/* ============================================================
   PITFALLS ON THE PATHWAY — shared stylesheet & component library
   Newspaper light theme: grey bg / creme cards / charcoal text
   Chart colors only: yellow #f2df22 · blue #1b9de0 · red #e94f35 · green #1fa84d
   Fonts: Cormorant Garamond (display) · Lora (body) · Libre Franklin (sans)
   Dark inversion: <html class="theme-dark"> (survey page)

   COMPONENT INDEX
   ─ Nav .................. injected by /nav.js (.site-nav)
   ─ Page header .......... .page-header + .eyebrow + h1 em + p (hero-style)
   ─ Section card ......... section.card-section (creme card on grey)
   ─ Buttons .............. .btn-dark (primary) / .btn-light (secondary)
   ─ Stat grid ............ .stat-grid > .stat-card (.num + p) — key findings row
   ─ Insight box .......... .insight-row > .insight (.i-num + p) — single stat + caption
   ─ Chart container ...... .chart-wrap (creme, rounded; D3 or canvas inside)
                            chart types in index.html kit: hBars (+log/range),
                            vGrouped (+line overlay), lineChart (area), donut
   ─ Chart legend ......... .chart-legend > .legend-item > .legend-swatch
   ─ FAQ accordion ........ .faq-item > .faq-q (+ .faq-icon) + .faq-a; JS toggles .open
   ─ Pyramid .............. .pyramid > .pyr-band.pyr-l0..l5 (solid poster fills)
   ─ Tables ............... table/thead/tbody (light grey --line separators)
   ─ Callout .............. .callout (neutral grey, single style site-wide)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,700&family=Lora:ital,wght@0,400;0,500;1,400&family=Libre+Franklin:wght@400;500;600;700&display=swap');

:root { --font-sans: 'Libre Franklin', 'Helvetica Neue', sans-serif; }

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

a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(200,195,187,.3); }
a:hover { text-decoration-color: var(--text); }

:root {
  /* light newspaper theme — off-white / charcoal / grey, yellow accent (sparing) */
  /* neutrals: grey bg, creme boxes, charcoal text; poster primaries for charts */
  --bg:         #fcfcfc;        /* background grey */
  --surface:    #fffeff;        /* creme */
  --surface-2:  #f2f0f1;        /* grey panels on creme cards */
  --border:     #e4e6e9;        /* light grey */
  --text:       #2e2e2e;        /* charcoal body */
  --text-strong:#0f0f0f;        /* charcoal headings */
  --muted:      #292929;        /* muted labels, captions, eyebrows (not paragraphs) */
  --gold:       #e3c419;        /* poster lemon yellow — use sparingly */
  --red:        #e94f35;        /* vermillion */
  --red-lt:     rgba(233,79,53,.10);
  --green:      #1fa84d;        /* kelly green (Quellkollektiv poster) */
  --green-lt:   rgba(31,168,77,.10);
  --line:       #e4e6e9;        /* light grey — chart/table separators */
  --blue:       #1b9de0;        /* cyan blue */
  --blue-lt:    rgba(27,157,224,.10);
  --navy:       #f2f0f1;
  --slate:      #fffeff;
  --card:       #fffeff;
  --border-tier:#e4e6e9;
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

/* charcoal theme — applied per-page via <html class="theme-dark"> (survey) */
html.theme-dark {
  --bg:         #0f0f0f;
  --surface:    #171717;
  --surface-2:  #1e1e1e;
  --border:     #2c2c2c;
  --text:       #cfcecb;
  --text-strong:#f5f4f2;
  --muted:      #8a8782;
  --gold:       #f2df22;
  --red:        #ef6750;
  --green:      #2fc063;
  --blue:       #3fb3ec;
  --blue-lt:    rgba(63,179,236,.12);
  --line:       rgba(255,255,255,.09);
  --navy:       #0f0f0f;
  --slate:      #171717;
  --card:       #171717;
  --border-tier:#2c2c2c;
}

body {
  font-family: 'Lora', Georgia, serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.78;
}

