/* ═══════════════════════════════════════════════════════════════
   ALL ROADS TO TOURISM — v2
   Design tokens: Stone + Ink + Oxblood + Olive
   Type: Fraunces (display + body) · Inter (UI) · JetBrains Mono (data)
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* — Surfaces — */
  --bg:           #EAE6DD;   /* stone */
  --bg-alt:       #E2DCCD;   /* warmer stone */
  --bg-deep:      #DAD3C2;   /* deeper stone for full-bleed moments */
  --bg-card:      #F0EDE5;   /* lifted card */
  --bg-paper:     #F5F2EA;   /* near-white paper */

  /* — Ink — */
  --ink:          #2A2622;   /* primary text */
  --ink-mid:      #5A544D;   /* body secondary */
  --ink-muted:    #8A8278;   /* captions, eyebrows */
  --ink-soft:     #B5AC9F;   /* hairlines as text */

  /* — Rules — */
  --rule:         #C8BFB0;
  --rule-soft:    #D6CDBE;
  --rule-strong:  #2A2622;

  /* — Accents — */
  --oxblood:      #5C2018;   /* primary accent: kickers, links, claret moments */
  --oxblood-dim:  #7A3329;
  --oxblood-bg:   rgba(92, 32, 24, 0.08);

  --olive:        #4A6741;   /* tailwind / positive */
  --olive-bg:     rgba(74, 103, 65, 0.10);

  --clay:         #A8431E;   /* headwind / risk warm */
  --clay-bg:      rgba(168, 67, 30, 0.10);

  --gold:         #B8852E;   /* mixed signal */
  --gold-bg:      rgba(184, 133, 46, 0.10);

  --highlight:    #F0D77A;   /* glossary target */

  /* — Type — */
  --serif: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --sans:  'Inter', -apple-system, system-ui, sans-serif;
  --mono:  'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* — Layout — */
  --maxw:         1240px;
  --content-w:    760px;
  --measure-w:    640px;
  --gutter:       clamp(20px, 4vw, 56px);
  --rail-w:       220px;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-feature-settings: "ss01", "kern", "liga", "calt", "tnum" 0;
  font-variation-settings: "opsz" 14, "SOFT" 50;
  font-size: 18px;
  line-height: 1.55;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--oxblood); text-decoration: underline; text-decoration-thickness: 0.5px; text-underline-offset: 3px; text-decoration-color: rgba(92, 32, 24, 0.35); }
a:hover { text-decoration-color: var(--oxblood); }

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR + SIDE RAIL TOC
   ═══════════════════════════════════════════════════════════════ */

.progress-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.progress-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: var(--oxblood);
  transition: width 0.05s linear;
}

.toc-rail {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  left: 24px;
  width: 200px;
  z-index: 50;
  font-family: var(--sans);
  font-size: 11px;
  display: none;
  pointer-events: none;
}
@media (min-width: 1280px) {
  .toc-rail { display: block; }
}
.toc-rail-inner {
  pointer-events: auto;
  border-left: 1px solid var(--rule);
  padding: 8px 0;
}
.toc-link {
  display: block;
  padding: 7px 0 7px 18px;
  color: var(--ink-muted);
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 1.3;
  position: relative;
  transition: color 0.2s ease;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.toc-link::before {
  content: attr(data-num);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-soft);
  margin-right: 8px;
  letter-spacing: 0.06em;
}
.toc-link:hover { color: var(--ink); }
.toc-link.is-active {
  color: var(--ink);
  border-left-color: var(--oxblood);
  font-weight: 500;
}
.toc-link.is-active::before { color: var(--oxblood); }

