/* Styx Alert marketing site — components
   ----------------------------------------------------------------------------
   Reads only tokens.css. No raw colour, radius, duration or shadow below
   except where a comment names the app constant it reproduces.
   Naming: BEM-ish, one block per app component where one exists
   (.pin = StyxMapPin, .cluster = StyxClusterBubble, .callout =
   StyxStationCallout, .sos = StyxMapSymbol, .glass = GlassChrome,
   .timestamp = StyxTimestampLabel, .btn--primary = StyxPrimaryButton).
   Section layout lives in site.css, not here.
   ------------------------------------------------------------------------- */

/* ===== 0. Base =========================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--color-bg); }
html { scroll-padding-top: calc(var(--nav-height) + var(--space-base)); }
body {
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--color-gold); text-decoration: none; }
a:hover { color: var(--color-gold-hover); }
::selection { background: var(--color-gold-border); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* Focus: keyboard only, 2 px gold, never after a click (DS Adaptive layout) */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus-ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.skip-link {
  position: absolute; left: var(--space-base); top: -100px; z-index: 100;
  padding: var(--space-sm) var(--space-base);
  background: var(--color-gold); color: var(--color-ink);
  border-radius: var(--radius-pill); font-weight: 700;
}
.skip-link:focus-visible { top: var(--space-base); outline-color: var(--color-focus-ring-on-gold); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* i18n — identical mechanism to WEB (js/i18n.js toggles html[data-active-lang]) */
[data-lang] { display: none !important; }
html[data-active-lang="en"] [data-lang="en"] { display: var(--show-en, inline) !important; }
html[data-active-lang="fr"] [data-lang="fr"] { display: var(--show-fr, inline) !important; }
[data-lang][data-display="block"] { --show-en: block; --show-fr: block; }
[data-lang][data-display="flex"] { --show-en: flex; --show-fr: flex; }
[data-lang][data-display="inline-flex"] { --show-en: inline-flex; --show-fr: inline-flex; }

/* ===== 1. Layout primitives ============================================== */
.wrap {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--section-pad) var(--gutter);
}
.wrap--prose { max-width: var(--container-prose); }
.section--alt { background: var(--color-bg-alt); }
.section--rule { border-top: 1px solid var(--color-divider); }

/* ===== 2. Typography ===================================================== */
.h1 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: var(--ls-h1);
  text-wrap: balance;
}
.h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  text-wrap: balance;
}
.h3 { font-size: var(--fs-title); font-weight: 700; line-height: 1.3; }
.h3--serif { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-h3-serif); line-height: 1.2; }
.lede { font-size: var(--fs-lede); line-height: 1.6; color: var(--color-text-muted); max-width: 60ch; }
.lede--hero { font-size: var(--fs-lede-hero); }
.muted { color: var(--color-text-muted); }

/* Section header: serif title + lede. Deliberately no all-caps eyebrow —
   the route line (§ .route) and the map key carry section identity instead. */
.section-head { max-width: 680px; margin-bottom: var(--space-huge); }
.section-head .lede { margin-top: var(--space-base); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .lede { margin-inline: auto; }

/* ===== 3. Buttons (pill/stadium — DS "Buttons") ========================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  min-height: 44px;                    /* WCAG 2.5.5 target */
  padding: 10px 18px;                  /* WEB .btn-gold */
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: 700 var(--fs-small)/1 var(--font-sans);
  white-space: nowrap; cursor: pointer;
  transition: background-color var(--motion-fast) var(--ease-standard),
              border-color var(--motion-fast) var(--ease-standard),
              color var(--motion-fast) var(--ease-standard);
}
.btn--lg { min-height: 52px; padding: 15px 26px; font-size: 15px; } /* WEB .btn-gold-lg */
.btn--block { width: 100%; }

/* Primary = StyxPrimaryButton: the one confirming action. Ink on gold (WEB), not white. */
.btn--primary { background: var(--color-gold); color: var(--color-ink); }
.btn--primary:hover { background: var(--color-gold-hover); color: var(--color-ink); }
.btn--primary:active { background: color-mix(in srgb, var(--color-gold) 88%, black); }
.btn--primary:focus-visible { outline-color: var(--color-focus-ring-on-gold); border-radius: var(--radius-pill); }

/* Outline = WEB .btn-outline-lg: secondary action next to a primary */
.btn--outline { border-color: rgba(225, 173, 90, 0.45); /* WEB literal */ color: var(--color-gold); background: transparent; }
.btn--outline:hover { background: var(--color-gold-tint-faint); color: var(--color-gold); }

