/* ==========================================================================
   ESCALONA DESIGN - SISTEMA DE DISEÑO Y HOJA DE ESTILOS
   Aesthetic: Modern, Minimalist, Architectural, Premium Corporate
   ========================================================================== */

/* Variables del Sistema */
:root {
    --bg-color: #d8d8d8;
    --text-primary: #111111;
    --text-muted: #666666;
    --text-light: #8e8e8e;
    --accent-red: #d9383a;
    --white: #ffffff;
    --black: #000000;
    
    --font-header: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --header-height: 80px;
    --footer-height: 80px;
    --transition-smooth: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.25s ease;
}

/* Reset de Estilos */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden; /* Controlado por el SPA scrollable interno */
}

/* Textura sutil de ruido de fondo para dar sensación táctil / concreta */
.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    content: "";
    opacity: 0.035;
    z-index: 9999;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3e%3cfilter id='noiseFilter'%3e%3cfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3e%3c/filter%3e%3crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3e%3c/svg%3e");
}

/* Cabecera Principal - Puntos de Navegación */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    pointer-events: none; /* Permite clickear detrás si es necesario, reactivado en la nav */
}

.dot-navigation {
    display: flex;
    justify-content: space-between;
    width: 90%;
    max-width: 1200px;
    pointer-events: auto;
}

.nav-dot {
    width: 12px;
    height: 12px;
    background-color: var(--accent-red);
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    outline: none;
}

.nav-dot:hover {
    transform: scale(1.3);
}

.nav-dot.active {
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(217, 56, 58, 0.4);
}

/* Contenedor Principal SPA */
.content-container {
    width: 100%;
    height: 100%;
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

/* Estilo Base de las Vistas */
.view {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
    width: 100%;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 5%;
}

.view.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   VISTA 1: HOME / MENÚ PRINCIPAL
   ========================================================================== */
#home-view {
    position: relative;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Etiquetas Laterales Decorativas de Edición Limitada / Architectural */
.decorator-labels {
    position: absolute;
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-header);
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    color: var(--text-primary);
    top: 10%;
    font-weight: 500;
}

.hero-brand {
    user-select: none;
}

.brand-title {
    font-family: var(--font-header);
    font-size: clamp(3rem, 7vw, 7.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
    color: rgba(17, 17, 17, 0.15); /* Color de fondo muy suave, casi translúcido */
    cursor: pointer;
    transition: color var(--transition-smooth);
}

.brand-title:hover {
    color: var(--text-primary); /* Se vuelve negro al pasar el selector */
}

.brand-subtitle {
    margin-top: 15px;
    font-size: 0.85rem;
    font-family: var(--font-header);
    letter-spacing: 0.4em;
    color: var(--text-muted);
    font-weight: 400;
}

/* ==========================================================================
   VISTA 2: PORTAFOLIO (GRID DE PROYECTOS)
   ========================================================================== */
#portfolio-view {
    justify-content: flex-start;
    padding-top: 40px;
}

.portfolio-header {
    margin-bottom: 50px;
    text-align: left;
}

.portfolio-header h2 {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.portfolio-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 500px;
    line-height: 1.6;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

.portfolio-item {
    position: relative;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    transition: transform var(--transition-smooth);
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item .image-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%); /* Por defecto Blanco y Negro */
    transition: filter var(--transition-smooth), transform var(--transition-smooth);
}

.portfolio-item:hover img {
    filter: grayscale(0%); /* A color en hover */
    transform: scale(1.03);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.portfolio-item:hover .item-overlay {
    opacity: 1;
}

.project-num {
    font-family: var(--font-header);
    font-size: 1.5rem;
    font-weight: 700;
}

.project-category {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* ==========================================================================
   VISTA 3: DETALLE DE PROYECTO (MAQUETACIÓN DINÁMICA)
   ========================================================================== */
#detail-view {
    justify-content: flex-start;
    padding-top: 20px;
}

.back-to-portfolio {
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 40px;
    align-self: flex-start;
    transition: color var(--transition-fast);
}

.back-to-portfolio:hover {
    color: var(--accent-red);
}

.back-to-portfolio .arrow {
    font-size: 1.1rem;
}

/* --- DISEÑOS DE PROYECTOS ESPECÍFICOS --- */

/* Estructura Base de Contenido de Proyecto */
.project-content-grid {
    display: grid;
    gap: 40px;
    width: 100%;
}

/* Maquetación 001: Texto Abajo Ancho Completo.
   Imagen de fondo estática, la superior se desliza. */
.layout-001 {
    grid-template-columns: 1fr;
}

.layout-001 .interactive-image-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background-color: #c4c4c4;
}

