/* Civis Cinematic Navy. Tokens reconciled to the official brand palette.
   Gold is the single page accent. The two chart colors are a separate,
   validated categorical pair and are used only inside charts. */

@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Light.ttf") format("truetype");
  font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lato"; src: url("../assets/fonts/Lato-Black.ttf") format("truetype");
  font-weight: 900; font-style: normal; font-display: swap; }

:root {
  --bg:            #22556f;
  --bg-darker:     #153545;
  --bg-darkest:    #0a2138;
  --surface:       #1a3a5c;
  --surface-alt:   #112848;

  --text:          #ffffff;
  --text-muted:    rgba(255,255,255,0.72);
  --text-dim:      rgba(255,255,255,0.45);
  --text-faint:    rgba(255,255,255,0.22);

  --gold:          #f59e0b;
  --gold-soft:     rgba(245,158,11,0.28);
  --gold-dim:      rgba(245,158,11,0.12);

  --border:        rgba(255,255,255,0.11);
  --border-gold:   rgba(245,158,11,0.38);

  /* chart categorical pair, validated against the #153545 surface */
  --series-a:      #c98209;
  --series-b:      #4485b6;

  --gutter: clamp(20px, 5vw, 96px);
  --rail: 96px;
}

* { box-sizing: border-box; }
img, svg, iframe { max-width: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg-darkest);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Atmosphere: a slow vertical navy wash plus a fine grain, so the canvas has
   depth without any decorative object competing with the type. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 70% at 12% 0%, #2a6284 0%, rgba(42,98,132,0) 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-darker) 46%, var(--bg-darkest) 100%);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* ── shell ─────────────────────────────────────────────────────────────── */

.masthead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--gutter);
  background: rgba(10,33,56,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.masthead img { height: 32px; width: auto; display: block; }
.masthead .asof {
  font-size: 12px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--text-dim); white-space: nowrap; text-align: right;
}
/* The as-of line is the only nowrap element on the page. Below this width it
   is what pushes the layout wider than the viewport, so let it wrap. */
@media (max-width: 620px) {
  .masthead { padding: 14px 20px; }
  .masthead img { height: 26px; }
  .masthead .asof { white-space: normal; font-size: 11px; letter-spacing: 1.2px; line-height: 1.35; }
}

main { position: relative; }

/* left index rail, desktop only */
.rail {
  position: fixed; left: 28px; top: 50%; transform: translateY(-50%); z-index: 30;
  display: none; flex-direction: column; gap: 14px;
}
.rail a {
  font-size: 11px; font-weight: 700; letter-spacing: 1.4px;
  color: var(--text-faint); text-decoration: none; transition: color .3s ease;
}
.rail a:hover { color: var(--text-muted); }
.rail a[aria-current="true"] { color: var(--gold); }
@media (min-width: 1180px) { .rail { display: flex; } }

section.screen {
  position: relative;
  padding: clamp(72px, 11vh, 140px) var(--gutter);
  border-top: 1px solid var(--border);
  max-width: 1240px; margin: 0 auto;
}
section.screen:first-of-type { border-top: 0; }

/* oversized ghost numeral behind a screen */
.ghost {
  position: absolute; right: 2%; top: 6%;
  font-size: clamp(140px, 26vw, 360px); font-weight: 900; line-height: .8;
  color: rgba(255,255,255,.028); letter-spacing: -.04em;
  pointer-events: none; user-select: none; z-index: 0;
}
section.screen > *:not(.ghost) { position: relative; z-index: 1; }

/* ── type ──────────────────────────────────────────────────────────────── */

.eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; font-weight: 700; letter-spacing: 3.2px; text-transform: uppercase;
  color: var(--gold); margin: 0 0 22px;
}
.eyebrow::after { content: ""; height: 1px; flex: 1; background: var(--border-gold); max-width: 120px; }

h1 {
  font-weight: 900; letter-spacing: -.028em; line-height: .96;
  font-size: clamp(44px, 8.2vw, 104px); margin: 0 0 26px;
}
h2 {
  font-weight: 900; letter-spacing: -.022em; line-height: 1.04;
  font-size: clamp(30px, 4.4vw, 54px); margin: 0 0 22px; max-width: 20ch;
}
h3 {
  font-weight: 700; letter-spacing: -.01em; line-height: 1.2;
  font-size: clamp(18px, 2vw, 22px); margin: 0 0 10px;
}
p { font-size: clamp(16px, 1.35vw, 19px); line-height: 1.62; color: var(--text-muted); margin: 0 0 18px; max-width: 62ch; }
p.lead { font-size: clamp(19px, 1.9vw, 25px); line-height: 1.5; color: var(--text); font-weight: 300; max-width: 40ch; }
p.small { font-size: 14px; line-height: 1.6; color: var(--text-dim); max-width: 72ch; }
strong { font-weight: 700; color: var(--text); }
em { font-style: normal; color: var(--gold); }
a { color: var(--gold); }

.rule { height: 2px; width: 64px; background: var(--gold); border-radius: 2px; margin: 0 0 30px; }

/* ── stat tiles ────────────────────────────────────────────────────────── */

