/* 
   KTF ECOSYSTEM - STYLESHEET PRINCIPAL
*/

:root {
    /* Orbital Command palette */
    --accent: #00f2ff;
    --accent-dim: rgba(0, 242, 255, 0.4);
    --accent-low: rgba(0, 242, 255, 0.1);
    --secondary: #9ddf2e;
    --secondary-dim: rgba(157, 223, 46, 0.4);
    --secondary-low: rgba(157, 223, 46, 0.1);
    --bg-void: #05070a;
    --bg-ui: #0a192f;
    --bg-surface: #111417;
    --bg-surface-low: #1d2023;
    --border-ui: #3a494b;
    --text-main: #e1e2e7;
    --text-dim: #b9cacb;
    --danger: #ffb4ab;

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-label: 'Space Mono', monospace;
    --font-cyber: var(--font-display);
    --font-ui: var(--font-mono);

    /* Spacing tokens */
    --unit: 4px;
    --gutter: 16px;
    --margin: 32px;
    --terminal-height: 64px;
    
    /* Shadows & Glows */
    --glow-soft: 0 0 20px var(--accent-dim);
    --glow-hard: 0 0 10px var(--accent);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: crosshair;
}

body {
    background: var(--bg-void);
    color: var(--text-main);
    font-family: var(--font-mono);
    overflow: hidden;
    height: 100vh;
}

/* --- LABEL TYPOGRAPHY OVERRIDES (Space Mono) --- */
.status-badge,
.status-badge-detail,
.orbital-name,
.orbital-coords,
.detail-section-title,
.detail-tag,
.tech-tag,
.tool-category-badge,
.skill-category-title,
.tool-keyword,
.experience-period,
.detection-label,
.dynamic-block h3 {
    font-family: var(--font-label);
}

/* --- HUD OVERLAYS --- */
.scanline-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.2;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    background: url('https://grainy-gradients.vercel.app/noise.svg');
    opacity: 0.04;
    z-index: 10001;
    pointer-events: none;
}

/* --- VISTA 1: ONBOARDING --- */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, rgba(5, 10, 15, 0.8), var(--bg-void));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9000;
    transition: opacity 1s, transform 1s;
}

.onboarding-card {
    width: 90%;
    max-width: 480px;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border-ui);
    background: rgba(10, 15, 20, 0.6);
    backdrop-filter: blur(20px);
}

.onboarding-card::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; width: 30px; height: 30px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.glitch-text {
    font-family: var(--font-cyber);
    font-weight: 900;
    font-size: 2.8rem;
    letter-spacing: 8px;
    text-transform: uppercase;
    position: relative;
    color: white;
    margin-bottom: 5px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.7rem;
    border: 1px solid var(--danger);
    color: var(--danger);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.onboarding-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 40px;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.scan-bar {
    position: absolute;
    top: 0; left: 0; width: 2px; height: 100%;
    background: var(--accent);
    box-shadow: var(--glow-hard);
    animation: scan-horizontal 2s infinite linear;
}

@keyframes scan-horizontal {
    0% { left: 0; }
    100% { left: 100%; }
}

.onboarding-card input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-ui);
    padding: 15px 20px;
    color: white;
    font-family: var(--font-cyber);
    letter-spacing: 2px;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.onboarding-card input:focus {
    border-color: var(--accent);
}

#start-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 15px;
    font-family: var(--font-cyber);
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.3s;
}

#start-btn:hover {
    background: var(--accent-low);
    box-shadow: 0 0 20px var(--accent-dim);
}

/* --- VISTA 2: LOADING --- */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-void);
    z-index: 8000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cyber-spinner {
    width: 120px;
    height: 120px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.ring:nth-child(2) {
    width: 80%; height: 80%;
    border-top-color: var(--text-dim);
    animation-duration: 2s;
}

.loading-percent {
    font-family: var(--font-cyber);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
}

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

/* --- VISTA 3: EL NUCLEO (APP) --- */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    opacity: 1;
    transition: opacity 1s;
}

#app.hidden, .hidden {
    display: none !important;
}

