/* ============================================
   datatelomere.com - Memphis-meets-Bioinformatics
   ============================================ */

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

:root {
    --paper: #F0E4D0;
    --ink: #1A1A1A;
    --memphis-red: #E85040;
    --memphis-blue: #3090C0;
    --memphis-green: #40A060;
    --memphis-yellow: #E8C040;
    --warm-gray: #8A8078;
    --cream-card: #F8F0E0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.8;
    color: var(--ink);
    background-color: var(--paper);
    overflow-x: hidden;
    position: relative;
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--memphis-red);
    z-index: 1000;
    transition: width 0.1s linear;
    opacity: 0;
}

#scroll-progress.visible {
    opacity: 1;
}

/* --- Site Mark --- */
#site-mark {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    cursor: default;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--paper);
    overflow: hidden;
}

.memphis-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.memphis-shape {
    position: absolute;
    opacity: 0;
    transform: scale(0) rotate(45deg);
    transition: opacity 0.4s ease-out, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.memphis-shape.visible {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    padding: 0 8vw;
    max-width: 900px;
}

#hero-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    line-height: 1.1;
    color: var(--ink);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

#hero-title.visible {
    opacity: 1;
    transform: translateY(0);
}

#hero-underline {
    width: 0%;
    height: 4px;
    background-color: var(--ink);
    margin-top: 16px;
    margin-bottom: 24px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition-delay: 0.6s;
}

#hero-underline.visible {
    width: 50%;
}

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.7;
    color: var(--warm-gray);
    max-width: 600px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out 0.8s, transform 0.8s ease-out 0.8s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Telomere Strips --- */
.telomere-strip {
    width: 100%;
    height: 12px;
    overflow: hidden;
    position: relative;
}

.telomere-sequence {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 12px;
    width: 200%;
}

.telomere-block {
    width: 8px;
    height: 12px;
    flex-shrink: 0;
}

/* Telomere color coding: T=#E85040, A=#40A060, G=#3090C0 */
.telomere-block.t-block { background-color: var(--memphis-red); }
.telomere-block.a-block { background-color: var(--memphis-green); }
.telomere-block.g-block { background-color: var(--memphis-blue); }

/* Slow continuous horizontal scroll animation */
@keyframes telomere-scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

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

.telomere-strip[data-direction="left"] .telomere-sequence {
    animation: telomere-scroll-left 30s linear infinite;
}

.telomere-strip[data-direction="right"] .telomere-sequence {
    animation: telomere-scroll-right 30s linear infinite;
}

/* --- Content Sections --- */
.content-section {
    position: relative;
    padding: 120px 8vw;
    max-width: 1200px;
    margin: 0 auto;
}

.section-accent {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.accent-triangle {
    top: 80px;
    right: -20px;
}

.accent-circle {
    top: 60px;
    left: -30px;
}

.accent-square {
    top: 100px;
    right: -10px;
}

.accent-zigzag {
    top: 90px;
    left: -20px;
}

.section-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.section-content h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.2;
    color: var(--ink);
    margin-bottom: 32px;
}

.section-content p {
    margin-bottom: 24px;
    color: var(--ink);
}

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

.sequence-label {
    margin-top: 16px;
}

.code-text {
    font-family: 'Fira Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: rgba(26, 26, 26, 0.7);
}

/* --- Botanical Dividers --- */
.botanical-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.chromosome-botanical {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.chromosome-botanical.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Margin Floral Motifs --- */
.margin-floral {
    position: fixed;
    z-index: 10;
    pointer-events: none;
    opacity: 0.6;
}

/* --- Alternating section accent positioning --- */
#section-hypothesis .section-accent { top: 80px; right: -20px; }
#section-hypothesis .section-content { margin-left: 0; }

#section-decay .section-accent { top: 60px; left: -30px; }
#section-decay .section-content { margin-left: auto; }

#section-protection .section-accent { top: 100px; right: -10px; }
#section-protection .section-content { margin-left: 0; }

#section-longevity .section-accent { top: 90px; left: -20px; }
#section-longevity .section-content { margin-left: auto; }

#section-crisis .section-accent { top: 80px; right: -15px; }
#section-crisis .section-content { margin-left: 0; }

#section-closing .section-accent { top: 60px; left: -25px; }
#section-closing .section-content { margin-left: auto; }

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .hero-content {
        padding: 0 6vw;
    }

    .content-section {
        padding: 80px 6vw;
    }

    .section-accent {
        opacity: 0.5;
    }

    .section-accent svg {
        width: 60px;
        height: 60px;
    }

    #section-decay .section-content,
    #section-longevity .section-content,
    #section-closing .section-content {
        margin-left: 0;
    }

    .margin-floral {
        display: none;
    }

    .botanical-divider svg {
        width: 140px;
        height: auto;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding: 60px 5vw;
    }

    .hero-content {
        padding: 0 5vw;
    }
}

/* --- Selection Styling --- */
::selection {
    background-color: var(--memphis-yellow);
    color: var(--ink);
}