.stats { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); margin: 34px 0 12px; }
.stats.c3 { grid-template-columns: repeat(3, 1fr); }
.stats.c4 { grid-template-columns: repeat(4, 1fr); }
.stats.c5 { grid-template-columns: repeat(5, 1fr); }
.stat { background: rgba(10,33,56,.5); padding: 26px 22px 22px; }
.stat .n {
  font-size: clamp(30px, 4.4vw, 54px); font-weight: 900; line-height: 1;
  letter-spacing: -.03em; color: var(--text); display: block; margin-bottom: 10px;
}
.stat .n.hot { color: var(--gold); }
.stat .k { font-size: 12px; letter-spacing: 1.7px; text-transform: uppercase; color: var(--text-dim); line-height: 1.45; }
@media (max-width: 900px) {
  .stats.c4, .stats.c5 { grid-template-columns: repeat(2, 1fr); }
  .stats.c3 { grid-template-columns: 1fr; }
  /* an odd tile count would leave a hole in a 2-up grid */
  .stats.c5 .stat:last-child, .stats.c3 .stat:last-child { grid-column: 1 / -1; }
}

/* ── cards / grids ─────────────────────────────────────────────────────── */

.cols { display: grid; gap: 26px; margin-top: 30px; }
.cols.c2 { grid-template-columns: repeat(2, 1fr); }
.cols.c3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cols.c2, .cols.c3 { grid-template-columns: 1fr; } }

.card {
  background: rgba(10,33,56,.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px 24px;
}
.card p { font-size: 16px; margin-bottom: 0; }
.card .tag {
  font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold); display: block; margin-bottom: 12px;
}
.card.flag { border-left: 2px solid var(--gold); }

.pillar { display: flex; gap: 22px; align-items: flex-start; padding: 26px 0; border-top: 1px solid var(--border); }
.pillar .num {
  font-size: 40px; font-weight: 900; line-height: 1; color: var(--gold-soft);
  letter-spacing: -.03em; flex: 0 0 auto; min-width: 58px;
}
.pillar p { margin-bottom: 0; }
@media (max-width: 640px) { .pillar { gap: 14px; } .pillar .num { font-size: 28px; min-width: 40px; } }

/* ── tables ────────────────────────────────────────────────────────────── */

.tblwrap { overflow-x: auto; margin: 26px 0 8px; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; }
th, td { text-align: right; padding: 13px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th {
  font-size: 11px; letter-spacing: 1.7px; text-transform: uppercase;
  color: var(--text-dim); font-weight: 700; border-bottom-color: var(--border-gold);
}
tbody td { color: var(--text-muted); }
tbody td.win { color: var(--gold); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

/* ── charts ────────────────────────────────────────────────────────────── */

.figure { margin: 30px 0 6px; }
/* Wide charts keep their real geometry and scroll inside their own box rather
   than shrinking labels to nothing on a phone. */
.figure.scrollx { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.figure.scrollx .chart, .figure.scrollx .tl { min-width: 680px; }
.scrollhint { display: none; font-size: 12px; color: var(--text-dim); margin: 8px 0 0; }
@media (max-width: 760px) { .scrollhint { display: block; } }
.figure figcaption { font-size: 13px; color: var(--text-dim); margin-top: 14px; line-height: 1.55; max-width: 70ch; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: "Lato", Helvetica, Arial, sans-serif; }
.ax { font-size: 13px; fill: var(--text-dim); }
.val { font-size: 14px; font-weight: 700; fill: var(--text); }
.val.dim { fill: var(--text-dim); font-weight: 400; }
.grid { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.bar-a { fill: var(--series-a); }
.bar-b { fill: var(--series-b); }
.bar-hot { fill: var(--series-a); }
.chart g.mark { transition: opacity .18s ease; cursor: default; }
.chart:hover g.mark { opacity: .55; }
.chart g.mark:hover { opacity: 1; }

.legend { display: flex; flex-wrap: wrap; gap: 20px; margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ── footnotes ─────────────────────────────────────────────────────────── */

sup.fn { font-size: 11px; font-weight: 700; color: var(--gold); vertical-align: super; line-height: 0; }
sup.fn a { text-decoration: none; }
.notes { padding: 56px var(--gutter) 84px; border-top: 1px solid var(--border); max-width: 1240px; margin: 0 auto; }
.notes ol { margin: 0; padding-left: 20px; }
.notes li { font-size: 13.5px; line-height: 1.66; color: var(--text-dim); margin-bottom: 10px; }
.notes li a { color: var(--text-muted); }

/* ── CTA ───────────────────────────────────────────────────────────────── */

.cta {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--gold); color: #0a2138; text-decoration: none;
  font-weight: 700; font-size: 16px; letter-spacing: .2px;
  padding: 16px 30px; border-radius: 999px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(245,158,11,.22); }
.cta.outline { background: transparent; color: var(--gold); border: 1px solid var(--border-gold); }
.cta.outline:hover { box-shadow: none; border-color: var(--gold); }

/* ── reveal ────────────────────────────────────────────────────────────── */

/* Reveal is opt-in: without JS (or in a headless capture) everything is visible. */
body.js .reveal { opacity: 0; transform: translateY(18px); }
body.js .reveal.in { opacity: 1; transform: none; transition: opacity .7s cubic-bezier(.2,.7,.3,1), transform .7s cubic-bezier(.2,.7,.3,1); }
body.js .reveal.in.d1 { transition-delay: .07s; }
body.js .reveal.in.d2 { transition-delay: .14s; }
body.js .reveal.in.d3 { transition-delay: .21s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body.js .reveal { opacity: 1; transform: none; }
  .cta:hover { transform: none; }
}
