/* ==================== VARIABLES CSS ==================== */
:root {
    --primary-dark: #000000;
    --secondary-light: #f5f5f5; /* Gris muy claro */
    --accent-red: #ff4500; /* Naranja rojizo */
    --title-font: 'Oswald', sans-serif; /* Alternativa a Extenda 30 Deca */
    --body-font: 'Lato', sans-serif; /* Alternativa a Aileron */
}

/* ==================== RESET BÁSICO ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

strong {
    font-weight: bold !important;
}

.body-font strong {
    font-weight: 700;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--secondary-light);
    color: var(--primary-dark);
    font-family: var(--body-font);
    overflow-x: hidden;
}

/* ==================== TIPOGRAFÍA ==================== */
.title-font {
    font-family: var(--title-font);
    font-size: 7vw;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.1em;
    margin: 0;
    padding: 0;
    display: block;
}

.subtitle-font {
    font-family: var(--title-font);
    font-size: 2.5vw;
    font-weight: 700;
    margin-bottom: 20px;
}

.body-font {
    font-family: var(--body-font);
    font-size: 1.1rem;
    line-height: 1.6;
}

.white-text {
    color: var(--secondary-light);
}

.centered {
    text-align: center;
}

/* ==================== ESTRUCTURA DE SECCIONES ==================== */
.section-container {
    padding: 80px 5%;
    min-height: auto;
    overflow: hidden;
}

.full-screen {
    min-height: 100vh;
}

.half-screen {
    min-height: 50vh;
}

.dark-bg {
    background-color: var(--primary-dark);
    color: var(--secondary-light);
}

.light-bg {
    background-color: var(--secondary-light);
    color: var(--primary-dark);
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== CABECERA (SECCIÓN 1) ==================== */
header {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    width: 90%;
    height: 60vh;
    position: relative;
    padding: 0;
}

.name-text-container {
    flex-grow: 1;
    line-height: 0.9;
    transform: translateY(-20px);
}

.profile-image-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--secondary-light);
    margin-left: 50px;
    flex-shrink: 0;
}

.profile-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== SOBRE MÍ Y CONTACTO (SECCIÓN 2) ==================== */
.about-flex {
    display: flex;
    gap: 40px;
}

.about-flex p {
    flex: 2;
}

.contact-box {
    flex: 1;
    background-color: var(--primary-dark);
    color: var(--secondary-light);
    padding: 20px;
    border-radius: 5px;
}

/* ==================== HABILIDADES (SECCIÓN 3) ==================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.skill-item {
    text-align: center;
}

.skill-icon {
    font-size: 4rem;
    margin-bottom: 10px;
    color: var(--accent-red);
}

.progress-bar-bg {
    height: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-red);
    transition: width 1s ease-out;
}

/* ==================== PORTAFOLIO 3D (SECCIÓN 4) ==================== */
#portfolio-3d {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sketchfab-embed-wrapper {
    width: 100%;
    max-width: 800px;
    height: 500px;
    margin-top: 40px;
}

.sketchfab-embed-wrapper iframe {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* ==================== DISEÑO DE PERSONAJES (SECCIÓN 5) ==================== */

.character-gallery {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 80px;
    margin-top: 50px;
    margin-bottom: 80px;
}

/* Círculos más grandes */
.character-item {
    position: relative;
    width: 330px;
    aspect-ratio: 1 / 1;
    border: 5px solid #ff3c00;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(255, 60, 0, 0.4);
    background: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.character-item:hover {
    transform: scale(1.06);
    box-shadow: 0 0 40px rgba(255, 60, 0, 0.7);
}

/* Fondo circular personalizado */
.character-bg {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 1;
}

/* Imagen del personaje */
.character-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
    padding: 8%;
}

/* Enlace y texto */
.character-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
    color: #fff;
}

