/* home.css — homepage-specific styles. New section CSS gets appended below
 * as later tasks add new home sections. */

/* ---- Hero ---- */
.home-hero {
    position: relative;
    min-height: clamp(520px, 70vh, 760px);
    display: flex; align-items: center;
    color: var(--text-on-dark);
    background-color: var(--bg-darker);
    background-image:
        linear-gradient(90deg, rgba(15,16,17,0.65) 0%, rgba(15,16,17,0.25) 60%, rgba(15,16,17,0.05) 100%),
        url('/assets/img/hero/hero-metal-roof-home.jpg');
    background-size: cover;
    background-position: center;
}
@media (min-resolution: 2dppx), (min-width: 2400px) {
    .home-hero {
        background-image:
            linear-gradient(90deg, rgba(15,16,17,0.65) 0%, rgba(15,16,17,0.25) 60%, rgba(15,16,17,0.05) 100%),
            url('/assets/img/hero/hero-metal-roof-home@2x.jpg');
    }
}

.home-hero__inner {
    padding-block: var(--space-20);
    /* Sit flush with the container's left edge — moves content back toward
       the viewport's left half (matches Roofix's hero positioning). */
    padding-left: 0;
    padding-right: var(--space-6);
}
/* Eyebrow: muted grey, NO left bar (Roofix's "SMART SOLUTION" treatment) */
.home-hero__eyebrow {
    color: var(--text-muted-on-dark);
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: var(--space-4);
}
/* Headline: green vertical bar lives only beside this element. The
   <br> in the markup forces the natural 2-line break; we don't constrain
   width — the content can run as wide as the container allows. */
.home-hero__headline {
    position: relative;
    padding-left: var(--space-5);
    font-size: clamp(var(--fs-2xl), 5.5vw, var(--fs-3xl));
    color: var(--text-on-dark);
    font-weight: var(--fw-black);
    line-height: 1.1;
    margin-bottom: var(--space-5);
}
.home-hero__headline::before {
    content: '';
    position: absolute;
    left: 0; top: 8%; bottom: 8%;
    width: 4px;
    background: var(--brand-primary);
}
.home-hero__sub {
    font-size: var(--fs-md);
    margin-bottom: var(--space-8);
    color: rgba(255,255,255,0.92);
    max-width: 560px;
    padding-left: var(--space-5); /* aligns with headline text */
}
.home-hero__actions {
    display: flex; gap: var(--space-4); flex-wrap: wrap;
    padding-left: var(--space-5);
}

/* ---- Get-to-Know ---- */
.home-intro {
    padding-block: var(--space-20);
    position: relative;
    overflow: hidden;
    /* Real Roofix blueprint asset — stylized roof gable on the bottom-left,
       3D wireframe building on the bottom-right. Positioned bottom-center
       so both decorative elements anchor to the bottom of the section. */
    background-image: url('/assets/img/decorative/getknow-blueprint.jpg');
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 1500px auto;
}
.home-intro > .container { position: relative; z-index: 1; }
.home-intro__grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: var(--space-12);
    align-items: center;
}
@media (max-width: 880px) { .home-intro__grid { grid-template-columns: 1fr; } }

.home-intro__copy {
    max-width: 580px;
    padding-right: var(--space-8); /* breathing room before the visual */
}
.home-intro__lede {
    font-size: var(--fs-base);
    color: var(--text-body);
    margin-bottom: var(--space-8);
    line-height: var(--lh-body);
}

.home-intro__features {
    display: grid; gap: var(--space-6);
    margin-bottom: var(--space-8);
}
.home-intro__feature {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: var(--space-4);
    align-items: start;
}
.home-intro__feature i {
    width: 64px; height: 64px;
    background: var(--brand-primary-tint);
    color: var(--brand-primary);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.home-intro__feature h3 {
    font-size: var(--fs-md);
    color: var(--text-heading);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-2);
}
.home-intro__feature p {
    color: var(--text-body);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    margin: 0;
}

