/* oning.stream - Frutiger Aero / Navy-Metallic / Immersive Scroll */

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

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

body {
    background-color: #0D1B2A;
    color: #8FA3B8;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

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

/* ===== Depth Gauge ===== */
#depth-gauge {
    position: fixed;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 30px;
    z-index: 100;
    pointer-events: none;
}

#depth-line {
    position: absolute;
    left: 50%;
    top: 5vh;
    bottom: 5vh;
    width: 1px;
    background: #1B2E4A;
    transform: translateX(-50%);
}

#depth-dot {
    position: absolute;
    left: 50%;
    top: 5vh;
    width: 8px;
    height: 8px;
    background: #5FB8D9;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px #5FB8D9, 0 0 24px rgba(95, 184, 217, 0.2);
    transition: top 0.05s linear;
}

.depth-label {
    position: absolute;
    left: 22px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A6FA5;
    white-space: nowrap;
    opacity: 0.7;
}

.depth-label::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 50%;
    width: 8px;
    height: 1px;
    background: #1B2E4A;
    transform: translateY(-50%);
}

.depth-label[data-depth="0"] {
    top: 5vh;
}

.depth-label[data-depth="1"] {
    top: 45vh;
}

.depth-label[data-depth="2"] {
    top: 80vh;
}

/* ===== Layers ===== */
.layer {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ===== Surface Layer / Hero ===== */
#surface {
    height: 100vh;
    background: linear-gradient(180deg, #0D1B2A 0%, #0A0E1A 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gloss-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 2;
}

.surface-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.6) 100%);
    pointer-events: none;
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
}

.ripple-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(95, 184, 217, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: rippleExpand 6s ease-out infinite;
}

@keyframes rippleExpand {
    0% {
        width: 60px;
        height: 60px;
        opacity: 0.6;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
    }
}

.hero-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    letter-spacing: -0.01em;
    color: #C8D6E5;
    margin-bottom: 0.5em;
    position: relative;
}

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A6FA5;
}

/* ===== Wave Backgrounds ===== */
.wave-bg {
    position: absolute;
    width: 200%;
    left: -50%;
    pointer-events: none;
}

.wave-hero {
    bottom: 0;
    height: 60%;
    z-index: 1;
}

.wave-abyss {
    top: 50%;
    height: 50%;
    transform: translateY(-50%);
    z-index: 0;
}

.wave-benthic {
    bottom: 20%;
    height: 40%;
    z-index: 0;
}

/* ===== Thermocline - Card Section ===== */
#thermocline {
    padding: 15vh 0;
    background: linear-gradient(180deg, #0A0E1A 0%, #0D1B2A 20%, #0D1B2A 80%, #0A0E1A 100%);
}

.card-viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    padding: 5vh 5vw;
    perspective: 1200px;
}

/* ===== Specimen Cards ===== */
.specimen-card {
    width: min(65vw, 720px);
    height: min(70vh, 540px);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
}

.specimen-card.flipped[data-flip="left"] {
    transform: rotateY(180deg);
}

.specimen-card.flipped[data-flip="right"] {
    transform: rotateY(-180deg);
}

.card-face {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #4A6FA5;
}

.specimen-card.flipped .card-face {
    box-shadow: 0 0 20px rgba(95, 184, 217, 0.3);
}

/* Card Front */
.card-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
}

.card-front:hover {
    border-color: #5FB8D9;
    box-shadow: inset 0 0 0 1px rgba(95, 184, 217, 0.15);
}

.watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at var(--wc-x1) var(--wc-y1), rgba(95, 184, 217, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse at var(--wc-x2) var(--wc-y2), rgba(74, 111, 165, 0.12) 0%, transparent 50%),
        #E8EDF2;
    filter: url(#watercolor-noise);
    z-index: 0;
}

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

.droplet {
    position: absolute;
    left: var(--dx);
    top: var(--dy);
    width: var(--ds);
    height: var(--ds);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.1) 60%, transparent);
    opacity: 0.6;
}

.card-category {
    position: relative;
    z-index: 2;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A6FA5;
    margin-bottom: 1.5rem;
}

.card-title {
    position: relative;
    z-index: 2;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -0.01em;
    color: #2C3E50;
    text-align: center;
    line-height: 1.2;
}

/* Card Back */
.card-back {
    transform: rotateY(180deg);
    background: #0D1B2A;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 3.5rem;
}

.specimen-card[data-flip="right"] .card-back {
    transform: rotateY(-180deg);
}

.back-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    letter-spacing: -0.01em;
    color: #C8D6E5;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.back-body {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #8FA3B8;
    max-width: 680px;
}

.back-meta {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #1B2E4A;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meta-tag,
.meta-date {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #4A6FA5;
}

/* ===== Wave Divider ===== */
.wave-divider {
    display: block;
    width: 60%;
    max-width: 600px;
    height: 40px;
    margin: 0 auto;
}

/* ===== Abyssal Section ===== */
#abyss {
    background: #0A0E1A;
    padding: 20vh 0;
    min-height: 200vh;
}

.abyss-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 2rem;
}

.bioluminescent-block {
    margin-bottom: 20vh;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease, text-shadow 0.6s ease;
}

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

.abyss-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 500;
    font-size: clamp(2rem, 5vw, 3.6rem);
    letter-spacing: -0.01em;
    color: #C8D6E5;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.bioluminescent-block.revealed .abyss-title {
    text-shadow: 0 0 12px rgba(95, 184, 217, 0.3);
}

.abyss-text {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    color: #8FA3B8;
}

.bioluminescent-block.revealed .abyss-text {
    text-shadow: 0 0 8px rgba(95, 184, 217, 0.1);
}

/* ===== Benthic Footer ===== */
#benthic {
    background: #0A0E1A;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benthic-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.benthic-domain {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 400;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    letter-spacing: -0.01em;
    color: #C8D6E5;
    opacity: 0.4;
    animation: benthicPulse 8s ease-in-out infinite;
}

@keyframes benthicPulse {
    0%, 100% {
        opacity: 0.3;
        text-shadow: 0 0 0 transparent;
    }
    50% {
        opacity: 0.5;
        text-shadow: 0 0 20px rgba(95, 184, 217, 0.15);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    #depth-gauge {
        left: 10px;
    }

    .depth-label {
        display: none;
    }

    .specimen-card {
        width: 90vw;
        height: auto;
        min-height: 60vh;
    }

    .card-front,
    .card-back {
        padding: 2rem;
    }

    .wave-divider {
        width: 80%;
    }

    .abyss-content {
        padding: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .specimen-card {
        width: 95vw;
        min-height: 50vh;
    }

    .card-back {
        padding: 1.5rem;
    }
}
