/* Gates Ride. System: DESIGN.md (VoltAgent "mercury" with Gates Ride overrides).
   Two worlds: the home page is night (deep purple), Apply/Terms/Privacy/Staff are day. Nav and footer are night everywhere.
   Shapes: buttons and nav links are pills, cards and inputs 12px, images 16px. Gold is only for Apply, prices, check marks, step numbers. */

@font-face { font-family: "Geist"; src: url(/fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --night: #1f0a3c;
  --night-raised: #2b1453;
  --on-dark: #efeaf6;
  --fog: #c6bcd8;
  --gold: #f4b223;
  --gold-hi: #ffc54d;
  --on-gold: #1f0a3c;
  /* day world (default) */
  --bg: #f8f6fc;
  --card: #efe9f9;
  --surface: #fefdff;
  --text: #241a38;
  --muted: #574b70;
  --line: rgba(36, 26, 56, .12);
  --field: #fefdff;
  --field-line: rgba(36, 26, 56, .28);
  --deep: #f3eff9;
  --soft: rgba(36, 26, 56, .07);
  --r-card: 12px;
  --r-img: 16px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--font);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}
body[data-page="home"] {
  --bg: var(--night);
  --card: var(--night-raised);
  --surface: var(--night-raised);
  --text: var(--on-dark);
  --muted: var(--fog);
  --line: rgba(239, 234, 246, .14);
  --field: #180732;
  --field-line: rgba(239, 234, 246, .3);
  --deep: #180732;
  --soft: rgba(198, 188, 216, .16);
  color-scheme: dark;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.55 var(--font); -webkit-font-smoothing: antialiased; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--display); font-weight: 480; line-height: 1.12; letter-spacing: -.012em; margin: 0 0 .6em; text-wrap: balance; }
