/* ===========================
   CSS Variables & Reset
   =========================== */

:root {
    --bg-color: #FEFFE8;
    --text-color: #A1A54C;
    --heading-font: 'Bebas Neue', sans-serif;
    --body-font: 'Bebas Neue', sans-serif;
    --spacing-xs: 0.75rem;
    --spacing-sm: 1.5rem;
    --spacing-md: 2.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;
    --max-width: 1200px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 300;
    letter-spacing: 0.02em;
    overflow-x: hidden;
}

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

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

a:hover {
    opacity: 0.7;
}

/* ===========================
   Typography
   =========================== */

h1, h2, h3 {
    font-family: var(--heading-font);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(3.5rem, 9vw, 7rem);
    line-height: 1.1;
}

h2 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.2;
}

h3 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    line-height: 1.3;
}

p {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin-bottom: 1rem;
}

/* ===========================
   Layout Utilities
   =========================== */

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

section {
    padding: var(--spacing-md) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--spacing-md);
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    text-align: center;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--spacing-sm) / 2);
    width: 100%;
    max-width: 90%;
}

.hero-logo {
    width: 60%;
    max-width: 800px;
    height: auto;
}

.hero-contact {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.hero-contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    font-size: clamp(1rem, 3vw, 1.25rem);
    letter-spacing: 0.05em;
    -webkit-tap-highlight-color: transparent;
}

.hero-contact-item:hover {
    opacity: 0.7;
}

.hero-contact-icon {
    width: 18px;
    height: 18px;
    stroke-width: 1.5;
}

/* ===========================
   Content Section
   =========================== */

.content {
    background-color: var(--bg-color);
    padding: var(--spacing-lg) 0;
}

.content-text {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.content-text p {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

/* ===========================
   Portfolio Section
   =========================== */

.portfolio {
    padding: var(--spacing-sm);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    gap: 1rem;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    background-color: rgba(161, 165, 76, 0.1);
}

/* Create varying sizes for masonry effect */
.portfolio-item:nth-child(3n+1) {
    grid-row: span 2;
}

.portfolio-item:nth-child(5n+2) {
    grid-column: span 2;
}

.portfolio-item:nth-child(7n+3) {
    grid-row: span 2;
    grid-column: span 2;
}

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

.portfolio-item:hover img {
    transform: scale(1.05);
}

/* ===========================
   Services Section
   =========================== */

.services {
    background-color: rgba(161, 165, 76, 0.05);
    padding: var(--spacing-xl) 0;
}

.services-content {
    max-width: 1000px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.service-item {
    text-align: center;
    padding: var(--spacing-sm);
}

.service-item h3 {
    margin-bottom: var(--spacing-xs);
}

.service-item p {
    margin-bottom: 0;
}

/* ===========================
   Contact Section
   =========================== */

.contact {
    padding: var(--spacing-lg) 0;
}

.contact-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    font-size: clamp(1.25rem, 3.5vw, 1.5rem);
    letter-spacing: 0.05em;
}

.contact-item:hover {
    opacity: 0.7;
}

.contact-icon {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

/* ===========================
   Footer
   =========================== */

.footer {
    padding: var(--spacing-md) 0;
    text-align: center;
    border-top: 1px solid rgba(161, 165, 76, 0.2);
}

.footer p {
    margin-bottom: 0;
    font-size: 0.875rem;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    :root {
        --spacing-sm: 1rem;
        --spacing-md: 1.5rem;
        --spacing-lg: 2rem;
        --spacing-xl: 3rem;
    }

    .content {
        padding: var(--spacing-sm) 0;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        grid-auto-rows: 200px;
        gap: 0.75rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .contact-info {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .hero {
        height: auto;
        min-height: auto;
        padding: var(--spacing-md) 0;
    }

    .hero-content {
        position: static;
        transform: none;
    }

    .hero-logo {
        width: 75%;
    }

    .hero-contact {
        flex-direction: column;
        gap: var(--spacing-xs);
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        grid-auto-rows: 150px;
        gap: 0.5rem;
    }

    .portfolio-item:nth-child(7n+3) {
        grid-row: span 2;
        grid-column: span 1;
    }

    .hero-logo {
        width: 95%;
        max-width: none;
    }

    .hero-contact-item {
        font-size: 1rem;
        -webkit-tap-highlight-color: transparent;
    }

    .hero-contact-icon {
        width: 18px;
        height: 18px;
    }
}

/* ===========================
   Performance Optimizations
   =========================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Lazy loading placeholder */
img[loading="lazy"] {
    background-color: rgba(161, 165, 76, 0.1);
}

/* ===========================
   Lightbox
   =========================== */

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(161, 165, 76, 0.95);
    z-index: 9999;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--bg-color);
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}

.lightbox-close:hover {
    opacity: 0.7;
}

.portfolio-item {
    cursor: pointer;
}
