:root {
    --dark-brown: #000000;
    --text-color: #ffffff;
    --accent-color: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--dark-brown);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Texto secundario (cuerpo de texto, descripciones, etiquetas) */
.text-secondary,
.ai-text p.subtitle,
.project-info p,
.project-detail-desc p,
footer p,
.label-before,
.label-after,
.ia-page p {
    font-family: 'Questrial', sans-serif;
    font-weight: 400;
}

/* ==================================================
   BARRA DE NAVEGACIÓN — versión superpuesta al vídeo (home)
   ================================================== */
.navbar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem 4rem;
    box-sizing: border-box;
    z-index: 20;
}

/* ==================================================
   BARRA DE NAVEGACIÓN — versión estática (páginas internas)
   ================================================== */
.navbar-page {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 4rem;
    box-sizing: border-box;
    z-index: 20;
    background-color: var(--dark-brown);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-left, .nav-center, .nav-right {
    flex: 1;
}

.nav-left {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.nav-left a {
    display: flex;
    align-items: center;
}

.nav-left img {
    height: 90px;
    width: auto;
}

.navbar-page .nav-left img {
    height: 60px;
}

.nav-center {
    display: flex;
    justify-content: center;
    text-align: center;
}

.brand-name {
    color: white;
    font-size: 1.3rem;
    letter-spacing: 4px;
    font-weight: 300;
    text-transform: uppercase;
}

.brand-name-link {
    text-decoration: none;
    display: inline-block;
}

.nav-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 2.5rem;
}

.nav-right a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 300;
    letter-spacing: 1px;
    padding-bottom: 5px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
    white-space: nowrap;
}

.nav-right a:hover {
    border-bottom: 1px solid white;
}

/* --- SECCIÓN HERO CON VÍDEO --- */
.hero {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: white;
    text-align: center;
    overflow: hidden;
}

.hero-clickable {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

/* Slideshow de portada (sustituye al vídeo): imágenes con efecto
   "Ken Burns" (zoom / desplazamiento lento) y fundido a negro entre ellas. */
.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    background-color: #000;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.5s linear;
}

.hero-slide.visible {
    opacity: 1;
}

/* linear = velocidad constante, sin frenada al final de cada plano */
.hero-slide-1.kb-active { animation: kb-pan-1 4s linear forwards; }
.hero-slide-2.kb-active { animation: kb-pan-2 4s linear forwards; }
.hero-slide-3.kb-active { animation: kb-pan-3 4s linear forwards; }

/* Plano 1: la imagen central, acercándose más a la barra */
@keyframes kb-pan-1 {
    from { transform: scale(1.06); }
    to   { transform: scale(1.32); }
}

/* Plano 2: empieza en la zona de asientos y se traslada hacia la derecha,
   hasta encuadrar la barra al fondo */
@keyframes kb-pan-2 {
    from { transform: scale(1.22) translateX(3.5%); }
    to   { transform: scale(1.22) translateX(-3.5%); }
}

/* Plano 3: centrado primero en la barra, se desplaza hacia la derecha
   para descubrir el escenario y las columnas */
@keyframes kb-pan-3 {
    from { transform: scale(1.22) translateX(4%); }
    to   { transform: scale(1.22) translateX(-4%); }
}

/* Velo sutil SOLO arriba, de apoyo para la legibilidad del menú */
.hero-top-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 260px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: -2;
    pointer-events: none;
}

/* Pequeño degradado inferior solo para fundir con la siguiente sección */
.hero-bottom-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    background: linear-gradient(to top, var(--dark-brown) 0%, rgba(21, 13, 10, 0) 100%);
    z-index: -1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 2rem 3.5rem 2rem;
}

.hero p {
    margin: 0;
    font-family: 'Raleway', sans-serif;
    font-size: 1.05rem;
    font-weight: 300;
    letter-spacing: 3px;
    color: #ffffff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
    text-align: center;
}

/* El numeral "3" de Raleway Light queda más bajo que la "D" a este tamaño;
   se usa Questrial (ya cargada en el sitio) solo en "3D", cuyos números
   sí igualan la altura de las mayúsculas. */
.hero-3d {
    font-family: 'Questrial', sans-serif;
    letter-spacing: 1px;
}

/* --- SECCIÓN DE IA Y SLIDER --- */
.ai-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 4rem 6rem 4rem;
    box-sizing: border-box;
    width: 100%;
    gap: 4rem;
}

.ai-text {
    flex: 0 0 25%;
}

