/* ==========================================================================
   Global Variables & Reset
   ========================================================================== */
:root {
    --bg-main: #FBF9F5;
    --bg-card: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-muted: #666666;
    --accent-blue: #4D49E3;
    --accent-orange: #E05638;
    --accent-yellow: #FFD200;
    --border-light: #E5E2DC;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-script: 'Italianno', cursive, serif;
}

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

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   Layout Containers & Utilities
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.page-title-label {
    color: var(--accent-orange);
    text-transform: uppercase;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    letter-spacing: 0.1em;
    font-weight: 600;
}

.page-title-heading {
    font-family: var(--font-serif);
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    font-weight: 400;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.page-title-italic {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--accent-blue);
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 1rem;
    position: relative;
}

.site-logo {
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 0.05em;
}

.menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-width: 44px;
    min-height: 44px;
}

.menu-toggle span {
    display: block;
    width: 1.35rem;
    height: 2px;
    background-color: var(--accent-orange);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

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

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

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

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.site-nav a {
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    color: var(--text-primary);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
    background: rgba(77, 73, 227, 0.08);
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 0.75rem);
        right: 0;
        display: none;
        flex-direction: column;
        gap: 0.25rem;
        min-width: 220px;
        padding: 0.75rem;
        background: var(--bg-card);
        border: 1px solid var(--border-light);
        border-radius: 16px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
        z-index: 20;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 0.7rem 0.85rem;
        border-radius: 10px;
    }
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 44px;
}

.btn-primary {
    background-color: var(--accent-blue);
    color: #FFF;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--text-primary);
    color: #FFF;
}

.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.pill-badge {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    font-size: clamp(0.8rem, 1.5vw, 0.88rem);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-badge.active, .pill-badge:hover {
    background: var(--accent-blue);
    color: #FFF;
    border-color: var(--accent-blue);
}

/* ==========================================================================
   Gallery Grid (Masonry effect using CSS Columns)
   ========================================================================== */
.gallery-grid {
    column-count: 3;
    column-gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s ease;
}

.gallery-item:hover {
    transform: translateY(-3px);
}

.gallery-item img {
    width: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.86);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 1000;
}

.gallery-lightbox.open {
    display: flex;
}

.gallery-lightbox img,
.gallery-lightbox video {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.gallery-lightbox video {
    background: #000;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    cursor: pointer;
}

/* ==========================================================================
   Case Study & Detail Sections
   ========================================================================== */
.case-study-hero {
    padding: clamp(2rem, 5vw, 4rem) 1.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-item h3 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: var(--accent-blue);
    line-height: 1;
}

.stat-item p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.resource-list {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.resource-item {
    font-size: clamp(0.85rem, 1.5vw, 0.95rem);
    line-height: 1.5;
    word-break: break-word;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    padding: 3rem 1.25rem 2rem;
    border-top: 1px solid var(--border-light);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */
@media (max-width: 992px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 1rem 1.25rem;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .gallery-grid {
        column-count: 1;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .pill-container {
        gap: 0.4rem;
    }

    .pill-badge {
        padding: 0.4rem 0.85rem;
    }
}