/* Ghost = text button (THM textButtonTheme: greyText) */
.btn--ghost { background: transparent; color: var(--color-text-muted); padding-inline: var(--space-md); }
.btn--ghost:hover { background: var(--color-hover-overlay); color: var(--color-text); }

/* Store badges (WEB .store-badges — Apple badge served by Apple, Play badge local PNG) */
.store-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-base) var(--space-lg); }
.store-badges a { display: block; border-radius: var(--radius-sm); }
.store-badges img { height: 48px; width: auto; max-width: none; }

/* Language switch (WEB .lang-switch / .lang-pill) */
.lang-switch {
  display: flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid rgba(225, 173, 90, 0.2); /* WEB literal */
  border-radius: var(--radius-pill);
}
.lang-pill {
  min-height: 32px; min-width: 40px; padding: 5px 11px;
  border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--color-text-muted);
  font: 900 var(--fs-label)/1 var(--font-sans); letter-spacing: 0.06em;
  cursor: pointer;
}
.lang-pill:hover { color: var(--color-text); }
.lang-pill.is-active { background: var(--color-gold); color: var(--color-ink); }
.lang-pill:focus-visible { border-radius: var(--radius-pill); }

/* ===== 4. Nav ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 13, 0.86);     /* WEB .nav: --color-bg @ 86 % */
  backdrop-filter: blur(14px);            /* WEB .nav */
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-gold-nav-rule);
}
.nav__inner {
  max-width: var(--container); margin-inline: auto;
  padding: 14px var(--gutter);
  display: flex; align-items: center; gap: 28px;
}
.nav__links {
  display: flex; gap: 26px; margin-left: auto;
  font-size: var(--fs-small); font-weight: 700;
}
.nav__links a { color: #B6B2AA; /* WEB .nav-links literal, 8.9:1 */ }
.nav__links a:hover { color: var(--color-text); }

/* Logo lockup: inline SVG mark + serif wordmark */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--color-text); }
.brand:hover { color: var(--color-text); }
.brand__mark { width: auto; height: 32px; }
.brand__word { font-family: var(--font-serif); font-size: 24px; line-height: 1; }

@media (max-width: 900px) {
  .nav__links { display: none; }               /* one-page site: sections are a scroll away */
  .nav__inner { gap: var(--space-md); }
  .nav .lang-switch { margin-left: auto; }
}
@media (max-width: 380px) {
  .brand__word { font-size: 20px; }
  .nav .btn { padding-inline: 14px; }
}

/* ===== 5. Surfaces ======================================================= */
/* Card — DS card radius 20, surface, hairline. Accent shadow is opt-in. */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
}
.card--lift { box-shadow: var(--shadow-card-lift); }  /* set --accent */

/* Glass — GlassChrome: blur 24, translucent gradient, gold hairline top, gold glow.
   App = bottom sheets (top-only corners). Web adds a floating variant. */
.glass {
  position: relative;
  background: linear-gradient(to bottom, var(--glass-top), var(--glass-bottom));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  border-top: 1px solid var(--color-gold-hairline);
  box-shadow: var(--shadow-glass-glow);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
}
.glass--floating { border-radius: var(--radius-sheet); }
.glass__grabber {                         /* modal.dart drag handle: 100×4, goldHandle */
  width: 100px; height: 4px; margin: var(--space-md) auto 0;
  border-radius: var(--radius-pill); background: var(--color-gold-handle);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--color-surface-raised); }
}

/* ===== 6. Map vocabulary ================================================= */

/* 6.1 Pin — StyxMapPin. Teardrop 36×46, tip = anchor (bottom-centre).
   Markup:
   <span class="pin [pin--fresh] [pin--selected]" style="--pin-color: var(--alert-stealing); --pin-opacity: .72">
     <svg class="pin__shape" viewBox="0 0 36 46" aria-hidden="true">
       <path class="pin__base"    d="M18 46 L31.79 29.57 A18 18 0 1 0 4.21 29.57 Z"/>
       <path class="pin__fill"    d="M18 46 L31.79 29.57 A18 18 0 1 0 4.21 29.57 Z"/>
       <path class="pin__outline" d="M18 45 L31.21 28.70 A17 17 0 1 0 4.79 28.70 Z"/>
     </svg>
     <span class="pin__disc"><img src="img/alert/stealing.png" alt=""></span>
   </span>
   Outer path = StyxPinBorder._teardrop(36×46): r 18, tangent angle acos(18/28).
   Outline path = same shape deflated by 1, so a 2 px stroke sits inside the edge
   exactly like Flutter's inside BorderSide. */