/* Texto del nombre dentro del círculo */
.character-name {
    position: relative;
    z-index: 3;
    background: rgba(0, 0, 0, 0.55);
    width: 100%;
    text-align: center;
    padding: 10px 0;
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

/* Responsivo */
@media (max-width: 900px) {
    .character-gallery {
        flex-direction: column;
        gap: 50px;
    }

    .character-item {
        width: 75%;
        max-width: 300px;
    }

    .character-name {
        font-size: 1rem;
    }
}

.character-description {
    max-width: 900px;
    margin: 40px auto 0;
    font-size: 1.15rem;
    color: #333;
    line-height: 1.6;
    text-align: center;
    font-weight: 400;
}




/* ==================== PROYECTO DE GRADO (SECCIÓN 6) ==================== */
.plugin-top-row {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    margin-bottom: 40px;
}

.plugin-info-text {
    flex: 1;
    max-width: 460px;
    text-align: left;
    font-size: 3rem;        /* Aumenta tamaño del texto */
    font-weight: 600;          /* Semibold */
    line-height: 1.75;         /* Mejora la legibilidad */
    color: #f1f1f1;            /* Texto claro sobre fondo oscuro */
}

/* Imagen de la interfaz del plugin */
.plugin-img-interface {
    width: 60%;
    max-width: 600px;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Imagen grande de la infografía: centrada debajo del bloque principal */
.plugin-img-infographic-large {
    display: block;
    margin: 40px auto 60px auto; 
    max-width: 90%;
    width: auto;
    height: auto;
    position: relative; /* <-- AÑADIR/ASEGURAR ESTA LÍNEA */
    left: 0;
    transform: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 2; /* <-- AÑADIR ESTA LÍNEA */
}

/* ==================== EXPERIENCIA Y FORMACIÓN (SECCIÓN 7) ==================== */
.columns-container {
    display: flex;
    gap: 50px;
    margin-top: 40px;
}

.column {
    flex: 1;
}

.job-entry, .edu-entry {
    margin-bottom: 25px;
    padding-left: 15px;
    border-left: 3px solid var(--accent-red);
}

.job-entry p:first-child, .edu-entry p:first-child {
    font-weight: 700;
}

/* ==================== PIE DE PÁGINA (SECCIÓN 8) ==================== */
#footer {
    text-align: center;
    padding: 50px 5%;
}

.footer-content {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.qr-code {
    width: 300px;
    height: 200px;
}

/* ==================== ANIMACIONES SCROLL ==================== */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.active {
    opacity: 1;
}

.animate-on-scroll[data-animation="slide-up"] {
    transform: translateY(30px);
}
.animate-on-scroll[data-animation="slide-up"].active {
    transform: translateY(0);
}

.animate-on-scroll[data-animation="slide-right"] {
    transform: translateX(-30px);
}
.animate-on-scroll[data-animation="slide-right"].active {
    transform: translateX(0);
}

.animate-on-scroll[data-animation="slide-left"] {
    transform: translateX(30px);
}
.animate-on-scroll[data-animation="slide-left"].active {
    transform: translateX(0);
}

.animate-on-scroll[data-animation="scale-in"] {
    transform: scale(0.8);
}
.animate-on-scroll[data-animation="scale-in"].active {
    transform: scale(1);
}

.animate-on-scroll[data-animation^="fade-in-delay"] {
    transition: opacity 1.5s ease-out;
}
.animate-on-scroll[data-animation^="fade-in-delay"].active {
    opacity: 1;
}






/* ==================== DECORACIONES Y BACKGROUND CANVAS ==================== */
/* canvas general overlay */
.bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;   /* no interfiere con clicks */
    z-index: 0;             /* detrás del contenido */
}

/* Cada sección debe tener position: relative para contener el canvas */
.section-container { position: relative; }

/* ---------- Flechas animadas (Sección 1) ---------- */
.arrow-down-wrapper {
    /* Estas propiedades son nuevas o modificadas */
    position: relative; /* Ya no es 'absolute' */
    margin: 40px auto 20px auto; /* Centra (auto) y da espacio (40px arriba, 20px abajo) */

    /* Estas propiedades ya las tenías (son del tamaño) */
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    animation: pulse 2s infinite ease-in-out;
    font-size: 30px;
    color: #fff;

    /* Estas propiedades se eliminan (o se anulan con los márgenes) */
    /* bottom: 40px; */
    /* left: 50%; */
    /* transform: translateX(-50%); */
}

.arrow-down {
    width: 30px;
    height: 30px;
    border-left: 10px solid transparent; /* <-- CAMBIAR: p. ej., de 7px a 10px */
    border-right: 10px solid transparent; /* <-- CAMBIAR: p. ej., de 7px a 10px */
    border-top: 10px solid #fff; /* <-- CAMBIAR: p. ej., de 7px a 10px */
    transform: translateY(2px); /* Ajusta si es necesario para centrar visualmente */
    animation: bounce 2s infinite;
}

.arrow-down.multi {
    width: 28px;
    height: 48px;
    position: relative;
}
.arrow-down .arrow-line {
    width: 16px;
    height: 16px;
    border-left: 3px solid var(--accent-red);
    border-bottom: 3px solid var(--accent-red);
    transform: rotate(-45deg);
    position: absolute;
    left: 50%;
    margin-left: -8px;
    opacity: 0.95;
    animation: arrowDownMove 1.2s infinite ease-in-out;
}
.arrow-down .arrow-line.delay { top: 8px; animation-delay: 0.28s; opacity:0.7; }
.arrow-down .arrow-line.delay-long { top: 18px; animation-delay: 0.56s; opacity:0.5; }

/* keyframe para efecto de caída/loop */
@keyframes arrowDownMove {
    0% { transform: translateY(0) rotate(-45deg); opacity: 0.95; }
    50% { transform: translateY(8px) rotate(-45deg); opacity: 0.55; }
    100% { transform: translateY(0) rotate(-45deg); opacity: 0.95; }
}

/* ---------- Flecha en Sección 2 (apunta al recuadro contacto) ---------- */
.arrow-to-contact {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%) rotate(10deg);
    z-index: 6;
    pointer-events: none;
    display: flex;
    align-items: center;
}
.arrow-to-contact .arrow-to-contact-line {
    width: 2px;
    height: 140px;
    background: linear-gradient(#999, transparent);
    transform-origin: top center;
    animation: contactLine 1.6s infinite ease-in-out;
    opacity: 0.7;
}
.arrow-to-contact .arrow-to-contact-head {
    width: 18px; height: 18px;
    border-left: 3px solid var(--accent-red);
    border-bottom: 3px solid var(--accent-red);
    transform: rotate(-45deg);
    margin-left: -9px;
    margin-top: -6px;
    animation: contactHead 1.6s infinite ease-in-out;
}

/* sutil pulso */
@keyframes contactLine {
    0% { transform: translateY(0) scaleY(1); opacity: 0.85; }
    50% { transform: translateY(8px) scaleY(0.98); opacity: 0.45; }
    100% { transform: translateY(0) scaleY(1); opacity: 0.85; }
}
@keyframes contactHead {
    0% { transform: rotate(-45deg) translateY(0); opacity:1; }
    50% { transform: rotate(-45deg) translateY(6px); opacity:0.6; }
    100% { transform: rotate(-45deg) translateY(0); opacity:1; }
}

/* ---------- Section 3 - formas sutiles grises ---------- */
#skills { overflow: visible; }
.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.07;
    box-shadow: 0 0 20px rgba(0,0,0,0.03) inset;
    pointer-events: none;
    z-index: 0;
}

