/* ============================================
   datatelomere.com — Styles
   Organic-tech fusion / Bio-digital aesthetic
   ============================================ */

/* --- Custom Properties --- */
:root {
    --nucleotide-dark: #0c0e14;
    --cell: #141822;
    --telomere-cyan: #00d4aa;
    --data-magenta: #e040a0;
    --intact-green: #00c853;
    --degrade-yellow: #ffc107;
    --damage-red: #ff3d00;
    --text: #d0d8e8;
    --muted: #5a6478;

    --font-display: 'Sora', sans-serif;
    --font-body: 'Atkinson Hyperlegible', sans-serif;
    --font-code: 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--nucleotide-dark);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
    overflow-x: hidden;
}

/* --- Integrity Monitor Bar --- */
#integrity-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    display: flex;
    z-index: 1000;
}

#integrity-bar .seg {
    height: 100%;
    transition: background-color 2s ease;
}

.seg-intact {
    background: var(--intact-green);
    animation: integrityShift 60s ease-in-out infinite alternate;
}

.seg-degrade {
    background: var(--degrade-yellow);
    animation: integrityShiftWarn 45s ease-in-out infinite alternate;
}

@keyframes integrityShift {
    0%   { background-color: var(--intact-green); }
    70%  { background-color: var(--intact-green); }
    100% { background-color: var(--degrade-yellow); }
}

@keyframes integrityShiftWarn {
    0%   { background-color: var(--degrade-yellow); }
    60%  { background-color: var(--degrade-yellow); }
    100% { background-color: var(--damage-red); }
}

/* --- Sections --- */
.section {
    position: relative;
    width: 100%;
    padding: 100px 24px;
}

.section--dark {
    background: var(--nucleotide-dark);
    clip-path: polygon(0 0, 100% 40px, 100% 100%, 0 calc(100% - 40px));
}

.section--cell {
    background: var(--cell);
    clip-path: polygon(0 40px, 100% 0, 100% calc(100% - 40px), 0 100%);
}

.section--cap {
    background: var(--nucleotide-dark);
    border-top: 3px solid var(--telomere-cyan);
    border-bottom: 3px solid var(--data-magenta);
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Hero --- */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 0 100%);
}

.hero-content {
    position: relative;
    width: 100%;
    max-width: 900px;
    text-align: center;
}

.helix-svg {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.strand {
    opacity: 0.85;
}

.strand-bio {
    animation: driftRight 4s ease-in-out infinite alternate;
}

.strand-data {
    animation: driftLeft 4s ease-in-out infinite alternate;
}

@keyframes driftRight {
    from { transform: translateX(0); }
    to   { transform: translateX(-20px); }
}

@keyframes driftLeft {
    from { transform: translateX(0); }
    to   { transform: translateX(20px); }
}

.helix-connectors line {
    stroke: var(--muted);
    stroke-width: 1;
    opacity: 0.4;
}

.hero-text {
    position: relative;
    margin-top: 40px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.hero-title .accent-cyan {
    color: var(--telomere-cyan);
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--muted);
    margin-top: 16px;
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 24px;
}

.heading--bio {
    color: var(--telomere-cyan);
}

.heading--data {
    color: var(--data-magenta);
}

.section-description {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 740px;
    margin-bottom: 48px;
    line-height: 1.7;
}

/* --- Two Column Layout (Concept Section) --- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 32px;
}

.col-heading {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.col--bio .col-heading {
    color: var(--telomere-cyan);
}

.col--data .col-heading {
    color: var(--data-magenta);
}

.col p {
    margin-bottom: 20px;
    color: var(--text);
}

/* --- Base Pair Bullet Lists --- */
.base-pair-list {
    list-style: none;
    padding: 0;
}

.base-pair-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 0.95rem;
}

.base-pair-list li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    position: absolute;
    left: 0;
    top: 0.6em;
}

