/* =====================================================
   miris.day — seapunk drowned palace
   Bathymetric descent · grain overlay · magnetic motifs
   ===================================================== */

:root {
    --void-black: #03060A;
    --void-blue: #060B14;
    --abyssal-teal: #0A2F3C;
    --bio-cyan: #00FFCC;
    --neon-magenta: #FF00FF;
    --deep-violet: #2D0A4E;
    --coral-pink: #FF6B8A;
    --pearl-white: #E8F0F2;
    --phosphor-green: #1A4D3A;
    --aquamarine: #00E5CC;

    --serif: "Libre Baskerville", "Iowan Old Style", "Garamond", serif;
    --sans: "DM Sans", "Inter", "Helvetica Neue", sans-serif;

    --maxw: 720px;
    --grain-strength: 0.10;
}

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

html {
    scroll-behavior: smooth;
    background: var(--void-black);
}

body {
    font-family: var(--serif);
    color: var(--pearl-white);
    background: var(--void-black);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.7;
    letter-spacing: 0.01em;
    position: relative;
}

/* ---------- Atmospheric backdrop ---------- */
#atmosphere-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(180deg, #0A2F3C 0%, #060B14 100%);
    transition: background 1.8s ease-in-out, opacity 1.8s ease-in-out;
    pointer-events: none;
}

#atmosphere-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 70% 20%, rgba(0,255,204,0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(255,0,255,0.06) 0%, transparent 65%);
    transition: background 1.8s ease-in-out, opacity 1.8s ease-in-out;
    opacity: 1;
}

body[data-current-zone="surface"] #atmosphere-bg {
    background: linear-gradient(180deg, rgba(0,229,204,0.22) 0%, #0A2F3C 100%);
}
body[data-current-zone="thermocline"] #atmosphere-bg {
    background: linear-gradient(180deg, #0A2F3C 0%, #1A4D3A 70%, #060B14 100%);
}
body[data-current-zone="mesopelagic"] #atmosphere-bg {
    background: linear-gradient(180deg, #0A2F3C 0%, #2D0A4E 60%, #060B14 100%);
}
body[data-current-zone="bathypelagic"] #atmosphere-bg {
    background: linear-gradient(180deg, #060B14 0%, #03060A 100%);
}
body[data-current-zone="abyss"] #atmosphere-bg {
    background: radial-gradient(ellipse at 50% 50%, #060B14 0%, #03060A 70%);
}

body[data-current-zone="abyss"] #atmosphere-glow,
body[data-current-zone="bathypelagic"] #atmosphere-glow {
    opacity: 0.4;
}

/* ---------- Grain overlay ---------- */
#grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: var(--grain-strength);
    transition: opacity 1.6s ease-in-out;
}

#grain-overlay svg {
    width: 100%;
    height: 100%;
    display: block;
}

body[data-current-zone="surface"] { --grain-strength: 0.05; }
body[data-current-zone="thermocline"] { --grain-strength: 0.08; }
body[data-current-zone="mesopelagic"] { --grain-strength: 0.10; }
body[data-current-zone="bathypelagic"] { --grain-strength: 0.15; }
body[data-current-zone="abyss"] { --grain-strength: 0.04; }

/* ---------- Descent main ---------- */
#descent {
    position: relative;
    z-index: 1;
}

