.project-card img {
    image-rendering: auto;
}
/* GALLERY MODAL OVERLAY */
#gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 0.3s;
}

.gallery-viewer {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    padding: 24px 32px 32px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 840px;
    height: 744px;
    max-width: 94vw;
    max-height: 90vh;
}

.gallery-image-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 18px;
    width: 100%;
    flex: 1;
    min-height: 0;
    touch-action: pan-y;
}

.gallery-large-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    background: #f3f3f3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: block;
}

@media (max-width: 600px) {
    #gallery-modal {
        padding-top: 10vw;
    }
    .gallery-large-img {
        max-width: 98vw;
        max-height: 60vw;
    }
    .gallery-viewer {
        max-width: 100vw;
        width: 100vw;
        height: auto;
        padding: 0 0 10vw 0;
    }
    .gallery-image-area {
        flex: unset;
        min-height: unset;
    }
    .gallery-title, .gallery-desc {
        max-width: 95vw;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        width: 100vw;
        margin: 16px auto 0 auto;
    }
    .project-card {
        width: 98vw;
    }
    .project-card img {
        width: 98vw;
        height: 120px;
    }
    .project-card h3 {
        font-size: 16px;
        margin: 0;
        padding: 14px 12px;
        line-height: 1.3;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        min-height: 45px;
    }
    .topnav {
        padding: 8px 8px;
        font-size: 16px;
        flex-direction: column;
        align-items: flex-start;
    }
    .gallery-header {
        gap: 24px;
        height: 40px;
            width: 422px;
            height: 290px;
        font-size: 18px;
        height: 100%;
    }
    .gallery-header .gallery-prev,
    .gallery-header .gallery-next {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

.gallery-prev, .gallery-next {
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    color: #444;
    cursor: pointer;
    transition: background 0.2s;
}
.gallery-prev:hover, .gallery-next:hover {
    background: #ddd;
}

.close-modal {
    position: fixed;
    top: 0;
    right: 5px;
    background: none;
    border: none;
    font-size: 40px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2100;
}
.close-modal:hover {
    color: #222;
}

.gallery-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #222;
    text-align: center;
}
.gallery-desc {
    font-size: 15px;
    color: #555;
    margin-bottom: 8px;
    text-align: center;
    max-width: 420px;
}

.gallery-header {
    display: flex;
    align-items: center; /* vertical centering */
    justify-content: center;
    gap: 60px;
    margin-top: 18px;
    margin-bottom: 12px;
    height: 56px; /* Match arrow height for perfect vertical alignment */
}

.gallery-header .gallery-title {
    flex: 1;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    color: #222;
    display: flex;
    align-items: center;    /* vertical centering */
    justify-content: center; /* horizontal centering */
    height: 100%; 
    margin-top: 15px;           /* Fill header height */
}

