/* ── Fonts ─────────────────────────────────────────────────── */
@font-face {
    font-family: 'Gothic821Condensed';
    src: url('fonts/Gothic821Condensed.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --bg: #0e0c09;
    --bg-warm: #141008;
    --surface: #1a1610;
    --border: #2e2618;
    --dust: #c4975a;
    --dust-light: #e8c080;
    --dust-dim: #7a5c32;
    --text: #f0e8d8;
    --text-dim: #8a7a62;
    --text-muted: #5a4e3a;
    --accent: #c4622a;
    --accent-dim: #8a3e18;
    --white: #f0e8d8;

    --font-display: 'Gothic821Condensed';
    --font-serif: 'Courier New', Courier, monospace;
    --font-body: 'Courier New', Courier, monospace;

    --max-w: 1080px;
    --col-gap: 2rem;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    color: var(--text);
    font-family: var(--font-body), serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
}

/* ── Grain overlay ─────────────────────────────────────────── */
.grain {
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 4rem 2rem;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 1) 100%),
    url("./images/ScreenShot16.png") no-repeat center / cover;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-label {
    font-family: var(--font-display);
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeUp 1s ease 0.3s forwards;
}

.hero-title {
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    margin-bottom: 2rem;
}

.title-line {
    font-family: var(--font-display);
    font-size: clamp(5rem, 18vw, 14rem);
    color: var(--dust);
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeUp 1s ease 0.5s forwards;
}

.title-accent {
    color: var(--dust);
    animation-delay: 0.65s;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    color: var(--text-dim);
    font-weight: 400;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    opacity: 0;
    animation: fadeUp 1s ease 0.9s forwards;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: var(--dust-dim);
    margin: 0 auto;
    opacity: 0;
    animation: fadeUp 1s ease 1.1s forwards;
}

.scroll-hint {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    animation: bounce 2s ease-in-out infinite 2s;
    z-index: 2;
}

/* ── Paper layout ──────────────────────────────────────────── */
.paper {
    background: var(--bg);
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--col-gap);
    max-width: 1100px;
    margin: 0 auto;
    padding: 6rem 2rem 6rem;
    align-items: start;
    border: 2px solid var(--white);
}
/* ── Images ────────────────────────────────────────────────── */
.paper-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 2.5rem 0;
    border: 1px solid var(--border);
}

.paper-img-caption {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: -1.5rem;
    margin-bottom: 2.5rem;
    font-style: italic;
}
.img-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2.5rem 0;
}

.img-pair .paper-img {
    margin: 0;
}

.img-pair-caption {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Table of contents ─────────────────────────────────────── */
.toc-wrapper {
    height: 350px;
    align-self: start;
    position: relative;
    z-index: 20;
}

.toc {
    padding: 10px;
    border-right: 1px solid white;
    position: sticky;
    top: 3rem;
    z-index: 20;
    pointer-events: all;
}

.toc-label {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    color: var(--dust-dim);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.toc ol {
    list-style: none;
    counter-reset: toc;
}

.toc ol li {
    counter-increment: toc;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.toc ol li::before {
    content: counter(toc, decimal-leading-zero);
    font-family: var(--font-display);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.toc a {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-dim);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s ease;
    position: relative;
    z-index: 20;
    pointer-events: all;
}

.toc a:hover {
    color: var(--dust);
}

/* ── Body text ─────────────────────────────────────────────── */
.body-text {
    max-width: var(--max-w);
    margin-left: -200px;
}

.indent-first {
    margin-left: 200px;
}

.section {
    margin-bottom: 4.5rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text);
}

p:last-child {
    margin-bottom: 0;
}

/* Drop cap */
.drop-cap::first-letter {
    font-family: var(--font-serif);
    font-size: 4.5rem;
    font-weight: 900;
    float: left;
    line-height: 0.8;
    margin: 0.1em 0.1em 0 0;
    color: var(--dust);
}

/* ── Headings ──────────────────────────────────────────────── */
.section-heading {
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
}

.sub-heading {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.15em;
    color: var(--dust);
    text-transform: uppercase;
    margin: 2.5rem 0 1rem;
}

/* ── Pullquote ─────────────────────────────────────────────── */
blockquote {
    border-left: 2px solid var(--accent);
    padding: 1.2rem 1.8rem;
    margin: 2.5rem 0;
    background: var(--surface);
    position: relative;
}

blockquote p, blockquote {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.2rem;
    line-height: 1.7;
    color: var(--dust-light);
    margin: 0;
}

.pullquote-inline {
    font-style: italic;
    color: var(--dust-light);
}

/* ── References ────────────────────────────────────────────── */
.references-section {
    border-top: 1px solid var(--border);
    padding-top: 3rem;
}

.references-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.references-list li {
    font-size: 0.95rem;
    color: var(--text-dim);
    padding-left: 2rem;
    text-indent: -2rem;
    line-height: 1.7;
}

.references-list a {
    color: var(--dust-dim);
    text-decoration: none;
    word-break: break-all;
}

.references-list a:hover {
    color: var(--dust);
}

em {
    font-style: italic;
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    font-family: var(--font-display);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* Scroll reveal */
.section {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .paper {
        grid-template-columns: 1fr;
        padding: 4rem 1.5rem;
    }

    .toc-wrapper {
        height: auto;
        position: relative;
        z-index: 20;
        border-bottom: 1px solid var(--border);
        padding-bottom: 2rem;
        margin-bottom: 3rem;
    }

    .toc {
        position: static;
        border-right: none;
        z-index: 20;
        pointer-events: all;
    }

    .toc a {
        position: relative;
        z-index: 20;
        pointer-events: all;
    }

    .body-text {
        max-width: 100%;
        margin-left: 0;
    }

    .indent-first {
        margin-left: 0;
    }

    .title-line {
        font-size: clamp(4rem, 22vw, 8rem);
    }

    .section-heading {
        font-size: 1.5rem;
    }

    body {
        font-size: 1.05rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 1.5rem;
    }

    .paper {
        padding: 3rem 1.25rem;
    }
}