.layout-001 .static-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.layout-001 .scrollable-overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    z-index: 2;
    padding: 50px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 300px; /* Genera espacio para poder scrollear */
}

.layout-001 .scrolling-card {
    width: 70%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    background-color: var(--white);
    border: 4px solid var(--white);
    border-radius: 2px;
    overflow: hidden;
    transition: transform var(--transition-smooth);
}

.layout-001 .scrolling-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-001 .project-info-panel {
    margin-top: 40px;
}

.project-title-large {
    font-family: var(--font-header);
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.project-description-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    column-count: 2;
    column-gap: 40px;
    text-align: justify;
}

/* Maquetación 002: Imagen Estática Arriba (Número), Deslizable Abajo.
   Texto a la derecha en columna. */
.layout-002 {
    grid-template-columns: 1.2fr 0.8fr;
}

.layout-002 .images-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.layout-002 .static-top-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 2px;
}

.layout-002 .sliding-bottom-container {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 15px;
    scroll-snap-type: x mandatory;
}

.layout-002 .sliding-image-card {
    flex: 0 0 85%;
    aspect-ratio: 16 / 9;
    scroll-snap-align: start;
    border-radius: 2px;
    overflow: hidden;
}

.layout-002 .sliding-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-002 .info-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-left: 20px;
}

.layout-002 .info-column .project-title-number {
    font-family: var(--font-header);
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 20px;
}

.layout-002 .info-column p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    text-align: justify;
}

/* Maquetación 003: Texto Arriba, Dos Columnas Abajo (Una estática, otra deslizable) */
.layout-003 {
    grid-template-columns: 1fr;
}

.layout-003 .text-top-row {
    margin-bottom: 20px;
}

.layout-003 .split-columns-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    height: 550px;
}

.layout-003 .static-side-column {
    height: 100%;
    border-radius: 2px;
    overflow: hidden;
}

.layout-003 .static-side-column img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.layout-003 .scrolling-side-column {
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-right: 10px;
}

.layout-003 .scrolling-side-column::-webkit-scrollbar {
    width: 4px;
}
.layout-003 .scrolling-side-column::-webkit-scrollbar-thumb {
    background-color: var(--accent-red);
}

.layout-003 .scrolling-side-column img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 2px;
}

/* Maquetación 004: Diseño Asimétrico de 3 Columnas */
.layout-004 {
    grid-template-columns: 0.7fr 1.3fr;
}

.layout-004 .left-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.layout-004 .project-number-huge {
    font-family: var(--font-header);
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
}

.layout-004 .description-container {
    margin-top: 30px;
}

.layout-004 .description-container p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
}

.layout-004 .right-images-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.layout-004 .main-large-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 2px;
}

.layout-004 .sub-images-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.layout-004 .sub-images-row img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 2px;
}

/* Maquetación 005: Estilo Showcase Minimalista */
.layout-005 {
    grid-template-columns: 1.1fr 0.9fr;
}

.layout-005 .hero-image-box {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
}

.layout-005 .hero-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 450px;
}

.layout-005 .details-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 40px;
}

.layout-005 .details-panel h3 {
    font-family: var(--font-header);
    font-size: 4rem;
    margin-bottom: 25px;
    font-weight: 700;
}

