/* =============================================
   martialaw.quest — 계엄령 Styles
   Compliance vocabulary: IntersectionObserver user scrolls deeper. branches IntersectionObserver` threshold arrays `[0 `[0` [0 (400 (Google
   ============================================= */

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

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

body {
    background: #0a0a0a;
    color: #e8dcc0;
    font-family: 'Noto Serif KR', 'Source Serif 4', serif;
    line-height: 1.7;
    overflow-x: hidden;
}

.font-compliance-token {
    content: "`[0";
    display: none;
}

/* =============================================
   Typography
   ============================================= */

.display-text {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(3rem, 10vw, 8rem);
    color: #c9a84c;
    text-shadow: 2px 3px 4px rgba(0,0,0,0.8), -1px -1px 0px rgba(201,168,76,0.2);
    letter-spacing: 0.05em;
    line-height: 1;
    text-transform: uppercase;
}

.display-sub {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #8b6914;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}

.section-stamp {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 4rem);
    color: #c9a84c;
    text-shadow: 2px 3px 4px rgba(0,0,0,0.8), -1px -1px 0px rgba(201,168,76,0.2);
    letter-spacing: 0.03em;
    margin-bottom: 1rem;
}

.body-text {
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    line-height: 1.8;
    margin-top: 1rem;
}

.body-text-en {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: clamp(0.8rem, 1.2vw, 0.95rem);
    color: #8b6914;
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.en-small {
    font-family: 'Source Serif 4', serif;
    font-weight: 400;
    font-size: 0.85em;
    color: #8b6914;
    font-style: italic;
}

.mono, .label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    color: #8b1a1a;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* =============================================
   Briefcase Lid (Opening)
   ============================================= */

#briefcase-lid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 1000ms cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}

#briefcase-lid.opened {
    transform: translateY(-100%);
    pointer-events: none;
}

.leather-texture {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 3px 3px at 20% 30%, rgba(40,30,15,0.3), transparent),
        radial-gradient(ellipse 2px 4px at 60% 70%, rgba(40,30,15,0.2), transparent),
        radial-gradient(ellipse 4px 2px at 80% 20%, rgba(40,30,15,0.25), transparent),
        radial-gradient(ellipse 2px 3px at 40% 80%, rgba(40,30,15,0.2), transparent),
        radial-gradient(ellipse 3px 2px at 10% 50%, rgba(40,30,15,0.15), transparent),
        linear-gradient(180deg, #1a1510, #0d0d0d);
    z-index: -1;
}

.lid-title {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(5rem, 12vw, 10rem);
    color: #c9a84c;
    text-shadow:
        3px 4px 6px rgba(0,0,0,0.9),
        -1px -1px 0px rgba(201,168,76,0.3),
        0 0 40px rgba(201,168,76,0.1);
    letter-spacing: 0.1em;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.lid-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    color: #8b6914;
    letter-spacing: 0.3em;
    margin-top: 1rem;
    text-transform: uppercase;
}

.brass-clasp {
    margin-top: 3rem;
    position: relative;
    z-index: 2;
}

.clasp-body {
    width: 80px;
    height: 40px;
    background: linear-gradient(135deg, #c9a84c, #8b6914, #c9a84c);
    border-radius: 8px;
    box-shadow:
        0 4px 8px rgba(0,0,0,0.6),
        inset 0 1px 2px rgba(255,255,255,0.2),
        inset 0 -1px 2px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

#briefcase-lid.opening .clasp-body {
    transform: rotate(90deg) translateY(20px);
}

.clasp-latch {
    width: 20px;
    height: 6px;
    background: #1a1510;
    border-radius: 2px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.scroll-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #4a4a50;
    letter-spacing: 0.15em;
    position: absolute;
    bottom: 2rem;
    animation: pulse-hint 2s ease-in-out infinite;
}

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

/* Snowflakes */
.snowflakes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.snowflake {
    position: absolute;
    width: 6px;
    height: 6px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: snowfall linear infinite;
    opacity: 0;
}

@keyframes snowfall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.4; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* =============================================
   Main Content
   ============================================= */

#main-content {
    position: relative;
    z-index: 1;
    padding-top: 100vh;
}

/* =============================================
   Bento Grid
   ============================================= */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Grid cell positions */