.ai-text h2 {
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.ai-text p.subtitle {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 2.5rem;
    color: #b0b0b0;
}

.btn-primary {
    display: inline-block;
    background-color: white;
    color: var(--dark-brown);
    padding: 1rem 3rem;
    text-decoration: none;
    letter-spacing: 2px;
    font-weight: 400;
    font-size: 0.9rem;
    border-radius: 2px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    font-family: 'Raleway', sans-serif;
}

.btn-primary:hover {
    background-color: #d1d1d1;
    transform: translateY(-2px);
}

.ai-visual {
    flex: 1;
    position: relative;
    aspect-ratio: 21 / 9;
    width: 100%;
}

/* Contenedor del Slider Antes/Después */
.image-compare {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 2px;
}

.img-after, .img-before {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}


/* Textos de esquina en el slider */
.label-before, .label-after {
    position: absolute;
    bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    letter-spacing: 1px;
    pointer-events: none;
}

.label-before {
    left: 1.5rem;
}

.label-after {
    right: 1.5rem;
    z-index: 2;
}

.img-before-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: inset(0 calc(100% - var(--slider-pos)) 0 0);
    z-index: 3;
}

.image-compare.slider-hint-transition .img-before-container {
    transition: clip-path 0.55s ease-in-out;
}

.image-compare.slider-hint-transition .slider-line {
    transition: left 0.55s ease-in-out;
}

.slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
    margin: 0;
}

.slider-line {
    position: absolute;
    top: 0;
    left: var(--slider-pos);
    width: 2px;
    height: 100%;
    background: white;
    z-index: 5;
    transform: translateX(-50%);
    pointer-events: none;
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    color: var(--dark-brown);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: normal;
}


/* --- ESTILOS DE PROYECTOS (BANNERS INMERSIVOS) --- */
.portfolio-section {
    padding: 0 4rem;
    margin-bottom: 6rem;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 300;
    margin-bottom: 2rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Contenedor que agrupa los proyectos creando la fina línea blanca */
.projects-stack {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background-color: white;
    border: 1px solid white;
}

.project-banner {
    position: relative;
    width: 100%;
    height: 75vh;
    background-color: #222;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.project-banner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.8s ease;
}

.project-banner:hover img {
    transform: scale(1.02);
}

.project-placeholder {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-family: 'Questrial', sans-serif;
}

/* Degradado oscuro inferior para asegurar que el texto sea legible */
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(21, 13, 10, 0.85) 0%, rgba(21, 13, 10, 0) 50%);
    z-index: 2;
}

.project-info {
    position: relative;
    z-index: 3;
    padding: 3rem 4rem;
    width: 100%;
}

.project-info h3 {
    font-size: 1.26rem;
    font-weight: 400;
    margin: 0 0 0.5rem 0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.project-info p {
    font-size: 1.1rem;
    color: #d1d1d1;
    margin: 0;
    max-width: 100%;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

footer {
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer h2 {
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 1px;
}

footer p {
    color: #b0b0b0;
    margin-bottom: 2rem;
}

footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid white;
    padding-bottom: 2px;
    font-family: 'Questrial', sans-serif;
}

footer a:hover {
    color: #888;
    border-bottom-color: #888;
}

/* --- Enlaces de contacto (ubicación / correo / instagram) --- */
.contact-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 1rem auto 0 auto;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: none;
    padding-bottom: 0;
}

a.contact-item {
    cursor: pointer;
}

.contact-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* El icono de correo e Instagram vienen recortados a ras del círculo,
   mientras que el de ubicación tiene margen interno; se reescalan para
   que los tres círculos se vean del mismo tamaño visual. */
.contact-icon img.icon-tight {
    transform: scale(0.64);
}

a.contact-item:hover .contact-icon {
    transform: translateY(-4px);
}

.contact-text {
    font-family: 'Questrial', sans-serif;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    color: #d1d1d1;
    text-align: center;
    word-break: break-word;
    border-bottom: none;
    padding-bottom: 0;
    transition: color 0.3s ease;
}

a.contact-item:hover .contact-text {
    color: white;
}

/* ==================================================
   PÁGINA INDEPENDIENTE: PORTFOLIO IA
   ================================================== */
.ia-page {
    padding: 6rem 4rem 2rem 4rem;
}

.ia-hero {
    margin-bottom: 0.6rem;
}

.ia-hero h1 {
    font-size: 2.4rem;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 0;
}

.ia-hero p {
    color: #d1d1d1;
    font-size: 1.15rem;
    line-height: 1.75;
    margin-bottom: 1.3rem;
}

.ia-hero p.ia-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.5px;
    color: #999;
    line-height: 1.4;
    margin-bottom: 0;
}

.ia-intro-text {
    margin: 0 0 2rem 0;
}

.ia-intro-text p {
    font-family: 'Questrial', sans-serif;
    color: #d1d1d1;
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.ia-intro-text p:last-child {
    margin-bottom: 0;
}

.ia-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 2rem 0;
}

.ia-options-full {
    grid-column: 1 / -1;
}

.ia-options-cell {
    position: relative;
    overflow: hidden;
}

.ia-options-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ia-options-label {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
}

.ia-below-slider {
    font-family: 'Questrial', sans-serif;
    color: #d1d1d1;
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 2rem 0;
}

.ia-video-wrap {
    margin: 0 0 2rem 0;
    overflow: hidden;
    border-radius: 2px;
}

