/* ==========================================
   계엄령.quest - Archival Dark Academia
   Institutional Archive Design System
   ========================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Lora', Georgia, serif;
    background-color: #F5F0E8;
    color: #2A2A2A;
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* Background Texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        rgba(212, 208, 200, 0.03) 2px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 0;
}

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

/* ==========================================
   Watermark Background Elements
   ========================================== */
.watermark {
    position: fixed;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.watermark-1 {
    width: 500px;
    height: 700px;
    top: 10vh;
    right: -50px;
}

.watermark-2 {
    width: 450px;
    height: 625px;
    top: 60vh;
    left: -80px;
}

.watermark svg {
    width: 100%;
    height: 100%;
}

/* ==========================================
   Opening Section
   ========================================== */
.opening-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    z-index: 1;
}

.opening-content {
    max-width: 700px;
}

.opening-meta {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #5C5C5C;
    margin-bottom: 2.5rem;
}

.opening-title {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 600;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    line-height: 1.1;
    color: #1A1A1A;
    margin-bottom: 1.5rem;
}

.opening-subtitle {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.7;
    color: #5C5C5C;
    letter-spacing: 0.02em;
    margin-bottom: 2rem;
}

.opening-date {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8B8B8B;
    margin-top: 1rem;
}

/* Sepia Shadow Accent */
.opening-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background-color: #6B5B4A;
    opacity: 0.3;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.scroll-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B8B8B;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(180deg, #8B8B8B 0%, transparent 100%);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.2); }
}

/* ==========================================
   Timeline Container
   ========================================== */
.timeline-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 8rem;
    z-index: 1;
}

/* Central Spine */
.timeline-spine {
    position: absolute;
    left: 50%;
    top: 0;
    width: 1px;
    height: 0;
    background-color: #2A2A2A;
    transform: translateX(-50%);
    z-index: 1;
    transition: none;
}

.timeline-spine::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 5px;
    height: 100%;
    transform: translateX(-50%);
    background: linear-gradient(
        180deg,
        rgba(61, 90, 61, 0.0) 0%,
        rgba(61, 90, 61, 0.08) 50%,
        rgba(61, 90, 61, 0.0) 100%
    );
    pointer-events: none;
}

/* ==========================================
   Timeline Nodes
   ========================================== */
.timeline-node {
    position: relative;
    width: 45%;
    margin-bottom: 6rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.node-left {
    margin-left: 0;
    margin-right: auto;
}

.node-right {
    margin-left: auto;
    margin-right: 0;
}

/* Node Markers */
.node-marker {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #3D5A3D;
    border-radius: 50%;
    z-index: 5;
    transform: scale(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease, width 0.3s ease, height 0.3s ease;
    cursor: pointer;
}

.node-marker.active {
    transform: scale(1);
}

.node-marker::after {
    content: attr(data-label);
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #3D5A3D;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.node-marker:hover {
    width: 16px;
    height: 16px;
    box-shadow: 0 0 12px rgba(61, 90, 61, 0.3);
}

.node-marker:hover::after {
    opacity: 1;
}

.node-left .node-marker {
    right: -7%;
    top: 2rem;
    margin-right: -6px;
}

.node-right .node-marker {
    left: -7%;
    top: 2rem;
    margin-left: -6px;
}

/* Connector Lines */
.node-connector {
    position: absolute;
    top: 2.3rem;
    height: 2px;
    z-index: 3;
}

.node-left .node-connector {
    right: -7%;
    width: 7%;
}

.node-right .node-connector {
    left: -7%;
    width: 7%;
}

.connector-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.connector-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.5s ease;
}

.timeline-node.visible .connector-line {
    stroke-dashoffset: 0;
}

/* Document Nodes */
.document-node {
    background-color: #F5F0E8;
    border: 1px solid #A89080;
    padding: 2.5rem 3rem;
    position: relative;
    box-shadow: 0 4px 12px rgba(42, 42, 42, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.document-node::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at 50% 30%,
        rgba(42, 42, 42, 0.04) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.document-node:hover {
    border-color: #3D5A3D;
    box-shadow: 0 6px 18px rgba(42, 42, 42, 0.12);
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #D4D0C8;
}

.doc-ref {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3D5A3D;
}

.doc-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5C5C5C;
}

.node-title {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #1A1A1A;
    margin-bottom: 1.2rem;
}

.node-body {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.8;
    letter-spacing: 0.01em;
    color: #2A2A2A;
    margin-bottom: 1rem;
}

.node-body:last-child {
    margin-bottom: 0;
}

.node-body em {
    font-style: italic;
    color: #1A1A1A;
}

.node-body strong {
    font-weight: 500;
    color: #1A1A1A;
}

/* Node List */
.node-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.node-list li {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
    line-height: 1.7;
    color: #2A2A2A;
    padding: 0.6rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid rgba(212, 208, 200, 0.5);
}

.node-list li:last-child {
    border-bottom: none;
}

.node-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 6px;
    height: 1px;
    background-color: #3D5A3D;
}

.node-list li strong {
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
    color: #3D5A3D;
}

/* ==========================================
   Archive Node (Image/Visual)
   ========================================== */
.archive-node .archive-visual {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    margin: 2rem 0;
    padding: 2rem;
    background-color: #EBE5DA;
    border: 1px dashed #A89080;
}

.archive-stamp {
    flex-shrink: 0;
}

.archive-stamp svg {
    width: 100px;
    height: 100px;
}

.archive-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.archive-line {
    height: 1px;
    background-color: #A89080;
    width: 100%;
    opacity: 0.5;
}

.archive-line.short {
    width: 65%;
}

/* ==========================================
   Annotations
   ========================================== */
.annotation {
    position: relative;
    width: 25%;
    opacity: 0;
    transition: opacity 0.6s ease 0.2s;
    margin-bottom: -4rem;
    z-index: 2;
}

.annotation.visible {
    opacity: 0.6;
}

.annotation-right {
    margin-left: 60%;
    margin-top: -3rem;
}

.annotation-left {
    margin-left: 15%;
    margin-top: -3rem;
}

.annotation-mark {
    display: block;
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.4rem;
    color: #A89080;
    margin-bottom: 0.3rem;
}

.annotation-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1.6;
    color: #5C5C5C;
}

