:root {
  /* ... Colores ... */
  --bg-principal: #0f172a;
  --bg-tarjetas: #1e293b;
  --texto-principal: #f8fafc;
  --texto-secundario: #94a3b8;
  --acento-dev: #38bdf8;
  --acento-docente: #10b981;

  /* Tipografías */
  --fuente-titulos: 'Montserrat', sans-serif;
  --fuente-cuerpo: 'Roboto', sans-serif;
}

html {
    scroll-behavior: smooth;
}

/* Aplicación global básica */
body {
  background-color: var(--bg-principal);
  color: var(--texto-principal);
  font-family: var(--fuente-cuerpo);
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--fuente-titulos);
  font-weight: 800;
  color: var(--texto-principal);
}

.section-proyectos,
.section-docencia,
.section-competencias {
    scroll-margin-top: 8rem;
}

/* MENÚ */
.floating-nav {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
    background-color: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    padding: 0.6rem 0.8rem;
    border-radius: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    width: calc(100% - 4rem);
    max-width: 650px;
    box-sizing: border-box;
}

.desktop-menu-links {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-evenly;
    gap: 0.5rem;
}

.floating-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--texto-secundario);
    transition: background-color 0.2s ease, color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.floating-link:hover {
    color: var(--texto-principal);
    background-color: rgba(255, 255, 255, 0.05);
}

.btn-hamburguesa,
.mobile-menu-panel {
    display: none;
}


/* --- ESTILOS DEL HERO --- */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 2rem 2rem;
    text-align: center;
    box-sizing: border-box;
}

.hero-container {
    max-width: 1000px;
    margin: 0 auto;
}

.hero-tagline {
    font-size: 1.1rem;
    color: var(--texto-secundario);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.hero-title {
    font-size: clamp(1.8rem, 4.8vw, 3.8rem);
    line-height: 1.4;
    margin-bottom: 2rem;
}

.hero-block {
    display: inline-block;
    white-space: nowrap;
}

.hero-amp {
    color: var(--texto-secundario);
    font-weight: 400;
    margin: 0 0.5rem;
}

.text-dev {
    color: var(--acento-dev);
}

.text-docente {
    color: var(--acento-docente);
}

.hero-description {
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--texto-secundario);
    max-width: 680px;
    margin: 0 auto 3rem auto;
}

/* --- BOTONES --- */
.hero-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    font-family: var(--fuente-titulos);
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-3px);
}

/* Botón Desarrollador */
.btn-dev {
    background-color: transparent;
    color: var(--acento-dev);
    border: 2px solid var(--acento-dev);
}

.btn-dev:hover {
    background-color: var(--acento-dev);
    color: var(--bg-principal);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2);
}

/* Botón Docente */
.btn-docente {
    background-color: transparent;
    color: var(--acento-docente);
    border: 2px solid var(--acento-docente);
}

.btn-docente:hover {
    background-color: var(--acento-docente);
    color: var(--bg-principal);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}


/* SECCIÓN DE PROYECTOS */
.section-proyectos {
    padding: 6rem 2rem;
    background-color: var(--bg-principal);
    width: 100%;
    box-sizing: border-box;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--texto-secundario);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    width: 100%;
    margin-top: 4rem;
}


.project-card {
    background-color: var(--bg-tarjetas);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--acento-dev);
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.project-badge {
    display: inline-block;
    font-family: var(--fuente-cuerpo);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--acento-dev);
    margin-bottom: 1rem;
}

.project-title {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 0.8rem;
}

.project-description {
    color: var(--texto-secundario);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
    flex-grow: 1;
}

.project-link {
    color: var(--acento-dev);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    margin-top: auto;
}

.project-link:hover {
    color: var(--texto-principal);
}

/* SECCIÓN DOCENCIA */
.section-docencia {
    padding: 6rem 2rem;
    background-color: var(--bg-tarjetas);
    width: 100%;
    box-sizing: border-box;
}

.docencia-container-stacked {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3.5rem; /* Separación limpia entre los textos y las tarjetas de abajo */
}

.docencia-header-block {
    width: 100%;
}

.docencia-text {
    color: var(--texto-secundario);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 950px; /* Evita líneas infinitas para mejorar la lectura en pantallas gigantes */
}

.docencia-text:last-child {
    margin-bottom: 0;
}

/* Fila de tarjetas: Dos columnas perfectas en escritorio */
.docencia-pillars-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}

.pillar-card {
    background-color: var(--bg-principal);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 2rem;
    transition: border-color 0.3s ease;
}

.pillar-card:hover {
    border-color: var(--acento-docente);
}


.section-competencias {
    padding: 8rem 2rem;
    background-color: var(--bg-principal);
    width: 100%;
    box-sizing: border-box;
}

