/* ========================================
   nlbd.dev — Deep Ocean Descent
   ======================================== */

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

:root {
    --deep-ocean: #0a1628;
    --abyss: #040e1a;
    --hadal: #020810;
    --surface-bottom: #061220;
    --cyan: #4abdd6;
    --ice-text: #e0f4f8;
    --ocean-body: #8fb8cc;
    --light-mist: #c5dde7;
    --grid-line: #1a3a5c;
    --node-border: #0d2847;
    --signal-pulse: #2a9d8f;
    --deep-coral: #e76f6f;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-ocean);
    color: var(--ocean-body);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    line-height: 1.75;
    overflow-x: hidden;
    min-height: 800vh;
}

/* ========================================
   Generative Canvas (full page background)
   ======================================== */

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

/* ========================================
   Depth Indicator
   ======================================== */

#depth-indicator {
    position: fixed;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#depth-track {
    width: 2px;
    height: 120px;
    background: var(--node-border);
    border-radius: 1px;
    position: relative;
}

#depth-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--cyan);
    border-radius: 1px;
    transition: height 0.1s linear;
}

#depth-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 0.875rem);
    color: var(--cyan);
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}

/* ========================================
   Hero / Surface Zone
   ======================================== */

#surface {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

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

.hero-wordmark {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(6rem, 25vw, 20rem);
    color: var(--ice-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.hero-tagline {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--ocean-body);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.scroll-chevron {
    margin-top: 3rem;
    animation: pulse-chevron 3s ease-in-out infinite;
}

@keyframes pulse-chevron {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* ========================================
   Timeline Spine
   ======================================== */

#timeline-spine {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: var(--grid-line);
    z-index: 1;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s;
}

body.scrolled #timeline-spine {
    opacity: 1;
}

#spine-pulse {
    position: absolute;
    left: -1px;
    top: 0;
    width: 3px;
    height: 40px;
    background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
    border-radius: 2px;
    animation: spine-travel 4s linear infinite;
}

@keyframes spine-travel {
    0% { top: -40px; }
    100% { top: 100vh; }
}

/* ========================================
   Depth Zones — Background Transitions
   ======================================== */

.depth-zone {
    position: relative;
    z-index: 1;
}

.zone-photic {
    min-height: 200vh;
    padding: 10vh 0;
}

.zone-twilight {
    min-height: 200vh;
    padding: 10vh 0;
}

.zone-abyss {
    min-height: 200vh;
    padding: 10vh 0;
}

.zone-hadal {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: relative;
}

/* ========================================
   Grid Lines Overlay
   ======================================== */

.grid-lines-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 59px,
        rgba(26, 58, 92, 0.15) 59px,
        rgba(26, 58, 92, 0.15) 60px
    );
}

.grid-lines-overlay.dashed {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 59px,
        transparent 60px
    );
    background-size: 100% 60px;
    border: none;
}

.grid-lines-overlay.dashed::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        to right,
        rgba(26, 58, 92, 0.12) 0px,
        rgba(26, 58, 92, 0.12) 4px,
        transparent 4px,
        transparent 12px
    );
    background-size: 12px 1px;
    background-repeat: repeat;
    mask-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 59px,
        black 59px,
        black 60px
    );
    -webkit-mask-image: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 59px,
        black 59px,
        black 60px
    );
}

.grid-lines-overlay.dotted::before {
    background-image: repeating-linear-gradient(
        to right,
        rgba(26, 58, 92, 0.08) 0px,
        rgba(26, 58, 92, 0.08) 1px,
        transparent 1px,
        transparent 13px
    );
    background-size: 13px 1px;
}

/* ========================================
   Timeline Nodes
   ======================================== */

.timeline-node {
    position: relative;
    width: 50%;
    padding: 4vh 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.timeline-node.visible {
    opacity: 1;
    transform: translateY(0);
}

.node-left {
    margin-left: 0;
    padding-right: 5%;
    text-align: right;
}

.node-right {
    margin-left: 50%;
    padding-left: 5%;
    text-align: left;
}

.node-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    border: 2px solid var(--node-border);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.node-left .node-dot {
    right: -3px;
}

.node-right .node-dot {
    left: -3px;
}

.node-connector {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: var(--grid-line);
    transform: translateY(-50%);
}

.node-left .node-connector {
    right: 0;
}

.node-right .node-connector {
    left: 0;
}

/* ========================================
   Node Content Blocks
   ======================================== */

.node-content {
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--node-border);
    box-shadow: inset 0 0 30px rgba(74, 189, 214, 0.03);
    padding: 2.5rem 3rem;
    max-width: 600px;
    display: inline-block;
    text-align: left;
}

.node-content.glow {
    border-color: rgba(74, 189, 214, 0.15);
    box-shadow: inset 0 0 40px rgba(74, 189, 214, 0.06), 0 0 20px rgba(74, 189, 214, 0.04);
}

.node-left .node-content {
    margin-left: auto;
}

.node-content h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--ice-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.node-content p {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: var(--ocean-body);
    line-height: 1.75;
    max-width: 38em;
    margin-bottom: 1rem;
}

.node-content p:last-child {
    margin-bottom: 0;
}

.node-content p.emphasized {
    color: var(--light-mist);
    font-weight: 600;
}

.node-content .term {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1.2vw, 0.875rem);
    color: var(--cyan);
    letter-spacing: 0.05em;
}

/* ========================================
   Animation Containers
   ======================================== */

.animation-container canvas {
    display: block;
    margin: 1rem auto;
    max-width: min(400px, 80vw);
    max-height: min(400px, 80vw);
    width: 100%;
    height: auto;
}

/* ========================================
   Hadal Zone
   ======================================== */

#hadal-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hadal-statement {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hadal-statement h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2rem, 6vw, 5rem);
    color: var(--ice-text);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.3;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}

.hadal-statement.visible h2 {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Abstract Background Shapes
   ======================================== */

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

.abstract-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--node-border);
    opacity: 0.08;
    filter: blur(40px);
}

/* ========================================
   Responsive — Mobile
   ======================================== */

@media (max-width: 768px) {
    #timeline-spine {
        left: 2rem;
        transform: none;
    }

    .timeline-node {
        width: calc(100% - 4rem);
        margin-left: 3rem !important;
        padding-left: 1.5rem !important;
        padding-right: 1rem !important;
        text-align: left !important;
    }

    .node-dot {
        left: -3px !important;
        right: auto !important;
    }

    .node-connector {
        left: 0 !important;
        right: auto !important;
        width: 20px;
    }

    .node-left .node-content {
        margin-left: 0;
    }

    .node-content {
        padding: 1.5rem 2rem;
        max-width: 100%;
    }

    .animation-container canvas {
        max-width: min(300px, 90vw);
        max-height: min(300px, 90vw);
    }

    #depth-indicator {
        right: 0.5rem;
    }
}
