/*
  Nordschleife Live, the website.

  Colours come from the app's Sage tokens (lib/theme/sage.dart), injected
  as custom properties by tool/website/build.mjs. Motion follows the app's
  Motion tokens (lib/theme/app_theme.dart): quick, calm, nothing bounces.
  Solid colours only; the few gradients are copies of the app's own
  (weather banner, HUD weather pill, Pro sky).
*/
@layer reset, base, components, sections, utilities;

@font-face { font-family: "Urbanist"; font-weight: 300; font-style: normal; font-display: swap; src: url("../fonts/urbanist-300.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/urbanist-500.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/urbanist-600.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/urbanist-700.woff2") format("woff2"); }
@font-face { font-family: "Urbanist"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/urbanist-800.woff2") format("woff2"); }

:root {
  --font: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --t-micro: 120ms;
  --t-fast: 180ms;
  --t-med: 280ms;
  --t-slow: 700ms;
  --ease-enter: cubic-bezier(.215, .61, .355, 1);
  --ease-exit: cubic-bezier(.55, .055, .675, .19);
  --ease-drift: cubic-bezier(.645, .045, .355, 1);
  --gutter: 20px;
  --panel-inset: 12px;
  --r-card: 28px;
  --r-img: 22px;
  --r-panel: 32px;
}
@media (min-width: 840px) {
  :root { --gutter: 32px; --r-panel: 40px; }
}

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, p, ul, ol, figure, fieldset, legend, table { margin: 0; padding: 0; }
  ul, ol { list-style: none; }
  fieldset { border: 0; min-width: 0; }
  img, svg { display: block; max-width: 100%; }
  button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
  a { color: inherit; text-decoration: none; }
  table { border-collapse: separate; border-spacing: 0; }
  em, i { font-style: normal; }
  b, strong { font-weight: 600; }
}

@layer base {
  html { scroll-padding-top: 96px; }
  @media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
  }
  body {
    background: var(--bg);
    color: var(--ink);
    font: 500 17px/1.55 var(--font);
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
  }
  :focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
  ::selection { background: var(--sage-soft); color: var(--ink); }

  .wrap { width: min(100% - 2 * var(--gutter), 1160px); margin-inline: auto; }
  .sprite { position: absolute; }

  .icon {
    width: 24px; height: 24px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
  }

  .eyebrow {
    font: 600 13px/18px var(--font);
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--sage-text);
  }
  .display, .title { font-weight: 600; text-wrap: balance; }
  .display { font-size: clamp(2.6rem, 1.5rem + 5vw, 4.9rem); line-height: 1.02; letter-spacing: -.028em; }
  .title { font-size: clamp(2rem, 1.3rem + 2.8vw, 3.3rem); line-height: 1.08; letter-spacing: -.022em; }
  .thin { display: block; font-weight: 300; color: var(--ink-soft); }
  .lede {
    font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.5;
    color: var(--ink-muted); max-width: 34em;
  }
  .fine { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
  .fine a, .footer-legal a, .legal a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  .center { text-align: center; }
}

