/* 계엄령.quest - Martial Law History Quest */
/* Colors: #1a1a2e (deep base), #4a90d9 (primary blue), #f5f0e8 (warm off-white), #e8b84b (accent gold), #6c757d (muted gray) */
/* Fonts: Inter (sans-serif), Playfair Display (serif-revival) */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1a1a2e;
    color: #f5f0e8;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Particle Canvas */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Section Headers */
.section-header {
    margin-bottom: 3rem;
    position: relative;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    color: #e8b84b;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

.marble-divider {
    width: 120px;
    height: 3px;
    background: linear-gradient(90deg, #e8b84b, #4a90d9, #6c757d);
    margin-top: 1rem;
    position: relative;
}

.marble-divider::after {
    content: '';
    position: absolute;
    top: -2px;
    left: 0;
    width: 100%;
    height: 7px;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 4px,
        rgba(245, 240, 232, 0.15) 4px,
        rgba(245, 240, 232, 0.15) 5px
    );
}

/* ==================== HERO ==================== */
#hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    align-items: center;
    padding: 2rem;
    gap: 2rem;
}

.hero-content {
    grid-column: 1;
    padding-left: clamp(2rem, 8vw, 8rem);
}

.hero-title-block {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 900;
    color: #f5f0e8;
    line-height: 1;
    letter-spacing: -0.03em;
    text-shadow: 0 0 60px rgba(74, 144, 217, 0.3);
}

.hero-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 300;
    color: #4a90d9;
    letter-spacing: 0.1em;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.4rem);
    font-weight: 300;
    color: #6c757d;
    margin-top: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-disruption-line {
    width: 200px;
    height: 2px;
    background: #e8b84b;
    margin-top: 2rem;
    transform: rotate(-3deg);
    transform-origin: left center;
}

.hero-offset-block {
    grid-column: 2;
    align-self: end;
    padding-bottom: 15vh;
    padding-right: clamp(2rem, 6vw, 6rem);
    transform: translateY(-30px) rotate(1deg);
}

.hero-offset-text {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 400;
    font-style: italic;
    color: #e8b84b;
    line-height: 1.4;
    border-left: 3px solid #4a90d9;
    padding-left: 1.5rem;
}

/* ==================== TIMELINE ==================== */
#timeline {
    position: relative;
    z-index: 1;
    padding: clamp(3rem, 8vw, 8rem) clamp(2rem, 6vw, 6rem);
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
}

/* Broken grid: offset every other card */
.timeline-grid .timeline-card:nth-child(2) {
    transform: translateY(40px);
}

.timeline-grid .timeline-card:nth-child(3) {
    transform: translateY(-20px);
}

.timeline-grid .timeline-card:nth-child(4) {
    transform: translateY(25px);
}

.timeline-grid .timeline-card:nth-child(5) {
    transform: translateY(-35px);
}

.timeline-grid .timeline-card:nth-child(6) {
    transform: translateY(15px);
}

.timeline-card {
    position: relative;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(245, 240, 232, 0.1);
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.6s ease;
    cursor: default;
}

.timeline-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.timeline-card--blue::before {
    background: #4a90d9;
}

.timeline-card--gold::before {
    background: #e8b84b;
}

.timeline-card--gray::before {
    background: #6c757d;
}

.timeline-card--blue {
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.08), rgba(26, 26, 46, 0.95));
}

.timeline-card--gold {
    background: linear-gradient(135deg, rgba(232, 184, 75, 0.08), rgba(26, 26, 46, 0.95));
}

.timeline-card--gray {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.08), rgba(26, 26, 46, 0.95));
}

.card-marble-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(245, 240, 232, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(245, 240, 232, 0.02) 0%, transparent 40%),
        linear-gradient(135deg, transparent 40%, rgba(245, 240, 232, 0.015) 45%, transparent 50%),
        linear-gradient(225deg, transparent 40%, rgba(245, 240, 232, 0.01) 45%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.card-year {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: rgba(245, 240, 232, 0.07);
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    z-index: 0;
    line-height: 1;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.card-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* Zoom focus hover effect */
.zoom-focus:hover {
    transform: scale(1.04) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 30px rgba(74, 144, 217, 0.1);
    z-index: 10;
}

.zoom-focus:hover .card-year {
    color: rgba(245, 240, 232, 0.15);
    transition: color 0.6s ease;
}

/* ==================== RECORDS (Marble Section) ==================== */
#records {
    position: relative;
    z-index: 1;
    padding: clamp(3rem, 8vw, 8rem) clamp(2rem, 6vw, 6rem);
    background:
        linear-gradient(135deg, rgba(245, 240, 232, 0.04) 0%, transparent 50%),
        linear-gradient(225deg, rgba(245, 240, 232, 0.02) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 0%, rgba(74, 144, 217, 0.05) 0%, transparent 60%);
}

#records::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(245, 240, 232, 0.008) 100px,
            rgba(245, 240, 232, 0.008) 101px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 80px,
            rgba(245, 240, 232, 0.005) 80px,
            rgba(245, 240, 232, 0.005) 81px
        );
    pointer-events: none;
}

