:root {
    --primary: #f8fafc;
    --primary-dark: #0f172a;
    --accent: #1e40af;
    --accent-light: #3b82f6;
    --accent-glow: rgba(30, 64, 175, 0.1);
    --secondary: #6366f1;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-card: rgba(255, 255, 255, 0.75);
    --border-color: rgba(226, 232, 240, 0.6);
    --glass: rgba(255, 255, 255, 0.8);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --glow: 0 0 30px rgba(59, 130, 246, 0.15);
    /* 8bit Mesh Engine */
    --pixel-size: 30px;
    --mx: 50%;
    --my: 50%;
    /* Heimdall Engine */
    --scroll-reveal: 0%;
}

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

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

html {
    scroll-behavior: smooth;
}

body,
body.deep-blue-body {
    background: #060d1f;
    color: #e2e8f0;
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Páginas con fondo claro: anular el deep-blue */
body.deep-blue-body:has(.page-8bit-theme.light-mode) {
    background: #f8fafc !important;
    color: var(--text-main) !important;
}

body.deep-blue-body:has(.page-8bit-theme.light-mode) p,
body.deep-blue-body:has(.page-8bit-theme.light-mode) li {
    color: var(--text-muted) !important;
}

/* Sobrescribir texto oscuro heredado para compatibilidad */
body .text-dark,
body p,
body li {
    color: #cbd5e1;
}

body h1,
body h2,
body h3,
body h4 {
    color: #f1f5f9;
}

/* === GLOBAL BACKGROUND LAYER === */
.global-bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Malla de puntos tipo circuito */
.global-bg-canvas .eightbit-mesh {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(59, 130, 246, 0.18) 1px, transparent 1px);
    background-size: 32px 32px;
    animation: meshDrift 60s linear infinite;
    opacity: 0.5;
}

/* Scanlines atmosféricas */
.global-bg-canvas .eightbit-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 3px,
            rgba(0, 0, 0, 0.06) 3px,
            rgba(0, 0, 0, 0.06) 4px);
    opacity: 0.4;
}

/* Glow radial centrado — sensación de profundidad */
.global-bg-canvas::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(37, 99, 235, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(99, 102, 241, 0.10) 0%, transparent 60%);
}

@keyframes meshDrift {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 32px 32px;
    }
}

/* === THREE.JS CANVAS === */
#threejs-powergrid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.45;
}

/* Más visible en fondo claro */
body:has(.page-8bit-theme.light-mode) #threejs-powergrid {
    opacity: 0.85 !important;
}

/* Estilos Base para Botones - Fundaluz Premium */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    text-decoration: none !important;
    position: relative;
    overflow: hidden;
    gap: 10px;
    /* Evitar el temblor */
    backface-visibility: hidden;
    -webkit-font-smoothing: subpixel-antialiased;
    transform: translateZ(0);
}

.btn-primary {
    background: #120281 !important;
    color: #ffffff !important;
    border: 2px solid #120281 !important;
}

.btn-primary:hover {
    background: #1a06b0 !important;
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 10px 20px rgba(18, 2, 129, 0.2);
}

.btn-outline {
    border: 2px solid #e2e8f0 !important;
    background: transparent;
    color: #1e293b;
}

.btn-outline:hover {
    border-color: #3b82f6 !important;
    background: #eff6ff !important;
    color: #1e40af !important;
    transform: translateY(-2px) translateZ(0);
}

/* Fix para iconos dentro de botones */
.btn i {
    font-size: 1.2em;
    line-height: 0;
    display: flex;
    align-items: center;
}

/* Asegurar que el contenido quede siempre encima del canvas */
.navbar,
main,
section,
header,
footer,
.page-8bit-theme {
    position: relative;
    z-index: 2;
}

body::before {
    display: none;
    /* Reemplazado por .global-bg-canvas */
}


/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0.8rem 10%; /* Thinner navbar globally */
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-toggle {
    display: none;
}

.nav-menu-container {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
    justify-content: flex-end;
}

.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(30, 64, 175, 0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.5;
    pointer-events: none;
}

.navbar.scrolled {
    padding: 0.8rem 10%; /* Mantener coherencia con la navbar base */
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.navbar .logo {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--primary-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar .logo span {
    color: var(--accent);
}

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

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-social-links a:hover {
    color: #3b82f6 !important;
    transform: scale(1.15);
}

.footer-alliance-logo img {
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.footer-alliance-logo:hover img {
    opacity: 1 !important;
    transform: scale(1.12) translateY(-5px);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.35s ease !important;
    /* Forzar animación de ancho */
    box-shadow: 0 0 10px var(--accent-light);
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-btns {
    display: flex;
    gap: 1rem;
}

/* Hero Sections */
/* Energy Convergence Animation 2026 */
.hero {
    position: relative;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 10% 60px; /* Reducción agresiva para subir la diplomatura */
    background: #010413;
    overflow: hidden;
    color: white;
}

.energy-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-light) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 2;
    opacity: 0.2;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: ambientPulse 8s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0.3;
    }
}

.energy-background {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Tension Towers Blueprint */
.towers-grid {
    position: absolute;
    bottom: -10%;
    left: 0;
    width: 100%;
    height: 80%;
    opacity: 0.2;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"%3E%3Cdefs%3E%3ClinearGradient id="g" x1="0" y1="0" x2="1" y2="0"%3E%3Cstop offset="0" stop-color="%233b82f6" stop-opacity="0"/%3E%3Cstop offset=".5" stop-color="%233b82f6"/%3E%3Cstop offset="1" stop-color="%233b82f6" stop-opacity="0"/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d="M200 800 L350 200 L500 800 M250 600 L450 600 M280 450 L420 450" fill="none" stroke="%231e3a8a" stroke-width="2"/%3E%3Cpath d="M700 800 L850 150 L1000 800 M750 600 L950 600 M780 400 L920 400" fill="none" stroke="%231e3a8a" stroke-width="2"/%3E%3Cpath d="M0 300 Q 600 400 1200 300" fill="none" stroke="url(%23g)" stroke-width="2" stroke-dasharray="4,4"/%3E%3C/svg%3E');
    background-size: cover;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.4));
    animation: towersFlow 180s linear infinite;
}

@keyframes towersFlow {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 100% 0;
    }
}

/* Convergent Orbs */
.convergence-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 1s ease;
}

.orb-system {
    position: relative;
    width: 100%;
    height: 100vh;
}

.energy-orb {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;
    height: 160px;
    margin: -80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 6;
    transition: all 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.energy-orb::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: -1;
    transition: all 1s ease;
}

