/* Go4 design tokens: the parts that don't change with the theme or the
   mode. Colours live in src/themes/<theme>.css, and
   src/styles/theme-contrast.test.js checks every text and fill pair in them.

   Discipline carried over from TripFrogger: 16 px is the smallest text in a
   field, 46 px the smallest touch target. */

@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/src/vendor/lexend/lexend-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/src/vendor/lexend/lexend-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Lexend was drawn to be read quickly and with less effort: wide, open
     shapes that hold up at a glance from a car mount. */
  --g4-font: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --g4-text-xs: 0.8125rem;  /* 13: meta lines only */
  --g4-text-sm: 0.9375rem;  /* 15 */
  --g4-text-md: 1rem;       /* 16: body, and the floor for fields */
  --g4-text-lg: 1.25rem;    /* 20 */
  --g4-text-xl: 1.625rem;   /* 26 */
  --g4-text-2xl: 2.25rem;   /* 36 */
  --g4-text-3xl: 3rem;      /* 48 */

  /* The smallest text a field may have: every input, textarea and select
     (TAXONOMY 9.2.1.47, after TripFrogger's --tf-field-font-size).

     iOS Safari zooms the whole page when a field whose computed font-size
     is under 16 px takes focus, and stays zoomed after it is left. 15.5 px
     still does it: the line is hard. Nobody feels it as small type; they
     feel "the app broke when I tried to type".

     If a field looks too big, give it less padding and line-height. Never
     a smaller font-size, and never `maximum-scale` or `user-scalable=no`
     on the viewport: that takes pinch-zoom from everyone who needs it.

     max(), not 16px or 1rem alone: the 16 is a fixed line in someone
     else's engine, so a smaller root font must not take a field under it,
     but a larger root font is someone asking for larger text.

     Spelled without a fallback in a component's styles, so a misspelling
     shows up as a small field and src/styles/field-floor.test.js fails.
     The one fallback is the floor sheet in components/base.js, the last
     defence for a field nobody styled. */
  --g4-field-font-size: max(16px, 1rem);

  --g4-space-1: 0.25rem;
  --g4-space-2: 0.5rem;
  --g4-space-3: 0.75rem;
  --g4-space-4: 1rem;
  --g4-space-5: 1.5rem;
  --g4-space-6: 2rem;
  --g4-space-7: 3rem;

  --g4-touch: 2.875rem;     /* 46 px */

  /* The phone's bottom bar (design round 56, size B; owner, 2026-11-21):
     46 px, from 56. Pages and the Map keep this clear at their foot, and
     the centre button's lift above it (g4-shell.js --g4-drive-clear). */
  --g4-bar-height: 2.875rem; /* 46 px */

  /* Density (design round 37, owner 2026-11-19: "compact", board 1b and
     2b). One scale for lists, rows and forms, so a page is made compact by
     using these, not by its own numbers. A phone is tighter than a desk.
     Never below --g4-touch for anything tapped. */
  --g4-row-gap: var(--g4-space-2);        /* between rows of a list */
  --g4-row-pad-y: var(--g4-space-2);      /* inside a row, top and bottom */
  --g4-row-pad-x: var(--g4-space-3);      /* inside a row, at the sides */
  --g4-row-glyph: 2.25rem;                /* a row's picture */
  --g4-field-h: 2.875rem;                 /* a field's height: one touch */
  --g4-label-size: var(--g4-text-xs);     /* a field's small name above it */
  --g4-stack-gap: var(--g4-space-3);      /* between parts of a form or page */
  /* Round and soft: controls are pills and circles, panels have wide
     corners. Nothing here is a plate or a sign. */
  --g4-radius-sm: 10px;
  --g4-radius: 18px;
  --g4-radius-lg: 28px;
  --g4-radius-pill: 999px;

  --g4-rail: 24rem;         /* the Drive screen's side panel on a wide screen */

  /* The bright set: the one exception to the colour rules (the owner,
     2026-11-17; docs/design/brand/README.md, "What moves"). Only for the
     sparkles round a stop that is reached and the ribbons at the finish
     (utils/celebration.js). The same in every theme, so it lives here and
     not in a theme. They mark nothing and are gone in two seconds: nothing
     that stays on screen may use them. Never red, orange or purple, and
     the pink is brighter than the lead's and isn't its token.
     celebration.test.js checks all of that. */
  --g4-bright-pink: #ff5cc0;
  --g4-bright-lemon: #fff04d;
  --g4-bright-aqua: #35e6e0;
  --g4-bright-lime: #b6f24a;
  --g4-bright-white: #fffdf0;
  /* The hairline round every piece, so the lemon, lime and aqua still show
     on a light map. */
  --g4-bright-edge: #1f2328;

  /* The brand (design round 56; owner, 2026-11-21): the app icon's own
     ground, ink and hot-pink capsule, the same in every theme, as the app
     icon is (src/assets/app-icon.svg). The centre button's face is this
     disc. The hot-pink capsule is the brand's and never on a map
     (docs/design/brand/README.md); a bare logo on a page takes its
     theme's --g4-brand-lead. theme-contrast.test.js checks the pink and
     the ink on the ground. */
  --g4-brand-ground: #0b1220;
  --g4-brand-ink: #eef3fa;
  --g4-brand-pink: #f5189f;

  /* Sign-in buttons (design round 61): each provider's own face, which
     its rules ask for, the same in every theme: Apple and Google on
     white, Facebook on its blue. Only ever on a sign-in button. */
  --g4-sso-light: #ffffff;
  --g4-sso-light-ink: #1f1f1f;
  --g4-sso-edge: #747775;
  --g4-sso-facebook: #1877f2;
  --g4-sso-facebook-ink: #ffffff;

  /* Kinds of thing on the Map (the owner, 2026-11-18, Q26; design round
     23): ice for Events, lime for car meets, teal for groups to join.
     The same in every theme, because they sit on the map, not the page,
     and each mark has a dark edge so it shows on a light map too. Never
     red, orange or purple: those are trouble and talking. A mark's shape
     says what it is; its colour only agrees. */
  --g4-kind-event: #e8eef8;
  --g4-kind-meet: #c6ef6a;
  --g4-kind-group: #4fe0cf;
  /* A Crew's diamond: lilac (the owner's pick, 2026-11-18, design round
     34), the one kind near purple. It stays much lighter than talking's
     purple (--g4-live) in every theme, so a Crew never reads as someone
     talking; theme-contrast.test.js checks that and --g4-on-kind on it. */
  --g4-kind-crew: #c9b6ff;
  /* Kinds of Event (owner, 2026-11-18, Q39 and Q40; design round 29):
     blue for a drive or cruise, a crimson racing red for the track (the
     owner's exception to red meaning trouble; it sits apart from trouble's
     orange-red, and is only ever a round badge), sand for off-road,
     mint for motorbikes, sky for bicycles. A meet keeps --g4-kind-meet
     and "something else" --g4-kind-event. utils/event-kinds.js lists them;
     its test checks each against --g4-on-kind. */
  --g4-kind-cruise: #8fb4ff;
  --g4-kind-track: #f2475c;
  --g4-kind-offroad: #d3a46a;
  --g4-kind-moto: #9ff2c8;
  --g4-kind-cycle: #a8f0ff;
  /* Social, a party (design round 50, board 3 e; owner, 2026-11-20): a
     green 35 degrees of hue or more from the meet's lime, the motorbikes'
     mint and the go green, and far from trouble, talking, the lead and
     the picked ring. Ink 11.6:1 on it. */
  --g4-kind-social: #7dde73;
  --g4-on-kind: #0b1220;
  /* A car's paint, on the Garage form's round swatches (design round 35;
     utils/garage.js PAINTS). The same in every theme: it is the colour of
     the car itself, a fact about a thing, never a state, so the red and
     orange here say nothing of trouble. Only ever a small round swatch
     beside the colour's name, with an edge so black and white show on
     any page; never on the map, never as a state. */
  --g4-paint-black: #14171c;
  --g4-paint-white: #f4f5f7;
  --g4-paint-silver: #c3c8cf;
  --g4-paint-grey: #6b7280;
  --g4-paint-red: #c8102e;
  --g4-paint-blue: #2f5fd0;
  --g4-paint-green: #2e7d4f;
  --g4-paint-yellow: #f2c230;
  --g4-paint-orange: #e8701a;
  --g4-paint-brown: #6b4423;
  --g4-paint-beige: #d8c7a3;
  --g4-paint-gold: #b8913a;
  /* Kinds of driver, the Driver Profile (owner, 2026-11-18, Q46; design
     round 31). The same in every theme, each with --g4-on-kind for its
     words. Never purple. The Track Day Driver's crimson is the
     owner's exception to "red means trouble", as the track's Event kind
     is: a racing red, shown only on that kind's own badge and never on
     the map. utils/driver-kinds.js lists them; its test checks each
     against --g4-on-kind. */
  --g4-driver-cruiser: #8fb4ff;
  --g4-driver-back-road: #4fe0cf;
  --g4-driver-sightseer: #d3a46a;
  --g4-driver-navigator: #c6ef6a;
  --g4-driver-convoy-host: #a8f0ff;
  --g4-driver-explorer: #9ff2c8;
  --g4-driver-track-day: #f2475c;
  --g4-driver-all-rounder: #e8eef8;
  /* Rep paths (owner, 2026-11-18, Q47; design round 30): each path's badge
     is a rounded square in its colour with its icon in --g4-on-kind. The
     same in every theme, like the kinds; utils/paths.test.js checks each
     against --g4-on-kind. Several share a kind's colour: a badge is never
     on the map, so they can't be mistaken for each other. Never red,
     orange, purple or pink. */
  --g4-path-driver: #8fb4ff;
  --g4-path-out-front: #e8eef8;
  --g4-path-planner: #4fe0cf;
  --g4-path-rallymaster: #c6ef6a;
  --g4-path-steward: #a8f0ff;
  --g4-path-spotter: #d3a46a;
  /* A finished path's white rim, and the yellow last of the sparkles that
     run round it (owner, 2026-11-18). The others in the trail are path
     colours. */
  --g4-rim-white: #ffffff;
  --g4-spark-yellow: #ffd25e;

  /* A QR code to vouch in person (TAXONOMY 2.1.2.13): dark squares on a
     white card, the same in every theme and mode, because a phone's camera
     reads dark on light and nothing else reliably. g4-qr.js. */
  --g4-qr-ink: #0b1220;
  --g4-qr-paper: #ffffff;
}

