/* ============================================
   계엄령.com — Martial Law
   Inflated-3D Editorial Monument
   ============================================ */

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

:root {
    --fog-white: #edf1f4;
    --deep-slate: #1e2228;
    --steel-charcoal: #2a2d35;
    --coastal-slate: #7b8a93;
    --tidal-cerulean: #3d7a9e;
    --brass-patina: #8c9a5e;
    --emergency-amber: #c4873b;
    --gunmetal: #4a5568;
    --coastal-silver: #c8d5db;
    --secondary-text: #3d4046;
    --muted-silver: #b8c3ca;
}

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background: var(--fog-white);
    color: var(--steel-charcoal);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    overflow-x: hidden;
}

/* --- Noise Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 600ms ease-out;
    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.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

#noise-overlay.visible {
    opacity: 1;
}

/* --- Progress Navigation --- */
#progress-nav {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 999;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(ellipse at 35% 30%, var(--coastal-silver) 0%, var(--coastal-slate) 60%, var(--gunmetal) 100%);
    box-shadow: 0 2px 6px rgba(30,34,40,0.2), inset 0 -1px 2px rgba(0,0,0,0.15);
    transition: background 400ms ease, box-shadow 400ms ease, transform 300ms ease;
}

.progress-dot.active {
    background: radial-gradient(ellipse at 35% 30%, var(--coastal-silver) 0%, var(--tidal-cerulean) 50%, var(--gunmetal) 100%);
    box-shadow: 0 2px 8px rgba(61,122,158,0.4), inset 0 -1px 2px rgba(0,0,0,0.15);
    transform: scale(1.25);
}

.progress-dot.filled {
    background: radial-gradient(ellipse at 35% 30%, var(--coastal-slate) 0%, var(--gunmetal) 70%, var(--deep-slate) 100%);
    box-shadow: 0 2px 6px rgba(30,34,40,0.3);
}

/* --- Decree (Section Base) --- */
.decree {
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* --- Decree I: The Proclamation --- */
.decree-proclamation {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fog-white);
}

.decree-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.red-seal {
    position: absolute;
    top: 8%;
    right: 12%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: #8b3a3a;
    opacity: 0.15;
    filter: blur(40px);
    z-index: 1;
}

.sphere-authority {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 40px;
    background: radial-gradient(ellipse at 30% 25%, #c8d5db 0%, #7b8a93 45%, #4a5568 80%, #1e2228 100%);
    box-shadow: 0 20px 60px rgba(30,34,40,0.3);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 800ms ease, transform 800ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sphere-authority.visible {
    opacity: 1;
    transform: scale(1);
}

.decree-character {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: clamp(8rem, 20vw, 18rem);
    color: var(--steel-charcoal);
    line-height: 1;
    opacity: 0;
    transform: perspective(800px) translateZ(0px);
    transition: opacity 600ms ease, transform 1.2s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 1.2s ease;
    text-shadow: none;
}

.decree-character.inflated {
    opacity: 1;
    transform: perspective(800px) translateZ(40px);
    text-shadow: 0 30px 80px rgba(30,34,40,0.25);
}

.domain-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--coastal-slate);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.domain-title.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Decree II: The Authority --- */
.decree-authority {
    min-height: 120vh;
    background: var(--fog-white);
    display: flex;
    padding: 10vh 5%;
}

.decree-column {
    width: 55%;
    margin-left: 10%;
    position: relative;
    z-index: 2;
}

.decree-column-center {
    width: 55%;
    margin: 0 auto;
    text-align: center;
}

.shadow-shelf {
    width: 25%;
    margin-left: auto;
    padding: 2rem;
    position: relative;
}

.shadow-shelf-dark {
    opacity: 0.7;
}

.decree-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 7vw, 6rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    color: var(--steel-charcoal);
    margin-bottom: 0.3em;
}

.decree-heading-light {
    color: var(--coastal-silver);
}

.decree-subheading {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--coastal-slate);
    margin-bottom: 2rem;
    letter-spacing: 0.02em;
}

.decree-subheading-light {
    color: var(--muted-silver);
}

.text-group {
    margin-bottom: 2rem;
}

.text-group p {
    color: var(--secondary-text);
    margin-bottom: 1.5em;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.text-group p.visible {
    opacity: 1;
    transform: translateY(0);
}

.emboss-line {
    height: 1px;
    background: var(--coastal-slate);
    box-shadow: 0 1px 0 rgba(255,255,255,0.6);
    margin: 2.5rem 0;
}

/* Annotations */
.annotation {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--coastal-slate);
    margin-bottom: 1rem;
}

.annotation-light {
    color: var(--muted-silver);
}

.watermark-text {
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    line-height: 1.8;
    color: var(--steel-charcoal);
    opacity: 0.15;
    margin: 2rem 0;
}

/* Constitutional Cylinders */
.constitutional-cylinder {
    width: 40px;
    height: 120px;
    border-radius: 50% / 10%;
    margin: 1.5rem auto;
    transform: rotateY(5deg);
    box-shadow: 4px 8px 20px rgba(30,34,40,0.2);
}

