/* ============================
   footprint.broker - styles.css
   Deep-ocean descent design
   ============================ */

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

:root {
    --hadal-black: #060a14;
    --abyss: #0a0f1c;
    --midnight-pressure: #0f1a2e;
    --sonar-blue: #1a3a5c;
    --deep-ocean-blue: #2a5a8c;
    --bioluminescence: #00e5c8;
    --phosphor: #7dffd4;
    --thermal: #ff6b35;
    --ghost-light: #e0eaf5;
    --sediment: #8a9bb5;
    --fossil-trace: rgba(0, 229, 200, 0.12);
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, #0a0f1c 0%, #0f1a2e 40%, #0a0f1c 70%, #060a14 100%);
    color: var(--sediment);
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    letter-spacing: 0.005em;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Bioluminescent Blooms --- */
.blooms-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bloom {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 200, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.bloom-1 {
    width: 400px;
    height: 400px;
    top: 10%;
    left: 15%;
    animation: bloomPulse 10s ease-in-out infinite alternate;
}

.bloom-2 {
    width: 300px;
    height: 300px;
    top: 35%;
    right: 10%;
    animation: bloomPulse 12s ease-in-out infinite alternate;
    animation-delay: -3s;
}

.bloom-3 {
    width: 350px;
    height: 350px;
    top: 55%;
    left: 5%;
    animation: bloomPulse 9s ease-in-out infinite alternate;
    animation-delay: -6s;
}

.bloom-4 {
    width: 280px;
    height: 280px;
    top: 75%;
    right: 20%;
    animation: bloomPulse 14s ease-in-out infinite alternate;
    animation-delay: -2s;
}

.bloom-5 {
    width: 320px;
    height: 320px;
    top: 90%;
    left: 40%;
    animation: bloomPulse 11s ease-in-out infinite alternate;
    animation-delay: -8s;
}

@keyframes bloomPulse {
    0% {
        opacity: 0.02;
        transform: scale(0.95);
    }
    100% {
        opacity: 0.06;
        transform: scale(1.05);
    }
}

/* --- Depth Markers (fixed right edge) --- */
.depth-markers {
    position: fixed;
    top: 0;
    right: 24px;
    width: 30px;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s ease;
}

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

.depth-scale {
    width: 30px;
    height: 100%;
}

.depth-ticks line {
    stroke: var(--sonar-blue);
    stroke-opacity: 0.2;
    stroke-width: 1;
}

.depth-indicator {
    position: absolute;
    right: 3px;
    top: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bioluminescence);
    transform: translateY(0);
    transition: transform 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 229, 200, 0.5);
}

.depth-indicator-trail {
    position: absolute;
    right: 4px;
    top: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 229, 200, 0.3);
    transform: translateY(-4px);
    transition: transform 0.15s linear;
}

/* --- ZONE 1: Surface --- */
.zone {
    position: relative;
    width: 100%;
}

.zone-1 {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--abyss);
    overflow: hidden;

}

.hero-container {
    position: relative;
    text-align: center;
    z-index: 2;
}

.hero-bloom {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 200, 0.04) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.hero-bloom.active {
    animation: heroBloomIn 1200ms ease-out forwards;
}

@keyframes heroBloomIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

.hero-title {
    position: relative;
}

.hero-domain {
    display: block;
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: clamp(52px, 10vw, 120px);
    color: var(--ghost-light);
    letter-spacing: -0.03em;
    line-height: 1.0;
    text-shadow: 0 0 60px rgba(0, 229, 200, 0.15);
}

.hero-letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 200ms ease;
}

.hero-letter.visible {
    opacity: 1;
}

.hero-tld {
    display: block;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(20px, 4vw, 48px);
    color: var(--sonar-blue);
    letter-spacing: -0.03em;
    line-height: 1.0;
    opacity: 0;
    transition: opacity 300ms ease;
    margin-top: 8px;
}

.hero-tld.visible {
    opacity: 1;
}

/* Thermocline */
.thermocline {
    position: absolute;
    bottom: 15vh;
    left: 0;
    width: 100%;
    height: 10px;
    opacity: 0;
    transition: opacity 1500ms ease;
    z-index: 1;
}

.thermocline.visible {
    opacity: 1;
}

.thermocline-path {
    fill: none;
    stroke: #2a5a8c;
    stroke-opacity: 0.4;
    stroke-width: 0.7;
    animation: thermoclineWave 6s ease-in-out infinite;
}

@keyframes thermoclineWave {
    0%, 100% {
        d: path("M0,5 C360,3 720,7 1080,5 C1260,4 1380,6 1440,5");
    }
    50% {
        d: path("M0,5 C360,7 720,3 1080,5 C1260,6 1380,4 1440,5");
    }
}

/* --- ZONE 2: Mesopelagic --- */
.zone-2 {
    min-height: 150vh;
    padding: 10vh 0;
    position: relative;
}

.sonar-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.sonar-trace {
    fill: none;
    stroke: var(--sonar-blue);
    stroke-opacity: 0.25;
    stroke-width: 0.15;
    stroke-dasharray: 1 2;
    stroke-dashoffset: 100;
    transition: stroke-dashoffset 1200ms ease-out;
}

.sonar-trace.drawn {
    stroke-dashoffset: 0;
}

.trace-dot {
    fill: var(--bioluminescence);
    opacity: 0;
    transition: opacity 400ms ease;
}

.trace-dot.visible {
    opacity: 1;
    animation: tracePulse 600ms ease-out 2;
}

@keyframes tracePulse {
    0%, 100% { r: 0.4; opacity: 1; }
    50% { r: 0.8; opacity: 0.6; }
}

