/* concengine.net - Mission-Control Telemetry HUD */

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

:root {
    --reactor-black: #0B0E11;
    --console-charcoal: #161B22;
    --sonar-teal: #3A9D8F;
    --combustion-amber: #D4A843;
    --phosphor-white: #E2E8F0;
    --cathode-gray: #7B8794;
    --ignition-coral: #E85D4A;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.7;
    color: var(--phosphor-white);
    background: var(--reactor-black);
    overflow-x: hidden;
}

/* CRT grain overlay */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.4;
}

/* Telemetry bar */
.telemetry-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 48px;
    background: var(--console-charcoal);
    border-bottom: 1px solid rgba(58, 157, 143, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 80px;
    opacity: 0;
    animation: fadeIn 600ms 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

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

.telem-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.telem-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--cathode-gray);
    text-transform: uppercase;
}

.telem-val {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    letter-spacing: 0.12em;
    color: var(--combustion-amber);
    text-shadow: 0 0 6px rgba(212, 168, 67, 0.3);
}

.pulse-container {
    flex: 0 0 200px;
}

.heartbeat-svg {
    width: 200px;
    height: 30px;
    display: block;
}

/* Gauge strips */
.gauge-strip {
    position: fixed;
    top: 48px;
    bottom: 0;
    width: 64px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 24px 12px;
    background: var(--console-charcoal);
    border-right: 1px solid rgba(58, 157, 143, 0.15);
    opacity: 0;
}

.gauge-left {
    left: 0;
    animation: fadeIn 500ms 800ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    border-right: 1px solid rgba(58, 157, 143, 0.15);
}

.gauge-right {
    right: 0;
    border-right: none;
    border-left: 1px solid rgba(58, 157, 143, 0.15);
    animation: fadeIn 500ms 1200ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    align-items: center;
}

/* Mini bars in left gauge */
.mini-bar {
    width: 100%;
    height: 60px;
    background: rgba(58, 157, 143, 0.1);
    border: 1px solid rgba(58, 157, 143, 0.2);
    position: relative;
    overflow: hidden;
}

.mini-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--h, 50%);
    background: var(--sonar-teal);
    opacity: 0.6;
    animation: barPulse 3s ease-in-out infinite alternate;
}

@keyframes barPulse {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* Status dots in right gauge */
.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}

.status-dot.active {
    background: var(--sonar-teal);
    box-shadow: 0 0 8px rgba(58, 157, 143, 0.5);
}

.status-dot.waiting {
    background: var(--combustion-amber);
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.5);
    animation-delay: 0.5s;
}

.status-dot.idle {
    background: var(--cathode-gray);
    box-shadow: 0 0 4px rgba(123, 135, 148, 0.3);
    animation-delay: 1s;
}

@keyframes dotPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

/* Main content */
.control-center {
    margin-left: 64px;
    margin-right: 64px;
    padding-top: 48px;
}

/* Instrument panels */
.instrument-panel {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 40px;
    position: relative;
    filter: blur(0px);
    transition: filter 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.instrument-panel.blurred {
    filter: blur(4px);
}

/* Scan-line dividers */
.instrument-panel + .instrument-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 1px;
    border-top: 1px dashed rgba(58, 157, 143, 0.4);
}

/* Panel 1: Hero */
.panel-hero {
    text-align: center;
}

.hero-domain {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(3rem, 8vw, 9rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--phosphor-white);
    line-height: 1;
    opacity: 0;
}

