/* ============================================
   ANIBAL SANTA CRUZ — 3D PORTFOLIO
   Cybernetic Laboratory / Data Constellation
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #0A0F1D;
    --bg-panel: rgba(10, 15, 29, 0.85);
    --bg-panel-border: rgba(0, 240, 255, 0.15);
    --cyan: #00F0FF;
    --cyan-dim: rgba(0, 240, 255, 0.3);
    --cyan-glow: rgba(0, 240, 255, 0.12);
    --purple: #B486FF;
    --purple-dim: rgba(180, 134, 255, 0.35);
    --purple-glow: rgba(180, 134, 255, 0.18);
    --silver: #C0D0E0;
    --silver-dim: rgba(192, 208, 224, 0.5);
    --gold: #FFD700;
    --gold-dim: rgba(255, 215, 0, 0.3);

    --text-primary: #eef4ff;
    --text-secondary: rgba(200, 215, 240, 1);
    --text-dim: rgba(200, 215, 240, 1);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --panel-blur: 20px;
    --transition-smooth: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    cursor: default;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-tap-highlight-color: transparent;
}

/* --- Canvas Container --- */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    touch-action: none;
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#webgl-fallback {
    display: none !important;
}

/* 2D Fallback Background when WebGL is unavailable */
body.no-webgl #canvas-container {
    display: block !important;
    background: radial-gradient(circle at 50% 30%, #16203a 0%, #0A0F1D 60%, #040710 100%);
    position: fixed;
    inset: 0;
}

body.no-webgl #canvas-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #00F0FF, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 40px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 90px 40px, #B486FF, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, #FFD700, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 230px 190px, #00F0FF, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 280px 80px, #E64A19, rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 320px 320px;
    opacity: 0.75;
    animation: stars-pulse 8s ease-in-out infinite alternate;
}

@keyframes stars-pulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0.9; transform: scale(1.02); }
}


/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none !important;
}

.loading-panel {
    width: min(560px, calc(100% - 48px));
    padding: 32px 28px;
    background: rgba(6, 12, 24, 0.95);
    border: 1px solid rgba(255, 95, 22, 0.22);
    border-radius: 24px;
    box-shadow: 0 0 80px rgba(255, 95, 22, 0.14);
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.loading-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loading-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    color: #ffffff;
    opacity: 0.85;
    text-transform: uppercase;
}

.loading-title {
    font-family: var(--font-display);
    font-size: clamp(42px, 6vw, 60px);
    line-height: 1;
    color: #ffffff;
    font-weight: 800;
    text-transform: uppercase;
}

.loading-author {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 2px;
    color: #ffffff;
    opacity: 0.75;
    text-transform: uppercase;
}

.loading-bar-wrap {
    display: grid;
    gap: 10px;
    align-items: center;
}

.loading-bar-track {
    width: 100%;
    height: 18px;
    border-radius: 999px;
    background: rgba(255, 95, 22, 0.12);
    overflow: hidden;
    border: 1px solid rgba(255, 95, 22, 0.24);
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,95,22,1) 0%, rgba(255, 175, 86, 1) 48%, rgba(255, 255, 255, 1) 100%);
    box-shadow: 0 0 18px rgba(255, 95, 22, 0.28);
    transition: width 0.24s ease;
}

.loading-percent {
    display: block;
    font-family: var(--font-display);
    font-size: 14px;
    color: #ffffff;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}



/* ============================================
   HUD OVERLAY
   ============================================ */
#hud-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    padding: 20px 24px;
    opacity: 0;
    transition: opacity 1s ease 0.5s;
}

#hud-overlay.visible {
    opacity: 1;
}

.hud-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hud-corner.top-left { top: 20px; left: 24px; }
.hud-corner.top-right { top: 20px; right: 24px; align-items: flex-end; }
.hud-corner.bottom-left { bottom: 20px; left: 24px; }
.hud-corner.bottom-right { bottom: 20px; right: 24px; align-items: flex-end; }

.hud-text {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan-dim);
    text-transform: uppercase;
}

.hud-text.dim {
    color: var(--text-dim);
    text-shadow: none;
}

