/* --- Design System & Base Reset --- */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-gray: #7a7a7a;
    --accent-color: #f4f4f4;
    --dark-bg: #0d0d0d;
    --dark-text: #ffffff;
    --primary-accent: #000000;

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    --container-width: 1200px;
    --section-padding: 160px 0;
    --transition-smooth: all 0.8s cubic-bezier(0.19, 1, 0.22, 1);
    --transition-fast: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 300;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 2px;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: var(--section-padding);
}

.dark-bg {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

/* --- Navigation --- */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 30px 0;
    transition: var(--transition-smooth);
}

#main-header.scrolled {
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 40px;
    filter: grayscale(1) brightness(0);
}

#main-footer .logo img {
    filter: grayscale(1) brightness(5);
}

.logo span {
    font-weight: 200;
    opacity: 0.7;
}

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

/* --- Hamburger Button --- */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 2000;
}

.hamburger span {
    width: 30px;
    height: 1px;
    background-color: var(--text-color);
    transition: var(--transition-smooth);
}

.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links a {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--text-color);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after {
    width: 100%;
}

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

.hero-content {
    position: relative;
    z-index: 10;
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: 20px;
}

.hero h1 span {
    font-weight: 400;
    display: block;
}

.hero p {
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.5;
}

.hero-bg-parallax {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: #f9f9f9;
    z-index: 1;
    transform: translateX(10%);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.scroll-indicator span {
    font-size: 0.6rem;
    letter-spacing: 3px;
    writing-mode: vertical-lr;
    opacity: 0.5;
}

.scroll-indicator .line {
    width: 1px;
    height: 60px;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.scroll-indicator .line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: var(--text-color);
    animation: scrollLine 2s infinite ease-in-out;
}

@keyframes scrollLine {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(250%);
    }
}

/* --- Components & Utilities --- */
.section-tag {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-gray);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.line-before::before {
    content: '';
    width: 30px;
    height: 1px;
    background: var(--text-gray);
    margin-right: 15px;
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-smooth);
}

.line-before.animate::before {
    transform: scaleX(1);
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: center;
}

.reveal-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    overflow: hidden;
}

.btn-outline {
    display: inline-block;
    padding: 15px 35px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 20px;
}

.btn-outline:hover {
    background: var(--text-color);
    color: var(--bg-color);
    border-color: var(--text-color);
}

.btn-solid {
    display: inline-block;
    padding: 18px 45px;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-solid:hover {
    background: #333;
    transform: translateY(-3px);
}

/* --- Architectural Reveal Animations --- */
.reveal-image-container {
    position: relative;
    overflow: hidden;
}

.reveal-wall {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f4f4f4;
    z-index: 2;
    transition: transform 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

.reveal-image-container.animate .reveal-wall {
    transform: translateX(101%);
}

.reveal-image-container img {
    transform: scale(1.1);
    transition: transform 1.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.reveal-image-container.animate img {
    transform: scale(1);
}

/* --- About Section --- */
.stats {
    margin-top: 50px;
    border-top: 1px solid var(--accent-color);
    padding-top: 30px;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.stat-item .number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 300;
}

.stat-item .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-gray);
    letter-spacing: 1px;
}

/* --- Services Section Advanced --- */
.services-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.service-category {
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-smooth);
}

.service-category:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--dark-text);
}

.service-category h3 {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 25px;
    letter-spacing: 3px;
}

.service-category ul {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.service-category ul li {
    font-size: 0.8rem;
    opacity: 0.7;
    position: relative;
    padding-left: 15px;
}

.service-category ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 5px;
    height: 1px;
    background: var(--text-gray);
}

.service-category:hover ul li {
    opacity: 1;
}

/* --- Portfolio Header Correction --- */
.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 20px;
}

/* --- Portfolio Section --- */
.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 30px;
}

.portfolio-item.large {
    grid-row: span 2;
}

.portfolio-item {
    position: relative;
    cursor: pointer;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-overlay {
    position: absolute;
    bottom: 30px;
    left: 30px;
    color: white;
    z-index: 5;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition-smooth);
}

