/* ==========================================================================
   MYSTERY ANALYZER // VIBRANT HIGH-GLOW NERV MAGI STYLESHEET (NEON EDITION)
   Restored bright neon alert glows, clean hero layout & full NLP features.
   ========================================================================== */

:root {
    --bg-darkest: #030406;
    --bg-primary: #08090d;
    --bg-surface: #0e1117;
    --bg-panel: #141822;
    --bg-panel-hover: #1c2230;
    
    /* Vibrant Electric Neon Accent Colors */
    --accent-red: #ff1100;
    --accent-orange: #ff5500;
    --accent-amber: #ffaa00;
    --accent-green: #00ff66;
    --accent-cyan: #00f0ff;
    
    /* Typography Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-alert: #ff1100;
    
    /* Neon Glowing Borders */
    --border-tech: rgba(255, 17, 0, 0.5);
    --border-dim: rgba(255, 255, 255, 0.12);
    --border-highlight: rgba(255, 85, 0, 0.8);
    
    /* Fonts */
    --font-display: 'Chakra Petch', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-sans: 'Space Grotesk', sans-serif;
    --font-kanji: 'Noto Sans JP', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* RESET & BASE STYLES */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    background-color: var(--bg-darkest);
    color: var(--text-primary);
    font-family: var(--font-sans);
    overflow-x: hidden;
}

body.tactical-hud {
    min-height: 100vh;
    position: relative;
    cursor: default;
}

/* VIBRANT NERV EMERGENCY SCROLLING BAR */
.nerv-emergency-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 24px;
    background: #ff1100;
    color: #000;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    z-index: 10001;
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 0 15px rgba(255, 17, 0, 0.8);
}

.emergency-scroll {
    display: flex;
    white-space: nowrap;
    animation: emergencyMarquee 18s linear infinite;
}

@keyframes emergencyMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* SCANLINES & OVERLAYS */
.scanlines-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.3) 50%
    ), linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.04),
        rgba(0, 255, 0, 0.01),
        rgba(0, 0, 255, 0.04)
    );
    background-size: 100% 3px, 6px 100%;
    opacity: 0.85;
}

.scanlines-overlay.disabled { opacity: 0 !important; }

.at-field-hex-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background-image: radial-gradient(rgba(255, 85, 0, 0.1) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.7;
}

.cyber-grid-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -3;
    background-image: 
        linear-gradient(rgba(255, 17, 0, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 17, 0, 0.08) 1px, transparent 1px);
    background-size: 48px 48px;
}

.vignette-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle at center, transparent 35%, rgba(3, 4, 6, 0.9) 100%);
}

/* CUSTOM CROSSHAIR CURSOR */
.custom-cursor {
    position: fixed;
    width: 36px;
    height: 36px;
    border: 1px solid var(--accent-orange);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.15s, border-color 0.15s;
    z-index: 10000;
}

.custom-cursor::before, .custom-cursor::after {
    content: '';
    position: absolute;
    background: var(--accent-orange);
}

.custom-cursor::before { top: 50%; left: -8px; right: -8px; height: 1px; transform: translateY(-50%); }
.custom-cursor::after { left: 50%; top: -8px; bottom: -8px; width: 1px; transform: translateX(-50%); }

.custom-cursor-dot {
    position: fixed;
    width: 4px;
    height: 4px;
    background: var(--accent-red);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 10001;
}

/* NAVIGATION */
.top-nav {
    position: fixed;
    top: 24px;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(8, 9, 13, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-tech);
    z-index: 1000;
    box-shadow: 0 0 20px rgba(255, 17, 0, 0.2);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.brand-badge { display: flex; align-items: center; gap: 0.75rem; }

.hazard-block {
    width: 14px;
    height: 28px;
    background: repeating-linear-gradient(
        45deg,
        var(--accent-red),
        var(--accent-red) 5px,
        #000 5px,
        #000 10px
    );
}

.brand-logo { display: flex; flex-direction: column; text-decoration: none; }
.brand-prefix { font-family: var(--font-kanji); font-size: 0.7rem; color: var(--accent-amber); letter-spacing: 2px; font-weight: 700; text-shadow: 0 0 8px var(--accent-amber); }
.brand-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text-primary); letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }

