/* ============================================
   continu.ax — Neon Electric Aquarium
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    color: rgba(192, 232, 255, 0.85);
    background: linear-gradient(
        to bottom,
        #0A0A1E 0%,
        #08081A 20%,
        #060618 40%,
        #040414 60%,
        #030312 80%,
        #020210 100%
    );
    background-attachment: scroll;
    min-height: 500vh;
    overflow-x: hidden;
    line-height: 1.75;
    letter-spacing: 0.01em;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    -webkit-font-smoothing: antialiased;
}

/* --- Scan-line Overlay --- */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.8s ease;
    background: repeating-linear-gradient(
        to bottom,
        #000000 0px,
        rgba(0, 0, 0, 0.04) 0px,
        rgba(0, 0, 0, 0.04) 1px,
        transparent 1px,
        transparent 4px
    );
}

.scanlines.visible {
    opacity: 1;
}

/* --- Depth Gauge --- */
.depth-gauge {
    position: fixed;
    left: 24px;
    top: 0;
    height: 100vh;
    width: 20px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.depth-gauge.visible {
    opacity: 1;
}

.depth-gauge-line {
    position: absolute;
    top: 5%;
    bottom: 5%;
    width: 2px;
    background: rgba(0, 240, 255, 0.4);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1s ease;
}

.depth-gauge-line.revealed {
    clip-path: inset(0 0 0% 0);
}

.depth-gauge-dot {
    position: absolute;
    top: 5%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00F0FF;
    box-shadow: 0 0 8px #00F0FF, 0 0 16px rgba(0, 240, 255, 0.4);
    animation: dotPulse 1s ease-in-out infinite;
    transition: top 0.15s linear;
}

.depth-gauge-label {
    position: absolute;
    bottom: 2%;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #6BA8C4;
}

@keyframes dotPulse {
    0%, 100% {
        box-shadow: 0 0 8px #00F0FF, 0 0 16px rgba(0, 240, 255, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 12px #00F0FF, 0 0 24px rgba(0, 240, 255, 0.6);
        transform: scale(1.2);
    }
}

/* --- Bubbles --- */
.bubbles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -100px;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 204, 0.15);
    /* #00FFCC Aqua Tint at low opacity */
    background: radial-gradient(
        circle at 60% 60%,
        transparent 40%,
        #00FFCC 0%,
        rgba(0, 255, 204, 0.03) 100%
    );
    animation: bubbleRise var(--rise-duration) linear infinite,
               bubbleWobble var(--wobble-duration) ease-in-out infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.bubble.active {
    opacity: 1;
}

.bubble::before {
    content: '';
    position: absolute;
    top: 15%;
    right: 20%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}

.bubble.flash-magenta {
    border-color: rgba(255, 0, 170, 0.3);
    background: radial-gradient(
        circle at 60% 60%,
        transparent 40%,
        rgba(255, 0, 170, 0.06) 100%
    );
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(-100vh - 150px));
    }
}

@keyframes bubbleWobble {
    0%, 100% {
        margin-left: 0;
    }
    50% {
        margin-left: 8px;
    }
}

/* --- Geometric Shapes Layer --- */
.shapes-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    animation: shapeDrift var(--drift-duration) ease-in-out infinite alternate,
               shapeSpin var(--spin-duration) linear infinite;
    opacity: var(--shape-opacity, 0.25);
    transition: filter 0.1s ease;
}

.floating-shape.glitch-hue {
    filter: hue-rotate(90deg);
}

@keyframes shapeSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shapeDrift {
    0% {
        translate: 0 0;
    }
    100% {
        translate: var(--drift-x, 30px) var(--drift-y, -40px);
    }
}

/* --- Secondary Text Color --- */
.text-secondary {
    color: #6BA8C4;
}

/* --- Plasma Violet Accents --- */
.plasma-accent {
    color: #8B00FF;
}