/* --- ORBITAL COMMAND TOP BAR --- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 56px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-ui);
    z-index: 5000;
    flex-shrink: 0;
}

.brand {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--accent);
    text-transform: uppercase;
    flex-shrink: 0;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-item {
    font-family: var(--font-label);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-dim);
    padding: 8px 16px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.btn-deploy {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: var(--accent);
    color: #000;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    transition: box-shadow 0.2s, opacity 0.2s;
}

.btn-deploy:hover {
    box-shadow: 0 0 16px var(--accent-dim);
    opacity: 0.9;
}

/* Robot y Escenario */
.app-main-shell {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    overflow: hidden;
    transition: grid-template-columns 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-main-shell:has(.robot-dialog.collapsed) {
    grid-template-columns: minmax(0, 1fr) 48px;
}

.mascot-stage {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at 50% 50%, rgba(0, 242, 255, 0.02) 0%, transparent 60%);
}

/* Contenedor del robot — flotación idle */
.mascot-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 7000;
    animation: robot-idle-float 4s ease-in-out infinite;
}

.mascot-container.flying {
    animation: none; /* Desactivar idle float durante vuelo */
}

@keyframes robot-idle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.robot {
    width: 42px; height: 42px;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 12px var(--accent-dim));
    transition: filter 0.3s, opacity 0.3s;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Aura reactiva del robot */
.robot-aura {
    position: absolute;
    width: 56px;
    height: 56px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.2) 0%, transparent 70%);
    animation: aura-pulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes aura-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

/* Estela de vuelo */
.mascot-container.flying .robot-aura {
    animation: aura-flight 0.4s ease-in-out infinite;
}

@keyframes aura-flight {
    0%, 100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.3; }
}

/* Estela de partículas cuando vuela */
.flight-trail {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99;
    animation: trail-fade 0.6s ease-out forwards;
}

@keyframes trail-fade {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.2); }
}

/* --- MISSION LOG RAIL (Chat) --- */
.robot-dialog {
    position: relative;
    width: 100%;
    min-height: 0;
    background: rgba(10, 15, 25, 0.92);
    border-left: 1px solid var(--border-ui);
    border-top: 1px solid var(--border-ui);
    backdrop-filter: blur(12px);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}

.robot-dialog.collapsed {
    width: 48px;
    opacity: 0.92;
}

.robot-dialog.collapsed .mission-log-title,
.robot-dialog.collapsed .mission-log-badge,
.robot-dialog.collapsed .mission-log-content {
    display: none;
}

.robot-dialog.collapsed .mission-log-header {
    justify-content: center;
    height: 100%;
    padding: 8px;
}

.robot-dialog::-webkit-scrollbar { width: 4px; }
.robot-dialog::-webkit-scrollbar-track { background: transparent; }
.robot-dialog::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 2px; }

.mission-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-ui);
    background: rgba(0, 0, 0, 0.2);
}

.mission-log-title {
    font-family: var(--font-label);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}

.mission-log-badge {
    font-size: 0.5rem;
    padding: 2px 8px;
    border: 1px solid var(--accent-dim);
    color: var(--text-dim);
    letter-spacing: 1px;
    font-family: var(--font-mono);
}

.mission-log-toggle {
    background: none;
    border: 1px solid var(--border-ui);
    color: var(--text-dim);
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: color 0.2s, border-color 0.2s;
}

.mission-log-toggle:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
}

.mission-log-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) transparent;
}

.mission-log-content::-webkit-scrollbar { width: 4px; }
.mission-log-content::-webkit-scrollbar-track { background: transparent; }
.mission-log-content::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 2px; }

/* Robot speech bubble (short status near robot) */
.robot-speech-bubble {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 15, 25, 0.9);
    border: 1px solid var(--accent-dim);
    padding: 6px 12px;
    white-space: nowrap;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    color: var(--accent);
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateX(-50%) translateY(4px);
}

.robot-speech-bubble.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.robot-speech-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border: 4px solid transparent;
    border-top-color: var(--accent-dim);
}

/* Bloques Holográficos — Planetas Vivos */
.dynamic-block {
    position: absolute;
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), filter 0.3s;
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.3));
    animation: planet-orbit 6s ease-in-out infinite;
}

/* Cada planeta tiene un ritmo de órbita distinto */
.dynamic-block:nth-child(1) { animation-delay: 0s; }
.dynamic-block:nth-child(2) { animation-delay: 1.5s; }
.dynamic-block:nth-child(3) { animation-delay: 3s; }
.dynamic-block:nth-child(4) { animation-delay: 4.5s; }

@keyframes planet-orbit {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(1deg); }
    75% { transform: translateY(4px) rotate(-1deg); }
}

