/* DV51 KEY-FOB pricing · Auverne Garage (fictional). Stage 2 of 6 adds the lights-on state and the chosen column in the compare table and on the key ring.
   One dark theme, never the OS's.
   Layers: tokens → base → header → stage (intro + rig: car, leather pad, fobs, plan card) → compare → faq → states. */

:root {
  color-scheme: dark;
  /* primitive */
  --graphite-0: #09090b; --graphite-1: #0e0e11; --graphite-2: #141417; --graphite-3: #1c1c20; --graphite-4: #2a2a2f;
  --bone: #ece7df; --bone-2: #bdb7ae; --bone-3: #8a857e;
  --amber: #f2a649; --amber-2: #ffc477; --amber-deep: #c9781f;
  --chrome-hi: #fbfbfc; --chrome-mid: #9a9ba0; --chrome-lo: #4a4b50;
  /* semantic */
  --bg: var(--graphite-1); --surface: var(--graphite-2); --raised: var(--graphite-3);
  --ink: var(--bone); --ink-2: var(--bone-2); --ink-3: var(--bone-3);
  --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .16);
  --accent: var(--amber); --accent-ink: #1b1207; --accent-wash: rgba(242, 166, 73, .13);
  --focus: var(--amber-2);
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --hdr: 68px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.3, 1.35, .5, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--hdr) + 12px); }
body { margin: 0; font: 400 16px/1.5 var(--sans); background: var(--bg); overflow-x: clip; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, p { margin: 0; }
svg { display: block; }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ── header ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--hdr);
  display: flex; align-items: center; gap: 28px; padding: 0 clamp(16px, 4.4vw, 64px);
  background: rgba(17, 17, 20, .94); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: baseline; text-decoration: none; font-size: 22px; letter-spacing: -.01em; min-height: 44px; align-items: center; }
.brand-a { font-weight: 400; color: var(--ink); }
.brand-b { font-weight: 600; color: var(--ink-2); }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.nav a, .login {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px;
  font-size: 14px; color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer;
  transition: color .2s, background-color .2s;
}
.nav a:hover, .login:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.nav a[aria-current="page"] { color: var(--ink); }
.acct { display: flex; align-items: center; gap: 6px; }
.signup {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 99px;
  border: 1.5px solid var(--accent); color: var(--amber-2); font-size: 14px; font-weight: 500; text-decoration: none;
  background: rgba(242, 166, 73, .07); transition: background-color .2s, color .2s;
}
.signup:hover { background: var(--accent); color: var(--accent-ink); }

