:root {
    --abyssal-black: #0A0A0F;
    --temple-gold: #C9A84C;
    --luminous-sand: #D4C5A0;
    --ceremonial-amber: #8B6914;
    --subaquatic-gray: #2A2A35;
    --refracted-white: #F0E8D0;
    --hadal-navy: #0D0D1A;
    --hud-green-gold: #7A8C3C;
    --ghost-amber: #6B5A2E;
    color-scheme: dark;
}

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

body {
    background: linear-gradient(180deg, #0A0A0F 0%, #1A1508 30%, #0D0D1A 70%, #0A0A0F 100%);
    background-attachment: fixed;
    color: rgba(212, 197, 160, 0.85);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
}

/* ====== SCANLINE ====== */
.scanline-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 3px,
        rgba(240, 232, 208, 0.03) 3px,
        rgba(240, 232, 208, 0.03) 4px
    );
}

/* ====== CAUSTICS ====== */
.caustics {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 300px 200px at 20% 40%, rgba(201, 168, 76, 0.04), transparent),
        radial-gradient(ellipse 250px 350px at 70% 20%, rgba(201, 168, 76, 0.03), transparent),
        radial-gradient(ellipse 400px 250px at 45% 75%, rgba(201, 168, 76, 0.035), transparent);
    animation: causticShift 20s ease-in-out infinite alternate;
}

@keyframes causticShift {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%; }
    100% { background-position: 5% 3%, -3% 5%, 4% -2%; }
}

/* ====== DEPTH INDICATOR ====== */
.depth-indicator {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.depth-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    color: rgba(201, 168, 76, 0.5);
    text-transform: uppercase;
}

.depth-track {
    width: 1px;
    height: 200px;
    background: rgba(201, 168, 76, 0.4);
    position: relative;
}

.depth-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--temple-gold);
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.5);
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    transition: top 0.1s linear;
}

.depth-readout {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(201, 168, 76, 0.6);
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
    white-space: nowrap;
    animation: hudFlicker 5s ease-in-out infinite;
}

@keyframes hudFlicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.6; }
    97% { opacity: 1; }
    98% { opacity: 0.75; }
}

/* ====== ZONES ====== */
.zone {
    position: relative;
    overflow: hidden;
}

/* ====== SURFACE ====== */
.zone-surface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.surface-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Recursive', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--temple-gold);
    text-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
    display: flex;
    gap: 0.15em;
    justify-content: center;
}

.title-seg {
    display: inline-block;
    opacity: 0;
    transform: translateY(-15px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.title-seg.visible {
    opacity: 1;
    transform: translateY(0);
}

.title-seg[data-seg="1"] { transition-delay: 0s; }
.title-seg[data-seg="2"] { transition-delay: 0.4s; }
.title-seg[data-seg="3"] { transition-delay: 0.8s; }

.hero-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    color: rgba(201, 168, 76, 0.6);
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
    margin-top: 24px;
    min-height: 1.5em;
}

.hero-subtitle .cursor {
    display: inline-block;
    width: 8px;
    height: 1em;
    background: rgba(201, 168, 76, 0.6);
    vertical-align: text-bottom;
    animation: cursorBlink 1.06s step-end infinite;
}

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

/* Bubble clusters */
.bubble-cluster {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.bubble-lg {
    width: 120px;
    height: 120px;
    right: 20%;
    bottom: 20%;
    background: radial-gradient(ellipse at 30% 30%, rgba(240, 232, 208, 0.15), rgba(201, 168, 76, 0.05) 50%, transparent 100%);
    border: 1px solid rgba(201, 168, 76, 0.15);
    animation: bubbleRise 15s ease-in-out infinite;
}

.bubble-md {
    width: 60px;
    height: 60px;
    left: 15%;
    bottom: 30%;
    background: radial-gradient(circle, rgba(240, 232, 208, 0.12), transparent 70%);
    border: 1px solid rgba(201, 168, 76, 0.1);
    animation: bubbleRise 20s ease-in-out infinite -5s;
}

@keyframes bubbleRise {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-30px); opacity: 0.9; }
}

