/* ============================================
   TELEMETRY-GRADE DESIGN SYSTEM
   AI for Research Automation
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Inter:ital,wght@0,200;0,300;0,400;0,500;1,300&family=Space+Grotesk:wght@300;400;500;600&display=swap');

/* ── Palette ──────────────────────────────── */
:root {
    --graphite: #0B0F12;
    --slate: #101418;
    --grid: #1F2430;
    --pastel-teal: #7EC8D6; /* primary pastel */
    --pastel-lavender: #BFA6E0; /* accent */
    --pastel-peach: #F1BFA3; /* corrective */
    --signal: var(--pastel-teal);
    --corrective: var(--pastel-peach);
    --readout: #CBD5DF;

    /* Derived */
    --text-bright: #D8DEE6;
    --text-dim: #636B78;
    --signal-glow: rgba(124, 185, 200, 0.12);
    --corrective-glow: rgba(196, 145, 86, 0.12);
    --signal-faint: rgba(124, 185, 200, 0.06);
    --pastel-teal-glow: rgba(126,200,214,0.10);
    --pastel-lavender-glow: rgba(191,166,224,0.10);
    --pastel-peach-glow: rgba(241,191,163,0.10);

    /* Glass */
    --glass-bg: rgba(8, 12, 18, 0.35);
    --glass-border: rgba(126, 200, 214, 0.08);
    --glass-blur: 18px;

    /* Typography */
    --font-display: 'Space Grotesk', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Consolas', monospace;

    /* Motion — mechanical, no overshoot */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --duration: 200ms;
}

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

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

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    background: #000000;
    color: var(--readout);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Focus (visible keyboard states) ──────── */
:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 3px;
}

::selection {
    background: var(--signal);
    color: var(--graphite);
}

/* ── Layout ───────────────────────────────── */
.section-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ══════════════════════════════════════════
   FIXED SPHERE CANVAS — always behind content
   ══════════════════════════════════════════ */
.sphere-backdrop {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ══════════════════════════════════════════
   SCROLL CONTENT — floats over the sphere
   ══════════════════════════════════════════ */
.scroll-content {
    position: relative;
    z-index: 1;
}

/* ══════════════════════════════════════════
   HERO — floating text over the sphere
   ══════════════════════════════════════════ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem 5rem;
    overflow: visible;
    background: transparent;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 720px;
    padding: 2.5rem 3rem;
    /* Glassmorphic card */
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow:
        0 0 60px rgba(126, 200, 214, 0.04),
        0 20px 60px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5.5vw, 4.0rem);
    font-weight: 300;
    letter-spacing: -0.05em;
    line-height: 1.05;
    color: #F0F4F8;
    margin-bottom: 1rem;
}

.hero-title .hl {
    color: var(--signal);
    text-shadow:
        0 0 30px rgba(126,200,214,0.25),
        0 0 80px rgba(126,200,214,0.08);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 200;
    font-style: italic;
    color: rgba(190, 200, 215, 0.7);
    margin-bottom: 2.2rem;
    letter-spacing: 0.04em;
}

.hero-body {
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.9;
    color: rgba(214, 220, 230, 0.75);
    max-width: 520px;
    margin: 0 auto;
    letter-spacing: 0.01em;
}

/* ══════════════════════════════════════════
   DIVIDER — hairline with tick marks
   Glassmorphic style over sphere backdrop
   ══════════════════════════════════════════ */
.divider {
    position: relative;
    margin: 0 2rem;
}

.divider__line {
    height: 1px;
    background: rgba(31, 36, 48, 0.6);
    position: relative;
}

.divider__line::before {
    content: '';
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 7px;
    background: repeating-linear-gradient(90deg,
            rgba(31, 36, 48, 0.5) 0 1px,
            transparent 1px 72px);
    pointer-events: none;
}

/* Coordinate-style section label */
.coord-label {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(99, 107, 120, 0.6);
    padding: 0.9rem 0 0;
    display: block;
}

/* ══════════════════════════════════════════
   MISSION — glassmorphic floating section
   ══════════════════════════════════════════ */
.mission {
    padding: 4rem 0 5rem;
    background: transparent;
}

.mission .section-inner {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem 2.5rem 2.5rem;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.mission-text {
    max-width: 620px;
    margin-bottom: 3rem;
}

.mission-text p {
    font-size: 0.92rem;
    font-weight: 300;
    line-height: 1.9;
    color: rgba(203, 213, 223, 0.8);
    margin-bottom: 1.2rem;
    letter-spacing: 0.01em;
}

.mission-text em {
    font-style: italic;
    color: rgba(216, 222, 230, 0.9);
}

.mission-highlight {
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 400;
    line-height: 1.55;
    color: rgba(216, 222, 230, 0.85);
    padding-top: 1.2rem;
    margin-top: 1.2rem;
    border-top: 1px solid rgba(31, 36, 48, 0.5);
}

/* ── Panels — floating instrument cards ─── */
.panels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: transparent;
    border: none;
}