/* --- Zone Common Styles --- */
.zone {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zone-sentinel {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
}

.zone-content {
    position: relative;
    z-index: 20;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
    transition: opacity 0.8s ease;
}

.zone.passed .zone-content {
    opacity: 0.3;
}

/* --- Amber Dot Accent --- */
.amber-dot {
    color: #FFB800;
    text-shadow: 0 0 6px rgba(255, 184, 0, 0.6);
    animation: amberGlow 1s ease-in-out infinite;
}

@keyframes amberGlow {
    0%, 100% {
        text-shadow: 0 0 6px rgba(255, 184, 0, 0.4);
    }
    50% {
        text-shadow: 0 0 12px rgba(255, 184, 0, 0.8);
    }
}

.zone-1-amber {
    position: absolute;
    bottom: 10%;
    right: 15%;
    font-size: 2rem;
    z-index: 30;
}

.zone-3-amber {
    position: absolute;
    bottom: 12%;
    left: 20%;
    font-size: 1.5rem;
    z-index: 30;
}

/* --- Zone 1: Surface --- */
.zone-1 {
    min-height: 100vh;
}

.zone-1-content {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: clamp(4rem, 12vw, 10rem);
    letter-spacing: -0.03em;
    color: #C0E8FF;
    opacity: 0;
    transition: opacity 0.8s ease;
    position: relative;
    display: inline-block;
}

.brand-name.visible {
    opacity: 1;
}

.brand-name .brand-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(180deg, #C0E8FF 0%, rgba(192, 232, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-name:hover .brand-text {
    text-shadow: none;
    -webkit-text-fill-color: transparent;
    filter: none;
}

.brand-name:hover {
    text-shadow: 2px 0 #FF00AA, -2px 0 #00F0FF;
}

.brand-name.glitch-channel {
    text-shadow: 2px 0 #FF00AA, -2px 0 #00F0FF;
}

/* Water surface clip effect on brand name */
.brand-name::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -5%;
    right: -5%;
    height: 30px;
    background: linear-gradient(
        180deg,
        rgba(10, 10, 30, 0.9) 0%,
        transparent 100%
    );
    animation: waterRipple 3s ease-in-out infinite;
    clip-path: polygon(
        0% 50%, 5% 40%, 10% 55%, 15% 35%, 20% 50%, 25% 38%, 30% 52%,
        35% 42%, 40% 55%, 45% 38%, 50% 48%, 55% 35%, 60% 50%, 65% 40%,
        70% 55%, 75% 38%, 80% 48%, 85% 42%, 90% 52%, 95% 40%, 100% 50%,
        100% 0%, 0% 0%
    );
}

@keyframes waterRipple {
    0%, 100% {
        clip-path: polygon(
            0% 50%, 5% 40%, 10% 55%, 15% 35%, 20% 50%, 25% 38%, 30% 52%,
            35% 42%, 40% 55%, 45% 38%, 50% 48%, 55% 35%, 60% 50%, 65% 40%,
            70% 55%, 75% 38%, 80% 48%, 85% 42%, 90% 52%, 95% 40%, 100% 50%,
            100% 0%, 0% 0%
        );
    }
    50% {
        clip-path: polygon(
            0% 45%, 5% 55%, 10% 40%, 15% 50%, 20% 38%, 25% 52%, 30% 42%,
            35% 55%, 40% 38%, 45% 48%, 50% 55%, 55% 42%, 60% 38%, 65% 50%,
            70% 42%, 75% 55%, 80% 38%, 85% 50%, 90% 42%, 95% 55%, 100% 45%,
            100% 0%, 0% 0%
        );
    }
}

/* --- Zone 2: Shallows --- */
.zone-2-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.statement-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.75;
    letter-spacing: 0.01em;
    color: rgba(192, 232, 255, 0.85);
}

.statement-text .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    margin-right: 0.3em;
}

.statement-text .word.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Zone 3: Mid-water --- */
.zone-3-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.triptych {
    display: flex;
    gap: 3rem;
    align-items: center;
    justify-content: center;
}

