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

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

body {
    background: #0D1B2A;
    color: #E8F0FE;
    font-family: 'DM Sans', sans-serif;
    font-size: 17px;
    line-height: 1.68;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* === TYPOGRAPHY === */
h2.section-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3.5vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: #E8F0FE;
}

.hero-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #00E5FF 0%, #FF006E 50%, #ADFF02 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dna-sequence {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.5;
    background: rgba(13, 27, 42, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: #00E5FF;
}

.dna-sequence.bright {
    font-size: 18px;
    color: #ADFF02;
    text-shadow: 0 0 20px rgba(173, 255, 2, 0.4);
}

.caption-text {
    color: #8B95A5;
    font-size: 15px;
    font-style: italic;
}

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* === PROGRESS INDICATOR === */
#progress-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #8B95A5;
    background: transparent;
    cursor: pointer;
    transition: all 0.4s ease;
    padding: 0;
}

.progress-dot.active {
    background: linear-gradient(135deg, #00E5FF, #FF006E);
    border-color: #00E5FF;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

.progress-dot:hover {
    border-color: #00E5FF;
    transform: scale(1.3);
}

/* === PANELS === */
.panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #1B2838 0%, #0D1B2A 100%);
}

.panel-content {
    position: relative;
    z-index: 2;
    max-width: 1440px;
    width: 100%;
    padding: 40px;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 24px;
}

/* === NOISE OVERLAY === */
.noise-overlay {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    mix-blend-mode: overlay;
}

/* === PARTICLE FIELD === */
.particle-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.8) 0%, transparent 70%);
    animation: particle-drift linear infinite;
}

@keyframes particle-drift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(0.5);
        opacity: 0;
    }
}

/* === PANEL 1: BIRTH === */
.panel-birth {
    background: radial-gradient(ellipse at 50% 40%, #1B2838 0%, #0D1B2A 70%);
}

.panel-birth-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    grid-column: 1 / -1;
}

.hero-capsule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 32px 64px;
    border-radius: 999px;
    background: rgba(27, 40, 56, 0.6);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow:
        0 0 30px rgba(0, 229, 255, 0.15),
        0 0 60px rgba(0, 229, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.15);
    position: relative;
    opacity: 0;
    transform: scale(0.8);
    animation: capsule-entrance 800ms cubic-bezier(0.22, 1, 0.36, 1) 300ms forwards;
}

.hero-capsule::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 999px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.4), rgba(255, 0, 110, 0.2), rgba(173, 255, 2, 0.3));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
}

@keyframes capsule-entrance {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.scroll-pulse {
    margin-top: 80px;
    opacity: 0;
    animation: fade-in 1s ease 1.2s forwards;
}

.scroll-dot {
    animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
    0%, 100% { cy: 10; opacity: 1; }
    50% { cy: 24; opacity: 0.3; }
}

@keyframes fade-in {
    to { opacity: 0.6; }
}

/* === PANEL 2: YOUTH === */
.panel-youth-content {
    display: flex;
    flex-direction: column;
    grid-column: 1 / -1;
    min-height: 100vh;
    justify-content: center;
    padding-bottom: 80px;
}

.youth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.info-card {
    padding: 40px;
    border-radius: 16px;
    background: rgba(27, 40, 56, 0.5);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow:
        0 0 30px rgba(0, 229, 255, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 229, 255, 0.1);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(255, 0, 110, 0.15), rgba(173, 255, 2, 0.2));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
}

.card-left {
    transform: translateY(0);
}

.card-right {
    transform: translateY(80px);
}

/* === DNA TICKER === */
.dna-ticker {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    overflow: hidden;
    padding: 12px 0;
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker-scroll 30s linear infinite;
}

.ticker-content {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #00E5FF;
    white-space: nowrap;
    padding-right: 40px;
    letter-spacing: 0.15em;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* === PANEL 3: MATURITY === */
.panel-maturity {
    background: radial-gradient(ellipse at 30% 50%, #1B2838 0%, #0D1B2A 80%);
}

.panel-maturity-content {
    grid-column: 1 / -1;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.maturity-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    clip-path: polygon(0 0, 55% 0, 45% 100%, 0 100%, 0 0, 55% 0, 100% 0, 100% 100%, 45% 100%, 55% 0);
}

.chromosome-illustration {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.chromosome-svg {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.2));
}

.telomere-cap {
    transition: r 0.6s ease;
}

.maturity-text-panel {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hairline-crack {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8B95A5, transparent);
    margin: 24px 0;
    position: relative;
}

.hairline-crack::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 30%;
    width: 40%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 51, 51, 0.3), transparent);
}