/* ---------- Section 4 y 5 - cubos/pirámides (red / blue) ---------- */
/* Se utilizan los canvas (bg-canvas-4, bg-canvas-5) - estilos para mantenerlos en background */
#portfolio-3d .bg-canvas,
#characters .bg-canvas {
    z-index: 0;
}

/* ---------- Section 6 - canvas para ondas reactivas ---------- */
#thesis-project .bg-canvas {
    z-index: 0;
}

/* ---------- Ajustes para capas de contenido por encima de canvas ---------- */
.header-content, .content-wrapper, .character-gallery, .plugin-top-row {
    position: relative;
    z-index: 3;
}

/* para pantallas pequeñas */
@media (max-width:900px) {
    .arrow-to-contact { display: none; } /* para no invadir layout móvil */
    .arrow-down-wrapper { margin-top: 20px; }
}


/* ==================== MEDIA QUERIES ==================== */
@media (max-width: 900px) {
    .title-font {
        font-size: 12vw;
    }
    .subtitle-font {
        font-size: 4vw;
    }
    .about-flex,
    .columns-container,
    .plugin-top-row {
        flex-direction: column;
        gap: 20px;
    }
    .header-content {
        height: auto;
        padding-right: 0;
        text-align: center;
    }
    .profile-image-container {
        margin: 20px auto 0;
        width: 150px;
        height: 150px;
    }
    .character-gallery {
        flex-direction: column;
        align-items: center;
    }
    .character-item {
        width: 80%;
        max-width: 250px;
    }
    .character-link {
        padding-top: 100%;
    }
    .character-img {
        padding: 10% 5% 5% 5%;
    }
    .plugin-top-row {
        flex-direction: column;
    }
    .plugin-img-interface,
    .plugin-info-text {
        width: 100%;
        max-width: none;
        text-align: center;
    }
    .plugin-img-infographic-large {
        width: 100%;
        left: 0;
        transform: none;
    }
    .sketchfab-embed-wrapper {
        height: 300px;
    }
}



/* 3. Ajustamos el canvas para que se superponga exactamente a la imagen */
#thesis-project #bg-canvas-6 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* <-- CAMBIAR DE 5 a 1 */
    pointer-events: none;
}