/* ── Navigation ─────────────────────────────────────────── */
.site-nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  width: 92%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
}
.nav-brand {
  font-family: var(--font-display);
  color: var(--text-strong);
  font-weight: 500;
  font-size: 1.38rem;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
  letter-spacing: -0.025em;
}
.nav-brand span { color: inherit; font-style: italic; }
.nav-links { display: flex; gap: 0; }
.nav-links a {
  font-family: var(--font-sans);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 1.1rem;
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.nav-links a:hover { color: var(--text-strong); border-bottom-color: var(--border); }
.nav-links a.active { color: var(--text-strong); border-bottom-color: var(--text-strong); }
.nav-links a.nav-appendix { opacity: 0.55; font-size: 0.65rem; }
.nav-links a.nav-appendix:hover { opacity: 1; }
.nav-links a.nav-survey {
  color: #f5f4f2;
  background: #0f0f0f;
  border: 1px solid #0f0f0f;
  border-radius: 4px;
  margin-left: 0.6rem;
  padding: 0 0.9rem;
  height: 32px;
  border-bottom: 1px solid #0f0f0f;
  align-self: center;
}
.nav-links a.nav-survey:hover { opacity: 0.82; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 5px;
}
/* hamburger -> X morph (ported from sharonzunkley.com MobileMenu) */
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-strong);
  transform-origin: center;
  transition: all .3s ease-in-out;
}
.nav-toggle span:nth-child(2) { transition: all .2s ease-in-out; }
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 0.5rem 0 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { height: auto; padding: 0.75rem 1.5rem; border-bottom: none; }
}

/* ══════════════════════════════════════════════════════════
   COMPONENT: Page header (hero-style, matches index hero)
   Usage: <div class="page-header">
            <div class="eyebrow">Deep Dive 02 · The Cost</div>
            <h1>Title with <em>italic accent</em></h1>
            <p>Lede paragraph.</p>
          </div>
   ══════════════════════════════════════════════════════════ */
.page-header {
  background: transparent;
  color: var(--text-strong);
  padding: 5rem 2rem 5.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;   /* headlines max out at medium */
  margin-bottom: 1.1rem;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}
.page-header h1 em { color: inherit; font-style: italic; }
.page-header p {
  font-family: 'Lora', Georgia, serif;
  color: #141414;
  font-size: 1rem;
  line-height: 1.75;
  max-width: 600px;
  margin: 0 auto;
}

/* ── COMPONENT: Eyebrow (caps kicker above headlines) ────── */
/* ── EYEBROW: page labels, category tags ───────────────────── */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.4rem;
}

/* ── CHART LABEL: titles inside chart containers ───────────── */
.chart-label {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* ── TICKER: stat numbers + labels ───────────────────────────── */
.ticker {
  background: transparent;
  width: 92%;
  max-width: 1600px;
  margin: 2.5rem auto;
  border-radius: 8px;
}
.ticker-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem 2rem;
  padding: 2rem 1.5rem;
}
.tick {
  text-align: center;
  padding: 0;
  flex: 1 1 240px;
  min-width: 240px;
}
.tick .n {
  font-family: var(--font-sans);
  font-size: 2.4rem;
  font-weight: 200;
  color: var(--text-strong);
  line-height: 1;
  padding-bottom: 0.25em;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}
.tick .n.n-phrase {
  white-space: nowrap;
}
.ticker-label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: #141414;
  margin-top: 0;
  letter-spacing: 0.01em;
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ── COMPONENT: Buttons ──────────────────────────────────────
   .btn-dark  charcoal fill, creme text (primary action)
   .btn-light creme/transparent, charcoal border (secondary)  */