/* Anillo orbital sutil */
.dynamic-block::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border: 1px solid rgba(0, 242, 255, 0.08);
    border-radius: 50%;
    animation: ring-rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes ring-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dynamic-block h3 {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 2px 8px;
    font-size: 0.5rem;
    color: var(--accent);
    border-left: 2px solid var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease;
    white-space: nowrap;
    position: absolute;
    bottom: -18px;
}

.dynamic-block:hover {
    transform: scale(1.2) !important;
    filter: drop-shadow(0 0 25px var(--accent));
    animation-play-state: paused;
}

.dynamic-block:hover h3 {
    opacity: 1;
    bottom: -22px;
}

.dynamic-block:hover::before {
    border-color: rgba(0, 242, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.1);
}

.dynamic-block.picked-up {
    opacity: 0;
    transform: scale(0) !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 1, 1);
}

/* HUD Inferior */
.command-center {
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 32px 20px;
    z-index: 5000;
}

.command-wrapper {
    width: 100%;
    background: #0a192f;
    border: 1px solid var(--accent);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.command-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
    caret-color: var(--accent);
}

.command-wrapper input::placeholder {
    color: var(--text-dim);
    opacity: 0.6;
}

.btn-hud {
    background: var(--secondary);
    color: #000;
    border: none;
    padding: 8px 20px;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: box-shadow 0.2s;
}

.btn-hud:hover {
    box-shadow: 0 0 12px var(--secondary-dim);
}

.btn-hud.secondary {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}

.btn-hud.secondary:hover {
    background: var(--accent-low);
}

/* Microphone and TTS buttons */
.btn-mic {
    background: transparent !important;
    border: 1px solid var(--border-ui) !important;
    color: var(--text-dim) !important;
    font-size: 14px !important;
    padding: 8px 12px !important;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-mic:hover {
    border-color: var(--accent-dim) !important;
    color: var(--accent) !important;
}

.btn-mic.listening {
    border-color: var(--danger) !important;
    color: var(--danger) !important;
    box-shadow: 0 0 12px rgba(255, 180, 171, 0.3);
    animation: mic-pulse 1s ease-in-out infinite;
}

@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 180, 171, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 180, 171, 0.4); }
}

.btn-tts {
    font-size: 12px !important;
    padding: 8px 10px !important;
    line-height: 1;
    transition: color 0.2s, border-color 0.2s;
}

.btn-tts.active {
    background: var(--accent-low) !important;
    border-color: var(--accent-dim) !important;
    color: var(--accent) !important;
}

/* Utilitarios */
.floating-module {
    z-index: 10;
}

.content-hologram {
    z-index: 6000;
    width: 90%;
    max-width: 640px;
    min-height: 400px;
    max-height: 70vh;
    display: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dim) transparent;
}

.content-hologram.active {
    display: block;
    animation: hologram-enter 0.6s ease-out;
}

/* Efecto de Onda al Grabar */
.ring-wave {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 4px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    animation: wave-expand 0.6s ease-out forwards;
    z-index: 100;
}

@keyframes wave-expand {
    from { transform: scale(0.1); opacity: 1; }
    to { transform: scale(3); opacity: 0; }
}

@keyframes hologram-enter {
    from { opacity: 0; transform: scale(0.9) translateY(20px); filter: blur(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* OMNI-VISION SCANNER (Agent Mode) */
.omni-vision-active #stage {
    filter: sepia(1) hue-rotate(60deg) brightness(1.2) contrast(1.2); /* Tinte verde táctico */
}

.detection-box {
    position: absolute;
    border: 1px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
    pointer-events: none;
    z-index: 100;
    animation: box-pulse 1.5s infinite;
}

.detection-label {
    position: absolute;
    top: -20px;
    left: 0;
    background: #00ff00;
    color: black;
    font-family: var(--font-cyber);
    font-size: 10px;
    padding: 2px 5px;
    font-weight: 900;
    white-space: nowrap;
    text-transform: uppercase;
}

@keyframes box-pulse {
    0%, 100% { opacity: 0.5; box-shadow: 0 0 5px #00ff00; }
    50% { opacity: 1; box-shadow: 0 0 15px #00ff00; }
}


/* Hologram Content Details */
.header-line {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin: 10px 0 20px 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.tech-tag {
    background: var(--accent-low);
    border: 1px solid var(--border-ui);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-family: var(--font-cyber);
    color: var(--accent);
    letter-spacing: 1px;
}

.project-list {
    list-style: none;
    margin-top: 20px;
}

.project-list li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-dim);
}


/* --- OMNI-SPACE ENVIRONMENT v3.0 --- */
.space-environment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

/* Capas de Nebulosa — profundidad real */
.space-environment::before {
    content: '';
    position: absolute;
    inset: -20%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0, 100, 255, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(100, 0, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 242, 255, 0.02) 0%, transparent 40%);
    animation: nebula-drift 60s linear infinite alternate;
    z-index: 0;
}

.space-environment::after {
    content: '';
    position: absolute;
    inset: -10%;
    background:
        radial-gradient(ellipse at 70% 20%, rgba(255, 0, 100, 0.02) 0%, transparent 45%),
        radial-gradient(ellipse at 30% 60%, rgba(0, 255, 200, 0.015) 0%, transparent 50%);
    animation: nebula-drift 80s linear infinite alternate-reverse;
    z-index: 0;
}

@keyframes nebula-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(30px, -20px) rotate(3deg); }
}