/* Mobile chip-rail (top of page, sticky) */
.toc-chips {
  position: sticky;
  top: 0;
  background: rgba(234, 230, 221, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
  z-index: 40;
  padding: 10px var(--gutter);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  display: none;
}
.toc-chips::-webkit-scrollbar { display: none; }
@media (max-width: 1279px) {
  .toc-chips { display: block; }
}
.toc-chips a {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  text-decoration: none;
  padding: 4px 10px;
  margin-right: 4px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.toc-chips a.is-active {
  color: var(--ink);
  border-color: var(--rule);
  background: var(--bg-card);
}

/* ═══════════════════════════════════════════════════════════════
   MASTHEAD
   ═══════════════════════════════════════════════════════════════ */

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 14px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  position: relative;
  z-index: 10;
}
.mast-left { display: flex; align-items: center; gap: 18px; }
.mast-mark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  font-variation-settings: "opsz" 18, "SOFT" 30;
  color: var(--ink);
  text-transform: none;
  letter-spacing: -0.005em;
}
.mast-divider { width: 1px; height: 14px; background: var(--rule); }
.mast-section { color: var(--oxblood); font-weight: 600; }
.mast-meta { color: var(--ink-muted); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════ */

.hero {
  padding: clamp(56px, 9vw, 120px) var(--gutter) clamp(48px, 7vw, 88px);
  border-bottom: 1px solid var(--rule);
  max-width: var(--maxw);
  margin: 0 auto;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.kicker {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.kicker::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--oxblood);
}
.kicker-num {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 400;
  font-size: clamp(48px, 9.2vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 36px;
  max-width: 14ch;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 400;
  color: var(--oxblood);
}

.standfirst {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 24, "SOFT" 50;
  font-size: clamp(20px, 2.3vw, 26px);
  line-height: 1.4;
  color: var(--ink);
  max-width: 30ch;
  margin-bottom: 32px;
  letter-spacing: -0.005em;
}
/* Drop cap */
.standfirst::first-letter {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 30, "wght" 500;
  font-size: 5.4em;
  float: left;
  line-height: 0.85;
  margin: 0.05em 0.08em -0.05em 0;
  color: var(--oxblood);
  text-transform: uppercase;
}

.standnote {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-mid);
  max-width: 56ch;
  padding: 18px 0 0 20px;
  border-left: 2px solid var(--oxblood);
  margin-bottom: 48px;
}
.standnote a { color: var(--ink-mid); }

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-mid);
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
.byline-item { display: flex; flex-direction: column; gap: 4px; }
.byline-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.byline-value { color: var(--ink); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   SECTION UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.section {
  padding: clamp(64px, 9vw, 128px) var(--gutter);
  max-width: var(--maxw);
  margin: 0 auto;
}

.section-head {
  margin-bottom: 56px;
  display: grid;
  grid-template-columns: 88px 1fr;
  column-gap: 32px;
  row-gap: 14px;
  align-items: end;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 22px;
}
@media (max-width: 720px) {
  .section-head { grid-template-columns: 56px 1fr; column-gap: 18px; }
}
.section-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 100;
  font-size: clamp(48px, 6vw, 72px);
  line-height: 0.9;
  color: var(--oxblood);
  grid-row: 1 / span 2;
  align-self: center;
  letter-spacing: -0.02em;
}
.section-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.section-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  font-variation-settings: "opsz" 48, "SOFT" 30, "wght" 500;
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--ink);
}
.section-intro {
  grid-column: 2;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-mid);
  line-height: 1.55;
  max-width: 60ch;
  margin-top: 6px;
  font-variation-settings: "opsz" 18, "SOFT" 50;
}
@media (max-width: 720px) {
  .section-intro { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════════
   SNAPSHOT — headline numbers with sparklines
   ═══════════════════════════════════════════════════════════════ */

.snapshot {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
}
.snapshot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--gutter) clamp(56px, 8vw, 96px);
}
.snapshot-head { margin-bottom: clamp(56px, 7vw, 88px); max-width: 800px; }