.pin {
  --pin-color: var(--alert-fallback);
  --pin-opacity: 1;
  position: relative; display: block;
  width: var(--pin-w); height: var(--pin-h);
  opacity: clamp(var(--pin-min-opacity), var(--pin-opacity), 1);
  transform-origin: 50% 100%;                       /* PIN: scale anchored bottomCenter */
  transition: transform var(--motion-fast) var(--ease-standard),
              opacity var(--motion-fast) var(--ease-standard);
}
.pin__shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  filter: drop-shadow(var(--shadow-pin-lift)); }
.pin__base { fill: var(--color-surface); }          /* PIN: colour alphaBlended over surface */
.pin__fill { fill: var(--pin-color); }
.pin__outline { fill: none; stroke: var(--color-text); stroke-width: var(--pin-outline); stroke-linejoin: round; }
.pin__disc {
  position: absolute; left: 4px; top: 4px;           /* (36 − 28) / 2 */
  width: var(--pin-disc); height: var(--pin-disc);
  border-radius: 50%; background: var(--color-text);
  display: grid; place-items: center;
}
.pin__disc img { width: var(--pin-icon); height: var(--pin-icon); object-fit: contain; }

.pin--selected { opacity: 1; transform: scale(var(--pin-selected-scale)); }
.pin--selected .pin__outline { stroke: var(--color-gold); stroke-width: var(--pin-outline-selected); }

/* Fresh (< 5 min, MRK freshAlertWindow): _PulseRing — a 36 circle at the pin's
   head, scale 1→1.8, border alpha 0.7→0, 1600 ms easeOutCubic, repeat. */
.pin--fresh::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: var(--pin-w); height: var(--pin-w); border-radius: 50%;
  border: var(--pin-outline) solid var(--pin-color);
  opacity: 0; pointer-events: none;
  animation: pin-pulse var(--motion-pulse) var(--ease-standard) infinite;
}
@keyframes pin-pulse {
  from { transform: scale(1); opacity: 0.7; }
  to   { transform: scale(var(--pin-pulse-scale)); opacity: 0; }
}

/* 6.2 Cluster bubble — StyxClusterBubble. Ring + lift take the most severe
   category colour inside (set --accent), gold when none. Centred on its point. */
.cluster {
  --accent: var(--color-gold);
  width: var(--cluster-sm); height: var(--cluster-sm);
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  border: var(--cluster-ring) solid var(--accent);
  box-shadow: var(--shadow-card-lift);
  color: var(--color-text);
  font: 900 var(--fs-cluster)/1 var(--font-sans);     /* THM w800 → Lato Black */
  font-variant-numeric: tabular-nums;
}
.cluster--md { width: var(--cluster-md); height: var(--cluster-md); }  /* ≥ 10 */
.cluster--lg { width: var(--cluster-lg); height: var(--cluster-lg); }  /* ≥ 50 */

/* 6.3 SOS symbol — StyxMapSymbol: bare 32 square, no pin shell, centred, never clustered */
.sos { width: var(--sos-size); height: var(--sos-size); display: block; border-radius: 50%; }
.sos img { width: 100%; height: 100%; object-fit: contain; }
.sos--selected { transform: scale(var(--pin-selected-scale));
  box-shadow: 0 0 0 var(--pin-outline-selected) var(--color-gold); }

/* 6.4 Station dot — transit_layer.dart CircleLayer: line colour, dark casing;
   interchange = larger white dot. HTML form for the map key; the hero draws
   the same thing in SVG. Set --line. */
.station-dot {
  --line: var(--color-text);
  display: inline-block; flex: none;
  width: var(--station-dot); height: var(--station-dot); border-radius: 50%;
  background: var(--line);
  box-shadow: 0 0 0 var(--transit-casing) var(--color-bg);
}
.station-dot--interchange { --line: var(--color-text); width: var(--station-dot-interchange); height: var(--station-dot-interchange); }

/* 6.5 Transit stroke — StyxTransitStroke: 3 px opaque livery over 1.5 px dark casing
   each side, round caps. HTML sample for the map key: */
.transit-stroke {
  --line: var(--line-m1);
  display: block; height: var(--transit-stroke); border-radius: var(--radius-pill);
  background: var(--line);
  box-shadow: 0 0 0 var(--transit-casing) var(--color-bg);
}

/* 6.6 Line badge — the official IDFM picto (assets/transport/<id>.svg), never redrawn.
   <img class="line-badge" src="img/lines/m4.svg" alt="Métro 4"> */
