/* --- ESTILOS GENERALES Y MENÚ --- */
* { box-sizing: border-box; }
html, body { 
    height: 100%; 
    margin: 0; 
}
body {
	background: #0c0c0c;
	color: #d8d8d8;
	font: 400 13px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
	overflow-x: hidden;
}
h1, p, a, li, span { margin: 0; font: inherit; color: inherit; }


/* --- CURSOR PERSONALIZADO (solo desktop hover) --- */
@media (hover: hover) {
    html, body { cursor: none; }
    a, button, [role="button"],
    .project-cover-container, .gallery img,
    .project-detail img, .nav, .close,
    .mobile-menu-button, label, .home-btn { cursor: none; }
}

.cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 5px; height: 5px;
    background: #e8e8e8;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
    transition: opacity 0.15s, width 0.2s, height 0.2s;
    display: none;
}
.cursor-ring {
    position: fixed;
    top: 0; left: 0;
    width: 28px; height: 28px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    will-change: transform;
    transition: width 0.28s cubic-bezier(0.4,0,0.2,1),
                height 0.28s cubic-bezier(0.4,0,0.2,1),
                border-color 0.28s,
                opacity 0.15s;
    display: none;
}
@media (hover: hover) {
    .cursor-dot  { display: block; }
    .cursor-ring { display: block; }
}


/* --- OVERLAY DE TRANSICIÓN DE PÁGINA --- */
.page-overlay {
    position: fixed;
    inset: 0;
    background: #0c0c0c;
    z-index: 8900;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.page-overlay.hidden {
    opacity: 0;
}


/* --- ANIMACIONES DE ENTRADA GLOBAL --- */
@keyframes slideFromLeft {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideFromRight {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes floatAnim {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-7px); }
}


/* --- SCROLL REVEAL --- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* Email e Instagram arriba derecha */
.contact {
	position: fixed;
	top: 14px;
	right: 16px;
	z-index: 100;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	max-width: 220px;
	text-align: right;
    animation: slideFromRight 0.7s cubic-bezier(0.4,0,0.2,1) 0.05s both;
}
.contact-section-label {
	font-size: 9px;
	letter-spacing: 0.12em;
	color: #d8d8d8;
	margin-bottom: 4px;
	margin-top: 10px;
}
.contact .about-text {
	font-size: 11px;
	line-height: 1.6;
	color: #d8d8d8;
	margin-bottom: 8px;
}
.contact .about-text a {
	color: #d8d8d8;
	text-decoration: none;
	transition: opacity .2s;
}
.contact .about-text a:hover { opacity: 0.5; }
.contact a {
	text-decoration: none;
	font-size: 11px;
	line-height: 1.4;
	color: #d8d8d8;
	transition: opacity .2s;
}
.contact a:hover { opacity: 0.5; }


/* Menú lateral con items repartidos */
.side {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 200px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 20px 16px;
	background: #0c0c0c;
	z-index: 100;
    animation: slideFromLeft 0.7s cubic-bezier(0.4,0,0.2,1) 0.05s both;
}
.nav-item {
	text-decoration: none;
	color: #d8d8d8;
	font-size: 11px;
	letter-spacing: 0.05em;
	transition: opacity .2s;
    position: relative;
    display: inline-block;
}
.nav-item::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #c8c8c8;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.nav-item:hover::after { width: 100%; }
.nav-item.active::after { width: 100%; }
.nav-item:hover { opacity: 1; }
.nav-item.active { font-weight: 600; }


/* Página principal (foto centrada) */
.home {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	margin-left: 200px;
    animation: fadeUp 0.8s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}
.profile {
	width: 180px;
	height: 180px;
	object-fit: cover;
    animation: floatAnim 7s ease-in-out infinite;
    animation-delay: 1.5s;
    filter: grayscale(15%);
    transition: filter 0.6s ease;
}
.profile:hover {
    filter: grayscale(0%);
}


/* --- CONTENIDO PRINCIPAL (DEFAULT: Para Film, Images, Index) --- */
.main { 
    margin-left: 200px; 
    padding: 30px; 
    padding-top: 60px;
    height: auto;
    overflow: visible;
    animation: fadeUp 0.8s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}


/* Estilos de vídeo */
.video-container {
	width: min(720px, 90%);
	margin: 0 0 24px auto; 
}
.video {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	margin: 0; 
	background: #000;
    overflow: hidden;
}
.video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
    transition: transform 0.4s ease;
}
.video:hover iframe {
    transform: scale(1.005);
}
.video-title {
	margin-top: 8px;
	font-size: 10px;
	color: #d8d8d8;
	letter-spacing: 0.03em;
}