/* Bio strand: cycle through A/G colors (cyan/green) */
[data-strand="bio"] li:nth-child(4n+1)::before { background: #00d4aa; }
[data-strand="bio"] li:nth-child(4n+2)::before { background: #00c853; }
[data-strand="bio"] li:nth-child(4n+3)::before { background: #00d4aa; }
[data-strand="bio"] li:nth-child(4n+4)::before { background: #00c853; }

/* Data strand: cycle through T/C colors (magenta/yellow) */
[data-strand="data"] li:nth-child(4n+1)::before { background: #e040a0; }
[data-strand="data"] li:nth-child(4n+2)::before { background: #ffc107; }
[data-strand="data"] li:nth-child(4n+3)::before { background: #e040a0; }
[data-strand="data"] li:nth-child(4n+4)::before { background: #ffc107; }

/* --- Integrity Spectrum --- */
.integrity-spectrum {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.spectrum-stage {
    background: var(--cell);
    border-radius: 8px;
    padding: 32px;
    border: 1px solid rgba(208, 216, 232, 0.06);
}

.spectrum-indicator {
    width: 40px;
    height: 6px;
    border-radius: 3px;
    margin-bottom: 20px;
}

.spectrum-indicator--intact {
    background: var(--intact-green);
    box-shadow: 0 0 12px rgba(0, 200, 83, 0.4);
}

.spectrum-indicator--degrading {
    background: var(--degrade-yellow);
    box-shadow: 0 0 12px rgba(255, 193, 7, 0.4);
}

.spectrum-indicator--damaged {
    background: var(--damage-red);
    box-shadow: 0 0 12px rgba(255, 61, 0, 0.4);
}

.spectrum-stage h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.spectrum-stage p {
    font-size: 0.95rem;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.6;
}

.code-block {
    display: block;
    font-family: var(--font-code);
    font-size: 0.8rem;
    color: var(--telomere-cyan);
    background: rgba(0, 212, 170, 0.06);
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 3px solid var(--telomere-cyan);
}

/* --- Mechanisms Grid --- */
.mechanisms-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

.mechanism-card {
    background: var(--nucleotide-dark);
    border: 1px solid rgba(208, 216, 232, 0.06);
    border-radius: 8px;
    padding: 32px;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.mechanism-card:hover {
    border-color: rgba(0, 212, 170, 0.2);
    transform: translateY(-2px);
}

.mechanism-icon {
    margin-bottom: 20px;
}

.mechanism-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
}

.mechanism-card p {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.6;
}

/* --- Code Examples --- */
.code-examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.code-example {
    background: var(--cell);
    border: 1px solid rgba(208, 216, 232, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.code-example-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--muted);
    padding: 16px 24px;
    background: rgba(208, 216, 232, 0.03);
    border-bottom: 1px solid rgba(208, 216, 232, 0.06);
}

.code-pre {
    font-family: var(--font-code);
    font-size: 0.82rem;
    line-height: 1.65;
    padding: 24px;
    overflow-x: auto;
    color: var(--text);
    white-space: pre;
}

.code-kw  { color: var(--data-magenta); }
.code-type { color: var(--telomere-cyan); }
.code-fn   { color: var(--degrade-yellow); }
.code-num  { color: var(--intact-green); }
.code-comment { color: var(--muted); font-style: italic; }

/* --- Applications --- */
.applications-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.app-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
    background: var(--nucleotide-dark);
    border-radius: 8px;
    border: 1px solid rgba(208, 216, 232, 0.06);
    transition: border-color 0.3s ease;
}

.app-item:hover {
    border-color: rgba(0, 212, 170, 0.15);
}

.app-marker {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    margin-top: 10px;
    background: var(--pair-color);
    border-radius: 0;
}

.app-content h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.app-content p {
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.6;
}

/* --- Footer (Telomere Cap) --- */
#footer {
    padding: 60px 24px;
    text-align: center;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.footer-helix {
    width: 100%;
    max-width: 600px;
    margin-bottom: 12px;
}

.footer-helix-svg {
    width: 100%;
    height: 60px;
}

.footer-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.footer-sub {
    font-size: 0.9rem;
    color: var(--muted);
}

.footer-bases {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.footer-bases .base {
    width: 6px;
    height: 6px;
    display: inline-block;
}

/* --- Scroll Reveal Animations --- */
.section-inner {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Hero always visible */
#hero .hero-content {
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .two-col {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .integrity-spectrum {
        grid-template-columns: 1fr;
    }

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

    .code-examples {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 80px 20px;
    }

    .section--dark,
    .section--cell {
        clip-path: polygon(0 0, 100% 20px, 100% 100%, 0 calc(100% - 20px));
    }
}
