/* ============================================================
   deslop.media · Forecast PAGE — page shell + mobile-first layout.
   Self-contained: the deslop tokens are COPIED here as :root vars
   (NOT @imported from speedo-pub, a hot read-only surface). This
   file owns the PAGE chrome (hero / sections / footer / breadcrumb
   / mobile-flow). The INSTRUMENT's own surfaces are styled by
   forecast-instrument.css + each component. All .fi-* namespaced.
   Flat, dark-native: NO gradients, NO shadows, NO glow. ONE easing.

   BASE = MOBILE. Desktop spread starts at the --island breakpoint
   (@media min-width: 720px). Reduced-motion + ≤640px turn the
   scroll-morph OFF and let the hero autoplay on the instrument face.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Inter+Tight:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ── deslop tokens (copied from deslop-tokens.css) ─────────── */
  --color-bg: #101820;
  --color-surface: #1a2230;
  --color-surface-2: #151c27;
  --color-border: #2a3240;
  --color-border-subtle: #1e2835;

  --color-text: #E8E6E1;
  --color-text-secondary: #8A8F98;
  --color-text-tertiary: #828a99;   /* lifted for mobile AA legibility (was #5a6070 ~2.6:1) */

  --color-volt: #CEFF00;            /* hold / signal — THE ONLY GREEN */
  --color-coral: #d9646e;           /* deny */
  --color-steel: #b6c2d4;           /* structure */
  --color-accent: #CEFF00;
  --color-accent-hover: #d9ff4d;

  --font-editorial: 'Inter Tight', 'Inter', -apple-system, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale — mobile-first sizes; desktop bumps below. */
  --fs-display: 2.25rem;    /* hero verdict — mobile */
  --fs-h1: 1.875rem;
  --fs-h2: 1.5rem;
  --fs-h3: 1.1875rem;
  --fs-body: 1rem;
  --fs-body-sm: 0.9375rem;
  --fs-meta: 0.8125rem;     /* 13px */
  --fs-micro: 0.75rem;      /* 12px — legibility floor pinned ≥11px */
  --fs-tiny: 0.6875rem;     /* 11px */

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 0.15s;
  --dur: 0.2s;

  /* ── page layout tokens ──────────────────────────────────── */
  --page-max: 72rem;        /* page max width */
  --read-max: 44rem;        /* editorial reading column ~700px */
  --hit: 44px;              /* minimum touch target */
  --island: 720px;          /* the mobile→desktop breakpoint */
}

/* ── Reset / base (mobile-first) ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--color-text);
  /* Sentence case is a copy rule, enforced in content not CSS:
     never text-transform headings to uppercase. */
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p { margin-bottom: var(--space-md); color: var(--color-text-secondary); }

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--color-accent-hover); }

code, .mono { font-family: var(--font-mono); }

.editorial {
  font-family: var(--font-editorial);
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* Mono uppercase label — section labels, kickers, stamps. */
.label-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-secondary);
}

/* ── Page frame ────────────────────────────────────────────── */
.fp-page { width: 100%; overflow-x: hidden; }

.fp-wrap {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--space-md);
}
.fp-read {
  width: 100%;
  max-width: var(--read-max);
  margin-inline: auto;
}

/* Section rhythm. Each top-level page section gets vertical air and a
   subtle top hairline so the page reads as discrete bands. */
.fp-section {
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--color-border-subtle);
}
.fp-section:first-of-type { border-top: 0; }

.fp-section__kicker { margin-bottom: var(--space-sm); }
.fp-section__title {
  font-family: var(--font-editorial);
  font-size: var(--fs-h2);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-md);
}
.fp-section__lede {
  max-width: var(--read-max);
  font-size: var(--fs-body);
  color: var(--color-text-secondary);
}

/* ── HERO (pinned scroll-animation host) ───────────────────────
   On desktop the hero is a tall scroll-stage: the .fp-hero is given
   height by the animation (the Build agent sets the scroll length);
   .fp-hero__pin sticks while the acts play. On mobile / reduced-
   motion the pin is released and the acts autoplay (mobile-flow). */
