/* ============================================================
   martial.quest -- Terminal-Era Magazine Historiography
   Colors: #1A1410, #F5EDE0, #D4785A, #C4A068, #0A0806, #8B7B5E, #C9BFB0
   Fonts: Oswald, Libre Baskerville, Source Code Pro, Noto Serif KR
   ============================================================ */

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #1A1410;
    color: #C9BFB0;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.05vw, 1rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* === SVG FILTERS (hidden) === */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* === NOISE OVERLAY === */
.noise-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
}

.noise-2 {
    opacity: 0.02;
}

.noise-3 {
    opacity: 0.03;
}

/* ============================================================
   SECTION 1: BROADCAST ALERT (HERO)
   ============================================================ */
.hero-section {
    position: relative;
    min-height: 100vh;
    background-color: #1A1410;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6vh 8vw;
    overflow: hidden;
}

.hero-titles {
    position: relative;
    z-index: 2;
    margin-bottom: 4vh;
}

.hero-martial {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(5rem, 14vw, 11rem);
    color: #D4785A;
    text-transform: uppercase;
    line-height: 0.95;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateX(-80px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.hero-martial.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.hero-quest {
    font-family: 'Oswald', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #C4A068;
    text-transform: uppercase;
    line-height: 1;
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateX(80px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.hero-quest.animate-in {
    opacity: 1;
    transform: translateX(0);
}

/* === TERMINAL WINDOW === */
.terminal-window {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1000px;
    min-height: 30vh;
    background-color: #0A0806;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: rgba(26, 20, 16, 0.8);
    border-bottom: 1px solid rgba(139, 123, 94, 0.15);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red {
    background-color: #D4785A;
}

.dot-yellow {
    background-color: #C4A068;
}

.dot-green {
    background-color: #8B7B5E;
}

.terminal-title {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    color: #8B7B5E;
    margin-left: 8px;
}

.terminal-body {
    padding: 20px 24px;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    line-height: 1.7;
}

.terminal-prompt {
    color: #D4785A;
    margin-bottom: 16px;
    min-height: 1.4em;
}

.terminal-prompt::after {
    content: '\2588';
    animation: blink-cursor 1s step-end infinite;
    color: #D4785A;
}

.terminal-prompt.typing-done::after {
    animation: none;
    opacity: 0;
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.log-line {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    margin-bottom: 4px;
}

.log-line.visible {
    opacity: 1;
    transform: translateX(0);
}

.log-timestamp {
    color: #8B7B5E;
}

.log-event {
    color: #D4785A;
}

/* ============================================================
   SECTIONS 2-4: HISTORICAL SPREADS
   ============================================================ */
.spread-section {
    position: relative;
    min-height: 100vh;
    padding: 10vh 8vw;
    overflow: hidden;
}

.spread-dark {
    background-color: #1A1410;
}

.spread-light {
    background-color: #F5EDE0;
}

/* === MAGAZINE GRID === */
.spread-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 4vw;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
}

/* === COLUMNS === */
.spread-col-left,
.spread-col-right {
    padding-top: 2vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out 0.2s, transform 0.4s ease-out 0.2s;
}

.spread-col-center {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.spread-col-left.animate-in,
.spread-col-right.animate-in,
.spread-col-center.animate-in {
    opacity: 1;
    transform: translateY(0);
}

/* === SECTION HEADERS === */
.section-header {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    text-transform: uppercase;
    color: #C4A068;
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.section-header-dark {
    color: #1A1410;
}

/* === BODY TEXT === */
.body-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.05vw, 1rem);
    line-height: 1.85;
    color: #C9BFB0;
    margin-bottom: 1.5rem;
}

.body-text-dark {
    color: #1A1410;
}

/* === PULL QUOTES === */
.pull-quote {
    border-left: 4px solid #D4785A;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.pull-quote::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background-color: #D4785A;
    transition: height 0.3s ease-out;
}

.pull-quote.animate-border::before {
    height: 100%;
}

.pull-quote p {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-style: italic;
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    line-height: 1.35;
    color: #C4A068;
    opacity: 0;
    transition: opacity 0.3s ease-out 0.3s;
}

.pull-quote.animate-border p {
    opacity: 1;
}

.pull-quote-dark {
    border-left-color: #D4785A;
}

.pull-quote-dark p {
    color: #1A1410;
}

/* === MARGIN ANNOTATIONS === */
.margin-annotation {
    margin-top: 3rem;
}

.annotation-date {
    display: block;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    color: #D4785A;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.annotation-text {
    display: block;
    font-family: 'Source Code Pro', monospace;
    font-size: 0.75rem;
    color: #8B7B5E;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.margin-annotation-dark .annotation-date {
    color: #D4785A;
}

.margin-annotation-dark .annotation-text {
    color: #8B7B5E;
}

/* ============================================================
   SECTION 5: COMMAND REFERENCE
   ============================================================ */
.command-section {
    position: relative;
    min-height: 80vh;
    background-color: #0A0806;
    padding: 10vh 8vw;
    overflow: hidden;
}

.command-header {
    font-family: 'Oswald', sans-serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3rem);
    text-transform: uppercase;
    color: #D4785A;
    margin-bottom: 4rem;
    letter-spacing: 0.05em;
    position: relative;
    z-index: 2;
}

.command-list {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.command-entry {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    line-height: 1.8;
    margin-bottom: 0.5rem;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.command-entry.visible {
    opacity: 1;
    transform: translateX(0);
}

.cmd-timestamp {
    color: #8B7B5E;
}

.cmd-desc {
    color: #D4785A;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer-section {
    position: relative;
    background-color: #1A1410;
    padding: 8vh 8vw;
    text-align: center;
    overflow: hidden;
}

.redaction-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 5px,
        rgba(212, 120, 90, 0.08) 5px,
        rgba(212, 120, 90, 0.08) 6px
    );
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-korean {
    font-family: 'Noto Serif KR', serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #C4A068;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
}

.footer-end {
    font-family: 'Source Code Pro', monospace;
    font-size: 0.8rem;
    color: #8B7B5E;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .spread-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .spread-col-left,
    .spread-col-right {
        padding-top: 0;
    }

    .spread-col-left {
        order: 1;
    }

    .spread-col-center {
        order: 2;
    }

    .spread-col-right {
        order: 3;
    }

    .hero-section {
        padding: 4vh 6vw;
    }

    .spread-section {
        padding: 8vh 6vw;
    }

    .command-section {
        padding: 8vh 6vw;
    }

    .terminal-window {
        min-height: auto;
    }

    .log-line,
    .command-entry {
        font-size: 0.75rem;
        word-break: break-word;
    }
}

@media (max-width: 600px) {
    .hero-martial {
        font-size: clamp(3rem, 16vw, 5rem);
    }

    .hero-quest {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .terminal-body {
        padding: 12px 16px;
        font-size: 0.75rem;
    }

    .pull-quote p {
        font-size: 1.3rem;
    }
}