/* Phone CTA + 25-Year badge sit side by side, mirroring Roofix's pattern */
.home-intro__cta-row {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.home-intro__phone {
    display: inline-flex; align-items: center;
    gap: var(--space-4);
    text-decoration: none;
}
.home-intro__phone i {
    width: 56px; height: 56px;
    border: 2px solid var(--border-strong);
    color: var(--text-strong);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-md);
}
.home-intro__phone-label {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--fs-sm);
    color: var(--text-strong);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-1);
}
.home-intro__phone-number {
    display: block;
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--brand-primary);
    line-height: 1;
}

/* "25 / Years of Experience" green badge */
.years-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--brand-primary);
    color: var(--text-on-dark);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-sm);
}
.years-badge__number {
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-black);
    line-height: 1;
}
.years-badge__label {
    font-family: var(--font-heading);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-transform: uppercase;
}

/* 3-image collage: tall left + 2-stacked right */
.home-intro__visual {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    grid-template-rows: 1fr 1fr;
    gap: var(--space-3);
    aspect-ratio: 5 / 4;
}
.home-intro__visual-cell {
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
}
/* <picture> needs explicit sizing or it shrink-wraps to the img's
   natural size — leaving grey gaps inside the cell. */
.home-intro__visual-cell picture {
    display: block;
    width: 100%;
    height: 100%;
}
.home-intro__visual-cell img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 600ms ease;
}
.home-intro__visual-cell:hover img { transform: scale(1.04); }
.home-intro__visual-cell--main {
    grid-row: 1 / span 2;
}

/* ---- What We Do (services) — warmer dark section with subtle architectural pattern ---- */
.home-services {
    position: relative;
    background-color: var(--bg-section-dark);
    background-image:
        radial-gradient(ellipse at 75% 25%, rgba(31,122,58,0.10), transparent 55%),
        radial-gradient(ellipse at 15% 90%, rgba(255,255,255,0.04), transparent 60%);
    color: var(--text-on-dark);
    padding-block: var(--space-20);
    overflow: hidden;
}
.home-services::before {
    /* Pure-CSS blueprint grid: faint horizontal + vertical lines, very low opacity.
       No external image — avoids the "wrong file" bug that the Roofix
       banner-shape.png caused (it's actually red roof-tile artwork, not blueprint). */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right,  rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}
.home-services > .container { position: relative; z-index: 1; }

.home-services__head {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;            /* intro text rides up next to title */
    margin-bottom: var(--space-12);
}
@media (max-width: 880px) { .home-services__head { grid-template-columns: 1fr; } }
.home-services__head h2 { color: var(--text-on-dark); margin-bottom: 0; }
.home-services__head p  {
    color: var(--text-muted-on-dark);
    max-width: 60ch;
    font-size: var(--fs-base);
    line-height: var(--lh-body);
    margin-top: var(--space-2);
}

/* Carousel — horizontal scroll-snap on track + dot navigation below */
.home-services__carousel { position: relative; }
.home-services__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--space-6) * 2) / 3);
    align-items: stretch;           /* equal-height cards */
    gap: var(--space-6);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scroll-behavior: smooth;
    scrollbar-width: none;          /* hide scrollbar Firefox */
    padding-bottom: var(--space-2); /* breathing room for shadows */
}
.home-services__grid::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.home-services__grid > * { scroll-snap-align: start; }

@media (max-width: 1080px) {
    .home-services__grid { grid-auto-columns: calc((100% - var(--space-6)) / 2); }
}
@media (max-width: 720px)  {
    .home-services__grid { grid-auto-columns: 100%; }
}

/* Dot pagination */
.home-services__dots {
    display: flex; justify-content: center; align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
}
.home-services__dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 0;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.home-services__dot:hover { background: rgba(255,255,255,0.4); }
.home-services__dot.is-active {
    background: var(--brand-primary);
    transform: scale(1.2);
}