.space-element {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    filter: drop-shadow(0 0 4px rgba(0, 242, 255, 0.15));
    opacity: 0;
    transition: opacity 3s ease-in, transform 0.15s ease-out;
    will-change: transform, opacity;
    animation: float-space var(--float-dur, 25s) infinite alternate ease-in-out;
    animation-delay: var(--float-delay, 0s);
}

/* Categorías de profundidad visual */
.space-element.layer-far { opacity: 0.2; filter: blur(1px) drop-shadow(0 0 2px rgba(0, 242, 255, 0.1)); }
.space-element.layer-mid { opacity: 0.45; }
.space-element.layer-near { opacity: 0.7; filter: drop-shadow(0 0 6px rgba(0, 242, 255, 0.25)); }

/* Estrellas con variación de color */
.star-particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--twinkle-dur, 3s) infinite alternate ease-in-out;
    animation-delay: var(--twinkle-delay, 0s);
}

.star-particle.warm { background: #ffeedd; box-shadow: 0 0 6px #ffeedd; }
.star-particle.cool { background: #ddeeff; box-shadow: 0 0 6px #aaccff; }
.star-particle.accent { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.star-particle.white { background: #ffffff; box-shadow: 0 0 5px #ffffff; }

@keyframes twinkle {
    0% { opacity: 0.05; transform: scale(0.6); }
    100% { opacity: var(--twinkle-max, 0.5); transform: scale(1.3); }
}

@keyframes float-space {
    0% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(calc(var(--drift-x, 10px)), calc(var(--drift-y, -8px))) rotate(1deg); }
    100% { transform: translate(calc(var(--drift-x, 10px) * -0.5), calc(var(--drift-y, -8px) * 0.5)) rotate(-0.5deg); }
}

/* Polvo cósmico — partículas diminutas que flotan */
.cosmic-dust {
    position: absolute;
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: dust-float var(--dust-dur, 15s) linear infinite;
    opacity: 0;
}

@keyframes dust-float {
    0% { opacity: 0; transform: translateY(0) translateX(0); }
    20% { opacity: 0.4; }
    80% { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-100vh) translateX(30px); }
}

/* Efecto de detección de Omni-Vision en planetas */
.omni-vision-active .space-element {
    filter: sepia(1) saturate(5) hue-rotate(90deg) brightness(1.5) drop-shadow(0 0 15px #00ff00);
}

/* --- ORBITAL FRAME SYSTEM (AI Assistant) --- */

.orbital-frame {
    position: absolute;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: filter 0.4s ease, opacity 0.4s ease, transform 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.orbital-image {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    image-rendering: pixelated;
}

.orbital-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    transition: transform 0.3s ease;
}

.orbital-frame:hover .orbital-image img {
    transform: scale(1.15);
}

.orbital-frame:not([data-state="grabbed"]):not([data-state="dropped"]):hover {
    filter: brightness(1.2) drop-shadow(0 0 14px var(--accent));
    transform: translate(-50%, -50%) scale(1.05);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.orbital-frame[data-state="locked"]:not([data-state="grabbed"]):not([data-state="dropped"]):hover {
    filter: brightness(1.3) drop-shadow(0 0 22px #ffa500);
}

.orbital-name {
    position: absolute;
    bottom: -18px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    padding: 2px 8px;
    font-size: 0.5rem;
    font-family: var(--font-cyber);
    color: var(--accent);
    border-left: 2px solid var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.4s ease;
    white-space: nowrap;
}

.orbital-frame:hover .orbital-name {
    opacity: 1;
    bottom: -22px;
}

.orbital-coords {
    position: absolute;
    top: -20px;
    font-family: var(--font-cyber);
    font-size: 7px;
    letter-spacing: 1px;
    color: var(--accent);
    opacity: 0.6;
    pointer-events: none;
    white-space: nowrap;
}

.orbital-ring {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1px solid rgba(0, 242, 255, 0.08);
    border-radius: 50%;
    pointer-events: none;
    animation: orbital-ring-rotate 20s linear infinite;
}

@keyframes orbital-ring-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Data state: floating (green glow — nominal) */
.orbital-frame[data-state="floating"] {
    filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.3));
}
.orbital-frame[data-state="floating"] .orbital-ring {
    border-color: rgba(0, 242, 255, 0.15);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.08);
}

/* Data state: freezing (transition to orange) */
.orbital-frame[data-state="freezing"] {
    filter: drop-shadow(0 0 14px #ffa500);
    transition: filter 0.5s ease;
}
.orbital-frame[data-state="freezing"] .orbital-ring {
    animation-play-state: paused;
    border-color: #ffa500;
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.2);
}

/* Data state: locked (orange glow — selected) */
.orbital-frame[data-state="locked"] {
    filter: drop-shadow(0 0 18px #ffa500);
}
.orbital-frame[data-state="locked"] .orbital-ring {
    border-color: #ffa500;
    box-shadow: 0 0 16px rgba(255, 165, 0, 0.3);
    animation: orbital-ring-pulse 1s ease-in-out infinite;
}

@keyframes orbital-ring-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 165, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 165, 0, 0.4); }
}

