/* ============================================================
   underdark.stream — Seapunk Bioluminescent Streaming Platform
   Color Palette:
     #04030a — Void Black (primary bg)
     #060816 — Deep Navy (secondary bg)
     #00ffff — Electric Cyan (primary accent)
     #ff00cc — Hot Magenta (secondary accent)
     #7b00ff — Deep Violet (tertiary accent)
     #00ff88 — Bioluminescent Green (hover)
     #c8d6e8 — Cool Blue-Grey (body text)
     #1a0a2e — Dark Indigo (card bg)
     #1a0010 — Deep Magenta-Dark (hadal bg)
     #7b8fa1 — Muted Blue-Slate (meta/labels)
   Fonts: Libre Baskerville (display), Oswald (headings/labels)
   ============================================================ */

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

:root {
    --void-black:    #04030a;
    --deep-navy:     #060816;
    --cyan:          #00ffff;
    --magenta:       #ff00cc;
    --violet:        #7b00ff;
    --green:         #00ff88;
    --body-text:     #c8d6e8;
    --card-bg:       #1a0a2e;
    --hadal-bg:      #1a0010;
    --meta:          #7b8fa1;
    --depth: 0;

    --glow-cyan:     0 0 20px #00ffff, 0 0 60px rgba(0,255,255,0.4);
    --glow-magenta:  0 0 20px #ff00cc, 0 0 60px rgba(255,0,204,0.4);
    --glow-violet:   0 0 20px #7b00ff, 0 0 60px rgba(123,0,255,0.4);
    --glow-green:    0 0 20px #00ff88, 0 0 60px rgba(0,255,136,0.4);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    background-color: var(--void-black);
    color: var(--body-text);
    overflow-x: hidden;
    line-height: 1.75;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ─── Navbar ────────────────────────────────────────────────── */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 48px;
    background: rgba(4, 3, 10, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.08);
}

.navbar-wordmark {
    font-family: 'Libre Baskerville', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.06em;
    text-shadow: var(--glow-cyan);
}

.navbar-wordmark .dot {
    color: var(--magenta);
    text-shadow: var(--glow-magenta);
}

.navbar-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--meta);
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
}

/* ─── Zones / Sections ──────────────────────────────────────── */
.zone {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

#surface    { background-color: #04030a; }
#thermocline { background-color: #060816; }
#twilight   { background: linear-gradient(180deg, #060816 0%, #0a0420 100%); }
#midnight   { background-color: #04030a; }
#hadal      { background: linear-gradient(180deg, #04030a 0%, #1a0010 60%, #1a0010 100%); }

.zone-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 0 48px;
}

/* ─── Section Labels ────────────────────────────────────────── */
.section-label {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.section-label::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 14px;
    background: var(--magenta);
    margin-right: 12px;
    box-shadow: var(--glow-magenta);
}

.label-text {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--magenta);
}

/* ─── Section Titles ────────────────────────────────────────── */
.section-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 60px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.08em;
    text-shadow: 0 0 30px #00ffff, 0 0 80px rgba(0,255,255,0.3);
    margin-bottom: 48px;
    line-height: 1.1;
}

/* ─── Surface Zone / Hero ───────────────────────────────────── */
#surface .zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 88px;
    font-weight: 700;
    color: var(--cyan);
    letter-spacing: 0.08em;
    text-shadow: 0 0 30px #00ffff, 0 0 80px rgba(0,255,255,0.44);
    margin-bottom: 20px;
    line-height: 1;
    position: relative;
    z-index: 3;
}

.hero-tagline {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--meta);
    margin-bottom: 24px;
    position: relative;
    z-index: 3;
}

.hero-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--magenta));
    position: relative;
    z-index: 3;
    box-shadow: 0 0 12px rgba(0,255,255,0.6);
}

/* ─── Decorative Background Blobs ───────────────────────────── */
.blob-bg {
    position: absolute;
    border-radius: 50% 40% 60% 38% / 60% 50% 40% 52%;
    filter: blur(2px);
    pointer-events: none;
    z-index: 1;
}

.blob-cyan {
    width: 72vw;
    height: 72vw;
    background: radial-gradient(ellipse at center, rgba(0,255,255,0.07) 0%, rgba(0,255,255,0.02) 50%, transparent 70%);
    top: -30vw;
    right: -25vw;
    animation: blob-drift-a 18s ease-in-out infinite;
}