.ia-video-track {
    display: flex;
    width: 200%;
    transition: transform 0.7s ease-in-out;
}

.ia-video-slide {
    flex: 0 0 50%;
    width: 50%;
}

.ia-video-wrap video {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    background: #000;
}

.ia-reform-image {
    margin: 0 0 2rem 0;
}

.ia-reform-image img {
    width: 100%;
    display: block;
    border-radius: 2px;
}

.ia-placeholder {
    font-family: 'Questrial', sans-serif;
    color: #666;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-style: italic;
    margin: 0 0 4rem 0;
}

.ia-section {
    margin: 0 0 6rem 0;
}

.ia-section-title {
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

.ia-section p {
    color: #d1d1d1;
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.2rem;
}

.ia-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin: 3rem 0 6rem 0;
    align-items: start;
}

.ia-columns h3 {
    font-size: 1.15rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
}

.ia-columns p {
    font-family: 'Questrial', sans-serif;
    color: #b0b0b0;
    font-size: 1rem;
    line-height: 1.7;
}

.ia-compare-wrap {
    margin: 0 0 2rem 0;
}

.ia-compare-wrap .ai-visual {
    aspect-ratio: 16 / 9;
}

.ia-caption {
    text-align: center;
    font-family: 'Questrial', sans-serif;
    color: #888;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    margin-top: 1rem;
}

.ia-variation-block {
    margin: 4rem 0;
}

.ia-variation-block img {
    width: 100%;
    display: block;
    border-radius: 2px;
}

.ia-collage-block {
    margin: 4rem 0;
}

.ia-collage-block img {
    width: 100%;
    display: block;
    border-radius: 2px;
}

@media (max-width: 950px) {
    .ia-columns { grid-template-columns: 1fr; gap: 2.5rem; }
    .ia-page { padding: 5rem 1.5rem 2rem 1.5rem; }
}

/* ==================================================
   PÁGINA DE PROYECTO INDIVIDUAL (CARRUSEL)
   ================================================== */
.project-detail-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.project-carousel {
    position: relative;
    flex: 1;
    overflow: hidden;
    background-color: #111;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-slide {
    position: relative;
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #1a1a1a 0%, #000000 75%);
    overflow: hidden;
    cursor: zoom-in;
}

/* Fondo desenfocado con la propia imagen del slide, para rellenar las
   áreas laterales que deja el object-fit: contain, en vez de negro plano. */
.carousel-slide-bg {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background-size: cover;
    background-position: center;
    filter: blur(45px) brightness(0.95);
    transform: scale(1.1);
    z-index: 0;
    pointer-events: none;
}

.carousel-slide img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 1;
}

.carousel-slide.is-vertical img {
    width: auto;
    max-width: 100%;
    height: 100%;
}

/* Lightbox para ampliar imágenes del carrusel */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    box-shadow: 0 10px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(21, 13, 10, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.3s ease;
    backdrop-filter: blur(4px);
}

.carousel-arrow:hover {
    background: rgba(21, 13, 10, 0.85);
}

.carousel-arrow.prev { left: 2rem; }
.carousel-arrow.next { right: 2rem; }

.carousel-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 5;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background 0.3s ease;
}

.carousel-dot.active {
    background: white;
}

/* Texto opcional sobre una imagen del carrusel (ej. "Renderizado con IA") */
.carousel-slide-caption {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
    z-index: 2;
    pointer-events: none;
}

.project-detail-desc {
    padding: 1.5rem 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--dark-brown);
}

.project-detail-desc h1 {
    font-size: 1.3rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    margin: 0 0 0.3rem 0;
    text-transform: uppercase;
}

.project-detail-desc p {
    font-size: 0.95rem;
    color: #c9c9c9;
    margin: 0;
    max-width: 100%;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- RESPONSIVE PARA MÓVILES --- */
@media (max-width: 950px) {
    .navbar, .navbar-page { padding: 1.2rem 1.5rem; flex-wrap: wrap; gap: 1rem; }
    .nav-left img { height: 55px; }
    .navbar-page .nav-left img { height: 45px; }
    .nav-center { order: 3; flex: 1 0 100%; }
    .nav-right { gap: 1rem; flex-wrap: wrap; justify-content: center; flex: 1 0 100%; order: 2; }
    .ai-banner {
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
    }
    .ai-text { width: 100%; }
    .ai-visual { aspect-ratio: 16 / 9; }
    .portfolio-section { padding: 0 1.5rem; }
    .project-info { padding: 2rem; }
    .project-info h3 { font-size: 1.8rem; }
    .project-detail-desc { padding: 1.2rem 1.5rem; }
    .carousel-arrow { width: 38px; height: 38px; font-size: 1.1rem; }
    .carousel-arrow.prev { left: 0.8rem; }
    .carousel-arrow.next { right: 0.8rem; }
    .contact-links {
        grid-template-columns: 1fr;
        gap: 2.2rem;
        max-width: 320px;
    }
}