.snapshot-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}
.snapshot-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--oxblood);
}
.snapshot-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6.4vw, 80px);
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 30, "wght" 400;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 18ch;
}
.snapshot-title em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 100, "wght" 400;
  color: var(--oxblood);
}
.snapshot-lede {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 24, "SOFT" 100;
  font-size: clamp(19px, 1.9vw, 23px);
  line-height: 1.4;
  color: var(--ink-mid);
  margin-top: 28px;
  max-width: 56ch;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 920px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .stat-grid { grid-template-columns: 1fr; } }

.stat {
  position: relative;
  padding: clamp(28px, 3vw, 40px) clamp(20px, 2.4vw, 32px) clamp(28px, 3vw, 40px) 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat:nth-child(4n) { border-right: 0; padding-right: 0; }
@media (max-width: 920px) {
  .stat:nth-child(4n) { border-right: 1px solid var(--rule); padding-right: clamp(20px, 2.4vw, 32px); }
  .stat:nth-child(2n) { border-right: 0; padding-right: 0; }
}
@media (max-width: 540px) {
  .stat { border-right: 0; padding-right: 0; }
}
.stat:last-child { border-bottom: 0; }
.stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: clamp(28px, 3vw, 40px);
  bottom: clamp(28px, 3vw, 40px);
  width: 2px;
  background: var(--ink-muted);
}
.stat.up::before { background: var(--olive); }
.stat.down::before { background: var(--clay); }
.stat.flat::before { background: var(--ink-muted); }

.stat-name {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
  margin: 0 0 clamp(20px, 2.4vw, 30px) 22px;
}

.stat-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin: 0 0 14px 22px;
  line-height: 1;
  font-size: clamp(40px, 5.8vw, 64px);
  font-feature-settings: "tnum", "lnum";
}
.stat-currency {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 48, "SOFT" 100;
  font-weight: 400;
  font-size: 0.42em;
  color: var(--ink-muted);
  align-self: flex-start;
  line-height: 1.1;
}
.stat-figure {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 96, "SOFT" 30, "wght" 500;
  font-size: 1em;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.035em;
  font-feature-settings: "tnum", "lnum";
}
.stat-suffix {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.005em;
}

.stat-spark {
  margin: 6px 0 14px 22px;
  width: 100%;
  max-width: 140px;
  height: 32px;
}

.stat-change {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.01em;
  margin-left: 22px;
  font-feature-settings: "tnum";
}
.stat-change.up    { color: var(--olive); }
.stat-change.down  { color: var(--clay); }
.stat-change.flat  { color: var(--ink-muted); }
.stat-change::before {
  font-family: var(--mono);
  font-size: 10px;
}
.stat-change.up::before   { content: '▲'; }
.stat-change.down::before { content: '▼'; }
.stat-change.flat::before { content: '−'; }

.stat-context {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 16, "SOFT" 100;
  font-size: 14px;
  color: var(--ink-mid);
  line-height: 1.5;
  margin: 18px 0 0 22px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  max-width: 30ch;
}

/* ═══════════════════════════════════════════════════════════════
   SCORECARD — replaces constellation
   Horizontal small-multiples of every indicator's direction.
   ═══════════════════════════════════════════════════════════════ */

.scorecard-section { background: var(--bg); }

.scorecard {
  margin-top: 8px;
  border-top: 1px solid var(--rule);
}
.scorecard-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--rule);
  align-items: stretch;
}
@media (max-width: 720px) {
  .scorecard-row { grid-template-columns: 1fr; }
}