/* At a desk there is room: the same scale, a little looser. */
@media (min-width: 48rem) {
  :root {
    --g4-row-pad-y: var(--g4-space-3);
    --g4-row-pad-x: var(--g4-space-4);
    --g4-field-h: 3.25rem;
    --g4-label-size: var(--g4-text-sm);
    --g4-stack-gap: var(--g4-space-4);
  }
}

/* ---- Route marks (design round 38, boards 6 to 8; TAXONOMY 3.1.3.28,
   3.1.3.29) --------------------------------------------------------------
   A colour for every kind of mark on a Route, dark and light. Like the
   kinds above, a mark sits on the map, not the page, so its colour follows
   the mode and not the theme: one block for dark (the default) and one for
   light, which between them cover every theme and variation. The shape
   still says what a mark is; its colour tells kinds apart at a glance.
   utils/mark-colors.js says which kind takes which.

   Kept out, and utils/mark-colors.test.js checks it: red and orange
   (trouble), amber and yellow (a notice), purple (talking), the lead's
   pink, a Crew's lilac and a favorite's rose. Fuel is green, never
   yellow (owner, 2026-11-19), moved clearly apart from comfort's teal
   (owner, 2026-11-22: at least 25 degrees). Comfort (restrooms, parking,
   a bed) keeps a teal of its own, bluer and lighter than fuel's.

   --g4-on-mark is the picture on a coloured pin. A stop keeps the plain
   ink and is never filled: a stop filled in means reached, on a Drive.
   Regroup is the colour of a Regroup's tag, here so every mark has one.

   A caution keeps trouble's edge (planned: outlined in the notice colour;
   dangerous: filled in the trouble colour). The picture inside takes a
   colour by what it is: --g4-hazard-* on the page's ground in a planned
   one, --g4-hazard-*-deep on the white disc in a dangerous one. Each is at
   least 3:1 where it sits. Road surface shares the pothole's slate. */
