/* =========================================================
   dilemma.quest — Deep-ocean bioluminescent design system
   Compliance language: IntersectionObserver` trigger appearance. starts `opacity: pairing immersive context: context:** frequency hairlines used against near-black (#040E18 philosophical questions Display" (Google Playfair's high contrast. Used copy `clamp(1rem
   ========================================================= */

:root {
    --abyss:          #040E18;
    --midnight:       #08203A;
    --bathyal:        #0F3460;
    --bioluminescent: #16C2D5;
    --phosphor:       #72F2EB;
    --glacial:        #E8F0F8;
    --silver:         #A8C4D8;
    --abyssal:        #0A4F6D;
    --muted-teal:     #5B8BA0;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Crimson Pro', 'Times New Roman', serif;
    --font-accent:  'DM Sans', 'Helvetica Neue', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--abyss);
    color: var(--silver);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Global gradient overlay — depth darkens with descent */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 50% 10%, rgba(15, 52, 96, 0.35) 0%, transparent 55%),
        linear-gradient(180deg,
            rgba(8, 32, 58, 0.0) 0%,
            rgba(4, 14, 24, 0.0) 30%,
            rgba(4, 14, 24, 0.4) 70%,
            rgba(4, 14, 24, 0.85) 100%);
    pointer-events: none;
    z-index: 1;
}

/* =========================================================
   Bubble canvas + marine snow
   ========================================================= */
#bubble-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.marine-snow {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.snow {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--phosphor);
    opacity: 0.18;
    box-shadow: 0 0 4px rgba(114, 242, 235, 0.4);
}

.snow.s1  { top:  8%; left:  4%; animation: drift 52s linear infinite; opacity: 0.15; }
.snow.s2  { top: 18%; left: 22%; animation: drift 47s linear infinite -8s; opacity: 0.12; }
.snow.s3  { top: 30%; left: 65%; animation: drift 60s linear infinite -14s; opacity: 0.20; }
.snow.s4  { top: 42%; left: 12%; animation: drift 41s linear infinite -22s; opacity: 0.10; }
.snow.s5  { top: 55%; left: 88%; animation: drift 55s linear infinite -30s; opacity: 0.18; }
.snow.s6  { top: 68%; left: 38%; animation: drift 49s linear infinite -6s; opacity: 0.13; }
.snow.s7  { top: 76%; left: 78%; animation: drift 58s linear infinite -18s; opacity: 0.16; }
.snow.s8  { top: 14%; left: 50%; animation: drift 44s linear infinite -10s; opacity: 0.14; }
.snow.s9  { top: 62%; left: 6%;  animation: drift 53s linear infinite -26s; opacity: 0.12; }
.snow.s10 { top: 88%; left: 28%; animation: drift 46s linear infinite -34s; opacity: 0.20; }
.snow.s11 { top: 35%; left: 92%; animation: drift 51s linear infinite -12s; opacity: 0.11; }
.snow.s12 { top: 92%; left: 60%; animation: drift 57s linear infinite -2s;  opacity: 0.17; }

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0); }
    25%  { transform: translate3d(-30px, -10vh, 0); }
    50%  { transform: translate3d(20px, -25vh, 0); }
    75%  { transform: translate3d(-15px, -45vh, 0); }
    100% { transform: translate3d(0, -75vh, 0); opacity: 0; }
}

/* =========================================================
   Layout — descent
   ========================================================= */
.descent {
    position: relative;
    z-index: 3;
    width: 100%;
}

.act {
    position: relative;
    width: 100%;
    padding: 0 4vw;
}

/* Depth lines — bathymetric / sonar sweep markers */
.depth-line {
    position: relative;
    width: 100%;
    height: 1px;
    border: none;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(15, 52, 96, 0.45) 18%,
        rgba(22, 194, 213, 0.35) 50%,
        rgba(15, 52, 96, 0.45) 82%,
        transparent 100%);
    margin: 8vh 0;
    overflow: visible;
}