.gallery-header .gallery-prev,
.gallery-header .gallery-next {
    background: #eee;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    font-size: 32px; /* Larger arrow */
    color: #444;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-header .gallery-prev:hover,
.gallery-header .gallery-next:hover {
    background: #ddd;
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .gallery-header {
        gap: 0;
    }

    .gallery-header .gallery-prev,
    .gallery-header .gallery-next {
        display: none;
    }

    .gallery-header .gallery-title {
        margin-top: 0;
    }

    .gallery-viewer {
        width: min(94vw, 760px);
        height: auto;
        padding: 16px;
    }

    .close-modal {
        display: none;
    }

    .gallery-large-img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 60vh;
    }

    .gallery-image-area {
        flex: unset;
        min-height: unset;
        margin-bottom: 12px;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.hero-section {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-top: 18px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 32px;
    width: 90%;
    padding: 0 5px;
}

.logo {
    width: 460px;
    height: 468px;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.intro {
    flex: 1;
}

.intro h1 {
    font-size: 36px;
    margin-bottom: 20px;
    line-height: 1.4;
}

.intro p {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
}

body {
    --nav-offset-top: 20px;
    --nav-collapsed-height: 78px;
    --nav-content-gap: 20px;
    padding-top: calc(var(--nav-offset-top) + var(--nav-collapsed-height) + var(--nav-content-gap));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

body.gallery-scroll-locked {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    touch-action: none;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.topnav {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,30,30,0.9);
    backdrop-filter: blur(8px);
    padding: 25px 45px;
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    z-index: 1000;
}

/* Logo Bubble */
.logo-bubble {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #ccc;
    font-size: 24px;
}

.logo-bubble a {
    color: #ccc;
    text-decoration: none;
    font-size: inherit;
}

.menu-toggle {
    display: none;  /* desktop hides button */
    background: none;
    border: none;
    color: white;
    margin-left: 10px;
}

.menu-toggle-bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform-origin: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 40px;
}

/* Subtle Fade + Slide Underline */
.nav-links a {
    position: relative;
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 21px;
}

/* underline */
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;                 /* starts slightly lower */
    width: 100%;
    height: 2px;
    background-color: white;

    opacity: 0;                   /* hidden */
    transform: translateY(4px);   /* slight downward offset */
    transition: 
        opacity 0.25s ease,
        transform 0.25s ease;
}

/* hover + active */
.nav-links a:hover,
.nav-links a.active {
    color: white;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    opacity: 1;
    transform: translateY(0);     /* slides into place */
}

/* Override visited link colors */
.nav-links a:visited,
.logo-bubble a:visited,
.nav-links a:active,
.logo-bubble a:active {
    color: #ccc;
}

.nav-links a:visited:hover,
.logo-bubble a:visited:hover,
.nav-links a:active:hover,
.logo-bubble a:active:hover {
    color: white;
}



/* MAIN CONTENT */
.content {
    padding: 30px 20px;
    flex: 1;
}

.contact-page .content {
    padding: 0 0 30px 0;
}

@media (min-width: 1025px) {
    .contact-page .contact-layout {
        gap: 28px;
    }

    .contact-page .contact-panel {
        padding: clamp(18px, 2.2vw, 24px);
    }
}

.contact-layout {
    width: 90%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(20px, 4vw, 48px);
    align-items: stretch;
}

.contact-panel {
    border-radius: 18px;
    padding: clamp(22px, 3vw, 34px);
    background: transparent;
    box-shadow: none;
}

.contact-panel h1,
.contact-panel h2 {
    font-size: clamp(28px, 3vw, 36px);
    color: #222;
    margin-bottom: 16px;
    line-height: 1.2;
}

.contact-panel p {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 4px;
}

.contact-panel p:last-child {
    margin-bottom: 0;
}

.contact-panel a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.contact-panel a:hover {
    text-decoration: none;
}

.contact-left {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contact-layout > .contact-panel p {
    margin-bottom: 20px;
}

.contact-layout > .contact-panel p:last-child {
    margin-bottom: 0;
}

.billing-section h2,
.availability-section h2 {
    font-size: clamp(28px, 3vw, 36px);
    color: #222;
    margin-bottom: 16px;
    line-height: 1.2;
}

.billing-section p,
.availability-section p {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 12px;
}

.billing-section p:last-child,
.availability-section p:last-child {
    margin-bottom: 0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(36px, 6vw, 100px);
    row-gap: 40px;
    margin-left: auto;
    margin-right: auto;
    width: 90%;
    justify-content: center;
    justify-items: center;
}

.card {
    width: clamp(220px, 24vw, 320px);   /* fluid with viewport */
    height: 220px;  /* Match preview image height */
    padding: 0;
    margin: 0;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 50px;
    box-shadow: none;
    background: transparent;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: none;
}

.card p {
    margin-top: 20px;
    font-size: 18px;
    color: #333;
    text-align: center;
    font-weight: 600;
}

/* SERVICES */
.service-list {
    list-style: none;
    margin-top: 20px;
}

.service-list li {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

/* GALLERY */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 48px;
    margin-top: 30px;
    align-items: stretch;
    justify-content: center;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.project-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 24px 0 rgba(30,30,60,0.10), 0 1.5px 6px 0 rgba(0,0,0,0.04);
    border: 1.5px solid #ececec;
    transition: transform 0.22s cubic-bezier(.4,0,.2,1), box-shadow 0.22s cubic-bezier(.4,0,.2,1), border-color 0.22s;
    cursor: pointer;
    margin-bottom: 0;
    position: relative;
    min-height: 235px;
}

.project-card:hover {
    transform: translateY(-7px) scale(1.025);
    box-shadow: 0 8px 32px 0 rgba(30,30,60,0.16), 0 2px 8px 0 rgba(0,0,0,0.08);
    border-color: #d1d1d1;
}

.project-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    background: #f5f5f5;
    image-rendering: auto;
    transition: filter 0.22s;
    filter: brightness(0.98) contrast(1.04) saturate(1.08);
}

.project-card h3 {
    margin: 0;
    padding: 18px 18px;
    font-size: 20px;
    color: #232323;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 #fff, 0 0.5px 1.5px rgba(0,0,0,0.04);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 50px;
}


.project-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.icon {
    width: 160px;
    height: 160px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* WHY CHOOSE US */
.why-us-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(12px, 2vw, 24px);
    margin-top: 28px;
}

.why-us-grid-tablet {
    display: none;
}

.why-us-item {
    background: transparent;
    border-radius: 16px;
    padding: 36px 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.why-us-item h3 {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.why-us-item p {
    font-size: 18px;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
    border-top: 1px solid #ddd;
}

footer p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .home-page {
        --tablet-home-section-gap: 24px;
    }
    .hero-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 24px;
        width: 90%;
        margin-top: 18px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: var(--tablet-home-section-gap);
        padding: 0 5px;
    }
    .logo {
        width: 285px;
        height: 290px;
        grid-column: 1;
        grid-row: 1;
        margin: 0 auto;
    }
    .intro {
        grid-column: 2;
        grid-row: 1;
        position: relative;
    }
    .intro .why-us-grid {
        display: none;
    }
    .why-us-grid-tablet {
        display: grid;
        width: 90%;
        margin: 0 auto var(--tablet-home-section-gap) auto;
    }
    .home-page footer {
        margin-top: var(--tablet-home-section-gap);
    }
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 90%;
        margin: 0 auto;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }
    .contact-layout {
        gap: 24px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .home-page {
        --tablet-home-section-gap: 24px;
    }
    .hero-section {
        gap: 28px;
        margin-bottom: var(--tablet-home-section-gap);
    }
    .logo {
        width: 325px;
        height: 331px;
    }
    .cards-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 90%;
        margin: 0 auto;
    }
    .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .why-us-item {
        padding: 24px 48px;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
    .home-page footer {
        margin-top: var(--tablet-home-section-gap);
    }
}

@media (max-width: 768px) {

    body {
        --nav-collapsed-height: 50px;
    }

    .home-page {
        --mobile-home-section-gap: 24px;
    }

    /* Topnav bubble layout */
    .topnav {
        --mobile-nav-radius-collapsed: 50px;
        --mobile-nav-radius-expanded: 24px;
        --mobile-nav-transition-duration: 0.42s;
        --mobile-nav-transition-ease: linear;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;

        padding: 15px 20px;
        border-radius: 24px;
        background: rgba(30,30,30,0.9);

        overflow: hidden;
        transform-origin: center center;
        max-height: 50px; /* collapsed bubble height */
        will-change: max-height;
        transition: max-height var(--mobile-nav-transition-duration) var(--mobile-nav-transition-ease);
        margin: 0 auto;
    }

    .topnav.expanded {
        max-height: 280px; /* fit menu content */
    }

    /* Logo bubble stays one line and centered */
    .logo-bubble {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        width: 100%;
        white-space: nowrap;
    }

    .logo-bubble a {
        font-size: 21px;
        margin-left: 0;
        line-height: 1;
        margin-right: 10px;
        margin-bottom: 3px;
        pointer-events: none;
        cursor: default;
    }

    /* Hamburger button visible on mobile */
    .menu-toggle {
        display: grid;
        place-items: center;
        align-content: center;
        justify-items: center;
        position: absolute;
        top: 50%;
        right: 3px;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        padding: 0;
        gap: 5px;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        line-height: 1;
        margin: 0;
    }

    .topnav.expanded .menu-toggle .menu-toggle-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .topnav.expanded .menu-toggle .menu-toggle-bar:nth-child(2) {
        opacity: 0;
    }

    .topnav.expanded .menu-toggle .menu-toggle-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Nav links hidden initially */
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;

        opacity: 0;
        transform: scaleY(0.8);
        transform-origin: center;
        transition:
            opacity calc(var(--mobile-nav-transition-duration) + 0.08s) ease,
            transform calc(var(--mobile-nav-transition-duration) + 0.08s) ease;
        margin-top: 0;
        pointer-events: none;
    }

    /* Show nav links when expanded */
    .topnav.expanded .nav-links {
        opacity: 1;
        transform: scaleY(1);
        margin-top: 8px;
        pointer-events: auto;
    }

    /* Individual link styling */
    .nav-links a {
        padding: 10px 0;
        color: white;
        text-decoration: none;
        font-size: 21px;
    }

    /* Show current page link on mobile */
    .nav-links a.current-link {
        display: block;
    }

    .logo {
        width: 290px;
        height: 296px;
        justify-content: center;
        margin-left: auto;
        margin-right: auto;
        margin-top: 8px;
    }

    .logo img {
        width: 250px;
        height: 255px;
        object-fit: contain;
    }

    .hero-section {
        display: flex;
        flex-direction: column;
        gap: 30px;
        align-items: center;
        margin-top: 12px;
        margin-left: 0;
        margin-right: 0;
        padding: 0 20px;
        width: 100%;
    }

    .intro h1 {
        font-size: 28px;
        margin-bottom: 15px;
        line-height: 1.4;
    }

    .intro p {
        font-size: 14px;
    }

    .intro {
        text-align: center;
        flex: none;
    }

    .hero-section {
        margin-bottom: var(--mobile-home-section-gap);
    }

    .home-page .content {
        padding-top: 0;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 90%;
        margin: 0 auto;
        padding: 0;
        column-gap: clamp(12px, 3vw, 20px);
        row-gap: 16px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        width: 80%;
        gap: 16px;
    }

    .contact-panel {
        padding: 22px 18px;
    }

    .contact-panel h1,
    .contact-panel h2 {
        font-size: 30px;
    }

    .contact-panel p {
        font-size: 16px;
    }

    .billing-section h2 {
        font-size: 26px;
    }

    .card {
        padding: 12px 8px;
        width: 100%;
        height: auto;
    }

    .card p {
        font-size: 16px;
        margin-top: 12px;
    }

    .home-page .why-us-grid {
        grid-template-columns: repeat(2, 1fr);
        margin-top: var(--mobile-home-section-gap);
    }

    .why-us-item {
        padding: 14px 16px;
    }

    .icon {
        width: 130px;
        height: 130px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        width: 80%;           /* keep aligned with nav bubble on mobile too */
        margin-left: auto;
        margin-right: auto;
    }

    .project-card {
        margin-bottom: 20px;
    }
    
    .project-card h3 {
        font-size: 18px;
        margin: 0;
        padding: 16px 14px;
        line-height: 1.3;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        min-height: 48px;
    }
    
    #gallery .section-title {
        width: 80%;
        margin: 0 auto 10px auto;
        text-align: center;   /* center heading text on mobile */
    }

    .home-page footer {
        margin-top: var(--mobile-home-section-gap);
    }

    #gallery-modal .gallery-viewer {
        width: auto;
        max-width: 96vw;
        max-height: 95vh;
        padding: 6px 10px;
    }

    #gallery-modal .gallery-image-area {
        aspect-ratio: auto;
        height: auto;
        max-height: none;
        margin-bottom: 6px;
        transition: none;
    }

    #gallery-modal .gallery-image-area.is-portrait {
        height: auto;
        max-height: none;
    }

    #gallery-modal .gallery-image-area.is-landscape {
        height: auto;
        max-height: none;
    }

    #gallery-modal .gallery-large-img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 82vh;
        object-fit: contain;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .home-page {
        --mobile-home-section-gap: 24px;
    }

    .hero-section {
        flex-direction: row;
        align-items: flex-start;
        width: 90%;
        margin-left: auto;
        margin-right: auto;
        padding: 0;
        gap: 20px;
        margin-bottom: var(--mobile-home-section-gap);
    }

    .logo {
        width: 160px;
        height: 163px;
        margin: 0;
        flex-shrink: 0;
    }

    .logo img {
        width: 160px;
        height: 163px;
    }

    .intro {
        text-align: left;
    }

    .intro h1 {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .why-us-item {
        padding: 10px 12px;
    }

    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 90%;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        width: 90%;
    }
}

/* Keep "Recent Work" heading inside same bounds as top nav/gallery */
#gallery .section-title {
    width: 90%;
    margin: 0 auto 12px auto;
}

/* Tighten spacing between image and card title */