:root, [data-mode="dark"] {
  /* A Drive's Route (design round 47, boards 16 and 17; owner,
     2026-11-20): the road ahead, lead to finish, teal with still white
     chevrons; the part driven a dim slate. Only on a Drive's map: the
     planner keeps ink. */
  --g4-route-ahead: #179a8e;
  --g4-route-driven: #4d6380;
  --g4-route-chevron: #ffffff;
  --g4-mark-start: #8ee06a;
  --g4-mark-stop: #eef3fa;
  --g4-mark-regroup: #5cc8ff;
  --g4-mark-via: #a3b3c9;
  --g4-mark-finish: #eef3fa;
  --g4-mark-fuel: #3fd775;
  --g4-mark-food: #c6ef6a;
  --g4-mark-photo: #a8f0ff;
  --g4-mark-comfort: #5ee6d2;
  --g4-mark-repair: #8fb4ff;
  --g4-on-mark: #0b1220;

  --g4-hazard-roadworks: #ffc24a;
  --g4-hazard-pothole: #c9d5e6;
  --g4-hazard-closed: #ffb3a6;
  --g4-hazard-water: #7fd1ff;
  --g4-hazard-debris: #d3a46a;
  --g4-hazard-surface: #c9d5e6;
  --g4-hazard-animals: #c6ef6a;

  /* The same in both modes: a photo spot's shutter flash on the planner,
     and the white disc a dangerous caution's picture sits on. */
  --g4-mark-flash: #ffffff;
  --g4-hazard-disc: #ffffff;
  --g4-hazard-roadworks-deep: #9a5b00;
  --g4-hazard-pothole-deep: #475569;
  --g4-hazard-closed-deep: #b42318;
  --g4-hazard-water-deep: #0369a1;
  --g4-hazard-debris-deep: #8a5a2b;
  --g4-hazard-surface-deep: #475569;
  --g4-hazard-animals-deep: #4d7c0f;
}

