/* datatelomere.com - Y2K Bio-Futurism Design */
/* Colors: #f0ebe3 #c9a84c #1b4332 #5e8c61 #3d2b1f #0b1a0f #2d1b0e #7ecda0 */
/* Fonts: Anybody (display), Space Grotesk (body), Inter (UI) */

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #5e8c61 #0b1a0f;
}

body {
    background-color: #0b1a0f;
    color: #f0ebe3;
    font-family: 'Space Grotesk', sans-serif;
    display: grid;
    grid-template-columns: 18vw 1fr;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* CRT Scanline Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.05) 2px,
        rgba(0, 0, 0, 0.05) 4px
    );
    opacity: 0.4;
}

/* Particle Canvas */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
}

/* === ROOT SYSTEM (Left Sidebar) === */
.root-system {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, #0b1a0f 0%, #1b4332 30%, #2d1b0e 70%, #0b1a0f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-right: 1px solid rgba(126, 205, 160, 0.1);
    overflow: hidden;
}

.root-trunk {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.trunk-svg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 100%;
    opacity: 0.6;
}

.growth-rings {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3vh;
}

.ring {
    background: none;
    border: none;
    cursor: pointer;
    width: 48px;
    height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ring svg {
    width: 48px;
    height: 48px;
    transition: all 0.4s ease;
}

.ring:hover {
    transform: scale(1.3);
}

.ring:hover svg circle {
    stroke: #c9a84c;
}

.ring.active svg circle:last-child {
    fill: #c9a84c;
    r: 5;
}

.ring.active svg circle {
    stroke: #c9a84c;
}

.ring-label {
    position: absolute;
    left: calc(100% + 10px);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7ecda0;
    opacity: 0;
    transform: translateX(-8px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.ring:hover .ring-label,
.ring.active .ring-label {
    opacity: 1;
    transform: translateX(0);
}

.ring.active .ring-label {
    color: #c9a84c;
}

/* Sap Flow Indicator */
.sap-flow {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 0%;
    background: linear-gradient(180deg, transparent, #7ecda0, transparent);
    transform: translateX(-50%);
    z-index: 1;
    transition: height 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0.5;
}

/* === NARRATIVE STREAM (Main Content) === */
.narrative-stream {
    position: relative;
    z-index: 5;
}

.narrative-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6vh 8vw;
}

.section-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.15;
    z-index: 0;
}

.helix-bg {
    width: 100%;
    height: 100%;
}

.section-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    width: 100%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Section Header */
.section-header {
    margin-bottom: 4rem;
    position: relative;
}

.section-index {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #c9a84c;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    opacity: 0.7;
}

.section-title {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(3rem, 7vw, 8rem);
    font-variation-settings: 'wdth' 150;
    letter-spacing: 0.04em;
    line-height: 0.95;
    color: #1b4332;
    text-transform: uppercase;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, #7ecda0, transparent);
    margin-top: 1.5rem;
}

/* Section Body - F-Pattern */
.section-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.lead-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    font-weight: 300;
    line-height: 1.7;
    color: #f0ebe3;
    max-width: 65ch;
    opacity: 0.9;
}

.lead-text em {
    color: #7ecda0;
    font-style: italic;
}

.content-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.body-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.8;
    color: rgba(240, 235, 227, 0.75);
    letter-spacing: 0.01em;
}

/* Metric Clusters */
.metric-cluster {
    display: flex;
    gap: 3rem;
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(126, 205, 160, 0.15);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-value {
    font-family: 'Anybody', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-variation-settings: 'wdth' 130;
    font-weight: 700;
    color: #c9a84c;
    line-height: 1;
}

.metric-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(240, 235, 227, 0.5);
}

/* === SECTION SPECIFIC VISUALS === */

/* Creation - Data Stream */
.data-stream-visual {
    width: 100%;
}

.stream-svg {
    width: 100%;
    height: auto;
}

.flow-dot {
    filter: drop-shadow(0 0 6px #c9a84c);
}

.data-flow-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease;
}

