/* Styx Alert marketing site — design tokens
   ----------------------------------------------------------------------------
   Every value is copied from an existing source; the source is named on each
   line. Abbreviations:
     DS   = gs/docs/design-system.md
     WEB  = gs/website/css/style.css (GoldSilver's live site, reference impl.)
     COL  = styx-flutter-app/lib/theme/app_colors.dart     (AppColors)
     SPC  = styx-flutter-app/lib/theme/app_spacing.dart    (AppSpacing)
     RAD  = styx-flutter-app/lib/theme/app_radii.dart      (AppRadii)
     MOT  = styx-flutter-app/lib/theme/app_motion.dart     (AppMotion)
     SHD  = styx-flutter-app/lib/theme/app_shadows.dart    (AppShadows)
     GLS  = styx-flutter-app/lib/theme/glass_chrome.dart   (GlassChrome)
     THM  = styx-flutter-app/lib/theme/theme.dart          (text styles)
     UTL  = styx-flutter-app/lib/utils/utils.dart          (AlertTypeColors)
     PIN  = styx-flutter-app/lib/components/styx_map_pin.dart
     CLU  = styx-flutter-app/lib/components/styx_cluster_bubble.dart
     CAL  = styx-flutter-app/lib/components/styx_station_callout.dart
     TRS  = styx-flutter-app/lib/components/styx_transit_stroke.dart
     MRK  = styx-flutter-app/lib/map/alert_marker.dart
     TRN  = styx-flutter-app/assets/transport/<line>.svg   (official line pictos)
     SOS  = styx-flutter-app/assets/poi/sos.svg
     NEW  = new on the web, justified inline
   Dark only (DS "Dark-mode-only"): there is no light theme and no
   prefers-color-scheme branch, on purpose.
   ------------------------------------------------------------------------- */