[data-mode="light"] {
  --g4-route-ahead: #08919b;
  --g4-route-driven: #a3b1c5;
  --g4-route-chevron: #ffffff;
  --g4-mark-start: #3d7f1c;
  --g4-mark-stop: #0b1220;
  --g4-mark-regroup: #0a6fb0;
  --g4-mark-via: #4a5b72;
  --g4-mark-finish: #0b1220;
  --g4-mark-fuel: #13803a;
  --g4-mark-food: #4f7a00;
  --g4-mark-photo: #0e7490;
  --g4-mark-comfort: #0b7a6c;
  --g4-mark-repair: #2f5fc4;
  --g4-on-mark: #ffffff;

  --g4-hazard-roadworks: #9a5b00;
  --g4-hazard-pothole: #475569;
  --g4-hazard-closed: #b42318;
  --g4-hazard-water: #0369a1;
  --g4-hazard-debris: #8a5a2b;
  --g4-hazard-surface: #475569;
  --g4-hazard-animals: #4d7c0f;
}

/* Broke down (design round 41; owner's ruling Q85, 2026-11-19): a trouble
   colour of its own, orange, apart from I'm lost's broken coral ring and an
   Emergency's coral fill (--g4-alert). Trouble only: a car that broke down
   on the map, its tile in the asks, its card. Like the marks, it follows
   the mode, not the theme: dark first, deepened on light (board 76). */
:root, [data-mode="dark"] {
  --g4-breakdown: #ff8a3d;
  --g4-on-breakdown: #1c0a00;
}
[data-mode="light"] {
  --g4-breakdown: #b54708;
  --g4-on-breakdown: #ffffff;
}