.nav-links { display: flex; gap: 2rem; }

.nav-item {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 1px;
}

.nav-num { color: var(--accent-orange); font-size: 0.75rem; }
.nav-item:hover { color: var(--accent-amber); text-shadow: 0 0 10px rgba(255, 170, 0, 0.8); }

.sync-rate-badge {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(255, 85, 0, 0.1);
    border: 1px solid var(--accent-orange);
    padding: 0.35rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0 10px rgba(255, 85, 0, 0.3);
}

.sync-label { color: var(--text-muted); }
.sync-val { color: var(--accent-amber); font-weight: 700; text-shadow: 0 0 8px var(--accent-amber); }

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    background: rgba(0, 255, 102, 0.05);
    border: 1px solid rgba(0, 255, 102, 0.3);
    padding: 0.35rem 0.75rem;
}

.status-pulse {
    width: 8px;
    height: 8px;
    background-color: var(--accent-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-green);
    animation: pulse 1.8s infinite;
}

.status-online { color: var(--accent-green); text-shadow: 0 0 8px var(--accent-green); }

/* HERO SECTION (2-COLUMN GRID) */
.hero-section {
    padding-top: 140px;
    padding-bottom: 80px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

.tactical-header-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-amber);
    letter-spacing: 2px;
    margin-bottom: 1rem;
    text-shadow: 0 0 8px var(--accent-amber);
}

.tag-bracket { color: var(--accent-red); }

.hero-title {
    font-family: var(--font-display);
    font-size: 3.75rem;
    line-height: 1.05;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.highlight-alert {
    color: var(--accent-red);
    text-shadow: 0 0 20px rgba(255, 17, 0, 0.8);
}

.kanji-sub-header {
    font-family: var(--font-kanji);
    font-size: 0.9rem;
    color: var(--accent-orange);
    letter-spacing: 4px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 85, 0, 0.6);
}

.hero-subtitle { font-family: var(--font-mono); font-size: 1.2rem; color: var(--accent-amber); margin-bottom: 1rem; }
.hero-description { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; max-width: 600px; margin-bottom: 2rem; }

.hero-cta-group { display: flex; gap: 1.5rem; margin-bottom: 2.5rem; }

/* VIBRANT NEON BUTTONS */
.btn {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    padding: 1rem 2rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition-fast);
    clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.btn-primary {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 0 25px rgba(255, 17, 0, 0.6);
}

.btn-primary:hover {
    background: #ff331a;
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(255, 17, 0, 0.9);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-tech);
    box-shadow: 0 0 15px rgba(255, 17, 0, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 17, 0, 0.1);
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    box-shadow: 0 0 25px rgba(255, 85, 0, 0.5);
}

.btn-large { padding: 1.25rem 2.75rem; font-size: 1.15rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

.btn-hazard-stripe {
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        #000,
        #000 4px,
        var(--accent-amber) 4px,
        var(--accent-amber) 8px
    );
}

/* MAGI 3-WAY CONSENSUS PANEL */
.magi-consensus-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.magi-core-box {
    background: #000;
    border: 2px solid var(--accent-orange);
    padding: 0.75rem;
    text-align: center;
    box-shadow: 0 0 15px rgba(255, 85, 0, 0.3);
}

.magi-name { font-family: var(--font-display); font-size: 0.85rem; font-weight: 700; color: var(--accent-amber); margin-bottom: 2px; }
.magi-vote.approved { font-family: var(--font-mono); font-size: 0.75rem; color: #000; background: var(--accent-orange); font-weight: 700; padding: 2px 0; margin-bottom: 2px; }
.magi-sub { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }

.hero-telemetry-strip {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--border-dim);
    padding-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.telemetry-item { display: flex; flex-direction: column; gap: 0.2rem; }
.telemetry-label { color: var(--text-muted); }
.telemetry-val { color: var(--accent-orange); text-shadow: 0 0 6px var(--accent-orange); }
.telemetry-divider { width: 1px; height: 25px; background: var(--border-dim); }

/* HERO VISUAL HUD */
.hud-frame.nerv-frame {
    background: var(--bg-surface);
    border: 2px solid var(--accent-red);
    box-shadow: 0 0 45px rgba(255, 17, 0, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.9);
}

.hud-header-bar {
    background: var(--bg-panel);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-tech);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-orange);
}