/* ---- Service card with smooth SVG swoop ---- */
.service-card {
    background: var(--bg-page);
    border-radius: var(--radius-md);
    overflow: hidden;
    color: var(--text-body);
    position: relative;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-card__media {
    width: 100%;
    height: 0;
    padding-bottom: 60%;             /* 5:3 — wider, less tall */
    position: relative;
    flex: 0 0 auto;                  /* don't let flex stretch the media box */
}
/* Both <picture> and direct <img> get absolutely positioned to fill the
   padding-defined media box. Without this, <picture> sized to its child's
   natural intrinsic height and the image overflowed into the body area. */
.service-card__media > picture,
.service-card__media > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.service-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}
.service-card__media img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.service-card__swoop {
    position: absolute;
    inset: auto 0 -1px 0;
    width: 100%;
    height: 38px;
    color: var(--brand-primary);
    display: block;
    pointer-events: none;
}
.service-card__icon {
    position: absolute;
    left: var(--space-6);
    bottom: -30px;
    width: 60px; height: 60px;
    background: var(--brand-primary);
    color: var(--text-on-dark);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-lg);
    box-shadow: 0 6px 14px rgba(15,16,17,0.18);
    z-index: 3;     /* above the swoop and the image edge */
    border: 3px solid var(--bg-page);
}
.service-card__body {
    padding: var(--space-10) var(--space-6) var(--space-6);
    flex: 1 1 auto;                  /* body fills remaining space → equal-height cards */
    display: flex;
    flex-direction: column;
}
.service-card__body .service-card__link {
    margin-top: auto;                /* link pinned to bottom of body */
}
.service-card__title {
    font-size: var(--fs-lg);
    color: var(--text-heading);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-2);
}
.service-card__excerpt {
    color: var(--text-body);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    margin-bottom: var(--space-4);
}
.service-card__link {
    display: inline-flex; align-items: center; gap: var(--space-2);
    color: var(--brand-primary); font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.service-card__link i { transition: transform var(--transition); }
.service-card:hover .service-card__link i { transform: translateX(4px); }

/* ---- Trusted Best Company section ---- */
.home-trust {
    position: relative;
    padding-block: var(--space-20);
    background-color: var(--bg-page);
    overflow: hidden;
}
.home-trust::before {
    /* Faint blueprint grid pattern behind the section content */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right,  rgba(15,16,17,0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15,16,17,0.04) 1px, transparent 1px),
        linear-gradient(to right,  rgba(15,16,17,0.025) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15,16,17,0.025) 1px, transparent 1px);
    background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
    pointer-events: none;
}
.home-trust > .container { position: relative; z-index: 1; }

.home-trust__grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-12);
    align-items: center;
}
@media (max-width: 880px) { .home-trust__grid { grid-template-columns: 1fr; } }

/* Visual block: photo + green corner accent + overhanging metric card */
.home-trust__visual {
    position: relative;
    padding-top: var(--space-6);          /* small offset = thin L-shape protrusion */
    padding-left: var(--space-6);
    padding-bottom: var(--space-10);      /* room for the metric card to overhang */
}
.home-trust__corner {
    /* Substantial green pedestal that the photo sits on top of — only a
       thin L-shape strip is visible past the photo's upper-left corner. */
    position: absolute;
    top: 0; left: 0;
    width: 200px; height: 200px;
    background: var(--brand-primary);
    background-image:
        linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    border-radius: var(--radius-sm);
    z-index: 0;
}
.home-trust__photo {
    position: relative;
    z-index: 1;
    aspect-ratio: 5 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.home-trust__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom; /* keep the roof in frame; sky drops off the top */
    display: block;
}

/* Metric card overhangs the bottom-right of the photo */
.home-trust__metric {
    position: absolute;
    right: -16px;
    bottom: -8px;
    z-index: 2;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    padding: var(--space-5) var(--space-6);
    display: flex; align-items: center; gap: var(--space-4);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 360px;
}
.home-trust__metric-circle {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: var(--brand-primary);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--brand-primary-dark);
    font-weight: var(--fw-black);
    font-size: var(--fs-md);
    position: relative;
    flex-shrink: 0;
}
.home-trust__metric-circle::after {
    content: ''; position: absolute; inset: 10px;
    background: var(--bg-page); border-radius: 50%;
    z-index: 0;
}
.home-trust__metric-circle span {
    position: relative; z-index: 1;
    font-size: var(--fs-lg);
}
.home-trust__metric-text strong {
    display: block;
    font-size: var(--fs-md);
    color: var(--text-heading);
    font-weight: var(--fw-bold);
    margin-bottom: var(--space-1);
}
.home-trust__metric-text span {
    display: block;
    font-size: var(--fs-md);
    color: var(--text-heading);
    font-weight: var(--fw-bold);
    line-height: 1.25;
}

