/* ============================================
   20241204.com — Styles
   Light-Academia Documentary Aesthetic
   ============================================ */

/* CSS Custom Properties */
:root {
    --bg-primary: #f5f0e8;
    --bg-secondary: #ede4d3;
    --text-primary: #1a1a1a;
    --text-secondary: #5c5647;
    --accent-red: #c23b22;
    --accent-navy: #1b2a4a;
    --accent-gold: #b8963e;
    --grid-color: #d4c5a9;
    --card-back-bg: #2d3748;
    --card-back-text: #f7f3ec;
    --font-heading: 'Commissioner', sans-serif;
    --font-body: 'Source Serif 4', 'Georgia', serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

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

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.72;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Paper Grain Texture Overlay
   ============================================ */
#paper-grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* ============================================
   Background Grid Lines (12-column)
   ============================================ */
#grid-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
    padding: 0 40px;
}

.grid-col {
    flex: 1;
    border-left: 1px solid rgba(212, 197, 169, 0.08);
    height: 100%;
    transform: scaleY(0);
    transform-origin: top;
    animation: gridDraw 2s ease-out forwards;
}

.grid-col:last-child {
    border-right: 1px solid rgba(212, 197, 169, 0.08);
}

.grid-col:nth-child(1) { animation-delay: 0s; }
.grid-col:nth-child(2) { animation-delay: 0.08s; }
.grid-col:nth-child(3) { animation-delay: 0.16s; }
.grid-col:nth-child(4) { animation-delay: 0.24s; }
.grid-col:nth-child(5) { animation-delay: 0.32s; }
.grid-col:nth-child(6) { animation-delay: 0.40s; }
.grid-col:nth-child(7) { animation-delay: 0.48s; }
.grid-col:nth-child(8) { animation-delay: 0.56s; }
.grid-col:nth-child(9) { animation-delay: 0.64s; }
.grid-col:nth-child(10) { animation-delay: 0.72s; }
.grid-col:nth-child(11) { animation-delay: 0.80s; }
.grid-col:nth-child(12) { animation-delay: 0.88s; }

@keyframes gridDraw {
    0% {
        transform: scaleY(0);
    }
    100% {
        transform: scaleY(1);
    }
}

/* ============================================
   Chapter Indicator (fixed right edge)
   ============================================ */
#chapter-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
}

.chapter-num {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0.4;
    transition: opacity 0.3s ease, color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
    text-align: center;
    width: 28px;
    line-height: 28px;
}

.chapter-num.active {
    opacity: 1;
    color: var(--accent-gold);
    transform: scale(1.2);
}

/* ============================================
   General Section / Chapter Styles
   ============================================ */