#audio-control {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 12;
    padding: 10px 16px;
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 4px;
    background: rgba(10, 15, 29, 0.92);
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.08);
    transition: all 0.25s ease;
    pointer-events: all;
}

#audio-control:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--cyan);
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.18);
}

#audio-control.active {
    background: rgba(180, 134, 255, 0.08);
    border-color: #B486FF;
    color: #B486FF;
}

/* --- Crosshair --- */
#crosshair {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    filter: drop-shadow(0 0 6px var(--cyan-dim));
}

#crosshair.hidden {
    opacity: 0;
}

#crosshair.visible {
    opacity: 1;
}


/* ============================================
   NAVIGATION DOTS
   ============================================ */
#nav-dots {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transition: opacity 1s ease 1s;
}

#nav-dots.visible {
    opacity: 1;
}

.nav-dot {
    position: relative;
    width: auto;
    min-width: 34px;
    height: 34px;
    padding: 0 10px 0 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: all;
    touch-action: manipulation;
    transition: transform 0.3s var(--transition-smooth);
}

.nav-dot:hover {
    transform: translateX(-2px);
}

.nav-dot.disabled,
.nav-dot:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.dot-ring {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-dim);
    transition: all 0.25s var(--transition-smooth);
    position: relative;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dot-ring::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.25s var(--transition-smooth), transform 0.25s var(--transition-smooth);
    transform: scale(0.95);
}

.nav-dot.active {
    background: transparent;
}

.nav-dot.active .dot-ring {
    border-color: var(--cyan);
    box-shadow: none;
    transform: scale(1.05);
}

.nav-dot.active .dot-ring::after {
    background: var(--cyan);
    transform: scale(1);
}

.nav-dot:hover .dot-ring {
    border-color: var(--cyan);
    transform: scale(1.1);
}

.dot-label {
    position: absolute;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 1px;
    color: #fff;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s var(--transition-smooth);
    pointer-events: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
}

.nav-dot:hover .dot-label {
    opacity: 1;
}

/* Dot colors by node */
.nav-dot[data-node="core"] .dot-ring {
    border-color: var(--cyan);
}

.nav-dot[data-node="intelica"] .dot-ring {
    border-color: #E64A19;
}

.nav-dot[data-node="core"] .dot-label {
    color: var(--cyan);
}

.nav-dot[data-node="intelica"] .dot-label {
    color: #E64A19;
}

.nav-dot[data-node="education"] .dot-ring {
    border-color: var(--purple);
}

.nav-dot[data-node="education"] .dot-label {
    color: var(--purple);
}

.nav-dot[data-node="innovation"] .dot-ring {
    border-color: var(--gold);
}

.nav-dot[data-node="innovation"] .dot-label {
    color: var(--gold);
}

.nav-dot:hover[data-node="core"] .dot-ring {
    border-color: var(--cyan);
}

.nav-dot:hover[data-node="intelica"] .dot-ring {
    border-color: #E64A19;
}

.nav-dot:hover[data-node="education"] .dot-ring {
    border-color: var(--purple);
}

.nav-dot:hover[data-node="innovation"] .dot-ring {
    border-color: var(--gold);
}

.nav-dot.active[data-node="core"] .dot-ring {
    border-color: var(--cyan);
    box-shadow: 0 0 10px var(--cyan-dim);
}

.nav-dot.active[data-node="intelica"] .dot-ring {
    border-color: #E64A19;
    box-shadow: 0 0 10px rgba(230, 74, 25, 0.3);
}

.nav-dot.active[data-node="core"] .dot-ring::after {
    background: var(--cyan);
}

.nav-dot.active[data-node="intelica"] .dot-ring::after {
    background: #E64A19;
}

.nav-dot.active[data-node="education"] .dot-ring {
    border-color: var(--purple);
    box-shadow: 0 0 10px var(--purple-dim);
}

.nav-dot.active[data-node="education"] .dot-ring::after {
    background: var(--purple);
}

.nav-dot.active[data-node="innovation"] .dot-ring {
    border-color: var(--gold);
    box-shadow: 0 0 10px var(--gold-dim);
}

.nav-dot.active[data-node="innovation"] .dot-ring::after {
    background: var(--gold);
}