.line-badge { width: var(--callout-line-picto); height: var(--callout-line-picto); flex: none; }
.line-badge--lg { width: 32px; height: 32px; }
.line-badges { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

/* 6.7 Station callout — StyxStationCallout. 248 wide, surfaceRaised, radius lg,
   pinLift, padding md; caret 16×8 whose tip is the anchor. */
.callout { width: var(--callout-w); position: relative; filter: drop-shadow(var(--shadow-pin-lift)); }
.callout__card {
  background: var(--color-surface-raised);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}
.callout::after {            /* _CaretPainter */
  content: ""; display: block; margin-inline: auto;
  width: var(--callout-caret-w); height: var(--callout-caret-h);
  background: var(--color-surface-raised);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.callout__head { display: flex; align-items: flex-start; gap: var(--space-sm); }
.callout__title {             /* THM styxCalloutTitleStyle */
  flex: 1; font-size: var(--fs-callout-title); font-weight: 700; line-height: 1.2; color: var(--color-text);
}
.callout__close { width: 26px; height: 26px; display: grid; place-items: center;
  color: var(--color-text-muted); border-radius: var(--radius-pill); }
.callout__close svg { width: 18px; height: 18px; }
.callout__lines { margin-top: var(--space-sm); }
.callout__alerts { margin-top: var(--space-md); display: grid; }
.callout__row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-xs) 0; border-radius: var(--radius-sm);
}
.callout__row img { width: var(--callout-alert-picto); height: var(--callout-alert-picto); object-fit: contain; flex: none; }
.callout__row-text { flex: 1; min-width: 0; }
.callout__row-name { font-size: var(--fs-small); font-weight: 700; color: var(--color-text); } /* THM w600 → 700 */
.callout__chevron { width: 18px; height: 18px; color: var(--color-text-muted); flex: none; }
.callout__more { margin-top: var(--space-xs); font-size: var(--fs-caption); color: var(--color-text-muted); }
.callout__action { margin-top: var(--space-md); }
.callout__action .btn { min-height: 44px; font-size: var(--fs-small); }

/* 6.8 Timestamp — StyxTimestampLabel. Warning colour + says so when expired. */
.timestamp {
  display: block; font-size: var(--fs-caption); line-height: 1.4;
  color: var(--color-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;   /* app ellipsises */
}
.timestamp--expired { color: var(--color-warning); }

/* 6.9 Score — alert_modal buildScore: trend arrow + total, green up / orange down */
.score { display: inline-flex; align-items: center; gap: var(--space-sm);
  font: 700 24px/1 var(--font-sans); font-variant-numeric: tabular-nums; }
.score svg { width: 24px; height: 24px; }
.score--up { color: var(--color-income); }
.score--down { color: var(--color-warning); }

/* ===== 7. Alert-type chip & card ========================================= */
/* Chip: inline reference to a category. Picto in the pin's white disc, ring in
   the category colour (colour never carries text: lightTeal/yellow on text fail). */
.type-chip {
  --accent: var(--alert-fallback);
  display: inline-flex; align-items: center; gap: var(--space-sm);
  padding: 4px 14px 4px 4px;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-pill);
  font-size: var(--fs-small); font-weight: 700; color: var(--color-text);
}
.type-disc {
  --accent: var(--alert-fallback);
  width: var(--pin-disc); height: var(--pin-disc); flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--color-text);
  box-shadow: 0 0 0 2px var(--accent);
}
.type-disc img { width: var(--pin-icon); height: var(--pin-icon); object-fit: contain; }
.type-disc--lg { width: 52px; height: 52px; box-shadow: 0 0 0 3px var(--accent); }
.type-disc--lg img { width: 34px; height: 34px; }

/* Card: one per category (alert_type_card.dart's role on the web). Lift takes
   the category colour — cardLift(accent), generic core, local override. */
.type-card {
  --accent: var(--alert-fallback);
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-base); align-items: start;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-lift);
}
.type-card__title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.type-card__body { margin-top: var(--space-xs); font-size: var(--fs-small); line-height: var(--lh-body); color: var(--color-text-muted); }

