:root {
    --white: #FFFFFF;
    --black: #111111;
    --gray: #EAEAEA;
    --font-stack: 'Montserrat', 'Helvetica Neue', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--white);
    color: var(--black);
    font-family: var(--font-stack);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.thin {
    font-weight: 300;
}

p {
    font-weight: 300;
    line-height: 1.6;
    color: var(--black);
}

/* Grid Overlay */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    background-size: 50px 50px;
    background-image:
        linear-gradient(to right, rgba(17, 17, 17, 0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(17, 17, 17, 0.05) 1px, transparent 1px);
}

/* Sticky Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 5%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--black);
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-decoration: none;
    color: var(--black);
}

.main-nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--black);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: opacity 0.3s ease;
}

.main-nav a:hover {
    opacity: 0.5;
}

.nav-cta {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--black);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid var(--black);
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: var(--black);
    color: var(--white);
}

/* Buttons */
.btn-solid {
    display: inline-block;
    background-color: var(--black);
    color: var(--white);
    padding: 18px 32px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid var(--black);
    transition: all 0.3s ease;
    margin-top: 30px;
}

.btn-solid:hover {
    background-color: var(--white);
    color: var(--black);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    padding-left: 5%;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    /* For parallax */
    background-image: url('images/residencial/IMG_0430.JPEG');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(2.5rem, 4.5vw, 4rem);
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
}

/* Manifiesto */
.manifiesto {
    min-height: 80vh;
    display: flex;
    align-items: center;
    padding: 100px 5%;
    gap: 10%;
    border-bottom: 1px solid var(--black);
}

.manifiesto-text {
    flex: 1;
}

.manifiesto-text h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 40px;
}

.manifiesto-text p {
    font-size: 1.5rem;
    line-height: 1.8;
}

.manifiesto-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.manifiesto-img {
    width: 400px;
    height: 500px;
    object-fit: cover;
    border: 1px solid var(--black);
    transition: transform 0.5s ease;
    filter: grayscale(20%);
}

.manifiesto-img:hover {
    transform: scale(1.02);
    filter: grayscale(0%);
}

/* Practica (Services) */
.practica {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-height: 80vh;
    border-bottom: 1px solid var(--black);
}

.practica .col {
    padding: 60px 40px;
    border-right: 1px solid var(--black);
    transition: background-color 0.4s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.practica .col:last-child {
    border-right: none;
}

.practica .col:hover {
    background-color: var(--gray);
}

.practica h3 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.practica p {
    font-size: 1.1rem;
}

/* Especialidades Marquee */
.especialidades {
    padding: 30px 0;
    background-color: var(--black);
    color: var(--white);
    border-bottom: 1px solid var(--black);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: scroll-left 30s linear infinite;
}

.especialidades h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 300;
    letter-spacing: 0.1em;
    display: inline-flex;
    align-items: center;
    gap: 30px;
    padding-right: 30px;
    margin: 0;
}

.especialidades .dot {
    font-size: 1rem;
    color: var(--gray);
    opacity: 0.5;
}

@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Galería (Portfolio) */
.galeria-section {
    padding: 100px 5%;
    border-bottom: 1px solid var(--black);
}

.galeria-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.galeria-header h2 {
    font-size: clamp(2rem, 3vw, 3rem);
}



.archivo {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    column-gap: 40px;
    row-gap: 70px;
    padding-bottom: 20px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    gap: 15px;
    cursor: pointer;
}

.archivo .grid-item:nth-child(1) { grid-column: span 7; }
.archivo .grid-item:nth-child(2) { grid-column: span 5; }

.archivo .grid-item:nth-child(3) { grid-column: span 4; }
.archivo .grid-item:nth-child(4) { grid-column: span 4; }
.archivo .grid-item:nth-child(5) { grid-column: span 4; }

.archivo .grid-item:nth-child(6) { grid-column: span 6; }
.archivo .grid-item:nth-child(7) { grid-column: span 6; }

.archivo .grid-item:nth-child(8) { grid-column: span 5; }
.archivo .grid-item:nth-child(9) { grid-column: span 7; }

.img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--gray);
}

.archivo .grid-item:nth-child(1) .img-wrapper { aspect-ratio: 16 / 10; }
.archivo .grid-item:nth-child(2) .img-wrapper { aspect-ratio: 16 / 10; }
.archivo .grid-item:nth-child(3) .img-wrapper { aspect-ratio: 1 / 1; }
.archivo .grid-item:nth-child(4) .img-wrapper { aspect-ratio: 1 / 1; }
.archivo .grid-item:nth-child(5) .img-wrapper { aspect-ratio: 1 / 1; }
.archivo .grid-item:nth-child(6) .img-wrapper { aspect-ratio: 3 / 2; }
.archivo .grid-item:nth-child(7) .img-wrapper { aspect-ratio: 3 / 2; }
.archivo .grid-item:nth-child(8) .img-wrapper { aspect-ratio: 16 / 10; }
.archivo .grid-item:nth-child(9) .img-wrapper { aspect-ratio: 16 / 10; }

/* Utility Classes for Sub-page Collages */
.grid-span-4 { grid-column: span 4; }
.grid-span-5 { grid-column: span 5; }
.grid-span-6 { grid-column: span 6; }
.grid-span-7 { grid-column: span 7; }
.grid-span-8 { grid-column: span 8; }
.grid-span-12 { grid-column: span 12; }

