/* ============================================================================
   BADA.DAY - Ocean Depth Experience
   Minimalist oceanic descent from sunlit surface to abyssal trench
   Code-only visual language: no images, only CSS gradients, shadows, SVG
   ============================================================================ */

:root {
    /* Ocean Palette - exact from DESIGN.md */
    --sunlit-shallows: #0B4F6C;
    --twilight-depths: #062C43;
    --abyssal-trench: #0A1628;
    --seafoam-white: #D4E8F0;
    --moonlit-surface: #B8D8E8;
    --bioluminescent-cyan: #00E5FF;
    --deep-current: #1A6B7C;
    --foam-white: #E8F4F8;
    --coral-breath: #FF6B6B;
    --surface-blue-bright: #4FC3F7;

    /* Typography */
    --font-heading: 'Exo 2', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-label: 'Space Grotesk', monospace;
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--seafoam-white);
    background: var(--sunlit-shallows);
    overflow-x: hidden;
    line-height: 1.85;
}

/* ============================================================================
   DEPTH GAUGE - Fixed left edge, 2px wide
   Fills as user scrolls, gradient from bright surface to abyssal dark
   ============================================================================ */

#depth-gauge {
    position: fixed;
    left: 0;
    top: 0;
    width: 2px;
    height: 100vh;
    background: rgba(10, 22, 40, 0.3);
    z-index: 1000;
}

#depth-gauge-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, #4FC3F7, #062C43, #0A1628);
    transition: height 0.15s linear;
}

/* ============================================================================
   ZONES - Ocean depth sections
   ============================================================================ */

.zone {
    position: relative;
    width: 100%;
    overflow: hidden;
}

#surface-zone {
    min-height: 100vh;
    background: var(--sunlit-shallows);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 15vh 8vw 0 8vw;
}

#twilight-zone {
    min-height: 150vh;
    background: var(--twilight-depths);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 12vh 0 12vh 0;
    gap: 12vh;
}

#abyssal-zone {
    min-height: 150vh;
    background: var(--abyssal-trench);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15vh 8vw;
    gap: 15vh;
}

/* ============================================================================
   OPENING SEQUENCE - Surface zone
   H1 fades in over 2s with 0.5s delay, body text at 1.5s delay
   ============================================================================ */

#opening-title {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--moonlit-surface);
    opacity: 0;
    animation: fadeInTitle 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s forwards;
}

#opening-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    font-weight: 300;
    line-height: 1.85;
    max-width: 560px;
    color: rgba(212, 232, 240, 0.85);
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeInUp 1.5s ease 1.5s forwards;
}

/* ============================================================================
   ZONE LABELS - Small accent text using Space Grotesk
   ============================================================================ */

.zone-label {
    font-family: var(--font-label);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--deep-current);
    position: absolute;
    top: 3vh;
    left: 8vw;
    opacity: 0;
    animation: fadeInUp 1s ease 2.5s forwards;
}

#twilight-label {
    position: relative;
    top: auto;
    margin-left: 8vw;
    margin-bottom: -8vh;
    animation-delay: 0s;
}

#abyss-label {
    position: absolute;
    top: 5vh;
    left: 50%;
    transform: translateX(-50%);
    color: var(--bioluminescent-cyan);
    opacity: 0.5;
    animation: none;
}

/* ============================================================================
   CONTENT PANELS - Frosted glass, left-aligned in twilight zone
   F-pattern: panels along left edge, <55% width
   ============================================================================ */

.content-panel {
    background: rgba(10, 22, 40, 0.5);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-left: 2px solid var(--deep-current);
    border-radius: 2px;
    padding: 3rem 2.5rem;
    max-width: 55%;
    margin-left: 8vw;
    opacity: 0;
    transform: translateX(-30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.6s ease;
}

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

.content-panel:hover {
    transform: scale(1.03);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.content-panel.visible:hover {
    transform: scale(1.03);
}

.content-panel h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 300;
    letter-spacing: 0.06em;
    color: var(--moonlit-surface);
    margin-bottom: 1.2rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

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

.content-panel p {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    font-weight: 300;
    line-height: 1.85;
    color: rgba(212, 232, 240, 0.85);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease 0.4s, transform 0.6s ease 0.4s;
}

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

/* ============================================================================
   CORAL ACCENTS - Rare warm punctuation, one per zone
   ============================================================================ */

.coral-accent {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--coral-breath);
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.4);
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 0.8s ease 0.6s;
}

.content-panel.visible .coral-accent {
    opacity: 1;
}

.coral-accent-abyss {
    margin: 2rem auto 0;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 12px rgba(255, 107, 107, 0.6);
}

/* ============================================================================
   ABYSSAL CONTENT - Centered, bioluminescent glow
   F-pattern collapses to single centered column
   ============================================================================ */