/* Accent helpers: class sets both --accent and --pin-color */
.t-physical-aggression { --accent: var(--alert-physical-aggression); --pin-color: var(--alert-physical-aggression); }
.t-touching            { --accent: var(--alert-touching);            --pin-color: var(--alert-touching); }
.t-stealing            { --accent: var(--alert-stealing);            --pin-color: var(--alert-stealing); }
.t-drunk-or-drugged    { --accent: var(--alert-drunk-or-drugged);    --pin-color: var(--alert-drunk-or-drugged); }
.t-other               { --accent: var(--alert-other);               --pin-color: var(--alert-other); }
.t-blocked-train       { --accent: var(--alert-blocked-train);       --pin-color: var(--alert-blocked-train); }
.t-crowded-platform    { --accent: var(--color-text-dim);            --pin-color: var(--alert-crowded-platform); } /* ring: slate is 1.7:1 on bg, below 3:1 for UI — dim grey ring instead; pin keeps the app colour */
.t-police-or-security  { --accent: var(--alert-police-or-security);  --pin-color: var(--alert-police-or-security); }

/* ===== 8. Route — the 3-step "how it works", drawn as a metro line ======= */
/* <ol class="route" role="list"><li class="route__stop">…</li>×3</ol> */
.route {
  --line: var(--color-gold);
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xxl);
  counter-reset: stop; padding: 0; list-style: none;
}
.route::before {                       /* the track: livery 3 px, casing — TRS */
  content: ""; position: absolute; left: 7px; right: 7px; top: 7px;
  height: var(--transit-stroke); background: var(--line);
  box-shadow: 0 0 0 var(--transit-casing) var(--color-bg);
  border-radius: var(--radius-pill);
}
.route__stop { position: relative; padding-top: 40px; counter-increment: stop; }
.route__stop::before {                 /* interchange dot, scaled up for a section */
  content: ""; position: absolute; left: 0; top: 0;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--color-text); box-shadow: 0 0 0 3px var(--color-bg);
}
.route__number { font-family: var(--font-serif); font-size: var(--fs-step-number); line-height: 1; color: var(--color-gold); }
.route__title { margin-top: var(--space-sm); font-size: var(--fs-title); font-weight: 700; }
.route__body { margin-top: var(--space-sm); font-size: var(--fs-small); line-height: var(--lh-body); color: var(--color-text-muted); max-width: 34ch; }
@media (max-width: 720px) {
  /* [role="list"] matches the list reset's specificity, which otherwise zeroes this indent */
  .route, .route[role="list"] { grid-template-columns: 1fr; gap: var(--space-xxl); padding-left: 36px; }
  .route::before { display: none; }
  .route__stop { padding-top: 0; }
  .route__stop::before { left: -36px; z-index: 1; }
  .route__stop:not(:last-child)::after {   /* track from this stop's dot to the next one's, never past the last */
    content: ""; position: absolute; left: calc(-36px + 7px); top: 8px;
    bottom: calc(-1 * var(--space-xxl) - 8px);
    width: var(--transit-stroke); background: var(--line);
    box-shadow: 0 0 0 var(--transit-casing) var(--color-bg);
  }
}

/* ===== 9. Freshness timeline (fresh → ageing → expired) ================== */
.freshness { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-base); padding: 0; list-style: none; }
.freshness__stage {
  position: relative; height: 132px;
  display: grid; place-items: end center; padding-bottom: 34px;
  background: var(--map-land);
  border: 1px solid var(--color-divider); border-radius: var(--radius-xl);
  overflow: hidden;
}
.freshness__stage::before {            /* a single line segment under the pin */
  content: ""; position: absolute; left: 0; right: 0; bottom: 32px;
  height: var(--transit-stroke); background: var(--line, var(--line-m4));
  box-shadow: 0 0 0 var(--transit-casing) var(--color-bg);
}
.freshness__stage .station-dot { position: absolute; left: 50%; bottom: 33.5px; transform: translate(-50%, 50%); }
.freshness__stage .pin { position: relative; z-index: 1; margin-bottom: -2px; }
.freshness__ghost {                    /* expired: where the pin was */
  width: var(--pin-w); height: var(--pin-h); position: relative; z-index: 1; opacity: 0.35;
}
.freshness__ghost path { fill: none; stroke: var(--color-text-dim); stroke-width: 1.5; stroke-dasharray: 3 3; }
.freshness__title { margin-top: var(--space-md); font-size: 16px; font-weight: 700; }
.freshness__body { margin-top: var(--space-xs); font-size: var(--fs-small); color: var(--color-text-muted); line-height: var(--lh-body); }
.freshness .timestamp { margin-top: var(--space-xs); }
@media (max-width: 900px) { .freshness { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) {
  .freshness { grid-template-columns: 1fr; }
  .freshness__item { display: grid; grid-template-columns: 112px 1fr; gap: var(--space-base); align-items: center; }
  .freshness__stage { height: 112px; }
  .freshness__title { margin-top: 0; }
}

/* ===== 10. Map key (legend) ============================================== */
.map-key { display: grid; gap: 0; padding: 0; list-style: none; }
.map-key__row {
  display: grid; grid-template-columns: 64px 1fr; gap: var(--space-base); align-items: center;
  padding: var(--space-base) 0; border-top: 1px solid var(--color-divider);
}
.map-key__row:first-child { border-top: 0; }
.map-key__glyph { display: flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 52px; }
.map-key__label { font-size: 15px; font-weight: 700; }
.map-key__desc { font-size: var(--fs-small); color: var(--color-text-muted); line-height: 1.55; margin-top: 2px; }

/* ===== 11. Ledger (privacy: kept / never asked) ========================== */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--color-divider);
  border: 1px solid var(--color-divider); border-radius: var(--radius-xl); overflow: hidden; } /* WEB .trust-grid */
