/* ============================================
   ppuzzle.works - Political Puzzle Workshop
   Sci-Fi Magazine-Spread Design System
   ============================================ */

/* --- Interactive elements (links, buttons) styles --- */
/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Crimson Text', Georgia, serif;
    background: #C0C0C0;
    color: #2C2C34;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
.hud-mono {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
}

/* --- Spread (Full-Page Sections) --- */
.spread {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

/* --- COVER SPREAD --- */
#cover-spread {
    background: linear-gradient(135deg, #C0C0C0 0%, #E8E8EC 40%, #C0C0C0 70%, #E8E8EC 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hud-text {
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.1em;
}

.hud-draw {
    opacity: 0;
}

.hud-draw.revealed {
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.hud-draw.revealed[opacity] {
    /* Restore original opacity values via JS */
}

.cover-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 2rem;
}

.cover-subtitle {
    color: #2C2C34;
    opacity: 0.6;
    margin-bottom: 1.5rem;
    font-size: 11px;
    letter-spacing: 0.15em;
}

.masthead {
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 7vw, 96px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #2C2C34;
    line-height: 1.05;
    min-height: 1.2em;
}

.masthead .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

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

.masthead .char.space {
    width: 0.3em;
}

.cover-tagline {
    font-family: 'Crimson Text', Georgia, serif;
    font-size: clamp(17px, 1.6vw, 20px);
    font-style: italic;
    color: #B8956A;
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 0.8s ease 2s;
    line-height: 1.75;
}

.cover-tagline.visible {
    opacity: 1;
}

/* Hero Geometric Illustration */
#hero-illustration {
    position: absolute;
    z-index: 0;
    width: 45vw;
    max-width: 500px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
    pointer-events: none;
}

#hero-illustration.visible {
    opacity: 0.35;
    transform: scale(1);
}

#hero-illustration svg {
    width: 100%;
    height: auto;
}

/* Scroll Indicator */
.cover-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #00D4FF;
    opacity: 0.6;
    animation: scrollPulse 2s ease infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 0.3; transform: translateY(5px); }
}

/* --- SIDEBAR HUD --- */
#sidebar-hud {
    position: fixed;
    right: 0;
    top: 0;
    width: 60px;
    height: 100vh;
    z-index: 100;
    background: linear-gradient(180deg, rgba(44,44,52,0.03) 0%, rgba(44,44,52,0.08) 100%);
    border-left: 1px solid rgba(0,212,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#sidebar-svg {
    width: 60px;
    height: 100%;
}

.section-dot {
    fill: none;
    stroke: #2C2C34;
    stroke-width: 1;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.section-dot.active {
    fill: #00D4FF;
    stroke: #00D4FF;
    opacity: 1;
    r: 5;
}

.section-dot.pulse {
    animation: dotPulse 0.3s ease;
}

@keyframes dotPulse {
    0% { r: 4; }
    50% { r: 6; }
    100% { r: 5; }
}

#progress-bar {
    transition: y2 0.15s ease;
}

#sidebar-label {
    position: absolute;
    bottom: 12px;
    color: #00D4FF;
    opacity: 0.5;
    font-size: 9px;
    letter-spacing: 0.08em;
    writing-mode: horizontal-tb;
}

/* --- PAGE-TURN WIPE --- */
#page-wipe {
    position: fixed;
    top: 0;
    left: -4px;
    width: 2px;
    height: 100vh;
    background: #00D4FF;
    box-shadow: 0 0 10px rgba(0,212,255,0.3), 0 0 20px rgba(0,212,255,0.15);
    z-index: 99;
    pointer-events: none;
    opacity: 0;
    transition: none;
}

#page-wipe.active {
    opacity: 1;
}

/* --- FEATURE SPREADS --- */
.feature-spread {
    background: #F8F8FA;
}

.feature-spread:nth-child(even) {
    background: #E8E8EC;
}

.spread-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 100vh;
}

.feature-spread:nth-child(even) .spread-grid .spread-text {
    order: 2;
}