.cylinder-1 {
    background: linear-gradient(135deg, var(--fog-white) 0%, var(--tidal-cerulean) 40%, var(--gunmetal) 100%);
}
.cylinder-2 {
    background: linear-gradient(135deg, var(--coastal-silver) 0%, var(--tidal-cerulean) 50%, var(--deep-slate) 100%);
    width: 35px; height: 100px;
}
.cylinder-3 {
    background: linear-gradient(135deg, var(--fog-white) 0%, var(--coastal-slate) 60%, var(--gunmetal) 100%);
    width: 30px; height: 90px;
}

/* --- Decree III: The Night --- */
.decree-night {
    min-height: 100vh;
    background: var(--deep-slate);
    display: flex;
    padding: 10vh 5%;
    color: var(--muted-silver);
}

.decree-night .text-group p {
    color: var(--muted-silver);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gunmetal);
}

.capsule-timestamp {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.2rem 1.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--gunmetal) 0%, var(--deep-slate) 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.capsule-timestamp.visible {
    opacity: 1;
    transform: translateY(0);
}

.capsule-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
    background: var(--emergency-amber);
    box-shadow: 0 0 8px var(--emergency-amber);
    margin-top: 6px;
}

.capsule-time {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--emergency-amber);
    min-width: 90px;
    margin-top: 2px;
}

.capsule-text {
    font-family: 'Source Serif 4', serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--coastal-silver);
}

/* --- Decree IV: The Resistance --- */
.decree-resistance {
    min-height: 100vh;
    background: var(--fog-white);
    padding: 10vh 5%;
}

.split-columns {
    display: flex;
    width: 80%;
    margin-left: 10%;
}

.split-left {
    flex: 0 0 55%;
    transition: flex 500ms ease;
}

.split-gap {
    flex: 0 0 3%;
    transition: flex 500ms ease;
}

.split-right {
    flex: 0 0 42%;
    position: relative;
    transition: flex 500ms ease;
}

.split-columns.active .split-left { flex: 0 0 48%; }
.split-columns.active .split-gap { flex: 0 0 4%; }
.split-columns.active .split-right { flex: 0 0 48%; }

/* Deflated Forms */
.deflated-form {
    border-radius: 30%;
    position: absolute;
    opacity: 0.5;
    filter: saturate(0.8);
    animation: deflate-wobble 3s ease-in-out infinite;
}

.deflated-1 {
    width: 80px; height: 80px;
    right: 10%; top: 60%;
    background: radial-gradient(ellipse at 40% 35%, var(--coastal-silver) 0%, var(--coastal-slate) 60%, var(--gunmetal) 100%);
    box-shadow: 0 6px 16px rgba(30,34,40,0.15);
}

.deflated-2 {
    width: 50px; height: 50px;
    right: 25%; top: 75%;
    background: radial-gradient(ellipse at 40% 35%, var(--muted-silver) 0%, var(--gunmetal) 80%);
    box-shadow: 0 4px 10px rgba(30,34,40,0.12);
    animation-delay: -1.5s;
}

@keyframes deflate-wobble {
    0%, 100% { border-radius: 30%; box-shadow: 0 6px 16px rgba(30,34,40,0.15); }
    50% { border-radius: 35% 25% 30% 28%; box-shadow: 0 4px 10px rgba(30,34,40,0.1); }
}

/* --- Decree V: The Aftermath --- */
.decree-aftermath {
    min-height: 80vh;
    background: var(--fog-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 5%;
    position: relative;
}

.scales-motif {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0 auto 3rem;
    opacity: 0;
    transition: opacity 1s ease;
}

.scales-motif.visible {
    opacity: 0.5;
}

.scale-left, .scale-right {
    width: 60px;
    height: 30px;
    border-radius: 60px 60px 0 0;
    background: radial-gradient(ellipse at 50% 80%, var(--brass-patina) 0%, #6b7a4a 100%);
}

.scale-right {
    box-shadow: 2px 4px 10px rgba(30,34,40,0.15);
    transform: translateY(4px);
}

.scale-beam {
    width: 120px;
    height: 3px;
    background: var(--brass-patina);
    transform: rotate(-2deg);
}

.closing-proclamation {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    line-height: 1.3;
    color: var(--steel-charcoal);
    max-width: 600px;
    margin: 2rem auto 0;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.closing-proclamation.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Final Pulse Animation --- */
@keyframes dot-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.5); }
}

.progress-dot.pulse {
    animation: dot-pulse 100ms ease;
}

/* --- Gradient Transition Section (between II and III) --- */
.decree-authority {
    background: linear-gradient(180deg, var(--fog-white) 0%, var(--fog-white) 85%, #d3dce3 100%);
}

.decree-night {
    background: linear-gradient(180deg, var(--deep-slate) 0%, var(--deep-slate) 100%);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .decree-column { width: 85%; margin-left: 5%; }
    .shadow-shelf { display: none; }
    .split-columns { flex-direction: column; width: 90%; margin-left: 5%; }
    .split-left, .split-right { flex: 1 1 100%; }
    .split-gap { height: 2rem; }
    .decree-column-center { width: 85%; }
    #progress-nav { left: 8px; }
    .decree-authority, .decree-night, .decree-resistance { padding: 8vh 3%; }
}
