/* ==========================================================================
   Designer Carpenter — styles.css
   Modern, warm, LIGHT-themed design with deep navy-blue accent.
   Mobile-first; progressively enhanced on larger screens.
   ========================================================================== */

/* ---------- Design tokens --------------------------------------------------*/
:root {
    /* Palette — cool-neutral light with deep navy-blue accent (matches DC logo) */
    --bg-0:         #ffffff;
    --bg-1:         #f5f6f8;
    --bg-2:         #eaecf0;
    --bg-3:         #d6dae1;
    --border:       rgba(20, 24, 40, 0.10);
    --border-2:     rgba(20, 24, 40, 0.18);

    --text:         #131722;
    --text-dim:     #4a5060;
    --text-muted:   #7a7f8d;

    --accent:       #1e3a8a;
    --accent-hi:    #2c52b8;
    --accent-soft:  rgba(30, 58, 138, 0.10);
    --accent-light: #cfe0ff; /* over dark hero photo */

    --success:      #2f7a47;
    --error:        #b3261e;

    /* Type */
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;

    /* Spacing */
    --container:    1240px;
    --gutter:       clamp(1rem, 4vw, 2rem);
    --section-y:    clamp(4rem, 10vw, 8rem);

    --radius-sm:    6px;
    --radius-md:    12px;
    --radius-lg:    20px;

    --shadow-1:     0 2px 12px rgba(20, 24, 40, 0.06);
    --shadow-2:     0 10px 40px rgba(20, 24, 40, 0.10);
    --shadow-3:     0 20px 60px rgba(20, 24, 40, 0.16);

    --ease:         cubic-bezier(.2,.7,.2,1);
}

/* ---------- Reset ----------------------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg-0);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    font-size: clamp(15px, 1.05vw, 17px);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -0.015em; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--accent); color: #fff; }

/* ---------- Custom scrollbar ----------------------------------------------*/
/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-1);
}
/* WebKit / Chromium / Safari / Edge */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--bg-1);
}
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border: 3px solid var(--bg-1);
    border-radius: 100px;
    min-height: 48px;
    transition: background .2s;
}
::-webkit-scrollbar-thumb:hover   { background: var(--accent-hi); }
::-webkit-scrollbar-thumb:active  { background: var(--accent-hi); }
::-webkit-scrollbar-corner        { background: var(--bg-1); }

/* Smaller scrollbar inside the textarea / form fields so it doesn't dominate */
textarea::-webkit-scrollbar { width: 8px; }
textarea::-webkit-scrollbar-thumb { border-width: 2px; }

/* ---------- Accessibility --------------------------------------------------*/
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: #fff;
    padding: .75rem 1rem;
    z-index: 999;
    font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- Layout primitives ----------------------------------------------*/
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.section {
    padding: var(--section-y) 0;
    position: relative;
}
.section + .section { border-top: 1px solid var(--border); }

.eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}
.accent { color: var(--accent); font-family: var(--font-display); font-style: italic; font-weight: 600; }
.section-heading { max-width: 780px; margin: 0 auto 4rem; text-align: center; }
.section-heading h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.08;
}
.section-lead { color: var(--text-dim); font-size: clamp(1rem, 1.2vw, 1.1rem); max-width: 640px; margin: 1.5rem auto 0; }
.subheading {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 500;
    margin-bottom: 2rem;
    text-align: center;
}

/* ---------- Buttons --------------------------------------------------------*/
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.6rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: 0.02em;
    transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease), box-shadow .25s var(--ease);
    line-height: 1.2;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
}
.btn-primary:hover {
    background: var(--accent-hi);
    border-color: var(--accent-hi);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(30, 58, 138, 0.30);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .75; cursor: wait; }