.feature-spread:nth-child(even) .spread-grid .spread-illustration {
    order: 1;
}

.spread-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 5rem;
    padding-right: 4rem;
}

.spread-label {
    color: #00D4FF;
    margin-bottom: 1.5rem;
    font-size: 10px;
    letter-spacing: 0.12em;
}

.spread-headline {
    font-family: 'Oswald', 'Arial Narrow', sans-serif;
    font-weight: 700;
    font-size: clamp(36px, 5vw, 72px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #2C2C34;
    line-height: 1.1;
    margin-bottom: 2rem;
}

.spread-body {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.75;
    color: #2C2C34;
    margin-bottom: 2rem;
}

.spread-pullquote {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(18px, 1.8vw, 24px);
    line-height: 1.6;
    color: #B8956A;
    border-left: 2px solid #B8956A;
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.spread-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.spread-illustration svg {
    width: 80%;
    max-width: 400px;
    height: auto;
}

/* --- Spread Entrance Animations --- */
.feature-spread .spread-text {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-spread:nth-child(even) .spread-text {
    transform: translateX(30px);
}

.feature-spread .spread-illustration {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.feature-spread:nth-child(even) .spread-illustration {
    transform: translateX(-30px);
}

.feature-spread.in-view .spread-text {
    opacity: 1;
    transform: translateX(0);
}

.feature-spread.in-view .spread-illustration {
    opacity: 1;
    transform: translateX(0);
}

/* --- EDITORIAL CLOSE --- */
#editorial-close {
    background: linear-gradient(135deg, #2C2C34 0%, #3a3a44 50%, #2C2C34 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.editorial-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 4rem 3rem;
    text-align: center;
}

.editorial-label {
    color: #00D4FF;
    opacity: 0.5;
    margin-bottom: 3rem;
    font-size: 10px;
    letter-spacing: 0.15em;
}

.editorial-statement {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(22px, 3vw, 36px);
    line-height: 1.6;
    color: #F8F8FA;
    border: none;
    padding: 0;
    margin: 0 0 3rem 0;
}

.editorial-attribution {
    color: #B8956A;
    font-size: 10px;
    letter-spacing: 0.12em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.editorial-dash {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: #B8956A;
    opacity: 0.5;
}

.editorial-hud {
    opacity: 0.5;
}

/* --- SHAKE-ERROR ANIMATION --- */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.shake {
    animation: shake 0.3s ease;
}

/* Alert Magenta highlight for critical alerts */
.alert-highlight {
    color: #FF2D78;
}

.shake.alert {
    color: #FF2D78;
    text-shadow: 0 0 8px rgba(255, 45, 120, 0.3);
}

/* --- Responsive (Mobile < 768px) --- */
@media (max-width: 768px) {
    .spread-grid {
        grid-template-columns: 1fr;
    }

    .feature-spread:nth-child(even) .spread-grid .spread-text {
        order: 2;
    }

    .feature-spread:nth-child(even) .spread-grid .spread-illustration {
        order: 1;
    }

    .spread-text {
        padding: 3rem 2rem;
    }

    .spread-illustration {
        padding: 2rem;
        min-height: 40vh;
    }

    #sidebar-hud {
        display: none;
    }

    #hero-illustration {
        width: 80vw;
    }

    .cover-content {
        padding: 0 1.5rem;
    }

    .editorial-content {
        padding: 3rem 1.5rem;
    }

    .feature-spread .spread-text,
    .feature-spread:nth-child(even) .spread-text {
        transform: translateY(20px);
    }

    .feature-spread .spread-illustration,
    .feature-spread:nth-child(even) .spread-illustration {
        transform: translateY(20px);
    }

    .feature-spread.in-view .spread-text,
    .feature-spread.in-view .spread-illustration {
        transform: translateY(0);
    }
}

/* Margin for sidebar on desktop */
@media (min-width: 769px) {
    body {
        margin-right: 60px;
    }
}