.zone {
    position: relative;
    min-height: 100vh;
    padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 6vw, 5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.zone-marker {
    position: absolute;
    top: clamp(1.5rem, 4vh, 3rem);
    left: clamp(1.5rem, 6vw, 5rem);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 11px;
    color: rgba(232, 240, 242, 0.55);
    z-index: 4;
}
.zone-marker__index {
    color: var(--bio-cyan);
    font-weight: 500;
}
.zone-marker__name {
    font-size: 12px;
    letter-spacing: 0.22em;
}
.zone-marker--abyss .zone-marker__index { color: var(--neon-magenta); }

/* =====================================================
   Zone 1 · The Surface
   ===================================================== */
.zone--surface {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.surface-haze {
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(0,255,204,0.18) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 80%, rgba(255,0,255,0.08) 0%, transparent 60%);
    filter: blur(40px);
    pointer-events: none;
    z-index: 0;
    animation: drift-haze 22s ease-in-out infinite alternate;
}

@keyframes drift-haze {
    0% { transform: translate3d(-2%, -1%, 0) scale(1); }
    100% { transform: translate3d(3%, 2%, 0) scale(1.05); }
}

.surface-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.dateline {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 11px;
    color: rgba(232, 240, 242, 0.6);
    margin-bottom: 2.5rem;
}

.brand-lockup {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(5rem, 14vw, 9.5rem);
    line-height: 1.0;
    letter-spacing: 0.06em;
    text-transform: lowercase;
    color: var(--pearl-white);
    text-shadow:
        0 0 40px rgba(0, 255, 204, 0.18),
        0 0 80px rgba(0, 229, 204, 0.10),
        2px 0 0 rgba(255, 0, 255, 0.18),
        -2px 0 0 rgba(0, 255, 204, 0.18);
    animation: surface-bob 6s ease-in-out infinite;
}

.brand-lockup__line {
    display: inline-block;
}
.brand-lockup__dot {
    display: inline-block;
    color: var(--bio-cyan);
    text-shadow: 0 0 28px rgba(0, 255, 204, 0.6);
    transform: translateY(-0.05em);
}

@keyframes surface-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.surface-tagline {
    margin-top: 2.5rem;
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.8;
    color: rgba(232, 240, 242, 0.78);
    letter-spacing: 0.02em;
    max-width: 38em;
    margin-left: auto;
    margin-right: auto;
}

.descend-prompt {
    position: absolute;
    bottom: clamp(2rem, 6vh, 4rem);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    z-index: 3;
}

.descend-prompt__label {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 10px;
    color: rgba(232, 240, 242, 0.55);
}

.descend-prompt__chevron {
    width: 22px;
    height: 22px;
    border-right: 1px solid var(--bio-cyan);
    border-bottom: 1px solid var(--bio-cyan);
    transform: rotate(45deg);
    box-shadow: 2px 2px 18px rgba(0,255,204,0.25);
    animation: chevron-pulse 2.6s ease-in-out infinite;
}

@keyframes chevron-pulse {
    0%, 100% { opacity: 0.4; transform: rotate(45deg) translate(-4px,-4px); }
    50% { opacity: 1; transform: rotate(45deg) translate(2px,2px); }
}

/* =====================================================
   Zone 2 · The Thermocline
   ===================================================== */
.zone--thermocline {
    justify-content: center;
    padding-top: clamp(8rem, 16vh, 12rem);
    padding-bottom: clamp(8rem, 16vh, 12rem);
}

.zone--thermocline::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='60'><path d='M0 50 Q30 20 60 50 T120 50' stroke='%2300FFCC' stroke-width='1' fill='none' opacity='0.05'/><path d='M0 30 Q30 0 60 30 T120 30' stroke='%2300FFCC' stroke-width='1' fill='none' opacity='0.04'/></svg>");
    background-size: 240px 120px;
    background-attachment: fixed;
    pointer-events: none;
    z-index: 0;
}

.kelp-stream {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: clamp(3rem, 8vh, 6rem);
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.kelp-block {
    position: relative;
    max-width: 36em;
    padding: clamp(1.6rem, 3vw, 2.4rem);
    border: 1px solid rgba(0, 255, 204, 0.18);
    background: rgba(10, 47, 60, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: border-color 0.6s ease, box-shadow 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: transform;
}

.kelp-block::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 28px;
    height: 1px;
    background: var(--bio-cyan);
    opacity: 0.7;
}
.kelp-block::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 1px;
    background: var(--neon-magenta);
    opacity: 0.6;
}

.kelp-block--left {
    margin-left: clamp(1rem, 6vw, 6rem);
    margin-right: auto;
}
.kelp-block--right {
    margin-right: clamp(1rem, 6vw, 6rem);
    margin-left: auto;
}

.kelp-meta {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 11px;
    color: var(--bio-cyan);
    opacity: 0.85;
    margin-bottom: 1rem;
}

.kelp-text {
    font-family: var(--serif);
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    line-height: 1.8;
    color: rgba(232, 240, 242, 0.92);
}

/* =====================================================
   Zone 3 · The Mesopelagic
   ===================================================== */
.zone--mesopelagic {
    justify-content: center;
    align-items: center;
    padding-top: clamp(8rem, 16vh, 12rem);
    padding-bottom: clamp(8rem, 16vh, 12rem);
}

.zone--mesopelagic::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M0 8 L24 8 L24 16 L8 16 L8 32 L32 32 L32 0' stroke='%23FF00FF' stroke-width='1' fill='none' opacity='0.05'/></svg>");
    background-size: 80px 80px;
    background-attachment: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.7;
}