/* --- GALERÍA FLEX (centrada) --- */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 14px;
    max-width: 750px;
    margin: 0 auto;
}
.gallery img {
    width: var(--flex-width, 30%);
    height: auto;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.4,0,0.2,1), filter 0.35s ease;
}
.gallery:hover .gallery img { opacity: 0.3; }
.gallery:hover .gallery img:hover {
    opacity: 1;
    transform: scale(1.015);
    filter: none;
    z-index: 2;
    position: relative;
}
/* --- FIN GALERÍA FLEX --- */


/* --- DISEÑO ESPECÍFICO: DESIGN.HTML (DESKTOP) --- */

.main-design {
    height: 100vh;
    overflow: hidden;
    padding-bottom: 0;
    animation: fadeUp 0.8s cubic-bezier(0.4,0,0.2,1) 0.1s both;
}

.design-layout {
    display: flex;
    justify-content: center; 
    gap: 50px; 
    height: calc(100vh - 60px); 
}

.design-layout .project-list, 
.design-layout .project-detail {
    height: 100%; 
    overflow-y: auto; 
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.design-layout .project-list::-webkit-scrollbar, 
.design-layout .project-detail::-webkit-scrollbar {
    display: none;
}
/* --- FIN DISEÑO ESPECÍFICO: DESIGN.HTML (DESKTOP) --- */


/* Lista de proyectos */
.project-list {
    width: 190px; 
    flex-shrink: 0; 
}

.project-item {
    text-align: left;
    margin-bottom: 4px;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4,0,0.2,1);
    transition-delay: var(--item-delay, 0ms);
}
.project-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.project-cover-container {
    display: block;
    cursor: pointer;
    padding: 4px 0;
}

.project-cover-container .project-title {
    transition: opacity .2s, letter-spacing 0.3s ease;
}

.project-cover-container:hover .project-title {
    opacity: 0.35;
    letter-spacing: 0.1em;
}

.project-cover-container.selected .project-title {
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 1;
    letter-spacing: 0.06em;
}

.project-title {
    font-size: 10px;
    color: #d8d8d8;
    letter-spacing: 0.06em;
    margin: 0;
}


/* Panel de detalle */
.project-detail {
    flex-grow: 1; 
    max-width: 560px; 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    min-height: 200px; 
    padding-top: 6px;
    transition: opacity 0.22s ease;
}

.project-detail .empty-message {
    margin-top: 40px;
    font-size: 11px;
    color: #d8d8d8;
    letter-spacing: 0.04em;
}