.img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.grid-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.project-info h4 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.project-info p {
    font-size: 1rem;
    color: #555;
    line-height: 1.5;
}

/* Project Card System (Folders) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 60px 40px;
    margin-top: 40px;
}

.project-card {
    text-decoration: none;
    color: var(--black);
    display: flex;
    flex-direction: column;
    gap: 25px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.project-card .img-wrapper-card {
    aspect-ratio: 16 / 10;
    border: 1px solid var(--black);
    overflow: hidden;
    position: relative;
    background-color: var(--gray);
}

.project-card .img-wrapper-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
    transition: all 0.6s ease;
}

.project-card:hover .img-wrapper-card img {
    filter: grayscale(0%);
    transform: scale(1.03);
}

.project-card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-card-main-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-card-main-info h3 {
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.project-card-main-info .location {
    font-size: 0.85rem;
    font-weight: 300;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.project-card-meta {
    text-align: right;
}

.project-card-meta .year {
    font-size: 0.9rem;
    font-weight: 700;
    display: block;
}

.project-card-meta .category {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.5;
    text-transform: uppercase;
}

/* Contacto */
.contacto {
    background-color: var(--black);
    color: var(--white);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 100px 5%;
}

.contacto h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 20px;
    max-width: 900px;
}

.contacto p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 40px;
}

.contact-links {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
}

.link-discreto {
    display: inline-block;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 5px;
    transition: all 0.4s ease;
}

.link-discreto:hover {
    color: var(--gray);
    border-bottom-color: var(--white);
}

/* Footer */
.site-footer {
    background-color: var(--white);
    color: var(--black);
    padding: 40px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--black);
}

.footer-info p {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.footer-social {
    display: flex;
    gap: 20px;
}

.footer-social a {
    color: var(--black);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: opacity 0.3s ease;
}

.footer-social a:hover {
    opacity: 0.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .site-footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .manifiesto {
        flex-direction: column;
        padding: 50px 5%;
    }

    .practica {
        grid-template-columns: 1fr;
    }

    .practica .col {
        border-right: none;
        border-bottom: 1px solid var(--black);
        padding: 40px 20px;
    }

    .galeria-section {
        padding: 50px 5%;
    }

    .archivo {
        display: flex;
        flex-direction: column;
        gap: 60px;
    }

    .archivo .grid-item {
        margin-top: 0 !important;
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* Header Fixes */
    .sticky-header {
        flex-wrap: wrap;
        padding: 15px 5%;
    }
    .logo {
        font-size: 1rem;
        order: 1;
    }
    .nav-cta {
        font-size: 0.75rem;
        padding: 8px 12px;
        order: 2;
    }
    .main-nav {
        width: 100%;
        order: 3;
        justify-content: center;
        gap: 15px;
        margin-top: 20px;
    }
    .main-nav a {
        font-size: 0.8rem;
    }

    /* Text & Margin Adjustments (Evitar cascadas y dar aire) */
    .hero {
        padding: 0 10%;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero p {
        font-size: 1.05rem;
    }

    .manifiesto {
        padding: 60px 10%;
    }
    .manifiesto-text h2 {
        font-size: 1.8rem;
    }
    .manifiesto-text p {
        font-size: 1.05rem;
        line-height: 1.6;
        text-align: justify;
    }

    .practica .col {
        padding: 40px 10%;
    }
    .practica h3 {
        font-size: 1.3rem;
    }
    .practica p {
        font-size: 1.05rem;
    }

    .galeria-section {
        padding: 50px 10%;
    }

    .contacto {
        padding: 60px 10%;
    }
    .contacto h2 {
        font-size: 2rem;
    }
    .contacto p {
        font-size: 1.05rem;
    }

    .contact-links {
        flex-direction: column;
        gap: 20px;
    }
}
@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* Base Project Detail Styles */
.project-detail-section {
    padding: 150px 5% 100px;
}

.project-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 30px;
}

.project-detail-header-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-detail-header-left .category-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.5;
}

.project-detail-header-left h1 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin: 0;
}

.project-detail-header-left .meta {
    font-size: 1rem;
    opacity: 0.7;
    font-weight: 300;
}

.btn-back-link {
    text-decoration: none;
    color: var(--black);
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--black);
    padding-bottom: 5px;
    transition: opacity 0.3s;
}

.btn-back-link:hover {
    opacity: 0.6;
}

/* Centered Description */
.project-detail-footer {
    max-width: 800px;
    margin: 80px auto 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.project-detail-footer h2 {
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-detail-footer p {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #444;
}

/* Carousel System */
.carousel-container {
    position: relative;
    width: 100%;
    margin: 40px 0 80px;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding-bottom: 20px;
}

/* Hide scrollbar but keep functionality */
.carousel-track::-webkit-scrollbar {
    display: none;
}
.carousel-track {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.carousel-slide {
    flex: 0 0 60%;
    scroll-snap-align: center;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--black);
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.carousel-slide:hover img {
    transform: scale(1.03);
}

.carousel-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--black);
    opacity: 0.2;
    cursor: pointer;
    transition: opacity 0.3s;
}

.carousel-dot.active {
    opacity: 1;
}

@media (max-width: 768px) {
    .carousel-slide {
        flex: 0 0 95%;
    }
}