/* Fonts — self-hosted, converted from styx-flutter-app/assets/fonts/*.ttf
   compressed with fonttools, not subset (FR, EN and the Lithuanian legal address need Latin Extended-A).
   Lato ships 400/700/900 only (WEB loads exactly those); app styles asking for
   w500/w600/w800 map to 400/700/900 — see the spec, §1.3. */
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../fonts/Lato-Black.woff2") format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/DMSerifDisplay-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Serif Display"; src: url("../fonts/DMSerifDisplay-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: dark;

  /* ---- Brand palette ---------------------------------------------------- */
  --color-bg: #0B0B0D;               /* COL background · WEB --bg · DS */
  --color-bg-alt: #0E0E11;           /* WEB --bg-alt (alternate sections) */
  --color-bg-footer: #08080A;        /* WEB --bg-footer */
  --color-surface: #121215;          /* COL surface · WEB --card · DS */
  --color-surface-raised: #18181C;   /* COL surfaceRaised (callout, snackbar) */
  --color-gold: #E1AD5A;             /* COL gold · WEB --gold · DS (single gold) */
  --color-gold-soft: #D9BE8C;        /* WEB --gold-soft (badge text, tagline) */
  --color-gold-hover: #F2D6A6;       /* WEB a:hover */
  --color-silver: #E5E3E3;           /* COL silver */
  --color-text: #F4F1EA;             /* COL white · WEB --text */
  --color-text-body: #CFCAC1;        /* WEB --text-body (long-form prose) */
  --color-text-muted: #A8A49C;       /* COL greyText · WEB --text-muted */
  --color-text-dim: #8E8A83;         /* COL greyDark · WEB --text-dim */
  --color-text-faint: #7E7B75;       /* COL greyFaint · WEB --text-faint — 4.66:1 on bg, FAILS on surface (4.43): bg only */
  --color-ink: #14100A;              /* WEB --ink — text on gold. NOT the app's white-on-gold (1.8:1, fails AA) */
  --color-divider: rgba(255, 255, 255, 0.07);        /* COL divider 0x12FFFFFF · WEB --border */
  --color-border-strong: rgba(255, 255, 255, 0.09);  /* WEB --border-strong */
  --color-ink-splash: rgba(255, 255, 255, 0.10);     /* COL inkSplash (pressed) */
  --color-hover-overlay: rgba(255, 255, 255, 0.08);  /* DS Adaptive layout: hoverOverlay 8 % white */
  --color-focus-ring: var(--color-gold);             /* DS Adaptive layout: focusRing = gold, 2 px */
  --color-focus-ring-on-gold: var(--color-text);     /* DS: "white ring on the gold primary button" */

  /* Translucent gold (COL goldHairline/goldGlow/goldHandle/goldTint/goldTintFaint) */
  --color-gold-hairline: rgba(225, 173, 90, 0.35);   /* COL 0x59 */
  --color-gold-glow: rgba(225, 173, 90, 0.22);       /* COL 0x38 */
  --color-gold-handle: rgba(225, 173, 90, 0.20);     /* COL 0x33 */
  --color-gold-tint: rgba(225, 173, 90, 0.15);       /* COL 0x26 */
  --color-gold-tint-faint: rgba(225, 173, 90, 0.05); /* COL 0x0D */
  --color-gold-border: rgba(225, 173, 90, 0.30);     /* WEB --gold-border */
  --color-gold-nav-rule: rgba(225, 173, 90, 0.12);   /* WEB .nav border-bottom */
  --color-gold-ambient: rgba(225, 173, 90, 0.13);    /* WEB .hero::before radial glow */

  --color-pin-shadow: rgba(11, 11, 13, 0.50);        /* COL pinShadow 0x800B0B0D */

  /* Glass chrome (GLS LinearGradient 0x8517140F → 0xAD121215, blur sigma 24) */
  --glass-top: rgba(23, 20, 15, 0.52);
  --glass-bottom: rgba(18, 18, 21, 0.68);
  --glass-blur: 24px;

  /* ---- Functional colours (never brand; DS non-goals) ------------------- */
  --color-income: #27A260;           /* COL income — vote trend up */
  --color-expense: #FF5454;          /* COL expense */
  --color-info: #2196F3;             /* COL info — device position */
  --color-warning: #FF9500;          /* COL warning — "Alerte expirée", trend down */
  --color-sos: #01C4B3;              /* SOS (assets/poi/sos.svg circle fill) */

  /* Alert categories (UTL alertTypeColors). Functional: a brand change must not touch them. */
  --alert-physical-aggression: #F7786B; /* AlertTypeColors.lightRed */
  --alert-touching: #9F5BBA;            /* AlertTypeColors.lightPurple */
  --alert-stealing: #CA8179;            /* AlertTypeColors.lightBrown */
  --alert-drunk-or-drugged: #2CDAB1;    /* AlertTypeColors.lightTeal */
  --alert-police-or-security: #6C79DB;  /* AlertTypeColors.indigo */
  --alert-crowded-platform: rgba(48, 57, 67, 0.39); /* AlertTypeColors.grey 0x64303943 — translucent, composited over surface like the pin does */
  --alert-blocked-train: #F6C747;       /* AlertTypeColors.yellow */
  --alert-other: #FA6555;               /* AlertTypeColors.red */
  --alert-fallback: #303943;            /* AlertTypeColors.black (pin fallback, e.g. CONTROLLERS) */

  /* Transit liveries (TRN: fill of each official picto) */
  --line-m1: #FFBE00;  --line-m2: #0055C8;  --line-m3: #6E6E00;  --line-m3b: #82C8E6;
  --line-m4: #A0006E;  --line-m5: #FF5A00;  --line-m6: #82DC73;  --line-m7: #FF82B4;
  --line-m7b: #82DC73; --line-m8: #D282BE;  --line-m9: #D2D200;  --line-m10: #DC9600;
  --line-m11: #8D5E2A; --line-m12: #00643C; --line-m13: #82C8E6; --line-m14: #640082;
  --line-ra: #FF1400;  --line-rb: #3C91DC;

  /* Brand mark — NEW: sampled from styx-flutter-app/assets/icon.png (top-left
     and bottom-right of the capsule). The PNG logo sits on a pale blob made
     for light store tiles; on a dark site the mark is redrawn as inline SVG
     (spec §2.1) and needs its own two stops. Used by the mark only. */
  --mark-from: #D0C982;
  --mark-to: #1CC5AD;

  /* Illustrated map — NEW: stand-ins for Mapbox dark-v11, which the app gets
     from its tile style (map_tiles.dart) and so has no token for. */
  --map-land: var(--color-bg);
  --map-water: #11161B;
  --map-street: rgba(244, 241, 234, 0.05);
  /* The hero's base map is an <img> (img/hero-base.svg) and cannot read these;
     tool/build_hero_map.py writes the same values: water #10161D, parks #0F1512,
     roads white at 7.5 % / 4 %. Change both together. */

  /* Map 3D (hero) — NEW: the camera for the tilted map. */
  --map3d-tilt: 56deg;           /* rotateX: steep enough to read as a landscape, flat enough to read the lines */
  --map3d-turn: -16deg;          /* rotateZ at rest */
  --map3d-turn-end: -8deg;       /* the drift's far end */
  --map3d-drift: 26s;            /* one sweep; slow enough to read as ambient, not as motion */
  --map3d-perspective: 1000px;
  --map3d-ripple-scale: 3.2;     /* ground ripple; the app's pin ring goes to 1.8, the ground needs more reach */

  /* ---- Typography -------------------------------------------------------- */
  --font-sans: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;  /* DS, WEB body */
  --font-serif: "DM Serif Display", Georgia, serif;                         /* DS, WEB .serif */

  --fs-h1: clamp(38px, 5.2vw, 68px);   /* WEB .h1 */
  --lh-h1: 1.05;
  --fs-h1-hero: clamp(36px, 4.2vw, 58px); /* NEW: the hero h1 is a full sentence in a half-width column; at WEB's 68 px it ran five lines */
  --ls-h1: -0.015em;
  --fs-h2: clamp(30px, 3.6vw, 46px);   /* WEB .h2 */
  --lh-h2: 1.12;
  --fs-cta: clamp(32px, 4.4vw, 56px);  /* WEB .cta-title */
  --fs-h3-serif: 28px;                 /* WEB .trust-title */
  --fs-step-number: 38px;              /* WEB .step-number */
  --fs-lede-hero: 18px;                /* WEB .hero-copy */
  --fs-lede: 17px;                     /* WEB .lede, .cta-body */
  --fs-title: 17px;                    /* WEB .step-title */
  --fs-body: 15px;                     /* WEB .trust-body, .prose */
  --fs-small: 14px;                    /* WEB .step-body, .faq-a · THM callout body */
  --fs-caption: 13px;                  /* THM styxTimestampLabelStyle, styxCalloutMutedStyle */
  --fs-label: 12px;                    /* WEB .lang-pill, .badge */
  --fs-callout-title: 16px;            /* THM styxCalloutTitleStyle */
  --fs-cluster: 14px;                  /* THM styxClusterCountStyle */
  --lh-body: 1.65;                     /* WEB .step-body, .trust-body */
  --lh-prose: 1.8;                     /* WEB .prose */

  /* ---- Spacing: 4 pt scale (SPC) ---------------------------------------- */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-huge: 48px;
  /* Layout rhythm (WEB .wrap / .nav-inner / .hero-inner) */
  --container: 1200px;                 /* WEB .wrap max-width */
  --container-prose: 820px;            /* WEB .wrap-prose */
  --gutter: 24px;                      /* WEB .wrap side padding */
  --section-pad: 96px;                 /* WEB .wrap (24 × 4, on the scale's grid) */
  --nav-height: 68px;                  /* WEB: 14 + 40 + 14 */

  /* ---- Radii (RAD + DS) -------------------------------------------------- */
  --radius-sm: 8px;      /* RAD sm — small controls */
  --radius-md: 12px;     /* RAD md — fields */
  --radius-lg: 16px;     /* RAD lg — callout, snackbar, small cards */
  --radius-xl: 20px;     /* RAD xl · DS card radius */
  --radius-sheet: 28px;  /* RAD sheet — glass chrome only */
  --radius-pill: 999px;  /* RAD pill · DS buttons (stadium) */

  /* ---- Motion (MOT) ------------------------------------------------------ */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-slow: 320ms;
  --motion-pulse: 1600ms;   /* ambient loop, deliberately outside fast–slow (MOT) */
  /* NEW: the hero's one orchestrated entrance (network reveal). 3 × slow, so
     it stays a multiple of the scale; like pulse it is a one-off, not a rung. */
  --motion-reveal: 960ms;
  --ease-standard: cubic-bezier(0.215, 0.61, 0.355, 1); /* Curves.easeOutCubic, exact */

  /* ---- Elevation (SHD). Flutter blurRadius r → CSS blur ≈ 1.15·r + 1
     (Flutter sigma = 0.577·r + 0.5; CSS blur = 2·sigma). ---------------- */
  --shadow-pin-lift: 0 3px 8px var(--color-pin-shadow);          /* pinLift: r 6, (0,3) */
  --shadow-glass-glow: 0 -6px 47px var(--color-gold-glow);       /* glassGlow: r 40, (0,-6) */
  /* cardLift(accent): r 15, (0,8), accent @ 15 %. A function in the app; here
     the accent is a parameter: set --accent on the element. */
  --shadow-card-lift: 0 8px 18px color-mix(in srgb, var(--accent, var(--color-gold)) 15%, transparent);

  /* ---- Component geometry (element sizes, not spacing — as in the app) -- */
  --pin-w: 36px;  --pin-h: 46px;          /* PIN width/height */
  --pin-disc: 28px; --pin-icon: 20px;     /* PIN iconDiscSize/iconSize */
  --pin-outline: 2px; --pin-outline-selected: 3px;
  --pin-selected-scale: 1.3;              /* PIN selectedScale */
  --pin-pulse-scale: 1.8;                 /* PIN pulseMaxScale */
  --pin-min-opacity: 0.45;                /* MRK minAlertPinOpacity */
  --cluster-sm: 40px; --cluster-md: 46px; --cluster-lg: 52px; /* CLU <10 / ≥10 / ≥50 */
  --cluster-ring: 2.5px;                  /* CLU clusterRingWidth */
  --sos-size: 32px;                       /* StyxMapSymbol.size */
  --callout-w: 248px;                     /* CAL stationCalloutWidth */
  --callout-caret-w: 16px; --callout-caret-h: 8px;
  --callout-line-picto: 22px; --callout-alert-picto: 24px;
  --transit-stroke: 3px; --transit-casing: 1.5px; /* TRS */
  --station-dot: 8px; --station-dot-interchange: 11px; /* transit_layer.dart radii 4 / 5.5 */
  --focus-ring-width: 2px;                /* DS */
}

@media (max-width: 720px) {
  :root {
    --gutter: 16px;        /* brief: 16 px gutters at 375 */
    --section-pad: 64px;   /* NEW: WEB has no mobile rhythm; 64 = 16 × 4 keeps the grid */
  }
}