.scroll-chevron {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    animation: chevronPulse 2s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ====== THERMOCLINE ====== */
.zone-thermocline {
    min-height: 200vh;
    padding: 10vh 0;
}

.thermo-grid {
    display: grid;
    grid-template-columns: 58% 8% 34%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.thermo-left {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.content-block {
    padding: 24px 0;
}

.body-text {
    max-width: 52ch;
}

.drop-cap {
    font-family: 'Recursive', sans-serif;
    font-weight: 700;
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.5rem;
    color: var(--temple-gold);
    text-shadow: 0 0 12px rgba(201, 168, 76, 0.3);
}

.thermo-gap {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.bubble-line {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.gap-bubble {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 232, 208, 0.5), transparent);
    animation: gapRise 6s ease-in-out infinite;
}

.gap-bubble:nth-child(2) { animation-delay: -1s; width: 7px; height: 7px; }
.gap-bubble:nth-child(3) { animation-delay: -2s; }
.gap-bubble:nth-child(4) { animation-delay: -3s; width: 4px; height: 4px; }
.gap-bubble:nth-child(5) { animation-delay: -4s; width: 6px; height: 6px; }
.gap-bubble:nth-child(6) { animation-delay: -5s; }

@keyframes gapRise {
    0% { transform: translateY(20px); opacity: 0; }
    20% { opacity: 0.6; }
    80% { opacity: 0.6; }
    100% { transform: translateY(-20px); opacity: 0; }
}

.thermo-right {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-top: 40px;
}

.telemetry-panel {
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-left: 2px solid var(--temple-gold);
    padding: 0.75rem 1rem;
    background: rgba(42, 42, 53, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.hud-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: rgba(201, 168, 76, 0.55);
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.2);
    text-transform: uppercase;
    line-height: 1.8;
    animation: hudFlicker 5s ease-in-out infinite;
}

/* ====== ABYSSAL ====== */
.zone-abyssal {
    min-height: 200vh;
    padding: 10vh 0;
    position: relative;
}

.hud-reticle {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease;
}

.hud-reticle.visible {
    opacity: 1;
}

.reticle-outer {
    width: 400px;
    height: 400px;
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: reticleRotate 45s linear infinite;
}

.reticle-inner {
    width: 300px;
    height: 300px;
    border: 1px solid rgba(201, 168, 76, 0.1);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: reticleRotate 60s linear infinite reverse;
}

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

.abyssal-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 10;
}

.abyssal-block {
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.abyssal-text {
    font-family: 'Recursive', sans-serif;
    font-weight: 500;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    letter-spacing: 0.08em;
    color: var(--luminous-sand);
    text-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
    line-height: 1.5;
}

/* Bubble field */
.bubble-field {
    height: 30vh;
    position: relative;
    overflow: hidden;
}

.macro-bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at 30% 30%, rgba(240, 232, 208, 0.1), rgba(201, 168, 76, 0.04) 50%, transparent 100%);
    border: 1px solid rgba(201, 168, 76, 0.1);
    animation: macroBubbleRise 12s ease-in-out infinite;
}

.mb-1 { width: 80px; height: 80px; left: 10%; bottom: -80px; animation-duration: 14s; }
.mb-2 { width: 140px; height: 140px; left: 35%; bottom: -140px; animation-duration: 18s; animation-delay: -3s; }
.mb-3 { width: 60px; height: 60px; right: 20%; bottom: -60px; animation-duration: 12s; animation-delay: -6s; }
.mb-4 { width: 100px; height: 100px; right: 40%; bottom: -100px; animation-duration: 16s; animation-delay: -9s; }
.mb-5 { width: 50px; height: 50px; left: 60%; bottom: -50px; animation-duration: 10s; animation-delay: -2s; }

@keyframes macroBubbleRise {
    0% { transform: translateY(0); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(calc(-30vh - 200px)); opacity: 0; }
}

/* ====== HADAL ====== */
.zone-hadal {
    min-height: 150vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--abyssal-black);
    position: relative;
}

.hadal-bubble {
    width: min(70vw, 500px);
    height: min(70vw, 500px);
    border-radius: 48% 52% 45% 55% / 50% 46% 54% 48%;
    background:
        radial-gradient(ellipse at 35% 30%, rgba(240, 232, 208, 0.15), transparent 50%),
        radial-gradient(ellipse at 60% 65%, rgba(201, 168, 76, 0.08), transparent 60%),
        radial-gradient(ellipse at 50% 50%, rgba(139, 105, 20, 0.05), transparent 70%);
    border: 1px solid rgba(201, 168, 76, 0.15);
    backdrop-filter: blur(6px) brightness(1.1);
    -webkit-backdrop-filter: blur(6px) brightness(1.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15%;
    animation: wobble 12s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes wobble {
    0%, 100% { border-radius: 48% 52% 45% 55% / 50% 46% 54% 48%; }
    50% { border-radius: 52% 48% 55% 45% / 46% 54% 48% 52%; }
}

.hadal-text {
    font-family: 'Recursive', sans-serif;
    font-weight: 600;
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    color: var(--refracted-white);
    line-height: 1.7;
    text-align: center;
    transform: perspective(500px) rotateX(3deg) rotateY(-1deg);
}

.hadal-final {
    margin-top: 60vh;
    text-align: center;
    position: relative;
    z-index: 2;
}

.final-readout {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: rgba(201, 168, 76, 0.5);
    text-shadow: 0 0 8px rgba(201, 168, 76, 0.3);
    text-transform: uppercase;
    animation: finalPulse 4s ease-in-out infinite;
}

@keyframes finalPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ====== REVEAL ====== */
[data-reveal] {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-reveal].revealed {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
    .thermo-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .thermo-gap {
        display: none;
    }

    .thermo-right {
        padding-top: 0;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .depth-indicator {
        display: none;
    }

    .hud-reticle {
        display: none;
    }

    .hadal-bubble {
        width: 85vw;
        height: 85vw;
    }

    .abyssal-text {
        font-size: clamp(1.2rem, 5vw, 2rem);
    }
}

/* ====== REDUCED MOTION ====== */
@media (prefers-reduced-motion: reduce) {
    .bubble-cluster,
    .gap-bubble,
    .macro-bubble {
        animation: none;
    }

    .scroll-chevron {
        animation: none;
        opacity: 0.5;
    }

    .reticle-outer,
    .reticle-inner {
        animation: none;
    }

    .hadal-bubble {
        animation: none;
    }

    .caustics {
        animation: none;
    }

    .hud-text,
    .depth-readout {
        animation: none;
    }

    .final-readout {
        animation: none;
        opacity: 0.5;
    }

    .hero-subtitle .cursor {
        animation: none;
        opacity: 1;
    }

    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .title-seg {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