.scorecard-cluster {
  padding: 22px 24px 22px 0;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: background 0.18s ease;
  text-decoration: none;
  color: inherit;
}
.scorecard-cluster:hover { background: var(--bg-card); }
@media (max-width: 720px) {
  .scorecard-cluster {
    border-right: 0;
    border-bottom: 1px solid var(--rule-soft);
    padding-right: 0;
    flex-direction: row;
    align-items: baseline;
    gap: 14px;
  }
}
.sc-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--oxblood);
  font-weight: 500;
}
.sc-name {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30, "wght" 500;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.sc-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* Deviation chart: one shared zero-axis per row, bars rendered from data */
.scorecard-bars {
  display: grid;
  grid-template-columns: 1fr;
  padding: 18px 0 14px 24px;
  position: relative;
}
@media (max-width: 720px) {
  .scorecard-bars { padding: 14px 0 10px 0; }
}
.sc-axis {
  display: grid;
  grid-template-columns: 160px 1fr 64px;
  align-items: center;
  column-gap: 16px;
  padding: 7px 0;
  border-top: 1px dotted var(--rule-soft);
  font-family: var(--sans);
  font-size: 11px;
}
.sc-axis:first-child { border-top: 0; }
.sc-axis-label {
  color: var(--ink-mid);
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sc-axis-track {
  position: relative;
  height: 14px;
}
.sc-axis-zero {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--rule);
}
.sc-axis-bar {
  position: absolute;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  border-radius: 1px;
}
.sc-axis-bar.up   { background: var(--olive); }
.sc-axis-bar.down { background: var(--clay); }
.sc-axis-bar.flat { background: var(--ink-muted); opacity: 0.6; }

.sc-axis-value {
  font-family: var(--serif);
  font-feature-settings: "tnum", "lnum";
  font-size: 12.5px;
  font-weight: 500;
  text-align: right;
  letter-spacing: -0.005em;
  font-variation-settings: "opsz" 16, "SOFT" 30, "wght" 500;
}
.sc-axis-value.up   { color: var(--olive); }
.sc-axis-value.down { color: var(--clay); }
.sc-axis-value.flat { color: var(--ink-muted); }

/* Status pill for non-numeric / qualitative indicators */
.sc-axis-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  border: 1px solid currentColor;
}
.sc-axis-pill.up      { color: var(--olive); }
.sc-axis-pill.upgrade { color: var(--olive); }
.sc-axis-pill.warn    { color: var(--clay); }
.sc-axis-pill.flat    { color: var(--ink-muted); }
.sc-axis-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Cluster summary chip in the left rail */
.sc-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-mid);
}
.sc-summary-dots { display: inline-flex; gap: 2px; }
.sc-summary-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--rule);
}
.sc-summary-dot.up      { background: var(--olive); }
.sc-summary-dot.down,
.sc-summary-dot.warn    { background: var(--clay); }
.sc-summary-dot.flat    { background: var(--ink-muted); opacity: 0.5; }
.sc-summary-dot.upgrade { background: var(--olive); }

.sc-axis-scale {
  display: grid;
  grid-template-columns: 160px 1fr 64px;
  column-gap: 16px;
  padding-bottom: 6px;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--rule);
}
.sc-axis-scale-track {
  position: relative;
  height: 14px;
}
.sc-axis-scale-track span {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
}
.sc-axis-scale-track span:first-child { left: 0;   transform: none; }
.sc-axis-scale-track span:last-child  { left: 100%; transform: translateX(-100%); }

@media (max-width: 720px) {
  .sc-axis,
  .sc-axis-scale { grid-template-columns: 110px 1fr 56px; column-gap: 10px; }
  .sc-axis-label { font-size: 10.5px; }
  .sc-axis-value { font-size: 11.5px; }
}

.scorecard-legend {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
  flex-wrap: wrap;
}
.scorecard-legend-items {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 600;
}
.scorecard-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.scorecard-legend-swatch {
  width: 14px;
  height: 3px;
  border-radius: 1px;
}
.scorecard-legend-swatch.tail { background: var(--olive); }
.scorecard-legend-swatch.head { background: var(--clay); }
.scorecard-legend-swatch.flat { background: var(--ink-muted); }

/* When placed above the scorecard table, the legend acts as a header:
   border on the bottom, no top rule, and a tighter rhythm to the table. */