.btn-loader {
    width: 18px; height: 18px;
    border: 2px solid currentColor; border-right-color: transparent;
    border-radius: 50%;
    display: none;
    animation: spin .8s linear infinite;
}
.btn.is-loading .btn-loader { display: inline-block; }
.btn.is-loading .btn-label { opacity: .6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Header / Nav ---------------------------------------------------*/
.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 1rem 0;
    background: transparent;
    transition: background .3s var(--ease), backdrop-filter .3s var(--ease), padding .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header.is-scrolled {
    padding: .6rem 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-1);
}

/* When the header is transparent (top of hero), make nav/toggle legible on dark photo */
.site-header:not(.is-scrolled) .primary-nav a { color: rgba(255,255,255,.88); }
.site-header:not(.is-scrolled) .primary-nav a:hover { color: #fff; }
.site-header:not(.is-scrolled) .nav-toggle span { background: #fff; }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    line-height: 0;
    transition: transform .3s var(--ease);
}
.logo:hover { transform: translateY(-1px); }
.logo:hover .logo-mark { transform: rotate(-4deg) scale(1.04); }

/* ---- Logo monogram (transparent PNG, color-tinted via CSS mask) ----------
   Prominent on the hero. Shrinks back into the navbar as soon as the user scrolls.
   ---------------------------------------------------------------------------*/
.logo-mark {
    display: block;
    width: 180px;   /* BIG on the hero */
    height: 180px;
    background-color: #ffffff; /* white over dark hero photo */
    -webkit-mask-image: url('../img/brand/designer-carpenter-logo.png');
            mask-image: url('../img/brand/designer-carpenter-logo.png');
    -webkit-mask-size: contain;
            mask-size: contain;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    filter: drop-shadow(0 10px 32px rgba(0, 0, 0, 0.55));
    transition: background-color .45s var(--ease),
                width .45s var(--ease),
                height .45s var(--ease),
                filter .45s var(--ease),
                transform .3s var(--ease);
    will-change: width, height;
}
.site-header.is-scrolled .logo-mark {
    background-color: var(--accent); /* navy on the light scrolled header */
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 2px 8px rgba(30, 58, 138, 0.30));
}

.primary-nav ul {
    display: flex;
    gap: .25rem;
    align-items: center;
}
.primary-nav a {
    padding: .6rem 1rem;
    font-size: .9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    transition: color .2s;
    position: relative;
}
.primary-nav a::after {
    content: "";
    position: absolute;
    left: 1rem; right: 1rem; bottom: .3rem;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s var(--ease);
}
.primary-nav a:hover { color: var(--text); }
.primary-nav a:hover::after { transform: scaleX(1); }
.primary-nav .nav-cta {
    margin-left: .75rem;
    padding: .7rem 1.3rem;
    color: #fff !important;
    background: var(--accent);
    border-radius: 100px;
    font-weight: 600;
}
.primary-nav .nav-cta::after { display: none; }
.primary-nav .nav-cta:hover { background: var(--accent-hi); color: #fff !important; }

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: 8px;
    z-index: 101;
}
.nav-toggle span {
    width: 22px; height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform .3s var(--ease), opacity .2s, width .3s var(--ease), background .3s;
    transform-origin: center;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero -----------------------------------------------------------*/
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 14rem; /* big enough to clear the oversized DC in the header */
    padding-bottom: 4rem;
    overflow: hidden;
    color: #fff;
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(.6) saturate(1.05);
    transform: scale(1.05);
    animation: kenburns 20s ease-out infinite alternate;
}
@keyframes kenburns { from { transform: scale(1.05); } to { transform: scale(1.15); } }
.hero-overlay {
    position: absolute; inset: 0;
    background:
      radial-gradient(80% 60% at 50% 100%, rgba(10,14,26,0.85) 0%, transparent 70%),
      linear-gradient(180deg, rgba(10,14,26,0.35) 0%, rgba(10,14,26,0.85) 100%);
}
.hero-inner { position: relative; z-index: 1; max-width: 900px; }
.hero .eyebrow {
    background: linear-gradient(100deg, #7dd3fc 0%, #60a5fa 55%, #3b82f6 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(59, 130, 246, 0.45));
    font-weight: 700;
}
.hero h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.8rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.02;
    margin-bottom: 1.5rem;
    color: #fff;
}
.hero h1 .accent {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 30%, #3b82f6 65%, #6366f1 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 4px 24px rgba(59, 130, 246, 0.55));
}
.hero-sub {
    color: rgba(255,255,255,0.86);
    font-size: clamp(1.05rem, 1.4vw, 1.25rem);
    max-width: 560px;
    margin-bottom: 2.5rem;
}
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-cta .btn-ghost {
    color: #fff;
    border-color: rgba(255,255,255,.35);
}
.hero-cta .btn-ghost:hover {
    background: rgba(255,255,255,.08);
    border-color: #fff;
    color: #fff;
}
.hero-scroll {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    width: 26px; height: 42px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 100px;
    display: flex; justify-content: center;
    padding-top: 8px;
    opacity: .7;
    transition: opacity .3s;
}
.hero-scroll:hover { opacity: 1; }
.hero-scroll span {
    display: block;
    width: 3px; height: 8px;
    background: #fff;
    border-radius: 2px;
    animation: scrollDown 1.8s ease-in-out infinite;
}
@keyframes scrollDown {
    0%   { transform: translateY(0);   opacity: 1; }
    80%  { transform: translateY(14px); opacity: 0; }
    100% { transform: translateY(14px); opacity: 0; }
}

