:root {
    --deep-sea: #001226;
    --ucr-blue: #0066B2;
    --tech-gray: #D1D3D4;
    --interface-gray: #58595B;
    --glow-blue: #00d4ff;
    --text-main: #f0f0fa;
}

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

body {
    background-color: var(--deep-sea);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Sci-Fi Grid Background */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 102, 178, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 102, 178, 0.05) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

/* HUD Navigation Extracted */
.main-header {
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 12%;
    background: linear-gradient(to bottom, var(--deep-sea), rgba(0,18,38,0.8));
    border-bottom: 1px solid rgba(0,102,178,0.1);
}

.header-tier-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-logo {
    height: 120px;
    object-fit: contain;
}

.header-tier-2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    border-left: 3px solid var(--ucr-blue);
    padding-left: 15px;
}

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

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 500;
    transition: 0.3s;
    position: relative;
}

.nav-links a:hover {
    color: var(--glow-blue);
    text-shadow: 0 0 10px var(--glow-blue);
}

section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Evita que se centre y deje un hueco enorme arriba en pantallas altas */
    padding: 18.5rem 12% 4rem 12%;
    /* Unified max margin */
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(0, 102, 178, 0.2);
}

#proyectos,
#cursos {
    min-height: auto;
    justify-content: flex-start;
    padding-top: 4rem;
    padding-bottom: 6rem;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -2px;
    line-height: 0.9;
    margin-bottom: 2rem;
}

.hero-title span {
    display: block;
    color: var(--ucr-blue);
    text-shadow: 0 0 30px rgba(0, 102, 178, 0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    color: var(--tech-gray);
    margin-bottom: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: 1px solid var(--ucr-blue);
    color: var(--text-main);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.9rem;
    background: rgba(0, 102, 178, 0.1);
    backdrop-filter: blur(10px);
    transition: 0.4s;
    width: fit-content;
}

.cta-button:hover {
    background: var(--ucr-blue);
    box-shadow: 0 0 20px var(--ucr-blue);
}

.lang-button {
    width: 100%;
    padding: 1rem 0;
    text-align: center;
    font-size: 0.8rem;
    letter-spacing: 3px;
}

.hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1500px;
    /* Evita que en monitores muy grandes se separen indefinidamente */
    margin: 0 auto;
    gap: 4rem;
}

.hero-text {
    flex: 1;
    max-width: 55%;
}

.hero-languages {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Bento Cards (Imagen degradada y bordes circulares) */
.bento-card {
    position: relative;
    background: rgba(15, 20, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.5rem;
    /* Bordes redondeados */
    padding: 2rem 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.4s ease;
    backdrop-filter: blur(12px);
    text-align: center;
}

.bento-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.6;
    z-index: -1;
    transition: all 0.5s ease;
}

.bento-card:hover::before {
    opacity: 0.9;
    width: 160px;
    height: 160px;
}

/* Degradados: Colores de Banderas */
.bento-card.ingles::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(179, 25, 66, 0.8) 40%, rgba(10, 49, 97, 0.8) 100%);
}

.bento-card.frances::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(0, 85, 164, 0.8) 40%, rgba(239, 65, 53, 0.8) 100%);
}

.bento-card.portugues::before {
    background: radial-gradient(circle, rgba(0, 39, 118, 0.8) 0%, rgba(255, 223, 0, 0.8) 40%, rgba(0, 156, 59, 0.8) 100%);
}

.bento-card.japones::before {
    background: radial-gradient(circle, rgba(188, 0, 45, 0.9) 0%, rgba(255, 255, 255, 0.4) 60%, transparent 100%);
}

.bento-card.italiano::before {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(0, 146, 70, 0.8) 40%, rgba(206, 43, 55, 0.8) 100%);
}

.bento-card.aleman::before {
    background: radial-gradient(circle, rgba(255, 206, 0, 0.8) 0%, rgba(221, 0, 0, 0.8) 40%, rgba(0, 0, 0, 0.8) 100%);
}

/* Degradado por defecto para otros nodos */
.bento-card.interno::before {
    background: radial-gradient(circle, rgba(0, 102, 178, 0.8) 0%, rgba(0, 212, 255, 0.6) 100%);
}

.bento-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.bento-subtitle {
    font-size: 0.7rem;
    color: var(--tech-gray);
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.8;
    margin-top: 0.5rem;
    z-index: 10;
}

/* Data HUD Overlay */
.hud-data {
    align-self: flex-end;
    margin-top: 3rem; /* Espaciado controlado justo despues de hero-languages */
    text-align: right;
    font-family: monospace;
    color: var(--interface-gray);
    font-size: 0.7rem;
    line-height: 2;
}

/* Projects Section */
.section-tag {
    color: var(--ucr-blue);
    font-size: 0.8rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    display: block;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
}

.project-card {
    align-items: flex-start;
    text-align: left;
    padding: 2.5rem;
}

.project-card .bento-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Animations */
@keyframes scan {
    0% {
        top: -10%;
    }

    100% {
        top: 110%;
    }
}

.scanner-line {
    position: fixed;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ucr-blue), transparent);
    z-index: 0;
    opacity: 0.3;
    animation: scan 8s linear infinite;
    pointer-events: none;
}

@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 3rem;
    }

    .hero-text {
        max-width: 100%;
    }

    .hero-languages {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* Ajustes generales de espacio en pantalla chica */
    section {
        padding: 13rem 5% 4rem 5%;
    }

    /* Ajustes de Nav Extraidos */
    .main-header {
        padding: 1rem 5%;
    }
    .header-tier-1 {
        margin-bottom: 1rem;
    }
    .header-logo {
        height: 60px; /* Reducir mitad de tamaño los escudos UCR/ELM */
    }
    .header-tier-2 {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    /* Mostrar menú en envoltura vertical centrada */
    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-links a {
        font-size: 0.7rem;
        padding: 6px 12px;
        background: rgba(0, 102, 178, 0.2);
        border: 1px solid rgba(0, 102, 178, 0.4);
        border-radius: 4px;
        box-shadow: 0 0 5px rgba(0,0,0,0.3);
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .hero-languages {
        grid-template-columns: 1fr;
    }
    
    .hud-data {
        margin-top: 2rem;
        font-size: 0.6rem;
    }
}