/**
 * Spataro Home Improvements — site stylesheet
 * =============================================================================
 * HOW THIS FILE IS ORGANIZED
 * Read from top to bottom. Cascade matters: rules that appear later override
 * earlier ones when selectors have the same specificity. Media queries at the
 * bottom of the file progressively adjust layout for narrower viewports.
 *
 * TABLE OF CONTENTS
 *   1. Foundation      — Reset, html/body defaults, .container
 *   2. Header & nav    — Fixed header, frosted bar, desktop links, hamburger
 *   3. Hero & buttons  — Full-viewport hero, primary/secondary CTAs
 *   4. Services        — Stacked rows; image + overlapping card; mobile expand
 *   5. About           — Two-column story + team photos
 *   6. Gallery         — Responsive grid; opens lightbox (see script.js)
 *   7. Lightbox        — Full-screen image viewer controls
 *   8. Contact         — Phone, email, Instagram, service area grid
 *   9. Footer          — Brand, lists, copyright
 *  10. Media queries   — max-width: 1200px, 1024px, 768px, 480px (+ reduced motion)
 *  11. Motion & polish — @keyframes, fade-in on cards, icon hover effects
 *
 * SCRIPT COUPLING (script.js)
 *   - Toggles .navbar--past-hero and .nav-logo-img.scrolled on scroll
 *   - Sets --site-header-height for mobile drawer top alignment
 *   - Service row tap-to-expand and lightbox behavior
 * =============================================================================
 */

/* =============================================================================
   1. FOUNDATION
   -----------------------------------------------------------------------------
   Universal border-box sizing, base typography (Roboto stack), horizontal scroll
   clamp on body, and shared .container (max-width 1200px, horizontal padding).
   Smooth scrolling applies to anchor links site-wide.
   ============================================================================= */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    line-height: 1.5;
    color: #333;
    overflow-x: hidden;
    font-weight: 400;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =============================================================================
   2. HEADER & NAVIGATION
   -----------------------------------------------------------------------------
   .site-header: fixed shell (z-index 1000) wrapping <nav> and the <ul> menu.
   The menu is a *sibling* of .navbar (not nested) so its backdrop-filter does
   not stack inside the bar’s blur (see project history).

   .navbar: frosted strip over the hero; .navbar--past-hero (JS) switches to
   solid #F5F5F5 after the hero scrolls away.

   Desktop: .nav-menu is position absolute, right-aligned to the 1200px column.
   Mobile overrides live in section 10 (max-width: 768px): drawer, safe-area, --site-header-height.
   ============================================================================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    width: 100%;
    background: transparent;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

.navbar.navbar--past-hero {
    background: #F5F5F5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    min-height: 80px;
}