.zone--mesopelagic::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 40%, rgba(45,10,78,0.4) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.meso-deck {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.meso-heading {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2.4rem, 4vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: 0.04em;
    color: var(--pearl-white);
    text-align: center;
    margin-bottom: 1.2rem;
    text-shadow: 0 0 32px rgba(0, 255, 204, 0.12);
}

.meso-subhead {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    color: rgba(232, 240, 242, 0.7);
    text-align: center;
    margin-bottom: clamp(3rem, 6vh, 5rem);
    max-width: 38em;
    margin-left: auto;
    margin-right: auto;
}

.panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.5rem);
    perspective: 1200px;
}

.glass-panel {
    position: relative;
    padding: clamp(2rem, 4vw, 3.75rem);
    background: linear-gradient(135deg, rgba(0, 255, 204, 0.04) 0%, rgba(255, 0, 255, 0.05) 100%);
    border: 1px solid rgba(0, 255, 204, 0.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), border-color 0.4s ease, box-shadow 0.4s ease;
    transform-style: preserve-3d;
    will-change: transform;
    overflow: hidden;
}

.glass-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,204,0.6), transparent);
    opacity: 0.6;
}

.glass-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at var(--mx, 50%) var(--my, 50%), rgba(0,255,204,0.12) 0%, transparent 50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.glass-panel:hover {
    border-color: rgba(0, 255, 204, 0.55);
    box-shadow:
        0 0 0 1px rgba(0,255,204,0.1),
        0 20px 60px -20px rgba(0,255,204,0.18),
        0 0 40px rgba(255,0,255,0.05);
}

.glass-panel:hover::after {
    opacity: 1;
}

.glass-panel--shifted {
    transform: translateY(2rem);
}

.panel-eyebrow {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.28em;
    font-size: 11px;
    color: var(--bio-cyan);
    margin-bottom: 1.2rem;
}

.panel-title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(1.4rem, 2vw, 1.75rem);
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--pearl-white);
    margin-bottom: 1.4rem;
}

.panel-body {
    font-family: var(--serif);
    font-size: 1.0rem;
    line-height: 1.75;
    color: rgba(232, 240, 242, 0.82);
    margin-bottom: 1.8rem;
}

.panel-foot {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 10px;
    color: rgba(255, 107, 138, 0.75);
    border-top: 1px solid rgba(232, 240, 242, 0.1);
    padding-top: 1rem;
}

/* =====================================================
   Zone 4 · The Bathypelagic
   ===================================================== */
.zone--bathypelagic {
    justify-content: center;
    align-items: center;
    padding-top: clamp(10rem, 18vh, 14rem);
    padding-bottom: clamp(10rem, 18vh, 14rem);
    background: var(--void-blue);
}

.zone--bathypelagic::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><path d='M0 8 L24 8 L24 16 L8 16 L8 32 L32 32 L32 0' stroke='%23FF00FF' stroke-width='1' fill='none' opacity='0.06'/></svg>"),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><circle cx='32' cy='48' r='1.5' fill='%23FF6B8A' opacity='0.25'/><circle cx='120' cy='40' r='1.4' fill='%23FF6B8A' opacity='0.2'/><circle cx='200' cy='90' r='1.3' fill='%23FF6B8A' opacity='0.22'/><circle cx='80' cy='160' r='1.5' fill='%23FF6B8A' opacity='0.25'/><circle cx='180' cy='200' r='1.2' fill='%23FF6B8A' opacity='0.2'/></svg>");
    background-size: 80px 80px, 480px 480px;
    background-attachment: fixed;
    pointer-events: none;
    z-index: 0;
}

.zone--bathypelagic::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 30%, rgba(255,0,255,0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 70%, rgba(0,255,204,0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.bathy-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    margin: 0 auto;
}

.bathy-eyebrow {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 11px;
    color: var(--neon-magenta);
    text-align: center;
    margin-bottom: 2rem;
    opacity: 0.75;
}

.bathy-heading {
    font-family: var(--serif);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.15;
    letter-spacing: 0.02em;
    text-align: center;
    color: var(--pearl-white);
    margin-bottom: clamp(3rem, 6vh, 5rem);
    text-shadow: 0 0 40px rgba(0,255,204,0.1);
}

.bathy-stack {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vh, 3rem);
}

.bathy-paragraph {
    font-family: var(--serif);
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    line-height: 1.85;
    color: rgba(232, 240, 242, 0.86);
    letter-spacing: 0.01em;
    text-align: left;
}

