/* Editorial Report Design System: Bricolage Grotesque - Blue, Red, Black */
:root {
  --bg: #ffffff;
  --surface: #f3f3f3;
  --surface-alt: #e9e9e9;
  --ink: #0a0a0a;
  --muted: #595959;
  --accent: #2436ff;
  --accent-ink: #ffffff;
  --field-1: #2436ff;
  --field-1-ink: #ffffff;
  --field-2: #ff3b1f;
  --field-2-ink: #0a0a0a;
  --field-3: #0a0a0a;
  --field-3-ink: #ffffff;
  --field-4: #050a5c;
  --field-4-ink: #ffffff;

  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-text: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1rem, 0.96rem + 0.25vw, 1.125rem);
  --step-lead: clamp(1.2rem, 1.06rem + 0.65vw, 1.5rem);
  --step-head: clamp(1.85rem, 1.2rem + 2.8vw, 3.25rem);
  --step-display: clamp(2.45rem, 1.15rem + 5.8vw, 6.25rem);

  --margin: clamp(1.25rem, 4vw, 3rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(3.5rem, 7vw, 6.5rem);
  --radius: 0px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
  --t-reveal: 800ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, p, figure, blockquote, ul, ol, dl, dd { margin: 0; }
ul[class], ol[class] { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; background: var(--surface); }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
:target { scroll-margin-top: 4.5rem; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.96;
  text-wrap: balance;
  hyphens: none;
}

.display { font-size: var(--step-display); line-height: 0.92; letter-spacing: -0.045em; }
.head { font-size: var(--step-head); line-height: 1.02; letter-spacing: -0.035em; }
.subhead { font-size: var(--step-lead); line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; }
.lead { font-size: var(--step-lead); line-height: 1.38; font-weight: 400; max-width: 44ch; }
.small { font-size: var(--step-small); line-height: 1.48; }
.muted { color: var(--muted); }
.nums { font-variant-numeric: tabular-nums; }
p { max-width: 60ch; text-wrap: pretty; }
p + p { margin-top: 0.85em; }

.wrap { padding-inline: var(--margin); }
.section { padding-block: var(--section); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 1.75rem; }

/* Fields */
.field-ink { background: var(--field-3); color: var(--field-3-ink); }
.field-ink .muted, .field-dark .muted, .sim-output-panel .muted { color: #c8c8c8; }
.field-blue { background: var(--field-1); color: var(--field-1-ink); }
.field-blue .muted { color: #d8deff; }
.field-navy { background: var(--field-4); color: var(--field-4-ink); }
.field-navy .muted { color: #cdd4ff; }
.field-red { background: var(--field-2); color: var(--field-2-ink); }
.field-surface { background: var(--surface); color: var(--ink); }

/* Buttons & links */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.35rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: var(--step-small);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius);
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.button:hover { background: var(--ink); color: var(--bg); }
.button:active { transform: scale(0.97); }
.button-inv { background: var(--bg); color: var(--ink); }
.button-inv:hover { background: var(--field-2); color: var(--ink); }

/* Top bar & Masthead Mosaic Hero */
.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  padding-inline: var(--margin);
  background: var(--bg);
}
.brand-block {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.15rem;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: var(--step-small);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.nav-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.2rem;
  column-gap: 1.2rem;
  padding-inline: 1.25rem;
  background: var(--accent);
  color: var(--accent-ink);
}
.nav-strip a {
  text-decoration: none;
  font-size: var(--step-small);
  font-weight: 500;
  white-space: nowrap;
  padding-block: 0.7rem;
  transition: opacity var(--t-hover) ease;
}
.nav-strip a:hover { opacity: 0.75; }
.header-action {
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
}

.masthead-mosaic {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(108px, 16vh, 170px));
  gap: 0;
  width: 100%;
  overflow: clip;
}
.mosaic-cell {
  position: relative;
  overflow: clip;
  margin: 0;
}
.mosaic-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
  display: block;
}
.mosaic-span-2c { grid-column: span 2; }
.mosaic-span-3c { grid-column: span 3; }
.mosaic-span-2r { grid-row: span 2; }
.mosaic-tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  font-weight: 500;
}
.mosaic-tile strong {
  font-size: var(--step-head);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
}

.hero-body {
  padding-inline: var(--margin);
  padding-block: clamp(2rem, 4vw, 4rem) clamp(2.5rem, 4.5vw, 4.5rem);
  display: grid;
  grid-template-columns: 42% minmax(0, 1fr);
  column-gap: var(--gutter);
  align-items: end;
}
.hero-standfirst {
  padding-right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
}
.hero-title-wrap {
  min-width: 0;
}
.hero-title-wrap .line {
  white-space: nowrap;
}