/* ============================================
   DETAIL PANELS — Holographic UI
   ============================================ */
.detail-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 480px;
    height: 100%;
    z-index: 50;
    padding: 60px 0 40px 0;
    display: flex;
    align-items: stretch;
    transition: transform 0.6s var(--transition-smooth), opacity 0.5s ease;
    pointer-events: none;
}

.detail-panel.hidden {
    transform: translateX(-60px);
    opacity: 0;
}

.detail-panel.visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

.panel-chrome {
    width: 100%;
    margin: 0 0 0 24px;
    background: var(--bg-panel);
    backdrop-filter: blur(var(--panel-blur));
    -webkit-backdrop-filter: blur(var(--panel-blur));
    border: 1px solid var(--bg-panel-border);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    touch-action: auto;
}

.panel-chrome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.6;
}

.panel-chrome::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, var(--cyan), transparent 60%);
    opacity: 0.4;
}

/* --- Panel Header --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.08);
    flex-shrink: 0;
}

.panel-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}


.status-dot.cyan { background: var(--cyan); box-shadow: 0 0 8px var(--cyan-dim); }
.status-dot.purple { background: var(--purple); box-shadow: 0 0 8px var(--purple-dim); }
.status-dot.gold { background: var(--gold); box-shadow: 0 0 8px var(--gold-dim); }
.status-dot.orange { background: #E64A19; box-shadow: 0 0 8px rgba(230, 74, 25, 0.5); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-dim);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: var(--cyan);
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 2px;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-back:hover {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--cyan);
    box-shadow: 0 0 15px var(--cyan-glow);
}

#panel-innovation .btn-back {
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: var(--gold);
}

#panel-innovation .btn-back:hover {
    background: rgba(255, 215, 0, 0.08);
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-dim);
}

#panel-intelica .btn-back {
    border: 1px solid rgba(230, 74, 25, 0.2);
    color: #E64A19;
}

#panel-intelica .btn-back:hover {
    background: rgba(230, 74, 25, 0.08);
    border-color: #E64A19;
    box-shadow: 0 0 15px rgba(230, 74, 25, 0.3);
}

/* --- Panel Body --- */
.panel-body {
    padding: 24px 24px 30px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--cyan-dim) transparent;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior-y: contain;
}

.panel-body::-webkit-scrollbar {
    width: 3px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: var(--cyan-dim);
    border-radius: 3px;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
    line-height: 1.2;
}

/* Glitch Effect */
.panel-title.glitch {
    position: relative;
    animation: glitch-skew 4s infinite linear alternate-reverse;
}

.panel-title.glitch::before,
.panel-title.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.panel-title.glitch::before {
    color: var(--cyan);
    animation: glitch-1 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
    opacity: 0.5;
}

.panel-title.glitch::after {
    color: var(--purple);
    animation: glitch-2 2s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
    opacity: 0.5;
}

@keyframes glitch-1 {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 1px); }
    94% { transform: translate(2px, -1px); }
    96% { transform: translate(-1px, 2px); }
}

@keyframes glitch-2 {
    0%, 88%, 100% { transform: translate(0); }
    90% { transform: translate(2px, -1px); }
    93% { transform: translate(-2px, 1px); }
    95% { transform: translate(1px, -2px); }
}

@keyframes glitch-skew {
    0%, 95%, 100% { transform: skew(0deg); }
    96% { transform: skew(0.5deg); }
    97% { transform: skew(-0.3deg); }
}

.panel-subtitle {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--cyan);
    margin-top: 6px;
    text-shadow: 0 0 10px var(--cyan-dim);
}

.panel-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--cyan-dim), transparent);
    margin: 18px 0;
}

.panel-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-weight: 400;
}

.panel-desc strong {
    color: var(--cyan);
    font-weight: 600;
}

/* --- Section Label --- */
.section-label {
    position: relative;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 3px;
    color: #c0d0e0;
    margin: 24px 0 14px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.25), 0 0 20px rgba(255, 118, 233, 0.08);
    overflow: hidden;
    animation: hologram-interference 4.5s infinite ease-in-out;
}

.section-label::before,
.section-label::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    opacity: 0.25;
    pointer-events: none;
}