/* An Event's own places on a map (W71; design round 38, boards 6, 16 to
   18, 23 and 24; owner, 2026-11-19): each a pin tied to the Event's disc
   by a dotted line. The Meeting spot is white with people, where
   Directions lead; the Rally point if lost is trouble's own colour with a
   life ring, so it follows each theme's --g4-alert and its ink; the
   afterparty is indigo with two glasses, never talking's purple. Dark
   first, and the light mode after, as the map's ground turns light.
   utils/event-marks.test.js checks each ink and the indigo's distance
   from --g4-live. The other --g4-mark-* (the planner's) are W69's,
   above: this block comes after theirs, whose test reads the first light
   block. */
:root {
  --g4-mark-meet: #eef3fa;
  --g4-mark-lost: var(--g4-alert);
  --g4-mark-after: #9aa8ff;
  --g4-on-mark: #0b1220;
  --g4-on-mark-lost: var(--g4-on-alert);
  /* The edge round a pin, so a white one shows on a light map. */
  --g4-mark-edge: #0b1220;
}
[data-mode="light"] {
  --g4-mark-meet: #0b1220;
  --g4-mark-after: #4552c9;
  --g4-on-mark: #ffffff;
  --g4-mark-edge: #ffffff;
}

/* Featured (design round 50, board 3; owner, 2026-11-20, option B): a
   soft halo round a Drive's or an Event's mark on the Map, at 1.15x, with
   a light sweep and a small bounce. A halo only, never a fill, a ring or a
   badge: gold sits 12 degrees of hue from the notice amber, and its shape
   keeps it apart. Dark: a warm gold, 14.4:1 on the ground. Light: the
   owner's violet-gold (board 9b, option 4), 4.57:1. */
:root, [data-mode="dark"] {
  --g4-featured: #f3e37c;
}
[data-mode="light"] {
  --g4-featured: #8a5aa0;
}

/* The spot's sand, drawn as a picture on a page (design rounds 62 and 65;
   owner, 2026-11-22): the Spot button's eye, the Spot sheet's kinds and
   Car mode's Spot. The Spotter path's own --g4-path-spotter is a badge's
   fill under dark ink, the same in every theme, and is pale: on a light
   page it falls to about 2:1, so a page's sand is this, which holds 3:1 on
   every ground in every theme and variation (styles/theme-contrast.test.js).
   Dark: the path's sand, 7.2:1 or more. Light: a deeper sand, 4.85:1 or
   more. */
:root, [data-mode="dark"] {
  --g4-spot-ink: #d3a46a;
}
[data-mode="light"] {
  --g4-spot-ink: #8a5a1e;
}

/* Area colours (owner, 2026-11-22: "make sure icons are color-coded where
   they need to be ... and we should reuse those same color codes across
   the system to match"; TAXONOMY 9.2.1.178). One colour for each part of
   the app: a round disc behind that part's icon, its picture in the -ink,
   wherever the icon is shown (utils/areas.js; components/area-disc.js
   draws every one). Like the marks, the colour follows the mode and not
   the theme, so an area is the same colour wherever you meet it: dark
   discs are light with a dark picture, light discs deep with a white one.
   Free and Favorites take their theme's own go and rose, so those two
   follow every theme and variation.

   Reused where an area had a colour: Racing history the track's crimson
   (a round badge only, as this disc is), Events an Event's ice on the Map,
   Help the cruise blue, Drives a Route's start green, Driver Profile the
   afterparty's indigo, Settings the via mark's slate, Free the go and
   Favorites the rose; Groups a group's teal stepped off gathering's, and
   Rep a lime near the Rallymaster path's. A variation whose own states
   crowd an area moves it in its theme file (Tide's lime go, Harbor's
   yellow-green notices, Lotus Ltd's deep green go).

   Never trouble's red or orange, talking's purple (Chat is a pale ice
   aqua, Driver Profile an indigo far lighter or greyer than talking), the notice amber, the lead's pink, or a caution's own colour.
   styles/theme-contrast.test.js holds each picture at 3:1 or more on its
   disc and each disc at 3:1 or more on the page, in every theme,
   variation and mode, and keeps the areas apart from each other. */