/* 42% Vertical Editorial Axis Layout */
.axis-layout {
  display: grid;
  grid-template-columns: 40% minmax(0, 1fr);
  column-gap: clamp(1.5rem, 3vw, 3.5rem);
  row-gap: 2rem;
  align-items: start;
}
.axis-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.axis-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.two-col-prose {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2rem;
}
.prose-block {
  background: transparent;
  padding: 0;
}
.field-ink .prose-block { background: transparent; color: #f3f3f3; }
.field-blue .prose-block { background: transparent; color: #ffffff; }
.field-navy .prose-block { background: transparent; color: #ffffff; }
.prose-block h3 {
  font-size: var(--step-lead);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.55rem;
}

/* Stats: Column aligned on the decimal */
.decimal-ledger {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.decimal-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 0.12em;
  padding-block: 0.35rem;
}
.dec-int {
  font-size: clamp(2.8rem, 5.2vw, 5.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-align: right;
  min-width: 3.1ch;
  font-variant-numeric: tabular-nums;
}
.dec-frac {
  font-size: clamp(2.8rem, 5.2vw, 5.2rem);
  font-weight: 600;
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-align: left;
  min-width: 1.8ch;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.dec-caption {
  padding-left: clamp(1rem, 2vw, 2rem);
  font-size: var(--step-body);
  line-height: 1.38;
  max-width: 36ch;
}

/* Sticky Simulator ("One Live Thing") */
.sim-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
  align-items: start;
}
.sim-output-panel {
  position: sticky;
  top: 1.5rem;
  background: var(--field-3);
  color: var(--field-3-ink);
  padding: clamp(1.4rem, 2.8vw, 2.4rem);
}
.sim-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-block: 1.35rem;
}
.sim-kpi {
  background: transparent;
  padding: 0.35rem 0;
}
.sim-kpi-val {
  font-size: var(--step-head);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.25rem;
}
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 1.85rem;
}
.control-card {
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.preset-row, .seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.seg-btn {
  min-height: 42px;
  padding: 0.45rem 0.9rem;
  background: var(--bg);
  color: var(--ink);
  font-size: var(--step-small);
  font-weight: 500;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.seg-btn:hover { background: var(--surface-alt); }
.seg-btn:active { transform: scale(0.97); }
.seg-btn[aria-pressed="true"], .tab-btn[aria-selected="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.field-input {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  color: var(--ink);
  border: 0;
  font-size: var(--step-body);
  font-variant-numeric: tabular-nums;
}

/* Charts & data-ui containers */
.chart-box {
  background: transparent;
  color: inherit;
  padding: 0.25rem 0;
  position: relative;
}
.chart-box .muted { color: var(--muted); }
.field-ink .chart-box { background: transparent; color: #f5f5f5; }
.field-ink .chart-box .muted { color: #c8c8c8; }
.field-blue .chart-box { background: #ffffff; color: #0a0a0a; padding: 1.35rem 1.45rem; }
.field-blue .chart-box .muted { color: var(--muted); }
.chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}
.chart-head h3 {
  font-size: var(--step-lead);
  line-height: 1.2;
  letter-spacing: -0.025em;
  max-width: 34ch;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.2rem;
  font-size: var(--step-small);
  margin-bottom: 0.65rem;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
}
.legend-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  flex-shrink: 0;
}
.svg-wrap {
  position: relative;
  width: 100%;
  overflow: visible;
}
.svg-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #0a0a0a;
  color: #ffffff;
  padding: 0.55rem 0.75rem;
  font-size: var(--step-small);
  line-height: 1.35;
  z-index: 20;
  max-width: 260px;
  opacity: 0;
  transition: opacity 120ms ease;
  font-variant-numeric: tabular-nums;
}
.chart-tooltip.visible { opacity: 1; }
.chart-source {
  margin-top: 0.75rem;
  font-size: var(--step-small);
  opacity: 0.78;
}
.chart-source a { text-decoration: underline; text-underline-offset: 2px; }

/* Tables inside data-ui */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  background: var(--bg);
  color: var(--ink);
}
.table-scroll-capped {
  max-height: 540px;
  overflow-y: auto;
}
.field-ink .table-scroll { background: #141414; color: #f3f3f3; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}
.data-table th, .data-table td {
  padding: 0.72rem 0.85rem;
  text-align: left;
}
.data-table th {
  font-weight: 600;
  background: var(--surface-alt);
  color: var(--ink);
  white-space: nowrap;
}
.data-table tbody tr:nth-child(even) { background: rgba(128, 128, 128, 0.08); }
.field-ink .data-table th { background: #1f1f1f; color: #ffffff; }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(36, 54, 255, 0.08); }

/* Banded Agenda / Tabs Section */
.agenda-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}
.tab-rail {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  position: sticky;
  top: 1.25rem;
}
.tab-btn {
  text-align: left;
  padding: 0.9rem 1rem;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background-color var(--t-hover) ease, color var(--t-hover) ease, transform var(--t-press) var(--ease-out);
}
.tab-btn:hover { background: var(--surface-alt); }
.tab-btn strong { font-weight: 600; font-size: var(--step-body); line-height: 1.2; }
.tab-btn span { font-size: var(--step-small); opacity: 0.85; }
.agenda-panel[hidden] { display: none; }
.band-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1.25rem;
}
.band-row {
  display: grid;
  grid-template-columns: 225px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1.2rem;
  background: var(--surface);
}
.band-row:nth-child(even) { background: var(--surface-alt); }
.band-stat { font-size: var(--step-lead); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Showcase Portrait Block */
.showcase-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px) minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
}
.showcase-portrait {
  aspect-ratio: 3 / 4;
  overflow: clip;
  margin: 0;
}
.showcase-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

/* FAQ Reading Text Columns */
.faq-columns {
  columns: 2;
  column-gap: clamp(2rem, 4vw, 3.5rem);
}
.faq-item {
  break-inside: avoid;
  margin-bottom: 1.35rem;
}
.faq-item strong { font-weight: 600; color: var(--ink); }

/* Footer */
.site-footer {
  background: var(--field-3);
  color: var(--field-3-ink);
  padding: clamp(3rem, 6vw, 5rem) var(--margin) 2rem;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
}
.footer-col h3 {
  font-size: var(--step-body);
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #ffffff;
}
.footer-col p, .footer-col li, .footer-col a {
  font-size: var(--step-small);
  color: #c8c8c8;
  line-height: 1.55;
  text-decoration: none;
}
.footer-col a:hover { color: #ffffff; text-decoration: underline; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-wordmark {
  width: 100%;
  margin-bottom: 1.25rem;
}
.footer-wordmark svg {
  width: 100%;
  height: auto;
  display: block;
}
.credits-line {
  font-size: var(--step-small);
  color: #c8c8c8;
  line-height: 1.5;
}
.credits-line a { color: #ffffff; text-decoration: underline; text-underline-offset: 2px; }

/* Motion layer */
.lines .line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.lines [data-line] { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(18px); animation: ad-rise var(--t-reveal) var(--ease-expo) forwards; animation-delay: calc(var(--i, 0) * 90ms + 120ms); }
  .js .lines [data-line] { transform: translateY(105%); animation: ad-line 900ms var(--ease-expo) forwards; animation-delay: calc(var(--i, 0) * 110ms + 100ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 650ms var(--ease-out), transform 820ms var(--ease-expo); transition-delay: calc(var(--i, 0) * 65ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .moving-pic img { animation: slow-drift 18s var(--ease-soft) infinite alternate; }
}
@keyframes ad-rise { to { opacity: 1; transform: none; } }
@keyframes ad-line { to { transform: none; } }
@keyframes slow-drift { from { transform: scale(1); } to { transform: scale(1.05); } }

/* Responsive (768px & 390px) */
@media (max-width: 1024px) {
  .mosaic-tile { padding: 1.05rem; }
  .mosaic-tile strong { white-space: nowrap; }
  .site-header { grid-template-columns: 1fr auto; row-gap: 0; }
  .nav-strip { grid-column: 1 / -1; order: 3; padding-inline: 1.25rem; }
  .hero-body { grid-template-columns: 1fr; row-gap: 1.5rem; }
  .hero-standfirst { padding-right: 0; }
  .hero-title-wrap { order: -1; }
  p { max-width: none; }
  .dec-caption { max-width: none; }
  .axis-layout { grid-template-columns: 1fr; }
  .sim-grid { grid-template-columns: 1fr; }
  .sim-output-panel { position: static; }
  .agenda-shell { grid-template-columns: 1fr; }
  .tab-rail { flex-direction: row; flex-wrap: wrap; position: static; }
  .tab-btn { flex: 1 1 200px; }
  .showcase-band { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav-strip { padding-inline: 1rem; gap: 0.25rem 0.9rem; }
  .masthead-mosaic {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, 132px);
  }
  .mosaic-span-2c { grid-column: span 2; }
  .mosaic-span-3c { grid-column: span 1; }
  .mosaic-sm-1c { grid-column: span 1; }
  .mosaic-hide-sm { display: none; }
  .two-col-prose { grid-template-columns: 1fr; }
  .decimal-row { grid-template-columns: auto auto; padding-block: 0.75rem; }
  .dec-caption { grid-column: 1 / -1; padding-left: 0; margin-top: 0.35rem; }
  .sim-kpi-row { grid-template-columns: 1fr; }
  .band-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .faq-columns { columns: 1; }
  .footer-cols { grid-template-columns: 1fr; }
}