.fp-hero {
  position: relative;
  width: 100%;
}
.fp-hero__pin {
  position: sticky;
  top: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: var(--space-2xl);
}
.fp-hero__stamp { margin-bottom: var(--space-md); }
.fp-hero__verdict {
  font-family: var(--font-editorial);
  font-size: var(--fs-display);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin-bottom: var(--space-lg);
}
.fp-hero__verdict .fp-hl-noLead { color: var(--color-text); }
.fp-hero__anim {
  position: relative;
  width: 100%;
  min-height: 40svh;
}
.fp-hero__captions { min-height: 3.5em; margin-top: var(--space-lg); }

/* ANIMATION PAUSED (operator, 2026-06-14) — the 5-act hero is a reviewable
   DRAFT, opt-in only behind ?anim=1. Default = a clean compact STATIC hero
   (the static verdict + the settled instrument below), no tall scroll-stage,
   no animation-only chrome. Mirrors the reduced-motion treatment. */
.fp-anim-paused .fp-hero { min-height: auto !important; }
.fp-anim-paused .fp-hero__pin {
  position: static; top: auto;
  min-height: auto !important;   /* collapse the reserved 100svh scroll-scrub
                                    height so the paused hero leaves no empty
                                    gap above the instrument */
}
.fp-anim-paused .fp-hero__anim,
.fp-anim-paused .fp-hero__captions,
.fp-anim-paused .fp-breadcrumb { display: none; }

/* ── Sticky compact readout (#fi-sticky) ────────────────────────────
   Follows the reader once the full headline scrolls above the viewport,
   so changing a dial down at the controls visibly moves an anchored
   answer. A SECOND readout element (the orchestrator still solely owns
   #fi-headline). Reveals via the .is-visible class set by an
   IntersectionObserver on #fi-headline. */
.fi-sticky {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px var(--space-md);
  padding: 10px var(--space-lg);
  background: var(--color-surface);
  border-top: 2px solid var(--color-volt);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 6px 20px -8px rgba(0, 0, 0, .6);
  transform: translateY(-101%);
  transition: transform var(--dur) var(--ease);
  pointer-events: none;
}
.fi-sticky.is-visible { transform: translateY(0); }
.fi-sticky__name {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-text-secondary);
}
/* NO-CROWN: a neutral live-instrument marker, not a win color — steel,
   never volt, so nothing in the sticky reads as a crowned winner. */
.fi-sticky__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-steel); flex: none;
}
.fi-sticky__yr {
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  letter-spacing: .04em; color: var(--color-text-tertiary);
}
.fi-sticky__scs {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 14px;
}
.fi-sticky__sc {
  font-size: 12.5px; color: var(--color-text-secondary); white-space: nowrap;
}
.fi-sticky__sc b {
  font-family: var(--font-mono); font-weight: 600; color: var(--color-text);
}
/* NO-CROWN: no per-scenario win color in the sticky — the heaviest pattern
   is shown in plain text like the rest, never volt. */
@media (prefers-reduced-motion: reduce) { .fi-sticky { transition: none; } }
@media (max-width: 640px) {
  .fi-sticky { padding: 8px var(--space-md); }
  .fi-sticky__sc { font-size: var(--fs-micro); }
}

/* ── SOURCE toggle + per-source blocks (the Source architecture) ──
   One toggle [ Forecast | Experts ] under the headline; the chosen
   source sets <html data-fi-source>, which shows/hides the per-source
   content inside the stacked speedometer + cascade blocks. */
.fi-source {
  display: flex; align-items: center; gap: var(--space-md);
  flex-wrap: wrap; margin: var(--space-sm) 0 var(--space-md);
}
.fi-source__lab {
  color: var(--color-text-tertiary); font-size: var(--fs-tiny);
  letter-spacing: .08em; text-transform: uppercase;
}
.fi-source__group { display: flex; gap: var(--space-sm); }
.fi-source__seg {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  min-height: 44px; padding: 6px 16px;
  border: 1px solid var(--color-border); border-radius: 10px;
  background: var(--color-surface-2); color: var(--color-text-secondary);
  font-family: var(--font-sans);
  transition: background var(--dur) var(--ease),
    color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.fi-source__nm { font-weight: 600; font-size: 15px; line-height: 1.1; }
.fi-source__sub {
  font-family: var(--font-mono); font-size: var(--fs-tiny);
  letter-spacing: .04em; opacity: .85;
}
.fi-source__seg.is-on {
  background: var(--color-volt); color: #0c1116;
  border-color: var(--color-volt);
}
.fi-source__seg:focus-visible {
  outline: 2px solid var(--color-volt); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .fi-source__seg { transition: none; }
}

.fi-block { margin: var(--space-lg) 0; }
.fi-block__kicker {
  display: block; color: var(--color-text-tertiary);
  margin-bottom: var(--space-sm);
}

/* per-source visibility — experts content is hidden until the toggle
   selects it; forecast is the default (no attribute needed). */
.fi-experts-only { display: none; }
[data-fi-source="experts"] .fi-forecast-only { display: none; }
[data-fi-source="experts"] .fi-experts-only { display: block; }

/* Breadcrumb act-tracker — 5 dots/labels, the current act lit volt. */
.fp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  list-style: none;
  margin-top: var(--space-lg);
}
.fp-breadcrumb__step {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: var(--hit);
  font-family: var(--font-mono);
  font-size: var(--fs-tiny);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-tertiary);
}
.fp-breadcrumb__step[aria-current="step"],
.fp-breadcrumb__step.is-active { color: var(--color-volt); }
.fp-breadcrumb__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  flex: 0 0 auto;
}
.fp-breadcrumb__step.is-active .fp-breadcrumb__dot {
  background: var(--color-volt);
}