.grid-competencias {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.section-title-left {
    font-size: 2.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

/* SECCIÓN COMPETENCIAS */
.section-competencias {
    padding: 8rem 2rem;
    background-color: var(--bg-principal);
    width: 100%;
    box-sizing: border-box;
}

.grid-competencias {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.section-title-left {
    font-size: 2.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.competencias-intro {
    color: var(--texto-secundario);
    font-size: 1.1rem;
    margin-bottom: 3.5rem;
    line-height: 1.6;
}

.skills-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    width: 100%;
}

.skills-category h3 {
    font-size: 1.3rem;
    color: var(--acento-dev);
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.skills-list li {
    color: var(--texto-principal);
    font-size: 1.05rem;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
}

.skills-list li::before {
    content: "•";
    color: var(--acento-dev);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -0.5em;
}


/* --- FOOTER --- */
.site-footer {
    padding: 3rem 2rem;
    background-color: #0b0f19;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.footer-copy {
    color: var(--texto-secundario);
    font-size: 0.9rem;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--texto-secundario);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--acento-dev);
}

.site-footer {
    padding-bottom: 3rem;
}

/* CONTACTO */
.section-contacto {
    padding: 8rem 2rem;
    background-color: var(--bg-tarjetas);
    width: 100%;
    box-sizing: border-box;
}

.container-contacto {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.contacto-intro {
    color: var(--texto-secundario);
    font-size: 1.1rem;
    margin-bottom: 3.5rem;
    line-height: 1.6;
}

.form-contacto {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.form-label {
    color: var(--texto-principal);
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--bg-principal);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 0.9rem 1.2rem;
    color: var(--texto-principal);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea {
    height: 150px;
    min-height: 150px;
    max-height: 250px;
    resize: none;
}

.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://w3.org' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='rgba(148,163,184,0.8)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2rem;
    padding-right: 3rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--acento-dev);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-privacy {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    width: 100%;
    margin-top: 0.5rem;
}

.form-checkbox {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--acento-dev);
}

.form-privacy-label {
    color: var(--texto-secundario);
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
}

.btn-submit {
    display: inline-block;
    width: 100%;
    padding: 1rem 2rem;
    font-family: var(--fuente-titulos);
    font-weight: 700;
    font-size: 1rem;
    color: var(--bg-principal);
    background-color: var(--acento-dev);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.3);
}

.legal-info-block {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1.5rem;
    margin-top: 1rem;
}

.legal-info-block p {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.6;
    margin: 0;
}

.legal-info-block strong {
    color: var(--texto-secundario);
}

/* ANIMACIONES */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: opacity, transform;
}

.reveal-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card,
.pillar-card {
    transition: transform 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--acento-dev);
    box-shadow: 0 12px 30px rgba(56, 189, 248, 0.15);
}

.pillar-card:hover {
    transform: translateY(-6px);
    border-color: var(--acento-docente);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.15);
}

/* ===============================
   MENSAJES FORMULARIO DE CONTACTO
   ============================ */

.errores{
    background-color: #b58726;
}

.errores, .exito{
    padding: 0 15px;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.errores p, .exito p{
    margin: 0;
}

.exito{
    background-color: #5a835e;
}

/* ===============================
   MEDIA QUERIES TABLETS Y MÓVILES
   ============================ */
@media (max-width: 980px) {
    .hero {
        min-height: auto;
        padding: 6rem 1.5rem 4rem 1.5rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 4.5vw, 2.8rem);
        line-height: 1.3;
    }

    .hero-block {
        display: inline;
        white-space: normal;
    }

    .hero-amp {
        display: block;
        margin: 0.3rem 0;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-actions {
        width: 100%;
        flex-direction: row;
        gap: 1.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .btn {
        width: auto;
        min-width: 200px;
        box-sizing: border-box;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
        text-align: center;
    }

    .cv-downloads-container {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .btn-cv-download {
        flex: 1;
        min-width: 200px;
    }

    .section-proyectos,
    .section-docencia,
    .section-competencias,
    .section-contacto {
        padding: 5rem 1.5rem;
    }

    .grid-docencia {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .docencia-pillars-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .pillar-card {
        padding: 1.5rem;
    }

    .grid-competencias {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .skills-groups {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .cv-card {
        padding: 2.5rem 1.5rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .site-footer {
        padding-bottom: 4rem;
    }

    /* MENÚ */

    .floating-nav {
        position: static;
        width: auto;
        max-width: none;
        transform: none;
        padding: 0;
        background: none;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .desktop-menu-links {
        display: none;
    }

    body.menu-open {
        overflow: hidden;
    }

    .btn-hamburguesa {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        position: fixed;
        bottom: 2rem;
        right: 2rem;
        width: 50px;
        height: 50px;
        background-color: var(--acento-dev);
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
        cursor: pointer;
        z-index: 1100;
        box-sizing: border-box;
        transition: transform 0.3s ease, background-color 0.3s ease;
    }

    .btn-hamburguesa:hover {
        transform: scale(1.05);
    }

    .btn-hamburguesa .line {
        display: block;
        width: 20px;
        height: 2px;
        background-color: var(--bg-principal);
        transition: transform 0.3s ease, opacity 0.3s ease;
        margin: 3px 0;
    }

    .btn-hamburguesa.is-active {
        background-color: #ef4444;
    }

    .btn-hamburguesa.is-active .line {
        margin: 0;
    }

    .btn-hamburguesa.is-active .line:nth-child(1) {
        transform: rotate(45deg) translate(1.5px, 1.5px);
    }

    .btn-hamburguesa.is-active .line:nth-child(2) {
        opacity: 0;
    }

    .btn-hamburguesa.is-active .line:nth-child(3) {
        transform: rotate(-45deg) translate(1.5px, -1.5px);
    }

    .mobile-menu-panel {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(15, 23, 42, 0.8);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        z-index: 1050;
        transform: translateY(100%);
        transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .mobile-menu-panel.is-active {
        transform: translateY(0);
    }

    .mobile-link {
        font-family: var(--fuente-titulos);
        font-weight: 700;
        font-size: 1.5rem;
        color: var(--texto-secundario);
        text-decoration: none;
        text-transform: uppercase;
        letter-spacing: 1px;
        transition: color 0.2s ease;
    }

    .mobile-link:hover {
        color: var(--texto-principal);
    }

}


