:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101311;
  color: #f4f6f4;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 75% 12%, rgba(153, 255, 87, 0.11), transparent 34%),
    linear-gradient(155deg, #151a16 0%, #0d0f0e 70%);
}

main {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.topbar {
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) clamp(20px, 4vw, 48px) 14px;
}

.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; letter-spacing: 0.04em; }

.brand-mark {
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
}

.format { color: #9aa39c; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; }

model-viewer {
  width: 100%;
  min-height: 52dvh;
  height: 100%;
  --poster-color: transparent;
  --progress-bar-color: #9dff57;
}

.ar-button {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: max-content;
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: #9dff57;
  color: #101311;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ar-button svg { width: 21px; height: 21px; fill: currentColor; }

.progress { position: absolute; left: 12%; right: 12%; bottom: 18px; height: 3px; overflow: hidden; border-radius: 3px; background: #303632; }
.progress-fill { width: 0; height: 100%; background: #9dff57; transition: width 180ms ease; }

.error {
  display: none;
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  width: min(88%, 440px);
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(25, 29, 26, 0.94);
  color: #d6dbd7;
  text-align: center;
  font-size: 0.86rem;
}

.error.visible { display: block; }

.info-panel {
  z-index: 2;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding: 22px clamp(20px, 4vw, 48px) max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 15, 13, 0.72);
  backdrop-filter: blur(16px);
}

.eyebrow { margin: 0 0 5px; color: #9dff57; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.15em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -0.055em; }
.instructions { margin: 10px 0 0; max-width: 560px; color: #9aa39c; font-size: 0.9rem; line-height: 1.45; }

.status { display: flex; align-items: center; flex: none; gap: 8px; color: #aeb6b0; font-size: 0.8rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #e2b84b; box-shadow: 0 0 10px currentColor; }
.status.ready .status-dot { background: #9dff57; }
.status.failed .status-dot { background: #ff766f; }

@media (max-width: 640px) {
  .info-panel { align-items: start; flex-direction: column; gap: 16px; }
  model-viewer { min-height: 56dvh; }
  .ar-button { bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .progress-fill { transition: none; }
}