.section-label::before {
    color: #8bf4ff;
    transform: translateX(-1px);
    clip-path: inset(0 0 65% 0);
    animation: hologram-scan 4.5s infinite ease-in-out;
}

.section-label::after {
    color: #ff79c6;
    transform: translateX(1px);
    clip-path: inset(45% 0 0 0);
    animation: hologram-glitch 8s infinite ease-in-out;
}

@keyframes hologram-interference {
    0%, 100% {
        opacity: 0.95;
        filter: saturate(1) brightness(1.02);
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.2), 0 0 20px rgba(255, 118, 233, 0.08);
    }
    20%, 60% {
        opacity: 0.75;
        filter: saturate(0.8) brightness(1.15);
        text-shadow: 0 0 12px rgba(0, 240, 255, 0.3), 0 0 26px rgba(255, 118, 233, 0.12);
    }
    40%, 80% {
        opacity: 0.9;
        filter: saturate(1.1) brightness(0.95);
        text-shadow: 0 0 7px rgba(0, 240, 255, 0.18), 0 0 16px rgba(255, 118, 233, 0.06);
    }
}

@keyframes hologram-scan {
    0%, 100% {
        transform: translateX(-1px) translateY(0);
        opacity: 0.2;
    }
    45%, 55% {
        transform: translateX(-1px) translateY(100%);
        opacity: 0.45;
    }
}

@keyframes hologram-glitch {
    0%, 80%, 100% {
        transform: translateX(1px) translateY(0);
        opacity: 0.2;
    }
    82%, 84% {
        transform: translateX(2px) translateY(-2px);
        opacity: 0.55;
    }
    86%, 88% {
        transform: translateX(-2px) translateY(2px);
        opacity: 0.6;
    }
}

/* --- Skills Tags --- */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.skill-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 6px 14px;
    border: 1px solid var(--cyan-dim);
    border-radius: 2px;
    color: var(--cyan);
    background: rgba(0, 240, 255, 0.04);
    transition: all 0.3s ease;
    animation: tag-in 0.5s var(--transition-smooth) backwards;
    animation-delay: var(--delay, 0s);
}

.skill-tag:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan);
    box-shadow: 0 0 12px var(--cyan-glow);
    transform: translateY(-2px);
}

@keyframes tag-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* --- Radar Chart --- */
#radar-chart {
    display: block;
    margin: 0 auto 10px;
    max-width: 100%;
}

/* --- Action Buttons --- */
.panel-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--cyan-dim);
    border-radius: 3px;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-primary);
    background: rgba(0, 240, 255, 0.04);
    transition: all 0.3s var(--transition-smooth);
    cursor: pointer;
}

.action-btn .btn-icon {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--cyan);
}

.action-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan);
    box-shadow: 0 0 20px var(--cyan-glow), inset 0 0 20px var(--cyan-glow);
    transform: translateY(-2px);
}

.action-btn.linkedin:hover { border-color: #0077B5; box-shadow: 0 0 20px rgba(0, 119, 181, 0.2); }
.action-btn.behance:hover { border-color: #1769FF; box-shadow: 0 0 20px rgba(23, 105, 255, 0.2); }
.action-btn.email:hover { border-color: var(--purple); box-shadow: 0 0 20px var(--purple-glow); }

/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.metric-card {
    text-align: center;
    padding: 16px 8px;
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: 4px;
    background: rgba(0, 240, 255, 0.02);
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.metric-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--cyan);
    text-shadow: 0 0 20px var(--cyan-dim);
    display: inline;
}

.metric-symbol {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--cyan);
    opacity: 0.6;
    margin-left: 2px;
}

.metric-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-top: 8px;
    line-height: 1.4;
    text-transform: uppercase;
}

/* --- Module List --- */
.module-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.module-item {
    display: flex;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(0, 240, 255, 0.06);
    border-radius: 3px;
    background: rgba(0, 240, 255, 0.02);
    transition: all 0.3s ease;
}

.module-item:hover {
    border-color: var(--cyan-dim);
    background: rgba(0, 240, 255, 0.05);
}

