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

html {
    scroll-behavior: smooth;
}

body {
    background: #0a0a0f;
    color: #e8e8f0;
    font-family: 'Libre Baskerville', serif;
    overflow-x: hidden;
}

#undercurrent {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

.parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    will-change: transform;
}

#parallax-bg {
    z-index: -1;
}

#parallax-mid {
    z-index: 1;
}

#content {
    position: relative;
    z-index: 2;
}

/* Sections */
.section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(180deg, #0a0a0f 0%, #0d0d1a 100%);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.section:not(:first-child) {
    margin-top: -15vh;
}

.section-content {
    padding: 4rem 8vw;
    width: 100%;
}

.section-content--centered {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section-content--left {
    text-align: left;
    max-width: 900px;
}

.section-content--right {
    text-align: left;
    margin-left: auto;
    max-width: 600px;
    padding-right: 12vw;
}

/* Typography */
.section-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 8rem);
    color: #00f0ff;
    letter-spacing: -0.02em;
    line-height: 0.95;
    text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
    margin-bottom: 1.5rem;
}

.section-body {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #e8e8f0;
    line-height: 1.7;
    max-width: 38ch;
}

.section-content--centered .section-body {
    margin: 0 auto;
}

.meta-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #6a6a80;
    display: block;
    margin-bottom: 1.5rem;
}

.meta-label--footer {
    margin-top: 4rem;
    margin-bottom: 0;
}

/* Cards */
.cards-container {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
    perspective: 1000px;
    flex-wrap: wrap;
}

.card-wrapper {
    width: 280px;
    height: 360px;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-wrapper[data-card="1"] .card {
    transition-delay: 200ms;
}

.card-wrapper[data-card="2"] .card {
    transition-delay: 400ms;
}

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

.card-front,
.card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border-radius: 4px;
}

.card-front {
    background: #0d0d1a;
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 80px 40px rgba(0, 240, 255, 0.08);
}

.card-word {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: #00f0ff;
}

.card-back {
    background: #1a0030;
    border: 1px solid rgba(255, 0, 200, 0.3);
    transform: rotateY(180deg);
    text-align: center;
}

.card-meta {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ff00c8;
    margin-bottom: 1.5rem;
}

.card-text {
    font-family: 'Libre Baskerville', serif;
    font-size: 0.95rem;
    color: #e8e8f0;
    line-height: 1.6;
    font-style: italic;
}

/* Gradient Viewport - Section 3 */
.gradient-viewport {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50vmin;
    height: 50vmin;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 40%, #7b00ff 0%, #ff00c8 45%, #00f0ff 100%);
    opacity: 0.6;
    animation: rotateGradient 30s linear infinite;
}

@keyframes rotateGradient {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Flares */
.flare {
    position: absolute;
}

.flare-1 { left: 20vw; top: 30vh; }
.flare-2 { left: 75vw; top: 55vh; }
.flare-3 { left: 40vw; top: 140vh; }
.flare-4 { left: 60vw; top: 250vh; }

.flare-bloom {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 0, 255, 0.4) 0%, rgba(0, 240, 255, 0.1) 30%, transparent 60%);
    animation: flarePulse 8s ease-in-out infinite;
}

.flare-streak {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vw;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.3), transparent);
    animation: flareRotate 12s ease-in-out infinite;
}

@keyframes flarePulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@keyframes flareRotate {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    50% { transform: translate(-50%, -50%) rotate(3deg); }
}

/* Bubbles */
.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 240, 255, 0.15), rgba(255, 0, 200, 0.08), transparent 70%);
    border: 1px solid rgba(0, 240, 255, 0.12);
    will-change: transform;
    animation: bubbleDrift var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes bubbleDrift {
    0%, 100% {
        transform: translateY(0) translateX(0) scale(1);
    }
    25% {
        transform: translateY(-30px) translateX(15px) scale(1.02);
    }
    50% {
        transform: translateY(-50px) translateX(-10px) scale(1.05);
    }
    75% {
        transform: translateY(-20px) translateX(20px) scale(1.02);
    }
}

/* Section 2 magenta title */
.section-2 .section-title {
    color: #ff00c8;
    text-shadow: 0 0 40px rgba(255, 0, 200, 0.3);
}

/* Section 4 magenta title */
.section-4 .section-title {
    color: #ff00c8;
    text-shadow: 0 0 40px rgba(255, 0, 200, 0.3);
}