.annotation-text em {
    font-style: italic;
}

/* ==========================================
   Breath Sections
   ========================================== */
.breath-section {
    position: relative;
    width: 100%;
    padding: 6rem 2rem;
    margin: 4rem 0;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.breath-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.breath-section .node-marker {
    left: 50%;
    top: 0;
    margin-left: -6px;
}

.breath-quote {
    max-width: 650px;
    margin: 0 auto;
    padding: 0;
    border: none;
}

.breath-quote p {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: #1A1A1A;
    font-style: italic;
}

.breath-cite {
    display: block;
    margin-top: 1.5rem;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8B8B8B;
    font-style: normal;
}

/* ==========================================
   Closing Section
   ========================================== */
.closing-section {
    position: relative;
    text-align: center;
    padding: 8rem 2rem 6rem;
    margin-top: 4rem;
}

.closing-section .node-marker {
    left: 50%;
    top: 0;
    margin-left: -6px;
}

.closing-content {
    max-width: 500px;
    margin: 0 auto;
}

.closing-meta {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8B8B8B;
    margin-bottom: 1.5rem;
}

.closing-title {
    font-family: 'Crimson Text', Georgia, serif;
    font-weight: 600;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    color: #1A1A1A;
    margin-bottom: 1rem;
}

.closing-text {
    font-family: 'Lora', Georgia, serif;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
    line-height: 1.7;
    color: #5C5C5C;
    margin-bottom: 2.5rem;
}

.closing-seal {
    display: inline-block;
    opacity: 0.6;
}

.closing-seal svg {
    width: 80px;
    height: 80px;
}

/* ==========================================
   Margin Decorations
   ========================================== */
.margin-decoration {
    position: fixed;
    top: 0;
    height: 100vh;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.margin-left {
    left: 1.5rem;
    width: 30px;
}

.margin-decoration svg {
    width: 100%;
    height: 100%;
}

/* ==========================================
   Responsive Design
   ========================================== */
@media (max-width: 768px) {
    .timeline-container {
        padding: 4rem 1.5rem 6rem;
    }

    .timeline-spine {
        left: 20vw;
    }

    .timeline-node {
        width: 70%;
        margin-left: auto;
        margin-right: 0;
        margin-bottom: 4rem;
    }

    .node-left,
    .node-right {
        margin-left: auto;
        margin-right: 0;
    }

    .node-left .node-marker,
    .node-right .node-marker {
        left: -12%;
        right: auto;
        margin-left: -6px;
        margin-right: 0;
    }

    .node-left .node-connector,
    .node-right .node-connector {
        left: -12%;
        right: auto;
        width: 12%;
    }

    .document-node {
        padding: 1.5rem 2rem;
    }

    .annotation {
        width: 60%;
        margin-left: auto !important;
        margin-right: 0;
        margin-top: -2rem;
    }

    .watermark {
        display: none;
    }

    .margin-decoration {
        display: none;
    }

    .archive-node .archive-visual {
        flex-direction: column;
        gap: 1.5rem;
    }

    .breath-section {
        padding: 4rem 1rem;
    }
}

@media (max-width: 480px) {
    .timeline-node {
        width: 72%;
    }

    .document-node {
        padding: 1.2rem 1.5rem;
    }

    .document-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .opening-title {
        font-size: clamp(2.5rem, 12vw, 4rem);
    }
}
