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

html {
    scroll-behavior: smooth;
    background: #0d1117;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    color: #e8ddd0;
    background: linear-gradient(180deg, #0d1117 0%, #141b24 30%, #1a2636 60%, #2a3f5f 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* === Birch Grain Texture (CSS noise) === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        repeating-linear-gradient(17deg, rgba(232,221,208,0.02) 0px, transparent 1px, transparent 3px),
        repeating-linear-gradient(97deg, rgba(232,221,208,0.015) 0px, transparent 1px, transparent 5px),
        repeating-linear-gradient(153deg, rgba(232,221,208,0.01) 0px, transparent 1px, transparent 4px),
        repeating-linear-gradient(47deg, rgba(232,221,208,0.02) 0px, transparent 1px, transparent 6px),
        repeating-linear-gradient(200deg, rgba(232,221,208,0.015) 0px, transparent 1px, transparent 3px),
        repeating-linear-gradient(73deg, rgba(232,221,208,0.01) 0px, transparent 1px, transparent 7px);
}

/* === Root Network SVG === */
.root-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
}

/* === Leaf Fragments === */
.leaf {
    position: fixed;
    border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
    pointer-events: none;
    z-index: 1;
}
.leaf-1 { width: 18px; height: 14px; background: rgba(200,162,200,0.06); top: 12%; left: 8%; }
.leaf-2 { width: 14px; height: 12px; background: rgba(91,138,114,0.07); top: 25%; left: 82%; }
.leaf-3 { width: 22px; height: 16px; background: rgba(212,165,116,0.05); top: 38%; left: 15%; }
.leaf-4 { width: 12px; height: 10px; background: rgba(200,162,200,0.04); top: 45%; left: 90%; }
.leaf-5 { width: 20px; height: 15px; background: rgba(91,138,114,0.06); top: 55%; left: 5%; }
.leaf-6 { width: 16px; height: 13px; background: rgba(212,165,116,0.07); top: 62%; left: 78%; }
.leaf-7 { width: 24px; height: 18px; background: rgba(200,162,200,0.05); top: 72%; left: 22%; }
.leaf-8 { width: 13px; height: 11px; background: rgba(91,138,114,0.08); top: 80%; left: 88%; }
.leaf-9 { width: 17px; height: 14px; background: rgba(212,165,116,0.04); top: 18%; left: 55%; }
.leaf-10 { width: 15px; height: 12px; background: rgba(200,162,200,0.06); top: 90%; left: 42%; }

/* === Reveal Animation === */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Stream Line === */
.stream-line {
    height: 1px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent 0%, #c8a2c8 50%, transparent 100%);
    background-size: 50% 100%;
    animation: streamPulse 4s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(200,162,200,0.4), 0 0 24px rgba(200,162,200,0.15);
    position: relative;
    z-index: 2;
}
.stream-line-1 { width: 20%; }
.stream-line-2 { width: 40%; }
.stream-line-3 { width: 60%; }
.stream-line-4 { width: 80%; }
.stream-line-5 { width: 95%; }
.stream-line-6 { width: 100%; }

@keyframes streamPulse {
    0% { background-position: -100% 0; }
    100% { background-position: 200% 0; }
}

/* === Section: The Source === */
.source {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.neon-ring {
    position: absolute;
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    filter: drop-shadow(0 0 20px rgba(200,162,200,0.4));
    animation: ringRotate 60s linear infinite, ringPulse 4s ease-in-out infinite;
    z-index: 0;
}

@keyframes ringRotate {
    0% { transform: translate(-50%, -55%) rotate(0deg); }
    100% { transform: translate(-50%, -55%) rotate(360deg); }
}

@keyframes ringPulse {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(200,162,200,0.2)); }
    50% { filter: drop-shadow(0 0 30px rgba(200,162,200,0.6)); }
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 10vw, 9rem);
    letter-spacing: 0.06em;
    text-transform: lowercase;
    color: #e8ddd0;
    text-shadow: 0 0 10px rgba(200,162,200,0.3), 0 0 30px rgba(200,162,200,0.15), 0 0 60px rgba(200,162,200,0.05);
    position: relative;
    z-index: 1;
    margin-bottom: 3rem;
}

