/* css/chapter1.css */

:root {
    --paper: #f9f7f1;
    --ink: #111;
    --gold: #d4af37;
    --purple: #7f2c99;
    --measure: 85ch; /* STRICT WIDTH LIMIT */
}

body.article-layout {
    margin: 0;
    padding: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: 'Cormorant Garamond', serif;
    font-size: 21px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- 1. VIZ LAYER (Fixed Background) --- */
.viz-background {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    /* Soft vignette to focus eye on center */
    mask-image: radial-gradient(circle at center, black 40%, rgba(0,0,0,0.8) 100%);
}
#viz-roots { width: 100%; height: 100%; }

/* --- 2. ARTICLE STREAM (Scrolling) --- */
.content-stream {
    position: relative;
    z-index: 10;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center everything */
    padding-bottom: 50vh;
}

/* --- 3. TEXT BLOCKS --- */
.step {
    width: 100%;
    max-width: var(--measure); /* The 85ch Limit */
    margin-bottom: 80vh; /* Space between beats */
    padding: 2rem;
    
    /* Text readability over graph */
    background: rgba(249, 247, 241, 0.92); /* High opacity paper */
    box-shadow: 0 0 30px 30px rgba(249, 247, 241, 0.92); /* Fade out edges */
    
    opacity: 0.1; /* Start dim */
    transition: opacity 0.8s ease;
    pointer-events: auto;
}

.step.is-active { opacity: 1; }

.header-step {
    text-align: center;
    background: transparent;
    box-shadow: none;
    margin-top: 20vh;
    margin-bottom: 60vh;
    opacity: 1;
}

.spacer { height: 20vh; }

/* --- TYPOGRAPHY --- */
h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 5rem;
    line-height: 0.9;
    color: var(--ink);
    margin-bottom: 1.5rem;
}

.intro {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--purple);
    border-top: 1px solid var(--gold);
    border-bottom: 1px solid var(--gold);
    display: inline-block;
    padding: 1rem 2rem;
}

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--ink);
    text-align: center;
}

p { margin-bottom: 1.5rem; color: #222; }

.drop-cap {
    float: left;
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5rem;
    line-height: 0.75;
    margin-right: 15px;
    color: var(--gold);
}

/* Data Tables */
.stat-table {
    margin: 2rem 0;
    border-top: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    padding: 1rem 0;
}
.stat-table.purple-border { border-color: var(--purple); }

.row {
    display: flex; justify-content: space-between;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}
.row:last-child { border: none; }
.gold { color: var(--gold); }
.purple { color: var(--purple); }

/* --- UI ELEMENTS --- */
.article-nav {
    position:sticky;
    top: 0; left: 0;
    padding: 1.5rem 2rem;
    display: flex; justify-content: space-between;
    z-index: 100;
    background: linear-gradient(to bottom, var(--paper) 60%, transparent 100%);
    pointer-events: none;
}
.brand {
    pointer-events: auto;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 700;
    text-decoration: none;
    color: var(--ink);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.issue {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--gold);
}

.legend {
    position: fixed;
    bottom: 30px; left: 30px;
    z-index: 20;
    font-family: 'Lato', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.l-item { margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; display: block; }
.dot.gold-ring { border: 2px solid var(--gold); border-radius: 50%; }
.dot.purple-drop { background: var(--purple); border-radius: 0 50% 50% 50%; transform: rotate(45deg); }

#tooltip {
    position: absolute;
    background: #fff;
    padding: 15px;
    border: 1px solid var(--gold);
    pointer-events: none;
    z-index: 99;
}
#tooltip.hidden { display: none; }

.next-link {
    display: block;
    text-align: center;
    margin-top: 6rem;
    padding: 1rem;
    border: 1px solid var(--ink);
    color: var(--ink);
    text-decoration: none;
    font-family: 'Lato', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;

    transition: 0.3s;
}
.next-link:hover { background: var(--ink); color: #fff; }