/* CarStats landing page (/app): flat midnight navy, Clarity City, no glows or gradients (Gate decisions,
   design/marketing/landing/copy.md). Only decoration: faint map contours and one real showcase route in the app's
   speed-band colours. Self-hosted font, no third-party requests. Dark only. */
@font-face { font-family: "Clarity City"; src: url("/fonts/ClarityCity-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Clarity City"; src: url("/fonts/ClarityCity-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Clarity City"; src: url("/fonts/ClarityCity-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --navy: #071430;
  --rule: #16264a;
  --sky: #5cc7fa;
  --fg: #f2f6fc;
  --fg-2: #b7c6dd;
  --fg-3: #8fa3c2;
  --font: "Clarity City", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: max(16px, env(safe-area-inset-left, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--navy); }
body { margin: 0; background: var(--navy); color: var(--fg); font: 400 17px/1.5 var(--font); }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--sky); outline-offset: 3px; border-radius: 6px; }
img, video { display: block; max-width: 100%; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: var(--gutter); }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 64px; position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1rem; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.top nav { display: flex; gap: 1.25rem; font-size: 0.9rem; }
.top nav a { color: var(--fg-3); text-decoration: none; }
.top nav a:hover { color: var(--fg); }

/* Hero: copy first, then the phone, which runs off the bottom edge of the section. */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero-map { position: absolute; inset: 0; pointer-events: none; }
.hero-map svg { position: absolute; overflow: visible; }
.hero-map .contours { left: -20%; top: 30%; width: 140%; height: auto; }
.hero-map .contours path { fill: none; stroke: var(--sky); stroke-opacity: 0.07; stroke-width: 1; vector-effect: non-scaling-stroke; }
/* Phones: beside the badge, rising towards the phone below. */
.hero-map .route { right: 3%; top: 238px; width: 58%; height: auto; }
.hero-map .route path { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.hero-map .route circle { fill: var(--navy); stroke: var(--fg); stroke-width: 2.5; vector-effect: non-scaling-stroke; }

.hero-grid { position: relative; display: grid; gap: 2.25rem; padding-top: 1.75rem; }
h1 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2.6rem, 1.55rem + 4.6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
}
h1 span { display: block; }
.accent { color: var(--sky); }
.lede { margin: 1rem 0 0; max-width: 30ch; color: var(--fg-2); font-size: 1.08rem; }

.cta { margin-top: 1.6rem; }
.store { display: inline-block; border-radius: 9px; }
.store img { height: 50px; width: auto; }
.free { margin: 0.6rem 0 0; color: var(--fg-3); font-size: 0.85rem; }

/* Phone: thin flat bezel drawn in CSS; the capture already contains its Dynamic Island. */
.hero-phone { --w: min(300px, 76vw); justify-self: center; height: calc(var(--w) * 1.62); }
.phone {
  width: var(--w);
  padding: calc(var(--w) * 0.03);
  border-radius: calc(var(--w) * 0.165);
  background: #0a0c10;
  border: 1.5px solid #4a5566;
}
.phone .screen { width: 100%; height: auto; aspect-ratio: 600 / 1304; border-radius: calc(var(--w) * 0.135); background: #13213a; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 900px) {
  .top { height: 76px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 4rem; padding-top: 4.5rem; }
  .hero-copy { padding-bottom: 6rem; }
  .lede { font-size: 1.2rem; }
  .hero-phone { --w: 340px; margin-right: 4%; height: calc(var(--w) * 1.66); }
  .hero-map .contours { left: 25%; top: 6%; width: 90%; }
  .hero-map .route { left: 27%; right: auto; top: auto; bottom: 8%; width: 66%; }
}

/* Desktop QR beside the badge (phones can't scan their own screen). */
.cta-row { display: flex; align-items: center; gap: 1.25rem; }
.qr { display: none; align-items: center; gap: 0.75rem; color: var(--fg-3); font-size: 0.85rem; line-height: 1.3; }
.qr img { width: 76px; height: 76px; padding: 5px; background: #fff; border-radius: 8px; }
@media (min-width: 900px) and (hover: hover) { .qr { display: flex; } }

/* Sections */
.section { padding-block: 4.5rem; border-bottom: 1px solid var(--rule); }
h2 {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2rem, 1.35rem + 2.9vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
h2 span { display: block; }
.desc { margin: 1rem 0 0; max-width: 34ch; color: var(--fg-2); font-size: 1.08rem; }
.split { display: grid; gap: 2.5rem; align-items: center; }

/* Small captions next to pictures: a short bold line, then the sentence. */
.note { margin: 0; max-width: 32ch; color: var(--fg-2); font-size: 0.95rem; border-top: 1px solid var(--rule); padding-top: 0.9rem; }
.note strong { display: block; color: var(--fg); font-weight: 600; margin-bottom: 0.2rem; }
.notes { display: grid; gap: 1.5rem; margin-top: 2rem; }

/* Pictures: phones reuse the hero frame; cards keep the app's own corners. */
.shot { --w: 240px; }
.shot .screen { width: 100%; height: auto; border-radius: calc(var(--w) * 0.135); }
.card { width: 100%; height: auto; border-radius: 12px; border: 1px solid #22355a; }
.card.widget { border-radius: 22px; }

/* 2 · Drives: the fuel card overlaps the phone's lower half. */
.drive-pic { position: relative; padding-bottom: 2rem; max-width: 460px; }
.drive-pic .shot { --w: min(240px, 60vw); }
.drive-pic .card { position: absolute; right: 0; bottom: 0; width: min(270px, 64vw); }

/* 3 · Costs: a swipeable row on phones, three phones side by side on desktop. */
.phones { display: flex; gap: 1.25rem; margin-top: 2.5rem; overflow-x: auto; scroll-snap-type: x mandatory;
  margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
.phones::-webkit-scrollbar { display: none; }
.phones figure { margin: 0; flex: none; scroll-snap-align: start; }
.phones .shot { --w: min(230px, 62vw); }
.phones figcaption { margin-top: 1rem; width: var(--w); }
.swipe { margin: 0.75rem 0 0; color: var(--fg-3); font-size: 0.8rem; }

/* 4 · Driving: the big smoothness card, then two short cards with their notes. */
.driving { display: grid; gap: 1.5rem; margin-top: 2.5rem; }
.driving figure { margin: 0; display: grid; gap: 1rem; }

/* 5 · At a glance */
.glance { display: grid; gap: 2.5rem; align-items: start; }
.glance .widgets { display: grid; gap: 1rem; max-width: 420px; margin-top: 2.5rem; }
.glance .shot { --w: min(240px, 62vw); }

/* 6 · Privacy: words only, set large. */
.privacy h2 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem); }
.privacy .desc { font-size: 1.2rem; max-width: 30ch; }

/* 7 · Also in CarStats: a plain list with rules, not cards. */
.label { margin: 0 0 1.25rem; color: var(--fg-3); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.also { list-style: none; margin: 0; padding: 0; display: grid; column-gap: 3rem; }
.also li { border-top: 1px solid var(--rule); padding: 1.1rem 0; color: var(--fg-2); }
.also strong { color: var(--fg); font-weight: 600; }

/* 8 · Close */
.close { padding-block: 5rem 4rem; }
.close .icon { width: 72px; height: 72px; border-radius: 16px; margin-bottom: 1.5rem; }
.close .cta-row { margin-top: 1.75rem; }
.safety { margin: 1.5rem 0 0; color: var(--fg-3); font-size: 0.9rem; }

footer { padding-block: 2rem 3rem; color: var(--fg-3); font-size: 0.85rem; }
footer nav { display: flex; gap: 1.25rem; margin-bottom: 1rem; }
footer nav a { color: var(--fg-2); text-decoration: none; }
footer nav a:hover { color: var(--fg); }
footer p { margin: 0.4rem 0 0; max-width: 60ch; }
footer .legal { font-size: 0.75rem; }

/* Sticky bar: phones only, once the hero badge has scrolled away, hidden again by the closing badge. */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom, 0px));
  background: #0b1a38; border-top: 1px solid #22355a;
  transform: translateY(110%); transition: transform 0.25s ease;
}
.bar.on { transform: none; }
.bar .brand img { width: 36px; height: 36px; border-radius: 9px; }
.bar .store img { height: 40px; }
@media (prefers-reduced-motion: reduce) { .bar { transition: none; } }

@media (min-width: 900px) {
  .bar { display: none; }
  .section { padding-block: 7rem; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5rem; }
  .split.flip > :first-child { order: 2; }
  .drive-pic .shot { --w: 270px; }
  .drive-pic .card { width: 300px; }
  .costs-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 5rem; align-items: end; }
  .phones { overflow: visible; margin-inline: 0; padding-inline: 0; justify-content: space-between; }
  .phones .shot { --w: 260px; }
  .phones figure:nth-child(2) { margin-top: 3rem; }
  .swipe { display: none; }
  .driving { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 3rem; align-items: start; }
  .driving .side { display: grid; gap: 2.5rem; }
  .glance { grid-template-columns: minmax(0, 1fr) auto; column-gap: 6rem; }
  .glance figure { margin-top: 0.5rem; }
  .section.privacy { padding-block: 5rem; }
  .glance .shot { --w: 260px; }
  .also { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .close { padding-block: 7rem 5rem; }
}
