@font-face {
    font-family: "Hanken Grotesk";
    src: url("/fonts/site/hanken-grotesk-normal-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Mono";
    src: url("/fonts/site/ibm-plex-mono-400-normal-latin.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

:root,
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f6f3;
    --surface: #fbfcfa;
    --surface-strong: #e8eeea;
    --surface-accent: #dceee9;
    --ink: #11201b;
    --ink-soft: #365048;
    --muted: #6e827b;
    --line: #d4dfd9;
    --line-strong: #b7c9c0;
    --accent: #087f73;
    --accent-strong: #075c54;
    --accent-soft: #bfe4dc;
    --shadow: 0 18px 50px rgba(22, 57, 47, 0.08);
    --radius: 14px;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e1714;
    --surface: #15211c;
    --surface-strong: #1b2b25;
    --surface-accent: #163f38;
    --ink: #edf5f0;
    --ink-soft: #c4d7ce;
    --muted: #8fa99f;
    --line: #2c4038;
    --line-strong: #40584e;
    --accent: #6ed1c1;
    --accent-strong: #a2eadb;
    --accent-soft: #214e45;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--ink);
    font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: inherit; }

button { cursor: pointer; }

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.shell {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--ink);
    color: var(--bg);
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(16px);
}

.header-inner {
    min-height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    width: max-content;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--accent);
    border-radius: 9px;
    color: var(--accent-strong);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: -0.08em;
}

.brand-copy {
    display: grid;
    gap: 0;
    font-size: 13px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.brand-copy strong { font-size: 14px; }
.brand-copy span { color: var(--muted); }

.primary-nav {
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 14px;
    color: var(--muted);
}

.primary-nav a {
    position: relative;
    padding: 26px 0 24px;
    text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] { color: var(--ink); }

.primary-nav a[aria-current="page"]::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--accent);
    content: "";
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
}

.header-refresh,
.live-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.status-dot.is-muted {
    background: var(--muted);
    box-shadow: 0 0 0 4px var(--surface-strong);
}

.theme-button,
.text-button,
.control-label-row button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.theme-button:hover,
.text-button:hover,
.control-label-row button:hover { color: var(--accent-strong); }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: clamp(48px, 8vw, 120px);
    align-items: end;
    min-height: 560px;
    padding-top: 84px;
    padding-bottom: 80px;
}

.hero-copy { max-width: 720px; }

.eyebrow,
.mono-label,
.control-label,
.panel-kicker,
.method-tag,
.fact-index {
    margin: 0;
    color: var(--accent-strong);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.hero h1 {
    max-width: 700px;
    margin: 16px 0 20px;
    font-size: clamp(48px, 7vw, 88px);
    font-weight: 730;
    letter-spacing: -0.075em;
    line-height: 0.96;
}

.hero-lede {
    max-width: 580px;
    margin: 0;
    color: var(--ink-soft);
    font-size: clamp(18px, 2.2vw, 22px);
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 680;
    text-decoration: none;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
    gap: 14px;
    background: var(--accent);
    color: #f2faf7;
}

.button-primary:hover { background: var(--accent-strong); }

.button-secondary {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--ink);
}

.button-secondary:hover { border-color: var(--accent); }

.hero-note {
    max-width: 500px;
    margin: 22px 0 0;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 11px;
    line-height: 1.6;
}

.hero-brief {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.brief-topline,
.control-label-row,
.chart-meta,
.visual-header,
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brief-topline { align-items: flex-start; }
.brief-topline .mono-label { color: var(--muted); }

.brief-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 44px;
}

.brief-grid div { display: grid; gap: 2px; }
.brief-grid strong { font-size: 28px; letter-spacing: -0.07em; }
.brief-grid span { color: var(--muted); font-size: 12px; }

.brief-rule { height: 1px; margin: 24px 0 18px; background: var(--line); }

.hero-brief p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.6;
}

.section { padding-top: 84px; }

.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
    gap: 48px;
    align-items: end;
    margin-bottom: 30px;
}

.section-heading h2,
.reading-lead h2 {
    max-width: 680px;
    margin: 12px 0 0;
    font-size: clamp(31px, 4vw, 52px);
    font-weight: 700;
    letter-spacing: -0.065em;
    line-height: 1;
}

.section-intro {
    max-width: 390px;
    margin: 0 0 3px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.55;
}

.monitor-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.control-rail,
.visual-panel,
.reading-section,
.registry-table-wrap,
.source-card {
    border: 1px solid var(--line);
    background: var(--surface);
}

.control-rail {
    position: sticky;
    top: 96px;
    border-radius: var(--radius);
    overflow: hidden;
}

.control-block {
    padding: 18px;
    border-bottom: 1px solid var(--line);
}

.control-block:last-child { border-bottom: 0; }

.control-label { display: block; margin-bottom: 10px; color: var(--muted); }

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg);
}