.nav-logo-img {
    position: absolute;
    left: 40%;
    top: 5%;
    width: 200px;
    height: auto;
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-logo-img.scrolled {
    width: 120px;
    position: relative;
    left: auto;
    top: auto;
    transform: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 50%;
    right: max(10px, calc((100vw - 1200px) / 2 + 10px));
    transform: translateY(-50%);
    z-index: 1002;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #2a2a2a;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

/* Desktop-only: after hero, nav links use brand blue (see .nav-link base for in-hero color). */
@media (min-width: 769px) {
    nav.navbar.navbar--past-hero + .nav-menu .nav-link {
        color: #2c3e50;
    }
}

.nav-link:hover {
    color: #9dadb7;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #9dadb7;
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    position: relative;
    z-index: 1002;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 3px 0;
    transition: 0.3s;
}

/* =============================================================================
   3. HERO & PRIMARY BUTTONS
   -----------------------------------------------------------------------------
   Full-viewport hero with fixed-parallax background (background-attachment:
   fixed — may be reduced on some mobile browsers). Negative margin-top pulls
   content under the fixed header. .btn-* are shared by hero CTAs and elsewhere.
   .hero-image / .hero-img / .placeholder-image: utility blocks if a split hero
   layout with a separate image column is used.
   ============================================================================= */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-image: url('img/hero_edit_3.jpeg?v=20260329a');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
    padding: 140px 0 80px;
    position: relative;
    margin-top: -60px;
}

/* iOS WebKit: fixed backgrounds + cover are unreliable; other platforms unchanged. */
@supports (-webkit-touch-callout: none) {
    .hero {
        background-attachment: scroll;
    }
}

.hero-content {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
    animation: slideInLeft 1s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    animation: slideInLeft 1s ease-out 0.2s both;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: slideInLeft 1s ease-out 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    animation: slideInLeft 1s ease-out 0.6s both;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: #9dadb7;
    color: white;
}

.btn-primary:hover {
    background: #8B4513;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 69, 19, 0.3);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #2c3e50;
    transform: translateY(-2px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.hero-img:hover {
    transform: scale(1.02);
}

.placeholder-image {
    background: rgba(139, 69, 19, 0.1);
    border: 2px dashed rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    padding: 3rem;
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.placeholder-image i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
    color: #9dadb7;
}

.placeholder-image p {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #2c3e50;
}

/* =============================================================================
   4. SERVICES
   -----------------------------------------------------------------------------
   Vertical stack of .service-row blocks. Desktop: full-bleed image with a
   white .service-card overlapping left or right (.service-row--card-left /
   --card-right). .service-row-media uses display:contents on desktop so the
   image and content participate in the row grid flow.

   Mobile (section 10): .service-row-media becomes a real box; tap the bottom bar to
   expand .service-card-body; script.js adjusts row min-height when expanded.
   ============================================================================= */

.services {
    padding: 100px 0 120px;
    background: #F5F5F5;
    overflow: hidden;
}

.container--services {
    max-width: 1100px;
}

.services h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 3rem;
    color: #2c3e50;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.services-rows {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* One row: background image + overlapping white card (desktop). */
.service-row {
    position: relative;
    min-height: 420px;
    border-radius: 8px;
    overflow: visible;
    padding: 0;
}

/* display:contents (desktop) = children slot into parent; block (mobile) = card stack. */
.service-row-media {
    display: contents;
}

/* Unwrap head/body for desktop overlap; mobile (10c) sets display:block on both. */
.service-card-head,
.service-card-body {
    display: contents;
}

.service-row-image {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 8px;
    overflow: hidden;
}

.service-row-image img {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
    display: block;
}

/* Flex row positions .service-card left or right per modifiers below. */
.service-row-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 420px;
    padding: 2rem 0;
}

.service-row--card-left .service-row-content {
    justify-content: flex-start;
    padding-left: 0;
    margin-left: -5rem;
}

.service-row--card-right .service-row-content {
    justify-content: flex-end;
    padding-right: 0;
    margin-right: -5rem;
}

.service-card {
    width: 100%;
    max-width: 480px;
    background: white;
    padding: 2.5rem 3rem;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-top: 4px solid #9dadb7;
    min-height: 320px;
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #9dadb7, #8B4513);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon i {
    font-size: 1.5rem;
    color: white;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.service-card p {
    margin-bottom: 1.5rem;
    color: #666;
}

.service-card ul {
    list-style: none;
}

.service-card li {
    padding: 0.5rem 0;
    color: #666;
    position: relative;
    padding-left: 1.5rem;
}

.service-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #9dadb7;
    font-weight: bold;
}

/* Shown only in mobile expanded state (breakpoint 10c); tap hint on collapsed bar. */
.service-details-close {
    display: none;
}

.service-tap-hint {
    display: none;
}

/* =============================================================================
   5. ABOUT
   -----------------------------------------------------------------------------
   Two-column grid: copy + feature checklist, and .team-photos (Marco + team).
   Wide screens: overlapping absolute-positioned photos. ≤1200px: second image
   (.team-photo-desktop-only) hidden; single centered photo (see section 10).
   ============================================================================= */

.about {
    padding: 100px 0;
    background: linear-gradient(
        to right,
        #ffffff 0%,
        #ffffff 75%,
        #2c3e50 75%,
        #2c3e50 100%
    );
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.team-photos {
    position: relative;
    width: 100%;
    min-height: clamp(420px, 46vw, 560px);
    margin: 0 auto;
}

.team-photos > .team-photo:first-child {
    position: absolute;
    width: 76%;
    max-width: 500px;
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
    top: 3%;
    left: 0;
    z-index: 1;
    object-fit: cover;
    object-position: center 22%;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.team-photos > .team-photo-desktop-only {
    position: absolute;
    width: 76%;
    max-width: 500px;
    aspect-ratio: 4 / 3;
    height: auto;
    min-height: 0;
    bottom: 2%;
    right: -12rem;
    z-index: 2;
    object-fit: cover;
    object-position: center 78%;
    border-radius: 8px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.18);
}

.team-photo {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.about-text h2 {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
    line-height: 1.8;
}

.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature i {
    color: #9dadb7;
    font-size: 1.2rem;
}

.feature span {
    font-weight: 500;
    color: #2c3e50;
}

/* =============================================================================
   6. GALLERY
   -----------------------------------------------------------------------------
   Auto-fit minmax grid of .gallery-item; images are object-fit cover. Click
   opens #lightbox (controlled in script.js). .placeholder-image rules support
   optional placeholder tiles if used in markup.
   ============================================================================= */

.gallery {
    padding: 100px 0;
    background: #F5F5F5;
}

.gallery h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gallery > .container > p {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: #666;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    aspect-ratio: 4/3;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease;
    border: 1px solid #e0e0e0;
    cursor: pointer;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item .placeholder-image {
    height: 100%;
    background: linear-gradient(135deg, #E1E1E1, #C0C0C0);
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gallery-item .placeholder-image i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #9dadb7;
}

/* =============================================================================
   7. LIGHTBOX
   -----------------------------------------------------------------------------
   Fixed overlay (#lightbox) below nav z-index. .is-open toggled by JS; prev/
   next/close are absolutely positioned. Image is max 95vh for letterboxing.
   ============================================================================= */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10001;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10001;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* =============================================================================
   8. CONTACT
   -----------------------------------------------------------------------------
   Centered .contact-info with a 2×2 .contact-grid of phone, email, Instagram,
   service area. Links use brand accent colors; no form — tel/mailto only.
   ============================================================================= */

.contact {
    padding: 100px 0;
    background: white;
}

.contact h2 {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact > .container > p {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    color: #666;
}

.contact-content {
    display: flex;
    justify-content: center;
    max-width: 720px;
    margin: 0 auto;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem 3rem;
    align-items: start;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0;
}

.contact-item i {
    font-size: 1.5rem;
    color: #9dadb7;
    margin-top: 0.2rem;
}

.contact-item h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.contact-item p {
    color: #666;
}

.contact-item a {
    color: #9dadb7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: #8B4513;
}

/* =============================================================================
   9. FOOTER
   -----------------------------------------------------------------------------
   Dark band (#2c3e50): multi-column .footer-content, then .footer-bottom rule.
   ============================================================================= */

.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: #E1E1E1;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: #bdc3c7;
}

.footer-section p {
    color: #bdc3c7;
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* =============================================================================
   10. RESPONSIVE BREAKPOINTS
   -----------------------------------------------------------------------------
   max-width: 1200px — Hide overlapping team shot; simplify about photos.
   max-width: 1024px — Tighter service rows (image insets, shorter min-heights).
   max-width: 768px — Mobile nav drawer, hero stack, services as tap-expand cards,
                       gallery 2 columns, contact/features single column.
   max-width: 480px — Tighter nav/hero/type; smallest service card titles.

   Nested inside 768px: prefers-reduced-motion shortens service panel transition.
   ============================================================================= */

/* --- 10a. ≤1200px: about team layout --- */
@media (max-width: 1200px) {
    .team-photo-desktop-only {
        display: none;
    }

    .team-photos {
        min-height: 0;
    }

    .team-photos > .team-photo:first-child {
        position: relative;
        width: 100%;
        max-width: 500px;
        top: auto;
        left: auto;
        margin: 0 auto;
        aspect-ratio: 4 / 3;
    }
}

/* --- 10b. ≤1024px: service row density --- */
@media (max-width: 1024px) {
    .service-row {
        min-height: 360px;
        padding: 0 1rem;
    }
    .service-row-image {
        inset: 0 1rem 0 1rem;
    }
    .service-row-content {
        min-height: 360px;
        justify-content: center;
        margin-left: 0;
        margin-right: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .service-card {
        max-width: 100%;
    }
    .service-row-image img {
        min-height: 360px;
    }
}

/* --- 10c. ≤768px: mobile navigation, section stacks, service overlays --- */
@media (max-width: 768px) {
    .site-header {
        padding-top: env(safe-area-inset-top, 0px);
    }

    /* Drawer z-index: entire .navbar (logo + bar) above .nav-menu so the open panel
       does not paint over the centered logo; see script --site-header-height. */
    nav.navbar {
        position: relative;
        z-index: 1002;
    }

    .nav-link {
        color: #2c3e50;
    }

    .hamburger {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1003;
    }

    .navbar {
        padding: 1.5rem 0;
        min-height: 100px;
    }

    .nav-container {
        min-height: 60px;
    }

    .nav-menu {
        position: fixed;
        right: -100%;
        top: var(--site-header-height, 112px);
        transform: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        z-index: 1;
        background: transparent;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: right 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease,
            -webkit-backdrop-filter 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.08);
        padding: 2rem 0;
    }

    nav.navbar.navbar--past-hero + .nav-menu {
        background: #F5F5F5;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .nav-menu.active {
        right: 0;
        top: var(--site-header-height, 112px);
        padding-top: 4.251rem;
        z-index: 1;
        margin-top: 0;
        /* Let taps pass through the panel except on links so pointerdown reaches the page and JS can close the drawer. */
        pointer-events: none;
        transition: right 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease,
            -webkit-backdrop-filter 0.3s ease, padding-top 0.3s ease;
    }

    .nav-menu.active .nav-item {
        pointer-events: auto;
    }

    /* Compact header: once .nav-logo-img.scrolled (script.js, scroll > 50px). */
    nav.navbar:has(.nav-logo-img.scrolled) + .nav-menu.active {
        padding-top: 1rem;
    }

    .nav-logo-img {
        width: 150px;
        top: 45%;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1003;
    }

    .nav-logo-img.scrolled {
        width: 100px;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding: 250px 0 60px;
        margin-top: -40px;
    }

    .hero-content {
        margin-left: 0;
        padding: 0 2rem;
        margin-bottom: 2rem;
    }

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

    .hero-buttons {
        justify-content: center;
    }

    .about {
        background: #ffffff;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .team-photos {
        min-height: 0;
    }

    .team-photos > .team-photo:first-child {
        position: relative;
        width: 100%;
        max-width: none;
        aspect-ratio: unset;
        top: auto;
        left: auto;
        inset: auto;
        z-index: auto;
        transform: none;
        min-height: 220px;
        height: auto;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    }

    .team-photo {
        min-height: 220px;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

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

    .services-rows {
        gap: 3rem;
    }
    .service-card {
        min-height: auto;
        padding: 2rem;
    }

    /* Services: image + bottom bar live in .service-row-media; body expands below. */
    .service-row-media {
        display: block;
        position: relative;
        height: 240px;
        border-radius: 8px;
        overflow: visible;
    }

    .service-card-head,
    .service-card-body {
        display: block;
    }

    .service-row {
        position: relative;
        min-height: 240px;
        cursor: pointer;
        overflow: visible;
    }
    .service-row-image {
        position: absolute;
        inset: 0;
        border-radius: 8px;
        overflow: hidden;
    }
    .service-row-image img {
        width: 100%;
        height: 100%;
        min-height: 240px;
        object-fit: cover;
    }
    .service-row-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        min-height: 0;
        width: 100%;
        max-width: 100%;
        padding: 1rem 1.25rem;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4));
        color: #fff;
        align-items: flex-end;
        justify-content: flex-start;
        box-sizing: border-box;
        /* visible so the panel (absolute; top:100%) isn’t clipped on collapse — overflow:hidden
           made the card vanish instantly when expanded class was removed */
        overflow: visible;
    }

    /* Mobile-only: undo desktop card-left/card-right offsets so all four overlays match */
    .service-row--card-left .service-row-content,
    .service-row--card-right .service-row-content {
        margin-left: 0;
        margin-right: 0;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
        left: 0;
        right: 0;
        justify-content: flex-start;
    }
    .service-row-content .service-card {
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: 100%;
        min-width: 0;
        /* Inline transform (scroll/hover JS) makes this a containing block and breaks
           top:100% on .service-card-body — panel must anchor to full overlay bar */
        transform: none !important;
    }
    .service-row-content .service-card:hover {
        transform: none !important;
    }
    /* Icon + title + hint in a tight row (matches desktop branding on small screens) */
    .service-row-content .service-card-head {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        column-gap: 0.7rem;
        row-gap: 0.2rem;
        align-items: start;
    }
    .service-row-content .service-card-head .service-icon {
        grid-row: 1 / -1;
        align-self: start;
        width: 42px;
        height: 42px;
        min-width: 42px;
        margin-bottom: 0;
        flex-shrink: 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    }
    .service-row-content .service-card-head .service-icon i {
        font-size: 1.05rem;
    }
    .service-row-content .service-card-head h3 {
        grid-column: 2;
        margin-top: 0;
    }
    .service-row-content .service-card-head .service-tap-hint {
        grid-column: 2;
    }
    .service-row-content .service-card h3 {
        color: #fff;
        font-size: clamp(0.95rem, 2.5vw + 0.65rem, 1.1rem);
        line-height: 1.25;
        margin-bottom: 0.25rem;
        max-width: 100%;
        /* Wrap long titles instead of ellipsis — clearer on small phones */
        overflow-wrap: break-word;
    }
    .service-row--expanded .service-card-head {
        padding-right: 3rem; /* keep title clear of close (×) */
    }
    .service-tap-hint {
        display: block;
        font-size: 0.85rem;
        opacity: 0.9;
        margin-top: 0.25rem;
        max-width: 100%;
    }
    /* Always out of flow so collapsing max-height never stretches the bar to full image height */
    .service-row-content .service-card-body {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        margin-top: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
        transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.32s ease,
            margin-top 0.32s ease;
    }

    @media (prefers-reduced-motion: reduce) {
        .service-row-content .service-card-body {
            transition-duration: 0.01ms !important;
        }
    }
    .service-details-close {
        display: none;
    }

    /* Expanded: same bar overlay; white card drops below image.
       Vertical space below the card is set in JS to match actual panel height. */
    .service-row--expanded {
        cursor: default;
    }
    .service-row--expanded .service-row-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        padding: 1rem 1.25rem;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4));
        overflow: visible;
        margin-left: 0;
        margin-right: 0;
    }
    .service-row--expanded .service-details-close {
        display: flex;
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.2);
        border: none;
        border-radius: 50%;
        color: #fff;
        font-size: 1.75rem;
        line-height: 1;
        cursor: pointer;
        z-index: 10;
    }
    .service-row--expanded .service-card-body {
        margin-top: 0.5rem;
        max-height: min(70vh, 32rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        opacity: 1;
        pointer-events: auto;
        /* Same transition as collapsed state so collapse animates reliably */
        transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.32s ease,
            margin-top 0.32s ease;
        background: #fff;
        color: #333;
        padding: 1.5rem 1.25rem;
        border-radius: 8px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        border-top: 4px solid #9dadb7;
    }
    .service-row--expanded .service-card-body p {
        margin-bottom: 1rem;
        font-size: 0.95rem;
        color: #666;
    }
    .service-row--expanded .service-card-body ul {
        margin-bottom: 0;
        list-style: none;
    }
    .service-row--expanded .service-card-body li {
        padding: 0.5rem 0;
        padding-left: 1.5rem;
        position: relative;
        color: #666;
    }
    .service-row--expanded .service-card-body li::before {
        content: '✓';
        position: absolute;
        left: 0;
        color: #9dadb7;
        font-weight: bold;
    }
    .service-row--expanded .service-tap-hint {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* --- 10d. ≤480px: smallest phones --- */
@media (max-width: 480px) {
    .navbar {
        padding: 1rem 0;
        min-height: 80px;
    }

    .nav-container {
        min-height: 50px;
    }

    .hero {
        padding: 280px 0 60px;
        margin-top: -30px;
    }

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

    .hero p {
        font-size: 1rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }

    .services h2,
    .about-text h2,
    .gallery h2,
    .contact h2 {
        font-size: 2rem;
    }

    .nav-logo-img {
        width: 120px;
    }

    .nav-logo-img.scrolled {
        width: 80px;
    }

    .nav-logo-img {
        width: 120px;
        top: 40%;
        left: 50%;
        transform: translateX(-50%);
    }

    .service-row-content .service-card h3 {
        font-size: clamp(0.9rem, 4.2vw + 0.55rem, 1.05rem);
        line-height: 1.3;
    }
}

/* =============================================================================
   11. SCROLL ANIMATIONS, KEYFRAMES & HOVER POLISH
   -----------------------------------------------------------------------------
   .service-card, .gallery-item, .contact-item: initial fadeInUp (CSS) plus
   intersection observer in script.js fades them in on scroll (dual animation —
   intentional). Keyframes: fadeInUp, pulse (icon), slideInLeft (hero).

   Service icon hover: scale + pulse on .service-card:hover.
   ============================================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Entry animation on load (complements JS IntersectionObserver on same selectors). */
.service-card,
.gallery-item,
.contact-item {
    animation: fadeInUp 0.6s ease-out;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon i {
    animation: pulse 1s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1.2);
    }
}

/* Hero headline / subcopy / buttons — staggered via animation-delay on each rule. */
@keyframes slideInLeft {
    0% {
        opacity: 0;
        transform: translateX(-100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}
