/* ===================================
   PARALLENGINE.COM - Mission Control
   =================================== */

/* --- Palette --- */
:root {
    --deep-space: #050510;
    --neon-blue: #00AAFF;
    --neon-green: #00FF88;
    --warning-orange: #FF8C00;
    --panel-dark: #0A0A1F;
    --ghost-text: #8888AA;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Exo 2', sans-serif;
    font-size: 0.95rem;
    line-height: 1.65;
    font-weight: 400;
    color: var(--ghost-text);
    background-color: var(--deep-space);
    overflow-x: hidden;
}

/* --- Circuit Board Background Grid --- */
#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(var(--neon-blue) 1px, transparent 1px),
        linear-gradient(90deg, var(--neon-blue) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.03;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#hero-content {
    text-align: center;
    position: relative;
}

#hero-title {
    font-family: 'Fira Code', monospace;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: var(--neon-blue);
    letter-spacing: 0.15em;
    text-shadow: 0 0 20px rgba(0, 170, 255, 0.5), 0 0 40px rgba(0, 170, 255, 0.2);
}

#cursor {
    display: inline-block;
    animation: blink 1s step-end infinite;
    color: var(--neon-blue);
}

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

#hero-subtitle {
    font-family: 'Exo 2', sans-serif;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: var(--ghost-text);
    letter-spacing: 0.3em;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#hero-subtitle.visible {
    opacity: 1;
}

#hero-line {
    width: 0;
    height: 1px;
    background: var(--neon-blue);
    margin: 2rem auto 0;
    box-shadow: 0 0 8px var(--neon-blue), 0 0 16px rgba(0, 170, 255, 0.3);
    transition: width 1.2s ease;
}

#hero-line.expanded {
    width: min(80vw, 600px);
}

/* --- Circuit Trace SVG Overlay --- */
#circuit-traces {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.trace-line {
    stroke: var(--neon-blue);
    stroke-width: 1;
    fill: none;
    opacity: 0.4;
    filter: url(#glow);
}

.trace-node {
    fill: var(--neon-green);
    opacity: 0;
    animation: nodePulse 2s ease-in-out infinite;
}

.trace-node:nth-child(odd) {
    animation-delay: 0.5s;
}

@keyframes nodePulse {
    0%, 100% { opacity: 0.3; r: 2; }
    50% { opacity: 1; r: 4; }
}

/* --- Dashboard Section --- */
#dashboard {
    position: relative;
    z-index: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Bento Grid --- */
#bento-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: auto;
    gap: 4px;
}

/* --- Panel Base Styles --- */
.panel {
    background: var(--panel-dark);
    border: 1px solid var(--neon-blue);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(0, 170, 255, 0.15);
    overflow: hidden;
    position: relative;
}

.panel-reveal {
    opacity: 0.4;
    transform: scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.panel-reveal.revealed {
    opacity: 1;
    transform: scale(1);
}

.panel-large {
    grid-column: 2 / 3;
}

.panel-full {
    grid-column: 1 / -1;
}

.panel-half {
    grid-column: span 1;
}

/* Two equal feature panels side by side — need to span properly */
#panel-feature-1 {
    grid-column: 1 / 2;
}

#panel-feature-2 {
    grid-column: 2 / 4;
}

/* --- Panel Header --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(0, 170, 255, 0.15);
    background: rgba(0, 170, 255, 0.03);
}

.panel-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon-blue);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-indicator {
    width: 6px;
    height: 6px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--neon-green);
    animation: indicatorPulse 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* --- Panel Body --- */
.panel-body {
    padding: 1.2rem 1rem;
}

/* --- Status Panel --- */
.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(0, 170, 255, 0.06);
}

.status-row:last-child {
    border-bottom: none;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-green), 0 0 20px rgba(0, 255, 136, 0.3);
    animation: statusPulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 6px var(--neon-green); }
    50% { box-shadow: 0 0 14px var(--neon-green), 0 0 28px rgba(0, 255, 136, 0.4); }
}

.status-text {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--neon-green);
    margin-left: 0.8rem;
}

.metric-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    color: var(--ghost-text);
    letter-spacing: 0.05em;
}

.metric-value {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--neon-blue);
    font-weight: 400;
}