@media (max-width: 540px) {
    .home-trust__metric {
        position: relative;
        right: 0; bottom: 0;
        margin: -32px auto 0;
        min-width: auto;
    }
}

/* FAQ accordion. Native <details> with name="faq" so items are mutually
   exclusive (opening one closes the others). The collapse/expand animates
   via the ::details-content pseudo + interpolate-size in modern browsers;
   older browsers still get a working accordion, just snapping. */
:root { interpolate-size: allow-keywords; }

.faq { display: grid; gap: var(--space-3); }
.faq__item {
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-page);
    transition: border-color var(--transition);
}
.faq__item[open] { border-color: var(--brand-primary); }

.faq__summary {
    list-style: none;
    cursor: pointer;
    padding: var(--space-5);
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-md);
    color: var(--text-strong);
    display: flex; justify-content: space-between; align-items: center;
    transition: color var(--transition);
}
.faq__summary::-webkit-details-marker { display: none; }
.faq__summary:hover { color: var(--brand-primary); }
.faq__summary::after {
    content: '+';
    font-size: var(--fs-xl);
    line-height: 1;
    color: var(--brand-primary);
    display: inline-block;
    transition: transform 280ms ease, color var(--transition);
}
.faq__item[open] .faq__summary::after {
    transform: rotate(45deg);   /* + smoothly rotates into × */
}

.faq__body {
    padding: 0 var(--space-5) var(--space-5);
    color: var(--text-body);
}

/* Animate the body's collapse/expand */
.faq__item::details-content {
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition:
        content-visibility 280ms allow-discrete,
        block-size 280ms ease,
        opacity 200ms ease;
}
.faq__item[open]::details-content {
    block-size: auto;
    opacity: 1;
}

/* ---- Recent Works grid ---- */
.home-works {
    padding-block: calc(var(--space-20) + 80px) var(--space-20); /* extra top room for the CTA banner overlap */
    background: var(--bg-soft);
    position: relative;
}
.home-works__head { text-align: center; margin-bottom: var(--space-10); }

/* Filter pills — pipe-separator style, underline indicator on active */
.home-works__filters {
    list-style: none;
    margin: var(--space-5) 0 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}
.home-works__filters li { display: inline-flex; align-items: center; }
.home-works__filters li + li::before {
    content: "|";
    color: var(--text-muted);
    margin: 0 var(--space-4);
    opacity: 0.45;
    font-weight: var(--fw-regular);
}
.home-works__filter {
    padding: var(--space-2) 0;
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    cursor: pointer;
    border: 0;
    background: transparent;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}
.home-works__filter[aria-pressed="true"] {
    color: var(--text-heading);
    border-bottom-color: var(--brand-primary);
}
.home-works__filter:hover { color: var(--brand-primary); }

/* Asymmetric 3×2 grid: top-left 1.5× wider, bottom-right 1.5× wider.
   7-column track gives nice 3 / 2 / 2 splits. White gutters between cells. */
.home-works__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(2, 340px);
    gap: var(--space-2);                 /* the "nice white lines" between boxes */
}
.home-works__cell:nth-child(1) { grid-column: span 3; grid-row: 1; }
.home-works__cell:nth-child(2) { grid-column: span 2; grid-row: 1; }
.home-works__cell:nth-child(3) { grid-column: span 2; grid-row: 1; }
.home-works__cell:nth-child(4) { grid-column: span 2; grid-row: 2; }
.home-works__cell:nth-child(5) { grid-column: span 2; grid-row: 2; }
.home-works__cell:nth-child(6) { grid-column: span 3; grid-row: 2; }