.blob-magenta {
    width: 60vw;
    height: 60vw;
    background: radial-gradient(ellipse at center, rgba(255,0,204,0.07) 0%, rgba(255,0,204,0.02) 50%, transparent 70%);
    bottom: -28vw;
    left: -20vw;
    animation: blob-drift-b 22s ease-in-out infinite;
}

.blob-violet {
    width: 65vw;
    height: 65vw;
    background: radial-gradient(ellipse at center, rgba(123,0,255,0.08) 0%, rgba(123,0,255,0.02) 50%, transparent 70%);
}

.blob-thermocline {
    top: -20vw;
    left: -25vw;
    animation: blob-drift-a 20s ease-in-out infinite reverse;
}

.blob-midnight {
    bottom: -25vw;
    right: -20vw;
    animation: blob-drift-b 16s ease-in-out infinite;
}

.blob-hadal {
    width: 80vw;
    height: 80vw;
    background: radial-gradient(ellipse at center, rgba(255,0,204,0.1) 0%, rgba(123,0,255,0.04) 50%, transparent 70%);
    top: 10vh;
    left: -30vw;
    animation: blob-drift-a 24s ease-in-out infinite;
}

@keyframes blob-drift-a {
    0%, 100% {
        border-radius: 50% 40% 60% 38% / 60% 50% 40% 52%;
        transform: translate(0, 0) scale(1);
    }
    33% {
        border-radius: 40% 60% 38% 52% / 50% 38% 62% 44%;
        transform: translate(2vw, -2vw) scale(1.03);
    }
    66% {
        border-radius: 62% 36% 44% 56% / 40% 58% 38% 60%;
        transform: translate(-1vw, 3vw) scale(0.97);
    }
}

@keyframes blob-drift-b {
    0%, 100% {
        border-radius: 42% 58% 36% 62% / 54% 44% 58% 42%;
        transform: translate(0, 0) scale(1);
    }
    40% {
        border-radius: 58% 38% 56% 40% / 42% 60% 36% 58%;
        transform: translate(-3vw, 2vw) scale(1.04);
    }
    70% {
        border-radius: 36% 62% 48% 50% / 60% 40% 52% 44%;
        transform: translate(2vw, -3vw) scale(0.96);
    }
}

/* ─── Feature Cards (Thermocline) ───────────────────────────── */
.thermocline-title {
    margin-left: 2%;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.feature-card {
    position: relative;
    background: rgba(26, 10, 46, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 2px solid var(--cyan);
    border-radius: 4px;
    padding: 36px 28px;
    cursor: default;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
    overflow: hidden;
}

.feature-card:hover {
    box-shadow: 0 0 40px rgba(0,255,255,0.12), 0 8px 32px rgba(0,0,0,0.6);
}

.card-left   { margin-top: 40px; }
.card-center { margin-top: 0; border-left-color: var(--magenta); }
.card-right  { margin-top: 60px; border-left-color: var(--green); }

/* Card gloss layer */
.card-gloss {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    transition: background-position 0.15s ease-out;
}

.card-inner {
    position: relative;
    z-index: 1;
}

/* Creature icons */
.card-icon {
    width: 52px;
    height: 70px;
    color: var(--cyan);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 8px var(--cyan));
}

.card-icon-magenta { color: var(--magenta); filter: drop-shadow(0 0 8px var(--magenta)); }
.card-icon-green   { color: var(--green);   filter: drop-shadow(0 0 8px var(--green)); }

.creature-icon {
    width: 100%;
    height: 100%;
}

.lantern-glow {
    animation: lantern-pulse 2s ease-in-out infinite;
}

@keyframes lantern-pulse {
    0%, 100% { opacity: 1; filter: none; }
    50% { opacity: 0.6; filter: brightness(1.5); }
}

.card-title {
    font-family: 'Oswald', sans-serif;
    font-size: 22px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--cyan);
    margin-bottom: 14px;
    line-height: 1.2;
}

.card-title-magenta { color: var(--magenta); }
.card-title-green   { color: var(--green); }

.card-body {
    font-size: 15px;
    line-height: 1.75;
    color: var(--body-text);
    margin-bottom: 20px;
}

.card-meta {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--meta);
}

/* ─── Twilight Zone / Blob Section ──────────────────────────── */
.twilight-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 5%;
}

.twilight-title {
    font-size: 52px;
    margin-bottom: 0;
}

