/* HailAFare v1 — design tokens (see DESIGN.md).
   Light is the default. Dark applies through prefers-color-scheme unless the rider chose a theme, which /js/theme.js
   stores in localStorage and sets as data-theme="light"|"dark" on <html>. Every hex value is the one in the v1 brief. */
:root {
  color-scheme: light;
  /* palette */
  --navy: #1F3864;            /* brand fill: top bar, primary buttons, badges, rider pin (same in both themes) */
  --primary: #1F3864;         /* text and outlines in brand color (dark: #8FA8E8) */
  --ink: #15213A;
  --muted: #5B6B82;
  --line: #E3E8F0;            /* decorative dividers and card edges */
  --field-line: #8A96AB;      /* input borders: 3.1:1 on white (WCAG 1.4.11 non-text contrast) */
  --bg: #F6F8FB;
  --surface: #FFFFFF;
  --raised: #FFFFFF;
  --amber: #F2A900;           /* Cheapest, primary action; never body text */
  --amber-ink: #15213A;       /* ink on amber fills */
  --amber-tint: #FFF6DC;
  --teal: #0E7C86;            /* Fastest */
  --teal-ink: #FFFFFF;
  --live: #0B7A3B;            /* LIVE */
  --live-tint: #E6F4EA;
  --estimate: #5B6B82;        /* Estimate */
  --estimate-tint: #EEF1F6;
  --danger: #B42318;
  --danger-tint: #FBEAE8;
  --on-navy: #FFFFFF;
  --on-navy-muted: #D9E1F2;
  --focus: #1F3864;           /* focus ring on light surfaces (10.4:1 on white) */
  --focus-on-navy: #F2A900;   /* focus ring on navy (5.5:1) */
  --map-bg: #E9ECF1;
  --ring-a: #1F3864;          /* availability rings: palette slots, not brand colors (see DESIGN.md) */
  --ring-b: #0E7C86;
  --ring-c: #F2A900;
  --scrim: rgba(21, 33, 58, .45);
  --shadow-sheet: 0 -8px 32px rgba(21, 33, 58, .16);
  --shadow-float: 0 8px 24px rgba(21, 33, 58, .14);
  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --fs-32: 32px; --fs-24: 24px; --fs-20: 20px; --fs-17: 17px; --fs-15: 15px; --fs-13: 13px;
  --lh-heading: 1.3;
  --lh-body: 1.45;
  /* spacing (4 px grid), shape, targets */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --r-card: 12px; --r-field: 10px; --r-chip: 999px;
  --tap: 44px;
  /* motion */
  --t-chip: 160ms;
  --t-sheet: 240ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --pulse: 2s;
  --pulse-play: running;
  /* layout */
  --topbar-h: 52px;
  --panel-w: 420px;
}

/* dark palette — system preference, unless the rider chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary: #8FA8E8;
    --ink: #E8EDF7;
    --muted: #9AA8C0;
    --line: #2A3650;
    --field-line: #6B7A96;
    --bg: #0F1626;
    --surface: #182238;
    --raised: #1F2B47;
    --amber: #F7B733;
    --amber-ink: #0F1626;
    --amber-tint: #2E2A1A;
    --teal: #3FB7C2;
    --teal-ink: #0F1626;
    --live: #39B46C;
    --live-tint: #16302A;
    --estimate: #9AA8C0;
    --estimate-tint: #1F2B47;
    --danger: #F28B7D;
    --danger-tint: #3A1F1E;
    --focus: #8FA8E8;
    --focus-on-navy: #F7B733;
    --map-bg: #141C2E;
    --ring-a: #8FA8E8;
    --ring-b: #3FB7C2;
    --ring-c: #F7B733;
    --scrim: rgba(0, 0, 0, .6);
    --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, .5);
    --shadow-float: 0 8px 24px rgba(0, 0, 0, .45);
  }
}
/* dark palette — the rider's explicit choice */
:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #8FA8E8;
  --ink: #E8EDF7;
  --muted: #9AA8C0;
  --line: #2A3650;
  --field-line: #6B7A96;
  --bg: #0F1626;
  --surface: #182238;
  --raised: #1F2B47;
  --amber: #F7B733;
  --amber-ink: #0F1626;
  --amber-tint: #2E2A1A;
  --teal: #3FB7C2;
  --teal-ink: #0F1626;
  --live: #39B46C;
  --live-tint: #16302A;
  --estimate: #9AA8C0;
  --estimate-tint: #1F2B47;
  --danger: #F28B7D;
  --danger-tint: #3A1F1E;
  --focus: #8FA8E8;
  --focus-on-navy: #F7B733;
  --map-bg: #141C2E;
  --ring-a: #8FA8E8;
  --ring-b: #3FB7C2;
  --ring-c: #F7B733;
  --scrim: rgba(0, 0, 0, .6);
  --shadow-sheet: 0 -8px 32px rgba(0, 0, 0, .5);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, .45);
}

/* reduced motion: no transitions, the rider pulse pauses */
@media (prefers-reduced-motion: reduce) {
  :root { --t-chip: 0ms; --t-sheet: 0ms; --pulse-play: paused; }
}
