/* ============================================
   witch-trial.com — Mid-Century Editorial Magazine
   ============================================ */

/* --- CSS Variables --- */
:root {
    --powder-ash: #e8e0d4;
    --bone-cream: #f5f0e8;
    --charcoal: #2c2a26;
    --faded-testimony: #6b6359;
    --verdict-rose: #c87e7e;
    --acquittal-blue: #7ea3c8;
    --brass-rule: #c4a882;
    --evidence-mint: #8fb8a0;
    --pyre-orange: #d4956a;
    --aged-parchment: #9a8f7e;
    --gutter-position: 45%;
}

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

html {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: var(--charcoal);
    background: var(--powder-ash);
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
}

/* --- Fixed Gutter Line --- */
.gutter-line {
    position: fixed;
    top: 0;
    left: var(--gutter-position);
    width: 1px;
    height: 100vh;
    background: var(--brass-rule);
    z-index: 100;
    will-change: transform;
    pointer-events: none;
}

/* --- Accusation Thread SVG --- */
.accusation-thread {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* --- Circuit Traces SVG --- */
.circuit-traces {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10;
    pointer-events: none;
    opacity: 0.5;
}

/* --- Spread Base --- */
.spread {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    scroll-snap-align: start;
    overflow: hidden;
}

.spread-left {
    width: var(--gutter-position);
    height: 100%;
    background: var(--powder-ash);
    padding: 4vh 3vw 6vh 4vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.spread-right {
    width: calc(100% - var(--gutter-position));
    height: 100%;
    background: var(--bone-cream);
    padding: 4vh 5vw 6vh 4vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* --- Typography --- */
.spread-headline {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 9rem);
    line-height: 0.9;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--charcoal);
    margin-bottom: 2rem;
}

.spread-headline .word {
    display: block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.spread.is-visible .spread-headline .word {
    opacity: 1;
    transform: translateY(0);
}

.cover-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(5rem, 15vw, 14rem);
    line-height: 0.85;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--charcoal);
    margin-bottom: 2rem;
}

.cover-title .word {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.spread-cover.is-visible .cover-title .word {
    opacity: 1;
    transform: translateY(0);
}

.cover-subtitle {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 1.72;
    color: var(--faded-testimony);
    max-width: 36ch;
    margin-bottom: 3rem;
}

.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    line-height: 1.72;
    color: var(--charcoal);
    margin-bottom: 1.2rem;
    max-width: 50ch;
}

.spread-left .body-text {
    max-width: 40ch;
    columns: 1;
}

.mono-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    letter-spacing: 0.06em;
    color: var(--aged-parchment);
    text-transform: uppercase;
}

/* --- Drop Caps --- */
.drop-cap {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    float: left;
    font-size: 4.5rem;
    line-height: 0.8;
    padding-right: 0.15em;
    margin-top: 0.05em;
}

.spread-salem .drop-cap { color: var(--verdict-rose); }
.spread-inquisition .drop-cap { color: var(--brass-rule); }
.spread-mccarthy .drop-cap { color: var(--verdict-rose); }
.spread-modern .drop-cap { color: var(--acquittal-blue); }
.spread-mechanism .drop-cap { color: var(--pyre-orange); }
.spread-reflection .drop-cap { color: var(--evidence-mint); }

/* --- Pull Quotes --- */
.pull-quote {
    position: relative;
    margin: 2rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--brass-rule);
}

.pull-quote .quote-mark {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: 8rem;
    position: absolute;
    top: -2rem;
    left: -1rem;
    opacity: 0.1;
    line-height: 1;
    pointer-events: none;
}

.spread-salem .pull-quote .quote-mark,
.spread-mccarthy .pull-quote .quote-mark { color: var(--verdict-rose); }
.spread-inquisition .pull-quote .quote-mark,
.spread-modern .pull-quote .quote-mark { color: var(--acquittal-blue); }
.spread-reflection .pull-quote .quote-mark { color: var(--evidence-mint); }

.pull-quote p {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    line-height: 1.4;
    color: var(--charcoal);
    font-style: italic;
}

.pull-quote cite {
    display: block;
    margin-top: 0.75rem;
    font-style: normal;
}

.pull-quote-large p {
    font-size: clamp(1.8rem, 4vw, 3.5rem);
}

/* --- Evidence Tags --- */
.evidence-tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    letter-spacing: 0.06em;
    color: var(--charcoal);
    background: var(--evidence-mint);
    padding: 0.3em 0.8em;
    text-transform: uppercase;
    margin: 0.5rem 0;
}

/* --- Vintage Photos --- */
.vintage-photo {
    position: relative;
    width: 100%;
    height: 200px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.photo-inner {
    width: 100%;
    height: 100%;
    background: var(--charcoal);
    opacity: 0.15;
}

.vintage-photo[data-accent="prosecution"] .photo-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--verdict-rose);
    mix-blend-mode: color;
    opacity: 0.3;
}

.vintage-photo[data-accent="defense"] .photo-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--acquittal-blue);
    mix-blend-mode: color;
    opacity: 0.3;
}

/* --- Rule Lines --- */
.rule-line {
    position: absolute;
    background: var(--brass-rule);
}

.rule-line.rule-h {
    height: 1px;
    left: 0;
}

/* --- Folio --- */
.folio {
    position: absolute;
    bottom: 2vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

/* --- Cover Specific --- */
.cover-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.cover-decoration {
    position: relative;
    height: 100px;
}

.scroll-hint {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.scroll-arrow {
    font-size: 1.5rem;
    color: var(--aged-parchment);
    animation: bounce 2s ease-in-out infinite;
}

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

/* --- Mechanism Diagram --- */
.mechanism-diagram {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 1rem 0;
}

.mechanism-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.step-node {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bone-cream);
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 1rem;
}

.mechanism-step h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--charcoal);
    margin-bottom: 0.25rem;
}

/* --- Spread Background Variations --- */
.spread-cover .spread-left { background: var(--powder-ash); }
.spread-cover .spread-right { background: var(--bone-cream); }

.spread-salem .spread-left { background: #ebe3d5; }
.spread-salem .spread-right { background: #f7f2ea; }

.spread-inquisition .spread-left { background: #e6ddd0; }
.spread-inquisition .spread-right { background: #f4efe6; }

.spread-mccarthy .spread-left { background: #e3ddd5; }
.spread-mccarthy .spread-right { background: #f0ece6; }

.spread-modern .spread-left { background: #e5ded2; }
.spread-modern .spread-right { background: #f3eee5; }

.spread-mechanism .spread-left { background: var(--powder-ash); }
.spread-mechanism .spread-right { background: var(--bone-cream); }

.spread-reflection .spread-left { background: #e4dcd0; }
.spread-reflection .spread-right { background: #f2ede4; }

/* --- Reflection --- */
.reflection-text {
    position: relative;
}

/* --- Circuit Node Pulse Animation --- */
@keyframes nodePulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.circuit-node.is-active {
    animation: nodePulse 600ms ease-out forwards;
}

/* --- Responsive (basic) --- */
@media (max-width: 768px) {
    .spread {
        flex-direction: column;
    }
    .spread-left, .spread-right {
        width: 100%;
        height: 50%;
    }
    .gutter-line {
        left: 0;
        top: 50%;
        width: 100%;
        height: 1px;
    }
    .cover-title {
        font-size: clamp(3rem, 20vw, 6rem);
    }
}