.chapter {
    position: relative;
    z-index: 1;
    padding: 100px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.chapter-watermark {
    position: absolute;
    top: 60px;
    left: -20px;
    font-family: var(--font-heading);
    font-weight: 200;
    font-size: 280px;
    line-height: 1;
    color: var(--text-primary);
    opacity: 0.04;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

.chapter-header {
    margin-bottom: 60px;
    position: relative;
    z-index: 1;
}

.chapter-label {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 12px;
}

.chapter-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 48px;
    line-height: 1.1;
    color: var(--text-primary);
}

/* ============================================
   Fade Reveal Animation
   ============================================ */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   CHAPTER I: HERO
   ============================================ */
.hero-chapter {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 40px;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-date {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 120px;
    letter-spacing: -2px;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 40px;
}

.hero-subtitle {
    max-width: 600px;
    margin: 0 auto;
}

.hero-korean {
    font-family: var(--font-heading);
    font-weight: 400;
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.hero-english {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 18px;
    color: var(--text-secondary);
}

.hero-scroll-hint {
    margin-top: 80px;
}

.scroll-line {
    display: inline-block;
    width: 1px;
    height: 60px;
    background: var(--accent-gold);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* ============================================
   Section Dividers
   ============================================ */
.section-divider {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    position: relative;
    z-index: 1;
}

.divider-line {
    width: 100%;
    background-color: var(--grid-color);
}

.divider-line.thin {
    height: 1px;
}

.divider-line.thick {
    height: 2px;
}

/* ============================================
   CHAPTER II: TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 60px;
    margin-top: 20px;
}

.timeline-spine {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--grid-color);
}

.timeline-event {
    position: relative;
    margin-bottom: 40px;
}

.timeline-node {
    position: absolute;
    left: -48px;
    top: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent-gold);
    transition: box-shadow 0.3s ease;
    z-index: 2;
}

.timeline-event:hover .timeline-node {
    box-shadow: 0 0 0 2px var(--accent-gold), 0 0 12px rgba(184, 150, 62, 0.4);
}

/* ============================================
   Card Flip Elements
   ============================================ */
.card-flip {
    perspective: 1000px;
    cursor: pointer;
    width: 100%;
    max-width: 700px;
}

.card-inner {
    position: relative;
    width: 100%;
    min-height: 120px;
    transform-style: preserve-3d;
    transition: transform 0.4s ease-in-out;
}

.card-flip.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    padding: 24px 28px;
    border-radius: 2px;
}

.card-front {
    background: var(--bg-primary);
    border-left: 3px solid var(--accent-gold);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    z-index: 2;
}

.card-back {
    background: var(--card-back-bg);
    color: var(--card-back-text);
    transform: rotateY(180deg);
    border-left: 3px solid var(--accent-red);
}

.card-timestamp {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-red);
    display: block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.card-back .card-timestamp {
    color: var(--accent-gold);
}

.card-headline {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.3;
    color: var(--text-primary);
}

.card-flip-hint {
    position: absolute;
    top: 12px;
    right: 12px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.card-flip:hover .card-flip-hint {
    opacity: 1;
}

.card-detail {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--card-back-text);
    margin-bottom: 12px;
}

.card-source {
    font-family: var(--font-heading);
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    color: rgba(247, 243, 236, 0.6);
}

/* ============================================
   CHAPTER III: SPLIT COLUMN
   ============================================ */
.split-column {
    display: flex;
    gap: 60px;
    position: relative;
    z-index: 1;
}

.column-primary {
    flex: 6;
}

.column-primary p {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.column-sidebar {
    flex: 4;
    position: relative;
}

.sidebar-block {
    margin-bottom: 40px;
    padding: 24px;
    background: var(--bg-secondary);
    border-left: 2px solid var(--accent-gold);
    border-radius: 2px;
}

.sidebar-label {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 16px;
}

.vote-numbers {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vote-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.vote-label {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 14px;
    color: var(--text-secondary);
}

.vote-count {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.vote-row:first-child .vote-count {
    color: var(--accent-red);
}

.annotation-text {
    font-family: var(--font-heading);
    font-weight: 300;
    font-style: italic;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.annotation-translation {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* ============================================
   CHAPTER IV: COLLAGE INTERLUDE
   ============================================ */
.collage-interlude {
    position: relative;
    width: 100%;
    min-height: 400px;
    margin-bottom: 60px;
    overflow: hidden;
}

.collage-fragment {
    position: absolute;
}

.fragment-1 {
    top: 20px;
    left: 5%;
    transform: rotate(-3deg);
    z-index: 3;
}

.collage-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 72px;
    color: var(--accent-navy);
    opacity: 0.15;
}

.collage-translation {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 14px;
    color: var(--accent-navy);
    opacity: 0.3;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.fragment-2 {
    top: 40px;
    right: 15%;
    z-index: 1;
}

.collage-shape {
    width: 180px;
    height: 120px;
}

.shape-navy {
    background: var(--accent-navy);
    opacity: 0.08;
    transform: rotate(2deg);
}

.fragment-3 {
    bottom: 60px;
    left: 30%;
    z-index: 2;
}

.shape-gold {
    width: 140px;
    height: 90px;
    background: var(--accent-gold);
    opacity: 0.1;
    transform: rotate(-1deg);
}

.fragment-4 {
    top: 120px;
    left: 15%;
    z-index: 4;
    transform: rotate(1deg);
    max-width: 350px;
    padding: 30px;
    background: rgba(237, 228, 211, 0.5);
    border: 1px solid rgba(212, 197, 169, 0.3);
}

.collage-text-small {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    opacity: 0.6;
}

.fragment-5 {
    bottom: 20px;
    right: 10%;
    z-index: 3;
}

.assembly-dome {
    width: 200px;
    height: 120px;
    opacity: 0.2;
}

/* ============================================
   Narrative Blocks
   ============================================ */
.narrative-block {
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.narrative-block p {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.timestamp-inline {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent-red);
    white-space: nowrap;
}

/* ============================================
   CHAPTER V: AFTERMATH
   ============================================ */
.chapter-aftermath {
    padding-bottom: 60px;
}

.aftermath-content {
    position: relative;
    z-index: 1;
}

.pull-quote {
    max-width: 780px;
    margin: 60px auto;
    padding: 40px 0;
    border-top: 1px solid var(--grid-color);
    border-bottom: 1px solid var(--grid-color);
    text-align: center;
}

.pull-quote blockquote {
    font-family: var(--font-heading);
    font-weight: 300;
    font-style: italic;
    font-size: 24px;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.pull-quote cite {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 14px;
    color: var(--text-secondary);
    font-style: normal;
    letter-spacing: 0.5px;
}

.aftermath-narrative {
    max-width: 680px;
    margin: 0 auto 40px;
}

.aftermath-narrative p {
    font-size: 18px;
    line-height: 1.85;
    color: var(--text-primary);
}

/* ============================================
   Footer
   ============================================ */
#site-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 40px 60px;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-date {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 32px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.footer-note {
    font-family: var(--font-heading);
    font-weight: 300;
    font-style: italic;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.footer-divider {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-width: 200px;
    margin: 0 auto 30px;
}

.footer-legal {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* ============================================
   Link Styles
   ============================================ */
a {
    color: var(--accent-navy);
    text-decoration: none;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-red);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 900px) {
    .hero-date {
        font-size: 72px;
    }

    .chapter-title {
        font-size: 36px;
    }

    .chapter-watermark {
        font-size: 180px;
    }

    .split-column {
        flex-direction: column;
        gap: 40px;
    }

    .column-primary,
    .column-sidebar {
        flex: 1;
    }

    .timeline {
        padding-left: 40px;
    }

    .timeline-spine {
        left: 10px;
    }

    .timeline-node {
        left: -36px;
    }

    .collage-interlude {
        min-height: 300px;
    }

    .collage-text {
        font-size: 48px;
    }

    .fragment-4 {
        left: 5%;
        max-width: 280px;
    }

    .fragment-5 {
        right: 2%;
    }

    #chapter-indicator {
        right: 12px;
    }

    .chapter {
        padding: 60px 24px;
    }

    .section-divider {
        padding: 0 24px;
    }
}

@media (max-width: 600px) {
    .hero-date {
        font-size: 48px;
        letter-spacing: -1px;
    }

    .hero-korean {
        font-size: 16px;
    }

    .hero-english {
        font-size: 15px;
    }

    .chapter-title {
        font-size: 28px;
    }

    .chapter-watermark {
        font-size: 120px;
    }

    .card-headline {
        font-size: 17px;
    }

    .card-front,
    .card-back {
        padding: 18px 20px;
    }

    .pull-quote blockquote {
        font-size: 19px;
    }

    .collage-interlude {
        min-height: 250px;
    }

    .collage-shape {
        width: 120px;
        height: 80px;
    }

    .assembly-dome {
        width: 140px;
        height: 84px;
    }

    .vote-count {
        font-size: 22px;
    }

    .chapter {
        padding: 50px 16px;
    }

    .section-divider {
        padding: 0 16px;
    }

    #grid-lines {
        padding: 0 16px;
    }

    #chapter-indicator {
        display: none;
    }
}
