/* ============================================
   xbom.wiki - Earth-Dopamine Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-loam: #2C2416;
    --burnt-sienna: #C4652E;
    --saffron-glow: #E8A838;
    --pale-clay: #F0E4D0;
    --moss-verdant: #5B7C4F;
    --warm-chalk: #F5EDE0;
    --espresso: #3A2E21;
    --sky-wash: #7BAFCB;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--warm-chalk);
    background-color: var(--deep-loam);
    overflow-x: hidden;
}

/* --- Vertical Navigation --- */
#section-nav {
    position: fixed;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--warm-chalk) 20%, var(--warm-chalk) 80%, transparent);
    opacity: 0.25;
}

.nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--warm-chalk);
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: all 0.4s ease-out;
    opacity: 0.5;
    padding: 0;
}

.nav-dot.active {
    width: 12px;
    height: 12px;
    background: var(--saffron-glow);
    opacity: 1;
    box-shadow: 0 0 12px rgba(232, 168, 56, 0.4);
}

.nav-dot:hover {
    background: var(--saffron-glow);
    opacity: 0.8;
    transform: scale(1.3);
}

/* --- Parallax Sections --- */
.parallax-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8vh 10vw;
    overflow: hidden;
    margin-bottom: -12vh;
}

.parallax-section:last-child {
    margin-bottom: 0;
}

/* Section backgrounds with gradient overlays */
.section-surface {
    background: linear-gradient(135deg, var(--deep-loam) 0%, #3D2F1E 100%);
}

.section-topsoil {
    background: linear-gradient(135deg, #3D2F1E 0%, var(--deep-loam) 50%, #2A1F14 100%);
}

.section-subsoil {
    background: linear-gradient(135deg, #2A1F14 0%, var(--deep-loam) 50%, #352A1C 100%);
}

.section-bedrock {
    background: linear-gradient(135deg, var(--deep-loam) 0%, #1E1A10 50%, #2C2416 100%);
}

.section-mantle {
    background: linear-gradient(135deg, #1E1A10 0%, var(--deep-loam) 50%, #352A1C 100%);
}

.section-core {
    background: linear-gradient(135deg, #352A1C 0%, var(--deep-loam) 50%, #1E1A10 100%);
}

/* --- Section Background (Topo Lines) --- */
.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.topo-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.topo-path {
    fill: none;
    stroke: var(--warm-chalk);
    stroke-width: 0.8;
    opacity: 0.08;
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    transition: stroke-dashoffset 2s ease-out;
}

.parallax-section.visible .topo-path {
    stroke-dashoffset: 0;
}

/* --- Morph Blobs --- */
.morph-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    opacity: 0.12;
    z-index: 2;
    will-change: clip-path;
    animation: morph-cycle 10s ease-in-out infinite;
}

.blob-1 {
    top: 10%;
    right: 8%;
    background: var(--burnt-sienna);
    clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 95% 65%, 75% 90%, 50% 100%, 25% 90%, 5% 65%, 0% 35%, 20% 10%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: 5%;
    right: 15%;
    background: var(--saffron-glow);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    animation-delay: -2s;
    width: 350px;
    height: 350px;
}

.blob-3 {
    top: 15%;
    right: 5%;
    background: var(--moss-verdant);
    clip-path: polygon(50% 0%, 83% 12%, 100% 43%, 94% 78%, 68% 100%, 32% 100%, 6% 78%, 0% 43%, 17% 12%);
    animation-delay: -4s;
    width: 320px;
    height: 320px;
}

.blob-4 {
    bottom: 10%;
    left: 60%;
    background: var(--burnt-sienna);
    clip-path: polygon(50% 5%, 85% 15%, 100% 50%, 85% 85%, 50% 95%, 15% 85%, 0% 50%, 15% 15%);
    animation-delay: -6s;
    width: 380px;
    height: 380px;
}

.blob-5 {
    top: 20%;
    right: 10%;
    background: var(--sky-wash);
    clip-path: polygon(40% 0%, 75% 5%, 100% 40%, 90% 80%, 55% 100%, 20% 90%, 0% 55%, 10% 15%);
    animation-delay: -3s;
    width: 360px;
    height: 360px;
}

.blob-6 {
    bottom: 15%;
    right: 20%;
    background: var(--saffron-glow);
    clip-path: polygon(50% 0%, 90% 20%, 100% 60%, 75% 100%, 25% 100%, 0% 60%, 10% 20%);
    animation-delay: -5s;
    width: 340px;
    height: 340px;
}

@keyframes morph-cycle {
    0% {
        clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 95% 65%, 75% 90%, 50% 100%, 25% 90%, 5% 65%, 0% 35%, 20% 10%);
        transform: scale(0.95) rotate(0deg);
    }
    25% {
        clip-path: polygon(45% 5%, 85% 15%, 95% 40%, 100% 70%, 80% 95%, 45% 100%, 20% 85%, 0% 60%, 5% 30%, 25% 5%);
        transform: scale(1.02) rotate(2deg);
    }
    50% {
        clip-path: polygon(55% 0%, 78% 8%, 100% 42%, 90% 72%, 70% 95%, 50% 100%, 30% 88%, 8% 62%, 2% 38%, 22% 8%);
        transform: scale(1.05) rotate(-1deg);
    }
    75% {
        clip-path: polygon(48% 3%, 82% 12%, 98% 38%, 92% 68%, 72% 92%, 48% 98%, 28% 92%, 2% 68%, 5% 32%, 18% 12%);
        transform: scale(0.98) rotate(3deg);
    }
    100% {
        clip-path: polygon(50% 0%, 80% 10%, 100% 35%, 95% 65%, 75% 90%, 50% 100%, 25% 90%, 5% 65%, 0% 35%, 20% 10%);
        transform: scale(0.95) rotate(0deg);
    }
}

/* --- Section Content --- */
.section-content {
    position: relative;
    z-index: 10;
    max-width: 60%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.parallax-section.visible .section-content {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.parallax-section.visible .section-content > *:nth-child(1) { transition-delay: 0ms; }
.parallax-section.visible .section-content > *:nth-child(2) { transition-delay: 80ms; }
.parallax-section.visible .section-content > *:nth-child(3) { transition-delay: 160ms; }
.parallax-section.visible .section-content > *:nth-child(4) { transition-delay: 240ms; }
.parallax-section.visible .section-content > *:nth-child(5) { transition-delay: 320ms; }

.section-content > * {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.parallax-section.visible .section-content > * {
    opacity: 1;
    transform: translateY(0);
}

/* --- Hero Content --- */
.hero-content {
    max-width: 70%;
}

.hero-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2.5rem, 7vw, 6rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--warm-chalk);
    margin-bottom: 1.5rem;
}

.accent {
    color: var(--saffron-glow);
}

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--pale-clay);
    opacity: 0.85;
    line-height: 1.6;
    max-width: 500px;
}

/* --- Section Titles --- */
.section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--warm-chalk);
    margin-bottom: 2rem;
}

/* --- Content Blocks --- */
.content-block {
    max-width: 540px;
}

.content-block p {
    color: var(--pale-clay);
    margin-bottom: 1.25rem;
    opacity: 0.9;
}

/* --- Annotations (Caveat handwritten) --- */
.annotation {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--saffron-glow);
    opacity: 0.7;
    display: block;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.annotation-right {
    position: absolute;
    right: -15vw;
    top: 50%;
    transform: rotate(-90deg) translateX(-50%);
    transform-origin: center;
    white-space: nowrap;
}

.annotation-float {
    position: absolute;
    right: -8vw;
    bottom: 10%;
    transform: rotate(3deg);
}

/* --- Feature Grid --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.feature-item {
    padding: 1.5rem;
    border: 1px solid rgba(245, 237, 224, 0.1);
    border-radius: 12px;
    background: rgba(44, 36, 22, 0.5);
    backdrop-filter: blur(4px);
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.feature-item:hover {
    border-color: var(--saffron-glow);
    transform: translateY(-4px);
}

.feature-icon {
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    color: var(--warm-chalk);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.feature-item p {
    font-size: 0.95rem;
    color: var(--pale-clay);
    opacity: 0.8;
    line-height: 1.6;
}

/* --- Deep Quote --- */
.deep-quote {
    position: relative;
    padding: 2rem 0 2rem 2rem;
    margin: 2rem 0;
    border-left: 2px solid var(--burnt-sienna);
    font-family: 'DM Sans', sans-serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--pale-clay);
    line-height: 1.7;
}