.hud-canvas-container {
    width: 100%;
    height: 420px;
    position: relative;
    background: radial-gradient(circle at center, #0b0d14 0%, #030406 100%);
}

#heroVisualCanvas { width: 100%; height: 100%; display: block; }

.hud-alert-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 17, 0, 0.2);
    border: 1px solid var(--accent-red);
    padding: 0.4rem 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-red);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 0 10px rgba(255, 17, 0, 0.5);
}

.hud-readout-panel {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: rgba(8, 9, 13, 0.9);
    border: 1px solid var(--border-dim);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.text-orange { color: var(--accent-orange); text-shadow: 0 0 6px var(--accent-orange); }
.text-neon-orange { color: var(--accent-amber); text-shadow: 0 0 6px var(--accent-amber); }
.text-alert-red, .text-red { color: var(--accent-red); text-shadow: 0 0 8px var(--accent-red); }
.text-green { color: var(--accent-green); text-shadow: 0 0 6px var(--accent-green); }

.hud-waveform-box {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(8, 9, 13, 0.9);
    border: 1px solid var(--border-dim);
    padding: 0.5rem;
    width: 140px;
}

.waveform-title { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); margin-bottom: 4px; }
.waveform-bars { display: flex; align-items: flex-end; gap: 2px; height: 25px; }

.waveform-bar {
    flex: 1;
    background: var(--accent-orange);
    height: 30%;
    animation: barPulse 1.2s infinite ease-in-out alternate;
}

.hud-footer-bar {
    background: var(--bg-panel);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-dim);
}

/* SYSTEM CARDS */
.system-section {
    background: radial-gradient(circle at 50% 0%, #0b0d14 0%, var(--bg-darkest) 100%);
    border-top: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
}

.system-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.system-card.nerv-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.system-card.nerv-card:hover {
    border-color: var(--accent-orange);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(255, 17, 0, 0.3);
}

.card-corner { position: absolute; width: 10px; height: 10px; border-color: var(--accent-red); border-style: solid; }
.corner-tl { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.corner-tr { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.corner-bl { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.corner-br { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.card-num { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; color: var(--accent-orange); opacity: 0.7; text-shadow: 0 0 10px var(--accent-orange); }
.card-tag { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.card-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-primary); }
.card-desc { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 2rem; }

.card-specs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-amber);
    margin-bottom: 1.5rem;
}

.card-btn {
    width: 100%;
    padding: 0.85rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-tech);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
}

.card-btn:hover { background: var(--accent-red); color: #fff; box-shadow: 0 0 15px rgba(255, 17, 0, 0.6); }

/* MODAL WORKSPACE & PITCH BLACK TEXTAREAS */
.engine-workspace { display: flex; flex-direction: column; gap: 1.5rem; width: 100%; }

.workspace-full-width { display: flex; flex-direction: column; gap: 1.25rem; width: 100%; }

.input-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pdf-upload-wrapper { position: relative; display: inline-block; }

.pdf-upload-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-tech);
    color: var(--accent-amber);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.2);
}

.pdf-upload-btn:hover {
    background: rgba(255, 85, 0, 0.2);
    border-color: var(--accent-orange);
    color: #fff;
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.5);
}

.pdf-file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.full-width-textarea {
    width: 100%;
    min-height: 240px;
    background: #000000 !important;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 1.25rem;
    border: 1px solid var(--border-tech);
    border-radius: 0;
    resize: vertical;
    outline: none;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 1), 0 0 10px rgba(255, 17, 0, 0.2);
}

.full-width-textarea:focus {
    border-color: var(--accent-orange);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 1), 0 0 15px rgba(255, 85, 0, 0.5);
}

.compare-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
}

.dual-input-col { display: flex; flex-direction: column; gap: 0.75rem; width: 100%; }

.readability-scorecard-panel, .vector-similarity-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.panel-header-title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-orange);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 0.5rem;
    text-shadow: 0 0 6px var(--accent-orange);
}

.readability-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.read-card {
    background: #000;
    border: 1px solid var(--border-dim);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.read-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }
