/* =============================================
   Writing — Shared Poem/Essay Styles
   Base layout, opening, stanza, fracture,
   closing, back-link, animations, responsive.
   
   Each poem page provides its own :root vars
   and line-* classes via inline <style>.
   ============================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.8;
}

/* --- OPENING --- */

.opening {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.opening::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--accent));
}

.epigraph {
    font-size: clamp(1.4rem, 4vw, 2.6rem);
    font-style: italic;
    text-align: center;
    max-width: 700px;
    color: var(--text);
    line-height: 1.5;
    opacity: 0;
    animation: breatheIn 2s ease forwards 0.5s;
}

.epigraph-source {
    margin-top: 30px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0;
    animation: breatheIn 2s ease forwards 1.5s;
}

.scroll-cue {
    position: absolute;
    bottom: 40px;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-dim);
    opacity: 0;
    animation: breatheIn 2s ease forwards 2.5s, pulse 3s ease-in-out infinite 4s;
}

/* --- POEM BODY --- */

.poem {
    max-width: 680px;
    margin: 0 auto;
    padding: 80px 24px 160px;
}

.stanza {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.name-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.name-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.stanza p {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    line-height: 1.9;
    margin-bottom: 0.4em;
}

/* --- DIVIDERS --- */

.fracture {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

.fracture-line {
    flex: 1;
    height: 1px;
    background: var(--accent);
    opacity: 0.2;
}

.fracture-mark {
    margin: 0 20px;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.5em;
    color: var(--text-faded, var(--text-dim));
}

/* --- RIGHTS BLOCK (You Will Not Read Me) --- */

.rights-block {
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.rights-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.rights-block p {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    line-height: 1.9;
    margin-bottom: 0.4em;
}

/* --- COMPANION PIECE (I Am Dead / I Am Alive) --- */

.companion {
    margin-top: 24px;
}

.companion-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-dim, #7a7387);
    margin-bottom: 8px;
}

.companion-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim, #7a7387);
    text-decoration: none;
    transition: color 0.3s ease;
}

.companion-link:hover {
    color: var(--text);
}

/* --- BACK LINK --- */

.back-link {
    position: fixed;
    top: 24px;
    left: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
    z-index: 100;
}

.back-link:hover {
    color: var(--text);
}

/* --- CLOSING --- */

.closing {
    text-align: center;
    padding: 80px 20px 60px;
    border-top: 1px solid rgba(155, 135, 196, 0.20);
}

.closing-mark {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* --- ANIMATIONS --- */

@keyframes breatheIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50%       { opacity: 1; }
}

/* --- RESPONSIVE --- */

@media (max-width: 600px) {
    .poem {
        padding: 60px 20px 120px;
    }

    .stanza,
    .rights-block {
        margin-bottom: 2.2rem;
    }

    .fracture {
        margin: 2.5rem 0;
    }
}