.orb-edu::before {
    background: radial-gradient(circle at 30% 30%, #3b82f6, #1e40af);
    box-shadow: 0 0 80px rgba(59, 130, 246, 0.4);
    filter: blur(45px);
}

.orb-edu {
    opacity: 0.9;
    animation: infiniteConvergenceEdu 25s ease-in-out infinite alternate;
}

.orb-work::before {
    background: radial-gradient(circle at 30% 30%, #6366f1, #312e81);
    box-shadow: 0 0 80px rgba(99, 102, 241, 0.4);
    filter: blur(50px);
}

.orb-work {
    opacity: 0.85;
    animation: infiniteConvergenceWork 30s ease-in-out infinite alternate;
}

.orb-tech::before {
    background: radial-gradient(circle at 30% 30%, #06b6d4, #083344);
    box-shadow: 0 0 80px rgba(6, 182, 212, 0.4);
    filter: blur(45px);
}

.orb-tech {
    opacity: 0.9;
    animation: infiniteConvergenceTech 28s ease-in-out infinite alternate;
}

@keyframes infiniteConvergenceEdu {
    0% {
        transform: translate(-450px, -250px) scale(1.5);
    }

    50% {
        transform: translate(-100px, -50px) scale(1.2);
    }

    100% {
        transform: translate(-450px, -250px) scale(1.5);
    }
}

@keyframes infiniteConvergenceWork {
    0% {
        transform: translate(450px, -200px) scale(1.6);
    }

    50% {
        transform: translate(80px, -30px) scale(1.3);
    }

    100% {
        transform: translate(450px, -200px) scale(1.6);
    }
}

@keyframes infiniteConvergenceTech {
    0% {
        transform: translate(0, 300px) scale(1.5);
    }

    50% {
        transform: translate(0, 100px) scale(1.2);
    }

    100% {
        transform: translate(0, 300px) scale(1.5);
    }
}

.energy-orb .label {
    position: absolute;
    bottom: -15px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    z-index: 10;
}

.energy-orb i {
    font-size: 2.2rem;
    color: white;
    opacity: 0.95;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    z-index: 10;
}

.hero .hero-layout-split {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem; /* Revertido un poco (antes 5rem) para permitir el wrap del título que prefiere el usuario */
    align-items: center;
    position: relative;
    z-index: 10;
}

.hero-main-content {
    animation: fadeInLeft 1s ease;
}

.hero-stats-side {
    position: relative;
    animation: fadeInRight 1s ease;
}

.hero-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem; /* Reducido de 1.4rem */
    border-radius: 28px;
    border: 1px solid rgba(30, 64, 175, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.hero-stats-grid:hover {
    transform: translateY(-3px);
}

.hero-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    min-height: 100px;
    min-width: 140px;
    flex: 1;
    position: relative;
    overflow: visible;
}

.hero-stat-card::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 5px;
    height: 5px;
    background: var(--accent-light);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-light);
    animation: sensorPulse 2s infinite;
}

@keyframes sensorPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.hero-stat-card:hover {
    background: rgba(15, 23, 42, 0.6);
    border-color: var(--accent-light);
    transform: translateY(-4px);
}

.hero-stat-card .stat-number {
    font-size: 0.85rem !important;
    /* Forzamos tamaño pequeño para palabras largas */
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    line-height: 1.2;
    margin-bottom: 0.3rem;
    display: block;
    width: 100%;
    white-space: nowrap;
    text-transform: uppercase;
}

.hero-stat-card .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 700;
    margin: 0;
}

body.deep-blue-body:has(.page-8bit-theme.light-mode) .hero-stat-card .stat-number {
    color: var(--accent) !important;
}

body.deep-blue-body:has(.page-8bit-theme.light-mode) .hero-stat-card {
    background: white !important;
    border-color: rgba(30, 64, 175, 0.1) !important;
}

.hero h1 span {
    background: linear-gradient(135deg, #fff 30%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
    position: relative;
    display: inline-block;
}






.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.course-highlight-card {
    background: linear-gradient(135deg, #120281 0%, #2563eb 60%, #7c3aed 100%);
    margin-top: 1.2rem;
    padding: 2.2rem;
    border-radius: 28px;
    color: white;
    box-shadow:
        0 25px 50px rgba(18, 2, 129, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
    border: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    cursor: pointer;
}

.course-highlight-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 35px 60px rgba(18, 2, 129, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 0 40px rgba(37, 99, 235, 0.3);
}

/* Fondo animado sutil */
.course-highlight-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.12) 0%, transparent 55%);
    animation: cardShimmer 4s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes cardShimmer {
    from {
        transform: scale(1) rotate(0deg);
    }

    to {
        transform: scale(1.1) rotate(8deg);
    }
}

.highlight-tag {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.course-highlight-card::before {
    content: '\f0c0';
    /* Users icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 8rem;
    opacity: 0.1;
    color: white;
    transform: rotate(15deg);
}

.btn-mini {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.3s;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 8BIT.AI EXPERIENCE INTEGRATION - GLOBAL CANVAS */
.page-8bit-canvas {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: -10;
    overflow: hidden;
    pointer-events: none;
    transition: background 0.5s ease;
}

.page-8bit-canvas.light-mode {
    background: #fff;
}

.page-8bit-canvas.deep-blue-mode {
    background: #051124;
}



.page-8bit-canvas .eightbit-mesh {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: var(--pixel-size) var(--pixel-size);
}

.page-8bit-canvas.light-mode .eightbit-mesh {
    background-image: radial-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px);
}


.page-8bit-canvas .eightbit-mesh::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle 350px at var(--mx) var(--my), rgba(0, 242, 255, 0.15), transparent 80%);
}

.page-8bit-canvas .eightbit-interactive-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    mask-image: radial-gradient(circle 300px at var(--mx) var(--my), black, transparent);
    -webkit-mask-image: radial-gradient(circle 300px at var(--mx) var(--my), black, transparent);
}

.page-8bit-canvas .eightbit-interactive-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--accent) 1.5px, transparent 1.5px);
    background-size: var(--pixel-size) var(--pixel-size);
    opacity: 0.8;
}

.page-8bit-canvas .eightbit-scanlines {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    z-index: 5;
}

/* Light/Dark Mode Overrides for 8bit Experience */
.page-8bit-theme .section {
    background: transparent !important;
}

.page-8bit-theme.light-mode {
    color: var(--text-main);
}

.page-8bit-theme.deep-blue-mode {
    color: #fff;
}



