body {
    background-color: #0B0F14;
    color: #E0E2EA;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4rem;
}

.glass-panel {
    background: rgba(22, 27, 34, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid #374151;
}

.technical-grid {
    background-size: 40px 40px, 8px 8px;
    background-image:
        linear-gradient(to right, rgba(14, 165, 233, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(14, 165, 233, 0.05) 1px, transparent 1px),
        linear-gradient(to right, rgba(14, 165, 233, 0.015) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(14, 165, 233, 0.015) 1px, transparent 1px);
}

.card-clinical-impaired {
    background: rgba(22, 16, 18, 0.65) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), inset 0 0 12px rgba(239, 68, 68, 0.03) !important;
}

.card-clinical-impaired:hover {
    border-color: rgba(239, 68, 68, 0.45) !important;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.12), inset 0 0 12px rgba(239, 68, 68, 0.08) !important;
}

.card-clinical-optimized {
    background: rgba(16, 22, 20, 0.65) !important;
    border: 1px solid rgba(78, 222, 163, 0.2) !important;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2), inset 0 0 12px rgba(78, 222, 163, 0.03) !important;
}

.card-clinical-optimized:hover {
    border-color: rgba(78, 222, 163, 0.45) !important;
    box-shadow: 0 0 20px rgba(78, 222, 163, 0.12), inset 0 0 12px rgba(78, 222, 163, 0.08) !important;
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

/* Simulator Specific Styles */
@keyframes pulse-hub {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes data-flow {
    0% {
        stroke-dashoffset: 200;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

@keyframes node-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.animate-pulse-hub {
    animation: pulse-hub 3s ease-in-out infinite;
}

.animate-rotate-slow {
    animation: rotate-slow 12s linear infinite;
}

.data-stream {
    stroke-dasharray: 10, 190;
    animation: data-flow 3s linear infinite;
}

.simulator-node {
    animation: node-float 4s ease-in-out infinite;
}

/* Hero simulator — mobile visibility only (desktop unchanged at lg+) */
@media (max-width: 1023px) {
    .simulator-panel {
        min-height: 360px;
    }

    .simulator-body {
        min-height: 260px;
    }

    .simulator-viz {
        min-height: 0;
    }

    .simulator-center {
        overflow: visible;
    }

    .simulator-center .sim-orbit-outer,
    .simulator-center .sim-orbit-inner,
    .simulator-center .sim-hub {
        max-width: 100%;
        max-height: 100%;
    }
}

@media (max-width: 639px) {
    .simulator-panel {
        min-height: 340px;
    }

    .simulator-body {
        min-height: 240px;
    }
}

/* Direction-aware scroll reveal */
.scroll-reveal {
    opacity: 0;
    will-change: opacity, transform;
}

.scroll-reveal[data-reveal-dir="down"] {
    transform: translateY(30px);
}

.scroll-reveal[data-reveal-dir="up"] {
    transform: translateY(-30px);
}

.scroll-reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 750ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--reveal-delay, 0ms);
}

@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        will-change: auto;
    }

    .scroll-reveal.is-revealed {
        transition: none;
    }
}

/* Mobile navigation menu */
.nav-mobile-menu {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    pointer-events: none;
    transition:
        opacity 200ms ease,
        transform 200ms ease,
        visibility 200ms ease;
}

.nav-mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .nav-mobile-menu {
        transition: none;
    }
}

.center-node {
    transition: filter 0.3s ease;
}
.center-node:hover {
    filter: brightness(1.08) drop-shadow(0 0 12px rgba(171, 199, 255, 0.45));
}

/* ECG Waveform Animations */
.animate-healthy-ecg {
    stroke-dasharray: 30 90;
    animation: healthy-ecg-flow 2.8s linear infinite;
}

.animate-unhealthy-ecg {
    stroke-dasharray: 25 85;
    animation: unhealthy-ecg-flow 1.5s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

@keyframes healthy-ecg-flow {
    0% {
        stroke-dashoffset: 120;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes unhealthy-ecg-flow {
    0% {
        stroke-dashoffset: 110;
    }
    25% {
        stroke-dashoffset: 82; /* rapid contraction / first spike */
    }
    45% {
        stroke-dashoffset: 74; /* irregular delay/pause */
    }
    70% {
        stroke-dashoffset: 35; /* tachycardic secondary burst */
    }
    100% {
        stroke-dashoffset: 0;
    }
}
.input-node, .output-node {
    transition: filter 0.3s ease;
}
.input-node:hover, .output-node:hover {
    filter: brightness(1.12);
}