.scorecard-legend.scorecard-legend-top {
  margin-top: 0;
  margin-bottom: 24px;
  padding-top: 0;
  padding-bottom: 16px;
  border-top: none;
  border-bottom: 1px solid var(--rule-soft);
}

.scorecard-caption {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 100;
  font-size: 13px;
  color: var(--ink-mid);
}

/* ═══════════════════════════════════════════════════════════════
   CLUSTER SECTIONS
   ═══════════════════════════════════════════════════════════════ */

.cluster {
  border-top: 1px solid var(--rule);
  scroll-margin-top: 48px;
  position: relative;
}
.cluster:nth-of-type(odd) { background: var(--bg); }
.cluster:nth-of-type(even) { background: var(--bg-alt); }

.segment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.segment {
  padding: 32px 28px 28px;
  background: transparent;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.2s ease;
  cursor: default;
}
.segment:hover { background: var(--bg-card); }

.segment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.segment-title {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30, "wght" 500;
  font-size: 21px;
  line-height: 1.18;
  letter-spacing: -0.012em;
  color: var(--ink);
}
.badge {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
  font-feature-settings: "tnum";
}
.badge.up      { background: var(--olive-bg); color: var(--olive); }
.badge.down    { background: var(--clay-bg); color: var(--clay); }
.badge.warn    { background: var(--clay-bg); color: var(--clay); }
.badge.flat    { background: rgba(138,130,120,0.12); color: var(--ink-mid); }
.badge.upgrade { background: var(--olive-bg); color: var(--olive); }

.segment-stat {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 32, "SOFT" 30, "wght" 500;
  font-size: 26px;
  line-height: 1.05;
  color: var(--ink);
  letter-spacing: -0.018em;
  font-feature-settings: "tnum", "lnum";
}
.segment-stat .small {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 16, "SOFT" 100;
  font-size: 14px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 6px;
  letter-spacing: 0;
}

.segment-body {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  font-variation-settings: "opsz" 15, "SOFT" 50;
}
.segment-outlook {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 14, "SOFT" 100;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-mid);
  padding-top: 14px;
  margin-top: auto;
  border-top: 1px dashed var(--rule);
}
.segment-outlook strong {
  font-style: normal;
  font-family: var(--sans);
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--oxblood);
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

/* Segment with inline chart */
.segment-chart {
  margin: 4px 0 4px;
  height: 80px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   FULL-BLEED EDITORIAL MOMENTS
   ═══════════════════════════════════════════════════════════════ */

.full-bleed {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(72px, 10vw, 144px) var(--gutter);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.full-bleed-inner {
  max-width: 900px;
  margin: 0 auto;
}
.full-bleed-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(234, 230, 221, 0.55);
  font-weight: 600;
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.full-bleed-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: rgba(234, 230, 221, 0.55);
}
.full-bleed h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 30, "wght" 400;
  font-size: clamp(36px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin-bottom: 28px;
  max-width: 24ch;
}
.full-bleed h2 em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 96, "SOFT" 100, "wght" 400;
  color: #E8B45C;
}
.full-bleed p {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  color: rgba(234, 230, 221, 0.85);
  max-width: 56ch;
  font-variation-settings: "opsz" 18, "SOFT" 50;
}
.full-bleed p + p { margin-top: 18px; }

/* ═══════════════════════════════════════════════════════════════
   PULL QUOTE
   ═══════════════════════════════════════════════════════════════ */