.btn-dark, .btn-light {
  font-family: var(--font-sans);
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: opacity .15s, transform .15s;
}
.btn-dark  { background: var(--text-strong); color: var(--bg); border: 1px solid var(--text-strong); }
.btn-light { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-dark:hover  { opacity: 0.85; transform: translateY(-1px); }
.btn-light:hover { border-color: var(--text); transform: translateY(-1px); }

/* ── COMPONENT: FAQ accordion (expandable question rows) ────
   Usage: <div class="faq-item">
            <button class="faq-q">Question text
              <span class="faq-icon"><span></span><span></span></span>
            </button>
            <div class="faq-a"><p>Answer.</p></div>
          </div>
   JS: .faq-q click toggles .open on .faq-item                */
.faq-item { margin-bottom: 10px; }
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: none;
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-strong);
  transition: background .15s;
}
.faq-q:hover { background: var(--border); }
.faq-icon {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
}
.faq-icon span {
  position: absolute;
  top: 50%; left: 50%;
  width: 13px; height: 2px;
  background: var(--text-strong);
  transform: translate(-50%, -50%);
  transition: transform .25s ease;
}
.faq-icon span:last-child { transform: translate(-50%, -50%) rotate(90deg); }
.faq-item.open .faq-icon span:last-child { transform: translate(-50%, -50%) rotate(0deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.faq-a p {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  color: #141414;
  line-height: 1.7;
  padding: 0.9rem 1.4rem 0.4rem;
  margin: 0;
}
.faq-item.open .faq-a { max-height: 300px; }

/* ── Layout ──────────────────────────────────────────────── */
.container { width: 92%; max-width: 1600px; margin: 0 auto; padding: 2.5rem 0; }

/* ── Section card ────────────────────────────────────────── */
section.card-section {
  background: transparent;
  border: none;
  border-radius: 2px;
  padding: 2.5rem 2.75rem;
  margin-bottom: 1.75rem;
}
section.card-section h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-strong);
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}
section.card-section h3 {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 2rem 0 0.6rem;
}
section.card-section p {
  font-family: 'Lora', Georgia, serif;
  color: #141414;
  font-size: 1rem;
  margin-bottom: 0.9rem;
  line-height: 1.78;
}
section.card-section p:last-child { margin-bottom: 0; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}
thead th {
  background: var(--surface-2);
  color: var(--muted);
  padding: 0.8rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line);
}
tbody tr:nth-child(even) { background: var(--surface-2); }
tbody tr:hover { background: var(--line); transition: background .1s; }
tbody td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  vertical-align: top;
}

/* ── Pull quote ──────────────────────────────────────────────── */
.pull-quote {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.20;
  letter-spacing: -0.03em;
  color: var(--text-strong);
  text-align: center;
  max-width: 740px;
  margin: 3rem auto;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pull-quote em {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 2px;
}

/* ── Callouts ────────────────────────────────────────────────
   One neutral style site-wide (grey surface, like index insight
   cards). Edit here to retheme every page. Color variants
   (.blue etc.) intentionally retired — chart colors stay in charts. */
.callout {
  background: var(--bg);
  border: 1px solid rgba(200,195,187,.3);
  padding: 1.75rem 2rem;
  border-radius: 8px;
  margin: 1.25rem 0;
  color: var(--text);
  font-size: 0.93rem;
}
.callout strong { color: var(--text-strong); }

/* ── Stat grids ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.stat-card {
  background: var(--bg);
  border: 1px solid rgba(200,195,187,.3);
  padding: 1.75rem 1.25rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: none;
}
.stat-card .num {
  font-family: var(--font-sans);
  font-size: 2.4rem;
  font-weight: 500;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card .num.good { color: var(--gold); }
.stat-card .num.blue { color: var(--blue); }
.stat-card p {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #141414;
  margin: 0.45rem 0 0;
  letter-spacing: 0.02em;
}

/* ── Chart colour tokens — update here for sitewide chart changes ── */
:root {
  /* solid poster fills — no strokes on chart shapes */
  --ch-gold:      #c4a90e;
  --ch-gold-fill: #f2df22;
  --ch-blue:      #1b9de0;
  --ch-blue-fill: #1b9de0;
  --ch-red:       #e94f35;
  --ch-red-fill:  #e94f35;
  --ch-green:     #1fa84d;
  --ch-green-fill:#1fa84d;
  --ch-dim:       #dcdad5;
  --ch-dim-bd:    #8b867b;
  --ch-grid:      #e4e6e9;
}
html.theme-dark {
  --ch-gold:      #f2df22;
  --ch-gold-fill: #f2df22;
  --ch-blue:      #3fb3ec;
  --ch-blue-fill: #3fb3ec;
  --ch-red:       #ef6750;
  --ch-red-fill:  #ef6750;
  --ch-green:     #2fc063;
  --ch-green-fill:#2fc063;
  --ch-dim:       #3a3a3a;
  --ch-dim-bd:    #7a7875;
  --ch-grid:      rgba(255,255,255,.06);
}

/* ── Chart containers ────────────────────────────────────── */
.chart-wrap {
  position: relative;
  margin: 1.5rem 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 1.5rem;
}

/* ── Key finding boxes (shared, matches home page insights) ── */
.insight-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}
.insight {
  background: var(--bg);
  border: 1px solid rgba(200,195,187,.3);
  padding: 2rem;
  border-radius: 8px;
  flex: 1 1 280px;
  max-width: 380px;
}
.insight .i-num {
  font-family: var(--font-sans);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text-strong);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.insight p {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #141414;
  margin: 0.35rem 0 0;
  line-height: 1.5;
  min-height: calc(0.8rem * 1.5 * 2);
}
@media (max-width: 768px) { .insight-row { justify-content: flex-start; } }

