/* ParkGuard — homepage only (the other pages still use styles.css).
 *
 * Colours, radii and the two easing curves are the app's own
 * (ParkGuard/Utilities/DesignSystem.swift). Motion follows a few rules:
 *   - enter with a strong ease-out, move with ease-in-out, exit faster than enter
 *   - only transform, opacity and filter are animated
 *   - things you touch answer within 160ms; nothing starts from scale(0)
 *   - hover effects only on devices that can hover
 *   - prefers-reduced-motion keeps the fades and drops the movement
 * Written mobile first; the desktop layout is the media query, not the default. */

:root {
  --canvas: #F5F3EF;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --ink: #12141A;
  --ink-2: #5B6068;
  --ink-3: #8A9099;
  --hairline: #E6E2DB;
  --brand: #0E6F5C;
  --brand-ink: #0B5A4A;
  --brand-soft: #E2F0EC;
  --safe: #0FA97F;
  --caution: #E08A0B;
  --danger: #E23D33;
  --store-bg: #111317;
  --store-fg: #FFFFFF;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);

  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", sans-serif;

  --gutter: 20px;
  --maxw: 1120px;
  --nav-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0B0C0F;
    --surface: #16181D;
    --surface-2: #121419;
    --ink: #F2F1EE;
    --ink-2: #A1A7B0;
    --ink-3: #6F7682;
    --hairline: #262A31;
    --brand: #2ED3A7;
    --brand-ink: #55E0BC;
    --brand-soft: #12302A;
    --store-bg: #FFFFFF;
    --store-fg: #111317;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 17px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
a { color: var(--brand); }
h1, h2, h3 {
  font-family: var(--font-display); font-weight: 800; margin: 0;
  letter-spacing: -.025em; line-height: 1.04; text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 3px; border-radius: 10px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.eyebrow {
  font: 800 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); margin-bottom: 14px;
}
.h2 { font-size: clamp(32px, 7.4vw, 52px); }
.lede { font-size: 18px; color: var(--ink-2); max-width: 36ch; margin-top: 16px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- App Store button ---------- */
.store {
  display: inline-flex; align-items: center; gap: 11px; min-height: 54px;
  padding: 9px 22px 9px 16px; border-radius: 14px;
  background: var(--store-bg); color: var(--store-fg); text-decoration: none;
  transition: transform .16s var(--ease-out), opacity .2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.store:active { transform: scale(.97); }
.store svg { width: 26px; height: 26px; flex: none; }
.store__t { display: flex; flex-direction: column; line-height: 1.1; }
.store__s { font-size: 11.5px; opacity: .8; }
.store__b { font: 800 21px/1.1 var(--font-display); letter-spacing: -.01em; }
@media (hover: hover) and (pointer: fine) { .store:hover { opacity: .88; } }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent; transition: border-color .2s var(--ease-out);
}
.nav.is-stuck { border-bottom-color: var(--hairline); }
.nav__in { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 800 18px/1 var(--font-display); letter-spacing: -.02em; }
.brand svg { width: 28px; height: 28px; }
.nav__links { display: none; gap: 26px; margin-left: auto; }
.nav__links a { color: var(--ink-2); text-decoration: none; font-size: 15px; font-weight: 500; }
.nav__cta {
  margin-left: auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border-radius: 999px; background: var(--brand); color: #fff; text-decoration: none;
  font: 800 14.5px/1 var(--font-display); transition: transform .16s var(--ease-out);
}
@media (prefers-color-scheme: dark) { .nav__cta { color: #06231C; } }
.nav__cta:active { transform: scale(.97); }
@media (min-width: 880px) {
  .nav__links { display: flex; }
  .nav__cta { margin-left: 8px; }
}
@media (hover: hover) and (pointer: fine) { .nav__links a:hover { color: var(--ink); } }

/* ---------- device ---------- */
/* Screen rect from the artwork: 804x1748 at (38, 42) on an 880x1832 canvas. */
.device { position: relative; aspect-ratio: 880 / 1832; container-type: inline-size; }
.device__screen {
  position: absolute; left: 4.318%; top: 2.293%; width: 91.364%; height: 95.415%;
  border-radius: 7.09% / 3.26%; overflow: hidden; background: #F2F0EC;
}
.device__screen > img, .device__screen > video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.device::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url(assets/iphone-frame.svg) center / contain no-repeat;
}
.device--shadow { filter: drop-shadow(0 22px 40px rgba(0, 0, 0, .22)); }

/* An iOS-style notification, sized off the phone it sits on (cqw = 1% of device width). */
.notif {
  position: absolute; z-index: 3; left: 7%; right: 7%; top: 7.2%;
  display: grid; grid-template-columns: auto 1fr; gap: 0 3.4cqw; align-items: start;
  padding: 3.6cqw 4cqw; border-radius: 6.4cqw;
  background: rgba(246, 246, 248, .86); color: #111;
  backdrop-filter: blur(14px) saturate(160%); -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 2cqw 6cqw rgba(0, 0, 0, .16);
  font-family: var(--font-body); font-size: 3.55cqw; line-height: 1.3;
  opacity: 0; transform: translateY(-5cqw) scale(.97); filter: blur(2px);
  transition: opacity .18s ease-in, transform .18s ease-in, filter .18s ease-in;
}
.notif.is-on {
  opacity: 1; transform: none; filter: none;
  transition: opacity .32s var(--ease-out) .12s, transform .42s var(--ease-out) .12s, filter .32s var(--ease-out) .12s;
}
.notif__icon { width: 9cqw; height: 9cqw; border-radius: 2.1cqw; grid-row: span 2; }
.notif__top { display: flex; justify-content: space-between; gap: 2cqw; }
.notif__title { font-weight: 650; }
.notif__time { color: #777; font-size: 3.1cqw; }
.notif__body { grid-column: 2; }

/* ---------- hero ---------- */
.hero { padding: 28px 0 8px; overflow: clip; }
.hero__grid { display: grid; gap: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px;
  border-radius: 999px; background: var(--brand-soft); color: var(--brand);
  font: 800 12.5px/1 var(--font-display); letter-spacing: .02em;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.hero h1 { font-size: clamp(40px, 10.6vw, 72px); }
.hero h1 span { color: var(--brand); display: block; }
.hero .lede { font-size: 18.5px; max-width: 34ch; }
.hero__cta { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.hero__note { font-size: 14px; color: var(--ink-3); }
.hero__stage { position: relative; display: flex; justify-content: center; padding-bottom: 30px; }
.hero__stage .device { width: min(72vw, 330px); }
/* The phone drops in with a little overshoot, then the recording is already running. */
.hero__device { animation: drop-in .9s cubic-bezier(.34, 1.5, .64, 1) .15s both; }
@keyframes drop-in {
  from { opacity: 0; transform: translateY(70px) scale(.88) rotate(-2deg); }
  45% { opacity: 1; }
}
.hero .notif.is-on { transition: opacity .25s var(--ease-out), transform .55s cubic-bezier(.34, 1.56, .64, 1), filter .25s var(--ease-out); }
.live {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hairline); box-shadow: 0 6px 18px rgba(0,0,0,.08);
  font: 800 12.5px/1 var(--font-display); color: var(--ink-2);
  animation: rise .5s var(--ease-out) 1s both;
}
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.glow {
  position: absolute; inset: 6% 8%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--safe) 32%, transparent), transparent);
  filter: blur(36px);
}
@media (max-width: 879px) {
  .hero { padding-top: 14px; }
  .hero__grid { gap: 22px; }
  .chips { margin-bottom: 12px; }
  .hero h1 { font-size: clamp(32px, 9vw, 44px); }
  .hero .lede { font-size: 16.5px; margin-top: 12px; }
  .hero__cta { margin-top: 18px; }
  .hero__stage .device { width: min(64vw, 290px); }
}
@media (min-width: 880px) {
  .hero { padding: 56px 0 24px; }
  .hero__grid { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 48px; }
  .hero__stage .device { width: 340px; }
}

/* ---------- the two things it's for ---------- */
.for { padding: 56px 0 8px; }
.for__grid { display: grid; gap: 14px; margin-top: 28px; }
.for__card {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: start;
  padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hairline);
}
.for__icon { grid-row: span 2; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.for__icon svg { width: 24px; height: 24px; }
.for__card h3 { font-size: 20px; }
.for__card p { font-size: 15.5px; color: var(--ink-2); }
.for__also { margin-top: 18px; font-size: 15px; color: var(--ink-3); max-width: 60ch; }
@media (min-width: 720px) { .for__grid { grid-template-columns: 1fr 1fr; } }

/* ---------- the scroll story ---------- */
.story { padding: 72px 0 24px; }
.story__head { margin-bottom: 8px; }
.story__body { position: relative; }
.story__stage {
  position: sticky; top: calc(var(--nav-h) + 10px); z-index: 1;
  display: flex; justify-content: center;
  height: min(58svh, 560px);
}
.story__stage .device { height: 100%; }
.story__screen {
  opacity: 0; transform: scale(1.015);
  transition: opacity .22s ease-in, transform .22s ease-in;
}
.story__screen.is-on {
  opacity: 1; transform: none;
  transition: opacity .34s var(--ease-out), transform .5s var(--ease-out);
}
.story__steps { position: relative; z-index: 2; margin-top: -18svh; }
.step {
  min-height: 78svh; display: flex; align-items: flex-end; padding-bottom: 6svh;
}
.step:last-child { min-height: 70svh; }
.step__card {
  width: 100%; padding: 20px 20px 22px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hairline); box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
/* On phones the cards scroll over the pinned phone; once a card is no longer
   the active step it gets out of the way so the next screen is never covered. */
@media (max-width: 879px) {
  .js .step:not(.is-on) .step__card { opacity: 0; transform: translateY(-8px); transition-duration: .2s; }
  .js .step.is-next .step__card { opacity: 1; transform: none; }
}
.step__when {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font: 800 12px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
}
.step__when i { width: 8px; height: 8px; border-radius: 50%; }
.step h3 { font-size: 24px; }
.step p { margin-top: 8px; font-size: 16px; color: var(--ink-2); }
@media (min-width: 880px) {
  .story__body { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
  .story__stage { order: 2; top: calc(50svh - 290px + var(--nav-h) / 2); height: 580px; }
  .story__steps { order: 1; margin-top: 0; }
  .step { min-height: 92svh; align-items: center; padding: 0; }
  .step:first-child { min-height: 70svh; }
  .step__card {
    background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    padding: 0; max-width: 30ch; opacity: .28;
  }
  .step.is-on .step__card { opacity: 1; }
  .step h3 { font-size: 34px; }
  .step p { font-size: 18px; }
}

/* ---------- meters & sweeping detail ---------- */
.detail { padding: 72px 0; }
.detail__grid { display: grid; gap: 18px; margin-top: 30px; }
.panel {
  border-radius: 28px; background: var(--surface); border: 1px solid var(--hairline);
  padding: 24px 22px; overflow: hidden; display: flex; flex-direction: column;
}
.panel__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.panel h3 { font-size: 26px; }
.panel > p { color: var(--ink-2); margin-top: 6px; }
/* Spacing above the phone lives on the item before it: padding on .device itself
   would stretch the frame away from the screen. margin-top:auto lines both phones up. */
.panel .device { width: min(56vw, 230px); margin: auto auto 0; }
.panel > :nth-last-child(2) { margin-bottom: 28px; }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 15.5px; color: var(--ink-2); }
.ticks svg { width: 20px; height: 20px; color: var(--brand); margin-top: 2px; }
.ticks b { color: var(--ink); font-weight: 600; }
.quote {
  margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: var(--canvas);
  font-size: 14.5px; color: var(--ink);
}
.quote small { display: block; color: var(--ink-3); font-size: 12.5px; margin-bottom: 2px; }
@media (min-width: 880px) {
  .detail__grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 34px; }
}

/* ---------- films, scrubbed by scroll ---------- */
.films { padding: 72px 0 0; background: #0B0C0F; color: #F2F1EE; }
.films .eyebrow { color: #2ED3A7; }
.films .lede { color: #A1A7B0; }
.scrub { position: relative; height: var(--len); }
.scrub__pin {
  position: sticky; top: var(--nav-h); height: calc(100svh - var(--nav-h));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.scrub__card {
  position: relative; margin: 0; height: min(76svh, 720px); aspect-ratio: 9 / 16; max-width: calc(100vw - 40px);
  border-radius: 24px; overflow: hidden; background: #fff; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.scrub__card canvas, .scrub__first { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub.is-drawn .scrub__first { display: none; }
.scrub__bar { position: absolute; left: 14px; right: 14px; bottom: 12px; height: 4px; border-radius: 4px; background: rgba(0,0,0,.14); overflow: hidden; }
.scrub__bar i { position: absolute; inset: 0; background: #0E6F5C; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.scrub__cap { font: 800 15px/1 var(--font-display); color: #A1A7B0; }

/* ---------- where ---------- */
.where { padding: 72px 0 24px; }
.where__grid { display: grid; gap: 14px; margin-top: 28px; }
.city {
  padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--hairline);
}
.city h3 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.city p { color: var(--ink-2); font-size: 15.5px; margin-top: 6px; }
.city .chip { min-height: 24px; font-size: 11px; }
@media (min-width: 720px) { .where__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .where__grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- faq ---------- */
.faq { padding: 56px 0 24px; }
.faq__list { margin-top: 18px; max-width: 760px; }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer; position: relative; padding: 20px 36px 20px 0;
  font: 800 18px/1.3 var(--font-display); letter-spacing: -.01em; -webkit-tap-highlight-color: transparent;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 26px; width: 9px; height: 9px;
  border-right: 2.2px solid var(--ink-3); border-bottom: 2.2px solid var(--ink-3);
  transform: rotate(45deg); transition: transform .24s var(--ease-in-out);
}
.faq details[open] summary::after { transform: translateY(4px) rotate(-135deg); }
.faq details p { padding-bottom: 20px; color: var(--ink-2); font-size: 16px; max-width: 64ch; }

/* ---------- final band ---------- */
.get { padding: 40px 0 72px; }
.get__card {
  border-radius: 30px; padding: 34px 24px; color: #fff; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #12B888, #0A7A5E);
}
.get__card h2 { font-size: clamp(30px, 7vw, 46px); max-width: 18ch; }
.get__card p { color: rgba(255,255,255,.88); margin-top: 12px; max-width: 42ch; }
.get__card .store { --store-bg: #fff; --store-fg: #0B3F33; margin-top: 24px; }
@media (min-width: 880px) { .get__card { padding: 56px; } }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--hairline); padding: 40px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 14.5px; }
.footer__grid { display: grid; gap: 28px; grid-template-columns: 1fr 1fr; }
.footer h4 { font: 800 12px/1 var(--font-display); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer__about { grid-column: 1 / -1; }
.footer__about p { color: var(--ink-2); margin-top: 12px; max-width: 34ch; }
.footer__base { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--hairline); display: grid; gap: 6px; color: var(--ink-3); font-size: 13px; }
@media (min-width: 880px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .footer__about { grid-column: auto; }
}
@media (hover: hover) and (pointer: fine) { .footer a:hover { color: var(--ink); } }

/* ---------- reveal on scroll ---------- */
.rv {
  opacity: 0; transform: translateY(14px); filter: blur(3px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out), filter .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.rv.is-in { opacity: 1; transform: none; filter: none; }
/* The hero doesn't wait for the script: it plays on first paint. */
.hero .rv { opacity: 1; transform: none; filter: none; transition: none;
  animation: rise .6s var(--ease-out) both; animation-delay: calc(80ms + var(--i, 0) * 70ms); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } }
.no-js .rv { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  .rv { transform: none; filter: none; transition: opacity .3s linear; }
  .hero .rv, .hero__device, .live { animation: none; }
  .live i { animation: none; }
  .notif, .notif.is-on { transform: none; filter: none; }
  .story__screen, .story__screen.is-on { transform: none; }
  .store:active, .nav__cta:active { transform: none; }
}