/* --- Engine Panel --- */
.panel-engine-body {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.engine-text {
    flex: 1;
}

.engine-text p {
    margin-bottom: 1rem;
    color: var(--ghost-text);
    font-size: 0.9rem;
}

.engine-text p:last-child {
    margin-bottom: 0;
}

.engine-viz {
    flex: 0 0 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}

/* --- CSS Wireframe Sphere --- */
.wireframe-sphere {
    width: 150px;
    height: 150px;
    position: relative;
    transform-style: preserve-3d;
    animation: sphereRotate 12s linear infinite;
}

.sphere-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    margin-top: -70px;
    margin-left: -70px;
    border: 1px solid var(--neon-blue);
    border-radius: 50%;
    opacity: 0.6;
}

.ring-1 { transform: rotateX(0deg) rotateY(0deg); }
.ring-2 { transform: rotateX(60deg) rotateY(0deg); }
.ring-3 { transform: rotateX(120deg) rotateY(0deg); }
.ring-4 { transform: rotateX(0deg) rotateY(60deg); }
.ring-5 { transform: rotateX(0deg) rotateY(120deg); }
.ring-6 { transform: rotateX(90deg) rotateY(90deg); }

@keyframes sphereRotate {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(0deg); }
}

/* --- Thread Counter Panel --- */
.thread-counter {
    text-align: center;
    padding: 0.5rem 0;
}

.counter-value {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.4);
}

.thread-label {
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-size: 0.65rem;
    color: var(--ghost-text);
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.thread-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.thread-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-green));
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px var(--neon-blue);
}

/* --- Architecture Panel --- */
.ascii-art {
    overflow-x: auto;
    padding: 1rem 0;
}

.ascii-art code {
    font-family: 'Fira Code', monospace;
    font-size: clamp(0.55rem, 0.9vw, 0.75rem);
    color: var(--neon-blue);
    line-height: 1.4;
    white-space: pre;
    display: block;
    text-shadow: 0 0 4px rgba(0, 170, 255, 0.2);
}

/* --- Feature Panels --- */
.feature-title {
    font-family: 'Fira Code', monospace;
    font-size: clamp(1rem, 1.5vw, 1.4rem);
    font-weight: 700;
    color: var(--neon-blue);
    margin-bottom: 0.8rem;
}

.feature-text {
    color: var(--ghost-text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.feature-code {
    background: rgba(0, 170, 255, 0.05);
    border: 1px solid rgba(0, 170, 255, 0.15);
    border-radius: 2px;
    padding: 0.6rem 1rem;
    margin-bottom: 1.2rem;
}

.feature-code code {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--neon-green);
}

/* --- Circuit Decoration in Feature Panels --- */
.circuit-decoration {
    padding-top: 0.5rem;
}

.circuit-svg {
    width: 100%;
    height: 40px;
}

.circuit-line {
    stroke: var(--neon-blue);
    stroke-width: 1;
    opacity: 0.4;
}

.circuit-node-dot {
    fill: var(--neon-green);
    animation: nodePulse 2s ease-in-out infinite;
}

/* --- Footer --- */
#footer {
    position: relative;
    z-index: 1;
    padding: 2rem;
    border-top: 1px solid rgba(0, 170, 255, 0.15);
    margin-top: 2rem;
    background: var(--deep-space);
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-brand {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--neon-blue);
    letter-spacing: 0.15em;
}

.footer-divider {
    color: rgba(0, 170, 255, 0.3);
}

.footer-uptime {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--ghost-text);
}

#uptime-counter {
    color: var(--neon-green);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    #bento-grid {
        grid-template-columns: 1fr;
    }

    .panel-large,
    .panel-full,
    .panel-half,
    #panel-feature-1,
    #panel-feature-2 {
        grid-column: 1 / -1;
    }

    .panel-engine-body {
        flex-direction: column;
    }

    .engine-viz {
        flex: none;
        width: 100%;
        justify-content: center;
    }

    .ascii-art code {
        font-size: 0.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-divider {
        display: none;
    }
}

@media (max-width: 600px) {
    #dashboard {
        padding: 1rem;
    }

    .panel-body {
        padding: 1rem 0.8rem;
    }
}