/* Data state: grabbed (gold glow — captured) */
.orbital-frame[data-state="grabbed"] {
    filter: drop-shadow(0 0 22px #ffd700);
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 1, 1);
}
.orbital-frame[data-state="grabbed"] .orbital-ring {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    animation: orbital-ring-grab 0.6s ease-out forwards;
}

@keyframes orbital-ring-grab {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

/* Data state: dropped (fade back in — returning) */
.orbital-frame[data-state="dropped"] {
    filter: drop-shadow(0 0 12px rgba(0, 242, 255, 0.5));
    opacity: 0;
    animation: orbital-drop-in 0.4s ease-out forwards;
}

@keyframes orbital-drop-in {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Orbit wave effect */
.orbit-wave {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 4px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    animation: orbit-wave-expand 0.6s ease-out forwards;
    z-index: 50;
}

@keyframes orbit-wave-expand {
    from { transform: scale(0.1); opacity: 1; }
    to { transform: scale(3); opacity: 0; }
}

/* Chat message styles */
.chat-msg {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    margin: 6px 0;
    font-size: 0.8rem;
    font-family: var(--font-ui);
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.03);
    line-height: 1.4;
}

.chat-msg[data-role="user"] {
    border-left: 2px solid var(--accent);
    background: rgba(0, 242, 255, 0.05);
}

.chat-msg[data-role="robot"] {
    border-left: 2px solid var(--text-dim);
}

.chat-msg-label {
    color: var(--accent);
    flex-shrink: 0;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.chat-msg-text {
    color: var(--text-main);
    word-break: break-word;
    font-size: 0.8rem;
}

.chat-typing {
    font-family: var(--font-ui);
    font-size: 1rem;
    color: var(--accent);
    letter-spacing: 3px;
    animation: chat-blink 0.5s step-end infinite;
    padding: 4px 12px;
}

@keyframes chat-blink {
    50% { opacity: 0.4; }
}

/* Detail panel */
.detail-header h3 {
    font-family: var(--font-cyber);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.detail-body {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-dim);
}

/* Detection box for Omni-Vision */
.detection-box {
    position: absolute;
    border: 1px solid #00ff00;
    background: rgba(0, 255, 0, 0.1);
    pointer-events: none;
    z-index: 100;
    animation: box-pulse 1.5s infinite;
}

/* Omni-Vision active state for workspace */
.omni-vision-active .workspace {
    filter: sepia(1) hue-rotate(60deg) brightness(1.2) contrast(1.2);
}

/* --- CARRY SYSTEM — Robot-fetched object visual --- */
.orbital-carry {
    position: fixed;
    z-index: 7001;
    pointer-events: none;
    image-rendering: pixelated;
    filter: drop-shadow(0 0 14px var(--accent)) brightness(1.2);
    opacity: 0;
    transition: left 0.05s linear, top 0.05s linear;
}

.orbital-carry.active {
    opacity: 1;
    transition: opacity 0.15s ease-in;
}

.orbital-carry img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    image-rendering: pixelated;
}

.orbital-carry.dropping {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    opacity: 0;
    transform: scale(2.5);
    filter: blur(6px) drop-shadow(0 0 30px var(--accent));
}

.orbital-carry.returning {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.3);
}