/* ---------- About ----------------------------------------------------------*/
.section-about { background: var(--bg-0); }
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
.about-image {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-3);
    aspect-ratio: 4 / 5;
}
.about-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.about-image:hover img { transform: scale(1.04); }
.about-image::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 65%, rgba(10,14,26,0.35) 100%);
    pointer-events: none;
}
.about-copy h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.08;
    margin-bottom: 1.5rem;
}
.about-text p { color: var(--text-dim); }
.about-text p strong { color: var(--text); font-weight: 600; }
.about-text em { color: var(--accent); font-style: italic; font-weight: 500; }
.about-tag { font-family: var(--font-display); font-size: 1.15rem; margin-top: 1.5rem; color: var(--text); }

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: .25rem; }
.stat-num {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: var(--accent);
    line-height: 1;
}
.stat-label {
    font-size: .78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 500;
}

/* ---------- Services -------------------------------------------------------*/
.section-services { background: var(--bg-1); }
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.service-card {
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    position: relative;
    transition: transform .35s var(--ease), border-color .3s, background .3s, box-shadow .3s;
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.service-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .5s var(--ease);
}
.service-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-soft);
    box-shadow: var(--shadow-2);
}
.service-card:hover::before { transform: scaleX(1); }
.service-icon {
    width: 56px; height: 56px;
    color: var(--accent);
    margin-bottom: 1.25rem;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border-radius: 12px;
    padding: 12px;
}
.service-card h3 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: .6rem;
}
.service-card p {
    color: var(--text-dim);
    font-size: .95rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}
.service-link {
    color: var(--accent);
    font-weight: 600;
    font-size: .9rem;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: .4em;
    transition: gap .3s var(--ease), color .2s;
}
.service-link:hover { gap: .75em; color: var(--accent-hi); }

