/* tokens/colors.css */
/* ============================================================
   COLORS — Blacktop Volt (Keynote Energy)
   ------------------------------------------------------------
   Dark stage, volt yellow-green as the loud color, hot pink as
   the second voice. Token NAMES are kept from Frontier Editorial
   so every component re-themes without code changes:
   paper-* = stage surfaces (dark), ink-* = text (light),
   oxblood = volt, saddle/tan = pink.
   ============================================================ */

:root {
  /* --- Paper / warm neutral surfaces (light -> deep) --- */
  --paper-000: #181818; /* raised card, lighter than page */
  --paper-100: #0B0B0B; /* page background — warm bone/parchment */
  --paper-200: #141414; /* subtle sunken surface */
  --paper-300: #222222; /* panels, hovered rows */
  --paper-400: #5C5C58; /* hairline rules on paper */

  /* --- Ink / warm charcoal neutrals (near-black -> faint) --- */
  --ink-900: #F2F2EC; /* near-black headline ink */
  --ink-800: #E4E4DD;
  --ink-700: #D6D6CF; /* body text */
  --ink-600: #BDBDB6;
  --ink-500: #A9A9A2; /* muted text */
  --ink-400: #8C8C86; /* faint / placeholder */
  --ink-300: #6B6B66; /* disabled */

  /* --- Leather / saddle accents --- */
  --saddle-700: #FF8FBD; /* deep saddle */
  --saddle-500: #FF3D8B; /* saddle brown — primary leather accent */
  --tan-400:    #FF3D8B; /* dusty tan */
  --tan-200:    #3A1527; /* faded tan wash */

  /* --- Emphasis: oxblood + rust --- */
  --oxblood-700: #E6FF8A; /* deepest emphasis */
  --oxblood-500: #D4FF3A; /* primary emphasis — oxblood */
  --rust-500:    #FF8A3D; /* rust — warm alert / highlight */
  --rust-200:    #3A2414; /* rust wash */

  /* --- Secondary earth tones (trail signage) --- */
  --denim-600: #8FB3FF; /* deep faded denim */
  --denim-400: #5B8CFF; /* faded denim blue */
  --denim-200: #16223A; /* denim wash */
  --sage-600:  #9FE0A8;
  --sage-400:  #5FC27A; /* sage green */
  --sage-200:  #142A1B; /* sage wash */

  /* --- Pure black/white anchors (used rarely) --- */
  --true-black: #000000;
  --true-white: #FFFFFF;

  /* ==========================================================
     SEMANTIC ALIASES — reach for these in product code
     ========================================================== */

  /* Surfaces */
  --surface-page:    var(--paper-100);
  --surface-card:    var(--paper-000);
  --surface-sunken:  var(--paper-200);
  --surface-panel:   var(--paper-300);
  --surface-inverse: var(--oxblood-500); /* volt stage band */

  /* Text */
  --text-strong:  var(--ink-900);
  --text-body:    var(--ink-700);
  --text-muted:   var(--ink-500);
  --text-faint:   var(--ink-400);
  --text-ondark:  var(--paper-100);
  --text-ondark-muted: #3D4A12;

  /* Lines / borders */
  --border-hairline: var(--paper-400);
  --border-strong:   var(--ink-900);
  --border-leather:  var(--saddle-500);

  /* Accents — by role */
  --accent-emphasis: var(--oxblood-500); /* the one "loud" color */
  --accent-leather:  var(--saddle-500);
  --accent-cool:     var(--denim-400);
  --accent-sage:     var(--sage-400);
  --accent-rust:     var(--rust-500);

  /* Status (kept earthbound, not candy) */
  --status-positive: var(--sage-600);
  --status-warning:  var(--rust-500);
  --status-danger:   var(--oxblood-500);
  --status-info:     var(--denim-400);

  /* Interactive ink links */
  --link:       var(--oxblood-500);
  --link-hover: var(--oxblood-700);

  /* Accent text on the volt inverse band */
  --accent-on-inverse: #A3004A;

  /* Focus ring */
  --focus-ring: var(--saddle-500);
}

/* tokens/typography.css */
/* ============================================================
   TYPOGRAPHY — Blacktop Volt
   ------------------------------------------------------------
   Barlow Condensed Black Italic for headlines (race-bib energy),
   Barlow Condensed upright for labels, Barlow for body, IBM Plex
   Mono for data and metadata.
   ============================================================ */