.mode-button {
    min-height: 31px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.mode-button.is-active {
    background: var(--accent);
    color: #f2faf7;
}

.control-help {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.indicator-list { display: grid; gap: 3px; }

.indicator-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    text-align: left;
}

.indicator-button span:first-child { display: grid; gap: 2px; }
.indicator-button strong { font-size: 13px; line-height: 1.2; }
.indicator-button small { color: var(--muted); font-size: 11px; }
.indicator-button:hover { background: var(--surface-strong); }
.indicator-button.is-active { border-color: var(--accent); background: var(--surface-accent); }
.indicator-button.is-active small { color: var(--accent-strong); }
.control-arrow { color: var(--accent-strong); font-size: 14px; }

.control-label-row { align-items: baseline; margin-bottom: 10px; }
.control-label-row .control-label { margin-bottom: 0; }
.control-label-row button { padding: 0; font-family: "IBM Plex Mono", monospace; font-size: 10px; text-transform: uppercase; }

.country-list { display: grid; gap: 2px; }

.country-option {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.country-option input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--accent);
}

.visual-panel {
    min-width: 0;
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.visual-header { align-items: flex-start; }
.panel-kicker { margin-bottom: 7px; color: var(--accent-strong); }
.visual-header h3 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -0.06em; line-height: 1; }
.visual-description { max-width: 610px; margin: 10px 0 0; color: var(--ink-soft); font-size: 13px; }
.text-button { padding: 8px 0; color: var(--accent-strong); white-space: nowrap; }