/* ---------- Gallery / Before-After -----------------------------------------*/
.section-gallery { background: var(--bg-0); }
.before-after-wrap { margin-bottom: 5rem; }
.before-after-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}
.ba {
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-2);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--border);
}
.ba-compare {
    --pct: 50%;
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    user-select: none;
    cursor: ew-resize;
    touch-action: pan-y;
    background: var(--bg-1);
}
.ba-compare img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center center;
    pointer-events: none;
}
.ba-before-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    clip-path: inset(0 calc(100% - var(--pct)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--pct)) 0 0);
}
.ba-handle {
    position: absolute;
    top: 0; bottom: 0;
    left: var(--pct);
    width: 2px;
    background: rgba(255,255,255,.95);
    transform: translateX(-1px);
    pointer-events: none;
    box-shadow: 0 0 10px rgba(0,0,0,.5);
}
.ba-handle-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px; height: 56px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    display: grid;
    place-items: center;
    pointer-events: none;
}
.ba-handle-dot::before,
.ba-handle-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    margin-top: -8px;
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}
.ba-handle-dot::before { left: 10px; border-right: 10px solid #fff; }
.ba-handle-dot::after  { right: 10px; border-left:  10px solid #fff; }

.ba-label {
    position: absolute;
    top: 1rem;
    padding: .4rem .8rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(10,14,26,.75);
    color: #fff;
    backdrop-filter: blur(8px);
    border-radius: 4px;
    pointer-events: none;
}
.ba-label-before { left: 1rem; }
.ba-label-after  { right: 1rem; color: var(--accent-light); }

.ba-range {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: ew-resize;
    margin: 0;
}

.ba figcaption {
    text-align: center;
    padding: 1.25rem 1.5rem;
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--text);
    background: var(--bg-0);
    border-top: 1px solid var(--border);
}

/* Gallery grid */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin-bottom: 2.5rem;
}
.filter {
    padding: .55rem 1.1rem;
    font-size: .85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 100px;
    background: transparent;
    transition: all .25s var(--ease);
}
.filter:hover { color: var(--text); border-color: var(--border-2); }
.filter.active { color: #fff; background: var(--accent); border-color: var(--accent); }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
.gallery-item {
    margin: 0;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-2);
    transition: transform .4s var(--ease), opacity .3s;
    box-shadow: var(--shadow-1);
}
.gallery-item.is-hidden { display: none; }
.gallery-btn {
    display: block;
    width: 100%; height: 100%;
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
}
.gallery-btn img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .6s var(--ease), filter .4s;
}
.gallery-btn:hover img { transform: scale(1.06); filter: brightness(1.05); }
.gallery-btn::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(10,14,26,.75) 100%);
    opacity: 0;
    transition: opacity .3s;
}
.gallery-btn:hover::after { opacity: 1; }
.gallery-cat {
    position: absolute;
    bottom: .75rem; left: .75rem;
    padding: .3rem .7rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    backdrop-filter: blur(8px);
    border-radius: 4px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .3s, transform .3s;
}
.gallery-btn:hover .gallery-cat { opacity: 1; transform: translateY(0); }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, .95);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 1rem;
    opacity: 0;
    animation: fadeIn .3s forwards;
}
.lightbox[hidden] { display: none; }
@keyframes fadeIn { to { opacity: 1; } }
.lightbox-figure {
    margin: 0;
    max-width: min(95vw, 1400px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.lightbox-figure img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-3);
}
.lightbox-figure figcaption {
    color: rgba(255,255,255,.82);
    font-size: .9rem;
    text-align: center;
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,.10);
    color: #fff;
    font-size: 1.5rem;
    display: grid;
    place-items: center;
    transition: background .2s, transform .2s;
    backdrop-filter: blur(10px);
}
.lightbox-close { top: 1.25rem; right: 1.25rem; font-size: 2rem; line-height: 1; }
.lightbox-prev  { left: 1.25rem;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover, .lightbox-next:hover { background: var(--accent); color: #fff; }
.lightbox-close:hover { background: var(--error); color: #fff; }

/* ---------- Process --------------------------------------------------------*/
.section-process { background: var(--bg-1); }
.process-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 880px;
    margin: 0 auto;
}
.process-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    align-items: start;
    transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
    box-shadow: var(--shadow-1);
}
.process-step:hover {
    border-color: var(--accent-soft);
    transform: translateX(4px);
    box-shadow: var(--shadow-2);
}
.process-num {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
    min-width: 2.5ch;
}
.process-body h3 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: .25rem;
}
.process-body p { color: var(--text-dim); margin: 0; }