#abyss-content {
    text-align: center;
    max-width: 500px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
}

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

.abyss-heading {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bioluminescent-cyan);
    margin-bottom: 2rem;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.6);
    animation: biolumeGlow 6s ease-in-out infinite;
}

.abyss-text {
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.3vw, 1.15rem);
    font-weight: 300;
    line-height: 1.85;
    color: var(--seafoam-white);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
    animation: biolumeGlow 6s ease-in-out infinite;
}

.abyss-text:nth-of-type(2) {
    animation-delay: 2s;
}

.abyss-text:nth-of-type(3) {
    animation-delay: 4s;
}

#trench-text {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

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

.abyss-final {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 300;
    letter-spacing: 0.12em;
    color: var(--bioluminescent-cyan);
    text-shadow: 0 0 30px rgba(0, 229, 255, 0.8);
    animation: biolumeGlow 6s ease-in-out infinite;
    animation-delay: 1s;
}

/* ============================================================================
   BUBBLE FIELD - Fixed container, procedurally generated bubbles
   ============================================================================ */

#bubble-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle at 30% 30%, rgba(232,244,248,0.4), rgba(0,229,255,0.05));
    box-shadow: inset 0 -4px 8px rgba(0,0,0,0.15), 0 0 12px rgba(0,229,255,0.1);
    animation: bubbleRise var(--bubble-duration, 25s) linear var(--bubble-delay, 0s) infinite;
    will-change: transform;
}

/* ============================================================================
   PARTICLE FIELD - Bioluminescent dots in twilight/abyss
   ============================================================================ */

#particle-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease;
}

#particle-field.active {
    opacity: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: var(--bioluminescent-cyan);
    box-shadow: 0 0 6px 2px rgba(0, 229, 255, 0.6);
    animation: particleFade var(--particle-cycle, 6s) ease-in-out var(--particle-delay, 0s) infinite;
    will-change: opacity, transform;
}

/* ============================================================================
   WAVE TRANSITIONS - SVG wave dividers between zones
   Three stacked waves at different speeds for parallax depth
   ============================================================================ */

.wave-transition {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 5;
}

.wave-transition svg {
    display: block;
    width: 100%;
    height: 100%;
}

.wave-path {
    will-change: transform;
}

.wave-slow {
    animation: waveShift 20s ease-in-out infinite alternate;
    opacity: 0.6;
}

.wave-mid {
    animation: waveShift 14s ease-in-out infinite alternate-reverse;
    opacity: 0.4;
}

.wave-fast {
    animation: waveShift 8s ease-in-out infinite alternate;
    opacity: 0.15;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes fadeInTitle {
    from {
        opacity: 0;
        transform: scale(0.97);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes biolumeGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
        filter: brightness(0.9);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 229, 255, 0.8), 0 0 60px rgba(0, 229, 255, 0.3);
        filter: brightness(1.1);
    }
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: var(--bubble-opacity, 0.3);
    }
    20% {
        transform: translateY(-24vh) translateX(var(--wobble-amount, 15px));
    }
    40% {
        transform: translateY(-48vh) translateX(calc(var(--wobble-amount, 15px) * -1));
    }
    60% {
        transform: translateY(-72vh) translateX(calc(var(--wobble-amount, 15px) * 0.8));
        opacity: var(--bubble-opacity, 0.3);
    }
    80% {
        transform: translateY(-96vh) translateX(calc(var(--wobble-amount, 15px) * -0.8));
    }
    100% {
        transform: translateY(-115vh) translateX(0);
        opacity: 0;
    }
}

@keyframes particleFade {
    0%, 100% {
        opacity: 0;
        transform: translate(0, 0);
    }
    30% {
        opacity: var(--particle-max-opacity, 0.6);
    }
    70% {
        opacity: var(--particle-max-opacity, 0.6);
    }
    50% {
        transform: translate(var(--particle-drift-x, 10px), var(--particle-drift-y, -15px));
    }
}

@keyframes waveShift {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-30px);
    }
}

/* ============================================================================
   SCALE-HOVER INTERACTIONS
   Subtle 3% scale with spring overshoot easing
   ============================================================================ */

.content-panel,
.coral-accent {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.6s ease;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    #surface-zone {
        padding: 12vh 6vw 0 6vw;
    }

    .content-panel {
        max-width: 90%;
        margin-left: 5vw;
        padding: 2rem 1.5rem;
    }

    #abyss-content {
        padding: 0 5vw;
    }

    .zone-label {
        left: 5vw;
    }

    #twilight-label {
        margin-left: 5vw;
    }
}

@media (max-width: 480px) {
    .content-panel {
        max-width: 95%;
        margin-left: 2.5vw;
    }

    #opening-title {
        letter-spacing: 0.06em;
    }
}