.read-val { font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.read-sub { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-secondary); }

.sentiment-arc-graph-container {
    width: 100%;
    height: 200px;
    background: #000;
    border: 1px solid var(--border-dim);
    margin-top: 1rem;
    padding: 0.5rem;
}

.sentiment-svg-chart { width: 100%; height: 100%; display: block; }
.arc-legend { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-top: 0.5rem; }

.vector-results-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.vector-clean-alert { background: rgba(0, 255, 102, 0.05); border: 1px solid rgba(0, 255, 102, 0.3); padding: 0.8rem 1rem; font-family: var(--font-mono); font-size: 0.85rem; }

.redundancy-item { background: #000; border: 1px solid var(--border-tech); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.red-item-header { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.85rem; }
.red-snippets { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }
.snippet-box { background: var(--bg-panel); padding: 0.6rem; border-left: 2px solid var(--accent-orange); }

/* SECTION: HOW IT WORKS TIMELINE */
.how-it-works-section { position: relative; padding: 6rem 0; }
.timeline-wrapper { position: relative; margin-top: 3rem; }

.timeline-line {
    position: absolute;
    top: 35px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--border-dim);
    z-index: 1;
}

.timeline-pulse-beam {
    width: 120px;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
    animation: timelineBeam 4s infinite linear;
}

.timeline-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; position: relative; z-index: 2; }
.timeline-step { display: flex; flex-direction: column; gap: 1.5rem; }

.step-badge {
    width: 70px;
    height: 70px;
    background: var(--bg-surface);
    border: 2px solid var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent-amber);
    box-shadow: 0 0 20px rgba(255, 85, 0, 0.4);
}

.step-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.step-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }

/* PSYCHOLOGICAL SECTION */
.psychological-section.nerv-psych {
    position: relative;
    background: #000;
    padding: 8rem 0;
    border-top: 2px solid var(--accent-red);
    border-bottom: 2px solid var(--accent-red);
    overflow: hidden;
}

.psych-grid-bg { position: absolute; inset: 0; background-image: radial-gradient(var(--accent-red) 1px, transparent 1px); background-size: 30px 30px; opacity: 0.12; }
.psych-content-box { max-width: 900px; margin: 0 auto; text-align: center; position: relative; z-index: 2; }

.kanji-large-bg {
    font-family: var(--font-kanji);
    font-size: 5rem;
    font-weight: 900;
    color: rgba(255, 17, 0, 0.05);
    letter-spacing: 10px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

.psych-title { font-family: var(--font-display); font-size: 3.5rem; font-weight: 700; line-height: 1.1; margin-bottom: 2rem; text-transform: uppercase; }
.highlight-orange { color: var(--accent-orange); text-shadow: 0 0 20px rgba(255, 85, 0, 0.6); }
.psych-desc { font-size: 1.35rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 3rem; }
.psych-quote-badge { font-family: var(--font-mono); font-size: 0.9rem; color: var(--accent-amber); letter-spacing: 3px; text-shadow: 0 0 8px var(--accent-amber); }

.warning-stripes-top, .warning-stripes-bottom {
    height: 10px;
    width: 100%;
    margin: 2rem 0;
    background: repeating-linear-gradient(
        -45deg,
        var(--accent-red),
        var(--accent-red) 10px,
        #000 10px,
        #000 20px
    );
}

/* TERMINAL PREVIEW */
.terminal-preview-section { background: var(--bg-primary); }

.terminal-container.nerv-terminal {
    background: var(--bg-surface);
    border: 2px solid var(--accent-orange);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
}

.terminal-top-bar {
    background: var(--bg-panel);
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-tech);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-orange);
}

.terminal-body { display: grid; grid-template-columns: 300px 1fr; min-height: 400px; }
.terminal-sidebar { background: rgba(8, 9, 13, 0.7); border-right: 1px solid var(--border-dim); padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }

.telemetry-card { background: var(--bg-panel); border: 1px solid var(--border-dim); padding: 1rem; }
.card-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.card-value-highlight { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--accent-red); text-shadow: 0 0 10px var(--accent-red); }
.card-value-status { font-family: var(--font-mono); font-size: 0.95rem; color: var(--accent-green); text-shadow: 0 0 8px var(--accent-green); }