@media (max-width: 880px) {
    .home-works__grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; }
    .home-works__cell { grid-column: auto !important; grid-row: auto !important; }
}
@media (max-width: 560px) {
    .home-works__grid { grid-template-columns: 1fr; }
}

/* Cells: no link wrapper, inert articles. Height is set by the grid row. */
.home-works__cell {
    position: relative;
    overflow: hidden;
    background: var(--surface-placeholder);
}
@media (max-width: 880px) {
    .home-works__cell { aspect-ratio: 4 / 3; }
}
.home-works__cell img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 600ms ease, filter 350ms ease;
}

/* Default dark gradient overlay (bottom→top) */
.home-works__cell::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top,
        rgba(15,16,17,0.85) 0%,
        rgba(15,16,17,0.30) 45%,
        rgba(15,16,17,0)    75%);
    transition: opacity 300ms ease;
    pointer-events: none;
    z-index: 1;
}
/* Hover light wash overlay — fades in on top */
.home-works__cell::after {
    content: '';
    position: absolute; inset: 0;
    background: rgba(255,255,255,0.92);
    opacity: 0;
    transition: opacity 300ms ease;
    pointer-events: none;
    z-index: 2;
}

.home-works__caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: var(--space-5) var(--space-6);
    color: var(--text-on-dark);
    z-index: 3;
}
.home-works__category {
    display: inline-block;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-weight: var(--fw-semibold);
    margin-bottom: var(--space-2);
    color: var(--text-on-dark);
    transition: color 300ms ease;
}
.home-works__title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    margin: 0;
    color: var(--text-on-dark);
    position: relative;
    padding-left: var(--space-3);
    line-height: 1.25;
    transition: color 300ms ease;
}
.home-works__title::before {
    content: '';
    position: absolute;
    left: 0; top: 4px; bottom: 4px;
    width: 3px;
    background: var(--brand-primary);
}
.home-works__desc {
    margin: var(--space-3) 0 0;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--text-on-dark);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 350ms ease, opacity 250ms ease 50ms,
                color 300ms ease, margin-top 350ms ease;
}

/* ---- Hover state: dark gradient fades, white wash fades in,
       text flips to dark, description appears. ---- */
.home-works__cell:hover::before { opacity: 0; }
.home-works__cell:hover::after  { opacity: 1; }
.home-works__cell:hover img     { transform: scale(1.04); }
.home-works__cell:hover .home-works__category,
.home-works__cell:hover .home-works__title,
.home-works__cell:hover .home-works__desc {
    color: var(--text-heading);
}
.home-works__cell:hover .home-works__desc {
    max-height: 200px;
    opacity: 1;
}

/* When a filter narrows the list, hide non-matching cells */
.home-works__cell[hidden] { display: none; }

/* Filtered view: drop the asymmetric layout so visible cards flow from
   top-left in a simple equal-cell grid. */
.home-works__grid.is-filtered {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 340px;
    grid-auto-rows: 340px;
}
.home-works__grid.is-filtered .home-works__cell {
    grid-column: auto;
    grid-row: auto;
}
@media (max-width: 880px) {
    .home-works__grid.is-filtered { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .home-works__grid.is-filtered { grid-template-columns: 1fr; }
}

/* ---- Leading Way stat boxes ---- */
.home-stats { padding-block: var(--space-16); }
.home-stats__head {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--space-8); align-items: end;
    margin-bottom: var(--space-10);
}
@media (max-width: 880px) { .home-stats__head { grid-template-columns: 1fr; } }
.home-stats__head h2 { color: var(--text-strong); }
.home-stats__head p  { color: var(--text-body); max-width: 60ch; }

.home-stats__grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-4);
    align-items: start;     /* let the staggered offsets work */
    padding-top: 28px;      /* room for the upward-shifted tiles */
    padding-bottom: 28px;   /* room for the downward-shifted tiles */
}
@media (max-width: 1080px) { .home-stats__grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 540px)  { .home-stats__grid { grid-template-columns: 1fr; padding-top: 0; padding-bottom: 0; } }