.depth-line::after {
    content: attr(data-depth);
    position: absolute;
    right: 4vw;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 0.8vw, 0.78rem);
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--muted-teal);
    background: var(--abyss);
    padding: 0 1em;
    opacity: 0.7;
}

/* =========================================================
   ACT I — The Surface
   ========================================================= */
.surface {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6vh 4vw;
}

.surface-inner {
    max-width: 900px;
    width: 100%;
    padding: 0 4vw;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5.5rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    color: var(--glacial);
    animation: breathe 4s ease-in-out infinite;
    text-shadow:
        0 0 20px rgba(114, 242, 235, 0.15),
        0 0 60px rgba(22, 194, 213, 0.08);
}

@keyframes breathe {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1.0; }
}

/* =========================================================
   ACT II — Thermocline (floating cards)
   ========================================================= */
.thermocline {
    padding: 10vh 4vw 12vh;
    min-height: 200vh;
}

.card {
    position: relative;
    width: clamp(320px, 60vw, 720px);
    margin: 18vh auto;
    margin-left: calc(50% - clamp(160px, 30vw, 360px) + var(--offset, 0%));
    padding: clamp(2rem, 3.5vw, 3.5rem);
    background: rgba(8, 32, 58, 0.85);
    border: 1px solid rgba(15, 52, 96, 0.5);
    border-radius: 24px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow:
        0 0 40px rgba(4, 14, 24, 0.6),
        inset 0 0 60px rgba(15, 52, 96, 0.15);
    animation: float 6s ease-in-out infinite;
    overflow: hidden;
}

.card:nth-child(odd)  { animation-delay: -2s; }
.card:nth-child(even) { animation-delay: -4s; }

.card.reveal {
    animation: none;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.card-meta {
    font-family: var(--font-accent);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-teal);
    margin-bottom: 1.4em;
    padding-bottom: 1em;
    border-bottom: 1px solid rgba(15, 52, 96, 0.5);
    position: relative;
}

.card-meta::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 40px;
    height: 1px;
    background: var(--bioluminescent);
    box-shadow: 0 0 8px rgba(22, 194, 213, 0.7);
}

.card-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--glacial);
    margin-bottom: 1.2em;
}

.card-body {
    font-family: var(--font-body);
    font-weight: 300;
    color: var(--silver);
    line-height: 1.75;
}

/* Concentric rings behind selected cards */
.rings {
    position: absolute;
    right: -90px;
    top: -90px;
    width: 280px;
    height: 280px;
    pointer-events: none;
    z-index: 0;
}

.rings span {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(22, 194, 213, 0.2);
    border-radius: 50%;
    animation: sonar 6s ease-out infinite;
}

.rings span:nth-child(2) { animation-delay: -2s; }
.rings span:nth-child(3) { animation-delay: -4s; }

@keyframes sonar {
    0%   { transform: scale(0.4); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* Specimen figure (duotone-style SVG) */
.specimen {
    margin: 0;
    text-align: center;
}

.specimen-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 16px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 40%, rgba(15, 52, 96, 0.4) 0%, var(--abyss) 75%);
    border: 1px solid rgba(22, 194, 213, 0.18);
    box-shadow: inset 0 0 80px rgba(4, 14, 24, 0.8);
    margin-bottom: 1.4em;
}

.specimen-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 20px rgba(22, 194, 213, 0.4));
    animation: specimen-drift 10s ease-in-out infinite;
}

@keyframes specimen-drift {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(8px, -10px); }
}

.specimen figcaption {
    font-family: var(--font-accent);
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-teal);
    line-height: 1.6;
}

/* =========================================================
   ACT III — The Abyss (dilemma prompts)
   ========================================================= */
.abyss {
    padding: 18vh 4vw 18vh;
    min-height: 200vh;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(4, 14, 24, 0.4) 20%,
        rgba(4, 14, 24, 0.7) 100%);
}

.prompt {
    max-width: 900px;
    margin: 28vh auto;
    padding: 0 4vw;
    text-align: center;
}

.prompt-index {
    font-family: var(--font-accent);
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--muted-teal);
    margin-bottom: 2.4em;
    position: relative;
    display: inline-block;
}