.blob-container {
    position: relative;
    width: 100%;
}

.morphing-blob-wrapper {
    position: relative;
    width: 70vw;
    max-width: 600px;
    margin: -20px auto 0;
}

.morphing-blob-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    animation: morph-blob 8s ease-in-out infinite;
}

@keyframes morph-blob {
    0%, 100% {
        d: path("M250,80 C320,80 390,130 410,200 C430,270 400,350 340,390 C280,430 200,420 150,380 C100,340 80,270 100,200 C120,130 180,80 250,80Z");
    }
    25% {
        d: path("M250,70 C330,65 400,120 420,195 C440,270 410,360 345,398 C280,436 195,425 142,382 C90,340 75,265 98,195 C122,126 170,75 250,70Z");
    }
    50% {
        d: path("M250,85 C315,88 388,138 405,208 C422,278 388,352 325,388 C262,424 190,415 142,374 C95,332 82,260 105,192 C128,125 185,82 250,85Z");
    }
    75% {
        d: path("M250,75 C328,72 398,128 418,202 C438,276 402,355 338,394 C274,433 195,422 146,380 C96,338 78,268 102,196 C126,124 172,78 250,75Z");
    }
}

.blob-content {
    position: relative;
    z-index: 1;
    padding: 60px 40px 80px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stream-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
    max-width: 360px;
}

.stream-thumb {
    position: relative;
    background: rgba(4, 3, 10, 0.7);
    border-radius: 8px;
    padding: 16px;
    overflow: hidden;
    border: 1px solid rgba(0,255,255,0.15);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.stream-thumb:hover {
    border-color: rgba(0,255,255,0.5);
    box-shadow: 0 0 20px rgba(0,255,255,0.1);
}

.thumb-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    border-radius: 8px 8px 50% 50%;
    opacity: 0.25;
}