@layer components {
  /* ── Buttons and pills ── */
  .btn, .store-btn, .chip, .icon-btn, .switch-row {
    transition: transform var(--t-fast) var(--ease-enter), background-color var(--t-fast), color var(--t-fast);
  }
  .btn:active, .store-btn:active, .chip:active, .switch-row:active { transform: scale(.97); transition-duration: var(--t-micro); }
  .icon-btn:active { transform: scale(.92); transition-duration: var(--t-micro); }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    height: 56px; padding: 0 28px; border-radius: 999px;
    font: 600 17px/1 var(--font); white-space: nowrap;
  }
  .btn-sm { height: 44px; padding: 0 18px; font-size: 15px; }
  .btn-primary { background: var(--sage-strong); color: var(--on-sage); }

  .icon-btn {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface2); color: var(--ink);
  }
  .icon-btn .icon { width: 20px; height: 20px; }
  .theme-icon-dark { display: var(--show-day); }
  .theme-icon-light { display: var(--show-night); }

  .store-row { display: flex; flex-wrap: wrap; gap: 12px; }
  .store-btn {
    display: inline-flex; align-items: center; gap: 12px;
    height: 60px; padding: 0 26px 0 20px; border-radius: 999px;
    background: var(--ink-fill); color: var(--on-ink-fill);
    font: 600 19px/1.15 var(--font); white-space: nowrap;
  }
  .store-btn small { display: block; font: 500 11px/1.3 var(--font); letter-spacing: .02em; opacity: .82; }
  .store-btn-light { background: var(--on-sage); color: var(--sage-text); }

  .chip {
    display: inline-flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    font: 600 15px/1 var(--font); color: var(--ink);
  }
  .chip .icon { width: 18px; height: 18px; }

  .pill {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    height: 28px; padding: 0 12px; border-radius: 999px;
    font: 600 13px/1 var(--font); white-space: nowrap;
  }
  .pill .icon { width: 14px; height: 14px; stroke-width: 2; }
  .pill-info { background: var(--info-soft); color: var(--info-text); }
  .pill-free { background: var(--sage-soft); color: var(--sage-text); }
  .pill-pro { background: var(--surface2); color: var(--ink); }

  /* ── Cards ── */
  .card {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-card); box-shadow: var(--shadow-card);
    padding: 16px;
  }
  .point-icon, .list-icon {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface2); color: var(--sage-text);
  }
  .point-icon .icon, .list-icon .icon { width: 22px; height: 22px; }

  /* ── Segmented control and switch ── */
  .segmented {
    display: inline-flex; height: 44px; padding: 4px; border-radius: 999px;
    background: var(--surface2);
  }
  .segmented label { position: relative; display: block; cursor: pointer; }
  .segmented input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .segmented span {
    display: grid; place-items: center; height: 36px; padding: 0 16px; border-radius: 999px;
    font: 600 15px/1 var(--font); color: var(--ink-muted);
    transition: background-color var(--t-fast), color var(--t-fast);
  }
  .segmented input:checked + span { background: var(--sage-strong); color: var(--on-sage); }
  .segmented input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

  /* ── Car picker: the six cars from above, each in its bay ── */
  .car-picks { display: flex; gap: 6px; }
  .car-picks label { position: relative; display: block; flex: none; cursor: pointer; }
  .car-picks input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  .car-picks span {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface2);
    transition: background-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--ease-enter);
  }
  .car-picks img { width: auto; height: 34px; transition: transform var(--t-fast) var(--ease-enter); }
  .car-picks label:hover img { transform: translateY(-2px); }
  .car-picks label:active span { transform: scale(.92); transition-duration: var(--t-micro); }
  .car-picks input:checked + span { background: var(--sage-soft); box-shadow: inset 0 0 0 2px var(--sage-strong); }
  .car-picks input:checked + span img { transform: scale(1.08); }
  .car-picks input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

  .switch-row {
    display: inline-flex; align-items: center; gap: 12px;
    height: 44px; padding: 0 6px 0 16px; border-radius: 999px;
    background: var(--surface2); font: 600 15px/1 var(--font);
  }
  .switch {
    position: relative; width: 52px; height: 32px; border-radius: 999px;
    background: var(--line); transition: background-color var(--t-fast);
  }
  .switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(26, 34, 43, .25);
    transition: transform var(--t-fast) var(--ease-enter);
  }
  [aria-checked="true"] > .switch { background: var(--danger-fill); }
  [aria-checked="true"] > .switch::after { transform: translateX(20px); }

  /* ── Pace-note tile (lib/ui/widgets/pace_note_strip.dart) ── */
  .tile {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 92px; height: 100px; padding: 10px 10px 17px; border-radius: 16px;
    color: var(--pace-ink); box-shadow: var(--shadow-float);
    transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  }
  .tile.is-light { color: #fff; }
  .t-g6 { background: var(--pace-g6); }
  .t-g5 { background: var(--pace-g5); }
  .t-g4 { background: var(--pace-g4); }
  .t-g3 { background: var(--pace-g3); }
  .t-g2 { background: var(--pace-g2); }
  .t-g1 { background: var(--pace-g1); }
  .t-flat { background: var(--pace-flat); }
  .t-square { background: var(--pace-square); }
  .t-hairpin { background: var(--pace-hairpin); }
  .t-elevation { background: var(--pace-elevation); color: var(--ink); }
  .t-surface { background: var(--pace-surface); color: var(--ink); }
  .t-track { background: var(--pace-track); color: var(--ink); }
  .arrow { flex: none; overflow: visible; }
  .arrow-body { fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
  .arrow-head { fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
  .glyph { flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  .glyph .dot { fill: currentColor; stroke: none; }
  .tile-num { font: 800 34px/1 var(--font); letter-spacing: -.5px; margin-top: 2px; }
  .tile-word { font: 700 14px/1 var(--font); margin-top: 3px; }
  .tile-pill {
    position: absolute; top: 87px; left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 999px;
    background: var(--pace-pill); color: #fff;
    font: 700 15px/1.25 var(--font); white-space: nowrap;
    transition: background-color var(--t-fast);
  }
  .tile-pill .icon { width: 15px; height: 15px; stroke-width: 2.2; }
  .tile-badge {
    position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--danger-fill); color: #fff; font: 800 13px/24px var(--font); text-align: center;
  }
  .is-brake > .tile {
    box-shadow:
      0 0 0 3px color-mix(in srgb, var(--danger) 55%, transparent),
      0 0 14px color-mix(in srgb, var(--danger) 45%, transparent);
  }
  .is-brake > .tile-pill { background: var(--danger-fill); }
  /* Digits that tick sit in fixed cells: Urbanist has no tabular figures. */
  .fig { display: inline-block; width: .56em; text-align: center; }
  .fig-sep { display: inline-block; width: .3em; text-align: center; }

  /* ── Header ── */
  .site-header {
    position: sticky; top: 0; z-index: 50;
    padding: var(--panel-inset) var(--gutter) 0; pointer-events: none;
  }
  .header-bar {
    pointer-events: auto;
    display: flex; align-items: center; gap: 8px;
    max-width: 1160px; height: 60px; margin-inline: auto; padding: 0 8px 0 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    box-shadow: var(--shadow-float);
  }
  .brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; border-radius: 999px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-name { font: 600 17px/1 var(--font); letter-spacing: -.01em; white-space: nowrap; }
  .brand-name b { font-weight: 700; color: var(--sage-text); }
  .site-nav { display: none; }
  @media (min-width: 960px) {
    .site-nav { display: flex; gap: 2px; margin-right: auto; }
    .site-nav a {
      padding: 10px 14px; border-radius: 999px;
      font: 600 15px/1 var(--font); color: var(--ink-muted);
      transition: background-color var(--t-fast), color var(--t-fast);
    }
    .site-nav a:hover { background: var(--surface2); color: var(--ink); }
  }
  @media (max-width: 420px) {
    .brand-name { font-size: 15px; }
    .header-bar .btn-sm { padding: 0 14px; }
  }

  /* ── Phone frame and driving HUD ── */
  .phone-wrap {
    --s: .8;
    position: relative; margin-inline: auto;
    width: calc(390px * var(--s)); height: calc(800px * var(--s));
  }
  /* On wide screens the phone is sized to the window's height, so the
     whole hero fits on the first screen. */
  @media (min-width: 900px) { .phone-wrap { --s: .6; } }
  @media (min-width: 900px) and (min-height: 820px) { .phone-wrap { --s: .72; } }
  @media (min-width: 900px) and (min-height: 900px) { .phone-wrap { --s: .8; } }
  @media (min-width: 1200px) and (min-height: 1000px) { .phone-wrap { --s: .9; } }
  .phone {
    position: absolute; top: 0; left: 0; width: 390px; height: 800px;
    transform: scale(var(--s)); transform-origin: 0 0;
    padding: 10px; border-radius: 56px; background: #12171C;
    box-shadow: 0 30px 64px -18px rgba(10, 14, 18, .42), inset 0 0 0 1px rgba(255, 255, 255, .08);
  }
  .phone-screen {
    position: relative; width: 370px; height: 780px; border-radius: 46px; overflow: hidden;
    background: var(--map-land); color: var(--ink); line-height: 1.2;
  }
  .phone-island {
    position: absolute; top: 22px; left: 50%; width: 96px; height: 28px; margin-left: -48px;
    border-radius: 999px; background: #12171C;
  }

  .hud-map, .hud-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  /* The canvas takes over from the still picture once the drive is running. */
  .hud-canvas { display: none; }
  .is-live .hud-canvas { display: block; }
  .is-live .hud-map, .is-live .hud-car, .is-live .hud-tag { display: none; }
  .hm-sky { fill: var(--info-soft); }
  .hm-hill-far { fill: var(--map-park); }
  .hm-hill-near { fill: var(--sage-soft); }
  .hm-land { fill: var(--map-land); }
  .hm-contour { fill: none; stroke: var(--map-contour); stroke-width: 1.5; }
  .hm-road-edge { fill: var(--road-edge); }
  .hm-road { fill: var(--road); }
  .hm-route { fill: var(--sage); transition: fill var(--t-med); }
  .is-lift .hm-route { fill: var(--amber); }
  .is-brake .hm-route { fill: var(--danger); }

  .hud-tag {
    position: absolute; top: 262px; right: 14px;
    transition: opacity var(--t-fast);
  }
  .hud-tag span {
    display: block; padding: 7px 10px 7px 11px; border-radius: 8px;
    border-left: 2px solid #84A487; background: #1A222B; color: #fff;
    font: 700 12px/1 var(--font); letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap;
  }
  .hud-tag::after {
    content: ""; display: block; width: 1.5px; height: 30px; margin-left: 26px; background: #84A487;
  }
  .hud-tag.is-swapping { opacity: 0; }
  .hud-car { position: absolute; left: 153px; top: 468px; width: 70px; height: auto; filter: drop-shadow(0 6px 8px rgba(10, 14, 18, .35)); }

  .hud-top { position: absolute; top: 58px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; }
  .hud-circle {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface); box-shadow: var(--shadow-float);
  }
  .hud-circle .icon { width: 22px; height: 22px; stroke-width: 1.9; }
  .hud-weather {
    display: flex; align-items: center; gap: 5px; height: 44px; margin-inline: auto; padding: 0 5px 0 12px;
    border-radius: 999px; color: #fff; font: 700 14px/1 var(--font); white-space: nowrap;
    background: linear-gradient(90deg, var(--banner-a), var(--banner-b));
  }
  .hud-weather .icon { width: 19px; height: 19px; stroke-width: 1.9; }
  .hud-weather b { font-size: 17px; font-weight: 700; }
  .hud-weather-rule { width: 1px; height: 18px; margin-inline: 2px; background: rgba(255, 255, 255, .4); }
  .hud-weather .hud-wind { width: 15px; height: 15px; transform: rotate(120deg); }
  .hud-weather em { padding: 8px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 12px; font-weight: 600; }

  .strip { position: absolute; top: 118px; left: 12px; right: 12px; height: 124px; }
  .strip-item {
    position: absolute; top: 10px; right: 0; width: 92px; transform-origin: 50% 0;
    transition: transform var(--t-med) var(--ease-enter), opacity var(--t-med) var(--ease-enter);
  }
  .slot--1 { transform: translateX(-220px) scale(.652); opacity: 0; }
  .slot-0 { transform: translateX(-136px); }
  .slot-1 { transform: translateX(-52px) scale(.652); }
  .slot-2 { transform: translateX(16px) scale(.652); }
  .slot-3 { transform: translateX(84px) scale(.652); opacity: 0; }

  .hud-bottom { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: flex-end; gap: 8px; }
  .hud-card {
    flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line);
    border-radius: 28px; box-shadow: var(--shadow-card);
  }
  .hud-card small { display: block; font: 500 12px/1.3 var(--font); color: var(--ink-muted); white-space: nowrap; }
  .hud-card b { display: block; font: 700 17px/1.2 var(--font); }
  .hud-warn { padding: 5px; }
  .hud-warn-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 4px 8px 10px; }
  .hud-warn-head .icon { width: 18px; height: 18px; color: var(--ink-muted); }
  .hud-brake { padding: 7px 11px 8px; border-radius: 20px; background: var(--sage-strong); color: var(--on-sage); }
  .hud-brake small { color: inherit; opacity: .9; }
  .hud-gauge { flex: none; width: 132px; display: grid; justify-items: center; gap: 4px; }
  .gauge-face {
    position: relative; width: 132px; height: 88px; overflow: hidden;
  }
  .gauge-face::before {
    content: ""; position: absolute; top: 0; left: 0; width: 132px; height: 132px; border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, #fff 34%, transparent);
  }
  .gauge-arc { position: absolute; top: 0; left: 0; width: 132px; height: 132px; transform: rotate(158.5deg); }
  .ga-track, .ga-fill { fill: none; stroke-width: 7; stroke-linecap: round; }
  .ga-track { stroke: var(--line); stroke-dasharray: 225.7px 400px; }
  .ga-fill { stroke: var(--sage-strong); stroke-dasharray: calc(225.7px * var(--v, .42)) 400px; transition: stroke var(--t-fast); }
  .is-lift .ga-fill { stroke: var(--amber); }
  .is-brake .ga-fill { stroke: var(--danger); }
  .gauge-speed { position: absolute; top: 27px; left: 0; right: 0; text-align: center; font: 700 37px/1 var(--font); letter-spacing: -1px; }
  .gauge-unit { position: absolute; top: 66px; left: 0; right: 0; text-align: center; font: 600 13px/1 var(--font); color: var(--ink-muted); }
  .gauge-cam {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 6px 6px 14px 14px;
    background: var(--surface); box-shadow: var(--shadow-float);
  }
  .gauge-cam .icon { width: 18px; height: 18px; stroke-width: 1.9; }
  .hud-lap { padding: 8px 12px 12px; }
  .hud-mini { width: 100%; height: 62px; margin-bottom: 4px; overflow: visible; }
  .mini-band { fill: none; stroke: color-mix(in srgb, var(--sage) 22%, transparent); stroke-width: 64; stroke-linejoin: round; }
  .mini-line { fill: none; stroke: var(--sage-strong); stroke-width: 22; stroke-linejoin: round; }
  .mini-dot { fill: var(--amber); stroke: var(--surface); stroke-width: 12; }
  .hud-time { font-size: 22px !important; letter-spacing: -.5px; white-space: nowrap; }
  .hud-edge {
    position: absolute; inset: 0; border-radius: 46px; pointer-events: none; opacity: 0;
    box-shadow: inset 0 0 46px 10px var(--danger);
    transition: opacity var(--t-fast);
  }
  .is-lift .hud-edge { box-shadow: inset 0 0 46px 10px var(--amber); opacity: .7; }
  .is-brake .hud-edge { opacity: .9; }

  /* ── Footer ── */
  .site-footer { padding: 56px 0 44px; }
  .footer-grid { display: grid; gap: 28px; }
  .footer-brand p { margin-top: 10px; color: var(--ink-muted); font-size: 15px; }
  .site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; font: 600 15px/1.4 var(--font); }
  .site-footer nav a:hover { color: var(--sage-text); }
  .footer-legal { display: grid; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); }
  .footer-legal p { font-size: 13px; line-height: 1.55; color: var(--ink-muted); max-width: 96ch; }
  .footer-legal b { color: var(--ink); }
  @media (min-width: 840px) {
    .footer-grid { grid-template-columns: 1fr auto; align-items: end; }
    .footer-legal { grid-column: 1 / -1; }
  }
}