.prompt-index::before,
.prompt-index::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--bathyal));
}

.prompt-index::before { right: 100%; margin-right: 1.2em; transform: scaleX(-1); }
.prompt-index::after  { left:  100%; margin-left:  1.2em; }

.prompt-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    line-height: 1.3;
    letter-spacing: 0.01em;
    color: var(--glacial);
    max-width: 22ch;
    margin: 0 auto;
}

.pulse-attention {
    animation: pulse-attention 4s ease-in-out infinite;
}

@keyframes pulse-attention {
    0%, 100% {
        color: var(--glacial);
        text-shadow: 0 0 0px transparent;
    }
    50% {
        color: var(--phosphor);
        text-shadow: 0 0 30px rgba(114, 242, 235, 0.3);
    }
}

/* =========================================================
   ACT IV — The Floor (resolution)
   ========================================================= */
.floor {
    min-height: 100vh;
    padding: 12vh 4vw 18vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,
        rgba(4, 14, 24, 0.7) 0%,
        rgba(2, 6, 12, 1) 70%,
        #000000 100%);
}

.resolution {
    max-width: 720px;
    text-align: center;
}

.resolution-orb {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 6vh;
}

.orb-core {
    position: absolute;
    inset: 38%;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        var(--phosphor) 0%,
        var(--bioluminescent) 40%,
        transparent 80%);
    box-shadow:
        0 0 40px 10px rgba(22, 194, 213, 0.5),
        0 0 120px 30px rgba(114, 242, 235, 0.25);
    animation: orb-pulse 3s ease-in-out infinite;
}

@keyframes orb-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow:
            0 0 20px 5px rgba(22, 194, 213, 0.15),
            0 0 60px 15px rgba(114, 242, 235, 0.15);
    }
    50% {
        transform: scale(1.18);
        box-shadow:
            0 0 60px 20px rgba(22, 194, 213, 0.4),
            0 0 140px 40px rgba(114, 242, 235, 0.35);
    }
}

.orb-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(22, 194, 213, 0.4);
    border-radius: 50%;
    animation: orb-ring 5s ease-out infinite;
}

.orb-ring.r1 { animation-delay:  0s; }
.orb-ring.r2 { animation-delay: -1.6s; }
.orb-ring.r3 { animation-delay: -3.2s; }

@keyframes orb-ring {
    0%   { transform: scale(0.5); opacity: 0.8; border-color: rgba(114, 242, 235, 0.5); }
    100% { transform: scale(1.8); opacity: 0;   border-color: rgba(22, 194, 213, 0.0); }
}

.resolution-text {
    font-family: var(--font-display);
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.3rem, 2.4vw, 2rem);
    line-height: 1.5;
    color: var(--glacial);
    margin-bottom: 4vh;
    max-width: 28ch;
    margin-left: auto;
    margin-right: auto;
}

.resolution-signature {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.08em;
    color: var(--bioluminescent);
    margin-bottom: 2.4em;
    text-shadow: 0 0 12px rgba(22, 194, 213, 0.4);
}

.resolution-coords {
    font-family: var(--font-accent);
    font-size: clamp(0.65rem, 0.8vw, 0.78rem);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted-teal);
    opacity: 0.6;
}

/* =========================================================
   Reveal-on-scroll (IntersectionObserver targets)
   ========================================================= */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 800ms ease-out,
        transform 800ms ease-out;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Cards keep floating animation once visible — combine with translateY */
.card.reveal.is-visible {
    animation: none;
}

.card.reveal.is-floating {
    animation: float 6s ease-in-out infinite;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 720px) {
    .card {
        width: 85vw;
        margin-left: auto;
        margin-right: auto;
        margin-top: 14vh;
        margin-bottom: 14vh;
    }

    .rings {
        width: 200px;
        height: 200px;
        right: -60px;
        top: -60px;
    }

    .depth-line::after {
        right: 2vw;
        font-size: 0.6rem;
    }

    .prompt {
        margin: 22vh auto;
    }

    .resolution-orb {
        width: 180px;
        height: 180px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