.module-icon {
    font-size: 18px;
    color: var(--cyan);
    flex-shrink: 0;
    margin-top: 2px;
}

.module-item strong {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.module-item p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 4px;
}

/* --- Pillar Grid --- */
.pillar-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.pillar-card {
    padding: 18px;
    border: 1px solid rgba(157, 0, 255, 0.1);
    border-radius: 4px;
    background: rgba(157, 0, 255, 0.03);
    transition: all 0.3s ease;
}

.pillar-card:hover {
    border-color: var(--purple-dim);
    background: rgba(157, 0, 255, 0.06);
    transform: translateX(4px);
}

.pillar-icon {
    margin-bottom: 10px;
}

.pillar-card strong {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--purple);
    display: block;
    margin-bottom: 6px;
}

.pillar-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Innovation Sections --- */
.innovation-section {
    position: relative;
    padding-left: 36px;
}

.section-badge {
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    border: 1px solid var(--gold-dim);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    color: var(--gold);
}

.section-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.section-role {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.section-separator {
    height: 1px;
    background: linear-gradient(90deg, var(--gold-dim), transparent);
    margin: 20px 0;
}



/* Innovation Panel — Gold Theme */
#panel-innovation .panel-title {
    color: var(--gold);
}

#panel-innovation .panel-subtitle {
    color: var(--gold);
}

#panel-innovation .section-title {
    color: var(--gold);
}

#panel-innovation .status-dot {
    background-color: var(--gold);
    box-shadow: 0 0 8px var(--gold);
}

#panel-innovation .panel-desc strong {
    color: var(--gold);
}

#panel-innovation .panel-chrome {
    border: 1px solid rgba(255, 215, 0, 0.15);
}

#panel-innovation .panel-chrome::before {
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

#panel-innovation .panel-chrome::after {
    background: linear-gradient(180deg, var(--gold), transparent 60%);
}

#panel-innovation .panel-header {
    border-bottom: 1px solid rgba(255, 215, 0, 0.08);
}

#panel-innovation .panel-divider {
    background: linear-gradient(90deg, var(--gold-dim), transparent);
}

#panel-innovation .panel-body {
    scrollbar-color: var(--gold-dim) transparent;
}

#panel-innovation .panel-body::-webkit-scrollbar-thumb {
    background: var(--gold-dim);
}

/* Education Panel — Purple Theme */
#panel-education .btn-back {
    border: 1px solid rgba(180, 134, 255, 0.2);
    color: var(--purple);
}

#panel-education .btn-back:hover {
    background: rgba(180, 134, 255, 0.08);
    border-color: var(--purple);
    box-shadow: 0 0 15px var(--purple-dim);
}

#panel-education .panel-chrome {
    border: 1px solid rgba(180, 134, 255, 0.15);
}

#panel-education .panel-chrome::before {
    background: linear-gradient(90deg, transparent, var(--purple), transparent);
}

#panel-education .panel-chrome::after {
    background: linear-gradient(180deg, var(--purple), transparent 60%);
}

#panel-education .panel-header {
    border-bottom: 1px solid rgba(180, 134, 255, 0.08);
}

#panel-education .panel-divider {
    background: linear-gradient(90deg, var(--purple-dim), transparent);
}

#panel-education .panel-body {
    scrollbar-color: var(--purple-dim) transparent;
}

#panel-education .panel-body::-webkit-scrollbar-thumb {
    background: var(--purple-dim);
}

/* Intelica Panel — Orange Theme */
#panel-intelica .panel-chrome {
    border: 1px solid rgba(230, 74, 25, 0.15);
}

#panel-intelica .panel-body {
    scrollbar-color: rgba(230, 74, 25, 0.3) transparent;
}

#panel-intelica .panel-body::-webkit-scrollbar-thumb {
    background: rgba(230, 74, 25, 0.3);
}

#panel-intelica .panel-chrome::before {
    background: linear-gradient(90deg, transparent, #E64A19, transparent);
}

#panel-intelica .panel-chrome::after {
    background: linear-gradient(180deg, #E64A19, transparent 60%);
}

#panel-intelica .panel-header {
    border-bottom: 1px solid rgba(230, 74, 25, 0.08);
}

