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

body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    color: #e5e5e5;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.pre-title, .section-pre-title {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 300;
    font-size: 0.85rem;
    color: #D4AF37;
    display: block;
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 2rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center { text-align: center; }

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Hide bg canvas on mobile — huge perf win */
@media (max-width: 768px) {
    #bg-canvas { display: none; }
    body {
        background: radial-gradient(ellipse at 50% 20%, #110d00 0%, #000 65%);
    }
}

/* Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 200px;
    opacity: 0.12;
    mix-blend-mode: overlay;
}

.site-wrapper {
    position: relative;
    z-index: 2;
}

/* ========== HAMBURGER MENU ========== */
.menu-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 200;
}
.menu-btn__burger {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}
.menu-btn__burger::before,
.menu-btn__burger::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
}
.menu-btn__burger::before { transform: translateY(-10px); }
.menu-btn__burger::after  { transform: translateY(10px); }

/* Hide burger when overlay is open — no duplicate X */
.menu-btn.open { visibility: hidden; }

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(20px);
    z-index: 150;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.nav-overlay.open {
    opacity: 1;
    visibility: visible;
}
.nav-overlay__close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: white;
    cursor: pointer;
    z-index: 160;
    line-height: 1;
}
.nav-overlay__close::before,
.nav-overlay__close::after {
    content: none !important;
    display: none !important;
}
.nav-overlay__menu ul {
    list-style: none;
    text-align: center;
}
.nav-overlay__menu li { margin: 2rem 0; }
.nav-overlay__menu a {
    font-size: 2.5rem;
    font-family: 'Playfair Display', serif;
    text-decoration: none;
    color: rgba(255,255,255,0.7);
    transition: color 0.3s;
}
.nav-overlay__menu a:hover { color: #D4AF37; }

/* ========== HERO ========== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.hero-title {
    font-size: clamp(2.5rem, 8vw, 6rem);
    background: linear-gradient(135deg, #FFFFFF, #D4AF37);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 1.5rem;
}
.hero-description {
    max-width: 600px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.6;
}
.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    padding: 0.9rem 2rem;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.4s ease;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.9rem;
}
.btn-outline {
    border: 1px solid rgba(212,175,55,0.4);
    color: white;
    background: transparent;
}
.btn-outline:hover {
    border-color: #D4AF37;
    background: rgba(212,175,55,0.1);
    transform: translateY(-2px);
}
.btn-primary {
    background: #D4AF37;
    color: #000;
    border: none;
}
.btn-primary:hover {
    background: #c49a1f;
    transform: translateY(-2px);
}

/* ========== SERVICES ========== */
.services-section {
    padding: 6rem 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
}
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.service-card {
    background: rgba(20,20,25,0.5);
    backdrop-filter: blur(12px);
    border-radius: 32px;
    padding: 2rem;
    border: 1px solid rgba(212,175,55,0.1);
    transition: all 0.4s ease;
    text-align: center;
}
.service-card:hover {
    transform: translateY(-10px);
    border-color: rgba(212,175,55,0.3);
    background: rgba(20,20,25,0.7);
}
.service-card i {
    font-size: 2.5rem;
    color: #D4AF37;
    margin-bottom: 1rem;
}
.service-card h3 { margin-bottom: 1rem; }
.service-card p  { color: rgba(255,255,255,0.6); line-height: 1.6; }

/* ========== CINEMATIC GALLERY ========== */
.gallery-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}
.gallery {
    position: relative;
    width: 100%;
    height: 100%;
    flex: none;
}
.gallery__item {
    background-position: 50% 50%;
    background-size: cover;
    overflow: hidden;
    border-radius: 24px;
    transition: border-radius 0.3s ease;
}
.gallery__item img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
    /* Lazy-loading hint: keep will-change off until hovered */
}
.gallery--bento {
    display: grid;
    gap: 1vh;
    grid-template-columns: repeat(3, 32.5vw);
    grid-template-rows: repeat(4, 23vh);
    justify-content: center;
    align-content: center;
}
.gallery--final.gallery--bento {
    grid-template-columns: repeat(3, 100vw);
    grid-template-rows: repeat(4, 49.5vh);
    gap: 1vh;
}
.gallery--final .gallery__item { border-radius: 0; }
.gallery--bento .gallery__item:nth-child(1) { grid-area: 1 / 1 / 3 / 2; }
.gallery--bento .gallery__item:nth-child(2) { grid-area: 1 / 2 / 2 / 3; }
.gallery--bento .gallery__item:nth-child(3) { grid-area: 2 / 2 / 4 / 3; }
.gallery--bento .gallery__item:nth-child(4) { grid-area: 1 / 3 / 3 / 3; }
.gallery--bento .gallery__item:nth-child(5) { grid-area: 3 / 1 / 3 / 2; }
.gallery--bento .gallery__item:nth-child(6) { grid-area: 3 / 3 / 5 / 4; }
.gallery--bento .gallery__item:nth-child(7) { grid-area: 4 / 1 / 5 / 2; }
.gallery--bento .gallery__item:nth-child(8) { grid-area: 4 / 2 / 5 / 3; }

