/* ======================================================
   digitaltelomere.com — Styles
   Generative Bioluminescence / Neon-Electric / Organic-Flow
   ====================================================== */

/* --- CSS Custom Properties --- */
:root {
    --void-black: #050508;
    --neon-magenta: #ff00aa;
    --electric-cyan: #00f0ff;
    --phosphor-green: #39ff14;
    --deep-ultraviolet: #1a0033;
    --signal-white: #e8eaed;
    --plasma-purple: #8b00ff;
    --carbon-gray: #1a1a22;

    --gradient-primary: linear-gradient(135deg, #ff00aa, #8b00ff, #00f0ff);
    --gradient-container: linear-gradient(180deg, rgba(0,240,255,0.08), rgba(255,0,170,0.04), transparent);
    --gradient-flow: radial-gradient(ellipse at 50% 50%, rgba(57,255,20,0.06) 0%, transparent 70%);
    --gradient-nav: radial-gradient(circle, rgba(26,0,51,0.95) 0%, rgba(5,5,8,0.98) 100%);

    --font-display: 'Unbounded', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--void-black);
    color: var(--signal-white);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    position: relative;
}

a {
    color: var(--electric-cyan);
    text-decoration: none;
}

/* --- Cellular Automata Background Canvas --- */
#automata-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    will-change: transform;
    opacity: 0.05;
}

/* --- Circuit Lines Overlay --- */
.circuit-lines-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* ======================================================
   HERO / NUCLEUS
   ====================================================== */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    overflow: hidden;
}

#telomere-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    padding-left: 61.8%;
    transform: translateX(-50%);
    pointer-events: none;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    line-height: 1.05;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transition: opacity 0.4s ease;
    min-height: 1.2em;
}

.hero-title.visible {
    opacity: 1;
}

.hero-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    color: var(--signal-white);
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* ======================================================
   FLOW ZONES
   ====================================================== */
.flow-zone {
    position: relative;
    height: 30vh;
    width: 100%;
    z-index: 2;
    overflow: hidden;
    background: var(--gradient-flow);
}

.flow-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.flow-path {
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: d 1s ease;
}

/* ======================================================
   CONTENT SECTIONS
   ====================================================== */
.content-section {
    position: relative;
    z-index: 3;
    padding: 6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    flex-direction: column;
    gap: 2rem;
}

.section-container {
    position: relative;
    max-width: 800px;
    width: 90%;
    padding: 3.5rem 3rem;
    background: var(--gradient-container);
    border: 1px solid rgba(26, 26, 34, 0.4);
    overflow: visible;
}

/* Amoeboid clip-path shapes for each section container */
.amoeba-shape-1 {
    clip-path: polygon(
        5% 2%, 15% 0%, 30% 1%, 50% 0%, 70% 2%, 85% 0%, 95% 3%,
        98% 15%, 100% 35%, 99% 55%, 100% 75%, 97% 90%,
        93% 98%, 80% 100%, 60% 99%, 40% 100%, 20% 98%, 8% 100%,
        2% 92%, 0% 70%, 1% 45%, 0% 20%, 3% 8%
    );
}

.amoeba-shape-2 {
    clip-path: polygon(
        3% 0%, 20% 2%, 40% 0%, 60% 1%, 80% 0%, 97% 2%,
        100% 12%, 98% 35%, 100% 55%, 99% 80%, 97% 95%,
        90% 100%, 70% 98%, 50% 100%, 30% 99%, 10% 100%,
        2% 95%, 0% 75%, 1% 50%, 0% 25%, 2% 10%
    );
}

.amoeba-shape-3 {
    clip-path: polygon(
        8% 1%, 25% 0%, 45% 2%, 65% 0%, 80% 1%, 92% 0%,
        100% 8%, 98% 30%, 100% 50%, 99% 70%, 97% 88%, 100% 97%,
        88% 100%, 65% 98%, 45% 100%, 25% 99%, 5% 100%,
        0% 90%, 2% 65%, 0% 40%, 1% 20%, 0% 5%
    );
}

.amoeba-shape-4 {
    clip-path: polygon(
        2% 3%, 18% 0%, 35% 2%, 55% 0%, 75% 1%, 95% 0%,
        100% 10%, 97% 30%, 100% 52%, 98% 75%, 100% 92%,
        92% 100%, 72% 97%, 48% 100%, 28% 98%, 8% 100%,
        0% 88%, 3% 60%, 0% 38%, 2% 15%
    );
}

.container-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    opacity: 0.05;
    z-index: -1;
    filter: blur(20px);
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--neon-magenta);
    margin-bottom: 1.5rem;
    position: relative;
}

.section-body {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    color: var(--signal-white);
    margin-bottom: 1.2rem;
}

.section-body sup {
    font-size: 0.7em;
    color: var(--electric-cyan);
}