@layer sections {
  .section { padding-block: clamp(72px, 9vw, 128px); }
  .section-tint {
    margin-inline: var(--panel-inset); border-radius: var(--r-panel);
    background: var(--sage-soft);
  }
  .section-tint .point-icon { background: var(--surface); }
  .section-head { display: grid; gap: 16px; max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
  .title + .lede, .eyebrow + .title { margin-top: 0; }

  /* ── Hero ── */
  .hero { margin-top: -72px; padding: var(--panel-inset) var(--panel-inset) 0; }
  .hero-card {
    position: relative; overflow: hidden; border-radius: var(--r-panel);
    background: var(--map-land);
    padding: 112px 0 48px;
  }
  .hero-topo { position: absolute; inset: 0; width: 100%; height: 100%; }
  .topo-park { fill: var(--map-park); }
  .topo-contour { fill: none; stroke: var(--map-contour); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
  .hero-track {
    position: absolute; left: 50%; bottom: 24px; width: 150%; max-width: 760px;
    transform: translateX(-50%); overflow: visible;
  }
  .track-road { fill: none; stroke: var(--map-road); stroke-width: 16; stroke-linejoin: round; }
  .track-line { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linejoin: round; }
  .start-ring { fill: var(--map-road); }
  .start-dot { fill: var(--sage); }
  @media (prefers-reduced-motion: no-preference) {
    .hero .track-line { stroke-dasharray: var(--track-len); animation: draw 1900ms var(--ease-drift) 250ms backwards; }
  }
  @keyframes draw { from { stroke-dashoffset: var(--track-len); } to { stroke-dashoffset: 0; } }

  .hero-grid { position: relative; display: grid; gap: 44px; }
  .hero-copy { display: grid; gap: 22px; justify-items: start; }
  .hero .lede { color: color-mix(in srgb, var(--ink) 84%, transparent); }
  .hero-facts { display: flex; flex-wrap: wrap; gap: 6px 20px; font: 600 15px/1.4 var(--font); color: color-mix(in srgb, var(--ink) 80%, transparent); }
  .hero-facts li { display: inline-flex; align-items: center; gap: 6px; }
  .hero-facts .icon { width: 18px; height: 18px; stroke-width: 2.2; color: var(--sage-text); }
  .hero-device { display: grid; gap: 14px; justify-items: center; }
  /* Two rows on one card: how the demo drives, and which car drives it. */
  .drive-controls {
    display: grid; gap: 6px;
    padding: 6px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-float);
  }
  .drive-row { display: flex; align-items: center; gap: 6px; }
  .drive-controls .car-picks { justify-content: space-between; }
  .drive-controls .segmented span { padding: 0 13px; }
  @media (max-width: 420px) { .drive-controls .segmented span { padding: 0 9px; } }
  .icon-btn[aria-pressed="true"] { background: var(--sage-strong); color: var(--on-sage); }
  .drive-note {
    max-width: 38em; padding: 6px 14px; border-radius: 16px; text-align: center; font-size: 14px; line-height: 1.45;
    background: var(--map-land); color: color-mix(in srgb, var(--ink) 78%, transparent);
  }
  .drive-note b { font-weight: 700; color: var(--ink); }
  .note-pro {
    display: inline-block; margin-left: 2px; padding: 2px 7px; border-radius: 999px; vertical-align: 1px;
    background: var(--surface); color: var(--ink); font: 700 11px/1.2 var(--font); font-style: normal;
  }
  .note-pro[hidden] { display: none; }
  @media (min-width: 900px) {
    .hero-card { padding: 100px 0 20px; }
    .hero-device { gap: 10px; }
    .hero-grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); align-items: center; gap: 32px; }
    .hero-copy { max-width: 520px; }
    .hero-track { left: auto; right: -7%; bottom: auto; top: 54%; width: 56%; max-width: 900px; transform: translateY(-50%); }
  }

  /* ── Before you leave ── */
  .trio { display: grid; gap: 16px; }
  @media (min-width: 900px) { .trio { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .trio .card { display: flex; flex-direction: column; }
  .trio h3 { margin: 22px 8px 6px; font: 600 22px/28px var(--font); letter-spacing: -.3px; }
  .trio .card > p { margin: 0 8px 10px; color: var(--ink-muted); font-size: 16px; line-height: 1.5; }
  .trio .card > .fine { margin-top: auto; padding-top: 4px; font-size: 13px; line-height: 18px; }
  .mock { display: grid; gap: 8px; align-content: start; min-height: 268px; padding: 10px; border-radius: var(--r-img); background: var(--surface2); }

  .status-hero { display: grid; gap: 6px; padding: 18px 20px 20px; border-radius: 20px; background: var(--sage-strong); color: var(--on-sage); }
  .status-hero small { font: 600 11px/14px var(--font); letter-spacing: .06em; text-transform: uppercase; opacity: .92; }
  .status-hero strong { font: 800 34px/1.1 var(--font); text-transform: uppercase; }
  .status-hero span { display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--font); }
  .status-hero .icon { width: 18px; height: 18px; stroke-width: 2; }
  .status-hero { transition: background-color var(--t-fast), color var(--t-fast); }
  .status-hero.is-closed { background: var(--danger-fill); color: var(--on-danger); }
  .week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .week label { position: relative; display: block; cursor: pointer; }
  .week input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
  .week label > span {
    display: grid; gap: 8px; justify-items: center; padding: 12px 0; border-radius: 14px; background: var(--surface);
    transition: background-color var(--t-fast), transform var(--t-fast) var(--ease-enter);
  }
  .week label:active > span { transform: scale(.94); }
  .week small { font: 600 11px/14px var(--font); color: var(--ink-muted); transition: color var(--t-fast); }
  .week i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
  .week .is-open i { background: var(--sage); }
  .week input:checked + span { background: var(--ink-fill); }
  .week input:checked + span small { color: var(--on-ink-fill); }
  .week input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
  .status-call { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--surface); font: 600 15px/1.2 var(--font); }
  .status-call .icon { width: 20px; height: 20px; color: var(--sage-text); }
  .status-call em { margin-left: auto; padding: 6px 12px; border-radius: 999px; background: var(--sage-soft); color: var(--sage-text); font: 700 12px/1 var(--font); }

  .banner {
    position: relative; overflow: hidden; display: grid; gap: 2px; justify-items: start;
    padding: 16px 20px 18px; border-radius: 20px; color: #fff; background: var(--banner-a);
  }
  /* The app's three banners, crossfading as the sky is switched. */
  .banner-bg { position: absolute; inset: 0; opacity: 0; transition: opacity var(--t-med) var(--ease-enter); }
  .bg-clear { background: linear-gradient(135deg, var(--banner-a), var(--banner-b)); }
  .bg-cloudy { background: linear-gradient(135deg, var(--banner-cloud-a), var(--banner-cloud-b)); }
  .bg-rain { background: linear-gradient(135deg, var(--banner-rain-a), var(--banner-rain-b)); }
  [data-sky="clear"] .bg-clear, [data-sky="cloudy"] .bg-cloudy, [data-sky="rain"] .bg-rain { opacity: 1; }
  .banner strong, .banner > span, .banner em { position: relative; }
  .banner strong { font: 700 56px/1 var(--font); letter-spacing: -1px; }
  .banner > span { font: 600 17px/1.3 var(--font); }
  .banner em { margin-top: 10px; padding: 7px 12px; border-radius: 999px; background: #fff; color: var(--banner-ink); font: 600 13px/1 var(--font); transition: color var(--t-med); }
  [data-sky="cloudy"] .banner em { color: var(--banner-cloud-ink); }
  [data-sky="rain"] .banner em { color: var(--banner-rain-ink); }
  .banner-art {
    position: absolute; top: -18px; right: -18px; width: 136px; height: 136px; opacity: 0;
    fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
    transform: scale(.9) rotate(-8deg); transition: opacity var(--t-med) var(--ease-enter), transform var(--t-slow) var(--ease-enter);
  }
  [data-sky="clear"] .art-clear, [data-sky="cloudy"] .art-cloudy, [data-sky="rain"] .art-rain { opacity: .18; transform: none; }
  .wx-pick { display: flex; background: var(--surface); }
  .wx-pick label { flex: 1; }
  .wx-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .wx-tiles li { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--surface); }
  .wx-tiles .icon { grid-row: span 2; width: 20px; height: 20px; color: var(--info); }
  .wx-tiles small { font: 600 11px/14px var(--font); color: var(--ink-muted); }
  .wx-tiles b { font: 700 15px/1.2 var(--font); }

  .cam { position: relative; overflow: hidden; border-radius: 20px; aspect-ratio: 2 / 1; }
  .cam-scene { width: 100%; height: 100%; }
  .cam-time, .cam-next { position: absolute; display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font: 700 12px/1 var(--font); }
  .cam-time { top: 8px; left: 8px; background: #1A222B; color: #fff; }
  .cam-next { right: 8px; bottom: 8px; padding-left: 6px; background: var(--surface); color: var(--ink); }
  .cam-next svg { width: 16px; height: 16px; transform: rotate(-90deg); }
  .ring-track, .ring-fill { fill: none; stroke-width: 3; }
  .ring-track { stroke: var(--line); }
  .ring-fill { stroke: var(--sage-strong); stroke-dasharray: 36 57; stroke-linecap: round; }
  .ring-fill { transition: stroke-dasharray 1s linear; }
  .cam.is-new .cam-scene { animation: cam-new 700ms var(--ease-enter); }
  @keyframes cam-new { from { opacity: .35; transform: scale(1.04); } }
  .cam-list { display: grid; gap: 8px; }
  .cam-list li { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--surface); font: 600 15px/1.2 var(--font); }
  .cam-list .icon { width: 20px; height: 20px; color: var(--sage-text); }
  .cam-list em { margin-left: auto; padding: 5px 9px; border-radius: 999px; background: var(--info-soft); color: var(--info-text); font: 700 12px/1 var(--font); }

  /* ── Pace notes ── */
  .notes-grid { display: grid; gap: 40px; }
  .notes-copy { display: grid; gap: 18px; align-content: start; }
  .points { display: grid; gap: 20px; margin-top: 14px; }
  .points li, .ghost { display: flex; gap: 14px; align-items: flex-start; }
  .points b, .ghost b, .quad b { display: block; font: 600 17px/24px var(--font); }
  .points p, .ghost p, .quad p { color: var(--ink-muted); font-size: 16px; line-height: 1.5; }
  @media (min-width: 960px) {
    .notes-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 468px); gap: 64px; align-items: center; }
  }

  .demo { display: grid; gap: 16px; }
  .demo-stage {
    position: relative; overflow: hidden; display: grid; justify-items: center; align-content: center; gap: 8px;
    min-height: 270px; padding: 30px 16px 22px; border-radius: var(--r-img); background: var(--map-land);
  }
  .demo-tile { position: relative; width: 92px; height: 112px; margin-bottom: 62px; transform: scale(1.5); transform-origin: 50% 0; }
  .demo-call {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px 10px 14px; border-radius: 999px;
    background: var(--surface); box-shadow: var(--shadow-float); font: 600 17px/1.2 var(--font);
  }
  .demo-call .icon { width: 20px; height: 20px; color: var(--sage-text); }
  .demo-call:has(.speak:not([hidden])) { padding: 6px 18px 6px 6px; }
  .speak {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
    background: var(--sage-strong); transition: transform var(--t-fast) var(--ease-enter);
  }
  .speak[hidden] { display: none; }
  .speak .icon { width: 18px; height: 18px; color: var(--on-sage); }
  .speak:active { transform: scale(.92); }
  .speak.is-speaking { animation: speaking 900ms var(--ease-drift) infinite; }
  @keyframes speaking { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--sage) 26%, transparent); } }
  .demo-edge {
    position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
    box-shadow: inset 0 0 40px 8px var(--danger);
  }
  .demo-stage.is-brake .demo-edge { opacity: .8; transition: opacity var(--t-fast); }
  .demo-stage.is-flash .demo-edge { animation: flash 340ms steps(1, end) 3; }
  @keyframes flash { 0% { opacity: .85; } 50% { opacity: 0; } 100% { opacity: .85; } }

  .scale legend { margin-bottom: 10px; font: 600 11px/14px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
  .scale-row { display: grid; grid-template-columns: repeat(8, 46px); justify-content: space-between; gap: 10px 4px; }
  @media (max-width: 500px) { .scale-row { grid-template-columns: repeat(4, 46px); justify-content: space-around; } }
  .scale-item { position: relative; display: block; width: 46px; height: 50px; cursor: pointer; }
  .scale-item input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
  .scale-item .tile { transform: scale(.5); transform-origin: 0 0; box-shadow: none; }
  .scale-item input:checked + .tile { box-shadow: 0 0 0 4px var(--surface), 0 0 0 8px var(--ink); }
  .scale-item input:focus-visible + .tile { outline: 4px solid var(--info); outline-offset: 10px; }
  .scale-row.is-left .arrow { transform: scaleX(-1); }
  .demo-options { display: flex; flex-wrap: wrap; gap: 8px; }

  .features { margin-top: clamp(48px, 7vw, 80px); }
  .features-title { margin-bottom: 20px; font: 600 22px/28px var(--font); letter-spacing: -.3px; }
  .feature-row { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 14px; }

  /* Every note of the lap in two rows that run past as the page scrolls. */
  .ribbon-block { margin-top: clamp(44px, 6vw, 76px); }
  .ribbon { display: grid; gap: 18px; overflow: clip; padding: 12px 0 6px; }
  .ribbon.is-static { overflow-x: auto; }
  .ribbon-row { display: flex; gap: 12px; width: max-content; padding-inline: var(--gutter); will-change: transform; }
  .ribbon-item { flex: none; width: 84px; display: grid; justify-items: center; gap: 8px; }
  .ribbon-item .tile { margin: 0 -9px -20px; transform: scale(.8); transform-origin: 50% 0; }
  .ribbon-item small {
    max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 600 11px/1.2 var(--font); color: var(--ink-muted);
  }

  /* ── One lap ── */
  .lap {
    position: relative; margin: 0 var(--panel-inset); border-radius: var(--r-panel);
    background: var(--bg); color: var(--ink); overflow: clip;
  }
  .lap .wrap { width: min(100% - 2 * var(--gutter), 1320px); }
  .lap-sticky { padding: 96px 0 40px; }
  .lap-grid { display: grid; gap: 20px; }
  .lap-copy { display: grid; gap: 14px; align-content: start; }
  .lap-lede { font-size: 17px; }
  .lap-hint { color: var(--lime); }
  .lap-now { display: flex; align-items: center; gap: 18px; margin-top: 6px; }
  .lap-tile { position: relative; flex: none; width: 92px; height: 100px; }
  .lap-tile .tile { transition: none; }
  .lap-km { font: 700 clamp(40px, 5.2vw, 64px)/1 var(--font); letter-spacing: -1px; }
  .lap-km small { margin-left: 6px; font: 600 17px/1 var(--font); letter-spacing: 0; color: var(--ink-muted); }
  .lap-name { margin-top: 6px; font: 600 20px/1.2 var(--font); color: var(--ink-muted); min-height: 1.2em; }
  .lap-cars { justify-self: start; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }

  .lap-map {
    position: relative; margin-inline: auto;
    width: min(100%, calc((100svh - 200px) * 1.234));
    aspect-ratio: 1060 / 858.9;
  }
  .lap-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
  .lap-edge { fill: none; stroke: var(--line); stroke-width: 26; stroke-linejoin: round; }
  .lap-road { fill: none; stroke: var(--surface2); stroke-width: 20; stroke-linejoin: round; }
  .lap-line { fill: none; stroke: var(--lime); stroke-width: 7; stroke-linejoin: round; stroke-linecap: butt; }
  .lap-car circle { fill: var(--lime); opacity: .2; }
  .no-js .lap-car { display: none; }

  .lap-pills { position: absolute; inset: 0; pointer-events: none; display: none; }
  .lap-pills li {
    position: absolute; left: var(--x); top: var(--y);
    display: grid; gap: 1px; padding: 6px 10px 7px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-float);
    font: 600 13px/1.2 var(--font); white-space: nowrap;
  }
  .lap-pills small { font: 600 11px/1.2 var(--font); color: var(--ink-muted); }
  .lap-pills .at-right { transform: translate(16px, -50%); }
  .lap-pills .at-left { transform: translate(calc(-100% - 16px), -50%); }
  .lap-pills .at-top { transform: translate(-50%, calc(-100% - 16px)); }
  .lap-pills .at-bottom { transform: translate(-50%, 16px); }
  @media (min-width: 760px) { .lap-pills { display: block; } }

  /* Scroll drives the lap once the script is running and motion is allowed. */
  .lap-live .lap { height: 380vh; }
  .lap-live .lap-sticky { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; }
  .lap-live .lap-pills li { opacity: 0; translate: 0 6px; transition: opacity var(--t-med) var(--ease-enter), translate var(--t-med) var(--ease-enter); }
  .lap-live .lap-pills li.is-on { opacity: 1; translate: 0 0; }
  .lap-live .lap-pills li { pointer-events: auto; cursor: pointer; }
  .lap-live .lap-pills li:hover { border-color: var(--sage); }
  .lap-live .lap-pills li:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
  @media (min-width: 960px) {
    .lap-grid { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 40px; align-items: center; }
    .lap-copy { gap: 18px; }
    /* Room for the labels round the outline, and for the header above. */
    .lap-map { width: min(100% - 190px, calc((100svh - 250px) * 1.234)); }
    .lap-live .lap-sticky { padding: 84px 0 20px; }
  }
  @media (max-width: 959px) {
    .lap-live .lap-lede { display: none; }
    .lap-live .lap-sticky { padding-top: 84px; }
    .lap-grid { gap: 20px; }
    .lap-map { width: min(100%, calc((100svh - 408px) * 1.234)); }
  }
  /* Between phone and desktop the labels are on, so the map leaves them
     room at both edges. */
  @media (min-width: 760px) and (max-width: 959px) {
    .lap-map { width: min(100% - 200px, calc((100svh - 408px) * 1.234)); }
  }
  /* On a phone the map is small, so the car is drawn larger on it. */
  @media (max-width: 759px) { .lap-car > * { transform: scale(1.6); } }

  /* ── Sim racing ── */
  .sim-grid { display: grid; gap: 32px; }
  .sim-grid > div { display: grid; gap: 18px; align-content: start; }
  .ghost { margin-top: 14px; padding: 20px; }
  .sims { padding: 4px 20px; }
  .sims details + details { border-top: 1px solid var(--line); }
  .sims summary { display: flex; align-items: center; gap: 14px; padding: 16px 0; cursor: pointer; list-style: none; border-radius: 8px; }
  .sims summary::-webkit-details-marker { display: none; }
  .list-text { display: grid; margin-right: auto; }
  .list-text b { font: 600 17px/22px var(--font); }
  .list-text span { font-size: 15px; line-height: 20px; color: var(--ink-muted); }
  .sims .chevron { width: 20px; height: 20px; color: var(--ink-muted); transition: transform var(--t-fast) var(--ease-enter); }
  .sims details[open] .chevron { transform: rotate(180deg); }
  .sim-body { display: grid; gap: 12px; padding: 0 0 18px 58px; }
  .sim-body p { color: var(--ink-muted); font-size: 16px; line-height: 1.5; }
  .sim-body dl { display: grid; gap: 6px; margin: 0; }
  .sim-body dl div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface2); font-size: 15px; line-height: 1.35; }
  .sim-body dt { color: var(--ink-muted); }
  .sim-body dd { margin: 0; font-weight: 600; }
  @media (prefers-reduced-motion: no-preference) {
    .sims details[open] .sim-body { animation: rise var(--t-med) var(--ease-enter); }
  }
  @media (min-width: 900px) { .sim-grid { grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; } }
  @media (max-width: 480px) {
    .sims .pill { display: none; }
    .sim-body { padding-left: 0; }
  }

  /* ── Garage ── */
  .garage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .car { position: relative; padding: 0; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
  .car label { display: block; padding: 10px; border-radius: inherit; cursor: pointer; }
  .car-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .plinth { display: grid; place-items: center; padding: 26px 10px 12px; border-radius: var(--r-img); background: var(--surface2); overflow: clip; transition: background-color var(--t-fast); }
  .plinth img { width: 100%; max-width: 330px; height: auto; will-change: transform; }
  .car-meta { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 14px 8px 8px; }
  .car-meta b { display: block; font: 600 17px/22px var(--font); }
  .car-sub { display: block; font-size: 14px; line-height: 19px; color: var(--ink-muted); }
  .car-on {
    position: absolute; top: 20px; left: 20px; display: none; align-items: center; gap: 5px;
    height: 28px; padding: 0 12px 0 8px; border-radius: 999px;
    background: var(--sage-strong); color: var(--on-sage); font: 600 13px/1 var(--font);
  }
  .car-on .icon { width: 15px; height: 15px; stroke-width: 2.4; }
  .car-input:checked ~ .car-on { display: inline-flex; }
  .car-input:checked ~ .plinth { background: var(--sage-soft); }
  .car:has(.car-input:checked) { border-color: var(--sage-strong); box-shadow: 0 0 0 1px var(--sage-strong), var(--shadow-card); }
  .car-input:focus-visible ~ .plinth { outline: 2px solid var(--ink); outline-offset: 2px; }
  .car label:active .plinth img { scale: .97; }
  @media (min-width: 840px) { .garage { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .car label { padding: 12px; } .car-on { top: 22px; left: 22px; } }
  /* After a pick in the garage: the way back up to see it drive. It rides
     the bottom of the window for as long as the garage is on screen. */
  .car-toast {
    position: sticky; bottom: 16px; z-index: 5;
    display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%;
    margin: 20px auto 0; padding: 6px 6px 6px 20px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-float);
    font: 500 15px/1.3 var(--font);
  }
  .car-toast[hidden] { display: none; }
  .car-toast b { font-weight: 700; }
  .car-toast .btn { flex: none; gap: 6px; padding: 0 14px 0 18px; background: var(--ink-fill); color: var(--on-ink-fill); }
  .car-toast .btn .icon { width: 18px; height: 18px; stroke-width: 2.2; }
  @media (prefers-reduced-motion: no-preference) {
    .car-toast { animation: toast-in var(--t-med) var(--ease-enter); }
  }
  @keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

  /* ── Pro ── */
  .pro-grid { display: grid; gap: 32px; }
  .pro-copy { display: grid; gap: 18px; align-content: start; }
  .sky { position: relative; overflow: hidden; border-radius: var(--r-card); aspect-ratio: 2 / 1; max-height: 250px; width: 100%; margin-bottom: 10px; }
  .sky svg { width: 100%; height: 100%; }
  .sky-a { stop-color: var(--sky-a); }
  .sky-b { stop-color: var(--sky-b); }
  .sky-halo { stop-color: var(--sky-orb); stop-opacity: .35; }
  .sky-halo-out { stop-color: var(--sky-orb); stop-opacity: 0; }
  .sky-orb { fill: var(--sky-orb); }
  .sky-hill-a { fill: var(--sky-hill-a); }
  .sky-hill-b { fill: var(--sky-hill-b); }
  .day-only { display: var(--show-day); }
  .night-only { display: var(--show-night); }
  g.night-only circle { fill: #fff; opacity: .8; }
  .pro-pill {
    position: absolute; left: 16px; bottom: 16px;
    display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 14px; border-radius: 999px;
    background: #5E7D62; color: #fff; font: 700 17px/1 var(--font);
    box-shadow: 0 4px 14px rgba(94, 125, 98, .35);
  }
  .pro-pill .icon { width: 20px; height: 20px; }
  .sky-toggle {
    position: absolute; top: 12px; right: 12px; height: 34px; padding: 0 14px; border-radius: 999px;
    background: var(--surface); color: var(--ink); font: 600 13px/34px var(--font);
    box-shadow: var(--shadow-float); transition: transform var(--t-fast) var(--ease-enter);
  }
  .sky-toggle:active { transform: scale(.95); }
  .sky-orb { transition: fill var(--t-med); }
  /* The one colour loop in the app, and so the one here. */
  @media (prefers-reduced-motion: no-preference) {
    .pro-pill { animation: pro-cycle 8s ease-in-out infinite; }
  }
  @keyframes pro-cycle {
    0%, 100% { background: #5E7D62; box-shadow: 0 4px 14px rgba(94, 125, 98, .35); }
    25% { background: #3F7F95; box-shadow: 0 4px 14px rgba(63, 127, 149, .35); }
    50% { background: #6B52A3; box-shadow: 0 4px 14px rgba(107, 82, 163, .35); }
    75% { background: #9A6A12; box-shadow: 0 4px 14px rgba(154, 106, 18, .35); }
  }
  .pro-terms { display: flex; align-items: center; gap: 8px; font: 600 15px/1.4 var(--font); color: var(--sage-text); }
  .pro-terms .icon { width: 18px; height: 18px; stroke-width: 2.2; }

  .compare { padding: 6px 10px 10px 20px; }
  .compare table { width: 100%; }
  .compare thead th { padding: 14px 0 12px; font: 600 11px/14px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); text-align: center; width: 64px; }
  .compare thead th:first-child { width: auto; text-align: left; }
  .compare tbody th { position: relative; height: 51px; padding: 6px 8px 6px 32px; font: 600 16px/1.25 var(--font); text-align: left; border-top: 1px solid var(--line); }
  .compare tbody th .icon { position: absolute; left: 0; top: 50%; margin-top: -10px; width: 20px; height: 20px; color: var(--sage); }
  .compare tbody td { text-align: center; border-top: 1px solid var(--line); }
  .compare tbody td { vertical-align: middle; }
  .compare tbody td .icon { display: inline-block; vertical-align: middle; width: 18px; height: 18px; stroke-width: 2.2; color: var(--ink-muted); }
  .compare .is-free th, .compare .is-free th .icon { color: var(--ink-muted); }
  .compare .dash { color: var(--ink-faint) !important; }
  .compare td:last-child { background: var(--sage-soft); border-top-color: transparent; }
  .compare tbody tr:first-child td:last-child { border-radius: 24px 24px 0 0; }
  .compare tbody tr:last-child td:last-child { border-radius: 0 0 24px 24px; }
  .tick { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--sage-strong); vertical-align: middle; }
  .tick .icon { width: 15px !important; height: 15px !important; stroke-width: 2.6 !important; color: var(--on-sage) !important; }
  @media (min-width: 960px) { .pro-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.02fr); gap: 64px; align-items: center; } }
  @media (max-width: 480px) {
    .compare { padding: 4px 8px 8px 16px; }
    .compare thead th { width: 52px; }
    .compare tbody th { font-size: 15px; }
  }

  /* ── Privacy ── */
  .quad { display: grid; gap: 12px; }
  .quad .card { display: grid; gap: 6px; align-content: start; padding: 20px; }
  .quad b { margin-top: 10px; }
  .quad + .fine { margin-top: 28px; font-size: 15px; line-height: 1.5; }
  @media (min-width: 620px) { .quad { grid-template-columns: 1fr 1fr; gap: 16px; } }
  @media (min-width: 1040px) { .quad { grid-template-columns: repeat(4, 1fr); } }

  /* ── FAQ ── */
  .faq-grid { display: grid; gap: 28px; }
  .faq-grid > header { display: grid; gap: 16px; align-content: start; }
  .faq { padding: 4px 22px; }
  .faq details + details { border-top: 1px solid var(--line); }
  .faq summary {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 19px 0; font: 600 17px/1.35 var(--font); cursor: pointer; list-style: none; border-radius: 8px;
  }
  .faq summary::-webkit-details-marker { display: none; }
  .faq summary .icon { width: 20px; height: 20px; color: var(--ink-muted); transition: transform var(--t-fast) var(--ease-enter); }
  .faq details[open] summary .icon { transform: rotate(180deg); }
  .faq details p { padding-bottom: 20px; max-width: 62ch; color: var(--ink-muted); font-size: 16px; line-height: 1.55; }
  @media (prefers-reduced-motion: no-preference) {
    .faq details[open] p { animation: rise var(--t-med) var(--ease-enter); }
  }
  @keyframes rise { from { opacity: 0; transform: translateY(-6px); } }
  @media (min-width: 900px) { .faq-grid { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 64px; } }

  /* ── Download ── */
  .section-cta { padding-bottom: 24px; }
  .cta {
    position: relative; overflow: hidden; display: grid; gap: 14px; justify-items: start;
    padding: clamp(40px, 7vw, 88px) clamp(24px, 6vw, 80px); border-radius: var(--r-panel);
    background: var(--sage-strong); color: var(--on-sage);
  }
  .cta p { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); margin-bottom: 14px; }
  .cta-flag { position: absolute; right: -24px; bottom: -40px; width: clamp(180px, 30vw, 320px); height: auto; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; opacity: .16; }
  .cta .store-row { position: relative; }

  /* ── Terms and Privacy pages ── */
  .legal { max-width: 780px; padding-block: 48px 24px; }
  .legal-head { display: grid; gap: 12px; margin-bottom: 32px; }
  .legal section { margin-bottom: 12px; padding: 22px 24px 24px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
  .legal h2 { margin-bottom: 10px; font: 600 20px/26px var(--font); letter-spacing: -.2px; }
  .legal section p, .legal section li { font-size: 16px; line-height: 1.6; color: color-mix(in srgb, var(--ink) 82%, transparent); }
  .legal section p + p, .legal section ul + p, .legal section p + ul { margin-top: 12px; }
  .legal section ul { padding-left: 20px; list-style: disc; display: grid; gap: 6px; }
  .legal .is-warning { background: var(--danger-soft); border-color: transparent; }
  .legal .is-warning h2 { color: var(--danger-text); }
  .legal .is-note { background: var(--sage-soft); border-color: transparent; }
  .legal > .fine { margin-top: 24px; }
}

@layer utilities {
  .sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .skip {
    position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px 18px; border-radius: 999px;
    background: var(--ink-fill); color: var(--on-ink-fill); font: 600 15px/1 var(--font);
    transform: translateY(-200%);
  }
  .skip:focus { transform: none; }
  .no-js .js-only { display: none !important; }

  /* Entrances: fade and rise 12px in a 35ms cascade, once. Armed by the
     script, so nothing is ever hidden without it. */
  .reveal-on [data-reveal] { opacity: 0; transform: translateY(12px); }
  .reveal-on [data-reveal].is-in {
    opacity: 1; transform: none;
    transition: opacity var(--t-med) var(--ease-enter) var(--d, 0ms), transform var(--t-med) var(--ease-enter) var(--d, 0ms);
  }

  /* Light and dark crossfade at the app's page speed. */
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }
}