.ledger__col { background: var(--color-surface); padding: var(--space-xl); }
.ledger__title { font-size: 16px; font-weight: 700; }
.ledger__list { margin-top: var(--space-base); padding: 0; list-style: none; display: grid; gap: var(--space-md); }
.ledger__item { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-md); font-size: var(--fs-small); line-height: 1.55; color: var(--color-text-body); }
.ledger__item svg { width: 20px; height: 20px; margin-top: 1px; }
.ledger__col--kept .ledger__item svg { color: var(--color-gold); }
.ledger__col--never .ledger__item svg { color: var(--color-text-dim); }
@media (max-width: 720px) { .ledger { grid-template-columns: 1fr; } }

/* ===== 12. FAQ (native <details>) ======================================== */
.faq { border-bottom: 1px solid var(--color-border-strong); }
.faq-item { border-top: 1px solid var(--color-border-strong); }   /* WEB .faq-item */
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-base);
  min-height: 44px; padding: 22px 0;
  font-size: 16px; font-weight: 700;                                 /* WEB .faq-q */
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--color-gold-hover); }
.faq-item__icon { width: 20px; height: 20px; flex: none; color: var(--color-gold);
  transition: transform var(--motion-base) var(--ease-standard); }
.faq-item[open] .faq-item__icon { transform: rotate(45deg); }        /* + becomes × */
.faq-item__answer { padding: 0 0 22px; max-width: 68ch;
  font-size: var(--fs-small); line-height: 1.7; color: var(--color-text-muted); } /* WEB .faq-a */

/* ===== 13. CTA band (WEB .cta) =========================================== */
.cta { position: relative; border-top: 1px solid rgba(225, 173, 90, 0.18); /* WEB literal */ overflow: hidden; }
.cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(800px 320px at 50% 120%, rgba(225, 173, 90, 0.16), transparent 70%); /* WEB */
}
.cta__inner { position: relative; max-width: 860px; margin-inline: auto; padding: 104px var(--gutter); text-align: center; }
.cta__mark { height: 64px; width: auto; margin: 0 auto var(--space-xl); }
.cta__title { font-family: var(--font-serif); font-weight: 400; font-size: var(--fs-cta); line-height: 1.08; text-wrap: balance; }
.cta__body { margin: 18px auto 0; max-width: 520px; font-size: var(--fs-lede); color: var(--color-text-muted); }
.cta .store-badges { justify-content: center; margin-top: 30px; }

/* ===== 14. Footer (WEB .footer) ========================================== */
.footer { background: var(--color-bg-footer); border-top: 1px solid var(--color-border-strong); }
.footer__inner { max-width: var(--container); margin-inline: auto; padding: 56px var(--gutter) 40px; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-xxl); }
.footer__trademark { margin-top: 14px; font-size: var(--fs-label); color: var(--color-text-muted); letter-spacing: 0.04em; }
.footer__col { display: flex; flex-direction: column; gap: 10px; font-size: var(--fs-small); color: var(--color-text-muted); }
.footer__col-title { font-size: var(--fs-small); font-weight: 700; color: var(--color-text); } /* sentence case, not WEB's tracked caps */
.footer__col a { color: inherit; padding-block: 2px; }
.footer__col a:hover { color: var(--color-text); }
.footer__legal { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--color-border-strong);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-base);
  font-size: var(--fs-label); color: var(--color-text-faint); letter-spacing: 0.04em; } /* faint on footer bg: 4.7:1 */
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

