/* telomere.dev - Seapunk Scholarship */
/* Colors: #060a0e, #0f1a22, #1c2e3a, #3a5f6f, #5ec4b6, #8fa3ad, #d4dde1, #eef2f4 */

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

:root {
    --hadal-ink: #060a0e;
    --mesopelagic: #0f1a22;
    --bathyal-slate: #1c2e3a;
    --abyssal-teal: #3a5f6f;
    --bioluminescence: #5ec4b6;
    --pelagic-silver: #8fa3ad;
    --surface-light: #d4dde1;
    --photic-zone: #eef2f4;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--hadal-ink);
    color: var(--surface-light);
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(58, 95, 111, 0.08) 3px,
        rgba(58, 95, 111, 0.08) 4px
    );
    pointer-events: none;
    z-index: 100;
}

/* Particle Layer */
.particle-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.bio-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--bioluminescence);
    opacity: 0.4;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.1; }
    100% { transform: translate(-80px, -200px); opacity: 0; }
}

/* Depth Gauge */
.depth-gauge {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    height: 60vh;
    z-index: 90;
    display: flex;
    gap: 8px;
}

.gauge-track {
    width: 3px;
    height: 100%;
    background: var(--bathyal-slate);
    position: relative;
    border-radius: 1.5px;
}

.gauge-marker {
    position: absolute;
    top: 0;
    left: -2px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bioluminescence);
    box-shadow: 0 0 8px rgba(94, 196, 182, 0.5);
    transition: top 0.3s ease;
}

.gauge-labels {
    position: relative;
    height: 100%;
}

.gauge-label {
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-size: 9px;
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: var(--abyssal-teal);
    white-space: nowrap;
    transform: translateY(-50%);
}

/* Background Illustration */
.bg-illustration {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    z-index: 1;
    pointer-events: none;
    animation: bgRotate 120s linear infinite;
    opacity: 0.2;
}

@keyframes bgRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.bg-illustration svg {
    width: 100%;
    height: 100%;
}

/* Descent Container */
.descent-container {
    position: relative;
    z-index: 10;
    perspective: 1200px;
}

/* Zones */
.zone {
    position: relative;
    min-height: 100vh;
}

.zone-photic { min-height: 100vh; }
.zone-mesopelagic { min-height: 120vh; }
.zone-bathyal { min-height: 140vh; }
.zone-abyssal { min-height: 120vh; }
.zone-hadal { min-height: 100vh; }

/* Hero */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: 0.06em;
    color: var(--photic-zone);
    text-transform: uppercase;
    opacity: 0;
    transform: scale(0.92);
    animation: heroElastic 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s forwards;
}

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.08em;
    color: var(--pelagic-silver);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    animation: heroElastic 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s forwards;
}

@keyframes heroElastic {
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Bathymetric Dividers */
.bathymetric-divider {
    width: 100%;
    height: 60px;
    overflow: hidden;
}

.bathymetric-divider svg {
    width: 100%;
    height: 100%;
}

/* Content Cards */
.content-card {
    max-width: 65%;
    background: rgba(15, 26, 34, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(58, 95, 111, 0.3);
    border-radius: 2px;
    padding: 40px;
    margin: 40px 0;
    opacity: 0;
    will-change: transform, opacity;
}

.card-left {
    margin-left: 8%;
    transform: translateX(-40px);
}

.card-right {
    margin-left: auto;
    margin-right: 8%;
    transform: translateX(40px);
}

.content-card.visible {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.card-heading {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    letter-spacing: 0.04em;
    color: var(--bioluminescence);
    margin-bottom: 16px;
}

.card-body {
    color: var(--surface-light);
    margin-bottom: 14px;
    max-width: 62ch;
}

.card-body:last-child {
    margin-bottom: 0;
}

/* SVG Illustrations */
.svg-illustration {
    max-width: 600px;
    margin: 30px auto;
    opacity: 0;
    transform: translateY(30px);
}

.svg-illustration.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Chart Line Animation */
.chart-line {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease;
}

.hayflick-chart.visible .chart-line {
    stroke-dashoffset: 0;
}

/* Annotation Plane */
.annotation-plane {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

.annotation-float {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--abyssal-teal);
    margin-top: 16px;
    opacity: 0.7;
}

.margin-note {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--pelagic-silver);
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.margin-note.visible {
    opacity: 0.6;
}

/* Hexagonal Overlay */
.hex-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpolygon points='30,2 58,15 58,37 30,50 2,37 2,15' fill='none' stroke='%231c2e3a' stroke-width='0.5'/%3E%3C/svg%3E");
    background-size: 60px 52px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Reticle */
.reticle {
    position: absolute;
    width: 80px;
    height: 80px;
    opacity: 0.15;
    z-index: 0;
}

.reticle-left {
    left: 10%;
    top: 30%;
}

/* Closing */
.zone-hadal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.closing-text {
    max-width: 48ch;
    text-align: center;
}

.closing-quote {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--surface-light);
    line-height: 1.6;
}

.closing-mark {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--abyssal-teal);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .content-card {
        max-width: 90%;
        margin-left: 5% !important;
        margin-right: 5% !important;
    }

    .depth-gauge {
        display: none;
    }

    .hex-overlay {
        opacity: 0.08;
    }
}
