/* ========================================
   economics.quest — Seapunk Economics
   Continuous vertical descent experience
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    --sky-pink: #FF6B9D;
    --surface-cyan: #00E5CC;
    --shallow-teal: #0A8B7C;
    --deep-navy: #0B1A2E;
    --trench-black: #060D17;
    --coral-warm: #FF8FA3;
    --bioluminescent: #00FFC8;
    --foam-white: #F0F5F3;

    --font-display: 'Libre Baskerville', Georgia, serif;
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --scroll-depth: 0;
    --zone-padding: clamp(2rem, 5vw, 6rem);
}

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

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

body {
    font-family: var(--font-body);
    color: var(--foam-white);
    background: var(--trench-black);
    overflow-x: hidden;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Ripple System --- */
#ripple-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.ripple-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--surface-cyan);
    animation: ripple-expand 1.2s ease-out forwards;
    pointer-events: none;
}

.ripple-ring--pink {
    border-color: var(--sky-pink);
}

@keyframes ripple-expand {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }
    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* --- Bokeh Particle Field --- */
#bokeh-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bokeh-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
    animation: bokeh-float var(--float-duration, 10s) ease-in-out infinite alternate;
    animation-delay: var(--float-delay, 0s);
}

@keyframes bokeh-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(var(--float-distance, -20px)); }
}

/* --- Caustic Light Overlay --- */
#caustic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    mix-blend-mode: overlay;
    opacity: 0;
    transition: opacity 0.5s ease;
    background: repeating-conic-gradient(
        rgba(0, 229, 204, 0.03) 0deg,
        transparent 2deg,
        transparent 4deg
    );
    filter: url(#caustic-filter);
}

#caustic-overlay.active {
    opacity: 0.07;
}

/* --- Bubble Particles --- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1s ease;
}

#bubble-container.active {
    opacity: 1;
}

.bubble {
    position: absolute;
    bottom: -20px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 255, 200, 0.25), rgba(0, 255, 200, 0.08));
    animation: bubble-rise var(--rise-duration, 12s) linear infinite;
    animation-delay: var(--rise-delay, 0s);
    will-change: transform;
}

@keyframes bubble-rise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        transform: translateY(-110vh) translateX(var(--drift, 30px));
        opacity: 0;
    }
}

/* --- Current Lines --- */
#current-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 1s ease;
}

#current-lines.active {
    opacity: 1;
}

#current-svg {
    width: 100%;
    height: 100%;
}

.current-path {
    fill: none;
    stroke: var(--surface-cyan);
    stroke-width: 0.5;
    opacity: 0.15;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: current-flow 20s linear infinite;
}

@keyframes current-flow {
    0% { stroke-dashoffset: 800; }
    100% { stroke-dashoffset: -800; }
}

/* --- Depth Zones: Common --- */
.depth-zone {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.zone-content {
    width: 100%;
    max-width: 100%;
    padding: 0 var(--zone-padding);
    position: relative;
    z-index: 10;
}

/* --- ZONE 0: Surface --- */
.zone-surface {
    background: linear-gradient(180deg, #FF6B9D 0%, #FF8FA3 30%, #00E5CC 70%, #0A8B7C 100%);
    min-height: 100vh;
}

.zone-surface .zone-content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
    align-items: center;
    min-height: 100vh;
}

.site-title {
    grid-column: 2 / 8;
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(3rem, 7vw, 9rem);
    letter-spacing: 0.02em;
    line-height: 1.15;
    color: var(--foam-white);
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.15);
}

.title-dot {
    color: var(--bioluminescent);
}

.title-quest {
    font-style: italic;
    display: inline;
}