.progress-bar-container { height: 8px; background: #000; border: 1px solid var(--border-dim); margin-bottom: 0.5rem; }
.progress-bar-fill { height: 100%; background: var(--accent-orange); transition: width 0.5s ease; box-shadow: 0 0 8px var(--accent-orange); }
.card-value-small { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); }

.terminal-controls-group { font-family: var(--font-mono); font-size: 0.8rem; display: flex; flex-direction: column; gap: 0.5rem; }
.slider-input { accent-color: var(--accent-red); cursor: pointer; }

.terminal-main-display { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.terminal-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }

.data-box { background: var(--bg-panel); border: 1px solid var(--border-dim); padding: 1.25rem; }
.box-title { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-orange); margin-bottom: 1rem; border-bottom: 1px solid var(--border-dim); padding-bottom: 0.5rem; }

.subject-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.subject-item { font-family: var(--font-mono); font-size: 0.85rem; display: flex; justify-content: space-between; padding: 0.4rem 0.6rem; background: rgba(0, 0, 0, 0.4); border-left: 3px solid transparent; cursor: pointer; }
.subject-item.active { border-left-color: var(--accent-red); background: rgba(255, 17, 0, 0.15); }
.subj-risk.high { color: var(--accent-red); }
.subj-risk.med { color: var(--accent-amber); }

.metrics-box .metric-row { font-family: var(--font-mono); font-size: 0.9rem; display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px dashed var(--border-dim); }

.terminal-console-stream { background: #000; border: 1px solid var(--border-dim); padding: 1rem; font-family: var(--font-mono); font-size: 0.8rem; }
.stream-header { color: var(--text-muted); margin-bottom: 0.5rem; }
.stream-output { display: flex; flex-direction: column; gap: 0.4rem; max-height: 120px; overflow-y: auto; }
.log-line { color: var(--text-secondary); }
.log-line.warning { color: var(--accent-amber); }
.log-line.success { color: var(--accent-green); }

.terminal-footer-bar { background: var(--bg-panel); padding: 0.5rem 1.5rem; display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border-dim); }

/* FINAL CTA SECTION */
.final-cta-section { padding: 8rem 0; background: radial-gradient(circle at center, #1a0805 0%, var(--bg-darkest) 100%); }

.cta-card.nerv-cta {
    background: var(--bg-surface);
    border: 2px solid var(--accent-red);
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 50px rgba(255, 17, 0, 0.3);
}

.hazard-border-top, .hazard-border-bottom {
    height: 8px;
    background: repeating-linear-gradient(
        45deg,
        var(--accent-red),
        var(--accent-red) 8px,
        #000 8px,
        #000 16px
    );
}

.final-cta-title { font-family: var(--font-display); font-size: 3rem; font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; }
.final-cta-subtext { font-size: 1.25rem; color: var(--accent-amber); margin-bottom: 2.5rem; font-family: var(--font-mono); }

/* MODAL OVERLAY */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 4, 6, 0.92);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active { opacity: 1; pointer-events: auto; }

.modal-window.nerv-modal {
    width: 92%;
    max-width: 1100px;
    height: 88vh;
    background: var(--bg-surface);
    border: 2px solid var(--accent-red);
    box-shadow: 0 0 60px rgba(255, 17, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header { background: var(--bg-panel); padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-tech); }
.modal-badge { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-orange); }
.modal-title { font-family: var(--font-display); font-size: 1.5rem; color: var(--text-primary); }

.modal-close { background: none; border: none; font-size: 2rem; color: var(--text-secondary); cursor: pointer; }
.modal-close:hover { color: var(--accent-red); }

.modal-body { flex: 1; padding: 2rem; overflow-y: auto; }
.modal-footer { background: var(--bg-panel); padding: 1rem 1.5rem; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border-dim); }

/* FOOTER */
.main-footer { background: #000; border-top: 1px solid var(--border-dim); padding: 2rem 0; }
.footer-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: 0.8rem; }
.footer-brand { color: var(--text-primary); font-weight: 700; }
.footer-copyright { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }
.footer-right { display: flex; align-items: center; gap: 2rem; }