.page-8bit-theme .catalog-layout {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    border-radius: 40px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* En light-mode el catalog-layout es limpio */
.page-8bit-theme.light-mode .catalog-layout {
    background: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    padding: 0 !important;
}

.page-8bit-theme.light-mode .sidebar .filter-card {
    background: white !important;
    border-color: var(--border-color) !important;
    color: var(--text-main) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}


.page-8bit-theme .filter-list a {
    color: rgba(255, 255, 255, 0.6);
}

.page-8bit-theme .filter-list a:hover,
.page-8bit-theme .filter-list a.active {
    color: var(--accent);
    background: rgba(0, 242, 255, 0.1);
}

.page-8bit-theme .course-card {
    background: rgba(255, 255, 255, 0.03) !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.page-8bit-theme .course-card h4 {
    color: white;
}

.page-8bit-theme .course-card p {
    color: rgba(255, 255, 255, 0.6);
}

.page-8bit-theme .course-footer .btn-outline {
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.page-8bit-theme .course-footer .btn-outline:hover {
    background: white;
    color: black;
}

.hero.eightbit-infused {
    background: transparent !important;
}

/* HEIMDALL POWER SCROLL ENGINE */
/* Motor de revelado unificado */
.heimdall-reveal {
    background: linear-gradient(to right,
            #fff var(--scroll-reveal),
            rgba(255, 255, 255, 0.1) var(--scroll-reveal));
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    /* display: inline-block removed — breaks h1 block layout */
}

[data-theme="light"] .heimdall-reveal {
    background: linear-gradient(to right,
            #120281 var(--scroll-reveal),
            rgba(18, 2, 129, 0.65) var(--scroll-reveal)) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: rgba(18, 2, 129, 0.65) !important;
}

.deep-blue-mode .heimdall-reveal {
    background: linear-gradient(to right,
            #fff var(--scroll-reveal),
            rgba(255, 255, 255, 0.1) var(--scroll-reveal));
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}




.page-8bit-theme .section-title h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: rgba(255, 255, 255, 0.1);
}


.light-mode .section-title h2 {
    color: rgba(15, 23, 42, 0.1);
}

.deep-blue-mode .section-title p,
.deep-blue-mode .section p,
.deep-blue-mode .federal-content p,
.deep-blue-mode .stat-label,
.deep-blue-mode .federal-content div {
    color: rgba(255, 255, 255, 0.7) !important;
}

.deep-blue-mode h3,
.deep-blue-mode h4,
.deep-blue-mode .section-title h2 {
    color: #fff !important;
}

.deep-blue-mode .section {
    background: transparent !important;
}

.deep-blue-mode .federal-visual>div {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.deep-blue-mode .federal-visual li {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}






.glitch-title {
    font-size: clamp(2rem, 7vw, 4.2rem); /* Más compacto aún */
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.05em;
    position: relative;
    color: #fff;
    margin-bottom: 1rem;
    line-height: 0.95;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.1));
}

.light-mode .glitch-title {
    color: var(--primary-dark);
    background: linear-gradient(180deg, var(--primary-dark) 0%, rgba(15, 23, 42, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: none;
}

.deep-blue-mode .glitch-title {
    color: #fff;
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 30px rgba(59, 130, 246, 0.2));
}



.glitch-title span {
    display: inline;
    /* Cambiado de block a inline para que no se separen las palabras */
    font-size: inherit;
    letter-spacing: inherit;
    color: inherit;
    -webkit-text-fill-color: inherit;
    margin-top: 0;
    font-weight: inherit;
}

/* Adaptive 8bit Search */
.eightbit-search {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 242, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 5px;
    display: flex;
    max-width: 600px;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.1);
}

.eightbit-search input {
    background: transparent;
    border: none;
    color: #fff;
    padding: 15px 25px;
    flex: 1;
    font-size: 1.1rem;
    outline: none;
}

.eightbit-search button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 0 30px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.eightbit-search button:hover {
    background: #fff;
    box-shadow: 0 0 30px var(--accent);
}

/* Stats in 8bit.ai style */
.eightbit-stats-row {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
}

.eightbit-stat-box {
    border-left: 3px solid var(--accent);
    padding: 10px 20px;
}

.eightbit-stat-box .num {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    display: block;
}

.eightbit-stat-box .lab {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}


.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 15vh;
    background: linear-gradient(to top, var(--primary), transparent);
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 10;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    border-radius: 100px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2rem;
    animation: fadeInDown 1s ease;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 6rem);
    line-height: 1.05;
    margin-bottom: 1.5rem;
    color: white;
    letter-spacing: -3px;
    font-weight: 800;
}

.hero h1 span {
    background: linear-gradient(135deg, #fff 30%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem; /* Reducido de 1.25rem */
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem; /* Reducido de 3rem */
    max-width: 650px;
}

/* Buscador Antigravity Premium */
.search-container {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 0.4rem;
    border-radius: 100px;
    display: flex;
    max-width: 650px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 25px 60px rgba(30, 64, 175, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 0 40px rgba(255, 255, 255, 0.1) inset;
    margin-top: 2rem;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    animation: searchAppear 1s ease 0.6s both;
}

.search-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 100px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6), rgba(99, 102, 241, 0.4), rgba(59, 130, 246, 0.4), transparent);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); /* Standard mask */
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    /* Evita bloquear clics */
}

.search-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 3s infinite;
    pointer-events: none;
    /* Evita bloquear clics */
}

.search-container:hover,
.search-container:focus-within {
    transform: translateY(-3px) scale(1.02);
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 35px 80px rgba(30, 64, 175, 0.25),
        0 0 0 1px rgba(99, 102, 241, 0.3) inset,
        0 0 60px rgba(99, 102, 241, 0.2),
        0 0 100px rgba(255, 255, 255, 0.15) inset;
}

.search-container:focus-within::before {
    opacity: 1;
}

.search-container input {
    flex: 1;
    border: none;
    padding: 1.1rem 2rem;
    font-size: 1.05rem;
    background: transparent;
    color: white;
    outline: none;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.search-container input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 400;
}

.search-container button {
    background: linear-gradient(135deg, var(--accent-light) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.search-container button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.search-container button:hover::before {
    width: 300px;
    height: 300px;
}

.search-container button:hover {
    transform: translateX(3px) scale(1.05);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.3) inset,
        0 0 30px rgba(99, 102, 241, 0.4);
}

.search-container button:active {
    transform: translateX(3px) scale(0.98);
}

.search-container button i {
    position: relative;
    z-index: 1;
    font-size: 1.1rem;
}

@keyframes searchAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Dashboard Button Style */
.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 10px 20px -5px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -5px var(--accent-glow);
}

.btn-glass {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.btn-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-glass:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.4), 0 0 15px var(--accent-light);
}

.btn-glass:hover::before {
    left: 100%;
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(30, 64, 175, 0.05);
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 1px;
    border: 1px solid rgba(30, 64, 175, 0.1);
    margin-left: 10px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-3px);
}

/* Alertas */
.alert {
    padding: 1rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.alert-info {
    background: #e0f2fe;
    color: #075985;
    border: 1px solid #0ea5e9;
}

/* Stats Section */
.stats {
    padding: 5rem 10%;
    display: flex;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 249, 255, 0.95) 100%);
    border-bottom: 1px solid rgba(59, 130, 246, 0.1);
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stats::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    top: -150px;
    left: 20%;
    animation: float 12s ease-in-out infinite;
    pointer-events: none;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-heading);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Institutions Grid */
.section {
    padding: 8rem 10%;
    position: relative;
    overflow: hidden;
}

#capacitacion {
    background: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(30, 64, 175, 0.12) 0%, transparent 50%),
        linear-gradient(180deg, #eef6ff 0%, #d8eaff 100%);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(59, 130, 246, 0.15);
}

#capacitacion::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: 10%;
    animation: float 15s ease-in-out infinite;
    pointer-events: none;
}

#capacitacion::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: 5%;
    animation: float 18s ease-in-out infinite reverse;
    pointer-events: none;
}

#institutos {
    background: radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.07) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 40%),
        linear-gradient(180deg, rgba(232, 240, 254, 0.8) 0%, rgba(219, 234, 254, 0.9) 100%);
    position: relative;
    overflow: hidden;
}