h2 { font-size: clamp(1.9rem, 4.6vw, 2.6rem); }
h3 { font-size: 1.3rem; font-weight: 500; letter-spacing: 0; }
p { margin: 0 0 1rem; text-wrap: pretty; }
a { color: inherit; text-underline-offset: 3px; }
img, svg { max-width: 100%; display: block; }
b, strong { font-weight: 560; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)); }
.narrow { max-width: 760px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 30; background: var(--gold); color: var(--on-gold); padding: .6rem 1rem; border-radius: 999px; font-weight: 500; transition: top .2s var(--ease); }
.skip:focus { top: 12px; }
mark.todo { background: #fbe7b0; color: #4a3300; border-radius: 4px; padding: 0 .3em; font-size: .9em; }
.testbar { background: var(--gold); color: var(--on-gold); text-align: center; font-weight: 500; padding: .35rem 16px; font-size: .875rem; }

/* Nav: night on every page */
.bar { position: sticky; top: 0; z-index: 20; height: 72px; display: flex; align-items: center; gap: 1rem; padding: 0 max(16px, calc((100% - 1128px) / 2)); background: var(--night); color: var(--on-dark); border-bottom: 1px solid rgba(239, 234, 246, .08); transition: box-shadow .3s var(--ease); }
.bar.scrolled { box-shadow: 0 8px 24px -12px rgba(10, 2, 24, .6); }
.wordmark { font-family: var(--display); font-weight: 560; font-size: 1.35rem; letter-spacing: -.01em; text-decoration: none; color: var(--on-dark); margin-right: auto; white-space: nowrap; }
.wordmark span { color: var(--gold); }
.menu-btn { min-height: 44px; padding: 0 1rem; border: 0; border-radius: 999px; background: rgba(198, 188, 216, .16); color: var(--on-dark); font: 450 1rem/1 var(--font); cursor: pointer; }
.links[popover] { inset: 72px 0 auto 0; margin: 0; max-height: none; width: 100%; border: 0; padding: .5rem 16px 1rem; background: var(--night); color: var(--on-dark); border-bottom: 1px solid rgba(239, 234, 246, .1); }
.links[popover]:popover-open { display: grid; }
.links a { color: var(--on-dark); text-decoration: none; font-weight: 450; min-height: 44px; display: inline-flex; align-items: center; padding: 0 1rem; border-radius: 999px; transition: background-color .2s var(--ease); }
.links a:hover { background: rgba(198, 188, 216, .14); }
@media (max-width: 420px) { .wordmark { font-size: 1.15rem; } .bar { gap: .5rem; } }
@media (min-width: 860px) {
  .menu-btn { display: none; }
  .links[popover] { display: flex; position: static; inset: auto; width: auto; padding: 0; background: none; border: 0; overflow: visible; }
}

/* Buttons: one solid gold pill per group, everything else soft */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.4rem; border: 0; border-radius: 999px; background: var(--gold); color: var(--on-gold); font: 500 1rem/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .2s var(--ease), transform .2s var(--ease); -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--gold-hi); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 44px; padding: 0 1.15rem; }
.btn-soft, .btn-ghost { background: var(--soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-soft:hover, .btn-ghost:hover { background: rgba(198, 188, 216, .26); }
.text-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; color: inherit; text-decoration: underline; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.text-link:hover { opacity: .8; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

/* Gold check marks */
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { position: relative; padding: .3rem 0 .3rem 1.75rem; }
.checks li::before { content: ""; position: absolute; left: .2rem; top: .65rem; width: .45rem; height: .85rem; border: solid var(--gold); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Hero: driving video (poster image first) behind the copy, with a dark gradient for legibility */
.hero { position: relative; overflow: hidden; isolation: isolate; display: grid; align-items: end; min-height: 600px; background: var(--night); }
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 42% 55%; z-index: -2; }
.hero-video { opacity: 0; transition: opacity .6s var(--ease); }
.hero.is-playing .hero-video { opacity: 1; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(31, 10, 60, .55) 0%, rgba(31, 10, 60, .35) 45%, rgba(31, 10, 60, 0) 75%), linear-gradient(to right, rgba(31, 10, 60, .55) 0%, rgba(31, 10, 60, .55) 38%, rgba(31, 10, 60, 0) 72%); }
@media (max-width: 768px) { .hero::after { background: linear-gradient(to top, rgba(31, 10, 60, .55) 0%, rgba(31, 10, 60, .55) 62%, rgba(31, 10, 60, 0) 92%), linear-gradient(to right, rgba(31, 10, 60, .45) 0%, rgba(31, 10, 60, 0) 80%); } }
.hero-copy { width: 100%; padding-top: 6rem; padding-bottom: 2.5rem; position: relative; text-shadow: 0 1px 18px rgba(20, 6, 40, .55); }
.hero h1 { font-size: clamp(2.3rem, 8vw, 3.6rem); line-height: 1.06; letter-spacing: -.02em; max-width: 16ch; color: #fbf9fd; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36ch; margin-bottom: 1.75rem; }
.hero .lead { color: #f3eff9; }
.hero .cta-row .btn { flex: 1 1 10rem; text-shadow: none; }
@media (min-width: 769px) {
  .hero { align-items: end; min-height: clamp(560px, calc(100svh - 105px), 780px); }
  .hero-poster, .hero-video { object-position: 50% 55%; }
  .hero-copy { padding-top: 3rem; padding-bottom: 3.5rem; }
  .hero .lead { max-width: 32ch; }
  .hero .cta-row .btn { flex: none; }
}

/* Facts strip: six offer facts as a stat grid */
.facts-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chips { list-style: none; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; }
.chips li { display: grid; gap: .25rem; align-content: start; padding: 1.4rem 1rem 1.4rem 0; border-bottom: 1px solid var(--line); }
.chips li:nth-last-child(-n + 2) { border-bottom: 0; }
.fact-big { font-family: var(--display); font-weight: 480; font-size: clamp(1.15rem, 3.6vw, 1.6rem); line-height: 1.15; letter-spacing: -.01em; }
.chips li:first-child .fact-big { color: var(--gold); }
.fact-note { color: var(--muted); font-size: .92rem; }
@media (min-width: 900px) {
  .chips { grid-template-columns: repeat(3, 1fr); }
  .chips li { padding: 1.75rem 1.5rem 1.75rem 0; }
  .chips li:nth-last-child(-n + 3) { border-bottom: 0; }
}

/* Sections */
.band { padding: clamp(4rem, 9vw, 7rem) 0; }
.band > .wrap > h2 { margin-bottom: 2rem; }

/* How it works: heading sticks, steps scroll past, gold line follows */
.how-grid { display: grid; gap: 1.5rem; }
.steps { list-style: none; padding: 0 0 0 3.25rem; margin: 0; counter-reset: s; position: relative; display: grid; gap: 2rem; }
.steps::before, .steps::after { content: ""; position: absolute; left: 1.05rem; top: .4rem; bottom: .4rem; width: 2px; border-radius: 2px; }
.steps::before { background: var(--line); }
.steps::after { background: var(--gold); transform-origin: top; }
.steps li { counter-increment: s; position: relative; z-index: 1; } /* keeps the number circles above the progress line */
.steps li::before { content: counter(s); position: absolute; left: -3.25rem; top: -.15rem; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--on-gold); font-weight: 560; z-index: 1; }
.steps h3 { margin-bottom: .3rem; }
.steps p { color: var(--muted); margin: 0; max-width: 46ch; }
@media (min-width: 900px) {
  .how-grid { grid-template-columns: 5fr 7fr; gap: 4rem; align-items: start; }
  .how-grid h2 { position: sticky; top: 7rem; margin: 0; font-size: clamp(2.2rem, 4vw, 3rem); }
  .steps { gap: 3rem; }
}

/* Prices and shared small text */
.price { font-family: var(--display); font-weight: 480; color: var(--gold); font-size: clamp(2.8rem, 7vw, 3.6rem); line-height: 1; letter-spacing: -.02em; margin: 0 0 1rem; font-variant-numeric: tabular-nums; }
.price span { font-size: .4em; letter-spacing: 0; margin-left: .15em; }
.hint { color: var(--muted); font-size: .95rem; margin: 0; }

/* The cars: one card per car. 1 column on phones, 2 from 640px up (2x2 on desktop keeps each spec list readable). */
.car-grid { display: grid; gap: 1.25rem; }
@media (min-width: 640px) { .car-grid { grid-template-columns: 1fr 1fr; } }
.car { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r-img); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
@media (hover: hover) { .car:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(244, 178, 35, .45); } }
.car-photo { overflow: hidden; background: var(--night); }
.car-photo img, .car-photo svg { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 60%; }
.car-body { display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; flex: 1; }
.car-name { font-size: 1.45rem; margin: 0; }
.tag { color: var(--muted); font-weight: 500; margin: -.6rem 0 0; }
.price { margin: 0; font-size: clamp(2.4rem, 6vw, 3rem); }
.avail { margin: 0; color: var(--muted); }
.car-specs { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; padding: .9rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .95rem; }
.car-specs dt { color: var(--muted); }
.car-specs dd { margin: 0; }
.good-for { margin: 0; color: var(--muted); }
.car-body .btn { margin-top: auto; align-self: flex-start; }
.mpg-note { margin: 1rem 0 0; }
.terms-box { margin-top: 2rem; background: var(--card); border-radius: var(--r-card); padding: 1.75rem 2rem; box-shadow: inset 0 0 0 1px rgba(244, 178, 35, .5); }
.terms-box h3 { margin-bottom: .75rem; }
.terms-box .checks { display: grid; gap: .1rem 2rem; margin-bottom: 1rem; }
@media (min-width: 860px) { .terms-box .checks { grid-template-columns: 1fr 1fr; } }

/* Sticky phone action bar (Call + Request). Body gets matching bottom padding so nothing is covered. */
.action-bar { display: none; }
@media (max-width: 768px) {
  .nav-cta { display: none; }
  body:not([data-page="apply"]) .action-bar { position: fixed; z-index: 15; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; padding: .6rem 16px calc(.6rem + env(safe-area-inset-bottom)); background: rgba(31, 10, 60, .96); border-top: 1px solid rgba(239, 234, 246, .12); backdrop-filter: blur(8px); }
  body:not([data-page="apply"]) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .action-bar .btn { min-height: 48px; }
  .action-bar .btn-soft { color: var(--on-dark); background: rgba(198, 188, 216, .16); box-shadow: inset 0 0 0 1px rgba(239, 234, 246, .18); }
}

.review-list { display: grid; gap: 1rem; }
.review { margin: 0; background: var(--card); border-radius: var(--r-card); padding: 1.5rem; }
.review blockquote { margin: 0 0 .75rem; font-size: 1.15rem; }
.review figcaption { color: var(--muted); }
.reviews { padding-top: 0; }

/* Questions: accordion rows */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; position: relative; padding: 1.1rem 2.5rem 1.1rem 0; min-height: 44px; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .5rem; top: 1.45rem; width: .55rem; height: .55rem; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.7rem; }
.faq p, .faq ul { color: var(--muted); max-width: 64ch; }
.faq ul { margin: 0 0 1.1rem; padding-left: 1.2rem; }

/* Close */
.close { padding: clamp(4rem, 9vw, 6.5rem) 0; text-align: center; border-top: 1px solid var(--line); }
.close h2 { font-size: clamp(2rem, 5vw, 3rem); }
.close .cta-row { justify-content: center; }

/* Footer: night everywhere */
footer { background: var(--night); color: var(--fog); padding: 3.5rem 0 1.5rem; }
.foot { max-width: 1160px; margin: 0 auto; padding: 0 16px; display: grid; gap: 2rem; font-size: .95rem; }
.foot .wordmark { display: block; margin-bottom: .75rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.25rem; margin: 0; }
.facts dt { color: var(--on-dark); font-weight: 500; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.legal { max-width: 1160px; margin: 2.5rem auto 0; padding: 1.25rem 16px 0; border-top: 1px solid rgba(239, 234, 246, .12); display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .85rem; }
.legal a { min-height: 44px; display: inline-flex; align-items: center; margin: -.7rem 0; }
@media (min-width: 860px) { .foot { grid-template-columns: 1fr 1.3fr; } }

/* Day pages: Apply, Terms, Privacy */
.page-title { font-size: clamp(2.2rem, 6vw, 3rem); letter-spacing: -.02em; }
.progress { font-weight: 500; color: var(--muted); margin-bottom: .5rem; }
.progress-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 0 0 1.5rem; }
.progress-bar span { display: block; height: 100%; width: calc(var(--step, 1) / 6 * 100%); background: var(--gold); transition: width .4s var(--ease); }
.code-banner { background: var(--night); color: var(--on-dark); border-radius: var(--r-card); padding: 1rem 1.25rem; }
.code-banner b { color: var(--gold); font-weight: 560; font-size: 1.15rem; letter-spacing: .04em; }
.resume { background: var(--card); border-radius: var(--r-card); padding: .25rem 1.25rem; margin-bottom: 1.25rem; }
.resume summary { cursor: pointer; font-weight: 500; padding: .8rem 0; min-height: 44px; }
.resume form { padding-bottom: 1.25rem; }
.stack { display: grid; gap: 1.1rem; }
form.step { background: var(--surface); border-radius: var(--r-card); padding: clamp(1.25rem, 4vw, 2rem); box-shadow: 0 1px 2px rgba(36, 26, 56, .05), 0 8px 28px -12px rgba(36, 26, 56, .14); }
form.step h2 { font-size: 1.6rem; }
label { display: grid; gap: .35rem; font-weight: 500; }
input, select, textarea { font: 400 1rem/1.3 var(--font); min-height: 46px; padding: .55rem .9rem; border: 1px solid var(--field-line); border-radius: var(--r-card); background: var(--field); color: var(--text); width: 100%; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(244, 178, 35, .45); }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; padding: 0; margin: .15rem 0 0; flex: none; accent-color: var(--night); }
input[aria-invalid], select[aria-invalid] { border: 2px solid var(--text); background: #fff8e6; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-card); padding: .75rem 1rem; margin: 0; display: grid; gap: .1rem; }
legend { font-weight: 500; padding: 0 .35rem; }
.check, .choice { display: flex; align-items: flex-start; gap: .75rem; font-weight: 400; min-height: 44px; cursor: pointer; }
.check input[aria-invalid] { outline: 2px solid var(--text); outline-offset: 2px; }
.choice { border: 1px solid var(--text); border-radius: var(--r-card); padding: 1rem; }
.row { display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .row { grid-template-columns: 2fr 1fr; } }
.nav-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.error { font-weight: 500; border-left: 3px solid var(--gold); padding-left: .75rem; margin-top: 1rem; }
.error:empty { display: none; }
.done { background: var(--night); color: var(--on-dark); border-radius: var(--r-card); padding: 1.5rem; }
.rules { background: var(--card); border-radius: var(--r-card); padding: 1rem 1.25rem; }
.rules h3 { font-size: 1.05rem; margin: .75rem 0 .25rem; }
.rules ul { margin: 0 0 .5rem; padding-left: 1.2rem; color: var(--muted); }
.residency { background: var(--card); border-radius: var(--r-card); padding: 1rem 1.25rem; display: grid; gap: .6rem; }
.signed-copy { margin-top: 1rem; }
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.5rem; margin: 2.5rem 0 .6rem; }
.prose ul { padding-left: 1.25rem; color: var(--muted); }
.prose p { color: var(--muted); }
.prose li { margin: .3rem 0; }

/* Motion. Every effect is off without JS or with reduced motion; content is never hidden then. */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw { from { transform: scaleY(0); } }
.js-motion .hero-copy > * { animation: rise .7s var(--ease) both; }
.js-motion .hero-copy > :nth-child(2) { animation-delay: .12s; }
.js-motion .hero-copy > :nth-child(3) { animation-delay: .24s; }
.js-motion .rv { opacity: 0; }
.js-motion .rv.in { opacity: 1; animation: rise .6s var(--ease) var(--d, 0s) both; }
.js-motion form.step:not([hidden]) { animation: rise .4s var(--ease); }
/* The gold line in How it works follows reading progress where scroll-driven animations exist; elsewhere it is drawn in full. */
@supports (animation-timeline: view()) {
  .js-motion .steps::after { animation: draw linear both; animation-timeline: view(); animation-range: entry 40% cover 60%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js-motion .rv { opacity: 1; }
}