.stat-box {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    border-radius: var(--radius-md);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    aspect-ratio: 1 / 1;
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: var(--space-3);
    box-shadow: 0 6px 18px rgba(15, 16, 17, 0.06);
    transition: background-color 280ms ease, color 280ms ease,
                transform 280ms ease, box-shadow 280ms ease;
}
.stat-box i {
    font-size: var(--fs-2xl);
    color: var(--text-on-dark);
    transition: color 280ms ease;
}
.stat-box__number {
    font-size: var(--fs-3xl); line-height: 1;
    font-weight: var(--fw-black);
    font-family: var(--font-heading);
    color: var(--text-on-dark);
    transition: color 280ms ease;
}
.stat-box__label {
    font-size: var(--fs-sm);
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-on-dark);
    opacity: 0.95;
    transition: color 280ms ease, opacity 280ms ease;
}

/* Alternating vertical stagger — Roofix's signature offset */
.home-stats__grid .stat-box:nth-child(odd)  { transform: translateY(-20px); }
.home-stats__grid .stat-box:nth-child(even) { transform: translateY( 20px); }
@media (max-width: 540px) {
    .home-stats__grid .stat-box:nth-child(odd),
    .home-stats__grid .stat-box:nth-child(even) { transform: none; }
}

/* Hover: invert — white bg, green icon + number, grey label, soft lift */
.stat-box:hover {
    background: #ffffff;
    transform: translateY(-32px);     /* override stagger to lift up */
    box-shadow: 0 18px 40px rgba(15, 16, 17, 0.14);
}
.home-stats__grid .stat-box:nth-child(even):hover { transform: translateY(8px); }
.stat-box:hover i { color: var(--brand-primary); }
.stat-box:hover .stat-box__number { color: var(--text-heading); }
.stat-box:hover .stat-box__label  { color: var(--text-muted); opacity: 1; }

/* ---- Equipment & Capabilities ---- */
.home-equipment {
    position: relative;
    padding-block: var(--space-20);
    background-color: var(--bg-section-dark);
    background-image:
        radial-gradient(ellipse at 25% 20%, rgba(31,122,58,0.10), transparent 55%),
        radial-gradient(ellipse at 85% 90%, rgba(255,255,255,0.04), transparent 60%);
    color: var(--text-on-dark);
    overflow: hidden;
}
.home-equipment::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right,  rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}
.home-equipment > .container { position: relative; z-index: 1; }
.home-equipment__head { text-align: center; margin-bottom: var(--space-10); }
.home-equipment__head h2 { color: var(--text-on-dark); }

/* Capabilities carousel — same scroll-snap pattern as What We Do.
   Track holds N cards, JS clones the first M at the tail to make it
   loop forward forever. Dots reflect ORIGINAL card count. */
.home-equipment__carousel { position: relative; }
.home-equipment__grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - var(--space-6) * 2) / 3);
    align-items: stretch;
    gap: var(--space-6);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: var(--space-2);
}
.home-equipment__grid::-webkit-scrollbar { display: none; }
.home-equipment__grid > * { scroll-snap-align: start; }

@media (max-width: 1080px) {
    .home-equipment__grid { grid-auto-columns: calc((100% - var(--space-6)) / 2); }
}
@media (max-width: 720px)  {
    .home-equipment__grid { grid-auto-columns: 100%; }
}

.home-equipment__dots {
    display: flex; justify-content: center; align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-8);
}
.home-equipment__dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 0;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}
.home-equipment__dot:hover { background: rgba(255,255,255,0.4); }
.home-equipment__dot.is-active {
    background: var(--brand-primary);
    transform: scale(1.2);
}

.equip-card {
    background: var(--bg-page);
    border-radius: var(--radius-md);
    overflow: hidden;
    color: var(--text-body);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
}
.equip-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.equip-card__media {
    aspect-ratio: 4 / 5;
    background: var(--surface-placeholder);
    position: relative;
    overflow: hidden;
}
.equip-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* SVG swoop sits at the boundary between photo and green band — same green
   as the body so the photo dips into the green with a soft wave. */