.panel {
    background: rgba(16, 20, 24, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-left: 2px solid rgba(126, 200, 214, 0.4);
    border: 1px solid rgba(31, 36, 48, 0.5);
    border-left: 2px solid rgba(126, 200, 214, 0.4);
    border-radius: 10px;
    transition: background var(--duration) var(--ease),
        box-shadow var(--duration) var(--ease),
        border-color var(--duration) var(--ease),
        transform 160ms var(--ease);
    will-change: transform;
}

.panel:hover {
    background: rgba(25, 31, 40, 0.7);
    border-color: rgba(126, 200, 214, 0.15);
    box-shadow:
        0 0 30px rgba(126, 200, 214, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.panel--corrective {
    border-left-color: rgba(241, 191, 163, 0.5);
}

.panel--corrective:hover {
    border-color: rgba(241, 191, 163, 0.2);
    box-shadow:
        0 0 30px rgba(241, 191, 163, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.4);
}

.panel__title {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(216, 222, 230, 0.9);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.panel__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--signal);
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(126, 200, 214, 0.3);
}

.panel--corrective .panel__dot {
    background: var(--corrective);
    box-shadow: 0 0 8px rgba(241, 191, 163, 0.3);
}

.panel__text {
    font-size: 0.78rem;
    font-weight: 300;
    line-height: 1.7;
    color: rgba(99, 107, 120, 0.85);
}

.panel__text p {
    margin-bottom: 0.15rem;
}

/* ══════════════════════════════════════════
   CONTACT — glassmorphic floating
   ══════════════════════════════════════════ */
.contact {
    padding: 4rem 0 5rem;
    background: transparent;
}

.contact .section-inner {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.contact-content {
    max-width: 400px;
}

.contact-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(216, 222, 230, 0.9);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.status-dot--small {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--signal);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(126, 200, 214, 0.4);
    animation: pulse-dot 3s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

.contact-role {
    font-size: 0.82rem;
    font-weight: 300;
    color: rgba(99, 107, 120, 0.7);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
}

.contact-role .sep {
    font-family: var(--font-mono);
    padding: 0 0.15em;
    opacity: 0.4;
}

.contact-links {
    display: flex;
    gap: 0.7rem;
}

.contact-link {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.6em 1.4em;
    border: 1px solid rgba(31, 36, 48, 0.6);
    border-radius: 6px;
    color: rgba(203, 213, 223, 0.7);
    background: rgba(16, 20, 24, 0.4);
    transition: border-color var(--duration) var(--ease),
        color var(--duration) var(--ease),
        background var(--duration) var(--ease),
        box-shadow var(--duration) var(--ease);
    cursor: pointer;
}

.contact-link:hover,
.contact-link:focus-visible {
    border-color: rgba(126, 200, 214, 0.3);
    color: var(--signal);
    box-shadow: 0 0 20px rgba(126, 200, 214, 0.08);
}

.contact-link--primary {
    border-color: rgba(126, 200, 214, 0.25);
    color: var(--signal);
}

.contact-link--primary:hover,
.contact-link--primary:focus-visible {
    background: rgba(126, 200, 214, 0.08);
    border-color: rgba(126, 200, 214, 0.4);
}

/* ══════════════════════════════════════════
   FOOTER RAIL — floating
   ══════════════════════════════════════════ */
.footer-rail {
    height: 40px;
    border-top: 1px solid rgba(31, 36, 48, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    color: rgba(99, 107, 120, 0.5);
    background: rgba(8, 12, 18, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* ══════════════════════════════════════════
   SIGNATURE MOTIF — corrective-action trace
   ══════════════════════════════════════════ */
.motif {
    display: block;
    width: 100px;
    height: 20px;
}

/* Motif polyline draw + corrective pulse */
.motif polyline {
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    animation: motif-draw 6s linear infinite;
}
.motif circle { transition: transform .28s ease, opacity .28s ease; }
.motif.correction circle { transform: scale(1.6); opacity: 0.9; }

@keyframes motif-draw { to { stroke-dashoffset: 0; } }

.motif--small {
    width: 64px;
    height: 14px;
}

/* ══════════════════════════════════════════
   SCROLL REVEAL — mechanical settle
   ══════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(12px);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 400ms var(--ease),
        transform 400ms var(--ease);
}

.reveal-stagger>.reveal:nth-child(1) {
    transition-delay: 0ms;
}

.reveal-stagger>.reveal:nth-child(2) {
    transition-delay: 100ms;
}

.reveal-stagger>.reveal:nth-child(3) {
    transition-delay: 200ms;
}

/* ══════════════════════════════════════════
   REDUCED MOTION
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .sphere-backdrop {
        opacity: 0.9;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
    .hero {
        min-height: 90vh;
        padding: 3rem 1.5rem 4rem;
    }

    .hero-content {
        max-width: 560px;
        padding: 2rem 1.8rem;
    }

    .mission,
    .contact {
        padding: 3rem 0 4rem;
    }

    .mission .section-inner,
    .contact .section-inner {
        margin: 0 1rem;
        padding: 2rem 1.5rem;
    }

    .section-inner {
        padding: 0 1.5rem;
    }

    .panels-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .contact-links {
        flex-direction: column;
    }

    .contact-link {
        text-align: center;
    }

    .divider {
        margin: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-content {
        padding: 1.5rem 1.2rem;
        border-radius: 14px;
    }

    .hero-body {
        font-size: 0.82rem;
    }

    .section-inner {
        padding: 0 1.2rem;
    }

    .mission .section-inner,
    .contact .section-inner {
        margin: 0 0.8rem;
        padding: 1.5rem 1.2rem;
        border-radius: 12px;
    }

    .divider {
        margin: 0 1.2rem;
    }

    .footer-rail {
        padding: 0 1rem;
    }
}

/* ── Scrollbar ────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--graphite);
}

::-webkit-scrollbar-thumb {
    background: var(--grid);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--grid) var(--graphite);
}