/* ── INSTRUMENT (settled state) host ───────────────────────────
   The instrument's own internal layout lives in forecast-instrument
   .css; here we just give it a band on the page. */
.fp-instrument { padding-block: var(--space-2xl); }

/* ── Disclosure (honesty spine, always visible) ─────────────── */
.fp-disclosure {
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-volt);
  border-radius: var(--radius-md);
  background: var(--color-surface-2);
  padding: var(--space-md);
  font-size: var(--fs-body-sm);
  color: var(--color-text-secondary);
  max-width: var(--read-max);
}
.fp-disclosure b { color: var(--color-text); font-weight: 600; }

/* ── Machine channel ───────────────────────────────────────── */
.fp-machine pre {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow-x: auto;
  color: var(--color-text-secondary);
}

/* ── Footer ────────────────────────────────────────────────── */
.fp-footer {
  padding-block: var(--space-2xl);
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-tertiary);
  font-size: var(--fs-body-sm);
}
.fp-footer a { color: var(--color-text-secondary); }
.fp-footer a:hover { color: var(--color-accent); }

/* Skip link for keyboard/a11y. */
.fp-skip {
  position: absolute; left: -999px; top: 0;
  background: var(--color-volt); color: var(--color-bg);
  padding: var(--space-sm) var(--space-md); z-index: 100;
  font-family: var(--font-mono); font-size: var(--fs-micro);
}
.fp-skip:focus { left: var(--space-sm); }

/* Horizontal-swipe rail for wide content (cascade / evidence cards). */
.fp-swipe {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-sm);
}
.fp-swipe > * { scroll-snap-align: start; flex: 0 0 auto; }
/* mobile: a right-edge fade signals the swipe rail has more content → */
@media (max-width: 640px) {
  .fp-swipe {
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
}

/* Visually-hidden utility (a11y labels). */
.fp-vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── DESKTOP SPREAD (≥ --island) ───────────────────────────────
   Mobile is the base; here we add the desktop type bumps + the
   side-by-side needle/distribution width the spec asks for. */
@media (min-width: 720px) {
  :root {
    --fs-display: 3.5rem;
    --fs-h1: 2.5rem;
    --fs-h2: 1.75rem;
    --fs-h3: 1.25rem;
  }
  .fp-wrap { padding-inline: var(--space-xl); }
  .fp-section { padding-block: var(--space-3xl); }
  .fp-hero__verdict { max-width: 22ch; }
  /* The instrument top (needle + distribution) goes side-by-side on
     desktop; the component CSS handles the internal grid, this just
     widens the band. */
  .fp-instrument { padding-block: var(--space-3xl); }
}

/* ── MOBILE / REDUCED-MOTION: scroll-morph OFF ─────────────────
   At ≤640px OR prefers-reduced-motion, the hero is NOT pinned; the
   acts autoplay on the instrument face (mobile-flow). The animation
   JS reads these signals too (matchMedia) — CSS releases the pin so
   the page is a normal scroll document. */
@media (max-width: 640px) {
  .fp-hero__pin {
    position: static;
    min-height: auto;
  }
  .fp-hero { min-height: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fp-hero__pin {
    position: static;
    min-height: auto;
  }
  .fp-hero { min-height: auto !important; }
  * , *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