#institutos::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--accent) 0.8px, transparent 0.8px),
        radial-gradient(var(--accent) 0.8px, transparent 0.8px);
    background-size: 40px 40px;
    background-position: 0 0, 20px 20px;
    opacity: 0.03;
    pointer-events: none;
}

#institutos::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    top: 50%;
    right: -300px;
    transform: translateY(-50%);
    animation: pulse 8s ease-in-out infinite;
    pointer-events: none;
}

.section-title {
    margin-bottom: 5rem;
    text-align: center;
    position: relative;
    z-index: 5;
}

.section-title h2 {
    font-size: 3rem;
    background: linear-gradient(to right, var(--primary-dark), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
}

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

@media (min-width: 992px) {
    .institution-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
}

.page-8bit-theme .inst-card {
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 2.2rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.page-8bit-theme .inst-card::before {
    display: none;
}

.page-8bit-theme .inst-card:hover {
    transform: scale(1.03);
    border-color: var(--accent);
    background: rgba(0, 242, 255, 0.05) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 242, 255, 0.1);
}

.page-8bit-theme .inst-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #000;
    margin-bottom: 1.5rem;
    transition: all 0.5s ease;
    box-shadow: 0 10px 20px rgba(0, 242, 255, 0.2);
}

.page-8bit-theme .inst-card:hover .inst-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 30px var(--accent);
}

.page-8bit-theme .inst-card h3 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    letter-spacing: -0.02em;
}

.page-8bit-theme .inst-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.page-8bit-theme .inst-link {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.page-8bit-theme .inst-card:hover .inst-link {
    gap: 15px;
    text-shadow: 0 0 10px var(--accent);
}


.inst-card:hover::before {
    opacity: 1;
}

.inst-card:hover::after {
    opacity: 1;
}

.inst-card {
    text-decoration: none !important;
    background: rgba(240, 249, 255, 0.4) !important;
    /* Tono "ice" azulado muy ligero */
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 32px;
    padding: 1.5rem 0.6rem;
    position: relative;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(18, 2, 129, 0.03),
        inset 0 0 0 1px rgba(255, 255, 255, 0.4) !important;
}

.inst-card:hover {
    transform: scale(1.03);
    background: rgba(240, 249, 255, 0.6) !important;
    box-shadow: 0 25px 50px rgba(18, 2, 129, 0.1),
        0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    border-color: rgba(255, 255, 255, 1) !important;
}

.inst-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #ffffff !important;
    font-size: 1.4rem;
    margin-bottom: 2rem;
    transition: all 0.5s ease;
    box-shadow: 0 12px 24px rgba(30, 64, 175, 0.2);
    position: relative;
    z-index: 5;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.inst-icon span,
.inst-icon i {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.inst-card:hover .inst-icon {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4);
}

.inst-card h3 {
    color: #120281;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: -0.02em;
}

.inst-card p {
    color: #334155;
    /* Un tono más oscuro para legibilidad sobre el vidrio */
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 2.5rem;
    flex-grow: 1;
}

.inst-link {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: #1e40af !important;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0.6rem 1rem;
    background: rgba(30, 64, 175, 0.05);
    border-radius: 18px;
    width: fit-content;
    border: 1px solid transparent;
}

.inst-card:hover .inst-link {
    background: #1e40af !important;
    color: #ffffff !important;
    box-shadow: 0 15px 30px rgba(30, 64, 175, 0.2);
    transform: scale(1.05);
}

.inst-link i {
    transition: transform 0.3s ease;
}

.inst-link:hover i {
    transform: translateX(3px);
}

.floating-search {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.4), 0 0 20px rgba(59, 130, 246, 0.2);
    z-index: 9999;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    border: none;
    outline: none;
}

.floating-search.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.floating-search:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--accent-light);
    box-shadow: 0 15px 40px rgba(30, 64, 175, 0.5);
}

.floating-search i {
    transition: transform 0.3s ease;
}

.floating-search:hover i {
    transform: scale(1.1);
}

/* === WhatsApp Floating Button === */
.floating-wa {
    position: fixed;
    bottom: 100px;
    /* 30px + 56px lupa + 14px gap = alineado encima */
    right: 30px;
    /* mismo right que .floating-search */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25d366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-wa.visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.floating-wa:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 35px rgba(37, 211, 102, 0.55);
}

.floating-wa:hover .wa-tooltip {
    opacity: 1;
}

/* Pulsing ring */
.wa-ring {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37, 211, 102, 0.5);
    animation: waPulse 2.2s ease-out infinite;
    pointer-events: none;
}

/* Tooltip */
.wa-tooltip {
    position: absolute;
    right: 68px;
    background: #25d366;
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    border-radius: 10px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(10px);
}

@keyframes waPulse {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }

    70% {
        transform: scale(1.55);
        opacity: 0;
    }

    100% {
        transform: scale(1.55);
        opacity: 0;
    }
}

.inst-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 50%, var(--secondary) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
    color: white;
    font-size: 2rem;
    box-shadow: 0 15px 30px rgba(30, 64, 175, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    animation: iconLevitate 4s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.inst-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    animation: iconGlow 3s ease-in-out infinite;
}

@keyframes iconLevitate {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-12px) rotate(2deg);
    }
}

@keyframes iconGlow {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Cards de Cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.course-card {
    background: var(--bg-card);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
}

/* Glow interior en hover */
.course-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.4s ease !important;
    pointer-events: none;
    z-index: 1;
}

.course-card:hover {
    transform: translateY(-6px);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow:
        0 20px 40px rgba(30, 64, 175, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.06);
}

.course-card:hover::before {
    opacity: 1;
}

/* CABECERA DE CARD - Banner de color por categoría */
.course-card-header {
    position: relative;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    flex-shrink: 0;
}

/* Patrón de puntos decorativo en el banner */
.course-card-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}

.course-card-icon {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.2));
}

.course-card:hover .course-card-icon {
    transform: scale(1.2) translateY(-4px);
}

.course-card-badge {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    z-index: 2;
}