.quote-mark {
    font-family: 'Caveat', cursive;
    font-size: 3rem;
    color: var(--burnt-sienna);
    position: absolute;
    left: -0.5rem;
    top: 0.5rem;
    line-height: 1;
}

.quote-attribution {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--saffron-glow);
    font-family: 'Caveat', cursive;
}

/* --- Stats --- */
.stats-organic {
    display: flex;
    gap: 3rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: var(--saffron-glow);
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-family: 'Caveat', cursive;
    font-size: 1.1rem;
    color: var(--pale-clay);
    opacity: 0.7;
    margin-top: 0.3rem;
}

/* --- Core Section (CTA) --- */
.core-content {
    text-align: left;
    max-width: 55%;
}

.core-text {
    font-size: 1.25rem;
    color: var(--pale-clay);
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 480px;
}

.explore-btn {
    display: inline-block;
    position: relative;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: var(--deep-loam);
    background: var(--saffron-glow);
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 0.02em;
}

.explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(232, 168, 56, 0.35);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.explore-btn:hover .btn-glow {
    width: 300px;
    height: 300px;
}

/* --- Depth Indicator --- */
.depth-indicator {
    position: absolute;
    bottom: 3vh;
    right: 5vw;
    z-index: 10;
}

.depth-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--warm-chalk);
    opacity: 0.35;
    letter-spacing: 0.05em;
}

/* --- Floating Decorative Elements --- */
#floating-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    will-change: transform;
}

.floating-shape.circle {
    border-radius: 50%;
}

.floating-shape.rounded-rect {
    border-radius: 8px;
}

.floating-shape.triangle {
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .parallax-section {
        padding: 6vh 6vw;
        padding-left: 50px;
    }

    #section-nav {
        left: 12px;
        gap: 16px;
    }

    .section-content {
        max-width: 100%;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .annotation-right,
    .annotation-float {
        position: relative;
        right: auto;
        bottom: auto;
        top: auto;
        transform: none;
        margin-top: 1rem;
    }

    .stats-organic {
        gap: 2rem;
    }

    .morph-blob {
        width: 200px;
        height: 200px;
    }

    .core-content {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .parallax-section {
        padding: 4vh 5vw;
        padding-left: 44px;
    }

    .stats-organic {
        flex-direction: column;
        gap: 1.5rem;
    }
}
