/* --- VARIABLES Y RESET --- */
:root {
    --color-fondo: #f5f5f7;
    --color-texto-oscuro: #1d1d1f;
    --color-texto-claro: #ffffff;
    --color-bento-light: #ffffff;
    --color-bento-dark: #000000;
    --nav-height: 44px;
}

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

html {
    scroll-behavior: smooth; /* Para que el menú baje suavemente */
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-fondo);
    color: var(--color-texto-oscuro);
    -webkit-font-smoothing: antialiased;
    
    /* --- MAGIA: TRANSICIÓN BASE --- */
    opacity: 0; 
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clases que el JS activará */
body.page-fade-in { opacity: 1; }
body.page-fade-out { opacity: 0; }

/* --- BARRA DE NAVEGACIÓN (APPLE STYLE) --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: rgba(251, 251, 253, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    transition: background 0.4s ease, backdrop-filter 0.4s ease, border-bottom 0.4s ease;
}

.nav-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 20px;
}

.nav-logo {
    font-weight: 600;
    text-decoration: none;
    color: var(--color-texto-oscuro);
    font-size: 14px;
    letter-spacing: -0.02em;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #424245;
    font-size: 12px;
    transition: color 0.3s ease;
}

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

/* --- REGLAS MÁGICAS SOLO PARA LA PORTADA (INDEX) --- */
body.is-home .navbar {
    background: rgba(251, 251, 253, 0);
    backdrop-filter: blur(0px); 
    -webkit-backdrop-filter: blur(0px);
    border-bottom: 1px solid rgba(0,0,0,0);
}
body.is-home .nav-logo { 
    opacity: 0; 
    transform: translateY(5px); 
}

body.is-home.scrolled .navbar {
    background: rgba(251, 251, 253, 0.8);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
body.is-home.scrolled .nav-logo { 
    opacity: 1; 
    transform: translateY(0); 
}

/* --- HERO (CABECERA) --- */
.hero {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: white;
    padding-top: var(--nav-height); 
    overflow: hidden;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    letter-spacing: -0.05em;
    transform-origin: center center;
    will-change: transform, opacity;
}

.hero-tagline {
    font-size: 1.5rem;
    color: #86868b;
    margin-top: 1rem;
    will-change: transform, opacity;
}

/* --- PROYECTOS FULL-WIDTH (Borde a Borde) --- */
#contenedor-proyectos {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.project-full {
    width: 100%;
    height: 75vh; 
    position: relative;
    display: flex;
    align-items: center; 
    padding: 0 10%; 
    text-decoration: none;
    overflow: hidden;
}

.project-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.project-full:hover .project-bg {
    transform: scale(1.04); 
}

.project-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2;
}
.dark .project-overlay { background: linear-gradient(to right, rgba(0,0,0,0.85) 0%, transparent 60%); }
.light .project-overlay { background: linear-gradient(to right, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.2) 60%); }

.project-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    transition: transform 0.4s ease;
}

.project-full:hover .project-content {
    transform: translateX(10px); 
}

.dark .project-content { color: white; }
.light .project-content { color: #1d1d1f; }

.project-content h2 { 
    font-size: clamp(3rem, 7vw, 6rem); 
    font-weight: 700; 
    letter-spacing: -0.04em; 
    line-height: 1; 
    margin-bottom: 15px;
}
.project-content p { 
    font-size: 1rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    opacity: 0.8; 
}

/* --- SECCIONES ESTÁNDAR (Sobre mí y Contacto) --- */
.section-standard {
    padding: 100px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
}

.sobre-mi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

@media (min-width: 768px) {
    .sobre-mi-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.sobre-mi-text p {
    font-size: 1.4rem;
    line-height: 1.6;
    color: #424245;
    margin-bottom: 1.5rem;
}

.sobre-mi-image {
    background-color: #e5e5ea;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.sobre-mi-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contacto */
.contacto-content {
    text-align: center;
    padding: 60px 0;
}

.contacto-email {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 3rem;
    color: var(--color-texto-oscuro);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.social-links a {
    text-decoration: none;
    color: #0071e3;
    font-weight: 600;
    font-size: 1.1rem;
}

.footer-simple {
    text-align: center;
    padding: 40px;
    font-size: 12px;
    color: #86868b;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* --- SALA DE CINE (POSTERS VERTICALES) --- */
.cine-header {
    padding: 150px 20px 60px 20px;
    text-align: center;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cine-carousel {
    display: flex;
    gap: 30px;
    padding: 20px 5vw 40px 5vw; 
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; 
    width: 100%;
}
.cine-carousel::-webkit-scrollbar { display: none; }

.cine-card {
    min-width: 65vw; 
    aspect-ratio: 2 / 3; 
    border-radius: 16px; 
    background-size: cover;
    background-position: center;
    position: relative;
    scroll-snap-align: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .cine-card { min-width: 30vw; } 
}
@media (min-width: 1200px) {
    .cine-card { min-width: 22vw; } 
}

.cine-card:hover {
    transform: scale(1.02) translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.cine-card::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(0,0,0,0.3); opacity: 0; transition: 0.3s;
}
.cine-card:hover::before { opacity: 1; }

.play-button {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(255,255,255,0.2); backdrop-filter: blur(10px);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.play-button svg { width: 30px; height: 30px; fill: white; margin-left: 5px; }
.cine-card:hover .play-button { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.cine-info {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 40px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white; z-index: 2;
}
.cine-info h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 5px; line-height: 1.1; }
.cine-info p { font-size: 0.85rem; opacity: 0.8; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; }

.carousel-controls {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    margin-bottom: 40px;
}

.scroll-arrow {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #1d1d1f;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.scroll-arrow:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.scroll-arrow:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .carousel-controls { display: none; }
}

.video-modal {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.95); backdrop-filter: blur(20px);
    display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.4s ease;
}
.video-modal.active { display: flex; opacity: 1; }

.video-container {
    width: 90vw; max-width: 1200px; aspect-ratio: 16 / 9;
    background: black; border-radius: 12px; overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5); position: relative;
}
.video-container iframe { width: 100%; height: 100%; border: none; }

.btn-close-video {
    position: absolute; top: 30px; right: 40px;
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 50px; height: 50px; border-radius: 50%;
    font-size: 1.5rem; cursor: pointer; transition: 0.2s; z-index: 10001;
}
.btn-close-video:hover { background: rgba(255,255,255,0.3); transform: scale(1.1); }

.brands-section { padding: 20px 20px 100px 20px; text-align: center; }
.brands-grid { display: flex; justify-content: center; align-items: center; gap: 40px; flex-wrap: wrap; opacity: 0.6; }
.brands-grid img { max-height: 40px; filter: grayscale(100%); transition: 0.4s ease; cursor: default; }
.brands-grid img:hover { filter: grayscale(0%); transform: scale(1.05); }

/* --- CURSOR SUTIL PREMIUM --- */
@media (pointer: fine) {
    .custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 6px;
        height: 6px;
        background-color: var(--color-texto-oscuro);
        border-radius: 50%;
        pointer-events: none;
        z-index: 999999;
        transform: translate3d(0, 0, 0) translate(-50%, -50%);
        transition: width 0.2s ease, height 0.2s ease, opacity 0.2s ease;
        will-change: width, height, transform;
    }

    .custom-cursor.cursor-hover {
        width: 12px;
        height: 12px;
        opacity: 0.5;
    }
}

@media (pointer: coarse) {
    .custom-cursor { display: none !important; }
}