.portfolio-item:hover .item-overlay {
    opacity: 1;
    transform: translateY(0);
}

.item-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.item-overlay span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Parallax Banner --- */
.parallax-banner {
    position: relative;
    height: 60vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.parallax-banner .container {
    position: relative;
    z-index: 2;
    text-align: center;
}

.parallax-banner h2 {
    font-size: 3rem;
    color: var(--dark-text);
    font-weight: 200;
    line-height: 1.2;
    letter-spacing: 2px;
}

.parallax-banner h2 span {
    font-weight: 400;
    display: block;
}

/* --- Philosophy Section --- */
.philosophy {
    padding-bottom: 0;
}

.philosophy-intro {
    max-width: 800px;
    margin-bottom: 80px;
}

.lead-text {
    font-size: 1.4rem;
    font-weight: 300;
    line-height: 1.4;
    color: var(--text-color);
    margin-top: 20px;
}

.philosophy-block {
    padding: 100px 0;
}

.philosophy-block.dark-bg {
    background-color: var(--dark-bg);
    color: var(--dark-text);
}

.philosophy-block.accent-bg {
    background-color: #f9f9f9;
}

.philosophy-block h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    font-weight: 300;
}

.philosophy-text p {
    margin-bottom: 20px;
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1.8;
}

.philosophy-text strong {
    font-weight: 500;
    color: inherit;
}

.grid-layout.alternate {
    grid-template-columns: 1.2fr 1fr;
}

.grid-layout.alternate .philosophy-image {
    order: 2;
}

.grid-layout.alternate .philosophy-text {
    order: 1;
}

.philosophy-conclusion {
    text-align: center;
    padding: 150px 0;
}

.philosophy-conclusion h3 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.philosophy-conclusion .quote {
    font-size: 1.2rem;
    font-style: italic;
    margin: 40px 0;
    opacity: 0.6;
}

.conclusion-image {
    max-width: 900px;
    margin: 60px auto 0;
}

/* --- Contact Minimal --- */
#contacto .section-tag {
    justify-content: center;
}

#contacto .reveal-title {
    text-align: center;
}

.contact-info-centered {
    text-align: center;
    max-width: 600px;
    margin: 60px auto 0;
}

.contact-info-centered .contact-details {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.contact-info-centered .detail-item {
    margin-bottom: 0;
    text-align: center;
}

/* --- Responsive updates for Philosophy --- */
@media (max-width: 968px) {
    .grid-layout.alternate {
        grid-template-columns: 1fr;
    }

    .grid-layout.alternate .philosophy-image {
        order: -1;
    }

    .philosophy-block {
        padding: 60px 0;
    }

    .philosophy-conclusion {
        padding: 80px 0;
    }

    .parallax-banner {
        height: 40vh;
        background-attachment: scroll;
        /* Fixed backgrounds are problematic on mobile */
    }

    .parallax-banner h2 {
        font-size: 2rem;
    }

    .contact-info-minimal .contact-details {
        flex-direction: column;
        gap: 20px;
    }
}

/* --- Footer --- */
#main-footer {
    padding: 80px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 60px;
}

.footer-logo a {
    font-size: 1.4rem;
    letter-spacing: 5px;
    display: block;
    margin-bottom: 20px;
}

.footer-logo p {
    font-size: 0.85rem;
    opacity: 0.5;
    max-width: 300px;
}

.footer-links h4,
.footer-social h4 {
    font-size: 0.8rem;
    margin-bottom: 25px;
    color: var(--text-gray);
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    font-size: 0.85rem;
    opacity: 0.6;
}

.footer-links ul li a:hover {
    opacity: 1;
}

.social-icons {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.social-icons a {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-icons a svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.social-icons a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    font-size: 0.7rem;
    opacity: 0.3;
}

/* --- Responsive --- */
@media (max-width: 968px) {
    .grid-layout {
        grid-template-columns: 1fr;
        gap: 50px;
    }

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

    .hero h1 {
        font-size: 3.5rem;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-color);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
        z-index: 1500;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.5rem;
    }

    .hamburger {
        display: flex;
    }
}