/* --- Clip-path reveal animations --- */
.content-section {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.content-section.revealed {
    opacity: 1;
}

.section-1 .section-container {
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-1.revealed .section-container {
    clip-path: polygon(
        5% 2%, 15% 0%, 30% 1%, 50% 0%, 70% 2%, 85% 0%, 95% 3%,
        98% 15%, 100% 35%, 99% 55%, 100% 75%, 97% 90%,
        93% 98%, 80% 100%, 60% 99%, 40% 100%, 20% 98%, 8% 100%,
        2% 92%, 0% 70%, 1% 45%, 0% 20%, 3% 8%
    );
}

.section-2 .section-container {
    clip-path: inset(50% 0);
    transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-2.revealed .section-container {
    clip-path: polygon(
        3% 0%, 20% 2%, 40% 0%, 60% 1%, 80% 0%, 97% 2%,
        100% 12%, 98% 35%, 100% 55%, 99% 80%, 97% 95%,
        90% 100%, 70% 98%, 50% 100%, 30% 99%, 10% 100%,
        2% 95%, 0% 75%, 1% 50%, 0% 25%, 2% 10%
    );
}

.section-3 .section-container {
    clip-path: ellipse(0% 0% at 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-3.revealed .section-container {
    clip-path: polygon(
        8% 1%, 25% 0%, 45% 2%, 65% 0%, 80% 1%, 92% 0%,
        100% 8%, 98% 30%, 100% 50%, 99% 70%, 97% 88%, 100% 97%,
        88% 100%, 65% 98%, 45% 100%, 25% 99%, 5% 100%,
        0% 90%, 2% 65%, 0% 40%, 1% 20%, 0% 5%
    );
}

.section-4 .section-container {
    clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.section-4.revealed .section-container {
    clip-path: polygon(
        2% 3%, 18% 0%, 35% 2%, 55% 0%, 75% 1%, 95% 0%,
        100% 10%, 97% 30%, 100% 52%, 98% 75%, 100% 92%,
        92% 100%, 72% 97%, 48% 100%, 28% 98%, 8% 100%,
        0% 88%, 3% 60%, 0% 38%, 2% 15%
    );
}

/* ======================================================
   DATA ANNOTATIONS (Floating Gene Labels)
   ====================================================== */
.data-annotation {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.12em;
    color: var(--phosphor-green);
    opacity: 0.15;
    position: absolute;
    pointer-events: none;
    white-space: nowrap;
}

.annotation-float {
    animation: floatUp 12s linear infinite;
}

.section-container .data-annotation:nth-of-type(1) {
    bottom: 15%;
    right: 8%;
    animation-delay: 0s;
}

.section-container .data-annotation:nth-of-type(2) {
    bottom: 35%;
    left: 5%;
    animation-delay: -4s;
}

@keyframes floatUp {
    0% {
        transform: translateY(0);
        opacity: 0.15;
    }
    50% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-30px);
        opacity: 0.05;
    }
}

/* ======================================================
   LOTTIE / GENERATIVE DECORATIONS
   ====================================================== */
.lottie-decoration {
    position: absolute;
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: 4;
}

.helix-decoration {
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 400px;
}

.pulse-decoration {
    left: -40px;
    bottom: -30px;
    width: 300px;
    height: 100px;
}

.cell-decoration {
    right: -40px;
    top: 10%;
    width: 200px;
    height: 200px;
}

.lottie-decoration canvas {
    width: 100%;
    height: 100%;
}

/* ======================================================
   CTA SECTION
   ====================================================== */
.cta-section {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40vh;
    padding: 4rem 2rem;
}

.cta-link {
    font-family: var(--font-mono);
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.12em;
    color: var(--phosphor-green);
    text-decoration: none;
    position: relative;
    padding: 0.8rem 0;
    animation: ctaPulse 2.5s ease-in-out infinite;
}

.cta-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--phosphor-green);
    opacity: 0.5;
    animation: ctaLineGlow 2.5s ease-in-out infinite;
}

@keyframes ctaPulse {
    0%, 100% {
        opacity: 0.7;
        text-shadow: 0 0 8px rgba(57, 255, 20, 0.3);
    }
    50% {
        opacity: 1;
        text-shadow: 0 0 20px rgba(57, 255, 20, 0.6);
    }
}

@keyframes ctaLineGlow {
    0%, 100% {
        opacity: 0.3;
        box-shadow: 0 0 4px rgba(57, 255, 20, 0.2);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 12px rgba(57, 255, 20, 0.5);
    }
}

/* ======================================================
   RADIAL NAVIGATION
   ====================================================== */
.radial-nav {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.nav-trigger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.3);
    background: rgba(26, 0, 51, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
    position: relative;
    z-index: 1001;
}

.nav-trigger:hover {
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.nav-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--electric-cyan);
    animation: indicatorPulse 3s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

.nav-menu {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--gradient-nav);
    border: 1px solid rgba(0, 240, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.25s ease;
    pointer-events: none;
}

.nav-menu.open {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

.nav-link {
    position: absolute;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--electric-cyan);
    text-decoration: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease 0.15s, color 0.2s ease;
}

.nav-menu.open .nav-link {
    opacity: 1;
}

.nav-link:hover {
    color: var(--neon-magenta);
}

/* ======================================================
   PARTICLE EMITTERS (via JS)
   ====================================================== */
.particle-emitter {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* ======================================================
   GENE ANNOTATIONS CONTAINER
   ====================================================== */
.gene-annotations {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 768px) {
    .hero-content {
        padding-left: 50%;
    }

    .section-container {
        width: 95%;
        padding: 2.5rem 2rem;
    }

    .lottie-decoration {
        display: none;
    }

    .radial-nav {
        bottom: 1rem;
        right: 1rem;
    }

    .nav-menu {
        width: 240px;
        height: 240px;
    }

    .data-annotation {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding-left: 1.5rem;
        transform: none;
    }

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

    .section-container {
        clip-path: none !important;
        border-radius: 12px;
    }

    .section-1 .section-container,
    .section-2 .section-container,
    .section-3 .section-container,
    .section-4 .section-container {
        clip-path: none !important;
    }

    .section-1.revealed .section-container,
    .section-2.revealed .section-container,
    .section-3.revealed .section-container,
    .section-4.revealed .section-container {
        clip-path: none !important;
    }
}