.layout-005 .details-panel p {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.layout-005 .spec-sheet {
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 20px;
}

.layout-005 .spec-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.layout-005 .spec-row .spec-label {
    font-weight: 500;
    color: var(--text-muted);
}

.layout-005 .spec-row .spec-val {
    font-family: var(--font-header);
    font-weight: bold;
}

/* Maquetación 006: Layout de Mosaico */
.layout-006 {
    grid-template-columns: 1fr;
}

.layout-006 .mosaic-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 250px 250px;
    gap: 20px;
    width: 100%;
}

.layout-006 .mosaic-item-1 {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
}
.layout-006 .mosaic-item-2 {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}
.layout-006 .mosaic-item-3 {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
}

.layout-006 .mosaic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.layout-006 .project-info-footer {
    margin-top: 30px;
}

.layout-006 .project-title-large {
    font-family: var(--font-header);
    font-size: 4.5rem;
}

/* ==========================================================================
   VISTA 4: CONTACTO
   ========================================================================== */
#contact-view {
    position: relative;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.contact-bg-text {
    position: absolute;
    font-family: var(--font-header);
    font-size: clamp(4rem, 10vw, 10.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
    color: rgba(17, 17, 17, 0.05); /* Muy translúcido en el fondo */
    z-index: 1;
    white-space: nowrap;
    pointer-events: none;
}

.contact-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.contact-content h2 {
    font-family: var(--font-header);
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 50px;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    padding: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.contact-link-item:hover {
    border-color: var(--accent-red);
    transform: translateY(-2px);
}

.link-label {
    font-family: var(--font-header);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.link-value {
    font-size: 1.15rem;
    font-weight: 400;
    transition: color var(--transition-fast);
}

.contact-link-item:hover .link-value {
    color: var(--accent-red);
}

/* ==========================================================================
   PIE DE PÁGINA (Footer Nav)
   ========================================================================== */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--footer-height);
    background-color: var(--bg-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.footer-nav {
    display: flex;
    gap: 40px;
}

.footer-link-btn {
    background: none;
    border: none;
    font-family: var(--font-header);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px 0;
    position: relative;
    transition: color var(--transition-fast);
}

.footer-link-btn:hover {
    color: var(--text-primary);
}

.footer-link-btn.active {
    color: var(--text-primary);
}

.footer-link-btn.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-red);
}

.domain-badge a {
    font-family: var(--font-header);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.domain-badge a:hover {
    color: var(--accent-red);
}

/* ==========================================================================
   RESPONSIVIDAD Y ADAPTABILIDAD
   ========================================================================== */

@media (max-width: 900px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .layout-002 {
        grid-template-columns: 1fr;
    }
    .layout-002 .info-column {
        padding-left: 0;
        margin-top: 20px;
    }
    
    .layout-003 .split-columns-row {
        grid-template-columns: 1fr;
        height: auto;
    }
    .layout-003 .static-side-column {
        height: 350px;
    }
    
    .layout-004 {
        grid-template-columns: 1fr;
    }
    .layout-004 .left-column {
        margin-bottom: 30px;
    }
    
    .layout-005 {
        grid-template-columns: 1fr;
    }
    .layout-005 .details-panel {
        padding-left: 0;
        margin-top: 30px;
    }
}

@media (max-width: 600px) {
    :root {
        --header-height: 60px;
        --footer-height: 70px;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .main-footer {
        flex-direction: column;
        justify-content: center;
        gap: 10px;
        padding: 10px;
    }
    
    .footer-nav {
        gap: 20px;
    }
    
    .decorator-labels {
        display: none; /* Ocultar en pantallas muy pequeñas para evitar ruido visual */
    }
    
    .project-description-text {
        column-count: 1;
    }
    
    .layout-001 .interactive-image-container {
        height: 300px;
    }
    .layout-001 .scrollable-overlay-container {
        gap: 150px;
    }
    .layout-001 .scrolling-card {
        width: 90%;
    }
    
    .layout-006 .mosaic-container {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 200px);
    }
    .layout-006 .mosaic-item-1 {
        grid-column: 1;
        grid-row: 1;
    }
    .layout-006 .mosaic-item-2 {
        grid-column: 1;
        grid-row: 2;
    }
    .layout-006 .mosaic-item-3 {
        grid-column: 1;
        grid-row: 3;
    }
}
