/* ==========================================================================
   CAPAS DE CRISTAL Y FONDOS (RECUPERACIÓN DEL GLASSMORPHISM PREMIUM)
   ========================================================================== */
/* Hemos bajado la opacidad a 0.65 y subido el blur a 24px para evitar el fantasma SIN perder el cristal */
#soluciones { z-index: 2; background: rgba(11, 15, 20, 0.65) !important; backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important; }
#ai-native { z-index: 3; background: rgba(8, 10, 13, 0.65) !important; backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important; }
#casos { z-index: 4; background: rgba(9, 12, 16, 0.65) !important; backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important; }
#contacto  { z-index: 5; background: rgba(8, 9, 10, 0.65) !important; backdrop-filter: blur(24px) !important; -webkit-backdrop-filter: blur(24px) !important; }

/* ==========================================================================
   SECCIÓN: HERO (#inicio)
   ========================================================================== */
.hero { 
    z-index: 1; 
    border-radius: 0; 
    box-shadow: none; 
    border-top: none; 
    background: transparent !important; 
    position: sticky !important; 
    top: 0; 
    min-height: 100vh !important;
    padding-bottom: 0 !important;
}

.aurora-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.15; mix-blend-mode: screen; will-change: transform, opacity; }
@media (min-width: 1024px) { .aurora-orb { filter: blur(100px); animation: breathing 12s infinite alternate ease-in-out; } }