.pullquote {
  background: var(--bg);
  padding: clamp(72px, 9vw, 120px) var(--gutter);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pullquote-inner {
  max-width: 880px;
  margin: 0 auto;
  text-align: left;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .pullquote-inner { grid-template-columns: 1fr; }
}
.pullquote-mark {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 400;
  font-weight: 400;
  font-size: 120px;
  line-height: 0.7;
  color: var(--oxblood);
}
.pullquote-text {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 48, "SOFT" 100, "wght" 400;
  font-weight: 400;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.28;
  color: var(--ink);
  letter-spacing: -0.018em;
  max-width: 28ch;
}
.pullquote-source {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-muted);
  margin-top: 28px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   CROSS-CURRENTS
   ═══════════════════════════════════════════════════════════════ */

.crosscurrents { background: var(--bg); border-top: 1px solid var(--rule); }
.cc-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 128px) var(--gutter);
}
.cc-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 800px;
  margin-bottom: 64px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule-strong);
}
.cc-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cc-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--oxblood);
}
.cc-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 30, "wght" 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
  max-width: 22ch;
}
.cc-title em {
  font-style: italic;
  font-variation-settings: "opsz" 72, "SOFT" 100, "wght" 400;
  color: var(--oxblood);
  font-weight: 400;
}
.cc-intro {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-mid);
  max-width: 60ch;
  font-variation-settings: "opsz" 18, "SOFT" 50;
}

.cc-list { display: flex; flex-direction: column; }
.cc-item {
  display: grid;
  grid-template-columns: 80px 280px 1fr;
  gap: 32px;
  padding: 40px 0;
  border-top: 1px solid var(--rule);
  align-items: start;
}
.cc-item:last-child { border-bottom: 1px solid var(--rule); }

.cc-num {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--oxblood);
  letter-spacing: 0.06em;
  padding-top: 4px;
}
.cc-pair-and-title { display: flex; flex-direction: column; gap: 16px; }
.cc-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-mid);
}
.cc-chip {
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  color: var(--ink);
  white-space: nowrap;
}
.cc-arrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--oxblood);
}
.cc-h {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 32, "SOFT" 30, "wght" 500;
  font-size: clamp(22px, 2.6vw, 28px);
  line-height: 1.18;
  letter-spacing: -0.018em;
  color: var(--ink);
  max-width: 22ch;
}
.cc-body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  padding-top: 4px;
  font-variation-settings: "opsz" 16, "SOFT" 50;
  max-width: 60ch;
}
.cc-body strong {
  font-weight: 500;
  font-style: italic;
  color: var(--oxblood);
  font-variation-settings: "opsz" 16, "SOFT" 100, "wght" 500;
}

@media (max-width: 920px) {
  .cc-item {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 32px 0;
  }
  .cc-num { padding-top: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   ADJACENT FLOWS
   ═══════════════════════════════════════════════════════════════ */

.adjacent {
  background: var(--bg-deep);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.adjacent-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 96px) var(--gutter);
}
.adjacent-head { max-width: 800px; margin-bottom: 48px; }
.adjacent-head h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 500;
  font-variation-settings: "opsz" 48, "SOFT" 30, "wght" 500;
  line-height: 1.05;
  margin-top: 16px;
  max-width: 28ch;
  letter-spacing: -0.022em;
}
.adjacent-head p {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink-mid);
  margin-top: 18px;
  max-width: 62ch;
  line-height: 1.55;
  font-variation-settings: "opsz" 17, "SOFT" 50;
}
.adjacent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid var(--rule);
}
.adjacent-item {
  padding: 28px 24px 28px 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.adjacent-item:last-child { border-right: 0; }
@media (max-width: 880px) {
  .adjacent-item { border-right: 0; padding-right: 0; }
}
.adjacent-item h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 30, "wght" 500;
  margin-bottom: 8px;
  letter-spacing: -0.012em;
}
.adjacent-item .adj-stat {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--oxblood);
  margin-bottom: 12px;
  font-feature-settings: "tnum";
  letter-spacing: 0.02em;
}
.adjacent-item p {
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--ink-mid);
  line-height: 1.55;
  font-variation-settings: "opsz" 14, "SOFT" 50;
}

/* ═══════════════════════════════════════════════════════════════
   GLOSSARY TERMS (inline)
   ═══════════════════════════════════════════════════════════════ */