:root, [data-mode="dark"] {
  --g4-area-rep: #c0f088;
  --g4-area-driver: #9aa8ff;
  --g4-area-racing: var(--g4-kind-track);
  --g4-area-garage: #d4c09a;
  --g4-area-friends: #8fe8ff;
  --g4-area-groups: #6fd8cc;
  --g4-area-favorites: var(--g4-favorite);
  --g4-area-events: var(--g4-kind-event);
  --g4-area-drives: #8ee06a;
  --g4-area-map: #4fb0ff;
  --g4-area-chat: #c2ecf5;
  --g4-area-notices: #f6e7cf;
  --g4-area-settings: #a3b3c9;
  --g4-area-help: var(--g4-kind-cruise);
  --g4-area-free: var(--g4-go);

  --g4-area-rep-ink: #0b1220;
  --g4-area-driver-ink: #0b1220;
  --g4-area-racing-ink: #0b1220;
  --g4-area-garage-ink: #0b1220;
  --g4-area-friends-ink: #0b1220;
  --g4-area-groups-ink: #0b1220;
  --g4-area-favorites-ink: #0b1220;
  --g4-area-events-ink: #0b1220;
  --g4-area-drives-ink: #0b1220;
  --g4-area-map-ink: #0b1220;
  --g4-area-chat-ink: #0b1220;
  --g4-area-notices-ink: #0b1220;
  --g4-area-settings-ink: #0b1220;
  --g4-area-help-ink: #0b1220;
  --g4-area-free-ink: var(--g4-on-go);
}
[data-mode="light"] {
  --g4-area-rep: #617300;
  --g4-area-driver: #4a55a8;
  --g4-area-racing: #b51f3e;
  --g4-area-garage: #76602e;
  --g4-area-friends: #127090;
  --g4-area-groups: #0a6670;
  --g4-area-favorites: var(--g4-favorite);
  --g4-area-events: #334155;
  --g4-area-drives: #2a7a2e;
  --g4-area-map: #0a73b8;
  --g4-area-chat: #1f5570;
  --g4-area-notices: #5e5a52;
  --g4-area-settings: #56667e;
  --g4-area-help: #2f5fc4;
  --g4-area-free: var(--g4-go);

  --g4-area-rep-ink: #ffffff;
  --g4-area-driver-ink: #ffffff;
  --g4-area-racing-ink: #ffffff;
  --g4-area-garage-ink: #ffffff;
  --g4-area-friends-ink: #ffffff;
  --g4-area-groups-ink: #ffffff;
  --g4-area-favorites-ink: #ffffff;
  --g4-area-events-ink: #ffffff;
  --g4-area-drives-ink: #ffffff;
  --g4-area-map-ink: #ffffff;
  --g4-area-chat-ink: #ffffff;
  --g4-area-notices-ink: #ffffff;
  --g4-area-settings-ink: #ffffff;
  --g4-area-help-ink: #ffffff;
  --g4-area-free-ink: var(--g4-on-go);
}

/* The dim layer behind a sheet, a dialog or the Drive button's rows (the
   UX sweep of 2026-11-19, W74): one token, never a raw rgba in a
   component (src/styles/copy-lint.test.js). Darker in dark mode, where
   the page is dark already, so the page under it still steps back. */
:root, [data-mode="dark"] {
  --g4-scrim: rgba(4, 6, 10, 0.6);
  /* Stronger, for what must not be missed: an emergency, a Drive's own
     dialogs over a map. */
  --g4-scrim-strong: rgba(4, 6, 10, 0.7);
}
[data-mode="light"] {
  --g4-scrim: rgba(12, 22, 38, 0.42);
  --g4-scrim-strong: rgba(12, 22, 38, 0.58);
}

/* A picture or clip opened full screen, and the marks on a thumbnail
   (design round 67, TripFrogger's viewer): on black in every theme and
   mode, its controls in near-white, so a photo is seen as it was taken. */
:root {
  --g4-photo-ground: #050608;
  --g4-photo-ink: #f4f6fa;
  --g4-photo-chip: rgba(5, 6, 8, 0.62);
}