/* Bloque de descripción */
.project-desc-block {
    width: 100%;
    padding: 0 0 22px 0;
    border-bottom: 1px solid #1a1a1a;
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.project-desc-title {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: #d8d8d8;
    margin-bottom: 5px;
}

.project-desc-label {
    font-size: 9px;
    letter-spacing: 0.12em;
    color: #d8d8d8;
    margin-bottom: 12px;
}

.project-desc-text {
    font-size: 11px;
    color: #d8d8d8;
    line-height: 1.7;
    letter-spacing: 0.01em;
    margin-bottom: 12px;
}

.project-desc-meta {
    font-size: 10px;
    color: #d8d8d8;
    letter-spacing: 0.04em;
}


/* Imágenes del detalle */
.project-detail img {
    width: 100%;
    height: auto;
    margin-bottom: 14px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.project-detail img:hover {
    opacity: 0.80;
    transform: scale(1.008);
}


/* --- SECCIÓN FILM --- */
.film-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding-left: 130px;
}

.film-item {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
    max-width: 860px;
}

.film-item .video-container {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.film-description {
    width: 160px;
    flex-shrink: 0;
    padding-top: 2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.film-desc-label {
    font-size: 9px;
    letter-spacing: 0.12em;
    color: #d8d8d8;
}

.film-description p {
    font-size: 11px;
    color: #d8d8d8;
    line-height: 1.65;
    letter-spacing: 0.01em;
}

.film-desc-meta {
    font-size: 10px !important;
    color: #d8d8d8 !important;
    letter-spacing: 0.04em !important;
    margin-top: 4px;
}
/* --- FIN SECCIÓN FILM --- */


/* --- LIGHTBOX --- */
.lightbox {
	display: none; 
	position: fixed;
	inset: 0;
	align-items: center;
	justify-content: center;
	z-index: 999;
	background: rgba(8, 8, 8, 0.95);
	backdrop-filter: blur(0px);
	-webkit-backdrop-filter: blur(0px);
	opacity: 0;
	transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1),
	            backdrop-filter 0.35s ease,
	            -webkit-backdrop-filter 0.35s ease;
}
.lightbox.open {
    opacity: 1;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.lightbox .nav {
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 28px;
    font-weight: 300;
    color: #d8d8d8;
    cursor: pointer;
    z-index: 1001;
    padding: 10px 22px;
    user-select: none;
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.lightbox .nav:hover { color: #d8d8d8; transform: translateY(-50%) scale(1.15); }
.lightbox .nav.prev { left: 15px; }
.lightbox .nav.next { right: 15px; }
.lightbox-img {
    max-width: 88vw;
    max-height: 88vh;
    transform: scale(0.92);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
                opacity 0.35s cubic-bezier(0.4,0,0.2,1);
    object-fit: contain;
}
.lightbox.open .lightbox-img {
    transform: scale(1);
    opacity: 1;
}
.lightbox .close {
    position: absolute;
    top: 28px;
    right: 28px;
    font-size: 28px;
    color: #d8d8d8;
    cursor: pointer;
    z-index: 1000;
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
    line-height: 1;
}
.lightbox .close:hover {
    color: #d8d8d8;
    transform: rotate(90deg);
}

/* Contador del lightbox */
.lightbox-counter {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: 0.18em;
    color: #d8d8d8;
    pointer-events: none;
    white-space: nowrap;
}


/* Botón home */
.home-btn {
    position: fixed;
    bottom: 18px;
    right: 20px;
    font-size: 13px;
    letter-spacing: 0.05em;
    color: #d8d8d8;
    text-decoration: none;
    z-index: 100;
    line-height: 1;
    transition: opacity .2s, transform 0.3s ease, color 0.3s;
    animation: slideFromRight 0.7s cubic-bezier(0.4,0,0.2,1) 0.2s both;
}
.home-btn:hover {
    opacity: 1;
    color: #d8d8d8;
    transform: rotate(180deg);
}


/* --- ESTILOS MÓVIL (Media Query) --- */
.mobile-menu-button, .mobile-menu-overlay {
	display: none;
}

@media (max-width: 768px) {
	
	.side, .contact {
		display: none;
	}
	
	.main {
		margin-left: 0;
		padding: 60px 20px 20px 20px; 
        height: auto;
        overflow: visible;
	}
    .main-design {
        height: auto;
        overflow: visible;
        animation: none;  /* sin transform = position:fixed funciona correctamente */
        transform: none;
    }
	.home {
		margin-left: 0;
		padding: 60px 20px 20px 20px;
	}
	.profile {
		width: 150px;
		height: 150px;
	}
    
    .gallery {
        max-width: none;
        padding: 0 5px;
        gap: 12px;
    }
    .gallery img {
        width: 100% !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .gallery:hover .gallery img { opacity: 1; }

    /* --- DISEÑO ESPECÍFICO: DESIGN.HTML (MÓVIL) --- */

    .design-layout {
        flex-direction: column;
        padding-bottom: 64px; /* espacio para la barra fija inferior */
        gap: 0;
        align-items: stretch;
        height: auto;
        padding-top: 0;
    }

    /* Panel de detalle: scroll vertical normal, nada de horizontal */
    .design-layout .project-detail {
        width: 100%;
        max-width: none;
        padding: 0 20px;
        box-sizing: border-box;
        flex-direction: column;
        overflow: visible;
        scroll-snap-type: none;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        min-height: 0;
        height: auto;
    }

    /* Bloque de descripción: normal, sin scroll horizontal */
    .design-layout .project-detail .project-desc-block {
        flex-shrink: unset;
        width: 100%;
        height: auto;
        scroll-snap-align: none;
        border-bottom: 1px solid #1a1a1a;
        border-right: none;
        padding: 0 0 18px 0;
        margin-bottom: 18px;
        overflow: visible;
        justify-content: flex-start;
    }

    /* Imágenes: ancho completo apiladas verticalmente */
    .design-layout .project-detail img {
        flex-shrink: unset;
        scroll-snap-align: none;
        height: auto;
        width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
        transform: none !important;
    }

    /* Barra inferior de proyectos */
    .design-layout .project-list {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #0c0c0c;
        box-shadow: 0 -1px 0 #1a1a1a;
        z-index: 500;
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 16px 20px;
        box-sizing: border-box;
        justify-content: flex-start;
        align-items: center;
        gap: 28px;
        height: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .design-layout .project-list::-webkit-scrollbar {
        display: none;
    }

    .design-layout .project-list .project-item {
        width: auto;
        flex-shrink: 0;
        text-align: left;
        margin-bottom: 0;
        opacity: 1;
        transform: none;
    }

    .design-layout .project-list .project-cover-container {
        padding: 6px 0;
    }

    .design-layout .project-list .project-title {
        font-size: 11px;
        letter-spacing: 0.06em;
        white-space: nowrap;
    }

    .design-layout .project-list .project-cover-container.selected .project-title {
        text-decoration: underline;
        text-underline-offset: 3px;
        opacity: 1;
    }

    .design-layout .project-detail .empty-message {
        margin-top: 20px;
    }
    /* --- FIN DISEÑO ESPECÍFICO: DESIGN.HTML (MÓVIL) --- */

	.mobile-menu-button {
		display: block;
		position: fixed;
		top: 15px;
		left: 15px;
		font-size: 30px;
		font-weight: 300;
		color: #d8d8d8;
		cursor: pointer;
		z-index: 1001;
        transition: transform 0.3s ease;
	}
	
	.mobile-menu-overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: #0c0c0c;
		z-index: 1000;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
		opacity: 0;
		visibility: hidden;
		transform: translateY(-16px);
		transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1),
		            visibility 0.35s,
		            transform 0.35s cubic-bezier(0.4,0,0.2,1);
	}
	.mobile-menu-overlay.open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}
	
	.mobile-menu-close {
		position: absolute;
		top: 15px;
		right: 20px;
		font-size: 30px;
		font-weight: 300;
		color: #d8d8d8;
		cursor: pointer;
	}
	
	.mobile-nav a {
		display: block;
		font-size: 12px; 
		letter-spacing: 0.05em;
		color: #d8d8d8;
		padding: 8px 0;
		text-align: center;
		text-decoration: none;
        transition: opacity 0.2s;
	}
    .mobile-nav a:hover { opacity: 0.4; }
	.mobile-nav a.mobile-contact {
		margin-top: 30px;
		font-size: 13px;
	}
	.mobile-nav a.mobile-instagram {
		font-size: 13px;
		padding-top: 0; 
	}
	
	.lightbox .nav {
		display: none;
	}

    /* --- SECCIÓN FILM MÓVIL --- */
    .film-section {
        gap: 40px;
        padding-left: 0;
        padding-right: 0;
        align-items: center;
        width: 100%;
    }

    .film-item {
        flex-direction: column;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .film-description {
        width: 100%;
        gap: 6px;
        padding-top: 0;
    }

    /* Reveal en móvil: más sutil */
    .reveal {
        opacity: 0;
        transform: translateY(10px);
    }

    /* Marquee off en mobile */
    .marquee-strip {
        display: none;
    }
    /* --- FIN SECCIÓN FILM MÓVIL --- */
}

/* ═══════════════════════════════════════════════
   LIGHT MODE
   Activado con .light-mode en <html>
   ═══════════════════════════════════════════════ */

/* Transición suave al cambiar tema */
body,
.side,
.page-overlay,
.mobile-menu-overlay,
.lightbox,
.home-btn,
.nav-item,
.contact a,
.project-title,
.project-desc-title,
.project-desc-label,
.project-desc-text,
.project-desc-meta,
.empty-message,
.video-title,
.cursor-dot {
    transition-property: background-color, color, border-color, opacity;
    transition-duration: 0.4s;
    transition-timing-function: ease;
}

/* Fondo y texto base */
html.light-mode body {
    background: #f0f0ee;
    color: #1c1c1c;
}

/* Menú lateral */
html.light-mode .side {
    background: #f0f0ee;
}

/* Links y nav */
html.light-mode .nav-item,
html.light-mode .contact a,
html.light-mode .home-btn {
    color: #1c1c1c;
}
html.light-mode .nav-item::after {
    background: #1c1c1c;
}

/* Overlay de transición de página */
html.light-mode .page-overlay {
    background: #f0f0ee;
}

/* Menú móvil */
html.light-mode .mobile-menu-overlay {
    background: #f0f0ee;
}
html.light-mode .mobile-menu-button {
    color: #1c1c1c;
}

/* Cursor */
html.light-mode .cursor-dot {
    background: #1c1c1c;
}
html.light-mode .cursor-ring {
    border-color: rgba(0, 0, 0, 0.2);
}

/* Lightbox */
html.light-mode .lightbox {
    background: rgba(240, 240, 238, 0.97);
}
html.light-mode .lightbox .close,
html.light-mode .lightbox .nav,
html.light-mode .lightbox-counter {
    color: #1c1c1c;
}

/* Textos generales */
html.light-mode .project-title,
html.light-mode .project-desc-title,
html.light-mode .project-desc-label,
html.light-mode .project-desc-text,
html.light-mode .project-desc-meta,
html.light-mode .empty-message,
html.light-mode .video-title,
html.light-mode .film-desc-label,
html.light-mode .film-description p,
html.light-mode .contact-section-label,
html.light-mode .about-text,
html.light-mode .about-text a,
html.light-mode .home-btn {
    color: #1c1c1c;
}

/* Bordes */
html.light-mode .project-desc-block {
    border-bottom-color: #d0d0ce;
}

/* Barra inferior móvil */
@media (max-width: 768px) {
    html.light-mode .design-layout .project-list {
        background-color: #f0f0ee;
        box-shadow: 0 -1px 0 #d0d0ce;
    }
}

/* Foto del index: cursor pointer para indicar que es clicable */
.profile {
    cursor: pointer;
}