/* ===== 15. Legal page (WEB .page-head / .prose / .fact-list) ============= */
.page-head { position: relative; border-bottom: 1px solid var(--color-divider); }
.page-head::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(1100px 420px at 18% -12%, var(--color-gold-ambient), transparent 70%); }
.page-head__inner { position: relative; max-width: var(--container-prose); margin-inline: auto; padding: 72px var(--gutter) 48px; }
.prose { font-size: var(--fs-body); line-height: var(--lh-prose); color: var(--color-text-body); }
.prose > * + * { margin-top: 18px; }
.prose h2 { font-family: var(--font-serif); font-weight: 400; font-size: 26px; line-height: 1.25; color: var(--color-text); margin-top: 48px; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 20px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--color-gold-border); }
.fact-list { display: grid; grid-template-columns: minmax(190px, 260px) minmax(0, 1fr);
  border: 1px solid var(--color-divider); border-radius: 14px; /* WEB literal */ background: var(--color-surface); overflow: hidden; }
.fact-list dt { padding: 14px 20px; font-size: var(--fs-small); font-weight: 700; color: var(--color-gold); border-top: 1px solid var(--color-divider); }
.fact-list dd { margin: 0; padding: 14px 20px; color: var(--color-text-body); border-top: 1px solid var(--color-divider); }
.fact-list dt:first-of-type, .fact-list dt:first-of-type + dd { border-top: 0; }
@media (max-width: 720px) {
  .fact-list { grid-template-columns: 1fr; }
  .fact-list dd { border-top: 0; padding-top: 0; }
}

/* ===== 16. Map stage (hero + vignettes) ================================== */
/* An 800×800-unit SVG drawn with preserveAspectRatio="xMidYMid slice", plus
   HTML markers placed in the same units. --u = px per unit under "slice"
   = max(width, height) / 800, from container query units, so markers keep
   their real pixel size at every width while sitting on the right station.
   <div class="map-stage">
     <svg class="map-stage__svg" viewBox="0 0 800 800" preserveAspectRatio="xMidYMid slice">…</svg>
     <div class="map-marker map-marker--tip" style="--x:650; --y:360">(.pin)</div>
   </div> */
.map-stage { position: relative; container-type: size; overflow: hidden; background: var(--map-land); }
.map-stage__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-marker {
  --u: calc(max(100cqw, 100cqh) / 800);
  position: absolute;
  left: calc(50% + (var(--x) - 400) * var(--u));
  top:  calc(50% + (var(--y) - 400) * var(--u));
  transform: translate(-50%, -50%);         /* centred: cluster, SOS, dot */
}
.map-marker--tip { transform: translate(-50%, -100%); }   /* pin and callout: bottom-centre is the point */

