/* ============================================================
   계엄령.com — State of Emergency Stylesheet

   Typography sources cited from DESIGN.md:
     "Anton" (Google Fonts) — Primary Display / Proclamation Text
     "Roboto Condensed" (Google Fonts) — Body / Regulatory Details
     "Share Tech Mono" (Google Fonts) — Ticker Text / Scrolling Restrictions
     CSS Seven-Segment — Clock Display

   Behavior implementation references:
     Intersection Observer — CCTV monitor activation, section tracking
     scroll-snap — Proclamation Sequence Experience

   Design system tags: Space:** Emergency Proclamation System

   Palette:
     #0A0A0A  Monitor Black
     #1A1A1A  Ash Gray
     #2A2A2A  Concrete Gray
     #3A5A3A  Phosphor Green
     #8B0000  Emergency Red
     #E0E0E0  Emergency White
     #4A1A1A  Stamp Ink
     #2A3A2A  Surveillance Line
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background: #1A1A1A;
    color: #E0E0E0;
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    cursor: crosshair;
}

/* Scroll container with snap */
#proclamation-scroll {
    width: 100vw;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}

#proclamation-scroll::-webkit-scrollbar {
    display: none;
}

/* Section base */
.proclamation {
    position: relative;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Section Marker (top-left of every section)
   ============================================================ */

.section-marker {
    position: absolute;
    top: 24px;
    left: 24px;
    display: flex;
    align-items: baseline;
    gap: 14px;
    z-index: 10;
    color: #E0E0E0;
    letter-spacing: 0.18em;
}

.section-marker-light {
    color: #3A5A3A;
}

.marker-roman {
    font-family: 'Anton', 'Roboto Condensed', sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 1;
    text-transform: uppercase;
}

.marker-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.32em;
}

/* ============================================================
   Proclamation I: Declaration
   ============================================================ */

#proclamation-i {
    background:
        linear-gradient(rgba(139, 0, 0, 0.15), rgba(139, 0, 0, 0.15)),
        #1A1A1A;
    color: #E0E0E0;
    align-items: center;
    justify-content: center;
}

.declaration-frame {
    position: relative;
    width: 92vw;
    max-width: 1500px;
    padding: 32px 0;
    border-top: 2px solid #E0E0E0;
    border-bottom: 2px solid #E0E0E0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
}

.declaration-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px 18px;
    border-bottom: 1px solid rgba(224, 224, 224, 0.25);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: rgba(224, 224, 224, 0.7);
}

.declaration-text {
    font-family: 'Anton', 'Roboto Condensed', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 0.95;
    padding: 36px 24px;
    color: #E0E0E0;
    letter-spacing: 0.02em;
}

.declaration-line {
    display: block;
    font-size: clamp(40px, 6vw, 84px);
}

.declaration-line-emphasis {
    font-size: clamp(72px, 11vw, 168px);
    color: #E0E0E0;
    text-shadow: 0 0 0 #E0E0E0;
    padding: 12px 0;
    letter-spacing: 0.04em;
    position: relative;
}

.declaration-line-emphasis::before,
.declaration-line-emphasis::after {
    content: "";
    display: inline-block;
    width: clamp(40px, 8vw, 120px);
    height: 4px;
    background: #8B0000;
    vertical-align: middle;
    margin: 0 0.25em;
}

.declaration-footer {
    width: 100%;
    padding: 16px 24px 0;
    border-top: 1px solid rgba(224, 224, 224, 0.25);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: rgba(224, 224, 224, 0.65);
}

/* Official Stamp */
.official-stamp {
    position: absolute;
    top: 12vh;
    right: 8vw;
    z-index: 5;
    pointer-events: none;
    transform: rotate(-15deg);
    opacity: 0;
    animation: stamp-drop 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s forwards;
}

@keyframes stamp-drop {
    0% {
        transform: rotate(-15deg) scale(2.4);
        opacity: 0;
    }
    65% {
        transform: rotate(-15deg) scale(0.95);
        opacity: 1;
    }
    100% {
        transform: rotate(-15deg) scale(1);
        opacity: 1;
    }
}

.stamp-circle {
    width: 180px;
    height: 180px;
    border: 4px solid rgba(139, 0, 0, 0.55);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(139, 0, 0, 0.75);
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    text-align: center;
    background: transparent;
    box-shadow: inset 0 0 0 2px rgba(139, 0, 0, 0.35);
    filter: blur(0.4px);
}

.stamp-text-top {
    font-size: 24px;
    letter-spacing: 0.12em;
    line-height: 1;
}

