@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=JetBrains+Mono:wght@400;500;700&display=swap');

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

/* ── Base ── */
body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.55;
    background: #0e0e0e;
    color: #c8c8c8;
    min-height: 100vh;
    position: relative;
}

/* scan-line texture across entire page */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.08) 2px,
        rgba(0, 0, 0, 0.08) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

::selection {
    background: #7a1818;
    color: #fff;
}

a {
    color: #c8c8c8;
    text-decoration: none;
}

/* ── Navigation — horizontal index strip ── */
nav {
    border-bottom: 2px solid #c8c8c8;
    display: grid;
    grid-template-columns: auto 1fr;
}

nav .nav-index {
    background: #7a1818;
    color: #fff;
    padding: 10px 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

nav .nav-links {
    list-style: none;
    display: flex;
    border-left: 2px solid #c8c8c8;
}

nav .nav-links li {
    border-right: 1px solid #333;
}

nav .nav-links li:last-child {
    border-right: none;
}

nav .nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #666;
    transition: color 0.15s, background 0.15s;
    font-weight: 500;
}

nav .nav-links a .nav-num {
    color: #444;
    font-weight: 700;
}

nav .nav-links a:hover {
    color: #fff;
    background: #161616;
}

nav .nav-links a.active {
    color: #fff;
    background: #161616;
}

nav .nav-links a.active .nav-num {
    color: #7a1818;
}

/* ── Page header — left-aligned, editorial ── */
.page-head {
    border-bottom: 1px solid #282828;
    padding: 48px 40px 36px;
}

.page-head .overline {
    display: block;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #7a1818;
    margin-bottom: 10px;
    font-weight: 700;
}

.page-head h1 {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-size: 3.4em;
    font-weight: 900;
    color: #f0f0f0;
    line-height: 1.05;
    max-width: 720px;
    letter-spacing: -0.02em;
}

.page-head h1 em {
    font-style: italic;
    font-weight: 400;
    color: #7a1818;
}

.page-head .subline {
    margin-top: 14px;
    color: #666;
    font-size: 12px;
    max-width: 520px;
    line-height: 1.6;
}

/* ── Layout shell ── */
.frame {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
}

/* two-col asymmetric: narrow left column, wide right */
.split {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    border-left: 1px solid #282828;
    border-right: 1px solid #282828;
}

.split .col-label {
    padding: 28px 20px;
    border-right: 1px solid #282828;
    border-bottom: 1px solid #282828;
}

.split .col-label h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3em;
    font-weight: 700;
    color: #e8e8e8;
    line-height: 1.2;
    position: sticky;
    top: 60px;
}

.split .col-label .label-num {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #7a1818;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 700;
}

.split .col-body {
    padding: 28px 28px;
    border-bottom: 1px solid #282828;
}

/* single column block */
.block {
    border-left: 1px solid #282828;
    border-right: 1px solid #282828;
    border-bottom: 1px solid #282828;
    padding: 28px;
}

.block--flush {
    padding: 0;
}

/* ── Typography ── */
.t-body {
    color: #aaa;
    font-size: 13px;
    line-height: 1.75;
    max-width: 600px;
}

.t-body + .t-body {
    margin-top: 14px;
}

.t-serif {
    font-family: 'Playfair Display', Georgia, serif;
}

.t-label {
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #555;
    font-weight: 700;
}

.t-red {
    color: #7a1818;
}

/* ── Horizontal rule ── */
.rule {
    border: none;
    border-top: 1px solid #282828;
    margin: 0;
}

.rule--heavy {
    border-top: 2px solid #c8c8c8;
}

.rule--red {
    border-top: 2px solid #7a1818;
}

/* ── Stat strip — horizontal row, not cards ── */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-left: 1px solid #282828;
    border-right: 1px solid #282828;
    border-bottom: 2px solid #c8c8c8;
}

.stat-strip .stat {
    padding: 20px 20px;
    border-right: 1px solid #282828;
}

.stat-strip .stat:last-child {
    border-right: none;
}

.stat-strip .stat-val {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.8em;
    font-weight: 900;
    color: #f0f0f0;
    line-height: 1;
    display: block;
}

.stat-strip .stat-val .stat-unit {
    font-size: 0.45em;
    color: #7a1818;
    font-weight: 700;
    vertical-align: super;
}

.stat-strip .stat-desc {
    display: block;
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #666;
}

/* ── Takeaway list — numbered, dense ── */
.takeaway-list {
    list-style: none;
    counter-reset: takeaway;
}

.takeaway-list li {
    counter-increment: takeaway;
    padding: 12px 0;
    border-bottom: 1px solid #222;
    color: #aaa;
    font-size: 13px;
    line-height: 1.65;
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 0;
}

.takeaway-list li::before {
    content: counter(takeaway, decimal-leading-zero);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    color: #7a1818;
    padding-top: 1px;
}

