/* ========================================
   READING — the written half of the memorial
   The 3D scene shows the scale. These pages say what it means.
   Tokens come from styles.css; this file only handles long-form reading.
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Newsreader:ital,opsz,wght@0,6..72,300..600;1,6..72,300..500&display=swap');

:root {
    --bg-void: #0a0a12;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --text-muted: rgba(255, 255, 255, 0.42);
    --accent-blood: #dc2626;
    --accent-blood-dim: rgba(220, 38, 38, 0.4);
    --accent-ember: #f97316;
    --accent-gold: #fbbf24;
    --rule: rgba(255, 255, 255, 0.12);

    --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --font-read: 'Newsreader', Georgia, 'Times New Roman', serif;

    --measure: 34rem;       /* about 68 characters — one comfortable line */
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg-void);
    color: var(--text-secondary);
    font-family: var(--font-read);
    font-size: 1.18rem;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- masthead */

.masthead {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px clamp(16px, 5vw, 48px);
    background: rgba(10, 10, 18, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--rule);
    font-family: var(--font-sans);
}

.masthead a { color: var(--text-muted); text-decoration: none; font-size: 0.86rem; }
.masthead a:hover { color: var(--text-primary); }
.masthead a[aria-current="page"] { color: var(--accent-gold); }

.masthead .home {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.masthead nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }

/* ------------------------------------------------------------------ layout */

.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 clamp(16px, 5vw, 24px); }

article { padding: clamp(48px, 9vw, 96px) 0 96px; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-blood);
    margin-bottom: 18px;
}

h1 {
    font-family: var(--font-sans);
    font-size: clamp(2.1rem, 6vw, 3.1rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    font-weight: 700;
    margin-bottom: 20px;
}

.standfirst {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 44px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--rule);
}

h2 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    font-weight: 600;
    margin: 56px 0 18px;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.12rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 36px 0 12px;
}

p { margin-bottom: 24px; }

p strong { color: var(--text-primary); font-weight: 600; }

a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--accent-blood-dim); }
a:hover { text-decoration-color: var(--accent-blood); }

ul, ol { margin: 0 0 24px 1.2em; }
li { margin-bottom: 12px; }

/* ------------------------------------------------------------- the figures */

/* A number that should stop the reader. Used sparingly. */
/* Straight after the standfirst its own rule is already there — a second one
   with a gap between reads as an empty box. */
.standfirst + .figure { border-top: none; margin-top: 0; padding-top: 4px; }

.figure {
    margin: 44px 0;
    padding: 28px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    text-align: center;
}

.figure .n {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(2rem, 8vw, 3.4rem);
    font-weight: 500;
    line-height: 1;
    color: var(--accent-blood);
    letter-spacing: -0.02em;
}

.figure .what {
    display: block;
    margin-top: 12px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    color: var(--text-muted);
}

/* A table of receipts. The evidence does not get thinner. */
.receipts {
    width: 100%;
    margin: 32px 0 40px;
    border-collapse: collapse;
    font-family: var(--font-sans);
    font-size: 0.92rem;
}

.receipts caption {
    text-align: left;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding-bottom: 10px;
}

.receipts th, .receipts td { padding: 9px 10px; border-bottom: 1px solid var(--rule); text-align: left; }
.receipts th { color: var(--text-muted); font-weight: 500; font-size: 0.78rem;
               text-transform: uppercase; letter-spacing: 0.08em; }
.receipts td.num { text-align: right; font-family: var(--font-mono); color: var(--text-primary); }
.receipts tr:last-child td { border-bottom: none; }

.scroller { overflow-x: auto; }

blockquote {
    margin: 36px 0;
    padding-left: 22px;
    border-left: 2px solid var(--accent-blood);
    font-size: 1.22rem;
    line-height: 1.55;
    color: var(--text-primary);
}

blockquote cite {
    display: block;
    margin-top: 12px;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    font-style: normal;
    color: var(--text-muted);
}

/* ------------------------------------------------------------------ footer */

.endnotes {
    margin-top: 64px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
    font-family: var(--font-sans);
    font-size: 0.86rem;
    color: var(--text-muted);
}

.endnotes h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em;
                color: var(--text-muted); margin: 0 0 14px; }
.endnotes li { margin-bottom: 9px; }

.next {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 56px;
    padding-top: 28px;
    border-top: 1px solid var(--rule);
    font-family: var(--font-sans);
}

.next a {
    flex: 1 1 200px;
    padding: 16px 18px;
    border: 1px solid var(--rule);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.next a:hover { border-color: var(--accent-blood-dim); background: rgba(220, 38, 38, 0.06); }
.next .lab { display: block; font-size: 0.72rem; text-transform: uppercase;
             letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 5px; }
.next .ttl { display: block; color: var(--text-primary); font-weight: 600; font-size: 1rem; }

.colophon {
    padding: 36px 0 64px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Anything that must not be lost on a small screen. */
@media (max-width: 640px) {
    body { font-size: 1.1rem; }
    .masthead { gap: 12px; }
    .masthead nav { gap: 12px; width: 100%; margin-left: 0; }
}

/* The sound control on a reading page. Same switch as the scene's dock. */
.sound-toggle {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--rule);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.sound-toggle:hover { border-color: var(--accent-blood-dim); background: rgba(220, 38, 38, 0.08); }
.sound-toggle.is-on { border-color: var(--accent-blood-dim); }
.sound-toggle:focus-visible { outline: 2px solid var(--accent-gold); outline-offset: 2px; }

.sound-toggle svg { display: block; }