#panel-intelica .panel-subtitle {
    color: #E64A19;
    text-shadow: 0 0 10px rgba(230, 74, 25, 0.3);
}

#panel-intelica .panel-divider {
    background: linear-gradient(90deg, rgba(230, 74, 25, 0.3), transparent);
}

#panel-intelica .panel-desc strong {
    color: #E64A19;
}



#panel-intelica .metric-card {
    border: 1px solid rgba(230, 74, 25, 0.1);
    background: rgba(230, 74, 25, 0.02);
}

#panel-intelica .metric-card::before {
    background: linear-gradient(90deg, transparent, #E64A19, transparent);
}

#panel-intelica .metric-value {
    color: #E64A19;
    text-shadow: 0 0 20px rgba(230, 74, 25, 0.3);
}

#panel-intelica .metric-symbol {
    color: #E64A19;
}

#panel-intelica .module-item {
    border: 1px solid rgba(230, 74, 25, 0.06);
    background: rgba(230, 74, 25, 0.02);
}

#panel-intelica .module-item:hover {
    border-color: rgba(230, 74, 25, 0.3);
    background: rgba(230, 74, 25, 0.05);
}

#panel-intelica .module-icon {
    color: #E64A19;
}

#panel-intelica .action-btn {
    border: 1px solid rgba(230, 74, 25, 0.3);
    background: rgba(230, 74, 25, 0.04);
}

#panel-intelica .action-btn .btn-icon {
    color: #E64A19;
}

#panel-intelica .action-btn:hover {
    background: rgba(230, 74, 25, 0.1);
    border-color: #E64A19;
    box-shadow: 0 0 20px rgba(230, 74, 25, 0.2), inset 0 0 20px rgba(230, 74, 25, 0.05);
}

/* ============================================
   HUD TOUCH / DESKTOP HINTS
   ============================================ */
/* Default: show desktop, hide touch */
.hud-touch-hint { display: none !important; }
.hud-desktop-hint { display: inline-block !important; }

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */
#bottom-nav {
    display: none; /* shown only in mobile via media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 8px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: rgba(8, 13, 26, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 240, 255, 0.1);
    display: none;
    flex-direction: row;
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
    opacity: 0;
    transition: opacity 1s ease 1s;
    pointer-events: auto;
    -webkit-user-select: none;
    user-select: none;
}

#bottom-nav.visible {
    opacity: 1;
}

.bottom-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    min-height: 52px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.bottom-nav-btn:active {
    background: rgba(0, 240, 255, 0.06);
}

.bottom-nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(200, 215, 240, 0.4);
    transition: all 0.25s ease;
    display: block;
    position: relative;
}

.bottom-nav-dot::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: transparent;
    transition: background 0.25s ease;
}

.bottom-nav-btn.active .bottom-nav-dot::after {
    background: currentColor;
}

.bottom-nav-label {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 1px;
    color: rgba(200, 215, 240, 0.5);
    text-transform: uppercase;
    transition: color 0.25s ease;
    line-height: 1;
}

.bottom-nav-btn.active .bottom-nav-label {
    color: inherit;
}

/* Per-node colors */
.bottom-nav-btn[data-node="core"] { color: var(--cyan); }
.bottom-nav-btn[data-node="core"] .bottom-nav-dot { border-color: var(--cyan-dim); }
.bottom-nav-btn[data-node="core"].active .bottom-nav-dot { border-color: var(--cyan); box-shadow: 0 0 8px var(--cyan-dim); }

