/* ============================================================
   CruisePort AI · _tokens.css · v6

   One token file, one component file. No per-page layer.
   This is the single source of truth for design tokens. It carries:
     1. the base token set (from _styles.css:27-74, values verbatim
        except the documented --fg-3 contrast fix),
     2. the status ink + line tokens promoted from 50+ raw hex,
     3. the missing utility tokens (--mono, --fs-micro, --focus-*),
     4. the variabilised hero image,
     5. the reader-mode overrides (from _a11y.css:18-63, intact),
        which re-point these same tokens for the accessibility wedge.

   Contract: status uses ink + line tokens, never raw hex. Never use
   --warn as a text colour. Chips/badges/tags are square at 4px.
   --r-pill is reserved for the Ask CruisePort FAB only.

   Copy rule for this file: no em or en dashes anywhere. The middle dot
   and the colon are the separators, on purpose.

   Lockstep rule: if you RENAME or LIGHTEN any colour token, mirror the
   change in html[data-contrast="high"] below, or high-contrast mode
   breaks silently.
   ============================================================ */

:root {
  /* ---- BRAND PALETTE ---- */
  --navy:        #2C344C;
  --navy-ink:    #1A2036;
  --navy-soft:   #3C465F;
  --gold:        #D4B86A;
  --gold-hover:  #C0A558;
  --paper:       #FAF8F3;
  --card:        #FFFFFF;
  --muted-fill:  #F1ECE1;
  --rule:        #E4DECF;

  /* ---- TEXT RAMP (measured on --paper) ----
     fg-3 was #6B7489 at 4.41:1, below the AA floor of 4.5:1 and used 52
     times. Darkened to #5A6478 at 5.6:1. fg-1 is 14.8:1, fg-2 is 8.9:1.
     All three text greys now pass AA in default mode, no toggle needed. */
  --fg-1:        #1A2036;
  --fg-2:        #3C465F;
  --fg-3:        #5A6478;

  /* ---- STATUS: fill + soft pair ----
     --warn is a fill / border / icon colour ONLY. It is 3.43:1 on paper,
     so it is never a body-text colour. For status text use --warn-ink. */
  --ok:          #2F7A4A;  --ok-soft:   #E6F1E9;
  --warn:        #B7791F;  --warn-soft: #FBF2DE;
  --bad:         #B0283C;  --bad-soft:  #F7E2E5;
  --info:        #1E40AF;  --info-soft: #F0F7FF;

  /* ---- STATUS: ink (text) + line (border) ----
     Promoted from raw hex repeated 50+ times across the old v3 / v4 layers.
     Each ink exceeds AA on its matching -soft fill. Use these, never raw hex. */
  --ok-ink:      #246039;  --ok-line:   #C6E8D4;
  --warn-ink:    #7A4A0F;  --warn-line: #F8D9A4;
  --bad-ink:     #8E1F30;  --bad-line:  #F0C2C2;
                           --info-line: #BCD6F0;

  /* ---- TYPE FAMILIES ----
     --mono was referenced as var(--mono, 'JetBrains Mono', monospace) in the
     old v4 but never defined. Defined here as a system-mono stack, so the
     placeholder and key labels render without loading a new family. */
  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- TYPE FLOOR ----
     Minimum on-screen text size. Several 9 to 10px labels were
     !important-lifted because the scale had no floor. Use this token
     instead of going smaller. */
  --fs-micro: 11px;

  /* ---- RADII ----
     Chips / badges / tags / pills are SQUARE at --r-4. --r-pill (9999px) is
     reserved for ONE exception: the Ask CruisePort FAB. Cards use --r-6 / --r-8. */
  --r-4:  4px;
  --r-6:  6px;
  --r-8:  8px;
  --r-pill: 9999px;

  /* ---- SHADOWS ---- */
  --sh-sm: 0 1px 2px rgba(26,32,54,0.06);
  --sh-md: 0 4px 12px rgba(26,32,54,0.08);
  --sh-lg: 0 12px 32px rgba(26,32,54,0.12);

  /* ---- SPACING ---- */
  --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;

  /* ---- LAYOUT ---- */
  --container: 1280px;
  --nav-h: 64px;
  --tabs-h: 52px;

  /* ---- FOCUS RING (one spec) ----
     The gold ring was hand-written 24 times with offsets of 1 / 2 / 3px,
     some inside, some outside. One spec now: width var(--focus-ring-w),
     offset var(--focus-offset), colour var(--gold). */
  --focus-ring-w: 3px;
  --focus-offset: 2px;

  /* ---- HERO IMAGE ----
     Was baked into .pg-home-hero and .pg-page-head--hero in the old v3.
     Variabilised so a page, or a port guide, can override the source. */
  --hero-img: url('https://images.unsplash.com/photo-1548574505-5e239809ee19?w=2000&q=70');
}

/* ============================================================
   RAW-HEX SWEEP MAP  (for _components.css, the next turn)
   Replace these near-duplicates with the canonical token. No visual change
   at the listed values; the off-by-a-hair variants fold into one token.

     #246039, #1F5C38            ->  var(--ok-ink)
     #7A4A0F, #8A5A12            ->  var(--warn-ink)
     #8E1F30                     ->  var(--bad-ink)
     #C6E8D4                     ->  var(--ok-line)
     #F8D9A4, #F3D9A8            ->  var(--warn-line)
     #F0C2C2                     ->  var(--bad-line)
     #BCD6F0                     ->  var(--info-line)

   And the contract: stop passing --warn to a text colour. Where the old
   layers did (status body text), switch to --warn-ink, or keep --warn on
   an icon and add a text label.
   ============================================================ */

/* ============================================================
   READER-MODE OVERRIDES  (from _a11y.css:18-63, intact)
   These re-point the tokens above for the accessibility wedge. This is the
   one genuinely systemic idea in the old five files, and it must survive.
   The body-apply rule (font-size / line-height / spacing) lives in
   _components.css, next to the rest of the base layer.
   ============================================================ */
:root {
  --t-base: 16px;
  --lh:     1.55;
  --ls:     0em;
  --ws:     0em;
}

html[data-size="l"]  { --t-base: 19px; }
html[data-size="xl"] { --t-base: 22px; }

html[data-dys="on"] {
  --serif: 'Lexend', sans-serif;
  --sans:  'Lexend', sans-serif;
  --ls:    .01em;
  --ws:    .08em;
  --lh:    1.78;
}

html[data-spacing="loose"] {
  --lh: 1.95;
  --ls: .03em;
  --ws: .14em;
}

/* High-contrast re-points the whole palette: fg pushed to #050810, gold
   recomputed to #B8962A at 5.91:1. The status ink / line and the -soft fills
   are left at their defaults on purpose: each ink already exceeds AA on its
   soft fill, so status stays strong here. Mirror a change in this block only
   if a default ink is lightened, or a token is renamed. */
html[data-contrast="high"] {
  --paper:      #FFFFFF;
  --card:       #FFFFFF;
  --fg-1:       #050810;
  --navy-ink:   #050810;
  --fg-2:       #12191F;
  --fg-3:       #252F35;
  --rule:       #1A2036;
  --muted-fill: #EEE9DE;
  --navy:       #062030;
  --navy-soft:  #0A1C28;
  --gold:       #B8962A;
  --gold-hover: #A07F1F;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation:       none !important;
  transition:      none !important;
  scroll-behavior: auto !important;
}