.course-content {
    padding: 1.8rem 2rem 1rem;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.course-tag {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.35rem 0.85rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
}

.course-content h4 {
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
    color: var(--primary-dark);
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.3s ease !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.4rem; /* Asegura altura mínima para 2 líneas */
}

.course-card:hover .course-content h4 {
    color: #2563eb;
}

.course-content p {
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.course-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(226, 232, 240, 0.4);
    padding-top: 1rem;
    font-weight: 600;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-info i {
    margin-right: 0.4rem;
    color: #2563eb;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Catalog Layout & Sidebar Filters */
.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.filter-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
}

.filter-list li {
    margin-bottom: 0.5rem;
}

.filter-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-list a:hover {
    background: var(--primary);
    color: var(--accent);
}

.filter-list a.active {
    background: var(--accent);
    color: white;
}

.filter-list .count {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 2px 8px;
    border-radius: 10px;
}

/* Ocultar el badge cuando está vacío — elimina el "-" fantasma */
.filter-list .count:empty {
    display: none;
}

.filter-list a.active .count {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.course-footer {
    padding: 2rem;
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
}

.course-footer .btn {
    flex: 1;
    text-align: center;
    padding: 0.8rem;
    font-size: 0.9rem;
}

/* Footer Corrected */
.footer {
    background: #080d1a;
    padding: 5rem 10% 2rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-info .footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: block;
    color: white;
    text-decoration: none;
}

.footer-info p {
    color: rgba(255, 255, 255, 0.9);
}

.footer-links h4 {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: white;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

.campus-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

@keyframes glow-pulse {
    0% {
        box-shadow: 0 0 5px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow);
    }

    100% {
        box-shadow: 0 0 5px var(--accent-glow);
    }
}

/* Scroll Trigger Animations Preparations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.floating-blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
    filter: blur(50px);
    z-index: -1;
    border-radius: 50%;
    animation: blob-float 20s infinite alternate;
}

@keyframes blob-float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(100px, 50px);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Adjustments */
@media (max-width: 968px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}



/* Search Overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(15px);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-overlay-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.search-overlay-close:hover {
    opacity: 1;
}

.search-overlay .search-container {
    max-width: 800px;
    transform: translateY(30px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.active .search-container {
    transform: translateY(0);
}

.search-hint {
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2rem;
    font-size: 0.9rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Removed redundant media queries, consolidated at bottom */

/* =====================================================
   BOTÓN TOGGLE DE TEMA - Siempre visible
   ===================================================== */
.theme-toggle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow:
        0 4px 12px rgba(59, 130, 246, 0.4),
        0 0 0 3px rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.12) rotate(20deg);
    background: var(--accent-light);
    box-shadow:
        0 6px 20px rgba(59, 130, 246, 0.5),
        0 0 0 4px rgba(255, 255, 255, 0.2);
}

.theme-toggle:active {
    transform: scale(0.92);
}

/* Íconos dentro del botón */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    position: absolute;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* Modo OSCURO (por defecto): muestra ☀️ sol para cambiar a claro */
.theme-toggle .icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #fbbf24;
}

.theme-toggle .icon-moon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

/* =====================================================
   TEMA CLARO (INSTITUCIONAL) — data-theme="light"
   Paleta oficial:
   Navy #120281 | Lavender #ccd1ff | White #ffffff
   ===================================================== */

/* --- VARIABLES OVERRIDE para el tema claro --- */
[data-theme="light"] {
    --bg-main: #ffffff;
    --bg-section: #ccd1ff;
    --bg-card: #ffffff;
    --text-heading: #120281;
    --text-body: #120281;
    --text-muted: #4a5568;
    --accent: #120281;
    --accent-light: #9da1cf;
    --border-color: rgba(18, 2, 129, 0.15);
    --glass: rgba(255, 255, 255, 0.95);
}

/* --- BODY Y FONDO GLOBAL --- */
[data-theme="light"] body,
[data-theme="light"] body.deep-blue-body {
    background: #ffffff !important;
    color: #120281 !important;
}

/* Fondo animado: puntos sutiles en azul Fundaluz */
[data-theme="light"] .global-bg-canvas {
    opacity: 0.7 !important;
}

[data-theme="light"] .global-bg-canvas .eightbit-mesh {
    background-image: radial-gradient(rgba(30, 64, 175, 0.1) 1px, transparent 1px) !important;
    opacity: 1 !important;
}

[data-theme="light"] .global-bg-canvas .eightbit-scanlines {
    opacity: 0.04 !important;
}

[data-theme="light"] #threejs-powergrid {
    opacity: 0.8 !important;
    /* Más visible en fondo claro */
    filter: none !important;
    mix-blend-mode: normal !important;
}

/* --- NAVBAR --- */
[data-theme="light"] .navbar {
    background: rgba(219, 234, 254, 0.6) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(147, 197, 253, 0.4) !important;
    box-shadow: 0 4px 24px rgba(30, 64, 175, 0.05) !important;
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(219, 234, 254, 0.85) !important;
    box-shadow: 0 4px 24px rgba(30, 64, 175, 0.1) !important;
}

[data-theme="light"] .nav-links a {
    color: #120281 !important;
    font-weight: 600;
}

[data-theme="light"] .nav-links a:hover {
    color: #120281 !important;
    opacity: 0.8;
}

[data-theme="light"] .nav-links a::after {
    background: #120281 !important;
}

/* --- TIPOGRAFÍA GLOBAL --- */
[data-theme="light"] h1:not(.hero *):not(.heimdall-reveal),
[data-theme="light"] h2:not(.hero *):not(.cta-section *):not(.heimdall-reveal),
[data-theme="light"] h3:not(.hero *):not(.heimdall-reveal),
[data-theme="light"] h4:not(.hero *):not(.cta-section *):not(.heimdall-reveal) {
    color: #120281 !important;
    -webkit-text-fill-color: #120281 !important;
}

[data-theme="light"] p:not(.hero *):not(.cta-section *):not(.footer *):not(.search-overlay *):not(.inst-card *):not(.course-card-v2 *) {
    color: #120281 !important;
    opacity: 0.85;
}

[data-theme="light"] li:not(.hero *):not(.footer *):not(.inst-card *),
[data-theme="light"] span:not(.hero *):not(.cta-section *):not(.campus-status *):not(.stat-number):not(.course-tag):not(.btn *):not(.inst-card *):not(.course-card-v2 *) {
    color: #5a5a8a !important;
}

[data-theme="light"] strong:not(.hero *):not(.footer *) {
    color: #0f1747 !important;
}

/* --- SECTION TITLES --- */
[data-theme="light"] .section-title h2 {
    color: #120281;
    background: transparent !important;
}