.triptych-viewport {
    width: clamp(140px, 20vw, 220px);
    height: clamp(140px, 20vw, 220px);
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 170, 0.3);
    box-shadow: 0 0 20px rgba(255, 0, 170, 0.1), 0 0 40px #8B00FF;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.triptych-viewport.visible {
    opacity: 1;
    transform: scale(1);
}

.triptych-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.triptych-svg {
    width: 80%;
    height: 80%;
}

.geo-triangle {
    animation: shapeSpin 25s linear infinite;
    transform-origin: center;
}

.geo-circle {
    animation: shapeSpin 40s linear infinite reverse;
    transform-origin: center;
}

.geo-hexagon {
    animation: shapeSpin 35s linear infinite;
    transform-origin: center;
}

.geo-triangle-sm {
    animation: shapeSpin 20s linear infinite reverse;
    transform-origin: center;
}

.geo-circle-lg {
    animation: shapeSpin 45s linear infinite;
    transform-origin: center;
}

.geo-triangle-lg {
    animation: shapeSpin 30s linear infinite reverse;
    transform-origin: center;
}

/* --- Zone 4: Deep --- */
.zone-4-content {
    max-width: 700px;
    margin: 0 auto;
}

.deep-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    align-items: center;
}

.deep-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    line-height: 1.75;
    color: rgba(192, 232, 255, 0.85);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.deep-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.deep-shape {
    width: 80px;
    height: 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.deep-shape.visible {
    opacity: 1;
    transform: translateY(0);
}

.deep-shape svg {
    width: 100%;
    height: 100%;
    animation: shapeSpin 30s linear infinite;
}

/* --- Zone 5: Abyss --- */
.zone-5 {
    min-height: 100vh;
}

.zone-5-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4rem;
}

.closing-phrase {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.02em;
    color: #C0E8FF;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

.closing-phrase.visible {
    opacity: 1;
    transform: translateY(0);
}

.closing-phrase:hover {
    text-shadow: 2px 0 #FF00AA, -2px 0 #00F0FF, 0 0 30px rgba(0, 240, 255, 0.15);
}

/* Abyss single-bubble loop */
.abyss-bubble-loop {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 204, 0.15);
    background: radial-gradient(
        circle at 60% 60%,
        transparent 40%,
        rgba(0, 255, 204, 0.03) 100%
    );
    position: relative;
    animation: abyssBubbleRise 4s ease-in infinite;
}

.abyss-bubble-loop::before {
    content: '';
    position: absolute;
    top: 15%;
    right: 20%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
}

@keyframes abyssBubbleRise {
    0% {
        opacity: 0;
        transform: translateY(100px) scale(0.5);
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
        transform: translateY(-50px) scale(1);
    }
    90% {
        opacity: 0;
        transform: translateY(-60px) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0);
    }
}

/* --- Micro-stutter animation --- */
@keyframes microStutter {
    0%, 98% {
        transform: translateX(0);
    }
    99% {
        transform: translateX(1px);
    }
    100% {
        transform: translateX(0);
    }
}

main.stutter {
    transform: translateX(1px);
}

/* --- CRT warm-up --- */
body.crt-warmup {
    background-color: #020210;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .depth-gauge {
        left: auto;
        right: 8px;
    }

    .triptych {
        flex-direction: column;
        gap: 2rem;
    }

    .zone {
        min-height: 80vh;
    }

    .triptych-viewport {
        width: 160px;
        height: 160px;
    }

    .zone-1-amber {
        right: 10%;
    }

    .zone-3-amber {
        left: 10%;
    }

    .deep-content {
        gap: 2rem;
    }

    .brand-name {
        font-size: clamp(3rem, 15vw, 6rem);
    }
}

@media (max-width: 480px) {
    .depth-gauge {
        right: 4px;
    }

    .depth-gauge-label {
        display: none;
    }

    .triptych-viewport {
        width: 130px;
        height: 130px;
    }
}