.scanline-toggle-btn { background: none; border: 1px solid var(--border-dim); color: var(--text-secondary); padding: 0.4rem 0.8rem; font-family: var(--font-mono); font-size: 0.75rem; cursor: pointer; }
.scanline-toggle-btn:hover { border-color: var(--accent-orange); color: var(--accent-orange); }

/* ANIMATIONS */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes timelineBeam { 0% { transform: translateX(-100%); } 100% { transform: translateX(1000%); } }
@keyframes barPulse { 0% { height: 15%; } 100% { height: 95%; } }
@keyframes countUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── HOMEPAGE LIVE STATS SECTION ──────────────────────────────────────── */
.homepage-stats-section {
    padding: 5rem 0;
    background: #000;
    border-top: 1px solid var(--border-tech);
    border-bottom: 1px solid var(--border-tech);
    position: relative;
}

.homepage-stats-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%, rgba(255,17,0,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.stats-section-header { text-align: center; margin-bottom: 3rem; }

.homepage-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.hp-stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: var(--transition-smooth);
}

.hp-stat-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.hp-stat-card:hover {
    border-color: var(--border-tech);
    box-shadow: 0 0 25px rgba(255,17,0,0.2);
    transform: translateY(-3px);
}

.hp-stat-card:hover::before { opacity: 1; }

.hp-stat-icon { font-size: 1.75rem; margin-bottom: 1rem; }

.hp-stat-number {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent-orange);
    text-shadow: 0 0 15px rgba(255,85,0,0.6);
    margin-bottom: 0.5rem;
    animation: countUp 0.6s ease both;
}

.hp-stat-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ─── ANALYTICS MODAL: GLOBAL STATS GRID ──────────────────────────────── */
.analytics-global-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.global-stat-card {
    background: #000;
    border: 1px solid var(--border-dim);
    padding: 1.25rem 1rem;
    text-align: center;
    position: relative;
    transition: var(--transition-fast);
}

.global-stat-card:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255,85,0,0.25);
}

.gstat-icon { font-size: 1.25rem; margin-bottom: 0.5rem; }

.gstat-number {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent-orange);
    text-shadow: 0 0 10px rgba(255,85,0,0.5);
    margin-bottom: 0.4rem;
}

.gstat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

/* ─── ANALYTICS CHART PANEL ───────────────────────────────────────────── */
.analytics-chart-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

/* ─── NLP STATUS MESSAGES ──────────────────────────────────────────────── */
.no-text-warning {
    background: rgba(255,170,0,0.08);
    border: 1px solid rgba(255,170,0,0.35);
    color: var(--accent-amber);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.text-loaded-ok {
    background: rgba(0,255,102,0.05);
    border: 1px solid rgba(0,255,102,0.25);
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
}

.empty-nlp-msg {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 1.5rem;
    text-align: center;
    border: 1px dashed var(--border-dim);
}

.redis-offline-note {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-amber);
    text-align: center;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: rgba(255,170,0,0.05);
    border: 1px solid rgba(255,170,0,0.2);
}

/* ─── WORKSPACE HELPERS ─────────────────────────────────────────────────── */
.workspace-header { margin-bottom: 1.5rem; }
.workspace-header .header-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-orange);
    margin-bottom: 0.5rem;
}
.workspace-header h4 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.workspace-header p { font-size: 0.9rem; color: var(--text-secondary); }

.panel-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.file-status-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-green);
    text-shadow: 0 0 6px var(--accent-green);
}

.file-loaded-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-amber);
    background: rgba(255,170,0,0.1);
    border: 1px solid rgba(255,170,0,0.3);
    padding: 2px 8px;
    margin-left: 0.5rem;
}

.action-bar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

/* Results, Loading, Profiles */
.results-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 1.5rem;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.placeholder-state {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 2rem;
}

.pulse-dot {
    width: 10px; height: 10px;
    background: var(--accent-red);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-red);
    animation: pulse 1.5s infinite;
    flex-shrink: 0;
}

.loading-state {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--accent-amber);
    padding: 2rem;
}

