/* === CSS Custom Properties === */
:root {
    --void-black: #0b0c10;
    --aurora-green: #00e5a0;
    --aurora-violet: #8b5cf6;
    --aurora-teal: #06b6d4;
    --frost-white: #e8ecf1;
    --aurora-pink: #ec4899;
    --drift-gray: #2a2d35;

    --aurora-primary: linear-gradient(135deg, #00e5a0 0%, #06b6d4 40%, #8b5cf6 80%, #ec4899 100%);
    --aurora-ambient: radial-gradient(ellipse at 50% var(--aurora-y, 0%), rgba(0,229,160,0.08) 0%, rgba(139,92,246,0.04) 50%, transparent 100%);
    --aurora-border: linear-gradient(90deg, #00e5a0, #8b5cf6, #06b6d4);
    --aurora-y: 0%;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void-black);
    color: var(--frost-white);
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.5;
    overflow-x: hidden;
}

/* === Breathing Dot === */
.breathing-dot {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--aurora-green);
    z-index: 100;
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* === VOID GATE === */
.void-gate {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--void-black);
}

.void-content {
    text-align: center;
}

.simulate-word {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    letter-spacing: -0.02em;
    background: var(--aurora-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: fadeInSimulate 3s 0.8s ease forwards;
}

@keyframes fadeInSimulate {
    from { opacity: 0; }
    to { opacity: 1; }
}

.terminal-line {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 11px;
    color: var(--aurora-green);
    opacity: 0.7;
    margin-top: 24px;
    overflow: hidden;
    white-space: nowrap;
}

.terminal-text {
    display: inline-block;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    animation: typeWriter 1.8s steps(31) 2.8s forwards;
}

@keyframes typeWriter {
    from { width: 0; }
    to { width: 31ch; }
}

.terminal-cursor {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    animation: blink 1s step-end infinite;
    color: var(--aurora-green);
}

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

/* === DRIFT ZONE === */
.drift-zone {
    position: relative;
    background: var(--void-black);
    background-image: var(--aurora-ambient);
}

.simulation-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(0, 229, 160, 0.03) 0px,
            transparent 1px,
            transparent 80px
        ),
        repeating-linear-gradient(
            0deg,
            rgba(0, 229, 160, 0.02) 0px,
            transparent 1px,
            transparent 120px
        );
    perspective: 800px;
    pointer-events: none;
}

.drift-panel {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.panel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.panel-content {
    position: relative;
    z-index: 1;
    max-width: 540px;
    width: 100%;
    padding: 40px 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform, opacity;
}

.panel-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-text {
    color: var(--frost-white);
    line-height: 1.5;
}

.breathing-space {
    height: 20vh;
}

/* Crossed out word */
.crossed-out {
    position: relative;
    text-decoration: line-through;
    text-decoration-color: var(--aurora-pink);
    opacity: 0.6;
}

.correction {
    position: absolute;
    top: -1.4em;
    left: 0;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--aurora-green);
    text-decoration: none;
    opacity: 1;
    white-space: nowrap;
}

/* Annotations */
.annotation {
    display: block;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--aurora-violet);
    margin-top: 32px;
    letter-spacing: -0.02em;
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.annotation-right {
    text-align: right;
    padding-right: 0;
}

.annotation-left {
    text-align: left;
    padding-left: 0;
}

.panel-content.visible .annotation {
    opacity: 1;
}

/* === EXPOSED GRID === */
.exposed-grid {
    position: relative;
    height: 100vh;
    background: var(--void-black);
    overflow: hidden;
}

.grid-lines {
    position: absolute;
    inset: 0;
}

.grid-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--aurora-green), var(--aurora-violet), var(--aurora-teal));
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.grid-lines.revealed .grid-line {
    transform: scaleY(1);
}

.grid-line:nth-child(1) { transition-delay: 0ms; }
.grid-line:nth-child(2) { transition-delay: 60ms; }
.grid-line:nth-child(3) { transition-delay: 120ms; }
.grid-line:nth-child(4) { transition-delay: 180ms; }
.grid-line:nth-child(5) { transition-delay: 240ms; }
.grid-line:nth-child(6) { transition-delay: 300ms; }
.grid-line:nth-child(7) { transition-delay: 360ms; }
.grid-line:nth-child(8) { transition-delay: 420ms; }
.grid-line:nth-child(9) { transition-delay: 480ms; }
.grid-line:nth-child(10) { transition-delay: 540ms; }
.grid-line:nth-child(11) { transition-delay: 600ms; }
.grid-line:nth-child(12) { transition-delay: 660ms; }

.grid-annotations {
    position: absolute;
    inset: 0;
}

.grid-note {
    position: absolute;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--aurora-violet);
    letter-spacing: -0.02em;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    white-space: nowrap;
}

.grid-note.error-note {
    color: var(--aurora-pink);
}

.grid-annotations.revealed .grid-note {
    opacity: 1;
}

/* === STILLNESS POOL === */
.stillness-pool {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stillness-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(0, 229, 160, 0.15) 0%, 
        rgba(6, 182, 212, 0.12) 30%, 
        rgba(139, 92, 246, 0.15) 60%, 
        rgba(236, 72, 153, 0.08) 100%
    );
    animation: auroraShift 12s ease-in-out infinite alternate;
}

@keyframes auroraShift {
    0% { 
        background-position: 0% 50%;
        filter: hue-rotate(0deg);
    }
    100% { 
        background-position: 100% 50%;
        filter: hue-rotate(15deg);
    }
}

.stillness-content {
    position: relative;
    z-index: 1;
    max-width: 540px;
    text-align: center;
    padding: 40px 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1), transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.stillness-content.visible {
    opacity: 1;
    transform: translateY(0);
}

.stillness-text {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    line-height: 2.2;
    color: rgba(232, 236, 241, 0.85);
    font-size: clamp(1rem, 1.8vw, 1.25rem);
}

.stillness-annotation {
    display: block;
    margin-top: 48px;
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--aurora-green);
    letter-spacing: -0.02em;
    opacity: 0.7;
}

/* === Glitch effect === */
.glitch-active {
    animation: glitchFlash 60ms linear;
}

@keyframes glitchFlash {
    0% { transform: translate(2px, -1px); mix-blend-mode: difference; }
    100% { transform: translate(0, 0); mix-blend-mode: normal; }
}