.takeaway-list li strong {
    color: #e0e0e0;
}

/* ── Message Box (data page readout) ── */
.message-box {
    background: #111;
    color: #c8c8c8;
    padding: 20px 24px;
    margin: 20px 0 0;
    min-height: 100px;
    border: 1px solid #282828;
    border-left: 3px solid #7a1818;
}

.message-box h3 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a1818;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #222;
}

.message-box p {
    line-height: 1.7;
    font-size: 13px;
    color: #aaa;
}

.message-box p strong {
    color: #e0e0e0;
}

/* ── Table ── */
figure {
    margin: 0;
}

figcaption {
    font-size: 12px;
    color: #666;
    padding: 12px 0;
    line-height: 1.6;
    border-top: 1px solid #222;
    margin-top: 0;
}

figcaption strong {
    color: #7a1818;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #0e0e0e;
}

th {
    background: #161616;
    color: #888;
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    border-bottom: 2px solid #7a1818;
    transition: color 0.15s;
}

th:hover {
    color: #e0e0e0;
}

th.has-tooltip::after {
    content: "*";
    color: #7a1818;
    margin-left: 2px;
}

td {
    padding: 9px 14px;
    border-bottom: 1px solid #1e1e1e;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    transition: background 0.12s;
}

tbody tr:hover {
    background: #161616;
}

th:first-child,
td:first-child {
    font-weight: 700;
    color: #e0e0e0;
}

.row-hover {
    background: #1a1a1a !important;
}

.cell-spotlight {
    background: #7a1818 !important;
    color: #fff !important;
}

.highlight-cell {
    background: #7a1818 !important;
    color: #fff !important;
    font-weight: 700;
}

.year-cell {
    cursor: pointer;
    color: #7a1818;
    font-weight: 700;
}

.year-cell:hover {
    text-decoration: underline;
}

/* ── Tooltip ── */
.tooltip {
    display: none;
    position: absolute;
    background: #111;
    color: #aaa;
    padding: 14px;
    max-width: 280px;
    z-index: 1000;
    border: 1px solid #333;
    border-top: 2px solid #7a1818;
    top: 100%;
    left: 0;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.55;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

/* ── Glossary ── */
dl {
    margin: 0;
    padding: 0;
    display: block;
}

.glossary-item {
    border-bottom: 1px solid #1e1e1e;
}

dt {
    font-weight: 700;
    color: #e0e0e0;
    padding: 14px 0 14px 0;
    cursor: pointer;
    transition: color 0.15s;
    font-size: 13px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

dt::before {
    content: '//';
    color: #7a1818;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

dt:hover {
    color: #7a1818;
}

dd {
    margin: 0;
    padding: 0 0 16px 22px;
    color: #888;
    display: none;
    font-size: 13px;
    line-height: 1.7;
    border-left: 2px solid #7a1818;
    margin-left: 4px;
}

/* ── Walkthrough ── */
.walkthrough {
    padding: 0;
    margin: 0;
}

.walkthrough .wt-head {
    display: grid;
    grid-template-columns: 50px 1fr;
    border-bottom: 1px solid #222;
}

.walkthrough .wt-num {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6em;
    font-weight: 900;
    color: #7a1818;
    padding: 16px 0;
    text-align: center;
    border-right: 1px solid #222;
}

.walkthrough .wt-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.15em;
    font-weight: 700;
    color: #e0e0e0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
}

.walkthrough .wt-body {
    padding: 20px 0 20px 50px;
    border-left: none;
}

.walkthrough .wt-body p {
    color: #999;
    font-size: 13px;
    line-height: 1.75;
    max-width: 620px;
    margin: 0 0 12px;
}

.walkthrough .wt-body p:last-child {
    margin-bottom: 0;
}

.clickable-term {
    color: #7a1818;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color 0.15s;
}

.clickable-term:hover {
    color: #c44;
}

/* ── Footer ── */
footer {
    border-top: 2px solid #c8c8c8;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
    font-size: 11px;
    color: #555;
}

footer a {
    color: #7a1818;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

footer a:hover {
    color: #c44;
}

/* ── Utility ── */
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.pt-sm { padding-top: 12px; }
.pb-sm { padding-bottom: 12px; }

/* responsive */
@media (max-width: 768px) {
    .split {
        grid-template-columns: 1fr;
    }

    .split .col-label {
        border-right: none;
        border-bottom: none;
        padding-bottom: 0;
    }

    .stat-strip {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-head {
        padding: 32px 20px 24px;
    }

    .page-head h1 {
        font-size: 2.2em;
    }

    .frame {
        padding: 0 16px;
    }

    nav .nav-links a {
        padding: 10px 10px;
        font-size: 9px;
    }

    .walkthrough .wt-body {
        padding-left: 20px;
    }

    footer {
        flex-direction: column;
        gap: 4px;
        padding: 16px 20px;
    }
}
