/* Concept G · Final. Brand palette as tokens; colour only where it carries a timing meaning.
   Type: the phone's own system font (concept A), tabular digits everywhere. */
:root {
  --bg: #000; --panel: #141414; --field: #1c1c1c; --line: #2a2a2a;
  --text: #fff; --soft: #e6e6e6; --dim: #b5b5b5; --label: #8a8a8a;
  --green: #22d36b; --green-tint: #0e2a18; --red: #ff4d4d; --purple: #c77dff;
  --amber: #ffb020; --amber-tint: #3a2a00; --link: #8ab4ff;
  --font: -apple-system, "SF Pro Display", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 5vw, 88px);
  --ease: cubic-bezier(.23, 1, .32, 1); /* strong ease-out */
  --wrap: 1180px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; overflow-x: clip;
}
img { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
:focus-visible { outline: 2px solid var(--soft); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: rgba(255,255,255,.22); }
a, button { -webkit-tap-highlight-color: transparent; }
h2 { font-size: clamp(32px, 4.4vw, 60px); }
p { margin: 0; }
.kicker, .label { color: var(--label); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--text); color: #000; padding: 12px 16px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* The fixed 3D canvas and the pale glow that follows the phone */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; opacity: 0; transition: opacity .5s; }
#gl.ready { opacity: 1; }
.glow { display: none; }
/* A fixed-size glow that is moved and faded (transform/opacity only), never repainted per frame */
.gl .glow {
  display: block; position: fixed; left: 0; top: 0; width: 80vmax; height: 64vmax; z-index: 0; pointer-events: none;
  background: radial-gradient(40vmax 32vmax at 50% 50%, rgba(255,255,255,.1), rgba(255,255,255,.015) 55%, transparent 75%);
  transform: translate3d(calc(72vw - 40vmax), calc(55vh - 32vmax), 0); will-change: transform, opacity;
}
html:not(.gl) #gl { display: none; }
/* touch screens: size the canvas to the large viewport so the address bar never rescales the scene */
@media (pointer: coarse) { #gl { bottom: auto; height: 100lvh; } }
.gl .still { visibility: hidden; }
/* A slow connection: if the 3D has not drawn its first frame after a moment, the hero's still image stands in as a
   poster (the "poster" class is set by a timer in index.html), then fades out as the canvas fades in over it. On a
   normal connection the timer never fires, the poster never shows and the phone drops in. */
.gl .hero .still { opacity: 0; transition: opacity .4s ease-out, visibility 0s .4s; }
.gl.poster:not(.live) .hero .still { visibility: visible; opacity: 1; transition: opacity .4s ease-out; }
.slot { position: relative; }
.still { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent), linear-gradient(transparent, #000 10%, #000 90%, transparent); mask-composite: intersect; }
.bar, main, .foot { position: relative; z-index: 1; }

/* Header */
.bar { display: flex; align-items: center; gap: 16px; padding: 10px var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-weight: 600; }
.brand img { border-radius: 7px; }
.bar nav { margin-left: auto; display: flex; gap: 2px; align-items: center; }
.bar nav a { color: var(--label); font-size: 14px; min-height: 44px; padding: 0 10px; display: inline-flex; align-items: center; transition: color .2s, border-color .2s; }
.bar nav a.back { color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; margin-left: 8px; }
@media (max-width: 700px) { .bar nav a:not(.back) { display: none; } }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 24px;
  min-height: calc(100svh - 64px); max-width: 1440px; margin: 0 auto; padding: 24px var(--gutter) 48px;
}
.hero h1 { font-size: clamp(44px, 6.4vw, 96px); line-height: .98; letter-spacing: -0.045em; }
.hero h1 .ln { display: block; }
.hero h1 .dim { color: var(--label); }
.lead { color: var(--dim); font-size: clamp(17px, 1.5vw, 20px); max-width: 540px; margin-top: 24px; }
.hero-slot { height: min(72svh, 760px); }
.stores { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.store {
  display: grid; grid-template-columns: auto auto; column-gap: 14px; align-items: center; min-height: 56px; min-width: 228px;
  justify-content: space-between; padding: 8px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel);
  color: var(--soft); transition: border-color .25s, translate .3s var(--ease), scale .16s var(--ease);
}
.store small { grid-column: 1; font-size: 12px; color: var(--label); line-height: 1.1; }
.store strong { grid-column: 1; font-size: 18px; letter-spacing: -0.01em; line-height: 1.15; }
.store em { grid-column: 2; grid-row: 1 / 3; font-style: normal; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); background: var(--amber-tint); padding: 4px 8px; border-radius: 6px; }

/* Intro: copy rises in on load, alongside the phone's drop (60 ms stagger) */
.intro .hero h1 .ln, .intro .hero .lead, .intro .hero .stores { opacity: 0; translate: 0 12px; }
.hero h1 .ln, .hero .lead, .hero .stores { transition: opacity .6s var(--ease), translate .6s var(--ease); }
.hero h1 .ln + .ln { transition-delay: .06s; } .hero .lead { transition-delay: .12s; } .hero .stores { transition-delay: .18s; }

/* Kinetic band: a thin strip of dashboard figures */
.band { position: relative; overflow: hidden; border-block: 1px solid var(--line); padding: 12px 0; }
/* pause control for the moving band (WCAG 2.2.2): a small square at the right edge */
.band-toggle { position: absolute; right: 0; top: 0; bottom: 0; z-index: 1; width: 48px; min-height: 44px; border: 0; padding: 0; cursor: pointer; color: var(--label); background: linear-gradient(90deg, rgba(0,0,0,0), #000 40%); font: inherit; transition: color .2s ease; }
.band-toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 12px; translate: -50% -50%; border-inline: 3px solid currentColor; box-sizing: border-box; }
.band-toggle[aria-pressed="true"]::before { width: 0; height: 0; border-inline: 0; border-block: 6px solid transparent; border-left: 10px solid currentColor; translate: -35% -50%; }
.band-track.moving.paused { animation-play-state: paused; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.band-track { display: flex; width: max-content; gap: 40px; font-size: 14px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.band-track.moving { animation: band 60s linear infinite; }
.band i { font-style: normal; color: var(--label); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-right: 8px; }
.band b { font-weight: 600; } .band .g { color: var(--green); } .band .p { color: var(--purple); }
.band-track:not(.moving) { flex-wrap: wrap; width: auto; justify-content: center; padding: 0 var(--gutter); row-gap: 6px; }
@keyframes band { to { translate: -50% 0; } }

/* Drive: the wheel. Without the 3D scene it is an ordinary section with a still and a CSS exploded figure. */
.drive { position: relative; padding: 96px var(--gutter) 48px; }
.pin { position: relative; max-width: var(--wrap); margin: 0 auto; }
.wheel-slot { aspect-ratio: 4 / 3; max-width: 720px; margin: 0 auto 32px; }
.caps { display: grid; gap: 40px; max-width: 720px; margin: 0 auto; }
.ecaps .caps { margin-top: 40px; }
.center-slot, .push-slot { display: none; }
.cap h2 { font-size: clamp(30px, 3.6vw, 52px); margin: 10px 0 14px; }
.cap p:not(.kicker) { color: var(--dim); max-width: 560px; }
/* without 3D the four labels are one even row (or an even stack on phones), not ragged pills */
.labels { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin: 32px auto 0; max-width: 900px; }
.lbl {
  font: inherit; text-align: left; color: var(--soft); background: rgba(20,20,20,.86); border: 1px solid var(--line);
  border-radius: 14px; padding: 10px 16px; min-height: 44px; cursor: pointer; display: grid; gap: 2px;
  transition: border-color .2s, background-color .2s, opacity .2s var(--ease), color .2s, scale .16s var(--ease);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lbl b { font-size: 15px; font-weight: 600; letter-spacing: -0.005em; color: var(--text); }
.lbl span { font-size: 13px; color: var(--label); }
.lbl[aria-pressed="true"], .lbl.on { border-color: var(--soft); background: rgba(28,28,28,.94); }
.xfig { margin: 32px auto 0; max-width: 900px; padding: 4% 6%; }
.xscreen { position: relative; aspect-ratio: 2532 / 1170; container-type: inline-size; }
.xp { position: absolute; border-radius: 1.4cqw; background: url(screen-dashboard.png) no-repeat; box-shadow: 0 2cqw 5cqw rgba(0,0,0,.6); transition: opacity .35s, transform .45s var(--ease); }
.p-strip { left: 0; top: 0; width: 100%; height: 6.667%; background-size: 100% 1500%; background-position: 0 0; box-shadow: none; transform: translateY(-4cqw); }
.p-lap { left: .948%; top: 6.667%; width: 57.11%; height: 90%; background-size: 175.1% 111.1%; background-position: 2.21% 66.67%; transform: translateX(-4cqw); }
.p-pos { left: 59.95%; top: 6.667%; width: 15.4%; height: 23.08%; background-size: 649.2% 433.3%; background-position: 70.87% 8.667%; transform: translate(3cqw, -1cqw); }
.p-clock { left: 77.37%; top: 6.667%; width: 21.68%; height: 23.08%; background-size: 461.2% 433.3%; background-position: 98.79% 8.667%; transform: translate(5cqw, -1cqw); }
.p-gaps { left: 59.95%; top: 33.85%; width: 39.1%; height: 62.82%; background-size: 255.8% 159.2%; background-position: 98.44% 91.03%; transform: translate(4cqw, 1cqw); }
.xfig[data-focus] .xp { opacity: .3; }
.xfig[data-focus="strip"] .p-strip, .xfig[data-focus="lap"] .p-lap, .xfig[data-focus="race"] :is(.p-pos, .p-clock), .xfig[data-focus="gaps"] .p-gaps { opacity: 1; }

/* With the 3D scene: one long pinned section, captions cross-fade per step */
.gl .drive { height: 642vh; padding: 0; } /* the pin scrolls 542vh, the length of story.js's timeline (T.END) at the same pace as before */
.gl .pin { position: sticky; top: 0; height: 100vh; height: 100svh; max-width: none; overflow: hidden; }
.gl .xfig { display: none; }
/* how far through the pinned story you are: a hairline along the bottom edge; and a way past it */
.progress, .skip-story { display: none; }
.gl .skip-story { display: inline-flex; align-items: center; position: absolute; right: var(--gutter); top: 12px; z-index: 4; min-height: 44px; padding: 0 4px; color: var(--label); font-size: 13px; transition: color .2s; }
.gl .skip-story::after { content: ""; width: 6px; height: 6px; margin: -3px 2px 0 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; rotate: 45deg; }
.gl .progress { display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 4; background: var(--line); }
.gl .progress i { display: block; height: 100%; background: var(--label); transform-origin: 0 50%; transform: scaleX(0); }
.gl .wheel-slot { position: absolute; left: 38%; right: 3%; top: 8%; bottom: 8%; max-width: none; margin: 0; aspect-ratio: auto; }
.gl .side { position: absolute; left: var(--gutter); top: 0; bottom: 0; width: min(440px, 34vw); display: flex; flex-direction: column; justify-content: center; z-index: 2; transition: opacity .45s, visibility 0s; }
.gl .pin.panels .side { opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.gl .caps { display: grid; gap: 0; margin: 0; }
.gl .cap { grid-area: 1 / 1; align-self: end; opacity: 0; translate: 0 8px; filter: blur(2px); visibility: hidden; transition: opacity .18s var(--ease), filter .18s var(--ease), translate .18s var(--ease), visibility 0s .18s; }
.gl .cap.on { opacity: 1; translate: 0 0; filter: none; visibility: visible; transition: opacity .3s .12s var(--ease), filter .3s .12s var(--ease), translate .4s .12s var(--ease), visibility 0s; }
/* Panels part (concept E): the wheel in the middle, the caption centred under it, labels below */
.gl .center-slot { display: block; position: absolute; left: var(--gutter); right: var(--gutter); top: 72px; bottom: 30%; }
.gl .push-slot { display: block; position: absolute; left: 50%; top: 34%; width: min(50vw, 72vh); aspect-ratio: 16 / 9; translate: -50% -50%; }
.gl .ecaps { position: absolute; left: 50%; bottom: max(24px, 4vh); width: min(760px, calc(100% - 2 * var(--gutter))); translate: -50% 0; z-index: 2; text-align: center; }
.gl .ecaps .cap p:not(.kicker) { margin-inline: auto; max-width: 620px; }
.gl .ecaps .cap h2 { font-size: clamp(30px, 3.6vw, 52px); }
.chips { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.gl .ecaps .chips { justify-content: center; }
.chips li { font-size: 13px; color: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; }
@media (max-height: 820px) { .gl .ecaps .chips { display: none; } }
.gl .labels { position: absolute; inset: 0; margin: 0; max-width: none; display: block; pointer-events: none; z-index: 3; }
.gl .lbl { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; pointer-events: none; }
.gl .pin.exploded .lbl, .gl .lbl:focus-visible { opacity: 1; pointer-events: auto; }
.gl .pin.exploded.dimmed .lbl:not(.on):not(:focus-visible) { opacity: .55; }
.gl .lbl { background: #141414; -webkit-backdrop-filter: none; backdrop-filter: none; transition: border-color .2s, background-color .2s, opacity .2s var(--ease), scale .16s var(--ease); }
/* a dark floor under the centred captions so the pushed-in wheel never sits behind the text */
.gl .pin::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 40%; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .5s; background: linear-gradient(rgba(0,0,0,0), #000 42%); }
.gl .pin.panels::after { opacity: 1; }

@media (max-width: 899px), (max-aspect-ratio: 23/20) {
  .gl .wheel-slot { left: 0; right: 0; top: 60px; bottom: auto; height: calc(100svh - 300px); }
  .gl .side { left: var(--gutter); right: var(--gutter); width: auto; top: auto; bottom: 0; padding-bottom: max(20px, 3svh); justify-content: flex-end; }
  .gl .cap h2, .gl .ecaps .cap h2 { font-size: clamp(24px, 6.4vw, 36px); margin: 6px 0 8px; }
  .gl .center-slot { top: 60px; bottom: 300px; }
  .gl .cap p:not(.kicker) { font-size: 15px; line-height: 1.45; }
  .gl .push-slot { top: 60px; bottom: 300px; left: var(--gutter); width: auto; right: var(--gutter); aspect-ratio: auto; translate: none; }
  /* floating label cards are left out on narrow screens (only shown to keyboard focus) */
  .gl .pin.exploded .lbl:not(:focus-visible), .gl .pin.exploded.dimmed .lbl:not(.on):not(:focus-visible) { opacity: 0; pointer-events: none; }
  .gl .pin::after { height: 24%; }
  .gl .ecaps { bottom: max(16px, 2.5svh); }
  .gl .lbl span { display: none; }
  .gl .ecaps .chips { display: none; }
  .gl .lbl { padding: 6px 12px; align-content: center; }
}
@media (max-height: 700px) and (max-width: 899px) {
  .gl .cap p:not(.kicker) { display: none; }
  .gl .wheel-slot { height: calc(100svh - 200px); }
  .gl .center-slot { bottom: 200px; }
  .gl .push-slot { bottom: 200px; }
}

/* History */
.history {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 64px); align-items: center;
  max-width: 1440px; min-height: 100svh; margin: 0 auto; padding: clamp(80px, 12vh, 140px) var(--gutter);
}
.h-copy h2 { margin: 12px 0 18px; }
.h-copy > p:not(.kicker) { color: var(--dim); max-width: 520px; }
.figs { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); justify-content: start; gap: 12px 28px; margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); }
.figs dt { color: var(--label); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.figs dd { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.figs dd.p { color: var(--purple); }
.figs dd.n { font-size: 13px; font-weight: 400; color: var(--label); letter-spacing: 0; }
.history-slot { aspect-ratio: 16 / 10; }
@media (max-width: 899px) {
  .history { grid-template-columns: 1fr; min-height: 0; }
  .history-slot { order: -1; }
  .figs { grid-template-columns: repeat(2, minmax(0, auto)); }
}

/* Privacy: concept A's three notes */
.wrap { max-width: var(--wrap); margin-inline: auto; }
.private {
  margin-top: 40px; padding: 48px; background: var(--panel); border-radius: 24px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; width: calc(100% - 2 * var(--gutter));
}
.private h3 { margin: 8px 0 6px; font-size: 19px; letter-spacing: -0.01em; line-height: 1.25; }
.private p { color: var(--dim); font-size: 15px; }
@media (max-width: 760px) { .private { grid-template-columns: 1fr; padding: 28px; gap: 28px; } }

/* Call to action and footer */
.cta { text-align: center; padding: clamp(96px, 16vh, 160px) var(--gutter) clamp(80px, 12vh, 120px); }
.cta img { width: 88px; height: 88px; border-radius: 20px; margin-bottom: 20px; }
.cta h2 { font-size: clamp(36px, 5.6vw, 76px); }
.cta p { color: var(--dim); margin-top: 14px; }
.cta .stores { justify-content: center; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; border-top: 1px solid var(--line); padding: 20px var(--gutter) 32px; color: var(--label); font-size: 14px; }
.foot nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.foot nav a { color: var(--label); padding: 0 8px; min-height: 44px; display: inline-flex; align-items: center; transition: color .2s; }

/* Reveals (translate, so hover transforms stay free) */
.js .rv { opacity: 0; translate: 0 12px; transition: opacity .5s var(--ease), translate .6s var(--ease); }
.js .rv.in { opacity: 1; translate: 0 0; }
.js .private .rv:nth-child(2) { transition-delay: .08s; } .js .private .rv:nth-child(3) { transition-delay: .16s; }

@media (hover: hover) and (pointer: fine) {
  .bar nav a:hover, .foot nav a:hover, .skip-story:hover { color: var(--text); }
  .bar nav a.back:hover { border-color: #5a5a5a; }
  .store[href]:hover { border-color: #444; translate: 0 -2px; }
  .lbl:hover { border-color: #5a5a5a; }
  .band:hover .band-track { animation-play-state: paused; }
  .band-toggle:hover { color: var(--text); }
}

/* Narrow screens */
@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; gap: 0; min-height: 0; padding-top: 8px; padding-bottom: 16px; }
  .hero h1 { font-size: clamp(32px, 9.4vw, 44px); }
  .lead { font-size: 16px; margin-top: 14px; }
  .hero-slot { height: max(220px, calc(100svh - 410px)); margin-top: 10px; }
  .stores { margin-top: 18px; gap: 8px; flex-wrap: nowrap; }
  .store { flex: 1 1 0; min-width: 0; grid-template-columns: 1fr; padding: 8px 12px; min-height: 64px; }
  .store em { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 4px; font-size: 12px; padding: 2px 6px; }
  /* the figure band moves below the history so the phone never crosses it on its way to the wheel */
  main { display: flex; flex-direction: column; }
  #top, #drive, #history, .band, #start { width: 100%; }
  #top { order: 0; } #drive { order: 1; } #history { order: 2; } .band { order: 3; margin-top: 8px; } #privacy { order: 4; } #start { order: 5; }
  .history-slot { margin-inline: calc(-1 * var(--gutter)); }
}

/* Press feedback on tappable cards and buttons */
.lbl:active, .store[href]:active { scale: .97; }

/* Reduced motion: no movement, but keep short fades so changes stay easy to follow */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: opacity .2s ease-out !important; scroll-behavior: auto !important; translate: none !important; }
  .lbl:active, .store[href]:active { scale: none; }
}