.bottom-nav-btn[data-node="intelica"] { color: #E64A19; }
.bottom-nav-btn[data-node="intelica"] .bottom-nav-dot { border-color: rgba(230, 74, 25, 0.4); }
.bottom-nav-btn[data-node="intelica"].active .bottom-nav-dot { border-color: #E64A19; box-shadow: 0 0 8px rgba(230, 74, 25, 0.3); }

.bottom-nav-btn[data-node="education"] { color: var(--purple); }
.bottom-nav-btn[data-node="education"] .bottom-nav-dot { border-color: var(--purple-dim); }
.bottom-nav-btn[data-node="education"].active .bottom-nav-dot { border-color: var(--purple); box-shadow: 0 0 8px var(--purple-dim); }

.bottom-nav-btn[data-node="innovation"] { color: var(--gold); }
.bottom-nav-btn[data-node="innovation"] .bottom-nav-dot { border-color: var(--gold-dim); }
.bottom-nav-btn[data-node="innovation"].active .bottom-nav-dot { border-color: var(--gold); box-shadow: 0 0 8px var(--gold-dim); }

/* ============================================
   RESPONSIVE — 4-breakpoint system
   ============================================ */

/* ── 1. Tablet landscape (769px – 1024px) ── */
@media (max-width: 1024px) {
    .detail-panel {
        width: 420px;
        padding: 48px 0 32px 0;
    }

    .panel-chrome {
        margin: 0 0 0 16px;
    }

    .panel-title {
        font-size: 22px;
    }

    .pillar-grid {
        gap: 10px;
    }

    .pillar-card {
        padding: 14px;
    }

    .metrics-grid {
        gap: 10px;
    }
}

/* ── 2. Tablet portrait / Mobile landscape (601px – 768px) ── */
@media (max-width: 768px) {
    /* Switch HUD hints */
    .hud-desktop-hint { display: none !important; }
    .hud-touch-hint { display: inline-block !important; }

    /* Show bottom nav, hide side nav */
    #bottom-nav {
        display: flex;
    }

    #nav-dots {
        display: none;
    }

    /* Crosshair: never shown on touch */
    #crosshair {
        display: none !important;
    }

    /* HUD adjustments: hide top headers on mobile for clean layout */
    .hud-corner.top-left,
    .hud-corner.top-right,
    .hud-corner.bottom-right {
        display: none !important;
    }

    .hud-corner.bottom-left {
        left: 16px;
        bottom: calc(80px + env(safe-area-inset-bottom));
    }

    #audio-control {
        left: 16px;
        right: auto;
        bottom: calc(80px + env(safe-area-inset-bottom) + 32px);
        font-size: 9px;
        padding: 8px 12px;
    }

    /* Detail panels — full width, leave room for bottom-nav */
    .detail-panel {
        width: 100%;
        top: 0;
        bottom: calc(72px + env(safe-area-inset-bottom));
        height: auto;
        padding: calc(56px + env(safe-area-inset-top)) 0 0 0;
    }

    /* Allow native scrolling inside panel */
    .detail-panel.visible {
        touch-action: auto;
    }

    .panel-chrome {
        margin: 0 12px;
        border-radius: 8px;
        height: 100%;
    }

    .panel-body {
        padding: 20px 18px 28px;
        touch-action: pan-y;
    }

    .panel-title {
        font-size: 20px;
    }

    .panel-actions {
        flex-direction: column;
    }

    .action-btn {
        justify-content: center;
    }

    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .metric-value {
        font-size: 22px;
    }

    .metric-label {
        font-size: 8px;
    }

    .pillar-card {
        padding: 12px;
    }

    .pillar-icon {
        margin-bottom: 6px;
    }

    .pillar-icon svg {
        width: 24px;
        height: 24px;
    }
}