.equip-card__swoop {
    position: absolute;
    inset: auto 0 -1px 0;
    width: 100%;
    height: 44px;
    color: var(--brand-primary);
    display: block;
    pointer-events: none;
}
.equip-card__body {
    background: var(--brand-primary);
    color: var(--text-on-dark);
    padding: var(--space-6) var(--space-6) var(--space-6);
    text-align: center;
    flex: 1 1 auto;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.equip-card__title {
    color: var(--text-on-dark);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    margin: 0 0 var(--space-2);
}
.equip-card__role  {
    color: rgba(255,255,255,0.88);
    font-size: var(--fs-sm);
    margin: 0;
}

/* ---- Order Forms (panel + trim) ---- */
.home-orderforms {
    padding-block: var(--space-16);
    /* Soft warm-grey background with a subtle blueprint grid so the
       section visually separates from the Get-to-Know section above
       (which is light bg) and doesn't read as a continuous white slab. */
    background:
        linear-gradient(180deg, #f5f5f7 0%, #ebebee 100%);
    position: relative;
    overflow: hidden;
}
.home-orderforms::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(31, 122, 58, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 122, 58, 0.05) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px;
    pointer-events: none;
    z-index: 0;
}
.home-orderforms .container { position: relative; z-index: 1; }
.home-orderforms__head {
    text-align: center;
    margin-bottom: var(--space-10);
}
.home-orderforms__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
}
@media (max-width: 720px) { .home-orderforms__grid { grid-template-columns: 1fr; } }

.orderform-card {
    background: var(--bg-page);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-10) var(--space-8);
    text-align: center;
    display: flex; flex-direction: column; align-items: center;
    transition: transform 280ms ease, box-shadow 280ms ease, border-color 280ms ease;
}
.orderform-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-primary);
    box-shadow: 0 18px 40px rgba(15, 16, 17, 0.08);
}
.orderform-card__icon {
    width: 84px; height: 84px;
    border-radius: 50%;
    background: var(--brand-primary);
    color: var(--text-on-dark);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: var(--fs-2xl);
    margin-bottom: var(--space-5);
    box-shadow: 0 6px 18px rgba(31, 122, 58, 0.25);
}
.orderform-card__title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--text-heading);
    margin: 0 0 var(--space-3);
}
.orderform-card__desc {
    color: var(--text-body);
    font-size: var(--fs-sm);
    line-height: 1.55;
    margin: 0 0 var(--space-6);
    max-width: 38ch;
}
.orderform-card__cta {
    margin-top: auto;
    min-width: 220px;
}

/* ---- Mini quote strip — dark image backdrop with form on the right ---- */
.home-mini-quote {
    position: relative;
    padding-block: var(--space-20);
    color: var(--text-on-dark);
    background:
        linear-gradient(135deg, rgba(15,16,17,0.85) 0%, rgba(15,16,17,0.65) 100%),
        url('/assets/img/products/intro-roof.jpg') center / cover no-repeat;
    isolation: isolate;
}
.home-mini-quote__grid {
    display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--space-12);
    align-items: center;
}
@media (max-width: 880px) { .home-mini-quote__grid { grid-template-columns: 1fr; } }
.home-mini-quote h2 { color: var(--text-on-dark); }
.home-mini-quote p  { color: rgba(255,255,255,0.85); }
.home-mini-quote a  { color: var(--text-on-dark); text-decoration: underline; }

.home-mini-quote__form {
    background: var(--bg-page);
    padding: var(--space-8);
    border-radius: var(--radius-md);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    display: grid; gap: var(--space-4);
}
.home-mini-quote__form label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    display: block;
    margin-bottom: 6px;
}
.home-mini-quote__form input,
.home-mini-quote__form textarea {
    width: 100%;
    padding: 0 var(--space-4);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-page);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    color: var(--text-strong);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.home-mini-quote__form input { height: 44px; }    /* slim, was ~50 */