.term {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-muted);
  cursor: help;
  transition: color 0.2s ease, border-color 0.2s ease;
  padding-bottom: 1px;
}
.term:hover {
  color: var(--oxblood);
  border-bottom-color: var(--oxblood);
  border-bottom-style: solid;
}
.standnote .term { border-bottom-color: rgba(138, 130, 120, 0.5); }

/* ═══════════════════════════════════════════════════════════════
   GLOSSARY
   ═══════════════════════════════════════════════════════════════ */

.glossary {
  background: var(--bg-alt);
  border-top: 1px solid var(--rule);
}

/* Collapsible glossary — <details>/<summary> pattern */
.gloss-details > summary { list-style: none; cursor: pointer; }
.gloss-details > summary::-webkit-details-marker { display: none; }
.gloss-details > summary { position: relative; }
.gloss-details > summary:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 6px;
}
.gloss-details > summary:hover .gloss-title { color: var(--oxblood); }
.gloss-details > summary .gloss-title { transition: color 180ms ease; }

.gloss-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 600;
  user-select: none;
}
.gloss-toggle-label { display: none; }
.gloss-details:not([open]) .gloss-toggle-show { display: inline; }
.gloss-details[open]      .gloss-toggle-hide { display: inline; }
.gloss-toggle-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  position: relative;
  flex: 0 0 auto;
}
.gloss-toggle-icon::before,
.gloss-toggle-icon::after {
  content: '';
  position: absolute;
  background: currentColor;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 220ms ease;
}
.gloss-toggle-icon::before { width: 9px; height: 1.5px; }
.gloss-toggle-icon::after  { width: 1.5px; height: 9px; }
.gloss-details[open] .gloss-toggle-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

/* When closed, drop the bottom rule under .gloss-head so the section
   reads as a single tidy unit. */
.gloss-details:not([open]) > summary.gloss-head {
  margin-bottom: 0;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.gloss-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 112px) var(--gutter);
}
.gloss-head {
  margin-bottom: clamp(48px, 6vw, 72px);
  max-width: 800px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule-strong);
}
.gloss-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.gloss-eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--oxblood);
}
.gloss-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.4vw, 52px);
  font-weight: 400;
  font-variation-settings: "opsz" 72, "SOFT" 30, "wght" 400;
  line-height: 1.02;
  letter-spacing: -0.025em;
}
.gloss-intro {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 17, "SOFT" 100;
  font-size: 17px;
  color: var(--ink-mid);
  margin-top: 16px;
  max-width: 56ch;
  line-height: 1.5;
}
.gloss-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
}
@media (max-width: 760px) { .gloss-list { grid-template-columns: 1fr; } }
.gloss-entry {
  padding: 28px 32px 28px 0;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  transition: background 0.5s ease;
  scroll-margin-top: 48px;
}
.gloss-entry:nth-child(2n) { padding-right: 0; padding-left: 32px; border-right: 0; }
@media (max-width: 760px) {
  .gloss-entry { padding: 24px 0; border-right: 0; }
  .gloss-entry:nth-child(2n) { padding-left: 0; }
}
.gloss-entry:target { background: var(--highlight); }
.gloss-entry dt {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 18, "SOFT" 30, "wght" 500;
  font-size: 18px;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.012em;
  margin-bottom: 12px;
}
.gloss-entry dd {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-mid);
  font-variation-settings: "opsz" 15, "SOFT" 50;
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════ */

footer {
  background: var(--ink);
  color: var(--bg);
  padding: clamp(56px, 7vw, 96px) var(--gutter) 36px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 48px;
  margin-bottom: 56px;
}
footer h4 {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(234, 230, 221, 0.5);
  font-weight: 600;
  margin-bottom: 16px;
}
footer p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.6;
  color: rgba(234, 230, 221, 0.85);
  font-variation-settings: "opsz" 15, "SOFT" 50;
}
footer a {
  color: var(--bg);
  text-decoration: underline;
  text-decoration-color: rgba(234, 230, 221, 0.4);
  text-underline-offset: 3px;
}
footer .term {
  color: rgba(234, 230, 221, 0.85);
  text-decoration: none;
  border-bottom: 1px dotted rgba(234, 230, 221, 0.5);
}
footer .term:hover { color: var(--bg); border-bottom-color: var(--bg); }
.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid rgba(234, 230, 221, 0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--sans);
  font-size: 12px;
  color: rgba(234, 230, 221, 0.55);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS — subtle scroll fades
   ═══════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