.meso-block {
    max-width: 480px;
    padding: 40px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.meso-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.meso-left {
    margin-left: 8%;
    margin-right: auto;
}

.meso-right {
    margin-left: auto;
    margin-right: 8%;
}

.meso-block + .meso-block {
    margin-top: 12vh;
}

.body-text {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 19px;
    line-height: 1.75;
    letter-spacing: 0.005em;
    color: var(--sediment);
    max-width: 55ch;
    text-shadow: 0 0 40px rgba(26, 58, 92, 0.3);
}

/* --- ZONE 3: Bathypelagic --- */
.zone-3 {
    min-height: 200vh;
    padding: 15vh 0;
    position: relative;
}

.pressure-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(26, 58, 92, 0.08) 1.5px, transparent 1.5px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 50%, black 20%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.sonar-traces-z3 {
    z-index: 1;
}

.data-columns {
    display: flex;
    justify-content: center;
    gap: 60px;
    position: relative;
    z-index: 2;
    padding: 20vh 20px 10vh;
}

.data-column {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.data-column.revealed {
    opacity: 1;
    transform: translateY(0);
}

.data-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sediment);
}

.data-value {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: clamp(32px, 5vw, 56px);
    color: var(--bioluminescence);
    letter-spacing: -0.03em;
    line-height: 1.0;
    text-shadow: 0 0 40px rgba(0, 229, 200, 0.15);
}

.data-annotation {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: rgba(138, 155, 181, 0.6);
    margin-bottom: 20px;
}

.data-mark {
    width: 40px;
    height: 40px;
    margin: 10px 0;
}

.data-mark circle,
.data-mark rect,
.data-mark polygon {
    fill: none;
    stroke: var(--sonar-blue);
    stroke-width: 1;
    stroke-opacity: 0.3;
}

.data-mark line {
    stroke: var(--sonar-blue);
    stroke-width: 1;
    stroke-opacity: 0.2;
}

/* Thermal trace - used exactly once */
.thermal-trace {
    width: 80%;
    max-width: 600px;
    height: 1px;
    margin: 10vh auto 0;
    background: linear-gradient(90deg, #ff6b35, #00e5c8);
    opacity: 0.6;
    position: relative;
    z-index: 2;
}

/* --- ZONE 4: Abyssopelagic --- */
.zone-4 {
    min-height: 150vh;
    padding: 15vh 0;
    position: relative;
}

.abyss-content {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px;
}

.abyss-text {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: 24px;
    line-height: 2.2;
    color: var(--sediment);
    text-shadow: 0 0 40px rgba(26, 58, 92, 0.3);
    max-width: 55ch;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease, transform 800ms ease;
}

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

.abyss-text + .fossil {
    margin-top: 80px;
}

.fossil + .abyss-text {
    margin-top: 80px;
}

/* Fossil Impressions */
.fossil {
    display: block;
    width: 120px;
    height: 80px;
    margin: 0 auto;
    opacity: 0;
}

.fossil.revealed {
    opacity: 1;
}

.fossil ellipse {
    fill: none;
    stroke: var(--sonar-blue);
    stroke-width: 1;
    stroke-opacity: 0.15;
    opacity: 0;
    transform: scale(0.8);
    transform-origin: center;
    transition: opacity 400ms ease-out, transform 400ms ease-out;
}

.fossil.revealed ellipse {
    opacity: 1;
    transform: scale(1);
}

.fossil.revealed ellipse:nth-child(1) { transition-delay: 0ms; }
.fossil.revealed ellipse:nth-child(2) { transition-delay: 100ms; }
.fossil.revealed ellipse:nth-child(3) { transition-delay: 200ms; }
.fossil.revealed ellipse:nth-child(4) { transition-delay: 300ms; }
.fossil.revealed ellipse:nth-child(5) { transition-delay: 400ms; }

.fossil-1 { transform: rotate(-5deg); }
.fossil-2 { transform: rotate(4deg); }
.fossil-3 { transform: rotate(-7deg); }

/* --- ZONE 5: Hadal --- */
.zone-5 {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hadal-black);
    position: relative;
}

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

.hadal-text {
    font-family: 'Instrument Serif', serif;
    font-weight: 400;
    font-size: clamp(20px, 3vw, 32px);
    line-height: 1.75;
    color: var(--ghost-light);
    text-shadow: 0 0 60px rgba(0, 229, 200, 0.12);
    max-width: 55ch;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1200ms ease, transform 1200ms ease;
}

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

.ascent-triangle {
    display: block;
    width: 40px;
    height: 30px;
    margin: 60px auto 0;
    opacity: 0.15;
}

.ascent-triangle polygon {
    fill: none;
    stroke: var(--sonar-blue);
    stroke-width: 1;
}

/* --- Responsive (< 640px) --- */
@media (max-width: 640px) {
    .hero-domain {
        font-size: clamp(36px, 14vw, 120px);
    }

    .hero-tld {
        font-size: clamp(16px, 5vw, 48px);
    }

    .meso-left,
    .meso-right {
        margin-left: auto;
        margin-right: auto;
        max-width: 90vw;
    }

    .data-columns {
        flex-direction: column;
        align-items: center;
        gap: 60px;
    }

    .data-column {
        width: 90vw;
        max-width: 320px;
    }

    .depth-markers {
        display: none;
    }

    .bloom-4,
    .bloom-5 {
        display: none;
    }

    .body-text {
        text-shadow: 0 0 24px rgba(26, 58, 92, 0.2);
    }

    .hero-domain {
        text-shadow: 0 0 36px rgba(0, 229, 200, 0.1);
    }

    .thermocline-path {
        animation: none;
    }

    .abyss-text {
        font-size: 20px;
        line-height: 2.0;
    }
}
