:root {
    --void: #0a0a12;
    --slate: #14142a;
    --cyan: #00f5d4;
    --magenta: #ff2d7b;
    --violet: #b14dff;
    --ghost: #f0f0ff;
    --lavender: #d4d4e8;
    --twilight: #6b6b8a;
    --circuit: #2a2a4a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--ghost);
    font-family: 'Source Serif 4', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    overflow-x: hidden;
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #00f5d4 0%, #b14dff 50%, #ff2d7b 100%);
    z-index: 1000;
    transition: width 0.1s linear;
}

/* Hero Section */
#hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 60vw;
    background: radial-gradient(ellipse at center, rgba(0, 245, 212, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.jamo-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0.15;
}

.jamo {
    position: absolute;
    font-family: 'Noto Serif KR', serif;
    font-size: 8vw;
    color: var(--cyan);
    opacity: 0.4;
    transition: transform 1s ease, opacity 1s ease;
}

.jamo-1 {
    transform: translate(-120px, -80px);
}

.jamo-2 {
    transform: translate(80px, -40px);
}

.jamo-3 {
    transform: translate(-20px, 60px);
}

.hero-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 20vw;
    font-weight: 700;
    color: var(--ghost);
    text-shadow:
        0 0 4px rgba(0, 245, 212, 0.8),
        0 0 12px rgba(0, 245, 212, 0.5),
        0 0 30px rgba(0, 245, 212, 0.3),
        0 0 60px rgba(0, 245, 212, 0.15);
    animation: breathe 3s ease-in-out infinite;
    line-height: 1;
}

.hero-subtitle {
    font-family: 'Noto Serif KR', serif;
    font-size: 8vw;
    font-weight: 700;
    color: var(--ghost);
    opacity: 0;
    animation: fadeIn 1s ease forwards;
    animation-delay: 1.5s;
    text-shadow:
        0 0 4px rgba(0, 245, 212, 0.6),
        0 0 12px rgba(0, 245, 212, 0.3),
        0 0 30px rgba(0, 245, 212, 0.15);
}

.hero-line {
    position: absolute;
    bottom: 15%;
    left: 0;
    height: 1px;
    width: 0;
    background: var(--magenta);
    animation: drawLine 2s ease forwards;
    animation-delay: 3s;
}

.scroll-hint {
    position: absolute;
    bottom: 5%;
    color: var(--twilight);
    font-size: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

/* Editorial Section */
#editorial {
    padding: 10vh 1.5rem;
}

.editorial-column {
    max-width: 720px;
    margin: 0 auto;
}

.editorial-column p {
    margin-bottom: 2rem;
    color: var(--lavender);
    font-size: 1.1rem;
    line-height: 1.85;
}

.pull-quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    line-height: 1.2;
    color: var(--ghost);
    margin: 4rem -5vw;
    padding: 2rem 0;
    text-align: center;
    letter-spacing: -0.02em;
}

.annotation {
    float: right;
    width: 200px;
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-left: 2px solid var(--cyan);
    background: var(--slate);
}

.annotation-marker {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--cyan);
    font-size: 1.2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.annotation-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--cyan);
    line-height: 1.5;
}

/* Card Tribunal */
#card-tribunal {
    padding: 10vh 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    color: var(--ghost);
    margin-bottom: 4rem;
    letter-spacing: -0.02em;
    text-align: center;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    width: 100%;
}

.card {
    perspective: 1000px;
    min-height: 280px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 280px;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

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

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 4px;
}

.card-front {
    background: var(--slate);
    border-top: 2px solid var(--violet);
}

.card-front p {
    font-family: 'Source Serif 4', serif;
    font-size: 1.2rem;
    color: var(--ghost);
    text-align: center;
    font-weight: 600;
}

.card-back {
    background: linear-gradient(135deg, #14142a, rgba(255, 45, 123, 0.15));
    transform: rotateY(180deg);
    border-top: 2px solid var(--magenta);
}

.card-back p {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    color: var(--magenta);
    line-height: 1.6;
    text-align: center;
}

.card:hover {
    box-shadow: 0 0 40px rgba(255, 45, 123, 0.2), 0 0 80px rgba(177, 77, 255, 0.1);
}

/* Frequency Wall */
#frequency-wall {
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.drift-word {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.8rem, 2vw, 1.4rem);
    animation: drift linear infinite;
    opacity: 0.7;
}

.drift-word[style*="--magenta"] {
    text-shadow: 0 0 8px currentColor, 0 0 20px currentColor;
}

/* Closing Section */
#closing {
    padding: 15vh 1.5rem;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

#closing .editorial-column {
    text-align: center;
}

.closing-text {
    font-size: 1.15rem;
    line-height: 1.9;
    letter-spacing: 0.02em;
    color: var(--lavender);
    margin-bottom: 2.5rem;
}

.scale-icon {
    font-size: 3rem;
    color: var(--cyan);
    margin-top: 3rem;
    animation: rock 6s ease-in-out infinite;
    text-shadow:
        0 0 8px rgba(0, 245, 212, 0.6),
        0 0 20px rgba(0, 245, 212, 0.3);
}

/* Animations */
@keyframes breathe {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.85; filter: brightness(1.15); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

@keyframes drift {
    0% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-15px) translateX(10px); }
    50% { transform: translateY(-5px) translateX(-8px); }
    75% { transform: translateY(-20px) translateX(5px); }
    100% { transform: translateY(0) translateX(0); }
}

@keyframes rock {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* Fade-up animation base state */
.fade-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .annotation {
        float: none;
        width: 100%;
        margin-left: 0;
        margin-top: 1.5rem;
    }

    .pull-quote {
        margin: 3rem 0;
    }

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

    .jamo-1 {
        transform: translate(-60px, -50px);
    }
    .jamo-2 {
        transform: translate(40px, -20px);
    }
    .jamo-3 {
        transform: translate(-10px, 40px);
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .editorial-column {
        max-width: 640px;
    }

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