.subtitle {
    grid-column: 2 / 9;
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    color: rgba(240, 245, 243, 0.85);
    margin-top: -1rem;
    line-height: 1.6;
    max-width: 600px;
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.ripple-hint {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(240, 245, 243, 0.4);
    animation: hint-ripple 2.5s ease-out infinite;
}

.ripple-hint--delayed {
    animation-delay: 0.5s;
}

.ripple-hint--delayed-more {
    animation-delay: 1s;
}

@keyframes hint-ripple {
    0% {
        width: 10px;
        height: 10px;
        opacity: 0.6;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* --- ZONE 1: Shallows --- */
.zone-shallows {
    background: linear-gradient(180deg, #0A8B7C 0%, #0A8B7C 40%, #0B1A2E 100%);
    min-height: 120vh;
    padding: 10vh 0;
}

.shallows-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    align-items: start;
}

.editorial-block--1 {
    grid-column: 1 / 8;
    grid-row: 1;
    padding-top: 5vh;
}

.pull-quote--1 {
    grid-column: 8 / 13;
    grid-row: 1;
    padding-top: 15vh;
}

.editorial-block--2 {
    grid-column: 1 / 8;
    grid-row: 2;
    padding-top: 5vh;
}

.pull-quote--2 {
    grid-column: 8 / 13;
    grid-row: 2;
    padding-top: 12vh;
}

.editorial-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    font-weight: 400;
    line-height: 1.8;
    color: var(--foam-white);
    max-width: 65ch;
}

.pull-quote {
    position: relative;
    padding-left: 1.5rem;
}

.pull-quote-mark {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw, 6rem);
    color: var(--sky-pink);
    line-height: 0.8;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.pull-quote p {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    line-height: 1.5;
    color: var(--coral-warm);
}

/* --- ZONE 2: Thermocline --- */
.zone-thermocline {
    background: linear-gradient(180deg, #0B1A2E 0%, #0B1A2E 60%, #060D17 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.thermocline-content {
    text-align: center;
    padding: 10vh var(--zone-padding);
}

.thesis-statement {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.thesis-word {
    font-family: var(--font-display);
    font-size: clamp(3rem, 12vw, 15vw);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.02em;
    color: var(--sky-pink);
    transition: color 0.4s ease;
    display: block;
}

/* --- ZONE 3: Deep Water --- */
.zone-deep {
    background: var(--deep-navy);
    min-height: 120vh;
    padding: 10vh 0;
}

.deep-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(180px, auto);
    gap: 2rem;
}

.data-card {
    grid-column: var(--card-col) / var(--card-col-end);
    position: relative;
    background: rgba(0, 255, 200, 0.06);
    border: 1px solid rgba(0, 255, 200, 0.15);
    border-radius: 4px;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    transition: border-color 0.4s ease, transform 0.3s ease;
    overflow: visible;
}

.data-card:hover {
    border-color: rgba(0, 255, 200, 0.5);
    transform: translateY(-4px);
}

.data-card:hover .card-glow {
    transform: scale(1.2);
    opacity: 1;
}

.card-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(circle at center, rgba(0, 255, 200, 0.12) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
    transition: transform 0.5s ease, opacity 0.5s ease;
    opacity: 0.6;
    margin-top: -10%;
    margin-left: -10%;
    transform-origin: center center;
}

.card-label {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--bioluminescent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.card-text {
    font-family: var(--font-body);
    font-size: clamp(0.875rem, 1.2vw, 1rem);
    line-height: 1.7;
    color: rgba(240, 245, 243, 0.8);
}

/* --- ZONE 4: Trench --- */
.zone-trench {
    background: linear-gradient(180deg, var(--deep-navy) 0%, var(--trench-black) 30%, var(--trench-black) 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15vh 0;
}

.trench-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.trench-statement {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(2rem, 5vw, 5rem);
    font-weight: 400;
    line-height: 1.2;
    color: var(--sky-pink);
    opacity: 0;
    transition: opacity 1.5s ease;
    margin-bottom: 8vh;
    letter-spacing: 0.02em;
}

.trench-statement.visible {
    opacity: 0.7;
}

.ocean-floor-text {
    width: 100%;
    max-width: 700px;
}

.manifesto {
    font-family: var(--font-mono);
    font-size: clamp(11px, 1.2vw, 14px);
    font-weight: 400;
    line-height: 1.8;
    color: rgba(240, 245, 243, 0.4);
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* --- Tidal Wave Border Between Zones --- */
.zone-surface::after,
.zone-shallows::after,
.zone-thermocline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 40vh;
    pointer-events: none;
    z-index: 4;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .site-title {
        grid-column: 1 / -1;
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .subtitle {
        grid-column: 1 / -1;
    }

    .editorial-block--1,
    .editorial-block--2 {
        grid-column: 1 / -1;
    }

    .pull-quote--1,
    .pull-quote--2 {
        grid-column: 1 / -1;
        padding-top: 2vh;
    }

    .data-card {
        grid-column: 1 / -1 !important;
    }

    .thesis-word {
        font-size: clamp(2.5rem, 14vw, 10rem);
    }
}

@media (max-width: 480px) {
    :root {
        --zone-padding: 1.5rem;
    }

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