/* OVERDRIVE 009 — shared design language for the landing page, Overdrive Scout and the legal pages.
   Editorial and restrained: deep ink and warm cream, one accent (Overdrive orange), Instrument Serif for display,
   Instrument Sans for everything you read and tap, Martian Mono for small labels and figures. Frosted glass is kept
   for chrome that floats over the 3D venue (the nav, sheets, toasts); everything in the flow of a page is a solid ink
   surface with a hairline edge and a one-pixel top light. A fine film grain sits over every page. Motion is slow
   and weighted (ease-out, no overshoot).
   Layout: mobile-first. Stacked below 768 px and on portrait tablets; split (copy beside the 3D stage) from 768 px
   landscape up; the content measure caps at 1180 px from 1280 px. Spacing comes from the --s-* scale. */
:root {
  color-scheme: dark;
  --ink: #0d0e10;
  --ink-2: #15161a;
  --ink-3: #1d1f24;
  --cream: #f2ede3;
  --cream-2: #e4ddcf;
  --text: #f2ede3;
  --muted: #aaa397;           /* 7.7:1 on ink */
  --faint: #938c80;           /* 5.8:1 on ink, 4.9:1 on the raised surface: the floor for small print */
  --line: rgba(242, 237, 227, 0.13);
  --line-2: rgba(242, 237, 227, 0.22);
  --od: #e2531b;              /* the one accent */
  --od-2: #f08a55;
  --od-soft: rgba(226, 83, 27, 0.14);
  --od-fill: #c94515;         /* the accent as a button fill: white text on it passes AA (4.8:1) */
  --od-fill-hi: #bd3f12;
  --red: #d8434e; --blue: #4370e0; --gold: #d9a441; --green: #4fb58a; --danger: #e0584f;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --font: 'Instrument Sans', ui-sans-serif, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;
  --display: var(--serif);
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);       /* entrances: fast start, long settle, no overshoot */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);        /* exits and swaps */
  --slow: 0.6s;
  --r: 16px; --r-sm: 10px; --pill: 999px;
  /* spacing: a 4 px base, doubling at the large end */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px;
  --gutter: 20px; --wrap: 1180px;
  /* solid surfaces for anything in the page flow, with a one-pixel top light for depth */
  --surface: rgba(19, 20, 24, 0.94);
  --surface-2: rgba(27, 29, 34, 0.96);
  --top-light: inset 0 1px 0 rgba(242, 237, 227, 0.05);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --pane: rgba(16, 17, 20, 0.72);
  --pane-strong: rgba(13, 14, 16, 0.9);
  --frost: blur(22px) saturate(115%);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1280px) { :root { --gutter: 48px; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100%; background: var(--ink); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
/* film grain over everything: one tiled noise image, plain alpha (no blend mode, so it costs nothing per frame) */
body::after { content: ''; position: fixed; inset: 0; z-index: 150; pointer-events: none; background: var(--grain); opacity: 0.045; }
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.skip { position: fixed; z-index: 200; left: var(--s-4); top: calc(var(--s-4) + var(--safe-t)); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--cream); color: var(--ink); font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform 0.3s var(--ease); }
.skip:focus { transform: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--od-2); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
::selection { background: rgba(226, 83, 27, 0.35); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.mono { font-family: var(--mono); }
.eyebrow { margin: 0; font: 500 11px/1.55 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.od-text { color: var(--od-2); }
em, .it { font-family: var(--serif); font-style: italic; font-weight: 400; }

/* ------------------------------------------------------------------ surfaces
   Floating chrome (nav, sheets, toasts) is frosted; everything in the page flow is a solid surface. */
.glass, .nav, .sheet, .toast {
  position: relative;
  background: var(--pane);
  border: 1px solid var(--line);
  backdrop-filter: var(--frost); -webkit-backdrop-filter: var(--frost);
}
.glass.strong, .sheet, .toast { background: var(--pane-strong); }
.b-glass, .chip, .seg, .field, .card, .stepper, .tile { position: relative; background: var(--surface); border: 1px solid var(--line); }
.card, .stepper, .seg { box-shadow: var(--top-light); }
.card.strong { background: var(--surface-2); }
.card { border-radius: var(--r); padding: var(--s-5); }
.tile { border-radius: var(--r-sm); }

/* ------------------------------------------------------------------ buttons */
.b { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 22px; border: 1px solid transparent;
  border-radius: var(--r-sm); font-weight: 500; font-size: 15px; letter-spacing: 0.005em; text-decoration: none; white-space: nowrap; user-select: none;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.2s var(--ease), opacity 0.2s; -webkit-tap-highlight-color: transparent; }
.b:active { transform: scale(0.98); transition-duration: 0.12s; }
.b:disabled, .b[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.b-primary { background: var(--cream); color: var(--ink); }
.b-primary:hover { background: #fff; }
.b-od { background: var(--od-fill); color: #fff; }
.b-od:hover { background: var(--od-fill-hi); }
.b-glass { color: var(--text); border-color: var(--line-2); }
.b-glass:hover { background: var(--surface-2); border-color: rgba(242, 237, 227, 0.32); }
.b-ghost { background: transparent; color: var(--muted); }
.b-ghost:hover { color: var(--text); background: rgba(242, 237, 227, 0.06); }
.b-danger { background: transparent; color: #f0a39c; border-color: rgba(224, 88, 79, 0.45); }
.b-danger:hover { background: rgba(224, 88, 79, 0.12); }
.b.lg { height: 54px; padding: 0 28px; font-size: 16px; }
.b.sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.b.icon { width: 46px; padding: 0; }
.b.sm.icon { width: 36px; }
.b.block { width: 100%; }
.b .arrow { transition: transform 0.4s var(--ease); }
.b:hover .arrow { transform: translateX(3px); }
.b-google { background: #fff; color: #1f1f1f; gap: 12px; }
.b-google:hover { background: #f1f1f1; }
.b-google svg { width: 20px; height: 20px; }
.lnk-u { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; transition: text-decoration-color 0.3s var(--ease); }
.lnk-u:hover { text-decoration-color: var(--od-2); }

/* ------------------------------------------------------------------ top navigation */
.nav { position: fixed; z-index: 50; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(1180px, calc(100% - 28px));
  display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px 0 18px; border-radius: 14px; view-transition-name: od-nav; }
.nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 400 22px/1 var(--serif); letter-spacing: 0; margin-right: auto; }
.nav .brand .num { font: 500 11px/1 var(--mono); letter-spacing: 0.1em; color: var(--od-2); padding: 0; background: none; }
.nav a.lnk { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; transition: color 0.3s var(--ease); }
.nav a.lnk:hover, .nav a.lnk[aria-current="page"] { color: var(--text); }
.nav a.lnk { position: relative; }
.nav a.lnk::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 10px; height: 1px; background: var(--od-2); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease-out); }
.nav a.lnk:hover::after, .nav a.lnk[aria-current="page"]::after { transform: none; }
.mark { width: 26px; height: 26px; flex: none; }

/* ------------------------------------------------------------------ form controls */
label.lab, .lab { display: block; margin: 0 0 8px 2px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field { display: flex; align-items: center; min-height: 50px; border-radius: var(--r-sm); padding: 0 16px; gap: 10px; transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease); }
.field:focus-within { border-color: var(--od-2); box-shadow: 0 0 0 3px rgba(240, 138, 85, 0.18); }
.field input, .field select, .field textarea { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 14px 0; }
.field select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.field select option { background: var(--ink-2); color: var(--text); }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.field .suf { color: var(--faint); font: 500 11px var(--mono); }
.chev { pointer-events: none; color: var(--faint); }
.help { margin: 8px 2px 0; color: var(--faint); font-size: 13px; line-height: 1.5; }
.err { margin: 10px 2px 0; color: #f0a39c; font-size: 14px; min-height: 1em; }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 12px; }
.seg button { height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 500; font-size: 14px; transition: background-color 0.35s var(--ease), color 0.35s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--cream); color: var(--ink); }
.seg.red button[aria-pressed="true"] { background: var(--red); color: #fff; }
.seg.blue button[aria-pressed="true"] { background: var(--blue); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: var(--pill); color: var(--cream-2); font-weight: 500; font-size: 13.5px; background: transparent; transition: background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease); }
.chip[aria-pressed="true"] { background: var(--od-soft); color: #f7c3a6; border-color: rgba(226, 83, 27, 0.6); }

.switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 0 8px 0 16px; border-radius: var(--r-sm); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { position: relative; width: 46px; height: 28px; flex: none; border-radius: var(--pill); background: rgba(242, 237, 227, 0.14); transition: background-color 0.35s var(--ease); }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); transition: transform 0.35s var(--ease); }
.switch input:checked + .track { background: var(--od); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--od-2); outline-offset: 2px; }

/* match counter: minus on the left, the number on the right is the big tap target */
.stepper { display: grid; grid-template-columns: 54px 1fr 76px; align-items: stretch; min-height: 72px; border-radius: 14px; overflow: hidden; user-select: none; -webkit-user-select: none; }
.stepper .dec, .stepper .inc { border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); transition: background-color 0.2s var(--ease), color 0.2s; touch-action: manipulation; }
.stepper .dec:hover { color: var(--text); background: rgba(242, 237, 227, 0.05); }
.stepper .inc { color: var(--text); border-left: 1px solid var(--line); background: rgba(242, 237, 227, 0.04); }
.stepper .inc:hover { background: rgba(242, 237, 227, 0.08); }
.stepper .dec:active, .stepper .inc:active { background: rgba(242, 237, 227, 0.12); }
.stepper .mid { display: flex; flex-direction: column; justify-content: center; padding: 0 6px; min-width: 0; }
.stepper .mid b { font: 600 15px/1.25 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper .mid small { color: var(--faint); font: 400 12.5px/1.35 var(--font); }
.stepper .val { font: 400 34px/1 var(--serif); font-variant-numeric: tabular-nums; }
.stepper.bump .inc { background: rgba(226, 83, 27, 0.16); }
.stepper.od .inc .val { color: #f6b08c; }
.stepper.gold .inc .val { color: #e8c37a; }
.stepper.bad .inc .val { color: #ef9b93; }

.rate { display: flex; gap: 6px; }
.rate button { flex: 1; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font: 400 18px var(--serif); transition: background-color 0.3s var(--ease), color 0.3s var(--ease); }
.rate button[aria-pressed="true"] { background: var(--cream); color: var(--ink); border-color: var(--cream); }

/* ------------------------------------------------------------------ sheets, toasts */
.scrim { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(8, 8, 10, 0.6); animation: odFade 0.4s var(--ease); }
.sheet { width: min(520px, 100%); max-height: min(86vh, 860px); overflow: auto; border-radius: 18px; padding: 28px; animation: odRise 0.55s var(--ease); }
.sheet h2 { margin: 0 0 6px; font: 400 32px/1.1 var(--serif); }
.sheet .sub { margin: 0 0 20px; color: var(--muted); }
.sheet .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(22px + var(--safe-b)); transform: translate(-50%, 12px); max-width: calc(100% - 32px); padding: 13px 18px; border-radius: 12px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.45s var(--ease), transform 0.45s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@keyframes odFade { from { opacity: 0; } }
@keyframes odRise { from { opacity: 0; transform: translateY(14px); } }
@keyframes odSpin { to { transform: rotate(360deg); } }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(242, 237, 227, 0.2); border-top-color: var(--cream); animation: odSpin 0.9s linear infinite; }

/* ------------------------------------------------------------------ long-form text */
.prose { width: min(720px, calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: calc(var(--s-10) + var(--safe-t)) 0 var(--s-9); }
.prose h1 { font: 400 clamp(48px, 7vw, 84px)/1 var(--serif); letter-spacing: -0.02em; margin: var(--s-4) 0 var(--s-3); }
.prose .updated { color: var(--faint); font: 400 12px var(--mono); letter-spacing: 0.06em; }
.prose h2 { font: 400 28px/1.2 var(--serif); margin: 52px 0 12px; }
.prose p, .prose li { color: #d3cdc2; line-height: 1.8; }
.prose ul { padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose a { color: var(--text); text-decoration-color: var(--od); text-underline-offset: 3px; }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3); width: min(var(--wrap), calc(100% - 2 * var(--gutter))); margin: 0 auto; padding: 32px 0 calc(36px + var(--safe-b)); border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }
.foot nav { display: flex; gap: 22px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; transition: color 0.3s var(--ease); }
.foot a:hover { color: var(--text); }

/* page-to-page: a calm cross-fade, the nav stays put */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.5s; animation-timing-function: var(--ease); }

@media (prefers-reduced-transparency: reduce) { :root { --pane: rgba(20, 21, 24, 0.97); --pane-strong: rgba(14, 15, 17, 0.99); --frost: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { :root { --pane: rgba(20, 21, 24, 0.96); --pane-strong: rgba(14, 15, 17, 0.98); } }
/* touch screens: every control at least 44 px tall */
@media (pointer: coarse) {
  .b.sm { height: 44px; }
  .b.sm.icon { width: 44px; }
  .chip { height: 40px; }
  .nav a.lnk { height: 44px; }
}
@media (max-width: 767px) {
  .nav { height: 52px; padding: 0 6px 0 14px; top: calc(10px + var(--safe-t)); width: calc(100% - 20px); }
  .nav a.lnk.opt { display: none; }
  .sheet { padding: 24px 20px; }
}

/* ------------------------------------------------------------------ review pass: states and motion */
.b-primary:disabled, .b-primary[aria-disabled="true"] { opacity: 1; background: rgba(242, 237, 227, 0.08); color: var(--faint); transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out); }
.foot a { position: relative; }
.foot a::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: var(--od-2); transform: scaleX(0); transform-origin: left; transition: transform 0.35s var(--ease-out); }
.foot a:hover::after { transform: none; }
/* sheets leave as deliberately as they arrive */
@keyframes odSink { to { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes odOut { to { opacity: 0; } }
.scrim.closing { animation: odOut 0.22s var(--ease-io) forwards; pointer-events: none; }
.scrim.closing .sheet { animation: odSink 0.22s var(--ease-io) forwards; }
/* sheets are opaque and only move: fading a sheet in shows the page through it for a few frames */
.sheet { background: #121316; backdrop-filter: none; -webkit-backdrop-filter: none; animation: odSheetIn 0.5s var(--ease-out); }
@keyframes odSheetIn { from { transform: translateY(16px) scale(0.985); } }
@media (max-width: 767px) {
  /* phones: sheets come up from the bottom edge */
  .scrim { align-items: end; padding: 0; }
  .sheet { width: 100%; max-height: 88vh; border-radius: 18px 18px 0 0; padding-bottom: calc(24px + var(--safe-b)); animation: odSheetUp 0.5s var(--ease-out); }
  .scrim.closing .sheet { animation: odSheetDown 0.26s var(--ease-io) forwards; }
}
@keyframes odSheetUp { from { transform: translateY(100%); } }
@keyframes odSheetDown { to { transform: translateY(100%); } }
/* legal pages: dates read like every other label */
.prose .updated { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.prose > * { animation: odRise 0.8s var(--ease-out) backwards; }
.prose > :nth-child(2) { animation-delay: 0.08s; } .prose > :nth-child(3) { animation-delay: 0.16s; } .prose > :nth-child(n+4) { animation-delay: 0.24s; }
/* touch screens keep no sticky hover state */
@media (hover: none) {
  .b-primary:hover { background: var(--cream); } .b-od:hover { background: var(--od-fill); }
  .b-glass:hover { background: var(--surface); border-color: var(--line-2); } .b-ghost:hover { background: transparent; color: var(--muted); }
  .b:hover .arrow { transform: none; }
}
