/* ATELIER — concept car AR preview */

.car-body {
  --accent: #dfe9ea;
  --accent-ink: #07100f;
  --ink: #06080a;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  background: #06080a;
}

#backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(105% 75% at 50% 8%, #1d252b 0%, #0c1114 42%, #06080a 78%),
    linear-gradient(180deg, #0a0f12 0%, #050708 100%);
}

#backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 50% 92%, rgba(120, 190, 200, 0.12), transparent 70%),
    radial-gradient(30% 26% at 82% 18%, rgba(255, 236, 210, 0.06), transparent 70%);
  mix-blend-mode: screen;
}

#stage {
  z-index: 1;
  pointer-events: auto;
}

#stage canvas {
  touch-action: none;
}

.car-body.ar-running #stage,
.car-body.ar-running #backdrop {
  display: none;
}

.car-body.ar-running #camerafeed {
  display: block;
}

/* -- top bar tuning ----------------------------------------------- */

.car-body .brand {
  letter-spacing: 0.34em;
}

.car-body .brand-mark svg {
  stroke: var(--accent);
}

.car-body .status {
  background: rgba(6, 10, 12, 0.34);
}

/* -- landing ------------------------------------------------------- */

.hero-sheet {
  justify-content: flex-end;
  background:
    linear-gradient(to top, rgba(4, 6, 8, 0.96) 0%, rgba(4, 6, 8, 0.72) 34%, rgba(4, 6, 8, 0) 74%);
  padding: 20px;
  padding-bottom: calc(22px + var(--safe-bottom));
}

.hero {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.car-title {
  font-size: clamp(40px, 12vw, 74px);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.035em;
  margin: 12px 0 14px;
  color: #f2f4f2;
}

.hero-copy {
  max-width: 44ch;
  font-size: 14px;
  color: rgba(246, 247, 245, 0.68);
}

.hero .kicker {
  color: #c9a86a;
  letter-spacing: 0.3em;
}

.hero-legal {
  margin-top: 16px;
  text-align: left;
  max-width: 46ch;
}

@media (min-width: 900px) {
  .hero-sheet {
    justify-content: center;
    align-items: flex-start;
    padding-left: clamp(40px, 7vw, 110px);
    background:
      linear-gradient(100deg, rgba(3, 5, 7, 0.93) 0%, rgba(3, 5, 7, 0.7) 40%, rgba(3, 5, 7, 0) 68%);
  }
  .hero {
    margin: 0;
    max-width: 520px;
    padding-bottom: 14vh;
  }
  .car-title {
    font-size: clamp(58px, 5.4vw, 84px);
  }
  .hero .actions {
    flex-direction: row;
    align-items: center;
  }
  .hero .actions .primary {
    flex: 0 0 auto;
  }
}

/* -- preview chrome ------------------------------------------------ */

#preview-controls,
#ar-controls {
  gap: 9px;
}

.car-body .swatches {
  height: 44px;
}

.car-body .legal {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.34);
}

.car-body .legal span:first-child::after {
  content: "·";
  margin-left: 10px;
}

/* -- scan sheet ---------------------------------------------------- */

.card.compact {
  padding: 18px;
}

.title.small {
  font-size: clamp(23px, 6vw, 30px);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

#scan-sheet .primary {
  height: 48px;
  font-size: 12px;
}

#scan-sheet .actions.row {
  gap: 10px;
}

#scan-sheet .actions.row .primary:first-child {
  flex: 1.35;
}

/* -- steps --------------------------------------------------------- */

.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 4px;
}

.steps li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.steps .kbd {
  margin-top: 1px;
  border-radius: 999px;
  color: var(--accent);
  border-color: rgba(223, 233, 234, 0.26);
}

/* -- device / qr --------------------------------------------------- */

.qr-wrap {
  display: grid;
  place-items: center;
  margin: 18px 0 6px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f2f2ee;
  width: fit-content;
  margin-inline: auto;
}

.qr-wrap canvas {
  width: 176px;
  height: 176px;
  image-rendering: pixelated;
}

/* -- ar assertions ------------------------------------------------- */

.car-body.ar-running #landing,
.car-body.ar-running #device-sheet {
  display: none !important;
}

body.ar-running .bottom {
  padding-bottom: 2px;
}

/* when scanning, controls stay hidden but legal remains */
.car-body.scanning #ar-controls {
  display: none;
}

/* subtle vignette over the camera feed for legibility */
.car-body.ar-running::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.42), transparent 22%),
    linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 30%);
}

/* keep chrome readable above the vignette */
.car-body.ar-running .chrome {
  z-index: 8;
}

.car-body.ar-running .reticle {
  z-index: 7;
}

/* desktop preview hint */
@media (pointer: fine) {
  .car-body:not(.ar-running) .drag-hint {
    display: flex;
  }
}

.drag-hint {
  position: fixed;
  right: 18px;
  bottom: 92px;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 12, 0.5);
  backdrop-filter: blur(12px);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}