@media (prefers-reduced-motion: reduce) {
    .orbital-carry {
        display: none;
    }
}

/* Responsive: vertical stack below 600px */
@media (max-width: 600px) {
    .app-main-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .app-main-shell:has(.robot-dialog.collapsed) {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .top-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 8px 16px;
        gap: 8px;
    }

    .top-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-item {
        font-size: 10px;
        padding: 6px 10px;
    }

    .btn-deploy {
        font-size: 10px;
        padding: 6px 14px;
    }

    .command-center {
        padding: 0 16px 16px;
    }

    .command-wrapper {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Mission log on mobile: collapsed by default, bottom sheet when open */
    .mission-log-toggle {
        display: block;
    }

    .robot-dialog {
        width: 100%;
        height: min(35vh, 260px);
        max-height: 35vh;
        border-left: none;
        border-top: 1px solid var(--border-ui);
    }

    .robot-dialog.collapsed {
        width: 100%;
        height: 42px;
    }

    .robot-dialog.collapsed .mission-log-title,
    .robot-dialog.collapsed .mission-log-badge {
        display: inline;
    }

    .robot-dialog.collapsed .mission-log-header {
        justify-content: space-between;
        height: auto;
        padding: 8px 12px;
    }

    .robot-speech-bubble {
        display: none;
    }

    .orbital-frame {
        width: 42px;
        height: 42px;
    }
    .orbital-image {
        width: 28px;
        height: 28px;
    }
    .orbital-name {
        font-size: 0.4rem;
        bottom: -14px;
    }
    .orbital-coords {
        font-size: 5px;
        top: -14px;
    }
    .orbital-ring {
        width: 38px;
        height: 38px;
    }
}

/* Tablet: bottom sheet mission log */
@media (min-width: 601px) and (max-width: 900px) {
    .app-main-shell {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .app-main-shell:has(.robot-dialog.collapsed) {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .robot-dialog {
        width: 100%;
        height: min(40vh, 300px);
        max-height: 40vh;
        border-left: none;
        border-top: 1px solid var(--border-ui);
    }

    .robot-dialog.collapsed {
        width: 100%;
        height: 42px;
    }

    .robot-dialog.collapsed .mission-log-title,
    .robot-dialog.collapsed .mission-log-badge {
        display: inline;
    }

    .robot-dialog.collapsed .mission-log-header {
        justify-content: space-between;
        height: auto;
        padding: 8px 12px;
    }

    .robot-speech-bubble {
        display: none;
    }
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    .orbital-frame {
        animation: none !important;
        transition: none !important;
    }
    .orbital-ring {
        animation: none !important;
    }
    .orbit-wave {
        animation: none !important;
        display: none;
    }
    .orbital-coords {
        display: none;
    }
}

/* Focus-visible for keyboard navigation */
.orbital-frame:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    filter: drop-shadow(0 0 20px var(--accent));
}

/* --- DETAIL PANEL ENHANCED COMPONENTS --- */

.detail-hero {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-dim);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    letter-spacing: 0.3px;
}

.detail-section-title {
    font-family: var(--font-cyber);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 20px 0 12px 0;
}

.detail-highlights {
    list-style: none;
    margin: 12px 0;
    padding: 0;
}

.detail-highlights li {
    padding: 6px 0 6px 16px;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.5;
    position: relative;
    border-left: 1px solid rgba(0, 242, 255, 0.12);
    margin-bottom: 4px;
}

.detail-highlights li::before {
    content: '';
    position: absolute;
    left: -3px;
    top: 12px;
    width: 5px;
    height: 5px;
    background: var(--accent-dim);
    border-radius: 50%;
}

/* Status badge */
.status-badge-detail {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.6rem;
    font-family: var(--font-cyber);
    letter-spacing: 1.5px;
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    background: var(--accent-low);
    text-transform: uppercase;
    white-space: nowrap;
}

/* Tech badges with icons */
.tech-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.tech-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px 3px 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.7rem;
    font-family: var(--font-ui);
    color: var(--text-dim);
    line-height: 1;
}