/* SVG layer classes */
.map-water   { fill: none; stroke: var(--map-water); stroke-width: 26; stroke-linecap: round; }
.map-street  { fill: none; stroke: var(--map-street); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-casing  { fill: none; stroke: var(--color-bg); stroke-width: calc(var(--transit-stroke) + 2 * var(--transit-casing));
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-line    { fill: none; stroke: var(--line); stroke-width: var(--transit-stroke);
  stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.map-dot     { fill: var(--line); stroke: var(--color-bg); stroke-width: var(--transit-casing); vector-effect: non-scaling-stroke; }
.map-dot--interchange { fill: var(--color-text); }

/* ===== 17. Map 3D — the hero: the app's map, tilted ===================== */
/* The real network (IDFM shapes, OSM base) on a plane tilted in perspective.
   Markers are billboards: each one undoes the plane's rotation so pins, SOS
   symbols and the callout stand up facing the viewer at their real pixel size,
   while fresh alerts send a flat ripple across the ground.
   <div class="map3d"><div class="map3d__plane">
     <img class="map3d__base"> <svg class="map3d__network">…</svg>
     <div class="map3d__marker" style="--x:56.5%;--y:44.9%">
       <span class="map3d__ripple t-…"></span><span class="map3d__shadow"></span>
       <div class="map3d__stand">(.pin | .sos | .cluster | .callout)</div>
     </div>
   </div></div>
   --map-rx / --map-rz are registered so the entrance and the drift can animate
   them; every stand reads the same values, so it stays upright throughout. */
@property --map-rx { syntax: "<angle>"; inherits: true; initial-value: 56deg; }
@property --map-rz { syntax: "<angle>"; inherits: true; initial-value: -16deg; }

.map3d {
  --map-rx: var(--map3d-tilt);
  --map-rz: var(--map3d-turn);
  position: relative; overflow: hidden; container-type: size;
  background: var(--map-land);
  perspective: var(--map3d-perspective); perspective-origin: 50% 18%;
}
.map3d::after {                                   /* fog: the far edge and the near edge melt into the page */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background:
    linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 20%, color-mix(in srgb, var(--color-bg) 55%, transparent) 30%, transparent 44%, transparent 82%, var(--color-bg) 100%);
}
.map3d__plane {
  position: absolute; left: 50%; top: 58%;
  width: max(150cqw, 170cqh); aspect-ratio: 1;
  transform: translate(-50%, -50%) rotateX(var(--map-rx)) rotateZ(var(--map-rz));
  transform-style: preserve-3d;
}
.map3d__base, .map3d__network { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.map3d__network .map-dot { stroke-width: var(--transit-casing); }

.map3d__marker { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; transform-style: preserve-3d; }
.map3d__stand {
  position: absolute; left: 0; bottom: 0;
  transform-origin: 0 100%;
  transform: rotateZ(calc(-1 * var(--map-rz))) rotateX(calc(-1 * var(--map-rx))) translateX(-50%);
}
.map3d__stand > * { display: block; }
.map3d__shadow {                                  /* contact shadow on the ground, under a standing marker */
  position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-pin-shadow); filter: blur(3px);
}
.map3d__ripple {                                  /* a fresh alert's pulse, laid flat on the map */
  --pin-color: var(--color-gold);
  position: absolute; left: calc(var(--pin-w) / -2); top: calc(var(--pin-w) / -2);
  width: var(--pin-w); height: var(--pin-w); border-radius: 50%;
  border: var(--pin-outline) solid var(--pin-color);
  box-shadow: 0 0 18px var(--pin-color);
  opacity: 0;
  animation: map3d-ripple var(--motion-pulse) var(--ease-standard) infinite;
  animation-delay: var(--ripple-delay, 0ms);
}
@keyframes map3d-ripple {
  from { transform: scale(0.4); opacity: 0.85; }
  to   { transform: scale(var(--map3d-ripple-scale)); opacity: 0; }
}

/* Entrance: the map tilts down from above into place, then markers land.
   Afterwards the plane turns slowly back and forth. Scoped to .is-animated. */
.is-animated .map3d {
  animation:
    map3d-in var(--motion-reveal) var(--ease-standard) both,
    map3d-drift var(--map3d-drift) ease-in-out var(--motion-reveal) infinite alternate;
}
@keyframes map3d-in { from { --map-rx: 18deg; opacity: 0; } to { --map-rx: var(--map3d-tilt); opacity: 1; } }
@keyframes map3d-drift { from { --map-rz: var(--map3d-turn); } to { --map-rz: var(--map3d-turn-end); } }
.is-animated .hero-drop { opacity: 0; animation: marker-drop var(--motion-base) var(--ease-standard) var(--delay, 720ms) forwards; }
@keyframes marker-drop { from { opacity: 0; translate: 0 -10px; } to { opacity: 1; translate: 0 0; } }
.is-animated .hero-callout { opacity: 0; animation: callout-in var(--motion-slow) var(--ease-standard) 1440ms forwards; }
@keyframes callout-in { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }

/* Pause ambient loops while the hero is off screen (js toggles .is-offscreen) */
.is-offscreen .map3d, .is-offscreen .map3d__ripple, .is-offscreen .pin--fresh::before { animation-play-state: paused; }

/* ===== 17b. City tags — the served cities (the app's city list, NetworkList) ===
   One tag per city. A city with a metro carries a gold hairline (generic core:
   pill, caption size, surface; the metro mark is the only variant). Order is the
   API's: Paris first, then alphabetical. */
.city-tags__title {
  margin-top: var(--space-xl); font-size: var(--fs-label); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-dim);
}
.city-tags { margin-top: var(--space-md); padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.city-tag {
  padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill);
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  font-size: var(--fs-small); color: var(--color-text-body); white-space: nowrap;
}
.city-tag--metro { border-color: var(--color-gold-hairline); color: var(--color-text); }
.city-tag--sample { display: inline-block; width: var(--space-xl); padding: 0; height: var(--space-base); vertical-align: middle; }
.city-tags__legend { margin-top: var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); font-size: var(--fs-caption); color: var(--color-text-dim); }

/* ===== 18. Reduced motion ================================================ */
@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;
  }
  .pin--fresh::before { display: none; }          /* PIN: no ring under reduced motion */
  .is-animated .map3d { animation: none; }
  .map3d__ripple { display: none; }               /* no ambient motion: the still map only */
  .is-animated .hero-drop, .is-animated .hero-callout { opacity: 1; animation: none; }
}