/* ---------- Reviews --------------------------------------------------------*/
.section-reviews { background: var(--bg-0); }
.reviews-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.review-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    box-shadow: var(--shadow-1);
    transition: transform .3s var(--ease), box-shadow .3s;
}
.review-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2);
}
.review-card::before {
    content: "\201C";
    position: absolute;
    top: .25rem; right: 1.5rem;
    font-family: var(--font-display);
    font-size: 5rem;
    color: var(--accent-soft);
    line-height: 1;
    pointer-events: none;
}
.stars { color: var(--accent); display: inline-flex; gap: 2px; }
.stars svg { width: 18px; height: 18px; }
.review-card blockquote {
    margin: 0;
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.7;
    flex: 1;
}
.review-card blockquote p { margin: 0; }
.review-foot {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.review-name { font-weight: 600; color: var(--text); }
.review-role { color: var(--text-muted); font-size: .85rem; }

/* ---------- Contact --------------------------------------------------------*/
.section-contact { background: var(--bg-1); }
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: start;
}
.contact-intro h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4.5vw, 3.4rem);
    line-height: 1.08;
    margin-bottom: 1rem;
}
.contact-intro p { color: var(--text-dim); max-width: 48ch; }
.contact-details {
    display: grid;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}
.contact-details li {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 1rem;
    align-items: baseline;
}
.contact-label {
    font-size: .72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}
.contact-details a { color: var(--text); transition: color .2s; }
.contact-details a:hover { color: var(--accent); }

.contact-form {
    background: var(--bg-0);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: var(--shadow-2);
}
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field label {
    font-size: .78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dim);
    font-weight: 600;
}
.field input,
.field textarea,
.field select {
    width: 100%;
    padding: .95rem 1rem;
    background: var(--bg-1);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color .2s, background .2s, box-shadow .2s;
    font-family: inherit;
    min-height: 48px;
}
.field textarea { resize: vertical; min-height: 120px; }

/* Custom select chevron (consistent across browsers) */
.field select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231e3a8a'><path d='M5.5 7.5l4.5 5 4.5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 18px;
    cursor: pointer;
}
.field select:invalid,
.field select option[value=""] { color: var(--text-muted); }

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    background-color: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field.has-error input,
.field.has-error textarea,
.field.has-error select {
    border-color: var(--error);
    background-color: rgba(179, 38, 30, 0.05);
}
.field-error {
    color: var(--error);
    font-size: .82rem;
    min-height: 1em;
}
.field-hint {
    color: var(--text-muted);
    font-size: .78rem;
    min-height: 1em;
}
.field-hint.is-ok { color: var(--success); }

/* ---- Multi-column field rows ---- */
.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alert {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: .95rem;
    border: 1px solid transparent;
}
.form-alert-ok {
    background: rgba(47, 122, 71, 0.10);
    border-color: rgba(47, 122, 71, 0.4);
    color: var(--success);
}
.form-alert-err {
    background: rgba(179, 38, 30, 0.08);
    border-color: rgba(179, 38, 30, 0.4);
    color: var(--error);
}

.form-note {
    color: var(--text-muted);
    font-size: .78rem;
    margin: 0;
    line-height: 1.5;
}

/* ---------- Footer ---------------------------------------------------------*/
.site-footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
    color: var(--text-dim);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}
.logo-mark--footer {
    width: 56px;
    height: 56px;
    background-color: var(--accent);
    filter: none;
    margin-bottom: .25rem;
}
.footer-brand p { margin-top: 1rem; font-size: .95rem; }
.footer-brand strong { color: var(--text); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; }
.footer-nav h4,
.footer-contact h4 {
    font-size: .75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
    font-family: var(--font-body);
    font-weight: 700;
}
.footer-nav ul,
.footer-contact ul { display: grid; gap: .5rem; font-size: .95rem; }
.footer-nav a, .footer-contact a { transition: color .2s; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--accent); }
.footer-bottom {
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .82rem;
    color: var(--text-muted);
}
.footer-bottom p { margin: 0; }

/* ---------- Animations (reveal on scroll) ---------------------------------*/
[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: var(--d, 0ms);
}
[data-animate].is-visible {
    opacity: 1;
    transform: none;
}

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