.records-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
    position: relative;
}

.record-block {
    padding: 3rem 2.5rem;
    border: 1px solid rgba(245, 240, 232, 0.08);
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 70%, rgba(245, 240, 232, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(232, 184, 75, 0.02) 0%, transparent 50%),
        rgba(26, 26, 46, 0.6);
}

.record-block::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, transparent 45%, rgba(245, 240, 232, 0.02) 50%, transparent 55%),
        linear-gradient(45deg, transparent 45%, rgba(245, 240, 232, 0.015) 50%, transparent 55%);
    pointer-events: none;
}

.record-number {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    color: #e8b84b;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.record-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a90d9;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.record-detail {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.7;
}

/* ==================== INQUIRY ==================== */
#inquiry {
    position: relative;
    z-index: 1;
    padding: clamp(3rem, 8vw, 8rem) clamp(2rem, 6vw, 6rem);
}

.inquiry-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    max-width: 900px;
}

.inquiry-block {
    padding: 2.5rem 3rem;
    border-left: 3px solid #4a90d9;
    position: relative;
    background: linear-gradient(90deg, rgba(74, 144, 217, 0.05), transparent);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.inquiry-block--offset-right {
    margin-left: clamp(2rem, 10vw, 10rem);
    transform: rotate(-0.5deg);
}

.inquiry-block--offset-left {
    margin-left: clamp(0rem, 3vw, 3rem);
    transform: rotate(0.3deg);
    border-left-color: #e8b84b;
    background: linear-gradient(90deg, rgba(232, 184, 75, 0.05), transparent);
}

.inquiry-block:hover {
    transform: rotate(0deg) translateX(10px);
}

.inquiry-question {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 1rem;
}

.inquiry-text {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.8;
}

/* ==================== FOOTER ==================== */
#footer {
    position: relative;
    z-index: 1;
    padding: 4rem clamp(2rem, 6vw, 6rem) 3rem;
    border-top: 1px solid rgba(245, 240, 232, 0.08);
}

.footer-content {
    max-width: 600px;
}

.footer-brand {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 900;
    color: #f5f0e8;
    margin-bottom: 0.5rem;
}

.footer-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: #6c757d;
    line-height: 1.6;
}

.footer-line {
    width: 60px;
    height: 2px;
    background: #e8b84b;
    margin-top: 2rem;
}

/* ==================== ANIMATIONS ==================== */
.broken-grid-section,
.marble-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.broken-grid-section.visible,
.marble-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered card reveal */
.timeline-card {
    opacity: 0;
    transform: translateY(40px);
}

.timeline-card.revealed {
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.timeline-card.revealed:nth-child(2) {
    transform: translateY(40px);
    transition-delay: 0.1s;
}

.timeline-card.revealed:nth-child(3) {
    transform: translateY(-20px);
    transition-delay: 0.2s;
}

.timeline-card.revealed:nth-child(4) {
    transform: translateY(25px);
    transition-delay: 0.3s;
}

.timeline-card.revealed:nth-child(5) {
    transform: translateY(-35px);
    transition-delay: 0.4s;
}

.timeline-card.revealed:nth-child(6) {
    transform: translateY(15px);
    transition-delay: 0.5s;
}

.timeline-card.revealed:nth-child(1) {
    transform: translateY(0);
}

/* Record blocks animation */
.record-block {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.record-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.record-block.revealed:nth-child(2) {
    transition-delay: 0.15s;
}

.record-block.revealed:nth-child(3) {
    transition-delay: 0.3s;
}

/* Inquiry blocks animation */
.inquiry-block {
    opacity: 0;
}

.inquiry-block.revealed {
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.inquiry-block.revealed:nth-child(2) {
    transition-delay: 0.15s;
}

.inquiry-block.revealed:nth-child(3) {
    transition-delay: 0.3s;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    #hero {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .hero-content {
        padding-left: 2rem;
    }

    .hero-offset-block {
        grid-column: 1;
        padding-bottom: 3rem;
        padding-right: 2rem;
        transform: none;
    }

    .timeline-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

@media (max-width: 640px) {
    .timeline-grid {
        grid-template-columns: 1fr;
    }

    .timeline-grid .timeline-card:nth-child(n) {
        transform: none;
    }

    .timeline-card.revealed:nth-child(n) {
        transform: none;
    }

    .inquiry-block--offset-right,
    .inquiry-block--offset-left {
        margin-left: 0;
        transform: none;
    }

    .hero-title {
        font-size: clamp(3rem, 15vw, 5rem);
    }
}