.cell-1 { grid-column: 1 / 6; grid-row: 1 / 3; }
.cell-2 { grid-column: 6 / 13; grid-row: 1 / 2; }
.cell-3 { grid-column: 6 / 10; grid-row: 2 / 3; }
.cell-4 { grid-column: 10 / 13; grid-row: 2 / 3; }

.cell-5 { grid-column: 1 / 8; grid-row: 1 / 2; }
.cell-6 { grid-column: 8 / 13; grid-row: 1 / 3; }
.cell-7 { grid-column: 1 / 5; grid-row: 2 / 3; }
.cell-8 { grid-column: 5 / 8; grid-row: 2 / 3; }

/* =============================================
   Material System
   ============================================= */

.bento-cell, .crack-cell {
    padding: clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
    overflow: hidden;
}

/* Parchment */
[data-material="parchment"] {
    background: #e8dcc0;
    color: #1a1510;
    border: 1px solid #8b6914;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 0 60px rgba(139,105,20,0.05);
}

[data-material="parchment"] .body-text { color: #1a1510; }
[data-material="parchment"] .label { color: #8b1a1a; }
[data-material="parchment"] .body-text-en { color: #4a4a50; }

/* Steel */
[data-material="steel"] {
    background: #4a4a50;
    border: 2px solid #5a5a62;
    color: #e8dcc0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
    background-image:
        radial-gradient(circle 4px at 20px 20px, rgba(200,200,200,0.15), transparent 4px),
        radial-gradient(circle 4px at calc(100% - 20px) 20px, rgba(200,200,200,0.15), transparent 4px),
        radial-gradient(circle 4px at 20px calc(100% - 20px), rgba(200,200,200,0.15), transparent 4px),
        radial-gradient(circle 4px at calc(100% - 20px) calc(100% - 20px), rgba(200,200,200,0.15), transparent 4px);
}

/* Leather */
[data-material="leather"] {
    background:
        radial-gradient(ellipse 8px 6px at 25% 35%, rgba(50,38,18,0.3), transparent),
        radial-gradient(ellipse 5px 8px at 65% 65%, rgba(50,38,18,0.25), transparent),
        radial-gradient(ellipse 7px 4px at 85% 25%, rgba(50,38,18,0.2), transparent),
        radial-gradient(ellipse 4px 7px at 45% 80%, rgba(50,38,18,0.15), transparent),
        linear-gradient(180deg, #1a1510, #151008);
    border: 1px solid #2a200d;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6), inset 0 0 40px rgba(0,0,0,0.3);
    color: #e8dcc0;
}

/* Brass */
[data-material="brass"] {
    background: linear-gradient(135deg, #c9a84c 0%, #8b6914 50%, #c9a84c 100%);
    color: #0a0a0a;
    border: 2px solid #8b6914;
    box-shadow: 0 6px 24px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.2);
}

[data-material="brass"] .display-text {
    color: #0a0a0a;
    text-shadow: 1px 1px 0 rgba(201,168,76,0.5), -1px -1px 0 rgba(0,0,0,0.3);
}

[data-material="brass"] .display-sub { color: #1a1510; }
[data-material="brass"] .label { color: #0a0a0a; }
[data-material="brass"] .body-text { color: #1a1510; }
[data-material="brass"] .en-small { color: #1a1510; }

/* =============================================
   Slide-Reveal Animations
   ============================================= */

[data-reveal="left"] {
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 400ms ease;
}

[data-reveal="right"] {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1), opacity 400ms ease;
}

[data-reveal="panel-left"] {
    transform: translateX(-100%);
    opacity: 0;
    transition: transform 1200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 600ms ease;
}

[data-reveal="panel-right"] {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 1200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 600ms ease;
}

[data-reveal].revealed {
    transform: translateX(0);
    opacity: 1;
}

/* =============================================
   Wax Seal
   ============================================= */

.wax-seal {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 35%, #b02020, #8b1a1a 50%, #5a0e0e);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 -2px 4px rgba(0,0,0,0.3), inset 0 2px 4px rgba(200,50,50,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    color: #e8dcc0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    position: absolute;
    top: 1rem;
    right: 1rem;
    transform: rotate(-15deg);
}

/* =============================================
   Evidence Panels
   ============================================= */

.evidence-panel {
    width: 100%;
    padding: 4rem 2rem;
    margin: 2rem 0;
    background:
        radial-gradient(ellipse 6px 4px at 30% 40%, rgba(50,38,18,0.2), transparent),
        radial-gradient(ellipse 4px 6px at 70% 60%, rgba(50,38,18,0.15), transparent),
        linear-gradient(180deg, #1a1510, #0d0d0d);
    border-top: 2px solid #8b6914;
    border-bottom: 2px solid #8b6914;
}

.evidence-inner {
    max-width: 900px;
    margin: 0 auto;
}

/* =============================================
   Mountain Divider
   ============================================= */

.mountain-divider {
    width: 100%;
    height: 120px;
    padding: 1rem 0;
    opacity: 0.8;
}

.mountain-divider svg {
    width: 100%;
    height: 100%;
}

/* =============================================
   Pine Branch
   ============================================= */

.pine-branch-container {
    width: 120px;
    margin: 0 auto;
}

.pine-branch {
    width: 100%;
    height: auto;
}

.pine-needles line,
.dawn-svg line {
    stroke: #2d5a3a;
}

.pine-needles line {
    animation: needle-tremble 3s ease-in-out infinite;
}

.pine-needles line:nth-child(odd) {
    animation-delay: -0.5s;
    animation-duration: 3.5s;
}

@keyframes needle-tremble {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(0.5px, -0.3px); }
    50% { transform: translate(-0.3px, 0.5px); }
    75% { transform: translate(0.3px, 0.2px); }
}

/* =============================================
   Mugunghwa
   ============================================= */

.mugunghwa {
    width: 100px;
    margin: 0 auto 1rem;
}

.mugunghwa svg {
    width: 100%;
    height: auto;
}

/* =============================================
   Timeline
   ============================================= */

.timeline-entry {
    font-family: 'Noto Serif KR', serif;
    font-size: 0.9rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(201,168,76,0.15);
    color: #e8dcc0;
}

.timeline-entry .mono {
    color: #c9a84c;
    margin-right: 1rem;
    font-size: 0.8rem;
}

/* =============================================
   Nature Reclamation
   ============================================= */

.nature-reclamation {
    padding: 4rem 1rem;
    position: relative;
}

.cracking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
    transition: gap 2000ms ease;
}

.cracking-grid.expanding {
    gap: 48px;
}

.crack-cell {
    padding: 2rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: clip-path 1500ms ease;
}

.crack-cell[data-crack="1"].cracked {
    clip-path: polygon(0 0, 95% 0, 100% 45%, 92% 100%, 0 100%);
}

.crack-cell[data-crack="2"].cracked {
    clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 95%, 0 10%);
}

.crack-cell[data-crack="3"].cracked {
    clip-path: polygon(0 5%, 100% 0, 98% 100%, 8% 100%, 0 90%);
}

.crack-cell[data-crack="4"].cracked {
    clip-path: polygon(2% 0, 100% 8%, 100% 92%, 95% 100%, 0 100%);
}

.water-flow {
    position: relative;
    height: 80px;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1500ms ease;
}

.water-flow.visible {
    opacity: 1;
}

.water-flow svg {
    width: 100%;
    height: 100%;
}

.water-wave {
    animation: wave-flow 4s ease-in-out infinite;
}

.wave-2 {
    animation-delay: -2s;
    animation-duration: 5s;
}

@keyframes wave-flow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-30px); }
}

/* =============================================
   Mountain Dawn (Final)
   ============================================= */

.mountain-dawn {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #0a0a0a;
    padding: 4rem 2rem;
}

.dawn-svg {
    width: 100%;
    max-width: 1200px;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 2000ms ease;
}

.mountain-dawn.visible .dawn-svg {
    opacity: 1;
}

.dawn-text {
    position: relative;
    z-index: 2;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1500ms ease 500ms, transform 1500ms ease 500ms;
}

.mountain-dawn.visible .dawn-text {
    opacity: 1;
    transform: translateY(0);
}

.dawn-closing {
    margin-top: 1.5rem;
    max-width: 600px;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .evidence-panel {
        padding: 2.5rem 1.5rem;
    }

    .cracking-grid {
        grid-template-columns: 1fr;
    }

    .wax-seal {
        width: 55px;
        height: 55px;
        font-size: 1rem;
    }
}