:root {
  /* --- Families --- */
  --font-display:   'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-condensed: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-sans:      'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:      'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* --- Weights --- */
  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;

  /* --- Type scale (editorial; generous top end) --- */
  --text-7xl: 112px; /* hero display */
  --text-6xl: 88px;
  --text-5xl: 68px;
  --text-4xl: 52px;
  --text-3xl: 38px;
  --text-2xl: 28px;
  --text-xl:  20px;
  --text-lg:  18px;
  --text-md:  16px; /* base body */
  --text-sm:  14px;
  --text-xs:  12.5px;
  --text-2xs: 11px; /* trail-marker labels */

  /* --- Line heights --- */
  --leading-tight:   0.92; /* display headlines */
  --leading-snug:    1.18;
  --leading-normal:  1.5;  /* body */
  --leading-relaxed: 1.66; /* long-form essays */

  /* --- Tracking --- */
  --tracking-tight:  -0.01em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-label:  0.14em; /* ALL-CAPS section labels / trail markers */

  /* ==========================================================
     SEMANTIC TEXT ROLES
     ========================================================== */

  /* Display — Zilla Slab, tight */
  --type-display-font:    var(--font-display);
  --type-display-weight:  var(--weight-bold);
  --type-display-leading: var(--leading-tight);
  --type-display-tracking:var(--tracking-tight);

  /* Eyebrow / section label / trail marker — condensed all-caps */
  --type-label-font:     var(--font-condensed);
  --type-label-weight:   var(--weight-semibold);
  --type-label-size:     var(--text-2xs);
  --type-label-tracking: var(--tracking-label);
  --type-label-transform:uppercase;

  /* Body — Plex Sans */
  --type-body-font:    var(--font-sans);
  --type-body-weight:  var(--weight-regular);
  --type-body-leading: var(--leading-normal);

  /* Long-form essay — Plex Sans, relaxed */
  --type-prose-leading: var(--leading-relaxed);

  /* Mono / ledger / data / metadata */
  --type-mono-font:     var(--font-mono);
  --type-mono-weight:   var(--weight-regular);
  --type-mono-tracking: 0.01em;
}

/* tokens/spacing.css */
/* ============================================================
   SPACING & LAYOUT — Frontier Editorial
   ------------------------------------------------------------
   4px base. Editorial = lots of breathing room. Restrained grid,
   thin rules, generous vertical rhythm.
   ============================================================ */

:root {
  /* --- Spacing scale (4px base) --- */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;
  --space-40: 160px;

  /* --- Radii (Keynote: pill controls, soft big cards) --- */
  --radius-none: 0;
  --radius-xs:   6px;
  --radius-sm:   999px;
  --radius-md:   20px;
  --radius-lg:   28px;
  --radius-stamp:12px;  /* badge/stamp corners */
  --radius-pill: 999px;

  /* --- Hairlines / rules (the ledger lines) --- */
  --rule-thin:   1px;
  --rule-medium: 1.5px;
  --rule-thick:  2px;

  /* --- Containers --- */
  --container-prose: 680px;  /* essay measure */
  --container-text:  860px;
  --container-wide:  1120px;
  --container-max:   1280px;

  /* --- Gutters --- */
  --gutter-page:    var(--space-6);
  --gutter-section: var(--space-24);
}

/* tokens/elevation.css */
/* ============================================================
   ELEVATION — Frontier Editorial
   ------------------------------------------------------------
   Mostly flat. Hairline borders do the work. Shadows are warm,
   soft, and rare — like paper lifted a millimeter off a desk.
   ============================================================ */

:root {
  /* Warm-tinted shadows (brown-black, never pure grey) */
  --shadow-none: none;
  --shadow-xs:  0 1px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.07), 0 1px 1px rgba(0, 0, 0, 0.05);
  --shadow-md:  0 4px 14px -6px rgba(0, 0, 0, 0.16), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg:  0 16px 40px -16px rgba(0, 0, 0, 0.24), 0 4px 10px rgba(0, 0, 0, 0.07);

  /* Pressed / inset (ledger groove) */
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.10);

  /* Stamp ring — used for badges/seals */
  --ring-stamp: 0 0 0 1.5px rgba(212, 255, 58, 0.6);

  /* Focus ring */
  --shadow-focus: 0 0 0 3px rgba(255, 61, 139, 0.45);

  /* Transitions — calm, no bounce */
  --ease-standard: cubic-bezier(0.2, 0, 0.1, 1); /* @kind other */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1); /* @kind other */
  --duration-fast: 120ms; /* @kind other */
  --duration-base: 200ms; /* @kind other */
  --duration-slow: 320ms; /* @kind other */
}

/* tokens/base.css */
/* ============================================================
   BASE — Frontier Editorial
   Light element defaults + a few brand utilities. Tokens only,
   no magic numbers. Safe to ship to consumers.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--tan-200); color: var(--ink-900); }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

/* --- Editorial headings --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--weight-bold);
  margin: 0;
  text-wrap: balance;
  font-style: italic;
  font-weight: 900;
  text-transform: uppercase;
}

/* Every display-face run is set in the italic cut (race-bib lean). */
[style*="--font-display"] { font-style: italic; }

/* --- Trail-marker / eyebrow label --- */
.fe-eyebrow {
  font-family: var(--font-condensed);
  font-weight: var(--weight-semibold);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Numbered trail marker (e.g. "01 / BUILD") --- */
.fe-marker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--accent-leather);
}