.narrative-section.visible .data-flow-path {
    stroke-dashoffset: 0;
}

/* Protection - Shield */
.shield-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.shield-svg {
    width: 240px;
    height: 240px;
}

.shield-ring {
    transform-origin: center;
}

.shield-outer {
    animation: rotateRing 20s linear infinite;
}

.shield-mid {
    animation: rotateRing 15s linear infinite reverse;
}

.shield-inner {
    animation: pulseRing 3s ease-in-out infinite;
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes pulseRing {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Degradation - Erosion Bars */
.erosion-bars {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.erosion-bar {
    width: var(--bar-width);
    height: 28px;
    background: linear-gradient(90deg, #5e8c61, #7ecda0);
    border-radius: 2px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.erosion-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(11, 26, 15, 0.4));
}

.erosion-bar.critical {
    background: linear-gradient(90deg, #c9a84c, rgba(201, 168, 76, 0.4));
}

.erosion-bar span {
    font-family: 'Inter', sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0b1a0f;
    position: relative;
    z-index: 1;
}

/* Renewal - Growth Curve */
.renewal-visual {
    width: 100%;
}

.renewal-svg {
    width: 100%;
    height: auto;
}

.renewal-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.renewal-glow {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.narrative-section.visible .renewal-path,
.narrative-section.visible .renewal-glow {
    stroke-dashoffset: 0;
}

.renewal-dot {
    filter: drop-shadow(0 0 8px #c9a84c);
}

/* Permanence - Tree Rings */
.permanence-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tree-rings-svg {
    width: 260px;
    height: 260px;
    animation: slowRotate 60s linear infinite;
}

.tree-rings-svg circle {
    transform-origin: center;
}

@keyframes slowRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === SECTION BACKGROUNDS === */
#section-creation {
    background: radial-gradient(ellipse at 30% 50%, rgba(27, 67, 50, 0.3) 0%, #0b1a0f 70%);
}

#section-protection {
    background: radial-gradient(ellipse at 70% 40%, rgba(94, 140, 97, 0.2) 0%, #0b1a0f 70%);
}

#section-degradation {
    background: radial-gradient(ellipse at 50% 60%, rgba(61, 43, 31, 0.4) 0%, #0b1a0f 70%);
}

#section-renewal {
    background: radial-gradient(ellipse at 40% 40%, rgba(126, 205, 160, 0.15) 0%, #0b1a0f 70%);
}

#section-permanence {
    background: radial-gradient(ellipse at 50% 50%, rgba(201, 168, 76, 0.1) 0%, rgba(27, 67, 50, 0.2) 40%, #0b1a0f 70%);
}

/* === HELIX ANIMATION === */
.helix-strand {
    animation: helixRotate 8s linear infinite;
}

@keyframes helixRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    .root-system {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: auto;
        top: auto;
        border-right: none;
        border-top: 1px solid rgba(126, 205, 160, 0.15);
        background: rgba(11, 26, 15, 0.95);
        backdrop-filter: blur(10px);
        z-index: 100;
    }

    .root-trunk {
        flex-direction: row;
        padding: 0.75rem 1rem;
        height: auto;
    }

    .trunk-svg {
        display: none;
    }

    .growth-rings {
        flex-direction: row;
        gap: 1rem;
        width: 100%;
        justify-content: space-around;
    }

    .ring {
        width: 36px;
        height: 36px;
    }

    .ring svg {
        width: 36px;
        height: 36px;
    }

    .ring-label {
        display: none;
    }

    .sap-flow {
        display: none;
    }

    .narrative-section {
        padding: 4vh 5vw 12vh;
    }

    .content-block {
        grid-template-columns: 1fr;
    }

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

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0b1a0f;
}

::-webkit-scrollbar-thumb {
    background: #5e8c61;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7ecda0;
}

/* Selection */
::selection {
    background: rgba(126, 205, 160, 0.3);
    color: #f0ebe3;
}