.hero h1, .hero .standfirst, .hero .standnote, .hero .byline {
  animation: fadeUp 0.7s ease both;
}
.hero .standfirst { animation-delay: 0.08s; }
.hero .standnote  { animation-delay: 0.16s; }
.hero .byline     { animation-delay: 0.24s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE REFINEMENTS — 1024 / 768 / 375 target breakpoints
   ═══════════════════════════════════════════════════════════════ */

/* Tablet landscape (~1024) — gentler section heads, slightly tighter chips */
@media (max-width: 1100px) {
  .section-head { column-gap: 24px; padding-bottom: 18px; }
  .toc-chips { padding-top: 8px; padding-bottom: 8px; }
}

/* Tablet portrait (~768) — keep section-num column compact, ease scorecard,
   collapse glossary to one column for readability */
@media (max-width: 820px) {
  .section-head { grid-template-columns: 64px 1fr; column-gap: 20px; }
  .gloss-list { grid-template-columns: 1fr; }
  .gloss-entry { padding: 24px 0; border-right: 0; }
  .gloss-entry:nth-child(2n) { padding-left: 0; }
  .scorecard-row { grid-template-columns: 200px 1fr; }
  .masthead { gap: 12px; flex-wrap: wrap; }
  .mast-left { gap: 12px; }
}

/* Small phones (~375) — keep the editorial register but trim what crowds */
@media (max-width: 420px) {
  :root { --gutter: 18px; }
  .masthead { font-size: 10px; letter-spacing: 0.08em; }
  .mast-mark { font-size: 15px; }
  .mast-divider { display: none; }
  .mast-meta { font-size: 9.5px; }

  .hero { padding-top: 48px; padding-bottom: 40px; }
  .hero h1 { font-size: 44px; line-height: 0.98; margin-bottom: 28px; }
  .standfirst { font-size: 18px; line-height: 1.42; }
  .standfirst::first-letter {
    font-size: 3.6em;
    margin: 0.06em 0.06em -0.05em 0;
  }
  .standnote { font-size: 13.5px; padding: 14px 0 0 14px; }
  .byline { gap: 12px 24px; padding-top: 20px; }

  .snapshot-title { font-size: 36px; }
  .snapshot-lede { font-size: 17px; }

  .pullquote-mark { font-size: 80px; }
  .pullquote-text { font-size: 22px; }

  .full-bleed h2 { font-size: 32px; }
  .full-bleed p { font-size: 15px; }

  .section-title { font-size: 26px; }
  .section-num { font-size: 40px; }

  .scorecard-row { grid-template-columns: 1fr; }
  .scorecard-cluster { padding: 18px 0; flex-direction: row; align-items: baseline; gap: 12px; }
  .sc-axis,
  .sc-axis-scale { grid-template-columns: 96px 1fr 48px; column-gap: 8px; }
  .sc-axis-label { font-size: 10px; }
  .sc-axis-value { font-size: 11px; }

  .cc-item { gap: 14px; padding: 28px 0; }
  .cc-h { font-size: 20px; }
  .cc-body { font-size: 15px; }

  .segment { padding: 24px 18px 22px; }
  .segment-title { font-size: 19px; }
  .segment-stat { font-size: 22px; }
}

/* Print */
@media print {
  .toc-rail, .toc-chips, .progress-bar { display: none !important; }
  .cluster, .scorecard-row { page-break-inside: avoid; }
  body { background: white; color: black; }
}
