/* ============================================
   footprint.bar - Styles
   Maximalist Serenity / Neon-Electric Bioluminescence
   ============================================ */

/* --- Custom Properties --- */
:root {
    --bg-primary: #0A0A12;
    --bg-secondary: #12101E;
    --accent-green: #00FFB2;
    --accent-orchid: #FF6EC7;
    --accent-indigo: #7B68EE;
    --text-primary: #E0DDD4;
    --text-secondary: #8A8680;
    --convergence-white: #F0FFF0;
    --pure-white: #FFFFFF;
    --magma-orange: #FF4500;
    --breath-duration: 4s;
    --scroll-progress: 0;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    cursor: default;
}

/* --- SVG Defs (hidden) --- */
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Moss Texture Overlay --- */
#moss-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 45%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    filter: url(#mossTexture);
    background: var(--accent-green);
    opacity: 0.08;
}

/* --- Split-Screen Diptych --- */
#diptych {
    display: grid;
    grid-template-columns: 45fr 55fr;
    min-height: 100vh;
    position: relative;
}

/* --- Terrain Panel (Left) --- */
#terrain-panel {
    position: relative;
    background: var(--bg-primary);
    overflow: hidden;
    z-index: 1;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 45vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
}

#root-network {
    position: fixed;
    top: 0;
    left: 0;
    width: 45vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2;
    opacity: 0.2;
}

#root-network path {
    fill: none;
    stroke: var(--accent-green);
    stroke-width: 1;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 2s ease;
}

.biome-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 10vh 2rem;
}

.biome-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, var(--bg-secondary) 0%, var(--bg-primary) 70%);
    opacity: 0.6;
    z-index: 0;
}

/* Biome-specific background accents */
.biome-section[data-biome="forest"]::before {
    background: radial-gradient(ellipse at 30% 70%, rgba(0, 255, 178, 0.06) 0%, var(--bg-primary) 60%);
    opacity: 1;
}

.biome-section[data-biome="volcanic"]::before {
    background: radial-gradient(ellipse at 60% 40%, rgba(255, 69, 0, 0.08) 0%, var(--bg-primary) 60%);
    opacity: 1;
}

.biome-section[data-biome="coral"]::before {
    background: radial-gradient(ellipse at 40% 50%, rgba(123, 104, 238, 0.06) 0%, var(--bg-primary) 60%);
    opacity: 1;
}

.biome-section[data-biome="tundra"]::before {
    background: radial-gradient(ellipse at 50% 30%, rgba(224, 221, 212, 0.03) 0%, var(--bg-primary) 60%);
    opacity: 1;
}

.biome-section[data-biome="desert"]::before {
    background: radial-gradient(ellipse at 70% 60%, rgba(138, 134, 128, 0.06) 0%, var(--bg-primary) 60%);
    opacity: 1;
}

.biome-content {
    position: relative;
    z-index: 1;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.2s ease, transform 1.2s ease;
}

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

/* --- Terrain Typography --- */
.terrain-header {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 900;
    font-size: clamp(48px, 8vw, 144px);
    font-optical-sizing: auto;
    color: var(--accent-green);
    line-height: 0.92;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    animation: breathe var(--breath-duration) ease-in-out infinite;
}

.data-label {
    font-family: 'Lexend', sans-serif;
    font-weight: 300;
    font-size: clamp(11px, 1.2vw, 14px);
    color: var(--accent-indigo);
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.data-label:nth-child(even) {
    color: var(--accent-orchid);
}

/* --- Record Panel (Right) --- */
#record-panel {
    position: relative;
    background: var(--bg-primary);
    z-index: 4;
    min-height: 100vh;
}

#footprint-watermarks {
    position: fixed;
    top: 0;
    right: 0;
    width: 55vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.watermark-footprint {
    position: absolute;
    width: 60px;
    height: 100px;
    opacity: 0.03;
    fill: var(--accent-indigo);
}

.record-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10vh 3rem;
    position: relative;
}

.record-content {
    max-width: 38ch;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.4s ease, transform 1.4s ease;
}

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

.narrative-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.8vw, 22px);
    font-optical-sizing: auto;
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