.hero-domain .char {
    display: inline-block;
    opacity: 0;
    animation: charReveal 120ms cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes charReveal {
    0% { opacity: 0; color: var(--combustion-amber); }
    50% { opacity: 1; color: var(--combustion-amber); }
    100% { opacity: 1; color: var(--phosphor-white); }
}

.hero-desc {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 2vw, 1.4rem);
    letter-spacing: 0.06em;
    color: var(--cathode-gray);
    margin-top: 1.5rem;
    opacity: 0;
    transition: opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-desc.visible {
    opacity: 1;
}

/* Concurrency rings */
.concurrency-rings {
    margin-top: 3rem;
    width: 260px;
    height: 260px;
}

.concurrency-rings svg {
    width: 100%;
    height: 100%;
}

.ring-1 {
    animation: ringRotate 8s linear infinite;
    transform-origin: 130px 130px;
}

.ring-2 {
    animation: ringRotate 13s linear infinite reverse;
    transform-origin: 130px 130px;
}

.ring-3 {
    animation: ringRotate 21s linear infinite;
    transform-origin: 130px 130px;
}

@keyframes ringRotate {
    to { transform: rotate(360deg); }
}

/* Panel titles */
.panel-title {
    font-family: 'Chakra Petch', sans-serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    letter-spacing: 0.06em;
    color: var(--phosphor-white);
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-align: center;
}

.panel-desc {
    max-width: 580px;
    color: var(--cathode-gray);
    text-align: center;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Thread matrix */
.thread-matrix {
    display: grid;
    grid-template-columns: repeat(16, 12px);
    grid-template-rows: repeat(8, 12px);
    gap: 2px;
    transform: scale(0.85);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.thread-matrix.active {
    transform: scale(1);
}

.thread-cell {
    width: 12px;
    height: 12px;
    background: var(--reactor-black);
    transition: background 200ms;
}

.thread-cell.state-active {
    background: var(--sonar-teal);
    box-shadow: 0 0 4px rgba(58, 157, 143, 0.4);
}

.thread-cell.state-waiting {
    background: var(--combustion-amber);
    box-shadow: 0 0 4px rgba(212, 168, 67, 0.4);
}

.thread-cell.state-blocked {
    background: var(--ignition-coral);
    box-shadow: 0 0 4px rgba(232, 93, 74, 0.4);
}

/* Process waterfall */
.waterfall {
    width: 100%;
    max-width: 720px;
    height: 400px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(58, 157, 143, 0.15);
    background: var(--console-charcoal);
}

.waterfall-bar {
    position: absolute;
    left: 0;
    height: 3px;
    animation: waterfallDrop 4s linear forwards;
    opacity: 0.8;
}

.waterfall-bar.short {
    background: var(--sonar-teal);
}

.waterfall-bar.medium {
    background: var(--combustion-amber);
}

.waterfall-bar.long {
    background: var(--ignition-coral);
}

@keyframes waterfallDrop {
    from { top: 0; opacity: 0.8; }
    to { top: 100%; opacity: 0.2; }
}

/* Architecture grid */
.arch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 720px;
    width: 100%;
}

.arch-cell {
    background: var(--console-charcoal);
    border: 1px solid rgba(58, 157, 143, 0.2);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.arch-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    color: var(--cathode-gray);
    text-transform: uppercase;
}

.arch-val {
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: var(--sonar-teal);
    text-shadow: 0 0 8px rgba(58, 157, 143, 0.3);
}

/* Panel 5: Final */
.panel-final .final-domain {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.2rem, 3vw, 2rem);
    letter-spacing: 0.12em;
    color: var(--sonar-teal);
    text-shadow: 0 0 12px rgba(58, 157, 143, 0.4);
    display: block;
    text-align: center;
    margin-top: 2rem;
}

/* Blur-focus scroll animation */
.blur-reveal {
    filter: blur(6px);
    opacity: 0.3;
    transition: filter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blur-reveal.focused {
    filter: blur(0px);
    opacity: 1;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .hero-domain { opacity: 1; }
    .hero-desc { opacity: 1; }
    .telemetry-bar { opacity: 1; }
    .gauge-strip { opacity: 1; }
    .blur-reveal { filter: none; opacity: 1; }
    .thread-matrix { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .telemetry-bar {
        padding: 0 16px;
        font-size: 10px;
    }

    .gauge-strip {
        display: none;
    }

    .control-center {
        margin-left: 0;
        margin-right: 0;
    }

    .instrument-panel {
        padding: 60px 20px;
    }

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

    .thread-matrix {
        grid-template-columns: repeat(8, 12px);
        grid-template-rows: repeat(16, 12px);
    }

    .pulse-container {
        display: none;
    }
}
