/* reasoner.dev -- Dark-Academia Scholarly Manuscript */
:root {
    --bg: #0F1225;
    --bg-secondary: #141828;
    --surface: #1A1F35;
    --gold: #C9A855;
    --text-primary: #E8DCC8;
    --text-secondary: #B8AFA2;
    --text-muted: #6B6052;
    --divider: #3D3022;
    --attention: #A65D4C;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.85;
    color: var(--text-secondary);
    background: var(--bg);
    overflow-x: hidden;
}

/* Paper grain overlay */
.paper-grain {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    filter: url(#grain);
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.6s ease-in;
}
.paper-grain.visible { opacity: 0.03; }

/* Scroll progress */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: var(--gold);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s;
}
.scroll-progress.visible { opacity: 1; }

/* Hero */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Proof tree */
.proof-tree {
    width: 400px;
    height: 300px;
    opacity: 0;
    transition: opacity 0.6s ease-in;
}
.proof-tree.visible { opacity: 1; }
.proof-tree svg { width: 100%; height: 100%; }
.tree-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.4s ease-out;
}
.tree-line.drawn { stroke-dashoffset: 0; }
.tree-node {
    transition: fill 0.2s, stroke-opacity 0.2s;
}
.tree-node:hover {
    fill: rgba(201, 168, 85, 0.5);
    cursor: pointer;
}

/* Monogram */
.monogram {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 80px;
    color: var(--gold);
    letter-spacing: 0.01em;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    animation: candle-flicker 3.2s infinite;
}
.monogram.visible { opacity: 1; }
@keyframes candle-flicker {
    0% { filter: brightness(1.0); }
    23% { filter: brightness(0.92); }
    47% { filter: brightness(1.08); }
    71% { filter: brightness(0.95); }
    100% { filter: brightness(1.0); }
}

/* Tagline / typewriter */
.tagline {
    font-family: 'Inconsolata', monospace;
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 16px;
    height: 1.5em;
    min-width: 1px;
}
.tagline-cursor {
    border-right: 2px solid var(--gold);
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    0%, 100% { border-color: var(--gold); }
    50% { border-color: transparent; }
}

/* Gold flourish divider */
.gold-flourish {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.gold-flourish svg { width: 200px; height: 12px; }

/* Manuscript body */
.manuscript {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

/* Sections */
.ms-section {
    margin-bottom: 4.8rem;
    position: relative;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ms-section.visible {
    opacity: 1;
    transform: translateY(0);
}
.ms-section.no-anim {
    opacity: 1;
    transform: translateY(0);
}

/* Section label */
.section-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 8px;
}

/* Section heading */
.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    margin-bottom: 24px;
    position: relative;
    padding-left: 0;
}
.section-heading::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 4px;
    width: 4px;
    height: 28px;
    background: var(--gold);
}

/* Body text */
.body-text {
    color: var(--text-secondary);
    margin-bottom: 2.4rem;
}
.body-text:last-child { margin-bottom: 0; }

/* Logic code inline */
.logic-code {
    font-family: 'Inconsolata', monospace;
    font-size: 15px;
    color: var(--gold);
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 2px 8px;
}

/* Margin annotations */
.margin-note {
    position: absolute;
    left: -60px;
    top: 40px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.margin-note svg { width: 20px; height: 40px; }
.note-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

/* Closing band */
.closing-band {
    background: #0D0F1A;
    padding: 80px 24px;
    text-align: center;
}
.closing-question {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-style: italic;
    font-size: 24px;
    color: var(--text-primary);
    line-height: 1.4;
    max-width: 600px;
    margin: 0 auto 24px;
}
.closing-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
    .margin-note { display: none; }
}
@media (max-width: 768px) {
    .proof-tree { display: none; }
    .monogram { font-size: 48px; }
    .section-heading { font-size: 28px; }
    body { font-size: 16px; }
    .manuscript { max-width: 90vw; padding: 0 5vw 60px; }
    .closing-question { font-size: 20px; }
}