.tech-icon-img {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.tech-badge-label {
    vertical-align: middle;
}

/* Links */
.detail-links {
    display: flex;
    gap: 10px;
    margin: 12px 0 4px 0;
}

.detail-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.7rem;
    font-family: var(--font-cyber);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    background: var(--accent-low);
    transition: all 0.25s ease;
}

.detail-link:hover {
    background: rgba(0, 242, 255, 0.15);
    box-shadow: 0 0 16px var(--accent-dim);
    border-color: var(--accent);
}

.link-icon {
    font-size: 0.8rem;
}

/* Skill categories */
.skill-categories {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 16px 0;
}

.skill-category-title {
    font-family: var(--font-cyber);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 242, 255, 0.08);
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.skill-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-main);
}

.skill-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.skill-item-name {
    font-weight: 400;
}

.skill-item-level {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-left: 2px;
}

.skill-level-expert {
    border-left: 2px solid var(--accent);
}

.skill-level-advanced {
    border-left: 2px solid rgba(0, 242, 255, 0.4);
}

.skill-level-intermediate {
    border-left: 2px solid rgba(0, 242, 255, 0.2);
}

.skill-level-beginner {
    border-left: 2px solid rgba(255, 255, 255, 0.08);
}

/* Project cards */
.project-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.project-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    transition: border-color 0.25s ease;
}

.project-card:hover {
    border-color: rgba(0, 242, 255, 0.15);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.project-card-name {
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
    margin: 0;
}

.project-card-desc {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 8px 0;
}

/* Experience timeline */
.experience-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 16px 0;
    position: relative;
}

.experience-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 1px;
    background: rgba(0, 242, 255, 0.1);
}

.experience-entry {
    display: flex;
    gap: 16px;
    padding: 4px 0 16px 0;
    position: relative;
}

.experience-marker {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--accent-dim);
    background: var(--bg-void);
    flex-shrink: 0;
    margin-top: 4px;
    z-index: 1;
}

.experience-body {
    flex: 1;
    min-width: 0;
}

.experience-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.experience-role {
    font-family: var(--font-cyber);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.5px;
    margin: 0;
}

.experience-period {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    font-family: var(--font-cyber);
}

.experience-company {
    font-size: 0.75rem;
    color: var(--accent-dim);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* Contact grid */
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.contact-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: var(--font-ui);
    transition: all 0.25s ease;
}

.contact-card:hover {
    border-color: var(--accent-dim);
    background: var(--accent-low);
    color: var(--accent);
}

.contact-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.contact-card-name {
    letter-spacing: 0.5px;
}

/* Detail tags */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 16px 0;
}

.detail-tag {
    padding: 3px 10px;
    font-size: 0.65rem;
    font-family: var(--font-cyber);
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.06);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.detail-empty {
    font-size: 0.85rem;
    color: var(--text-dim);
    font-style: italic;
}

.content-hologram::-webkit-scrollbar {
    width: 4px;
}
.content-hologram::-webkit-scrollbar-track {
    background: transparent;
}
.content-hologram::-webkit-scrollbar-thumb {
    background: var(--accent-dim);
    border-radius: 2px;
}

/* --- TOOL CARDS --- */
.tool-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 16px 0;
}

.tool-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.tool-card:hover {
    border-color: rgba(0, 242, 255, 0.15);
}

.tool-card-matched {
    border-color: var(--accent-dim);
    box-shadow: 0 0 12px var(--accent-dim);
    background: rgba(0, 242, 255, 0.04);
}

.tool-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.tool-card-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.tool-card-name {
    font-family: var(--font-cyber);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1px;
    margin: 0;
}

.tool-card-desc {
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--text-dim);
    margin: 8px 0;
}

.tool-category-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.55rem;
    font-family: var(--font-cyber);
    letter-spacing: 1.5px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    text-transform: uppercase;
    white-space: nowrap;
}

.tool-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 8px 0;
}

.tool-keyword {
    padding: 2px 8px;
    font-size: 0.6rem;
    font-family: var(--font-ui);
    color: var(--accent-dim);
    border: 1px solid rgba(0, 242, 255, 0.08);
    letter-spacing: 0.5px;
}