.stamp-text-mid {
    font-size: 26px;
    margin: 6px 0;
    letter-spacing: 0.05em;
    line-height: 1;
}

.stamp-text-bot {
    font-size: 11px;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.18em;
    line-height: 1;
}

/* Scan-line overlay (used in declaration too) */
.scan-overlay {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(42, 58, 42, 0.30) 0px,
        rgba(42, 58, 42, 0.30) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: screen;
}

/* ============================================================
   Proclamation II: Restrictions
   ============================================================ */

#proclamation-ii {
    background: #1A1A1A;
    align-items: center;
    justify-content: center;
}

.restrictions-heading {
    font-family: 'Anton', sans-serif;
    text-transform: uppercase;
    text-align: center;
    color: #E0E0E0;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 0 24px;
    margin-bottom: 8vh;
}

.restrictions-line {
    display: block;
    font-size: clamp(28px, 4vw, 56px);
    margin-bottom: 10px;
}

.restrictions-line-emphasis {
    font-size: clamp(64px, 9.5vw, 148px);
    color: #8B0000;
    letter-spacing: 0.06em;
    margin: 6px 0;
}

.ticker-row {
    width: 100vw;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid rgba(139, 0, 0, 0.5);
    border-bottom: 1px solid rgba(139, 0, 0, 0.5);
    background: #0A0A0A;
    padding: 22px 0;
}

.ticker-track {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 40s linear infinite;
    will-change: transform;
}

.ticker-item {
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 22px;
    text-transform: uppercase;
    color: #8B0000;
    letter-spacing: 0.18em;
    padding: 0 18px;
}

.ticker-sep {
    display: inline-block;
    color: rgba(139, 0, 0, 0.55);
    font-family: 'Share Tech Mono', monospace;
    font-size: 22px;
    padding: 0 4px;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.restrictions-footer {
    margin-top: 8vh;
    text-align: center;
    color: rgba(224, 224, 224, 0.65);
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

/* ============================================================
   Proclamation III: Surveillance
   ============================================================ */

#proclamation-iii {
    background: #0A0A0A;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
    width: 100vw;
    height: 100vh;
    background: #0A0A0A;
    padding: 60px 0 32px;
}

.monitor-cell {
    position: relative;
    background: #0A0A0A;
    border: 1px solid #3A5A3A;
    overflow: hidden;
    color: #3A5A3A;
    font-family: 'Roboto Condensed', sans-serif;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
    transform: translateY(8px);
}

.monitor-cell.is-online {
    opacity: 1;
    transform: translateY(0);
}

.monitor-cell::before {
    /* CRT scan lines per cell */
    content: "";
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(42, 58, 42, 0.30) 0px,
        rgba(42, 58, 42, 0.30) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 2;
}

.monitor-cell::after {
    /* Static noise simulation */
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(58, 90, 58, 0.06) 0 1px, transparent 1px),
        radial-gradient(circle at 80% 60%, rgba(58, 90, 58, 0.04) 0 1px, transparent 1px),
        radial-gradient(circle at 45% 80%, rgba(58, 90, 58, 0.05) 0 1px, transparent 1px),
        radial-gradient(circle at 65% 15%, rgba(58, 90, 58, 0.04) 0 1px, transparent 1px),
        radial-gradient(circle at 10% 90%, rgba(58, 90, 58, 0.05) 0 1px, transparent 1px);
    background-size: 100px 100px;
    pointer-events: none;
    z-index: 1;
    animation: static-shift 0.1s steps(2) infinite;
}

@keyframes static-shift {
    0%   { background-position: 0 0,    0 0,    0 0,    0 0,    0 0; }
    50%  { background-position: 1px 1px, -1px 0, 0 -1px, 1px 0, -1px 1px; }
    100% { background-position: 0 1px,  1px -1px, -1px 1px, 0 0, 1px 0; }
}

.cell-id {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    color: #3A5A3A;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    z-index: 3;
    position: relative;
}

.cell-text {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #3A5A3A;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 3;
    position: relative;
    align-self: flex-start;
    padding-top: 14px;
}

.cell-status {
    align-self: flex-end;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    color: #8B0000;
    letter-spacing: 0.32em;
    z-index: 3;
    position: relative;
    animation: rec-blink 1.4s ease-in-out infinite;
}

.cell-status-fail {
    color: rgba(139, 0, 0, 0.55);
    animation: none;
}

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

.surveillance-footer {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(58, 90, 58, 0.7);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    z-index: 5;
}