.orb-1 { width: 300px; height: 300px; background: #00a8ff; top: -5%; left: -5%; }
.orb-2 { width: 250px; height: 250px; background: #1a5cff; bottom: 10%; right: -5%; }
.orb-3 { width: 200px; height: 200px; background: #00ffcc; top: 20%; left: 35%; opacity: 0.1; }
.orb-4 { width: 250px; height: 250px; background: #004d7a; bottom: 5%; left: 15%; opacity: 0.1; }

@media (min-width: 1024px) {
    .orb-1 { width: 600px; height: 600px; opacity: 0.3; top: -15%; left: -10%; }
    .orb-2 { width: 500px; height: 500px; opacity: 0.25; bottom: -10%; right: -5%; animation-delay: -2s; }
    .orb-3 { width: 400px; height: 400px; opacity: 0.1; top: 20%; left: 35%; animation-delay: -4s; }
    .orb-4 { width: 550px; height: 550px; opacity: 0.15; bottom: 5%; left: 15%; animation-delay: -6s; }
}

@keyframes breathing { 
    0% { transform: scale(1) translate(0,0); opacity: 0.2; } 
    100% { transform: scale(1.15) translate(40px, 30px); opacity: 0.4; } 
}

.hero-container { max-width: 1000px; text-align: center; margin: 0 auto; position: relative; z-index: 2; width: 100%; }

.hero-badge { display: inline-block; padding: 0.4rem 1rem; background: rgba(0, 168, 255, 0.05); border: 1px solid rgba(0, 168, 255, 0.2); border-radius: 20px; font-size: 0.75rem; color: var(--tech-blue); margin-bottom: 0.8rem; letter-spacing: 1px; font-weight: 600; }
.hero-title { font-size: clamp(2rem, 6.5vw, 3.8rem); line-height: 1.05; font-weight: 800; color: #fff; letter-spacing: -2px; margin-bottom: 0.8rem; }
.hero-subtitle { font-size: 1.05rem; color: #bbb; max-width: 800px; margin: 0 auto 1.5rem; line-height: 1.6; }
.desktop-br { display: none; }
@media (min-width: 768px) { .desktop-br { display: block; content: ""; margin-top: 0.2rem; } }

.hero-cta { display: flex; justify-content: center; margin-bottom: 1.5rem; }

/* TERMINAL HERO */
.code-window {
    background: var(--vsc-bg-glass); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; max-width: 800px; margin: 0 auto 1.5rem; 
    overflow: hidden; box-shadow: 0 25px 60px rgba(0,0,0,0.8); text-align: left; position: relative; z-index: 2;
}
.vsc-header { background: var(--vsc-header-glass); display: flex; align-items: flex-end; border-bottom: 1px solid rgba(255,255,255,0.05); }
.vsc-tab { padding: 8px 10px; background: transparent; color: #8b949e; font-size: 0.65rem; display: flex; align-items: center; gap: 6px; border-right: 1px solid rgba(255,255,255,0.03); flex: 1; justify-content: center; border-top: 1px solid transparent; transition: 0.2s; white-space: nowrap; }
.vsc-tab.active { background: var(--vsc-tab-active); color: #fff; border-top: 1px solid #007acc; }

.code-body { padding: 1.2rem 1.5rem; font-size: 0.95rem; line-height: 1.6; font-family: 'Fira Code', Consolas, monospace; color: var(--vsc-text); display: flex; align-items: flex-start; white-space: pre-wrap; height: 125px; overflow-y: auto; scrollbar-width: none; }
.code-body::-webkit-scrollbar { display: none; }
#tech-code { transition: opacity 0.2s ease; display: block; width: 100%; word-break: keep-all; }
.cursor { animation: blink 1s step-end infinite; color: #fff; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.kwd { color: var(--code-keyword); } .fnc { color: var(--code-func); } .str { color: var(--code-string); } .var { color: var(--code-var); }

/* LÓGICA DE COMPRESIÓN PARA NOTEBOOKS */
@media (max-height: 900px) {
    .hero { padding-top: 80px !important; }
    .hero-title { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 0.5rem; }
    .hero-subtitle { margin-bottom: 1rem; font-size: 0.95rem; }
    .code-window { margin-bottom: 1rem; max-width: 750px; }
    .code-body { height: 100px; padding: 1rem 1.2rem; }
    .hero-cta { margin-bottom: 1rem; }
    .trust-band p { margin-bottom: 0.4rem; }
}

/* ==========================================================================
   SECCIÓN: CLIENTES (MARQUESINA 3D)
   ========================================================================== */
.trust-band { margin-top: 0; position: relative; z-index: 10; padding-bottom: 0; }
.trust-band p { font-size: 0.75rem; letter-spacing: 2px; margin-bottom: 0.6rem; color: #777; text-transform: uppercase; font-weight: 600; }
.marquee-wrapper { width: 100%; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); mask-image: linear-gradient(to right, transparent, black 15%, black 85%, transparent); display: flex; flex-direction: column; gap: 0.8rem; }
.marquee-track { display: flex; width: max-content; gap: 4.5rem; padding-right: 4.5rem; align-items: center; }

.vip-track { animation: scroll-marquee 80s linear infinite; }
.vip-track span { font-weight: 800; font-size: 1.15rem; color: #ccc; }

.regular-track { animation: scroll-marquee-reverse 120s linear infinite; }
.regular-track span { font-weight: 700; font-size: 0.95rem; color: #aaa; opacity: 0.85; transform: scale(0.9); }

.marquee-track span { display: inline-block; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); white-space: nowrap; cursor: default; }
.marquee-wrapper:hover .marquee-track { animation-play-state: paused; }
.marquee-track:hover span { opacity: 0.15; filter: grayscale(1) blur(2px); }
.marquee-track span:hover { opacity: 1 !important; filter: grayscale(0) blur(0) !important; color: var(--tech-blue) !important; text-shadow: 0 0 20px rgba(0, 168, 255, 1), 0 0 40px rgba(0, 168, 255, 0.8) !important; transform: scale(1.3) !important; position: relative; z-index: 100 !important; }

@keyframes scroll-marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes scroll-marquee-reverse { 0% { transform: translateX(-50%); } 100% { transform: translateX(0); } }

/* ==========================================================================
   SECCIÓN: AI NATIVE DEVELOPER (#ai-native)
   ========================================================================== */
.ai-layout { display: grid; grid-template-columns: 1fr; gap: 4rem; align-items: center; }
@media (min-width: 1024px) { .ai-layout { grid-template-columns: 1fr 1.1fr; } }
.ai-sub-desc { color: #aaa; line-height: 1.8; font-size: 1.1rem; margin-bottom: 2rem; }
.ai-text { position: relative; padding: 1.5rem 0; }
.ai-text::before { content: ''; position: absolute; top: -20px; left: -20px; right: -20px; bottom: -20px; background-image: linear-gradient(rgba(0, 168, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 168, 255, 0.05) 1px, transparent 1px); background-size: 30px 30px; z-index: -1; border-radius: 20px; opacity: 0.6; pointer-events: none; -webkit-mask-image: radial-gradient(circle, black 30%, transparent 70%); mask-image: radial-gradient(circle, black 30%, transparent 70%); }
.ai-features { display: flex; flex-direction: column; gap: 1.2rem; }
.ai-feature-card { display: flex; align-items: flex-start; gap: 1.2rem; background: rgba(15, 18, 22, 0.6); padding: 1.5rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); position: relative; overflow: hidden; z-index: 1; }
.ai-feature-card::after { content: ''; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--tech-blue); transform: scaleY(0); transition: transform 0.4s ease; transform-origin: bottom; box-shadow: 0 0 15px var(--tech-blue); }
.ai-feature-card:hover { transform: translateY(-5px) scale(1.02); border-color: rgba(0, 168, 255, 0.5); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(0, 168, 255, 0.05); background: rgba(15, 18, 22, 0.9); }
.ai-feature-card:hover::after { transform: scaleY(1); }
.ai-feature-card h4 { color: #fff; margin-bottom: 0.4rem; font-size: 1.1rem; transition: color 0.3s; }
.ai-feature-card:hover h4 { color: var(--tech-blue); }
.ai-feature-card p { color: #888; font-size: 0.9rem; margin: 0; line-height: 1.5; transition: color 0.3s; }
.ai-feature-card:hover p { color: #ccc; }
.trophy-10x { color: #00ffcc; font-size: 1.3em; font-weight: 900; text-shadow: 0 0 15px rgba(0, 255, 204, 0.6); margin-left: 0.2rem; display: inline-block; vertical-align: baseline; }
.ai-icon { font-size: 1.6rem; display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; background: linear-gradient(135deg, rgba(0, 168, 255, 0.15) 0%, rgba(0, 100, 255, 0.05) 100%); border: 1px solid rgba(0, 168, 255, 0.4); border-radius: 12px; box-shadow: 0 0 15px rgba(0, 168, 255, 0.15), inset 0 0 10px rgba(0, 168, 255, 0.1); flex-shrink: 0; animation: cyber-pulse-box 2s infinite alternate; }
@keyframes cyber-pulse-box { 0% { box-shadow: 0 0 10px rgba(0, 168, 255, 0.1), inset 0 0 5px rgba(0, 168, 255, 0.1); border-color: rgba(0, 168, 255, 0.3); transform: scale(0.98); } 100% { box-shadow: 0 0 20px rgba(0, 168, 255, 0.4), inset 0 0 15px rgba(0, 168, 255, 0.2); border-color: rgba(0, 168, 255, 0.7); transform: scale(1.02); } }

/* TERMINAL COMPARATIVA */
#ai-terminal-window { margin: 0; width: 100%; }
.comp-body { display: grid; grid-template-columns: 1fr; border-top: 1px solid rgba(255,255,255,0.05); }
@media (min-width: 600px) { .comp-body { grid-template-columns: 1fr 1fr; min-height: 400px; } }
.comp-split { padding: 1.5rem; }
.old-way { background-color: rgba(0, 0, 0, 0.4); }
@media (min-width: 600px) { .old-way { border-right: 1px solid rgba(255,255,255,0.05); } }
.ub-way { background-color: rgba(0, 168, 255, 0.04); }
.split-header { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1.2rem; font-weight: 800; color: #666; padding-bottom: 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.ub-way .split-header { border-bottom-color: rgba(0, 168, 255, 0.3); color: #fff; }
.ub-way .split-header.text-gradient { background: none; -webkit-text-fill-color: initial; color: #fff; text-shadow: 0 0 10px rgba(0,168,255,0.5); }
.terminal-text div, .terminal-text p { font-family: 'Fira Code', Consolas, monospace; font-size: 0.8rem; line-height: 1.6; margin-bottom: 1.2rem; color: #888; white-space: normal; word-break: break-word; }
.ub-way .terminal-text p, .ub-way .terminal-text div { color: #b2ebf2; text-shadow: 0 0 8px rgba(0, 168, 255, 0.3); }

/* MVA HORIZONTAL COMPACTO */
.mva-box { background: linear-gradient(135deg, rgba(0, 255, 204, 0.1) 0%, rgba(0, 168, 255, 0.05) 100%) !important; border: 1px solid rgba(0, 255, 204, 0.4); border-left: 4px solid #00ffcc; padding: 0.8rem 1rem !important; border-radius: 6px; display: flex !important; align-items: center; justify-content: space-between; margin-top: 1.2rem !important; margin-bottom: 0 !important; animation: mva-pulse 2s infinite alternate ease-in-out; position: relative; overflow: hidden; }
.mva-box::before { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(0, 255, 204, 0.2), transparent); animation: mva-sweep 3s infinite; pointer-events: none; }
@keyframes mva-sweep { 0% { left: -100%; } 100% { left: 200%; } }
@keyframes mva-pulse { from { border-color: rgba(0, 255, 204, 0.3); box-shadow: 0 0 10px rgba(0, 255, 204, 0.1); } to { border-color: rgba(0, 255, 204, 0.8); box-shadow: 0 0 20px rgba(0, 255, 204, 0.3), inset 0 0 10px rgba(0, 255, 204, 0.1); } }
.mva-label { color: #b2ebf2; font-size: 0.75rem; font-weight: 600; margin: 0 !important; }
.mva-value { color: #00ffcc; font-size: 1.05rem; font-weight: 900; text-shadow: 0 0 10px rgba(0, 255, 204, 0.6); white-space: nowrap; margin: 0 !important; }
.terminal-text p:last-child, .terminal-text div:last-child { margin-bottom: 0; } 
.terminal-text .err { color: #ff5f56; text-shadow: 0 0 8px rgba(255, 95, 86, 0.4); }
.terminal-text .time { color: #ffbd2e; margin-top: 1.5rem; font-weight: bold; }

/* ==========================================================================
   SECCIÓN CASOS DE ÉXITO (CLÁSICA CON PROPORCIONES PANORÁMICAS)
   ========================================================================== */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; align-items: start; }
@media (min-width: 768px) { .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 3rem; } }

.project-card { 
    border-radius: 16px; overflow: hidden; background: rgba(15,18,22,0.6); border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-8px); border-color: rgba(0, 168, 255, 0.4); box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 20px rgba(0, 168, 255, 0.15); }

.project-img { 
    width: 100%; aspect-ratio: 21 / 9; height: auto; 
    background: linear-gradient(135deg, #0f141a, #05080a); border-bottom: 1px solid rgba(255,255,255,0.05); position: relative; overflow: hidden; background-size: cover; background-position: top center; 
}

.bg-labotal { background-image: url('../img/labotal.webp'); background-color: #0c1218; }
.bg-ferrovial { background-image: url('../img/ferrovial.webp'); background-color: #121820; }

.project-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(4, 8, 12, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.4s ease; padding: 2rem;
}
.project-card:hover .project-overlay { opacity: 1; }
.kpi-list { display: flex; flex-direction: column; gap: 1rem; width: 100%; transform: translateY(20px); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.project-card:hover .kpi-list { transform: translateY(0); }
.kpi-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(0, 168, 255, 0.15); padding-bottom: 0.5rem; }
.kpi-label { font-family: 'Fira Code', Consolas, monospace; font-size: 0.8rem; color: #888; }
.kpi-value { font-family: 'Fira Code', Consolas, monospace; font-size: 0.9rem; color: #00ffcc; font-weight: 700; text-shadow: 0 0 10px rgba(0,255,204,0.3); }

.project-info { padding: 3rem 2.5rem; flex: 1; display: flex; flex-direction: column; }
.project-info h3 { color: #fff; font-size: 1.5rem; margin-bottom: 0.8rem; transition: color 0.3s; }
.project-card:hover .project-info h3 { color: var(--tech-blue); }
.project-info p { color: #aaa; font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.5rem; flex: 1; }
.project-actions { margin-top: 1.5rem; display: flex; justify-content: flex-start; }

/* ==========================================================================
   SECCIÓN: CONTACTO WIZARD (#contacto)
   ========================================================================== */
.smart-form-wrapper { max-width: 650px; margin: 0 auto; width: 100%; }
.smart-form-card { background: rgba(15,18,22,0.8); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; padding: 3rem 2.5rem; box-shadow: 0 30px 70px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05); position: relative; overflow: hidden; }
.smart-form-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, var(--tech-blue), transparent); }
.form-step { display: none; } 
.form-step.active { display: block; animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.step-title { color: #fff; font-size: 1.3rem; margin-bottom: 1.5rem; font-weight: 700; }
.form-actions { display: flex; gap: 1rem; } 
.half-btn { flex: 1; }

/* TERMINAL SUCCESS BOX */
.terminal-success-box { background: rgba(5, 8, 12, 0.9); border: 1px solid rgba(0, 255, 204, 0.3); border-radius: 8px; padding: 1.5rem; font-family: 'Fira Code', Consolas, monospace; box-shadow: 0 0 30px rgba(0, 255, 204, 0.1); }
.success-line { color: #b2ebf2; font-size: 0.9rem; line-height: 1.8; margin-bottom: 0.5rem; opacity: 0; animation: terminalLineReveal 0.1s forwards; }
.success-200 { color: #00ffcc; font-weight: 800; text-shadow: 0 0 8px rgba(0, 255, 204, 0.6); }
.delay-s1 { animation-delay: 0.2s; } .delay-s2 { animation-delay: 0.8s; } .delay-s3 { animation-delay: 1.4s; } .delay-s4 { animation-delay: 2.0s; } .delay-s5 { animation-delay: 2.6s; }
@keyframes terminalLineReveal { to { opacity: 1; } }