[data-theme="light"] .section-title h2 .heimdall-reveal {
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .section-title p {
    color: #120281 !important;
    opacity: 0.7;
}

/* --- SECCIONES --- */
[data-theme="light"] .section,
[data-theme="light"] section {
    background: transparent !important;
}

/* Secciones alternas con fondo azul claro */
[data-theme="light"] section[style*="background: white"],
[data-theme="light"] section[style*="background:white"] {
    background: #ccd1ff !important;
    /* El color lavender pálido de la imagen */
}

[data-theme="light"] section[style*="background: linear-gradient(180deg, #f0f7ff"] {
    background: linear-gradient(180deg, #ffffff 0%, #ccd1ff 100%) !important;
}

/* --- CARDS DE INSTITUTOS (LIGHT GLASS) --- */
[data-theme="light"] .inst-card {
    background: rgba(240, 249, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .inst-card:hover {
    background: rgba(240, 249, 255, 0.6) !important;
    border-color: rgba(255, 255, 255, 1) !important;
}

[data-theme="light"] .inst-icon {
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

[data-theme="light"] .inst-icon span,
[data-theme="light"] .inst-icon i {
    color: #ffffff !important;
}

[data-theme="light"] .inst-card p {
    color: #1e293b !important;
    /* Texto oscuro sobre fondo claro de la card */
}

/* --- CARDS DE CURSOS (LIGHT GLASS) --- */
[data-theme="light"] .course-card-v2 {
    background: rgba(240, 249, 255, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

[data-theme="light"] .course-card-v2:hover {
    background: rgba(240, 249, 255, 0.6) !important;
}

[data-theme="light"] .course-icon-box {
    background: linear-gradient(135deg, #1e40af, #3b82f6) !important;
}

[data-theme="light"] .course-icon-box i {
    color: #ffffff !important;
}

[data-theme="light"] .course-card-v2 p,
[data-theme="light"] .course-card-v2 .course-excerpt {
    color: #334155 !important;
}

/* --- CARDS DE CURSOS --- */
[data-theme="light"] .course-card {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-color: rgba(18, 2, 129, 0.1) !important;
    box-shadow: 0 4px 24px rgba(18, 2, 129, 0.05) !important;
}

[data-theme="light"] .course-card:hover {
    border-color: rgba(18, 2, 129, 0.2) !important;
    box-shadow: 0 8px 32px rgba(18, 2, 129, 0.1) !important;
}

[data-theme="light"] .course-card h4 {
    color: #120281 !important;
}

[data-theme="light"] .course-card p {
    color: #120281 !important;
    opacity: 0.8;
}

[data-theme="light"] .course-tag {
    background: #e0e7ff !important;
    color: #1e40af !important;
    border: 1px solid rgba(30, 64, 175, 0.1) !important;
}

[data-theme="light"] .course-card-badge {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #120281 !important;
    border: 1px solid rgba(18, 2, 129, 0.2) !important;
    font-weight: 700 !important;
    backdrop-filter: blur(4px) !important;
}

[data-theme="light"] .course-info {
    color: #120281 !important;
    opacity: 0.7;
}

[data-theme="light"] .course-info i {
    color: #120281 !important;
}

[data-theme="light"] .course-footer .btn-outline {
    color: #120281 !important;
    border-color: rgba(18, 2, 129, 0.3) !important;
}

[data-theme="light"] .course-footer .btn-outline:hover {
    background: #120281 !important;
    color: white !important;
}

/* --- BOTONES GENERALES --- */
[data-theme="light"] .btn-primary {
    background: #120281 !important;
    box-shadow: 0 4px 15px rgba(18, 2, 129, 0.3) !important;
}

[data-theme="light"] .btn-glass {
    background: #ccd1ff !important;
    color: #120281 !important;
    border-color: #9da1cf !important;
}

[data-theme="light"] .btn-glass:hover {
    background: rgba(30, 64, 175, 0.15) !important;
}

/* --- SECCIÓN BENEFICIOS --- */
[data-theme="light"] .grid h3 {
    color: #120281 !important;
}

[data-theme="light"] .grid p {
    color: #120281 !important;
    opacity: 0.8;
}

[data-theme="light"] section i.fas,
[data-theme="light"] section i.far {
    color: #120281 !important;
}

/* --- PRESENCIA FEDERAL / SECCIÓN SEDES --- */
[data-theme="light"] .federal-content span[style*="color: var(--accent)"] {
    color: #3d2b8a !important;
}

[data-theme="light"] .federal-content h2,
[data-theme="light"] .federal-content h2[style] {
    color: #120281 !important;
    -webkit-text-fill-color: #120281 !important;
}

[data-theme="light"] .federal-content p,
[data-theme="light"] .federal-content div {
    color: #120281 !important;
    opacity: 0.85;
}

[data-theme="light"] .federal-visual div[style*="background: white"] {
    background: #fff !important;
    border-color: rgba(18, 2, 129, 0.1) !important;
    box-shadow: 0 20px 50px rgba(18, 2, 129, 0.05) !important;
}

[data-theme="light"] .federal-visual h4 {
    color: #120281 !important;
}

[data-theme="light"] .federal-visual span {
    color: #120281 !important;
    opacity: 0.7;
}

[data-theme="light"] .federal-visual strong {
    color: #120281 !important;
}

/* Números de sedes */
[data-theme="light"] span[style*="font-size: 2.5rem"] {
    color: #3d2b8a !important;
    -webkit-text-fill-color: #3d2b8a !important;
}

[data-theme="light"] span[style*="text-transform: uppercase"][style*="color: var(--text-muted)"] {
    color: #6b6b9a !important;
}

/* "Presencia en todo el País" badge */
[data-theme="light"] div[style*="background: var(--accent)"][style*="color: white"] {
    background: #120281 !important;
    color: white !important;
}

/* --- SECCIÓN "¿POR QUÉ ESTUDIAR?" --- */
[data-theme="light"] p[style*="font-size: 1.25rem"] {
    color: #0f1747 !important;
}

[data-theme="light"] p[style*="line-height: 1.8"] {
    color: #3d3d6e !important;
}

/* Mini stat cards blancas ("+25 Años", "+20K Alumnos") */
[data-theme="light"] div[style*="background: #f8fafc"] {
    background: #fff !important;
    border-color: rgba(61, 43, 138, 0.1) !important;
    box-shadow: 0 8px 24px rgba(61, 43, 138, 0.06) !important;
}

[data-theme="light"] span[style*="font-size: 2.5rem"][style*="color: var(--accent)"] {
    color: #3d2b8a !important;
    -webkit-text-fill-color: #3d2b8a !important;
}

/* --- TESTIMONIOS Y NOTICIAS --- */
[data-theme="light"] .testimonial-card {
    background: #ffffff !important;
    border-color: rgba(61, 43, 138, 0.1) !important;
}

[data-theme="light"] .testimonial-text {
    color: #5a5a8a !important;
}

[data-theme="light"] .testimonial-author strong {
    color: #120281 !important;
}

[data-theme="light"] .news-card {
    background: #fff !important;
    border: 1px solid rgba(18, 2, 129, 0.1) !important;
}

[data-theme="light"] .news-card h4 {
    color: #120281 !important;
}

[data-theme="light"] .news-card p {
    color: #120281 !important;
    opacity: 0.8;
}

[data-theme="light"] .news-link {
    color: #120281 !important;
    font-weight: 700;
}

/* --- SECCIÓN CTA FINAL --- */
[data-theme="light"] .cta-section {
    background: #120281 !important;
}

[data-theme="light"] .cta-section *,
[data-theme="light"] .cta-section h2,
[data-theme="light"] .cta-section p {
    color: white !important;
    -webkit-text-fill-color: white !important;
}

/* --- FOOTER --- */
[data-theme="light"] .footer {
    background: #120281 !important;
}

[data-theme="light"] .footer p,
[data-theme="light"] .footer li,
[data-theme="light"] .footer a,
[data-theme="light"] .footer span {
    color: #b8b8d8 !important;
}

[data-theme="light"] .footer h4 {
    color: #e8e3f5 !important;
}

[data-theme="light"] .footer a:hover {
    color: #c4b8e8 !important;
}

/* --- HERO TRANSPARENCY --- */
[data-theme="light"] .hero {
    background: transparent !important;
}

[data-theme="light"] .eightbit-search {
    background: #ffffff !important;
    border: 2px solid #120281 !important;
    box-shadow: 0 10px 30px rgba(18, 2, 129, 0.1) !important;
}

[data-theme="light"] .eightbit-search input {
    color: #120281 !important;
}

[data-theme="light"] .eightbit-search button {
    background: #120281 !important;
    color: #ffffff !important;
}

[data-theme="light"] .eightbit-search button:hover {
    background: #ccd1ff !important;
    color: #120281 !important;
}

[data-theme="light"] .hero-main-content p,
[data-theme="light"] header.hero h2,
[data-theme="light"] header.hero h2 span {
    color: #120281 !important;
    -webkit-text-fill-color: #120281 !important;
}

/* --- BOTÓN TOGGLE EN MODO CLARO: muestra 🌙 --- */
[data-theme="light"] .theme-toggle {
    background: linear-gradient(135deg, #3d2b8a, #6b5cbf) !important;
    box-shadow: 0 4px 16px rgba(61, 43, 138, 0.4), 0 0 0 3px rgba(61, 43, 138, 0.15) !important;
}

[data-theme="light"] .theme-toggle .icon-sun {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="light"] .theme-toggle .icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #e8e3f5;
}

/* --- FLOATING SEARCH EN MODO CLARO --- */
[data-theme="light"] .floating-search {
    background: linear-gradient(135deg, #3d2b8a, #6b5cbf) !important;
}

/* --- SEARCH OVERLAY --- */
[data-theme="light"] .search-overlay {
    background: rgba(15, 23, 71, 0.97) !important;
}

/* --- CTA SECTION: siempre oscura, textos siempre blancos --- */
/* Botón Inscribirme y otros */
.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    transition: all 0.3s ease;
    border: 2px solid transparent; /* Reservamos el espacio del borde siempre */
    box-sizing: border-box;
    backface-visibility: hidden; /* Evita jitter en transformaciones */
    vertical-align: middle;
}

.btn-primary {
    background: #120281;
    color: white;
    padding: 0 2rem;
}

/* Hover con elevación sutil */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Anular animación SOLO en el sidebar del curso */
.course-sidebar .sidebar-btn,
.course-sidebar .sidebar-btn:hover {
    transform: none !important;
}

/* Específicos para el sidebar de detalle */
.course-sidebar .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

[data-theme="light"] .cta-section {
    background: linear-gradient(135deg, #1e40af 0%, #3d2b8a 100%) !important;
    color: white !important;
}

[data-theme="light"] .cta-section p,
[data-theme="light"] .cta-section h1,
[data-theme="light"] .cta-section h2,
[data-theme="light"] .cta-section h3,
[data-theme="light"] .cta-section span,
[data-theme="light"] .cta-section li,
[data-theme="light"] .cta-section strong {
    color: white !important;
    -webkit-text-fill-color: white !important;
}


/* =====================================================
   ESTILOS ADICIONALES Y RECOLECCIÓN DE TEMA CLARO
   ===================================================== */

[data-theme="light"] .hero {
    background: transparent !important;
}

[data-theme="light"] .glitch-title {
    color: #120281 !important;
    -webkit-text-fill-color: initial !important;
    text-shadow: none !important;
    filter: none !important;
    display: block !important;
    width: 100% !important;
    line-height: 0.95 !important; /* Mantener line-height compacto */
    text-transform: uppercase;
    overflow: visible !important;
}

[data-theme="light"] .glitch-title.heimdall-reveal {
    /* Permitir el degradado del motor */
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

[data-theme="light"] .glitch-title span {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
    display: inline !important;
    font-size: inherit !important;
    letter-spacing: inherit !important;
    font-weight: inherit !important;
}

[data-theme="light"] .hero-desc {
    color: #120281 !important;
    margin-bottom: 1.5rem; /* Reducido de 2.5rem */
    font-size: 1.1rem; /* Reducido de 1.15rem */
    max-width: 600px;
    opacity: 0.85 !important;
    line-height: 1.6;
}

[data-theme="light"] .hero-subtitle {
    color: #120281 !important;
    font-size: 1.6rem !important; /* Reducido de 2.5rem */
    margin-bottom: 1.2rem; /* Reducido de 1.8rem */
    font-family: var(--font-heading);
    line-height: 1.2;
    font-weight: 800;
}

[data-theme="light"] .accent-sub {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    background: none !important;
    font-weight: 800;
}

/* BUSCADOR CON "GRACIA" */
[data-theme="light"] .eightbit-search {
    background: #ffffff !important;
    border: 2px solid #ccd1ff !important;
    padding: 6px;
    box-shadow:
        12px 12px 0px rgba(18, 2, 129, 0.05),
        0 20px 40px rgba(18, 2, 129, 0.08) !important;
    border-radius: 16px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

[data-theme="light"] .eightbit-search:focus-within {
    border-color: #120281 !important;
    box-shadow:
        12px 12px 0px rgba(18, 2, 129, 0.1),
        0 20px 40px rgba(18, 2, 129, 0.12) !important;
}

[data-theme="light"] .eightbit-search input {
    color: #120281 !important;
    font-weight: 600;
    font-size: 1.1rem;
    padding-left: 15px;
}

[data-theme="light"] .eightbit-search button {
    background: #120281 !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    height: 50px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

[data-theme="light"] .eightbit-search button:hover {
    background: #2563eb !important;
    transform: scale(1.05);
}

/* CARDS E ICONOS - SOFT VERSION */
[data-theme="light"] .hero-stat-card {
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 1rem 0.8rem !important;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

[data-theme="light"] .hero-stat-card::after {
    display: none !important;
}

[data-theme="light"] .hero-stat-card:hover {
    transform: translateY(-6px) scale(1.03) !important;
    background: #ffffff !important;
    border-color: #120281 !important;
    box-shadow:
        0 12px 28px rgba(18, 2, 129, 0.12),
        0 0 0 3px rgba(204, 209, 255, 0.4) !important;
}

[data-theme="light"] .hero-stat-card .stat-number {
    color: #120281 !important;
    -webkit-text-fill-color: #120281 !important;
    font-size: 1.5rem !important; /* Reducido de 2.2rem */
    font-weight: 900;
    margin-bottom: 0.1rem; /* Reducido de 0.2rem */
    transition: transform 0.3s ease;
}

[data-theme="light"] .hero-stat-card:hover .stat-number {
    transform: scale(1.08);
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
}

[data-theme="light"] .hero-stat-card .stat-label {
    color: #120281 !important;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 0.65rem !important; /* Reducido de 0.72rem */
    font-weight: 700;
}

[data-theme="light"] .course-highlight-card {
    background: linear-gradient(135deg, #120281 0%, #2563eb 60%, #7c3aed 100%) !important;
    box-shadow:
        0 25px 50px rgba(18, 2, 129, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset !important;
}

[data-theme="light"] .course-highlight-card h3 {
    color: white !important;
    -webkit-text-fill-color: white !important;
}

/* =====================================================
   RESPONSIVE - MOBILE EXPERIENCE
   ===================================================== */

/* Ocultar canvas de Three.js en móviles para mejorar rendimiento */
@media (max-width: 768px) {

    #threejs-powergrid,
    .global-bg-canvas {
        display: none !important;
    }

    body {
        background: #060d1f !important;
    }

    .container {
        padding: 0 1.5rem;
    }

    /* Navbar Mobile */
    .navbar {
        padding: 0.8rem 1.5rem !important;
    }

    .nav-toggle {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        cursor: pointer;
        z-index: 1001;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-toggle:hover, .nav-toggle:active {
        background: rgba(255, 255, 255, 0.2);
        transform: scale(1.05);
    }

    .nav-toggle span {
        display: block;
        width: 20px;
        height: 2.5px;
        background: #ffffff;
        border-radius: 4px;
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
        background: var(--accent);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
        background: var(--accent);
    }

    .nav-menu-container {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: linear-gradient(180deg, #070e24 0%, #010413 100%) !important;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        border-top: 6px solid #120281 !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start !important;
        align-items: center;
        gap: 1.8rem !important;
        padding: 5.5rem 1.5rem 3rem !important;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        box-shadow: -15px 0 45px rgba(0, 0, 0, 0.25);
    }

    .nav-menu-container.active {
        right: 0;
    }

    .nav-links {
        display: flex !important;
        flex-direction: column;
        align-items: stretch !important;
        width: 100%;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .nav-links li {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .nav-links li a {
        font-size: 0.95rem !important;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: rgba(255, 255, 255, 0.8) !important;
        padding: 1.1rem 0.5rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        transition: all 0.3s ease;
        text-decoration: none;
    }

    .nav-links li a::after {
        content: '\f054';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 0.75rem;
        opacity: 0.4;
        transition: transform 0.2s ease;
    }

    .nav-links li a:hover, .nav-links li a:active {
        color: var(--accent) !important;
        padding-left: 0.8rem !important;
    }

    .nav-links li a:hover::after, .nav-links li a:active::after {
        transform: translateX(3px);
        opacity: 0.8;
        color: var(--accent);
    }

    /* Buscador responsivo sin desbordamiento */
    .eightbit-search {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: 0 10px 30px rgba(18, 2, 129, 0.05) !important;
    }
    .eightbit-search input {
        padding: 10px 15px !important;
        font-size: 0.95rem !important;
    }
    .eightbit-search button {
        padding: 0 15px !important;
        font-size: 0.9rem !important;
        height: 44px !important;
    }

    /* Redes sociales circulares premium */
    .nav-social-links {
        display: flex !important;
        justify-content: center !important;
        gap: 1.5rem !important;
        margin: 1.5rem 0 !important;
        width: 100%;
    }

    .nav-social-links a {
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.08) !important;
        color: rgba(255, 255, 255, 0.8) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.25rem !important;
        transition: all 0.3s ease !important;
        margin: 0 !important;
    }

    .nav-social-links a:hover, .nav-social-links a:active {
        background: rgba(255, 255, 255, 0.15) !important;
        color: var(--accent) !important;
        transform: translateY(-2px);
    }

    /* Botones y Horarios centrado vertical */
    .nav-btns {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1.2rem !important;
        width: 100% !important;
        margin-top: 0.5rem !important;
    }

    .nav-btns .btn-glass {
        width: 100% !important;
        max-width: 260px !important;
        padding: 0.8rem 1.5rem !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        color: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    }

    .nav-btns > div {
        border-left: none !important;
        padding-left: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .nav-btns > div span {
        color: rgba(255, 255, 255, 0.5) !important;
        text-align: center !important;
    }

    .nav-btns > div span:last-child {
        color: var(--accent) !important;
        font-size: 0.85rem !important;
        font-weight: 800 !important;
    }

    /* Hero Mobile */
    .hero {
        padding: 120px 1.5rem 60px !important;
        min-height: auto;
        text-align: center;
    }

    .hero .hero-layout-split {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero h1 {
        font-size: 2.8rem !important;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.6rem !important;
    }

    .hero-desc {
        font-size: 1rem !important;
        margin: 0 auto 2rem !important;
    }

    .hero-stats-grid {
        grid-template-columns: 1fr 1fr;
        padding: 1rem;
    }

    .hero-stat-card .stat-number {
        font-size: 1.8rem !important;
    }

    /* Convergence Orbits Mobile (Simplified) */
    .convergence-container {
        display: none !important;
    }

    /* Grids General */
    [style*="display: grid"],
    .institution-grid,
    .courses-grid,
    .catalog-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .catalog-layout {
        padding: 1rem !important;
    }

    .sidebar {
        margin-bottom: 2rem;
    }

    /* Buscador Mobile */
    .search-overlay h2 {
        font-size: 1.8rem !important;
    }

    .search-container {
        width: 90% !important;
        flex-direction: column;
    }

    .search-container button {
        width: 100%;
        margin-top: 10px;
    }

    /* Secciones */
    section {
        padding: 60px 0 !important;
    }

    .section-header h2 {
        font-size: 2.2rem !important;
    }

    .cta-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem !important;
    }

    .cta-group a {
        width: 100%;
        justify-content: center;
    }

    .federal-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .federal-content h2 {
        font-size: 2.5rem !important;
    }

    .course-card-footer {
        flex-direction: column;
    }

    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2.5rem !important;
    }

    /* Soporte para Tema Claro en Mobile */
    [data-theme="light"] .nav-toggle {
        background: rgba(18, 2, 129, 0.05);
        border: 1px solid rgba(18, 2, 129, 0.15);
    }
    [data-theme="light"] .nav-toggle:hover, [data-theme="light"] .nav-toggle:active {
        background: rgba(18, 2, 129, 0.12);
    }
    [data-theme="light"] .nav-toggle span {
        background: #120281;
    }

    [data-theme="light"] .nav-menu-container {
        background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
        border-left: 1px solid rgba(18, 2, 129, 0.08) !important;
        box-shadow: -15px 0 45px rgba(18, 2, 129, 0.06) !important;
    }
    [data-theme="light"] .nav-links li a {
        color: #1e293b !important;
        border-bottom: 1px solid rgba(18, 2, 129, 0.06) !important;
    }
    [data-theme="light"] .nav-links li a:hover, [data-theme="light"] .nav-links li a:active {
        color: #120281 !important;
    }
    [data-theme="light"] .nav-social-links a {
        background: rgba(18, 2, 129, 0.05) !important;
        color: #120281 !important;
    }
    [data-theme="light"] .nav-social-links a:hover, [data-theme="light"] .nav-social-links a:active {
        background: rgba(18, 2, 129, 0.1) !important;
        color: #120281 !important;
    }
    [data-theme="light"] .nav-btns .btn-glass {
        background: #120281 !important;
        border: 1px solid #120281 !important;
        color: #ffffff !important;
        box-shadow: 0 4px 15px rgba(18, 2, 129, 0.2) !important;
    }
    [data-theme="light"] .nav-btns .btn-glass:hover, [data-theme="light"] .nav-btns .btn-glass:active {
        background: #1a06b0 !important;
        border-color: #1a06b0 !important;
    }
    [data-theme="light"] .nav-btns > div span {
        color: #64748b !important;
    }
    [data-theme="light"] .nav-btns > div span:last-child {
        color: #120281 !important;
    }
}

body.menu-open {
    overflow: hidden !important;
}

/* Transición mejorada para todos los elementos */
*,
*::before,
*::after {
    transition: background-color 0.4s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.4s ease !important;
}