/* datatelomere.com - Sci-Fi HUD Overlay Stats */
/* Palette: #0a0f1a, #141b2d, #22c55e, #eab308, #ef4444, #e2e8f0, #64748b, #06b6d4 */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@400;500&family=Space+Grotesk:wght@600;700&display=swap');

:root {
    --bg: #0a0f1a;
    --panel: #141b2d;
    --green: #22c55e;
    --amber: #eab308;
    --red: #ef4444;
    --text: #e2e8f0;
    --label: #64748b;
    --cyan: #06b6d4;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Scanlines overlay */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(255, 255, 255, 0.008) 2px,
        rgba(255, 255, 255, 0.008) 4px
    );
}

/* Background helix */
.bg-helix {
    position: fixed;
    right: 20px;
    top: 0;
    width: 60px;
    height: 100vh;
    opacity: 0.06;
    z-index: 1;
    pointer-events: none;
}

.bg-helix-strand-a,
.bg-helix-strand-b {
    stroke-dasharray: 6000;
    stroke-dashoffset: 6000;
    animation: drawBgHelix 8s ease forwards;
}

.bg-helix-strand-b {
    animation-delay: 0.5s;
}

@keyframes drawBgHelix {
    to { stroke-dashoffset: 0; }
}

/* ======================== */
/* HEADER                   */
/* ======================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(100, 116, 139, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.helix-icon {
    flex-shrink: 0;
}

.brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    letter-spacing: 0.02em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--label);
    letter-spacing: 0.1em;
    padding: 2px 6px;
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 3px;
}

.integrity-readout {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--green);
    letter-spacing: 0.05em;
}

.int-value {
    color: var(--cyan);
}

/* ======================== */
/* HERO (Initialization)    */
/* ======================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 50px;
}

.hero-helix {
    position: absolute;
    width: min(600px, 90vw);
    height: min(400px, 60vh);
    opacity: 0;
    animation: fadeInHelix 2s ease 0.5s forwards;
}

@keyframes fadeInHelix {
    to { opacity: 0.35; }
}

.hero-strand {
    stroke-dasharray: 1600;
    stroke-dashoffset: 1600;
    animation: drawHeroStrand 3s ease 0.8s forwards;
}

.hero-strand-b {
    animation-delay: 1.3s;
}

@keyframes drawHeroStrand {
    to { stroke-dashoffset: 0; }
}

.helix-rungs line {
    opacity: 0;
    animation: fadeRung 0.5s ease forwards;
}

.helix-rungs line:nth-child(1) { animation-delay: 2s; }
.helix-rungs line:nth-child(2) { animation-delay: 2.2s; }
.helix-rungs line:nth-child(3) { animation-delay: 2.4s; }
.helix-rungs line:nth-child(4) { animation-delay: 2.6s; }
.helix-rungs line:nth-child(5) { animation-delay: 2.8s; }
.helix-rungs line:nth-child(6) { animation-delay: 3.0s; }
.helix-rungs line:nth-child(7) { animation-delay: 3.2s; }
.helix-rungs line:nth-child(8) { animation-delay: 3.4s; }
.helix-rungs line:nth-child(9) { animation-delay: 3.6s; }

@keyframes fadeRung {
    to { opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.8rem, 8vw, 5rem);
    color: var(--text);
    text-shadow: 0 0 40px rgba(6, 182, 212, 0.15), 0 0 80px rgba(34, 197, 94, 0.08);
    opacity: 0;
    animation: materialize 1.5s ease 0.3s forwards;
    letter-spacing: -0.02em;
}

@keyframes materialize {
    0% { opacity: 0; transform: translateY(10px); filter: blur(8px); }
    100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.hero-tagline {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.65rem, 1.2vw, 0.8rem);
    color: var(--label);
    letter-spacing: 0.2em;
    margin-top: 0.75rem;
    text-transform: uppercase;
    opacity: 0;
    animation: materialize 1.2s ease 1.5s forwards;
}

.hero-integrity {
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    opacity: 0;
    animation: materialize 1s ease 2.5s forwards;
}

.hero-int-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--label);
    letter-spacing: 0.1em;
}

.hero-int-bar {
    width: 120px;
    height: 3px;
    background: var(--panel);
    border-radius: 2px;
    overflow: hidden;
}

.hero-int-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: var(--green);
    border-radius: 2px;
    transition: width 2s ease;
}

.hero-int-value {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--green);
    min-width: 3.5em;
    text-align: right;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeInBounce 1s ease 4s forwards;
}

.scroll-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.55rem;
    color: var(--label);
    letter-spacing: 0.15em;
}

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

@keyframes fadeInBounce {
    to { opacity: 0.6; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ======================== */
/* SECTION LABELS           */
/* ======================== */
.section-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

.section-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--cyan);
    padding: 3px 8px;
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.section-tag.warning {
    color: var(--amber);
    border-color: rgba(234, 179, 8, 0.3);
}

.section-tag.success {
    color: var(--green);
    border-color: rgba(34, 197, 94, 0.3);
}

.section-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--label);
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.section-name.warning { color: var(--amber); }
.section-name.success { color: var(--green); }

.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, rgba(6, 182, 212, 0.2), transparent);
}

.section-line.warning {
    background: linear-gradient(to right, rgba(234, 179, 8, 0.2), transparent);
}

.section-line.success {
    background: linear-gradient(to right, rgba(34, 197, 94, 0.2), transparent);
}