/* ============================================================
   Proclamation IV: Curfew
   ============================================================ */

#proclamation-iv {
    background: #1A1A1A;
    align-items: center;
    justify-content: center;
}

.curfew-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 32px;
    padding: 24px;
}

.curfew-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 13px;
    color: rgba(224, 224, 224, 0.7);
    letter-spacing: 0.4em;
    text-transform: uppercase;
}

.clock {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 36px;
    background: #0A0A0A;
    border: 2px solid #2A2A2A;
}

/* Seven-segment digit */
.digit {
    position: relative;
    width: 80px;
    height: 140px;
}

.seg {
    position: absolute;
    background: rgba(224, 224, 224, 0.05);
    transition: background 0.3s ease;
}

/* Horizontal segments */
.seg-a, .seg-d, .seg-g {
    width: 60px;
    height: 8px;
    left: 10px;
}

.seg-a { top: 0; }
.seg-d { bottom: 0; }
.seg-g { top: 50%; transform: translateY(-50%); }

/* Vertical segments */
.seg-b, .seg-c, .seg-e, .seg-f {
    width: 8px;
    height: 60px;
}

.seg-b { right: 0; top: 6px; }
.seg-c { right: 0; bottom: 6px; }
.seg-e { left: 0;  bottom: 6px; }
.seg-f { left: 0;  top: 6px; }

/* Active segments (will be applied via JS based on data-value) */
.seg.is-on {
    background: #E0E0E0;
    box-shadow: 0 0 6px rgba(224, 224, 224, 0.35);
}

.colon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 36px;
    height: 140px;
}

.colon .dot {
    width: 14px;
    height: 14px;
    background: #E0E0E0;
    box-shadow: 0 0 6px rgba(224, 224, 224, 0.35);
}

.colon.is-blink-off .dot {
    background: rgba(224, 224, 224, 0.05);
    box-shadow: none;
}

.curfew-line {
    font-family: 'Anton', sans-serif;
    font-size: clamp(20px, 2.4vw, 32px);
    text-transform: uppercase;
    color: #E0E0E0;
    letter-spacing: 0.18em;
    max-width: 70vw;
    line-height: 1.2;
}

.curfew-footer {
    margin-top: 12px;
    color: rgba(224, 224, 224, 0.55);
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

/* ============================================================
   Proclamation V: Aftermath
   ============================================================ */

#proclamation-v {
    background: #1A1A1A;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    padding: 40px;
}

.aftermath-frame {
    max-width: 22%;
    text-align: left;
    color: rgba(224, 224, 224, 0.85);
    border-left: 2px solid #4A1A1A;
    padding: 12px 0 12px 18px;
}

.aftermath-text {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: 0.02em;
    color: rgba(224, 224, 224, 0.85);
    margin-bottom: 12px;
}

.aftermath-meta {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(224, 224, 224, 0.45);
}

/* ============================================================
   Persistent Status Bar
   ============================================================ */

.status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 28px;
    background: #4A1A1A;
    color: #E0E0E0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    border-top: 1px solid #8B0000;
}

.status-bar-tag {
    background: #8B0000;
    color: #E0E0E0;
    padding: 3px 8px;
    letter-spacing: 0.32em;
    font-weight: 700;
}

.status-bar-divider {
    color: rgba(224, 224, 224, 0.4);
}

/* Reduced-motion guard for ticker, blink, and stamp */
@media (max-width: 720px) {
    .declaration-line { font-size: 36px; }
    .declaration-line-emphasis { font-size: 64px; }
    .restrictions-line { font-size: 22px; }
    .restrictions-line-emphasis { font-size: 48px; }
    .official-stamp { right: 4vw; top: 6vh; }
    .stamp-circle { width: 130px; height: 130px; }
    .stamp-text-top { font-size: 18px; }
    .stamp-text-mid { font-size: 18px; }
    .digit { width: 56px; height: 96px; }
    .seg-a, .seg-d, .seg-g { width: 40px; height: 6px; left: 8px; }
    .seg-b, .seg-c, .seg-e, .seg-f { width: 6px; height: 40px; }
    .seg-b { top: 4px; }
    .seg-c { bottom: 4px; }
    .seg-e { bottom: 4px; }
    .seg-f { top: 4px; }
    .colon { height: 96px; gap: 24px; }
    .colon .dot { width: 10px; height: 10px; }
    .aftermath-frame { max-width: 70%; }
    .monitor-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }
    .ticker-item, .ticker-sep { font-size: 16px; }
}