/* ── stage ──────────────────────────────────────────────────────────────── */
.stage {
  position: relative; overflow: clip;
  display: grid; grid-template-columns: minmax(300px, 34fr) 66fr; grid-template-rows: 1fr auto;
  grid-template-areas: "intro rig" "link rig";
  min-height: calc(100svh - var(--hdr));
  padding: 0 0 0 clamp(20px, 6.6vw, 112px);
  background:
    radial-gradient(60% 70% at 70% 30%, rgba(30, 30, 34, .55), transparent 70%),
    linear-gradient(#0b0b0d, #0b0b0d);
}
.intro { grid-area: intro; align-self: center; position: relative; z-index: 5; padding: 24px 0 0; }
h1 { font-family: var(--serif); font-weight: 400; color: #e4dfd7; line-height: .98; letter-spacing: -.005em; font-optical-sizing: auto; }
h1 .t1 { display: block; font-size: clamp(44px, 5.9vw, 100px); letter-spacing: .01em; }
h1 .t2 { display: block; font-size: clamp(42px, 5.5vw, 94px); font-weight: 300; color: #d9d3ca; margin-top: .02em; }

.billing { display: grid; grid-template-columns: auto auto; grid-template-areas: "btn side" "sw sw"; align-items: center; justify-content: start; column-gap: 22px; row-gap: 18px; margin-top: clamp(24px, 5vh, 52px); }
.engine { grid-area: btn; }

/* the ENGINE START/STOP button: knurled chrome ring, polished bezel, brushed cap, amber ring LED */
.engine {
  --d: clamp(108px, 10.4vw, 156px);
  position: relative; width: var(--d); height: var(--d); padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.engine:focus-visible { outline-offset: 6px; }

.to-compare {
  grid-area: link; align-self: end; justify-self: start; position: relative; z-index: 5; margin: 0 0 clamp(18px, 4vh, 40px);
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 99px;
  color: var(--ink-2); font-size: 14px; text-decoration: none; border: 1px solid var(--line); background: rgba(255, 255, 255, .02);
  transition: color .2s, border-color .2s;
}
.to-compare svg { width: 26px; height: 26px; fill: none; stroke: #c8c8cc; stroke-width: 2.4; stroke-linecap: round; }
.to-compare:hover { color: var(--ink); border-color: var(--line-2); }

/* ── rig: one coordinate system for car, pad, fobs and card (1cqw = 1% of the rig's width; height = 76cqw) ── */
.rig {
  grid-area: rig; position: relative; justify-self: end; align-self: end;
  width: min(100%, calc((100svh - var(--hdr)) * 1000 / 760)); aspect-ratio: 1000 / 760;
  container-type: inline-size;
}
.car {
  /* the car is the hero: ~72% of the rig wide, centred at 56%, wheels just behind the pad's far edge */
  --plate-w: calc(72cqw / var(--car-w));
  position: absolute; width: var(--plate-w); aspect-ratio: 21 / 9;
  left: calc(56cqw - var(--car-cx) * var(--plate-w));
  top: calc(33.5cqw - var(--car-floor) * var(--plate-w) * 9 / 21);
  /* fade the plate into the stage: an ellipse around the car, intersected with soft left/right edges */
  -webkit-mask-image: radial-gradient(56% 50% at calc(var(--car-cx) * 100%) 60%, #000 64%, transparent 100%), linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in;
          mask-image: radial-gradient(56% 50% at calc(var(--car-cx) * 100%) 60%, #000 64%, transparent 100%), linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
          mask-composite: intersect;
  pointer-events: none;
}
.car-plate { position: absolute; inset: 0; background-size: 100% 100%; }
.car-on, .car-flare, .pad-glow { will-change: opacity; }   /* image layers only (no text): kept composited so a flash never re-rasterises them */
.car-off { background-image: var(--car-off); }
.car-on { background-image: var(--car-on); opacity: 0; }
.lights-on .car-on { opacity: 1; }
.car-flare {
  position: absolute; inset: 0; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(18% 16% at calc(var(--lamp-x, .5) * 100%) calc(var(--lamp-y, .6) * 100%), rgba(255, 176, 80, .7), rgba(255, 150, 60, .18) 45%, transparent 75%);
}
.standin-tag {
  position: absolute; right: 2.5cqw; top: 1.5cqw; z-index: 2; padding: 5px 10px; border-radius: 8px;
  font-size: 11px; letter-spacing: .02em; color: var(--ink-3); border: 1px dashed rgba(255, 255, 255, .16);
}

.pad {
  position: absolute; left: 3cqw; top: 35cqw; width: 112cqw; height: 52cqw;
  transform: rotate(-3.5deg); transform-origin: 0 0;
  border-radius: 3.2cqw 0 0 0;
  background: var(--leather) 0 0 / var(--leather-size) repeat, #161414;
  box-shadow: 0 -2cqw 4cqw rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 2.5cqw 3cqw -2cqw rgba(255, 255, 255, .05);
}
.pad::before { /* soft studio light falling across the leather */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(70% 60% at 42% 18%, rgba(255, 255, 255, .07), transparent 70%), linear-gradient(transparent 60%, rgba(0, 0, 0, .45));
}
.pad-stitch {
  position: absolute; left: 2.1cqw; top: 2.1cqw; right: -2cqw; bottom: -2cqw; border-radius: 1.6cqw 0 0 0;
  border-left: 2px dashed rgba(201, 150, 96, .55); border-top: 2px dashed rgba(201, 150, 96, .55);
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .8));
}
.pad-glow { position: absolute; inset: 0; border-radius: inherit; opacity: 0; background: radial-gradient(40% 30% at 38% 4%, rgba(255, 168, 70, .28), transparent 70%); }
.lights-on .pad-glow { opacity: .55; }

/* fobs: a radio group. Each fob lies rotated on the pad; the image comes from assets.css, the engraving is live text */
.fobs { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fob {
  --L: 32cqw; --x: 50%; --y: 70%;
  position: absolute; left: var(--x); top: var(--y); width: calc(var(--L) * var(--fob-ar)); height: var(--L);
  margin: calc(var(--L) * -.5) 0 0 calc(var(--L) * var(--fob-ar) / -2);
  outline: none; -webkit-tap-highlight-color: transparent;
}
.fob[data-plan="drive"] { --x: 24%; --y: 63.5%; }
.fob[data-plan="grand"] { --x: 51%; --y: 72%; }
.fob[data-plan="signature"] { --x: 78%; --y: 80.5%; }
.fob-body {
  position: absolute; inset: 0; pointer-events: auto; cursor: pointer; touch-action: manipulation;
  border-radius: 40% / 18%;
  background-position: center; background-size: contain; background-repeat: no-repeat;
  transform: scale(1, .86) rotate(-125deg);
  transition: translate .35s var(--ease-out);
}
.fob-body::after { /* contact shadow for the SVG stand-ins (the photo sets carry their own) */
  content: ''; display: var(--fob-css-shadow); position: absolute; inset: 14% 13% 4%; z-index: -1; border-radius: 45% / 20%;
  box-shadow: 0 1.4cqw 2.2cqw rgba(0, 0, 0, .75), 0 .3cqw .5cqw rgba(0, 0, 0, .7);
  transition: box-shadow .35s var(--ease-out);
}
[data-finish="steel"] > .fob-body, .fob-body[data-finish="steel"] { background-image: var(--fob-steel); }
[data-finish="carbon"] > .fob-body, .fob-body[data-finish="carbon"] { background-image: var(--fob-carbon); }
[data-finish="chrome"] > .fob-body, .fob-body[data-finish="chrome"] { background-image: var(--fob-chrome); }
.fob[aria-checked="true"] .fob-body { translate: 0 -.7cqw; }
.fob[aria-checked="true"] .fob-body::after { box-shadow: 0 2.4cqw 3cqw rgba(0, 0, 0, .7), 0 .5cqw .8cqw rgba(0, 0, 0, .6); }
.fob:focus-visible .fob-body { outline: 2px solid var(--focus); outline-offset: .8cqw; }
.fob-led {
  display: var(--fob-led); position: absolute; left: 50%; top: 15.6%; width: 4%; aspect-ratio: 1; margin-left: -2%; border-radius: 50%;
  background: #3b2a16; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .7); transition: background-color .2s, box-shadow .2s;
}
.fob[aria-checked="true"] .fob-led { background: var(--amber-2); box-shadow: 0 0 .6cqw .2cqw rgba(255, 170, 70, .9); }
.fob-engrave {
  position: absolute; left: 50%; top: var(--engrave-y); width: 0; height: 0;
  display: grid; place-content: center; justify-items: center; white-space: nowrap; transform: rotate(90deg);
  font-family: var(--sans); line-height: 1.1; pointer-events: none;
}
.fob-name { font-size: calc(var(--L) * var(--engrave-name)); font-weight: 500; letter-spacing: .02em; }
.fob-price { font-size: calc(var(--L) * var(--engrave-price)); font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
[data-finish="steel"] .fob-engrave { color: #2a2b2f; text-shadow: 0 1px 0 rgba(255, 255, 255, .45); }
[data-finish="carbon"] .fob-engrave, [data-finish="chrome"] .fob-engrave { color: #d8d8dc; text-shadow: 0 -1px 0 rgba(0, 0, 0, .9); }

/* the plan card. On wide screens it opens in the intro column, over the headline, rising out of a clip line just above
   the ENGINE button, so the car, its headlights and the flash, the fobs and the engine all stay in view (round 2 rose it
   from the fob, and it covered the car). Phones, portrait tablets and short screens: a bottom sheet (below). */
.intro h1 { transition: opacity .3s var(--ease-out); }

/* ── compare ────────────────────────────────────────────────────────────── */
.compare {
  display: grid; grid-template-columns: minmax(260px, 30fr) 70fr; gap: clamp(24px, 4vw, 72px); align-items: center;
  padding: clamp(56px, 9vw, 120px) clamp(16px, 6.6vw, 112px); border-top: 1px solid var(--line);
  background: radial-gradient(50% 60% at 18% 40%, rgba(242, 166, 73, .06), transparent 70%), var(--bg);
}
.compare-ring { position: relative; width: min(100%, 340px); aspect-ratio: 1 / 1.25; justify-self: center; }
.ring { position: absolute; left: 50%; top: 2%; width: 38%; aspect-ratio: 1; margin-left: -19%; background: var(--keyring) center / contain no-repeat; z-index: 2; }
.hang { --r: 0deg; position: absolute; left: 50%; top: 24.5%; width: 30%; aspect-ratio: var(--fob-ar); margin-left: -15%; transform-origin: 50% 7.5%; transform: rotate(var(--r)); transition: transform .6s var(--ease-spring), filter .3s; }
.hang .fob-body { transform: none; pointer-events: none; }
.hang-drive { --r: 34deg; }
.hang-grand { --r: 0deg; z-index: 1; }
.hang-signature { --r: -34deg; }
.hang.is-sel { z-index: 3; }
.hang:not(.is-sel) { filter: brightness(.62); }
.compare h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4vw, 56px); line-height: 1.05; }
.compare-sub { margin-top: 10px; color: var(--ink-2); max-width: 60ch; }
.table-wrap { margin-top: 28px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.cmp { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 15px; }
.cmp col.c-feat { width: 31%; }
.cmp th, .cmp td { padding: 13px 16px; text-align: center; border-bottom: 1px solid var(--line); transition: background-color .3s; }
.cmp tbody tr:last-child > * { border-bottom: 0; }
.cmp tbody th { text-align: left; font-weight: 400; color: var(--ink-2); }
.cmp td { color: var(--ink); }
.cmp thead th { padding: 8px; vertical-align: bottom; }
.cmp .is-sel { background: var(--accent-wash); }
.col-btn {
  width: 100%; min-height: 64px; display: grid; gap: 2px; place-content: center; justify-items: center; padding: 8px 4px;
  border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.col-btn:hover { background: rgba(255, 255, 255, .04); }
.col-btn[aria-pressed="true"] { border-color: rgba(242, 166, 73, .55); }
.col-name { font-weight: 600; font-size: 15px; }
.col-price { font-variant-numeric: tabular-nums; color: var(--amber-2); font-size: 15px; }
.col-price small { color: var(--ink-3); font-size: 12px; }
.yes { width: 20px; height: 20px; margin: 0 auto; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.is-sel .yes { stroke: var(--amber-2); }
.no { color: var(--ink-3); }

/* ── faq + footer ───────────────────────────────────────────────────────── */
.faq { padding: clamp(40px, 7vw, 96px) clamp(16px, 6.6vw, 112px); max-width: 980px; }
.faq h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3vw, 40px); margin-bottom: 16px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 56px; display: flex; align-items: center; cursor: pointer; font-weight: 500; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; margin-left: auto; padding-left: 16px; color: var(--amber); font-size: 22px; font-weight: 300; }
.faq details[open] summary::after { content: '–'; }
.faq details:not([open]) > p { display: none; }
.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 70ch; }
.foot { padding: 28px clamp(16px, 6.6vw, 112px) 40px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13px; }

/* ── stacked layouts: portrait tablets and phones ───────────────────────── */
@media (max-aspect-ratio: 6/5) and (min-width: 720px), (max-width: 719.98px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto auto auto; grid-template-areas: "intro" "rig" "link"; min-height: 0; padding: 0; }
  .intro { padding: clamp(28px, 6vw, 64px) clamp(16px, 6vw, 64px) 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; }
  .billing { margin-top: 0; }
  .rig { width: 100%; justify-self: stretch; margin-top: -6cqw; }
  .pad { -webkit-mask-image: linear-gradient(#000 62%, transparent 82%); mask-image: linear-gradient(#000 62%, transparent 82%); }
  .to-compare { justify-self: center; margin: 4px 0 28px; }
  .compare { grid-template-columns: 1fr; }
  .compare-ring { width: min(64%, 260px); }
}
@media (max-width: 719.98px) {
  :root { --hdr: 56px; }
  .top { gap: 8px; padding: 0 8px; }
  .nav, .acct { display: none; }
  .brand { position: absolute; left: 50%; transform: translateX(-50%); font-size: 19px; }
  .intro { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 16px 0; gap: 0; }
  h1 .t1 { font-size: clamp(40px, 12.4vw, 60px); }
  h1 .t2 { font-size: clamp(38px, 11.6vw, 56px); }
  .billing { order: 3; }
  .rig { width: 100%; margin: -4cqw 0 0; }
  .fob { --L: 33cqw; }
  .fob[data-plan="drive"] { --x: 20%; }
  .fob[data-plan="signature"] { --x: 80%; }
  .stage { grid-template-areas: "intro" "rig" "bill" "link"; }
  .standin-tag { right: 14cqw; top: 9cqw; }
}

/* phone: billing sits under the fobs (moved by JS-free grid: the intro's billing block is shown here instead) */
@media (max-width: 719.98px) {
  .intro { display: contents; }
  .intro h1 { grid-area: intro; padding: 18px 16px 0; text-align: center; position: relative; z-index: 5; }
  .billing { grid-area: bill; justify-self: center; margin: -2cqw 16px 0; grid-template-columns: auto auto; grid-template-areas: "btn side" "btn sw"; column-gap: 16px; row-gap: 2px; position: relative; z-index: 5; }
  .engine { --d: 88px; }
  .to-compare { margin-top: 10px; }
  .compare { padding-top: 28px; }
  .compare-ring { display: none; }
  .compare h2 { font-size: 30px; }
  .table-wrap { margin-top: 18px; border-radius: 14px; }
  .cmp { font-size: 13px; }
  .cmp col.c-feat { width: 32%; }
  .cmp th, .cmp td { padding: 11px 6px; }
  .cmp tbody th { padding-left: 12px; }
  .cmp thead th { padding: 6px 2px; }
  .col-btn { min-height: 56px; padding: 6px 2px; }
  .col-name { font-size: 13px; line-height: 1.15; }
  .col-price { font-size: 13px; }
}

/* the card becomes a bottom sheet where there is no room above the fobs */
@media (min-width: 720px) and (max-aspect-ratio: 6/5) {
  .standin-tag { top: auto; bottom: 2cqw; }
}

/* short landscape screens: smaller headline and engine */
@media (min-aspect-ratio: 6/5) and (max-height: 640px) and (min-width: 720px) {
  h1 .t1 { font-size: clamp(34px, 5.6vh + 2vw, 72px); }
  h1 .t2 { font-size: clamp(32px, 5.2vh + 2vw, 68px); }
  .engine { --d: clamp(78px, 15vh, 120px); }
  .billing { margin-top: 18px; row-gap: 8px; }
  .to-compare { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