/* ======================== */
/* ANALYSIS SECTION         */
/* ======================== */
.analysis-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
    position: relative;
    z-index: 2;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 2.5rem;
}

.metric-card {
    background: var(--panel);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid rgba(100, 116, 139, 0.08);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cyan), var(--green));
    opacity: 0.6;
}

.metric-number {
    font-family: 'Fira Code', monospace;
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 500;
    color: var(--cyan);
    display: inline;
    line-height: 1;
}

.metric-unit {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: var(--green);
    margin-left: 2px;
}

.metric-desc {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--label);
    margin-top: 0.5rem;
    letter-spacing: 0.02em;
}

.metric-bar {
    margin-top: 0.75rem;
    height: 2px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: 1px;
    overflow: hidden;
}

.metric-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--green);
    border-radius: 1px;
    transition: width 1.5s ease;
}

/* ======================== */
/* PANELS                   */
/* ======================== */
.panels-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-panel {
    background: var(--panel);
    border-radius: 8px;
    border-top: 3px solid;
    padding: 1.25rem 1.5rem;
    border-left: 1px solid rgba(100, 116, 139, 0.06);
    border-right: 1px solid rgba(100, 116, 139, 0.06);
    border-bottom: 1px solid rgba(100, 116, 139, 0.06);
    position: relative;
}

.status-green { border-top-color: var(--green); }
.status-amber { border-top-color: var(--amber); }
.status-red { border-top-color: var(--red); }

.panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.panel-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-green .panel-indicator { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-amber .panel-indicator { background: var(--amber); box-shadow: 0 0 6px var(--amber); animation: pulse 2s ease-in-out infinite; }
.status-red .panel-indicator { background: var(--red); box-shadow: 0 0 6px var(--red); animation: pulse 1s ease-in-out infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.panel-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    flex: 1;
}

.panel-timestamp {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--label);
    letter-spacing: 0.05em;
}

.panel-text {
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.6);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-status {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
}

.panel-code {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--label);
    letter-spacing: 0.05em;
}

.status-green .panel-status { color: var(--green); }
.status-amber .panel-status { color: var(--amber); }
.status-red .panel-status { color: var(--red); }

/* ======================== */
/* DEGRADATION SECTION      */
/* ======================== */
.degradation-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 1.5rem 3rem;
    position: relative;
    z-index: 2;
}

.alert-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(234, 179, 8, 0.06);
    border: 1px solid rgba(234, 179, 8, 0.15);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 2rem;
    animation: alertFlash 3s ease-in-out infinite;
}

@keyframes alertFlash {
    0%, 100% { border-color: rgba(234, 179, 8, 0.15); }
    50% { border-color: rgba(234, 179, 8, 0.35); }
}

.alert-icon {
    flex-shrink: 0;
}

.alert-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--amber);
    letter-spacing: 0.08em;
}

.degradation-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 2rem;
}

.degrade-metric {
    background: var(--panel);
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
    border: 1px solid rgba(234, 179, 8, 0.1);
    position: relative;
}

.degrade-value {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 500;
    color: var(--amber);
    line-height: 1;
}

.degrade-unit {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--amber);
    opacity: 0.7;
}

.degrade-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--label);
    margin-top: 0.4rem;
}

.degrade-delta {
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--red);
    margin-top: 0.3rem;
    padding: 1px 6px;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 3px;
}

/* ======================== */
/* PRESERVATION SECTION     */
/* ======================== */
.preservation-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem;
    position: relative;
    z-index: 2;
}

.preservation-hero {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.preservation-ring {
    position: relative;
    width: 200px;
    height: 200px;
}

.ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-progress {
    transition: stroke-dashoffset 2s ease;
}

.ring-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-value {
    font-family: 'Fira Code', monospace;
    font-size: 2.8rem;
    font-weight: 500;
    color: var(--green);
    line-height: 1;
}

.ring-unit {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    color: var(--green);
    opacity: 0.7;
}

.ring-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.55rem;
    color: var(--label);
    letter-spacing: 0.15em;
    margin-top: 0.3rem;
}

/* Final Status */
.final-status {
    text-align: center;
    padding: 3rem 1.5rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(34, 197, 94, 0.1);
}

.final-helix {
    margin-bottom: 1.5rem;
    display: inline-block;
}

.final-message {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    color: var(--green);
    text-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.final-sub {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--label);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ======================== */
/* FOOTER                   */
/* ======================== */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid rgba(100, 116, 139, 0.08);
    max-width: 1000px;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--label);
}

.footer-status {
    font-family: 'Fira Code', monospace;
    font-size: 0.6rem;
    color: var(--green);
    letter-spacing: 0.08em;
}

/* ======================== */
/* ANIMATIONS               */
/* ======================== */
.slide-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.slide-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in:nth-child(2) { transition-delay: 0.1s; }
.slide-in:nth-child(3) { transition-delay: 0.2s; }
.slide-in:nth-child(4) { transition-delay: 0.3s; }

/* ======================== */
/* RESPONSIVE               */
/* ======================== */
@media (max-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .degradation-metrics {
        grid-template-columns: 1fr;
    }

    .hero-integrity {
        flex-direction: column;
        gap: 0.5rem;
    }

    .site-header {
        padding: 0.6rem 1rem;
    }

    .header-label {
        display: none;
    }

    .bg-helix {
        right: 10px;
        width: 40px;
        opacity: 0.04;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .alert-text {
        font-size: 0.55rem;
    }
}
