/* --- ESTILOS GENERALES Y RESETS --- */
:root {
    --primary-red: #c62828; 
    --text-color: #333;
    --white: #fff;
    --bg-color: #fcfcfc; 
    --font-family: 'Montserrat', sans-serif;
    
    /* Configuración del carrusel */
    --slide-width: 800px;      /* Ancho del slide central */
    --slide-height: 500px;
    --side-scale: 0.85;
    --side-opacity: 0.6;
    --side-filter: grayscale(100%) brightness(0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- NAV BAR - FIJA --- */
.header {
    background-color: var(--primary-red);
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
}

.brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--white);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: rgba(255,255,255,0.8);
}

/* --- SECCIÓN INTRO --- */
.intro-section {
    padding-top: 150px;
    padding-bottom: 60px;
}

.intro-profile-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 50px;
}

.profile-pic-container {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

.profile-pic {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 6px solid var(--primary-red);
    display: block;
}

.intro-text-box {
    background-color: var(--primary-red);
    color: var(--white);
    flex-grow: 1;
    z-index: 1;
    margin-left: -125px;
    padding: 40px 40px 40px 165px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
}

.intro-greeting {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.intro-sub {
    font-size: 1.2rem;
    font-weight: 400;
}

.highlight {
    position: relative;
    display: inline-block;
    font-size: 2.8rem;
    font-weight: 700;
}

/* --- TEXTO BIOGRAFÍA --- */
.biography-text {
    color: #555;
    max-width: 900px;
    margin-left: 50px;
    margin-top: 20px;
    font-size: 1.05rem;
}

.biography-text p {
    margin-bottom: 20px;
}

.red-underline {
    color: var(--primary-red);
    border-bottom: 2px solid var(--primary-red);
    font-weight: 600;
    padding-bottom: 1px;
}

/* --- CARRUSEL CON OREJAS LATERALES --- */
.carousel-section {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.carousel-viewport {
    width: 100%;
    max-width: var(--slide-width);
    height: var(--slide-height);
    margin: 0 auto;
    position: relative;
    overflow: visible;  /* Clave para ver los slides laterales */
}

.carousel-container {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    will-change: transform;
}



/* Slide central activo */
.carousel-slide.active {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    transform: scale(1);
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    width: 100%;
    padding: 20px;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
    pointer-events: none;
}
.carousel-slide {
    flex: 0 0 var(--slide-width);
    width: var(--slide-width);
    height: 100%;
    position: relative; /* Necesario para posicionar el overlay dentro */
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #2a2a2a;
    
    /* Asegura que el overlay respete los bordes y el texto flote encima */
    overflow: hidden; 
    z-index: 1;

    /* Tus transiciones profesionales (sin cambios aquí) */
    transition: filter 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                style 0s; /* style 0s es para la corrección del tirón en JS */
    will-change: transform, filter, opacity;
    backface-visibility: hidden;
    
    /* Estado por defecto (slides laterales) */
    filter: var(--side-filter);
    opacity: var(--side-opacity);
    transform: scale(var(--side-scale));
}
/* --- OVERLAY NEGRO PARA LEGIBILIDAD (NUEVO) --- */
.carousel-slide::before {
    content: ''; /* Necesario para que exista el pseudoelemento */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* Color negro. Ajusta el 0.4 (40% de opacidad) a tu gusto */
    background-color: rgba(0, 0, 0, 0.6); 
    
    /* Importante: el overlay debe estar ENTRE la imagen de fondo y el texto */
    z-index: 1; 
    
    /* Por defecto (en los laterales), el overlay es casi invisible */
    opacity: 0.2; 
}
/* Slide central activo */
/* Slide central activo */
.carousel-slide.active {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    transform: scale(1);
    z-index: 2; /* Sube el slide entero */
    box-shadow: 0 15px 40px rgba(0,0,0,0.4);
}

/* CUANDO ESTÁ ACTIVO: El overlay se oscurece (NUEVO) */
.carousel-slide.active::before {
    opacity: 1; /* Sube a la opacidad definida en rgba(0,0,0,0.4) */
}

/* ASEGURAR QUE EL TEXTO ESTÉ ARRIBA (ACTUALIZADO) */
.slide-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    width: 100%;
    padding: 20px;
    
    /* Mantenemos el shadow por seguridad, pero el overlay hará el trabajo duro */
    text-shadow: 0 2px 15px rgba(0,0,0,0.5); 
    pointer-events: none;
    
    /* ESTO ES CLAVE: Sube el texto por encima del overlay ::before */
    z-index: 2; 
}

/* Animación del texto */
.slide-content h1 {
    font-size: 3rem;
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(30px); /* Un poco más de recorrido */
    filter: blur(8px); /* Blur un poco más dramático al entrar */
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                filter 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform, opacity, filter;
}

.carousel-slide.active .slide-content h1 {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    /* Retrasamos el texto ligeramente para que aparezca justo cuando el slide llega al centro */
    transition-delay: 0.15s; 
}


.carousel-slide.active .slide-content h1 {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Navegación */
.carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 calc((100% - var(--slide-width)) / 2 + 20px);
    z-index: 100;
    pointer-events: none;
}

.prev-btn, .next-btn {
    pointer-events: auto;
    background: rgba(255,255,255,0.9);
    color: var(--primary-red);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.prev-btn:hover, .next-btn:hover {
    background: var(--primary-red);
    color: white;
    transform: scale(1.1);
}

/* --- HABILIDADES Y PROGRAMAS --- */
.habilidades-section, .programas-section {
    padding: 80px 0;
    text-align: center;
}

.section-title-btn {
    background-color: var(--primary-red);
    color: var(--white);
    border: none;
    padding: 15px 50px;
    font-family: var(--font-family);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 60px;
    cursor: default;
}

.habilidades-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    text-align: left;
    max-width: 1000px;
    margin: 0 auto;
}

.habilidad-col p {
    color: #777;
    margin-bottom: 8px;
}

.habilidad-col p:first-child {
    color: var(--text-color);
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.programas-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 50px;
    max-width: 1000px;
    margin: 0 auto;
}

.programa-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.programa-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.programa-item:hover img {
    transform: translateY(-10px);
}

.programa-item span {
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- SUBRAYADO ANIMADO (SVG) --- */
.scribble-svg {
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 105%;
    height: 25px;
    z-index: 1;
    pointer-events: none;
}

.scribble-svg path {
    fill: none;
    stroke: var(--white);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawScribble 1.5s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes drawScribble {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    :root {
        --slide-width: 90vw;
        --slide-height: 60vw;
    }
    
    .intro-profile-wrapper { 
        flex-direction: column; 
    }
    .intro-text-box { 
        margin-left: 0; 
        padding: 40px; 
        text-align: center; 
        margin-top: -50px; 
    }
    .habilidades-grid, .programas-grid { 
        grid-template-columns: 1fr; 
    }
    
    .carousel-nav {
        padding: 0 5%;
    }
}
/* ... (resto del CSS igual) ... */

.icon-box {
    background-color: var(--primary-red);
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px; /* Padding para que el logo respire */
}

/* Ajuste específico para el logo de Behance */
.icon-box.behance-box svg {
    /* La proporción de Behance es más ancha que alta */
    width: 100%;
    height: auto; /* Mantiene proporción */
    max-width: 110px; /* Ancho máximo para que se vea similar a la referencia */
    max-height: 80px;  /* Alto máximo de seguridad */
    object-fit: contain; /* Centra y ajusta dentro del contenedor */
    display: block;
}

/* Asegurar que el SVG se vea nítido */
.icon-box svg path {
    vector-effect: non-scaling-stroke;
}
/* ===== BOTONES FLOTANTES DE CONTACTO ===== */

.contacto-flotante {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 12px;
    font-family: 'Montserrat', sans-serif;
}

.contacto-item {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
}

.contacto-boton {
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border: none;
    border-radius: 50%;
    background: #D92332;
    color: white;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px #0003;
    transition: transform .25s, background .25s;
}

.contacto-boton svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.contacto-boton::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -7px;
    border-radius: 50%;
    background: #D9233266;
    animation: contacto-destello 1.8s ease-out infinite;
    pointer-events: none;
}

.contacto-boton::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -7px;
    border: 2px solid #D9233299;
    border-radius: 50%;
    animation: contacto-onda 1.8s ease-out infinite .6s;
    pointer-events: none;
}

@keyframes contacto-destello {
    0%, 100% {
        opacity: .25;
        transform: scale(.92);
    }
    50% {
        opacity: .85;
        transform: scale(1.12);
    }
}

@keyframes contacto-onda {
    0% {
        opacity: .8;
        transform: scale(.85);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

.contacto-boton:hover {
    background: #B91828;
    transform: scale(1.08);
}

.contacto-panel {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 0;
    max-width: calc(100vw - 120px);
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    background: white;
    color: #222;
    border-radius: 12px;
    box-shadow: 0 4px 20px #0002;
    transition: width .3s, padding .3s, opacity .2s,
                transform .3s, visibility .3s;
}

.contacto-item:hover .contacto-panel,
.contacto-item:focus-within .contacto-panel {
    width: 220px;
    padding: 12px 16px;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.contacto-panel-titulo {
    font-size: 12px;
    font-weight: 700;
    color: #D92332;
}

.contacto-panel-dato {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contacto-panel-ayuda {
    font-size: 10px;
    color: #777;
}

@media (max-width: 480px) {
    .contacto-flotante {
        right: 16px;
        bottom: 16px;
        gap: 10px;
    }

    .contacto-boton {
        width: 50px;
        height: 50px;
        flex-basis: 50px;
    }

    .contacto-boton svg {
        width: 24px;
        height: 24px;
    }

    .contacto-item:hover .contacto-panel,
    .contacto-item:focus-within .contacto-panel {
        width: min(190px, calc(100vw - 110px));
        padding: 10px 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contacto-boton::before,
    .contacto-boton::after {
        animation: none;
    }

    .contacto-boton,
    .contacto-panel {
        transition: none;
    }
}