/* === PANEL 4: SENESCENCE === */
.panel-senescence {
    background: radial-gradient(ellipse at center, #1B2838 0%, #0D1B2A 100%);
}

.panel-senescence.in-view {
    filter: saturate(0.7);
}

.panel-senescence-content {
    grid-column: 1 / -1;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.senescence-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.info-card.degraded {
    background: rgba(27, 40, 56, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 149, 165, 0.15);
}

.info-card.degraded::before {
    background: linear-gradient(135deg, rgba(139, 149, 165, 0.15), rgba(255, 51, 51, 0.1));
}

.card-drift-1 {
    transform: translate(-3px, 5px) rotate(-0.3deg);
}

.card-drift-2 {
    transform: translate(2px, -4px) rotate(0.2deg);
}

.card-drift-3 {
    transform: translate(-1px, 7px) rotate(-0.5deg);
}

.glitch-text {
    position: relative;
}

.panel-senescence.in-view .glitch-text {
    text-shadow: 1px 0 #FF3333, -1px 0 #00E5FF;
}

/* Glitch Layer */
.glitch-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.glitch-band {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 51, 51, 0.3);
    mix-blend-mode: difference;
    animation: glitch-flash 150ms steps(2) forwards;
}

@keyframes glitch-flash {
    0% {
        transform: translateX(-10px);
        opacity: 1;
    }
    50% {
        transform: translateX(10px);
        opacity: 0.8;
    }
    100% {
        transform: translateX(0);
        opacity: 0;
    }
}

/* === PANEL 5: REGENERATION === */
.panel-regeneration {
    background: radial-gradient(ellipse at 50% 50%, #1B2838 0%, #0D1B2A 60%);
}

.panel-regeneration.in-view {
    background: radial-gradient(ellipse at 50% 50%, #243448 0%, #0D1B2A 60%);
}

.panel-regeneration-content {
    grid-column: 1 / -1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.regeneration-capsule {
    text-align: center;
    max-width: 700px;
    padding: 60px 80px;
    border-radius: 32px;
    background: rgba(27, 40, 56, 0.65);
    backdrop-filter: blur(24px) saturate(2);
    -webkit-backdrop-filter: blur(24px) saturate(2);
    box-shadow:
        0 0 50px rgba(0, 229, 255, 0.2),
        0 0 100px rgba(173, 255, 2, 0.08),
        0 12px 48px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(173, 255, 2, 0.2);
    position: relative;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.regeneration-capsule::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 32px;
    padding: 1px;
    background: linear-gradient(135deg, #00E5FF, #FF006E, #ADFF02);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask-composite: xor;
    pointer-events: none;
}

.panel-regeneration.in-view .regeneration-capsule {
    opacity: 1;
    transform: scale(1);
}

.regen-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #00E5FF 0%, #ADFF02 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.regen-subtitle {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: #8B95A5;
    margin-bottom: 28px;
}

.regen-body {
    color: #E8F0FE;
    margin-bottom: 28px;
}

.regen-sequence {
    padding: 16px 24px;
    background: rgba(13, 27, 42, 0.5);
    border-radius: 8px;
    display: inline-block;
}

/* === BURST CONTAINER === */
.burst-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.burst-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(173, 255, 2, 0.9) 0%, transparent 70%);
    opacity: 0;
}

.burst-particle.animate {
    animation: burst-out 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes burst-out {
    0% {
        transform: translate(0, 0) scale(0);
        opacity: 1;
    }
    30% {
        opacity: 1;
        transform: translate(0, 0) scale(1.5);
    }
    100% {
        transform: translate(var(--bx), var(--by)) scale(0.3);
        opacity: 0;
    }
}

/* === PANEL TRANSITION EFFECTS === */
.panel .panel-content {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.panel.scrolling-out .panel-content {
    opacity: 0.6;
    transform: scale(0.95);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .panel-content {
        grid-template-columns: repeat(8, 1fr);
    }

    .senescence-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .panel-content {
        grid-template-columns: 1fr;
        padding: 24px;
    }

    .youth-grid {
        grid-template-columns: 1fr;
    }

    .card-right {
        transform: translateY(0);
    }

    .maturity-split {
        grid-template-columns: 1fr;
        clip-path: none;
    }

    .chromosome-illustration {
        order: -1;
    }

    .chromosome-svg {
        max-width: 200px;
    }

    .senescence-grid {
        grid-template-columns: 1fr;
    }

    .card-drift-1,
    .card-drift-2,
    .card-drift-3 {
        transform: none;
    }

    .hero-capsule {
        padding: 24px 40px;
    }

    .regeneration-capsule {
        padding: 40px 32px;
    }

    #progress-indicator {
        right: 12px;
    }

    .info-card {
        padding: 28px;
    }
}

/* === SELECTION === */
::selection {
    background: rgba(0, 229, 255, 0.3);
    color: #E8F0FE;
}