/* ── 3. Mobile portrait (≤ 600px) ── */
@media (max-width: 600px) {
    .loading-panel {
        width: calc(100% - 32px);
        padding: 24px 20px;
        gap: 18px;
    }

    .loading-title {
        font-size: clamp(28px, 8vw, 42px);
    }

    .loading-subtitle,
    .loading-author {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .loading-bar-track {
        height: 14px;
    }

    .loading-percent {
        font-size: 12px;
    }

    .panel-title {
        font-size: 18px;
    }

    .panel-body {
        padding: 16px 14px 24px;
    }

    .metric-value {
        font-size: 20px;
    }

    .metric-label {
        font-size: 8px;
        letter-spacing: 0.5px;
    }

    .skill-tags {
        gap: 6px;
    }

    .skill-tag {
        font-size: 10px;
        padding: 4px 10px;
    }

    .section-title {
        font-size: 16px;
    }

    .module-item {
        flex-direction: column;
        gap: 8px;
    }

    .module-icon {
        font-size: 16px;
    }

    /* Bottom nav slightly taller for small phones */
    .bottom-nav-btn {
        min-height: 56px;
    }
}

/* ── 4. Small Mobile — Portrait (≤ 380px) ── */
@media (max-width: 380px) {
    .loading-panel {
        width: calc(100% - 24px);
        padding: 20px 16px;
        gap: 14px;
    }

    .loading-title {
        font-size: clamp(22px, 7vw, 32px);
    }

    .loading-bar-track {
        height: 12px;
    }

    .panel-title {
        font-size: 16px;
    }

    .panel-body {
        padding: 14px 12px 20px;
    }

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

    .metric-value {
        font-size: 24px;
    }

    .bottom-nav-label {
        font-size: 7px;
    }
}

/* ── 5. Mobile Landscape / Low-Height Viewports (max-height: 550px) ── */
@media (max-height: 550px) {
    /* Switch HUD hints */
    .hud-desktop-hint { display: none !important; }
    .hud-touch-hint { display: inline-block !important; }

    /* Ensure bottom-nav is displayed in landscape touch mode */
    #bottom-nav {
        display: flex !important;
        padding: 4px 8px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
        background: rgba(8, 13, 26, 0.96);
    }

    .bottom-nav-btn {
        min-height: 40px;
        padding: 3px 2px;
        gap: 2px;
    }

    .bottom-nav-dot {
        width: 7px;
        height: 7px;
        border-width: 1px;
    }

    .bottom-nav-label {
        font-size: 7px;
        letter-spacing: 0.5px;
    }

    #nav-dots {
        display: none !important;
    }

    #crosshair {
        display: none !important;
    }

    /* HUD Adjustments */
    .hud-corner.top-left,
    .hud-corner.top-right,
    .hud-corner.bottom-right {
        display: none !important;
    }

    .hud-corner.bottom-left {
        left: 12px;
        bottom: calc(48px + env(safe-area-inset-bottom));
        font-size: 8px;
    }

    #audio-control {
        left: 12px;
        right: auto;
        bottom: calc(48px + env(safe-area-inset-bottom) + 24px);
        font-size: 8px;
        padding: 4px 8px;
    }

    /* Detail Panels in Landscape Mode: Do not stretch 100% full width, set comfortable max-width and margins */
    .detail-panel {
        width: min(520px, 85vw);
        max-width: 520px;
        top: 0;
        bottom: calc(46px + env(safe-area-inset-bottom));
        height: auto;
        padding: calc(36px + env(safe-area-inset-top)) 0 0 0;
    }

    .panel-chrome {
        margin: 0 10px;
        border-radius: 8px;
        height: 100%;
    }

    .panel-header {
        padding: 8px 14px;
    }

    .panel-status-bar {
        font-size: 8px;
    }

    .btn-back {
        padding: 4px 10px;
        font-size: 8px;
    }

    .panel-body {
        padding: 12px 14px 16px;
        touch-action: pan-y;
    }

    .panel-title {
        font-size: 17px;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .panel-subtitle {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .panel-divider {
        margin: 8px 0 12px 0;
    }

    .panel-desc {
        font-size: 11px;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .section-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .pillar-grid {
        gap: 8px;
    }

    .pillar-card {
        padding: 10px;
    }

    .pillar-icon svg {
        width: 18px;
        height: 18px;
    }

    .pillar-title {
        font-size: 12px;
    }

    .pillar-desc {
        font-size: 10px;
        line-height: 1.35;
    }

    .metrics-grid {
        gap: 6px;
    }

    .metric-card {
        padding: 8px 6px;
    }

    .metric-value {
        font-size: 16px;
    }

    .metric-label {
        font-size: 7px;
    }

    .module-item {
        padding: 8px 10px;
        gap: 6px;
    }

    .module-title {
        font-size: 11px;
    }

    .module-desc {
        font-size: 10px;
    }

    .skill-tag {
        font-size: 9px;
        padding: 3px 8px;
    }

    /* Loading Screen in Landscape */
    .loading-panel {
        padding: 16px 20px;
        gap: 10px;
        max-height: 90vh;
    }

    .loading-title {
        font-size: clamp(20px, 6vh, 28px);
    }
}