.thumb-cyan    { background: radial-gradient(ellipse at 50% 0%, #00ffff, transparent); }
.thumb-magenta { background: radial-gradient(ellipse at 50% 0%, #ff00cc, transparent); }
.thumb-violet  { background: radial-gradient(ellipse at 50% 0%, #7b00ff, transparent); }
.thumb-green   { background: radial-gradient(ellipse at 50% 0%, #00ff88, transparent); }

.thumb-label {
    font-family: 'Oswald', sans-serif;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--magenta);
    position: relative;
    z-index: 1;
    margin-bottom: 6px;
}

.thumb-title {
    font-size: 12px;
    line-height: 1.4;
    color: var(--body-text);
    position: relative;
    z-index: 1;
}

/* Micro-blobs floating */
.micro-blob {
    position: absolute;
    border-radius: 60% 40% 52% 48% / 44% 58% 42% 56%;
    animation: micro-drift 6s ease-in-out infinite;
    pointer-events: none;
}

.mb-1 {
    width: 50px; height: 50px;
    background: radial-gradient(ellipse, rgba(0,255,255,0.4), transparent 70%);
    top: 5%; right: 15%;
    animation-delay: 0s;
    animation-duration: 7s;
}
.mb-2 {
    width: 40px; height: 40px;
    background: radial-gradient(ellipse, rgba(255,0,204,0.4), transparent 70%);
    bottom: 20%; left: 5%;
    animation-delay: 1.5s;
    animation-duration: 9s;
}
.mb-3 {
    width: 60px; height: 60px;
    background: radial-gradient(ellipse, rgba(123,0,255,0.35), transparent 70%);
    top: 40%; right: 5%;
    animation-delay: 3s;
    animation-duration: 8s;
}
.mb-4 {
    width: 45px; height: 45px;
    background: radial-gradient(ellipse, rgba(0,255,136,0.35), transparent 70%);
    bottom: 10%; right: 25%;
    animation-delay: 0.8s;
    animation-duration: 10s;
}

@keyframes micro-drift {
    0%, 100% {
        transform: translate(0, 0);
        border-radius: 60% 40% 52% 48% / 44% 58% 42% 56%;
    }
    33% {
        transform: translate(10px, -15px);
        border-radius: 40% 60% 44% 56% / 58% 42% 56% 40%;
    }
    66% {
        transform: translate(-8px, 10px);
        border-radius: 52% 48% 60% 38% / 40% 56% 44% 60%;
    }
}

/* ─── Midnight Zone / Timeline ──────────────────────────────── */
.midnight-content {
    padding-left: 5%;
}

.section-title.midnight-title {
    margin-bottom: 32px;
}

.timeline-wrapper {
    width: 90vw;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.timeline-svg {
    width: 100%;
    height: 120px;
    overflow: visible;
}

.tl-node {
    cursor: pointer;
    transition: r 0.2s ease, filter 0.2s ease;
}

.tl-node:hover {
    filter: url(#glow-filter) brightness(1.5);
}

.active-node {
    r: 12;
    animation: node-pulse 2s ease-in-out infinite;
}

@keyframes node-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tl-label {
    font-family: 'Oswald', sans-serif;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    fill: var(--meta);
}

.tl-label-active {
    fill: var(--cyan);
    filter: url(#glow-filter);
}

.tl-sublabel {
    font-family: 'Libre Baskerville', serif;
    font-size: 8px;
    fill: rgba(200,214,232,0.5);
}

.midnight-caption {
    margin-top: 24px;
    font-size: 14px;
    color: var(--meta);
    font-style: italic;
    text-align: center;
}

/* ─── Hadal Zone ────────────────────────────────────────────── */
.hadal-content {
    display: flex;
    flex-direction: column;
    gap: 48px;
    max-width: 900px;
    margin-left: auto;
    margin-right: 5%;
    padding-right: 0;
}

.hadal-invert-block {
    background: var(--magenta);
    padding: 40px 48px;
    display: inline-block;
    position: relative;
}

.hadal-invert-block .section-label::before {
    background: #04030a;
    box-shadow: none;
}

.hadal-invert-block .label-text {
    color: #04030a;
}

.hadal-title {
    font-family: 'Libre Baskerville', serif;
    font-size: 52px;
    font-weight: 700;
    color: #04030a;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hadal-body {
    font-size: 16px;
    color: rgba(4,3,10,0.8);
    max-width: 480px;
    margin-bottom: 24px;
    line-height: 1.75;
}

.hadal-divider {
    width: 60px;
    height: 2px;
    background: #04030a;
}

.hadal-community {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.community-grid {
    display: flex;
    gap: 48px;
}

.community-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.community-stat {
    font-family: 'Libre Baskerville', serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--cyan);
    text-shadow: var(--glow-cyan);
    line-height: 1;
}

.community-label {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--meta);
}

.hadal-cta-group {
    display: flex;
    gap: 20px;
    align-items: center;
}

.hadal-cta {
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 14px 32px;
    border-radius: 2px;
    transition: all 0.2s ease;
    display: inline-block;
}

.primary-cta {
    background: var(--cyan);
    color: #04030a;
    box-shadow: var(--glow-cyan);
}

.primary-cta:hover {
    background: #04030a;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    box-shadow: var(--glow-cyan);
}

.secondary-cta {
    color: var(--magenta);
    border: 1px solid var(--magenta);
}

.secondary-cta:hover {
    background: var(--magenta);
    color: #04030a;
    box-shadow: var(--glow-magenta);
}

.hadal-wordmark {
    font-family: 'Libre Baskerville', serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(123, 143, 161, 0.3);
    letter-spacing: 0.08em;
    font-style: italic;
}

/* ─── Particle Burst (section-entry spawned via JS) ─────────── */
.particle-burst {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    animation: burst-out 600ms ease-out forwards;
}

@keyframes burst-out {
    0%   { opacity: 1; transform: scale(0) translate(var(--dx), var(--dy)); }
    100% { opacity: 0; transform: scale(1) translate(calc(var(--dx) * 6), calc(var(--dy) * 6 - 40px)); }
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero-title { font-size: 52px; }
    .section-title { font-size: 38px; }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .card-left, .card-center, .card-right { margin-top: 0; }

    .navbar { padding: 14px 24px; }

    .zone-content { padding: 0 24px; }

    .morphing-blob-wrapper { width: 90vw; }

    .hadal-content { margin-right: 24px; }
    .hadal-invert-block { padding: 24px; }
    .hadal-title { font-size: 32px; }

    .community-grid { gap: 24px; flex-wrap: wrap; }
    .community-stat { font-size: 36px; }

    .hadal-cta-group { flex-direction: column; align-items: flex-start; }

    .timeline-wrapper { width: 100%; }
}

@media (max-width: 600px) {
    .hero-title { font-size: 36px; letter-spacing: 0.04em; }
    .hero-tagline { font-size: 13px; }

    .navbar-links { display: none; }
}