.chart-meta {
    justify-content: flex-start;
    gap: clamp(24px, 6vw, 70px);
    margin-top: 30px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.chart-meta div { display: grid; gap: 2px; }
.chart-meta strong { font-size: 13px; font-weight: 650; }
.chart-meta .mono-label { color: var(--muted); font-size: 9px; }

.chart-card {
    min-height: 340px;
    margin-top: 18px;
    padding: 18px 14px 14px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.chart-axis {
    display: flex;
    justify-content: space-between;
    margin: 0 72px 10px 150px;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 9px;
}

.bar-chart { display: grid; gap: 10px; min-width: 600px; }

.bar-row {
    display: grid;
    grid-template-columns: 135px minmax(220px, 1fr) 58px;
    gap: 15px;
    align-items: center;
}

.bar-label {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
    color: var(--ink-soft);
    font-size: 12px;
    text-align: right;
}

.bar-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-label small { flex: 0 0 auto; color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 9px; }
.bar-row.is-region .bar-label strong { color: var(--accent-strong); }

.bar-track {
    height: 26px;
    border-radius: 5px;
    background: var(--surface-strong);
    overflow: hidden;
}

.bar-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 5px;
    background: var(--accent);
    transition: width 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-row.is-region .bar-fill { background: var(--ink); }
.bar-value { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 600; }

.data-callout {
    margin-top: 18px;
    padding: 13px 15px;
    border-left: 3px solid var(--accent);
    background: var(--surface-accent);
    color: var(--ink-soft);
    font-size: 13px;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 17px 0;
    border-bottom: 1px solid var(--line);
}

.summary-strip div { display: grid; gap: 3px; }
.summary-strip span { color: var(--muted); font-size: 11px; }
.summary-strip strong { font-family: "IBM Plex Mono", monospace; font-size: 13px; }

.table-wrap,
.registry-table-wrap { overflow-x: auto; }
.table-wrap { margin-top: 17px; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 9px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
tbody th { color: var(--ink); font-weight: 650; white-space: nowrap; }
tbody td { color: var(--ink-soft); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
td.value-cell { color: var(--ink); font-family: "IBM Plex Mono", monospace; font-weight: 600; white-space: nowrap; }
td.year-cell { color: var(--muted); font-family: "IBM Plex Mono", monospace; white-space: nowrap; }
.reading-cell { color: var(--muted); }

.visual-footnote {
    margin: 18px 0 0;
    color: var(--muted);
    font-family: "IBM Plex Mono", monospace;
    font-size: 10px;
    line-height: 1.6;
}

.reading-section {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: clamp(32px, 8vw, 120px);
    margin-top: 84px;
    padding: 42px clamp(22px, 5vw, 64px);
    border-radius: var(--radius);
    background: var(--surface-accent);
}

.reading-lead h2 { margin-top: 13px; font-size: clamp(30px, 3.6vw, 48px); }
.reading-lead > p:not(.eyebrow) { max-width: 450px; margin: 20px 0 0; color: var(--ink-soft); font-size: 16px; }
.inline-link,
.source-link { display: inline-flex; align-items: center; gap: 10px; color: var(--accent-strong); font-size: 13px; font-weight: 680; text-decoration: none; }
.inline-link { margin-top: 26px; }
.inline-link:hover, .source-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.reading-facts { display: grid; align-content: center; }
.fact-row { display: grid; grid-template-columns: 42px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); }
.fact-row:first-child { padding-top: 0; }
.fact-row:last-child { padding-bottom: 0; border-bottom: 0; }
.fact-index { padding-top: 3px; color: var(--accent-strong); }
.fact-row strong { font-size: 16px; }
.fact-row p { margin: 4px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }

.compact-heading { margin-bottom: 26px; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.method-card { min-height: 280px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.method-card:nth-child(2) { background: var(--surface-strong); }
.method-card:nth-child(3) { background: var(--ink); color: var(--bg); }
.method-number { color: var(--muted); font-family: "IBM Plex Mono", monospace; font-size: 11px; }
.method-card h3 { margin: 62px 0 11px; font-size: 25px; letter-spacing: -0.05em; line-height: 1; }
.method-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.method-card:nth-child(3) p { color: color-mix(in srgb, var(--bg) 76%, transparent); }
.method-tag { margin-top: auto; padding-top: 25px; color: var(--accent-strong); font-size: 9px; letter-spacing: 0.08em; }

.sources-section { padding-bottom: 96px; }
.registry-table-wrap { border-radius: var(--radius); }
.registry-table { min-width: 850px; }
.registry-table th, .registry-table td { padding: 15px 16px; }
.registry-table tbody th { font-size: 13px; }
.registry-table code { padding: 3px 5px; border-radius: 4px; background: var(--surface-strong); color: var(--accent-strong); font-family: "IBM Plex Mono", monospace; font-size: 10px; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 15px; }
.source-card { min-height: 245px; display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius); }
.source-card h3 { margin: 50px 0 10px; font-size: 22px; letter-spacing: -0.05em; line-height: 1.05; }
.source-card p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.source-link { margin-top: auto; padding-top: 22px; }
.source-card-dark { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.source-card-dark .mono-label { color: var(--accent); }
.source-card-dark p { color: color-mix(in srgb, var(--bg) 76%, transparent); }
.source-card-dark .source-link { color: var(--accent); }
.source-link-button { border: 0; background: transparent; cursor: pointer; text-align: left; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 110px; align-items: center; color: var(--muted); font-size: 12px; }
.footer-inner > div:first-child { display: grid; gap: 3px; }
.footer-inner strong { color: var(--ink); font-size: 13px; }
.footer-inner a { color: var(--ink-soft); text-underline-offset: 3px; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent-strong); }

@media (max-width: 1020px) {
    .header-inner { grid-template-columns: 1fr auto; }
    .primary-nav { order: 3; grid-column: 1 / -1; justify-content: center; border-top: 1px solid var(--line); }
    .primary-nav a { padding: 14px 0 13px; }
    .header-inner { padding-top: 8px; }
    .hero { grid-template-columns: 1fr; gap: 36px; min-height: auto; }
    .hero-brief { max-width: 620px; }
    .section-heading { grid-template-columns: 1fr; gap: 16px; }
    .section-intro { max-width: 600px; }
    .monitor-layout { grid-template-columns: 1fr; }
    .control-rail { position: static; display: grid; grid-template-columns: 1fr 1.2fr 1fr; }
    .control-block { border-right: 1px solid var(--line); border-bottom: 0; }
    .control-block:last-child { border-right: 0; }
    .country-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .shell { width: min(100% - 32px, 640px); }
    .site-header { position: static; }
    .header-inner { gap: 14px; }
    .brand-copy span { display: none; }
    .header-refresh { display: none; }
    .theme-button { padding: 7px 0; font-size: 11px; }
    .primary-nav { gap: 22px; justify-content: flex-start; overflow-x: auto; }
    .hero { padding-top: 60px; padding-bottom: 54px; }
    .hero h1 { max-width: 540px; font-size: clamp(48px, 15vw, 72px); }
    .hero-lede { font-size: 18px; }
    .hero-brief { padding: 18px; }
    .brief-grid { margin-top: 30px; }
    .section { padding-top: 62px; }
    .section-heading h2, .reading-lead h2 { font-size: 37px; }
    .control-rail { display: block; }
    .control-block { border-right: 0; border-bottom: 1px solid var(--line); }
    .control-block:last-child { border-bottom: 0; }
    .indicator-list { grid-template-columns: 1fr 1fr; }
    .indicator-button { min-height: 67px; }
    .chart-card { min-height: 290px; margin-right: -6px; padding-top: 14px; }
    .chart-axis { margin-left: 122px; margin-right: 62px; }
    .bar-chart { min-width: 540px; gap: 8px; }
    .bar-row { grid-template-columns: 108px minmax(220px, 1fr) 52px; gap: 10px; }
    .bar-label { font-size: 11px; }
    .summary-strip { gap: 10px; }
    .summary-strip strong { font-size: 11px; }
    .reading-section { grid-template-columns: 1fr; gap: 32px; margin-top: 62px; padding: 30px 22px; }
    .method-grid, .source-grid { grid-template-columns: 1fr; }
    .method-card { min-height: 240px; }
    .method-card h3, .source-card h3 { margin-top: 42px; }
    .sources-section { padding-bottom: 70px; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; gap: 18px; padding: 25px 0; }
    .footer-links { gap: 16px; flex-wrap: wrap; }
}

@media (max-width: 470px) {
    .indicator-list { grid-template-columns: 1fr; }
    .chart-meta { gap: 15px; justify-content: space-between; }
    .chart-meta strong { font-size: 11px; }
    .chart-meta .mono-label { font-size: 8px; }
    .summary-strip { grid-template-columns: 1fr; gap: 11px; }
    .summary-strip div { grid-template-columns: 1fr 1fr; align-items: baseline; }
    .summary-strip strong { text-align: right; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