.home-mini-quote__form textarea {
    padding: var(--space-3) var(--space-4);
    min-height: 90px;
    resize: vertical;
    line-height: 1.4;
}
.home-mini-quote__form input:focus,
.home-mini-quote__form textarea:focus {
    outline: 0;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-tint);
}
.home-mini-quote__form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 540px) {
    .home-mini-quote__form .form-row { grid-template-columns: 1fr; }
    /* Tighter card padding on mobile so inputs span more of the row,
       matching the bottom-strip feel. */
    .home-mini-quote__form { padding: var(--space-5) var(--space-4); gap: var(--space-3); }
    .home-mini-quote__form input { height: 48px; }
}

/* Submit button — brand-green with hover lift + arrow accent */
.home-mini-quote__form button[type="submit"] {
    margin-top: var(--space-2);
    width: auto;
    align-self: start;
    padding: 14px var(--space-8);
    background: var(--brand-primary);
    color: var(--text-on-dark);
    border: 0;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(31, 122, 58, 0.25);
    transition: background 220ms ease, transform 220ms ease, box-shadow 220ms ease;
    display: inline-flex; align-items: center; gap: var(--space-3);
    justify-self: start;
}
.home-mini-quote__form button[type="submit"]::after {
    content: '\f061';                      /* fa-arrow-right */
    font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: var(--fs-xs);
    transition: transform 220ms ease;
}
.home-mini-quote__form button[type="submit"]:hover {
    background: var(--brand-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(31, 122, 58, 0.30);
}
.home-mini-quote__form button[type="submit"]:hover::after { transform: translateX(4px); }
.home-mini-quote__form button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(31, 122, 58, 0.25);
}

/* ---- Partner / supplier logos — clean wordmark row, no chip outlines ---- */
.home-partners {
    padding-block: var(--space-12);
    background: var(--bg-soft);
}
.home-partners__strip {
    display: flex;
    gap: var(--space-10);
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.home-partners__strip span {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    color: var(--text-muted);
    font-size: var(--fs-md);
    letter-spacing: 0.02em;
    padding: 0;
    border: 0;
    background: transparent;
    text-transform: uppercase;
    transition: color 220ms ease;
    position: relative;
}
.home-partners__strip span:not(:last-child)::after {
    content: '';
    position: absolute;
    right: calc(var(--space-10) / -2 - 1px);
    top: 25%; bottom: 25%;
    width: 1px;
    background: var(--border-strong);
    opacity: 0.5;
}
.home-partners__strip span:hover {
    color: var(--brand-primary);
}

/* ---- Final contact strip ---- */
.home-contact-strip {
    background: var(--brand-primary);
    color: var(--text-on-dark);
    padding-block: var(--space-12);
    background-image:
        linear-gradient(120deg, var(--brand-primary-dark) 35%, var(--brand-primary) 70%);
    position: relative;
    overflow: hidden;
}
.home-contact-strip__inner {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center;
}
@media (max-width: 880px) { .home-contact-strip__inner { grid-template-columns: 1fr; } }

.home-contact-strip h2 { color: var(--text-on-dark); margin-bottom: var(--space-3); }
.home-contact-strip p  { color: rgba(255,255,255,0.9); margin-bottom: 0; }

.home-contact-strip__form {
    display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--space-3);
    align-items: stretch;
}
@media (max-width: 720px) { .home-contact-strip__form { grid-template-columns: 1fr; } }
.home-contact-strip__form input {
    height: 48px;
    padding: 0 var(--space-4);
    border: 0; border-radius: var(--radius-sm);
    background: var(--bg-page); color: var(--text-strong);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    transition: box-shadow 180ms ease;
}
.home-contact-strip__form input::placeholder { color: var(--text-muted); }
.home-contact-strip__form input:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}
.home-contact-strip__form button {
    height: 48px;
    padding: 0 var(--space-6);
    background: var(--brand-accent);
    color: var(--text-on-dark);
    border: 0;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: var(--fw-bold);
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    cursor: pointer;
    min-width: 160px;
    transition: background-color 220ms ease, color 220ms ease,
                transform 220ms ease, box-shadow 220ms ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.home-contact-strip__form button:hover,
.home-contact-strip__form button:focus-visible {
    background: #ffffff;
    color: var(--brand-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}
.home-contact-strip__form button:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}