/* Tablet ≥ 640 */
@media (min-width: 640px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .services-grid { grid-template-columns: repeat(2, 1fr); }
    .reviews-grid { grid-template-columns: repeat(2, 1fr); }
    .before-after-grid { grid-template-columns: repeat(2, 1fr); }
    /* If the last card sits alone on its row, center it with the width of one column */
    .ba:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        max-width: calc(50% - 1.25rem);
        justify-self: center;
        width: 100%;
    }

    /* Multi-column form rows */
    .field-row-2        { grid-template-columns: 1fr 1fr; }
    .field-row-zip      { grid-template-columns: 160px 1fr; }
    .field-row-city-state { grid-template-columns: 2fr 1fr; }
}

/* Small desktop ≥ 900 */
@media (min-width: 900px) {
    .about-grid {
        grid-template-columns: 5fr 7fr;
        gap: 5rem;
    }
    .contact-grid {
        grid-template-columns: 1fr 1.1fr;
        gap: 5rem;
    }
    .services-grid { grid-template-columns: repeat(3, 1fr); }
    .reviews-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid { grid-template-columns: repeat(4, 1fr); }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 3rem; }
}

/* Desktop ≥ 1100 */
@media (min-width: 1100px) {
    .contact-form { padding: 2.5rem; }
    .service-card { padding: 2.25rem; }
}

/* ---------- Mobile nav ----------------------------------------------------*/
@media (max-width: 899px) {
    .nav-toggle { display: flex; }
    .logo-mark { width: 104px; height: 104px; }
    .site-header.is-scrolled .logo-mark { width: 46px; height: 46px; }
    .hero { padding-top: 11rem; }
    .primary-nav {
        position: fixed;
        inset: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        padding: 6rem 2rem 3rem;
        transform: translateX(100%);
        transition: transform .4s var(--ease);
        z-index: 100;
        overflow-y: auto;
    }
    .primary-nav.is-open { transform: translateX(0); }
    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }
    .primary-nav li { border-bottom: 1px solid var(--border); }
    .primary-nav li:last-child { border: none; margin-top: 1.5rem; }
    .primary-nav a {
        display: block;
        padding: 1.1rem 0;
        font-size: 1.15rem;
        font-family: var(--font-display);
        font-weight: 500;
        color: var(--text) !important;
    }
    .primary-nav a::after { display: none; }
    .primary-nav .nav-cta {
        text-align: center;
        margin: 0;
        padding: 1rem 1.5rem;
        font-family: var(--font-body);
        font-size: 1rem;
        color: #fff !important;
    }
    body.nav-open { overflow: hidden; }
    /* Higher specificity beats `.site-header:not(.is-scrolled) .nav-toggle span`
       so the hamburger becomes dark while the white mobile menu is open,
       even when the header is still at the transparent hero state. */
    body.nav-open .site-header .nav-toggle span { background: var(--text); }

    /* While the menu is open, strip effects that create a containing block
       for position:fixed descendants (backdrop-filter does). Otherwise the
       scrolled header clamps `.primary-nav { inset: 0 }` to the ~64px header
       strip and only the first menu item is visible. */
    body.nav-open .site-header,
    body.nav-open .site-header.is-scrolled {
        -webkit-backdrop-filter: none;
                backdrop-filter: none;
        background: transparent;
        box-shadow: none;
        border-bottom: none;
    }
}

/* ---------- Tiny screens --------------------------------------------------*/
@media (max-width: 440px) {
    .hero-cta { flex-direction: column; }
    .hero-cta .btn { width: 100%; }
    .about-stats { grid-template-columns: 1fr; text-align: left; }
    .process-step { grid-template-columns: 1fr; gap: .5rem; padding: 1.5rem; }
    .contact-details li { grid-template-columns: 1fr; gap: .2rem; }
    .contact-form { padding: 1.5rem; }
    .logo-mark { width: 84px; height: 84px; }
    .site-header.is-scrolled .logo-mark { width: 42px; height: 42px; }
    .hero { padding-top: 10rem; }
}