/* ── DB grid (database stat boxes, same style as insight cards) ── */
.db-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 380px));
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}
.db-item {
  background: var(--bg);
  border: 1px solid rgba(200,195,187,.3);
  padding: 2rem;
  border-radius: 8px;
}
@media (max-width: 768px) { .db-grid { grid-template-columns: repeat(2, minmax(0, 380px)); } }
@media (max-width: 480px) { .db-grid { grid-template-columns: 1fr; } }
.db-item .dn {
  font-family: var(--font-sans);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--text-strong);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.db-item .dl {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: #141414;
  margin-top: 0.35rem;
  line-height: 1.5;
}
.chart-wrap canvas { display: block; }
.chart-title {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.chart-img {
  width: 100%;
  max-width: 720px;
  display: block;
  margin: 1.25rem auto;
  border: none;
}

/* ── Tier badges ─────────────────────────────────────────── */
.tier-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.t1  { background: rgba(79,168,119,.18);  color: #6ec49a; }
.t2  { background: rgba(90,145,217,.18);  color: #7db2f0; }
.t3  { background: rgba(217,95,95,.18);   color: #e88080; }
.t4  { background: rgba(160,110,220,.18); color: #c09adf; }
.t4b { background: rgba(79,168,119,.18);  color: #6ec49a; }
.t5  { background: rgba(201,168,76,.18);  color: var(--gold); }

/* ── Source attribution ──────────────────────────────────── */
.sources {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  color: var(--muted);
  background: transparent;
  border-top: 1px solid rgba(200,195,187,.3);
  padding: 0.75rem 0;
  margin-top: 1.25rem;
  line-height: 1.6;
}

/* ── Dot grid ────────────────────────────────────────────── */
.dot-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 1rem 0; }
.dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}
.dot.gone { background: #252525; }

/* ── Big number ──────────────────────────────────────────── */
.hero-num { text-align: center; padding: 1.5rem; }
.hero-num .number {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
}
.hero-num .label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── Monospace block ─────────────────────────────────────── */
.mono-block {
  background: var(--surface-2);
  color: var(--muted);
  border: none;
  padding: 1.25rem 1.5rem;
  font-family: "SFMono-Regular", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  overflow-x: auto;
  margin: 1rem 0;
}
.mono-block .hi { color: var(--gold); font-weight: bold; }

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ── Inline color overrides (dark theme compat) ──────────── */
[style*="color:#718096"], [style*="color: #718096"] { color: var(--muted) !important; }
[style*="color:#555"],    [style*="color: #555"]    { color: var(--text)  !important; }

@media (max-width: 600px) {
  section.card-section { padding: 1.25rem 1rem; }
  .page-header h1 { font-size: 2rem; }
  .page-header { padding: 3rem 1.25rem 3.5rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .hero-num .number { font-size: 3rem; }
  /* wide tables stay in frame and scroll sideways (same pattern as scope) */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .chart-wrap { padding: 0.75rem 0.4rem; }
  /* insight numbers match h2 scale on phones */
  .insight-row .insight .i-num { font-size: 1.55rem; }
}

/* ── Scroll reveal (global — elements are tagged by nav.js) ── */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
              transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* link underline tint works on both themes */
a { text-decoration-color: rgba(139,134,123,.4); }

/* ── The Soccer Pyramid (shared — index + scope) ─────────── */
.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 2rem auto;
  width: 100%;
  max-width: 1050px;
}
.pyr-band {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 118px;
  padding: 12px 18px 10px;
  border-radius: 0;
  font-family: var(--font-sans);
  transition: opacity 0.15s;
}
.pyr-band:first-child { border-radius: 6px 6px 0 0; }
.pyr-band:last-child  { border-radius: 0 0 6px 6px; }
.pyr-band:hover { opacity: 0.92; }
.pyr-lnum {
  grid-column: 1; grid-row: 1;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text);
  align-self: start;
}
.pyr-leagues {
  grid-column: 2; grid-row: 1;
  font-size: 0.68rem;
  color: var(--text);
  text-align: right;
  align-self: start;
  line-height: 1.5;
}
.pyr-logos {
  grid-column: 1 / -1; grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
}
.pyr-logo-slot {
  width: 48px;
  height: 32px;
  border-radius: 3px;
  background: rgba(255,255,255,.5);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: rgba(15,15,15,.55);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pyr-logo-slot img { width: 100%; height: 100%; object-fit: contain; }
/* slots holding a real logo: transparent, logo sits directly on the band */
.pyr-logo-slot:has(img) {
  background: transparent;
  border: none;
  width: auto;
  min-width: 75px;
  height: 75px;
  padding: 0;
  border-radius: 0;
}
/* landscape logos: 50% of the standard slot height, width follows aspect */
.pyr-logo-slot.logo-wide:has(img) {
  height: 38px;
  min-width: 0;
}
.pyr-logo-slot.logo-wide img { width: auto; }
.pyr-name {
  grid-column: 1; grid-row: 3;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-strong);
  align-self: end;
  letter-spacing: -0.01em;
}
/* band colors — solid poster fills, no borders */
.pyr-band.pyr-l1 { background: #f2df22; }   /* yellow */
.pyr-band.pyr-l2 { background: #e94f35; }   /* red */
.pyr-band.pyr-l3 { background: #1b9de0; }   /* blue */
.pyr-band.pyr-l4 { background: #1fa84d; }   /* green */
.pyr-band.pyr-l5 { background: #dcdad5; }   /* grey */
.pyr-band.pyr-l0 { background: #0f0f0f; }   /* charcoal foundation */

/* pyramid on small screens: gentler taper (inline widths overridden),
   half-size logo slots, tighter bands */
@media (max-width: 600px) {
  .pyr-band { min-height: 0; padding: 10px 12px 8px; }
  .pyr-band.pyr-l1 { width: 64% !important; }
  .pyr-band.pyr-l2 { width: 71% !important; }
  .pyr-band.pyr-l3 { width: 78% !important; }
  .pyr-band.pyr-l4 { width: 85% !important; }
  .pyr-band.pyr-l5 { width: 92% !important; }
  .pyr-band.pyr-l0 { width: 100% !important; }
  /* logos flow 3 across; partial rows (e.g. nal+e64, usl-youth+edp) stay centered */
  .pyr-logos { gap: 8px 4px; padding: 2px 0; }
  .pyr-logo-slot:has(img) { height: 44px; min-width: 0; flex: 0 0 30%; }
  .pyr-logo-slot.logo-wide:has(img) { height: 24px; flex: 0 0 30%; }
  .pyr-logo-slot.logo-wide img { max-width: 100%; }
  .pyr-leagues { font-size: 0.56rem; line-height: 1.4; }
  .pyr-lnum { font-size: 0.54rem; }
  .pyr-name { font-size: 0.7rem; }
}

/* text contrast per band */
.pyr-band.pyr-l1 .pyr-lnum, .pyr-band.pyr-l1 .pyr-leagues { color: rgba(15,15,15,.65); }
.pyr-band.pyr-l1 .pyr-name { color: #0f0f0f; }
.pyr-band.pyr-l5 .pyr-lnum, .pyr-band.pyr-l5 .pyr-leagues { color: rgba(15,15,15,.6); }
.pyr-band.pyr-l5 .pyr-name { color: #0f0f0f; }
.pyr-band.pyr-l2 .pyr-lnum, .pyr-band.pyr-l2 .pyr-leagues,
.pyr-band.pyr-l3 .pyr-lnum, .pyr-band.pyr-l3 .pyr-leagues,
.pyr-band.pyr-l4 .pyr-lnum, .pyr-band.pyr-l4 .pyr-leagues,
.pyr-band.pyr-l0 .pyr-lnum, .pyr-band.pyr-l0 .pyr-leagues { color: rgba(255,255,255,.82); }
.pyr-band.pyr-l2 .pyr-name, .pyr-band.pyr-l3 .pyr-name,
.pyr-band.pyr-l4 .pyr-name, .pyr-band.pyr-l0 .pyr-name { color: #fffeff; }

/* ── D3 chart kit (shared via report/charts.js) ───────────── */
.d3-chart svg { display: block; width: 100%; height: auto; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

#chart-tip {
  display: none;
  position: fixed;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.5;
  z-index: 100;
  max-width: 280px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
}