/* ========== 3D SECTIONS ========== */
.arch-3d-section,
.testimonials-section {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
    overflow: hidden;
}

/* Loading placeholder shown before Three.js inits */
.arch-3d-section::before,
.testimonials-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, #0d0d1a 0%, #000 100%);
    z-index: 1;
    pointer-events: none;
}

#arch-3d-canvas,
#testimonials-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    z-index: 5;
}

.arch-3d-text {
    position: absolute;
    top: 8%;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    color: white;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

/* ========== HORIZONTAL SLIDER ========== */
.horizontal-slider-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #000;
}
.slider-container {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
}
.slider-container:active { cursor: grabbing; }
.slider-track {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    height: 100%;
    align-items: center;
    padding: 0 2rem;
    will-change: transform;
}
.slide {
    flex: 0 0 70vw;
    height: 70vh;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 40px -12px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}
.slide:hover { transform: scale(1.02); }
.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}
.slider-text {
    position: absolute;
    top: 15%;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    color: white;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.slider-text .section-title { color: white; }

/* ========== TESTIMONIALS ========== */
.testimonials-text {
    position: absolute;
    top: 10%;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 20;
    pointer-events: none;
    color: white;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

/* ========== BEFORE / AFTER ========== */
.panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
}
.comparisonSection {
    position: relative;
    padding-bottom: 56.25%;
}
.comparisonImage {
    width: 100%;
    height: 100%;
}
.afterImage {
    position: absolute;
    overflow: hidden;
    top: 0;
    transform: translate(100%, 0px);
}
.afterImage img {
    transform: translate(-100%, 0px);
}
.comparisonImage img {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
}

/* ========== CONTACT ========== */
.contact-section {
    padding: 6rem 0;
    text-align: center;
}
.section-subtitle {
    max-width: 700px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}
.social-links a {
    color: rgba(255,255,255,0.5);
    font-size: 1.5rem;
    transition: color 0.3s;
}
.social-links a:hover { color: #D4AF37; }

/* ========== FOOTER ========== */
.site-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid rgba(212,175,55,0.1);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.4);
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    #bg-canvas { display: none; }
}

/* ========== MOBILE (max 768px) ========== */
@media (max-width: 768px) {
    .container { padding: 0 1.5rem; }

    .hero-title { font-size: clamp(2rem, 10vw, 3.5rem); }
    .hero-description { font-size: 1rem; padding: 0 1rem; }
    .hero-cta { flex-direction: column; align-items: center; gap: 1rem; }
    .btn { width: 220px; text-align: center; padding: 0.8rem 1.5rem; font-size: 0.85rem; }

    .services-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .service-card  { padding: 1.5rem; }

    .gallery--bento {
        gap: 0.5vh;
        grid-template-rows: repeat(4, 18vh);
    }

    /* Disable 3D heavy scenes on small mobile */
    .arch-3d-section { height: 60vh; }
    .testimonials-section { height: 60vh; }

    .arch-3d-text { top: 5%; padding: 0 1rem; }
    .arch-3d-text h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .arch-3d-text p  { font-size: 0.8rem; }

    .slide { flex: 0 0 85vw; height: 45vh; }
    .slider-track { padding: 0 1rem; }
    .slide-caption { font-size: 1rem; padding: 1rem; }
    .slider-text { top: 8%; }
    .slider-text h2 { font-size: 1.8rem; }

    .testimonials-text { top: 3%; padding: 0 1rem; }
    .testimonials-text h2 { font-size: 1.5rem; }
    .testimonials-text p  { font-size: 0.8rem; }

    .contact-section { padding: 4rem 0; }
    .contact-section .section-title { font-size: 2rem; }
    .section-subtitle { font-size: 1rem; padding: 0 1rem; }

    .site-footer { padding: 1.5rem; font-size: 0.7rem; }

    .nav-overlay__menu a { font-size: 1.8rem; }
    .menu-btn { top: 1.5rem; right: 1.5rem; width: 35px; height: 35px; }
    .menu-btn__burger,
    .menu-btn__burger::before,
    .menu-btn__burger::after { width: 25px; }
}

/* ========== TABLET (769–1024px) ========== */
@media (min-width: 769px) and (max-width: 1024px) {
    .container { padding: 0 2rem; }
    .slide { flex: 0 0 60vw; height: 55vh; }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 4rem; }
}

/* ========== LARGE SCREENS ========== */
@media (min-width: 1400px) {
    .container { max-width: 1400px; }
    .slide { flex: 0 0 60vw; }
}


/* Mobile performance overrides */
@media (max-width: 768px) {
    /* Disable grain overlay on mobile – heavy for GPU */
    #grain-overlay {
        display: none;
    }
    
    /* Reduce gallery animation complexity */
    .gallery--bento {
        gap: 0.5vh;
        transition: none;
    }
    
    /* Simplify slider */
    .slider-track {
        gap: 0.5rem;
    }
    
    .slide {
        transition: none;
    }
    
    /* Disable hover effects on mobile */
    .service-card:hover,
    .slide:hover,
    .portfolio-item:hover,
    .service-card-large:hover {
        transform: none;
    }
}