.spinner {
    width: 22px; height: 22px;
    border: 2px solid var(--border-dim);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* Analysis Report */
.analysis-report { display: flex; flex-direction: column; gap: 1.25rem; }
.report-badge {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent-red);
    background: rgba(255,17,0,0.1);
    border: 1px solid var(--border-tech);
    padding: 0.6rem 1rem;
    text-shadow: 0 0 8px var(--accent-red);
}
.report-title { font-family: var(--font-display); font-size: 1rem; color: var(--accent-amber); }
.clue-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.clue-list li { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-secondary); padding-left: 1rem; border-left: 2px solid var(--accent-red); }

.motives-breakdown { display: flex; flex-direction: column; gap: 0.75rem; }
.motives-breakdown h6 { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-muted); }
.vector-bar { display: flex; flex-direction: column; gap: 0.3rem; }
.vector-bar span { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); }
.bar-track { height: 6px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-dim); }
.bar-fill { height: 100%; }
.bar-fill.red { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.bar-fill.orange { background: var(--accent-orange); box-shadow: 0 0 8px var(--accent-orange); }

/* Character Dossier */
.character-dossier-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.character-selector-list { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }

.char-tab-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
    transition: var(--transition-fast);
    min-width: 180px;
}
.char-tab-btn.active { border-color: var(--accent-red); background: rgba(255,17,0,0.1); }
.char-tab-btn:hover { border-color: var(--accent-orange); }
.char-role { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }
.char-name { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.char-badge { font-family: var(--font-mono); font-size: 0.7rem; color: var(--accent-red); text-shadow: 0 0 6px var(--accent-red); }

.character-profile-view { background: var(--bg-panel); border: 1px solid var(--border-dim); padding: 1.75rem; }
.profile-card { display: flex; flex-direction: column; gap: 1.25rem; }
.profile-header { display: flex; justify-content: space-between; align-items: flex-start; }
.profile-header h3 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; }
.profile-role { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-muted); }
.profile-threat-banner { display: flex; justify-content: space-between; padding: 0.75rem 1rem; background: rgba(255,17,0,0.08); border: 1px solid var(--border-tech); font-family: var(--font-mono); font-size: 0.9rem; }
.profile-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.detail-block strong { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 0.4rem; }
.detail-block p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.trait-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.3rem; }
.trait-tag { font-family: var(--font-mono); font-size: 0.75rem; background: rgba(255,85,0,0.1); border: 1px solid rgba(255,85,0,0.3); color: var(--accent-orange); padding: 0.25rem 0.6rem; }

/* Section layout helpers */
.section-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; }
.section-header { margin-bottom: 3rem; }
.section-header.center-align { text-align: center; }
.stats-section-header { text-align: center; }
.tactical-badge { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent-orange); letter-spacing: 2px; margin-bottom: 1rem; text-shadow: 0 0 6px var(--accent-orange); }
.section-title { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; text-transform: uppercase; }
.section-subtext { font-size: 1.05rem; color: var(--text-secondary); line-height: 1.6; }

/* RESPONSIVE DESIGN */
@media (max-width: 1024px) {
    .hero-container { grid-template-columns: 1fr; gap: 3rem; }
    .timeline-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; }
    .timeline-line { display: none; }
    .terminal-body { grid-template-columns: 1fr; }
    .compare-dual-grid { grid-template-columns: 1fr; }
    .red-snippets { grid-template-columns: 1fr; }
    .homepage-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .analytics-global-stats-grid { grid-template-columns: repeat(3, 1fr); }
    .profile-details { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .nav-links { display: none; position: fixed; top: 94px; left: 0; width: 100%; background: var(--bg-surface); flex-direction: column; padding: 2rem; border-bottom: 1px solid var(--border-tech); }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: block; }
    .timeline-grid { grid-template-columns: 1fr; }
    .psych-title { font-size: 2.2rem; }
    .magi-consensus-panel { grid-template-columns: 1fr; }
    .input-controls-row { flex-direction: column; align-items: stretch; }
    .compare-dual-grid { grid-template-columns: 1fr; }
    .homepage-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-global-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .hp-stat-number { font-size: 1.75rem; }
    .section-title { font-size: 1.85rem; }
}

/* NERV / MAGI-ENGINE LOGO */
.nerv-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    position: relative;
    z-index: 10000;
    background: #000;
}