/* --- Section Divider (footprint glyph) --- */
.section-divider {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.divider-footprint {
    width: 30px;
    height: 50px;
    fill: var(--accent-indigo);
    opacity: 0.15;
}

/* --- Convergence Moments --- */
.convergence-moment {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 5;
    background: var(--bg-primary);
    overflow: hidden;
}

.convergence-moment::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 255, 178, 0.04) 0%, transparent 70%);
}

.convergence-content {
    text-align: center;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 1.8s ease, transform 1.8s ease;
}

.convergence-content.visible {
    opacity: 1;
    transform: scale(1);
}

.convergence-text {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 100;
    font-size: clamp(40px, 10vw, 200px);
    font-optical-sizing: auto;
    color: #FFFFFF;
    line-height: 1.0;
    letter-spacing: -0.02em;
    text-shadow: 0 0 40px rgba(0, 255, 178, 0.3);
}

/* --- Ripple Effects --- */
.ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    pointer-events: none;
    z-index: 0;
}

.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border: 1px solid var(--accent-green);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0.4;
    animation: rippleExpand 6s ease-out infinite;
}

.ripple-delay-1 {
    animation-delay: 2s;
}

.ripple-delay-2 {
    animation-delay: 4s;
}

@keyframes rippleExpand {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* --- Progress Bar --- */
#progress-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--accent-green);
    z-index: 100;
    transition: width 0.1s linear;
}

/* --- Breathing Animation --- */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.92;
    }
}

@keyframes breatheSubtle {
    0%, 100% {
        opacity: 0.08;
    }
    50% {
        opacity: 0.12;
    }
}

/* --- Custom Cursor Footprint --- */
#cursor-footprint {
    position: fixed;
    width: 24px;
    height: 40px;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s ease;
    fill: var(--accent-green);
}

#cursor-footprint svg {
    width: 100%;
    height: 100%;
}

body.terrain-hover #cursor-footprint {
    opacity: 0.6;
}

body.terrain-hover {
    cursor: none;
}

/* --- Ghost Impressions --- */
#ghost-impressions {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 199;
}

.ghost-impression {
    position: absolute;
    width: 20px;
    height: 34px;
    fill: var(--accent-green);
    opacity: 0.3;
    transition: opacity 2s ease;
}

.ghost-impression.fading {
    opacity: 0;
}

/* --- Scroll-synced biome transitions --- */
.biome-section {
    transition: opacity 0.4s ease;
}

/* --- Convergence clip-path animation --- */
.convergence-moment.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* --- Responsive: Mobile (below 768px) --- */
@media (max-width: 767px) {
    #diptych {
        grid-template-columns: 1fr;
    }

    #terrain-panel {
        position: sticky;
        top: 0;
        height: 30vh;
        z-index: 10;
        overflow: hidden;
    }

    #particle-canvas {
        width: 100vw;
        height: 30vh;
    }

    #moss-overlay {
        width: 100%;
        height: 30vh;
    }

    #root-network {
        width: 100vw;
        height: 30vh;
    }

    .biome-section {
        min-height: 30vh;
        padding: 4vh 1.5rem;
    }

    .terrain-header {
        font-size: clamp(28px, 8vw, 60px);
    }

    #record-panel {
        z-index: 11;
    }

    #footprint-watermarks {
        width: 100vw;
    }

    .record-section {
        min-height: 80vh;
        padding: 6vh 1.5rem;
    }

    .convergence-text {
        font-size: clamp(28px, 10vw, 80px);
    }

    .convergence-moment {
        min-height: 60vh;
    }

    /* Progress bar moves to right-vertical on mobile */
    #progress-bar {
        bottom: auto;
        left: auto;
        right: 0;
        top: 0;
        width: 2px;
        height: 0%;
        transition: height 0.1s linear;
    }
}

/* --- Tablet adjustments --- */
@media (min-width: 768px) and (max-width: 1023px) {
    .terrain-header {
        font-size: clamp(36px, 6vw, 80px);
    }

    .convergence-text {
        font-size: clamp(36px, 8vw, 120px);
    }

    .narrative-text {
        font-size: clamp(16px, 2vw, 20px);
    }
}