/* --- Ledger hairline rule --- */
.fe-rule {
  border: 0;
  border-top: var(--rule-thin) solid var(--border-hairline);
  margin: 0;
}
.fe-rule--ink { border-top-color: var(--ink-900); }

/* --- Mono metadata --- */
.fe-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--type-mono-tracking);
  color: var(--text-muted);
}

/* --- Prose measure --- */
.fe-prose { max-width: var(--container-prose); line-height: var(--leading-relaxed); }
.fe-prose p { margin: 0 0 var(--space-5); }

/* site-extra.css */
  html { scroll-behavior: smooth; }
  body { margin: 0; background: var(--surface-page); }
  [data-lucide] svg { width: 100%; height: 100%; }


  /* CAS Minute episode rows */
  .cas-ep { transition: background var(--duration-base) var(--ease-standard); }
  .cas-ep:hover { background: var(--surface-card); }
  .cas-ep:hover .cas-listen { color: var(--oxblood-700, var(--oxblood-500)); }
  .cas-ep .cas-listen { transition: transform var(--duration-base) var(--ease-standard); }
  .cas-ep:hover .cas-listen { transform: translateX(2px); }

  /* ============================================================
     RESPONSIVE LAYER
     Inline React styles set the desktop grids; these class rules
     use !important to win on smaller viewports. Type scale is
     re-declared on #root so every var(--text-*) heading steps
     down at once — scoped to the site, not the global tokens.
     ============================================================ */

  /* Mobile-menu chrome: hidden on desktop, shown under 880px */
  .fe-menu-btn { display: none; }
  .fe-mobile-nav { display: none; }

  /* --- Tablet & down (≤ 980px): collapse wide editorial splits --- */
  @media (max-width: 980px) {
    .fe-split,
    .fe-body-grid { grid-template-columns: 1fr !important; gap: var(--space-10) !important; }
    .fe-aside { position: static !important; top: auto !important; }
    .fe-cover { justify-self: start !important; max-width: 420px !important; margin-top: var(--space-4); }
    .fe-footer-grid { grid-template-columns: 1.2fr 1fr 1fr !important; row-gap: var(--space-10) !important; }
  }

  /* --- Mid (≤ 880px): show hamburger, hide inline desktop nav --- */
  @media (max-width: 880px) {
    .fe-nav-desktop { display: none !important; }
    .fe-menu-btn { display: inline-flex !important; }
    .fe-talk-desktop { display: none !important; }
    .fe-2col { grid-template-columns: 1fr !important; }
    .fe-featured-grid { grid-template-columns: 1fr !important; }
    .fe-featured-img { min-height: 200px !important; aspect-ratio: 16 / 10; }
  }

  /* --- Phone (≤ 640px): step down type, tighten gutters, stack data --- */
  @media (max-width: 640px) {
    #root {
      --text-7xl: 64px;
      --text-6xl: 56px;
      --text-5xl: 46px;
      --text-4xl: 38px;
      --text-3xl: 30px;
      --text-2xl: 24px;
      --text-xl:  18px;
    }
    .fe-wrap { padding-left: var(--space-5) !important; padding-right: var(--space-5) !important; }
    .fe-stat-4 { grid-template-columns: 1fr 1fr !important; gap: var(--space-8) var(--space-6) !important; }
    .fe-footer-grid { grid-template-columns: 1fr 1fr !important; }
    .fe-featured-pad { padding: var(--space-6) !important; }
    /* episode + event rows: number stays beside title, action drops below */
    .fe-ep-row,
    .fe-event-row { grid-template-columns: auto 1fr !important; gap: var(--space-4) !important; }
    .fe-ep-row .cas-listen { grid-column: 1 / -1; padding-top: 0 !important; }
    .fe-event-row .fe-event-years { grid-column: 1 / -1; justify-content: flex-start !important; max-width: none !important; }
    /* section vertical rhythm a touch tighter */
    .fe-hero { padding-top: var(--space-10) !important; padding-bottom: var(--space-10) !important; }
  }

  /* --- Small phone (≤ 420px): single-column data too --- */
  @media (max-width: 420px) {
    .fe-stat-4 { grid-template-columns: 1fr 1fr !important; }
    .fe-footer-grid { grid-template-columns: 1fr !important; }
  }

  /* Keynote ticker band */
  .fe-ticker { background: var(--oxblood-500); color: var(--paper-100); overflow: hidden; white-space: nowrap; padding: 14px 0; transform: rotate(-1.2deg); margin: 8px -24px 0; }
  .fe-ticker-track { display: inline-flex; animation: fe-marquee 36s linear infinite; }
  .fe-ticker-track span { font-family: var(--font-display); font-style: italic; font-weight: 900; font-size: 38px; text-transform: uppercase; letter-spacing: 0.01em; padding-right: 0.3em; }
  @keyframes fe-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  @media (prefers-reduced-motion: reduce) { .fe-ticker-track { animation: none; } }
  @media (max-width: 880px) { .fe-2col { grid-template-columns: 1fr !important; } .fe-circuit { grid-template-columns: 1fr 1fr !important; } }