.source .stream-line {
    position: absolute;
    bottom: 15%;
}

/* === Section: The Current === */
.current {
    position: relative;
    z-index: 2;
    padding: 8vh 2rem;
}

.current > .stream-line {
    margin-bottom: 8vh;
}
.current > .stream-line:last-child {
    margin-top: 8vh;
    margin-bottom: 0;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background: rgba(200,162,200,0.12);
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

.panel {
    background: #141b24;
    padding: 3.2rem;
    min-height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2rem;
}

.panel-label {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c8a2c8;
}

.panel-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3.5vw, 2.8rem);
    letter-spacing: 0.03em;
    line-height: 1.25;
    color: #e8ddd0;
}

.panel-body {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.6vw, 1.15rem);
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: rgba(232,221,208,0.8);
    max-width: 65ch;
}

/* === Confidence Bars === */
.confidence-bar {
    height: 4px;
    width: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #5b8a72, #d4a574);
    opacity: 0.7;
}
.confidence-bar-alt {
    background: linear-gradient(90deg, #c8a2c8, #5b8a72);
}
.confidence-bar-warm {
    background: linear-gradient(90deg, #d4a574, #c8a2c8);
}

/* === Sine Waves === */
.sine-wave {
    width: 100%;
    height: 60px;
    overflow: visible;
}
.sine-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: sineFlow 3s linear infinite;
}
@keyframes sineFlow {
    0% { stroke-dashoffset: 600; }
    100% { stroke-dashoffset: 0; }
}

/* === Section: The Confluence === */
.confluence {
    position: relative;
    z-index: 2;
    padding: 8vh 2rem;
    min-height: 60vh;
}

.confluence-columns {
    display: flex;
    gap: 1px;
    max-width: 1400px;
    margin: 8vh auto;
    background: rgba(200,162,200,0.08);
}

.confluence-col {
    flex: 1;
    padding: 3.2rem;
    background: #141b24;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.confluence-col-lilac {
    border-top: 2px solid rgba(200,162,200,0.3);
}
.confluence-col-sage {
    border-top: 2px solid rgba(91,138,114,0.3);
}
.confluence-col-amber {
    border-top: 2px solid rgba(212,165,116,0.3);
}

.confluence-heading {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: 0.03em;
    line-height: 1.25;
    color: #e8ddd0;
}

.confluence-merge {
    max-width: 800px;
    margin: 8vh auto;
    text-align: center;
    padding: 3.2rem;
    background: linear-gradient(135deg, rgba(200,162,200,0.05), rgba(91,138,114,0.05), rgba(212,165,116,0.05));
    animation: confluenceShift 20s ease infinite;
    background-size: 300% 300%;
}

@keyframes confluenceShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.merge-text {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    line-height: 1.6;
    color: #f0e6d3;
}

/* === Section: The Delta === */
.delta {
    position: relative;
    z-index: 2;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #c8a2c8, #5b8a72, #d4a574, #2a3f5f);
    background-size: 400% 400%;
    animation: auroraShift 30s ease infinite;
}

@keyframes auroraShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.delta-content {
    max-width: 900px;
    text-align: center;
}

.delta-statement {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.03em;
    line-height: 1.3;
    color: #0d1117;
    text-shadow: 0 0 40px rgba(13,17,23,0.3);
}

.delta .stream-line {
    position: absolute;
    bottom: 10%;
    box-shadow: 0 0 8px rgba(13,17,23,0.4), 0 0 24px rgba(13,17,23,0.15);
}

/* === Responsive: Tablet === */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .panel {
        grid-column: span 1 !important;
    }
    .confluence-columns {
        flex-direction: column;
    }
    .neon-ring {
        width: 120px;
        height: 120px;
    }
    .stream-line-1, .stream-line-2, .stream-line-3,
    .stream-line-4, .stream-line-5 {
        width: 90%;
    }
}

/* === Responsive: Mobile === */
@media (max-width: 480px) {
    body {
        padding: 0 1.5rem;
    }
    .panel {
        padding: 2rem;
    }
    .root-network {
        display: none;
    }
    .current, .confluence {
        padding: 4vh 0;
    }
}