.bathy-paragraph::first-letter {
    font-size: 1.4em;
    color: var(--bio-cyan);
    letter-spacing: 0.04em;
}

.reveal {
    opacity: 0;
    filter: contrast(0.3) brightness(1.5) blur(2px);
    transform: translateY(18px);
    transition: opacity 1.2s ease-out, filter 1.2s ease-out, transform 1.2s ease-out;
}

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

/* =====================================================
   Zone 5 · The Abyss
   ===================================================== */
.zone--abyss {
    background: var(--void-black);
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: clamp(8rem, 16vh, 12rem);
    padding-bottom: clamp(8rem, 16vh, 12rem);
    position: relative;
}

.zone--abyss::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(0,255,204,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.particle-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    animation-name: bio-pulse;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
}

.particle--cyan {
    background: var(--bio-cyan);
    box-shadow:
        0 0 12px 4px rgba(0,255,204,0.5),
        0 0 24px 8px rgba(0,255,204,0.18);
}

.particle--magenta {
    background: var(--neon-magenta);
    box-shadow:
        0 0 12px 4px rgba(255,0,255,0.5),
        0 0 24px 8px rgba(255,0,255,0.18);
}

.particle--coral {
    background: var(--coral-pink);
    box-shadow:
        0 0 10px 3px rgba(255,107,138,0.45),
        0 0 22px 6px rgba(255,107,138,0.16);
}

@keyframes bio-pulse {
    0%, 100% {
        opacity: 0.1;
        transform: translate(var(--mx, 0px), 0px) scale(0.85);
    }
    50% {
        opacity: 0.8;
        transform: translate(var(--mx, 0px), -32px) scale(1.1);
    }
}

.abyss-content {
    position: relative;
    z-index: 3;
    max-width: 720px;
    margin: 0 auto;
}

.abyss-eyebrow {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.36em;
    font-size: 11px;
    color: rgba(0, 255, 204, 0.75);
    margin-bottom: 3rem;
}

.abyss-statement {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.6vw, 2.1rem);
    line-height: 1.5;
    letter-spacing: 0.02em;
    color: var(--pearl-white);
    text-shadow: 0 0 28px rgba(0,255,204,0.18);
    margin-bottom: 2.5rem;
}

.abyss-signature {
    font-family: var(--serif);
    font-style: italic;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: var(--coral-pink);
    letter-spacing: 0.04em;
    text-shadow: 0 0 18px rgba(255,107,138,0.25);
}

.abyss-coda {
    position: absolute;
    bottom: clamp(2rem, 6vh, 4rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.36em;
    font-size: 10px;
    color: rgba(232, 240, 242, 0.45);
}

.coda-tick {
    width: 36px;
    height: 1px;
    background: rgba(232, 240, 242, 0.3);
}

/* =====================================================
   Depth gauge
   ===================================================== */
.depth-gauge {
    position: fixed;
    top: 50%;
    right: clamp(1rem, 3vw, 2.4rem);
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    pointer-events: none;
}

.depth-gauge__rail {
    width: 1px;
    height: clamp(140px, 22vh, 240px);
    background: linear-gradient(180deg, rgba(0,255,204,0.4) 0%, rgba(255,0,255,0.4) 100%);
    position: relative;
    opacity: 0.45;
}

.depth-gauge__fill {
    position: absolute;
    top: 0;
    left: -1px;
    width: 3px;
    height: 0%;
    background: linear-gradient(180deg, var(--bio-cyan), var(--neon-magenta));
    box-shadow: 0 0 12px rgba(0,255,204,0.55);
    transition: height 0.2s linear;
}

.depth-gauge__value {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 11px;
    color: var(--bio-cyan);
    letter-spacing: 0.18em;
}

.depth-gauge__label {
    font-family: var(--sans);
    text-transform: uppercase;
    letter-spacing: 0.32em;
    font-size: 9px;
    color: rgba(232, 240, 242, 0.45);
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 768px) {
    .zone-marker {
        font-size: 9px;
        gap: 0.2rem;
    }
    .kelp-block--left,
    .kelp-block--right {
        margin-left: 0;
        margin-right: 0;
    }
    .glass-panel--shifted {
        transform: translateY(0);
    }
    .depth-gauge {
        right: 0.6rem;
    }
    .depth-gauge__rail {
        height: 100px;
    }
    .depth-gauge__label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-lockup,
    .surface-haze,
    .descend-prompt__chevron,
    .particle {
        animation: none !important;
    }
    .reveal {
        opacity: 1;
        filter: none;
        transform: none;
    }
}
