/* ==========================================================================
   GuilRoy Plumbing – one-page site
   Built from the 1920px design. Type and spacing scale fluidly with the
   viewport (vw) and are clamped so they stay readable on phones.

   Contents
   1. Fonts
   2. Tokens
   3. Base
   4. Utilities
   5. Header / navigation
   6. Hero
   7. Intro
   8. About + pillars
   9. Solutions
   10. Gallery
   11. Pricing
   12. Contact + footer
   ========================================================================== */


/* 1. Fonts (self-hosted PT Sans, SIL Open Font License)
   ========================================================================== */
@font-face {
    font-family: "PT Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/pt-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "PT Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/pt-sans-latin-700-normal.woff2") format("woff2");
}


/* 2. Tokens
   ========================================================================== */
:root {
    /* Colours */
    --navy: #00205B;
    --navy-rgb: 0, 32, 91;
    --teal: #95D2CF;
    --blue: #2E3092;
    --yellow: #EFC319;
    --grey: #D9D9D9;
    --black: #000;
    --white: #fff;

    /* Type */
    --font: "PT Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Fluid type scale: min, 1920px-design size expressed in vw, max */
    --hero-h: 100vh;
    /* Hero text: 80px at 1920 wide, but shrinks on short screens so the whole
       hero (headline + sub line + button, about 10.6em tall) fits the first view */
    --fs-display: clamp(2.25rem, min(4.167vw, (var(--hero-h) - var(--header-h) - 2.5rem) / 10.6), 5rem);
    --fs-title:   clamp(2.5rem,    4.167vw, 5rem);      /* 80px  h2 */
    --fs-lead:    clamp(1.75rem, 2vw, 2.5rem);  /* 50px  intro + about lead */
    --fs-body:    clamp(1.25rem, 2vw, 1.75rem);  /* 40px  paragraphs */
    --fs-small:   clamp(1.25rem,  2vw, 1.75rem); /* 30px  notes, card text */
    --fs-small2:   clamp(1.25rem,  2vw, 1.5rem); /* 30px  notes, card text */
    --fs-h3:      clamp(2rem, 2.5vw,  3rem);      /* 48px  solution titles */
    --fs-pillars: clamp(1.75rem, 3.125vw, 3.75rem);   /* 60px  "Our 4 Pillars" */
    --fs-label:   clamp(1.5rem,  2.4vw, 2.875rem);  /* 46px  pillar labels */
    --fs-price:   clamp(2.75rem, 5vw,     6rem);      /* 96px  price */
    --fs-price-label: clamp(1.125rem, 2.083vw, 2.5rem); /* 40px */
    --fs-price-note:  clamp(.75rem, 1.04vw, 1.25rem);   /* 20px */
    --fs-nav:     clamp(.8125rem, 1.04vw, 1.25rem);   /* 20px */
    --fs-footer:  clamp(.875rem, 1.5vw,  1.75rem);  /* 34px */

    /* Layout */
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --container: 85rem;       /* 1440px content column */
    --container-wide: 90rem; /* 1540px header + hero column */
    --grid-gap: clamp(.5rem, 1.4vw, 1.5rem);

    --header-h: clamp(4.25rem, 6.6vw, 7.9rem);
    --focus: var(--blue);
}

@supports (height: 100svh) {
    :root {
        --hero-h: 100svh; /* small viewport height: ignores collapsing mobile browser bars */
    }
}


/* 3. Base
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--header-h);
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: var(--fs-body);
    line-height: 1.3;
    color: var(--black);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, figure {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 4px;
}

.container {
    width: min(100% - (var(--gutter) * 2), var(--container));
    margin-inline: auto;
}

.section-title {
    font-size: var(--fs-title);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: .45em;
}

.section-text {
    font-size: var(--fs-body);
    line-height: 1.3;
}


/* 4. Utilities
   ========================================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: -6rem;
    left: .5rem;
    z-index: 200;
    padding: .6rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    background: var(--yellow);
}

.skip-link:focus {
    top: .5rem;
}

.accent        { color: var(--teal); }
.accent-yellow { color: var(--yellow); }
.accent-teal   { color: var(--teal); }


/* 5. Header / navigation
   Fixed and transparent at the top of the page. js/main.js adds
   .is-scrolled once the page has been scrolled, which fills it navy.
   Without JavaScript (html.no-js) the header is always navy.
   ========================================================================== */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    background-color: transparent;
    transition: background-color .3s ease;
    --focus: var(--yellow);
}

.site-header.is-scrolled,
.site-header.is-open,
.no-js .site-header {
    background-color: var(--navy);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100% - (var(--gutter) * 2), var(--container-wide));
    margin-inline: auto;
    padding-block: clamp(.6rem, 1.04vw, 1.25rem);
}

.site-header__logo img {
    width: clamp(8.5rem, 12.4vw, 14.875rem); /* 238px at 1920 */
}

.site-nav {
    margin-right: clamp(0px, 6vw, 7.2rem); /* nav ends short of the right edge in the design */
}

.site-nav__list {
    display: flex;
    gap: clamp(1.25rem, 3.1vw, 3.75rem);
}

.site-nav a {
    display: block;
    padding-block: .5em;
    font-size: var(--fs-nav);
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--white);
    transition: color .2s ease;
}

.site-nav a:hover {
    color: var(--teal);
}

/* Burger button – only shown on small screens */
.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
    display: block;
    width: 1.6rem;
    height: 2px;
    margin-inline: auto;
    background: var(--white);
    transition: transform .25s ease, background-color .25s ease;
}

.nav-toggle__bars {
    position: relative;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
}

.nav-toggle__bars::before { top: -.5rem; }
.nav-toggle__bars::after  { top: .5rem; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
    transform: translateY(.5rem) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
    transform: translateY(-.5rem) rotate(-45deg);
}

@media (max-width: 56.25em) { /* 900px */
    .nav-toggle {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        margin: 0;
        padding: .5rem var(--gutter) 1.5rem;
        background: var(--navy);
        border-top: 1px solid rgba(255, 255, 255, .15);
        visibility: hidden;
        opacity: 0;
        transform: translateY(-.5rem);
        transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
    }

    .site-header.is-open .site-nav {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition-delay: 0s;
    }

    .site-nav__list {
        flex-direction: column;
        gap: 0;
    }

    .site-nav a {
        padding-block: 1rem;
        font-size: 1.0625rem;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }
}


/* 6. Hero
   Navy panel on the left (15.3% of the width, as in the design), photo to
   the right with a navy fade so the headline stays readable.
   ========================================================================== */
.hero {
    position: relative;
    isolation: isolate;
    display: flex;
    min-height: var(--hero-h); /* exactly the first screen */
    color: var(--white);
    background: var(--navy);
    --focus: var(--yellow);
}

.hero__bg {
    position: absolute;
    top: 0;
    right: 0;
    z-index: -2;
    width: 84.7%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(var(--navy-rgb), .6) 0, rgba(var(--navy-rgb), 0) 9.5rem),
        linear-gradient(90deg,
            var(--navy) 0,
            var(--navy) 15.3%,
            rgba(var(--navy-rgb), .82) 15.4%,
            rgba(var(--navy-rgb), .45) 38%,
            rgba(var(--navy-rgb), 0) 58%);
}

.hero__inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: min(100% - (var(--gutter) * 2), var(--container-wide));
    margin-inline: auto;
    padding-top: var(--header-h);
    padding-bottom: 1.25rem;
    font-size: var(--fs-display);
}

.hero__title,
.hero__sub {
    max-width: 8em;
    font-size: 1em;
    line-height: 1.275;
}

.hero__title {
    font-weight: 700;
}

.hero__sub {
    margin-top: .25em;
    font-weight: 400;
}

.hero__sub strong {
    font-weight: 700;
}

.hero__cta {
    display: block;
    width: 1.5em;
    margin-top: .6em;
    border-radius: 50%;
    transition: transform .2s ease;
}

.hero__cta:hover {
    transform: scale(1.06);
}

@media (max-width: 56.25em) {
    .hero__bg {
        width: 100%;
        object-position: 65% center;
    }

    .hero::before {
        background: linear-gradient(180deg,
            rgba(var(--navy-rgb), .78) 0,
            rgba(var(--navy-rgb), .6) 45%,
            rgba(var(--navy-rgb), .88) 100%);
    }

    .hero__title,
    .hero__sub {
        max-width: 9em;
    }
}

/* 6a. Header
   Navy panel on the left (15.3% of the width, as in the design), photo to
   the right with a navy fade so the headline stays readable.
   ========================================================================== */
.header {
    position: relative;
    isolation: isolate;
    display: flex;
    height: 400px;
    color: var(--white);
    background: var(--navy);
    --focus: var(--yellow);
}


.header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(var(--navy-rgb), .6) 0, rgba(var(--navy-rgb), 0) 9.5rem),
        linear-gradient(90deg,
            var(--navy) 0,
            var(--navy) 15.3%,
            rgba(var(--navy-rgb), .82) 15.4%,
            rgba(var(--navy-rgb), .45) 38%,
            rgba(var(--navy-rgb), 0) 58%);
}

.header__inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: min(100% - (var(--gutter) * 2), var(--container-wide));
    margin-inline: auto;
    padding-top: var(--header-h);
    padding-bottom: 1.25rem;
    font-size: var(--fs-display);
}

.header__title,
.header__sub {
    color: var(--white);
    max-width: 8em;
    font-size: 1em;
    line-height: 1.275;
}

.header__title {
    font-weight: 700;
}

.header__sub {
    margin-top: .25em;
    font-weight: 400;
}

.header__sub strong {
    font-weight: 700;
}

.header__cta {
    display: block;
    width: 1.5em;
    margin-top: .6em;
    border-radius: 50%;
    transition: transform .2s ease;
}

.header__cta:hover {
    transform: scale(1.06);
}

@media (max-width: 56.25em) {
    .header__bg {
        width: 100%;
        object-position: 65% center;
    }

    .header::before {
        background: linear-gradient(180deg,
            rgba(var(--navy-rgb), .78) 0,
            rgba(var(--navy-rgb), .6) 45%,
            rgba(var(--navy-rgb), .88) 100%);
    }

    .header__title,
    .header__sub {
        max-width: 9em;
    }
}



/* 7. Intro
   ========================================================================== */
.intro {
    padding-block: 5.5vw 4.5vw;
    text-align: center;
}

.intro__title {
    font-size: var(--fs-title);
    font-weight: 700;
    line-height: 1.1;
}

.intro__lead {
    max-width: 26em;
    margin: .5em auto 0;
    font-size: var(--fs-lead);
    line-height: 1.28;
}

.intro__note {
    max-width: 44em;
    margin: 1.1em auto 0;
    font-size: var(--fs-small);
    line-height: 1.3;
    color: var(--blue);
}

.intro__cta {
    display: block;
    width: clamp(5.5rem, 8.1vw, 9.75rem); /* 156px */
    margin: clamp(2rem, 4.3vw, 5.2rem) auto 0;
    border-radius: 50%;
    transition: transform .2s ease;
}

.intro__cta:hover {
    transform: scale(1.06);
}

@media (max-width: 56.25em) {
    .intro {
        padding-block: 3.5rem;
    }
}


/* 8. About + pillars
   ========================================================================== */
.about {
    padding-block: 4.4vw 4.1vw;
    background: var(--teal);
}

.about__lead {
    margin-bottom: .95em;
    font-size: var(--fs-lead);
    line-height: 1.3;
    color: var(--blue);
}

.about__body p {
    font-size: var(--fs-body);
    line-height: 1.3;
}

.about__body p + p {
    margin-top: 1.3em;
}

.pillars__title {
    margin: clamp(2.5rem, 5.5vw, 6.6rem) 0 clamp(1.25rem, 2.7vw, 3.25rem);
    font-size: var(--fs-pillars);
    font-weight: 700;
    line-height: 1.1;
}

.pillars {
    display: grid;
    grid-template-columns: repeat(4, 2fr);
    gap: var(--grid-gap);
}

.pillar__label {
    margin-top: .55em;
    font-size: var(--fs-label);
    font-weight: 700;
    line-height: 1.26;
    text-align: center;
    text-transform: uppercase;
    color: var(--white);
}

@media (max-width: 56.25em) {
    .about {
        padding-block: 3.5rem;
    }

    .pillars {
        grid-template-columns: repeat(2, 1fr);
        row-gap: 1.75rem;
    }
}


/* 9. Solutions
   Each card is a 3-row subgrid (icon / title / text) so titles and text
   line up across a row even when one title wraps to two lines.
   ========================================================================== */
.solutions {
    padding-block: 5.4vw 4.2vw;
}

.solutions__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: var(--grid-gap);
    margin-top: clamp(1.75rem, 3.2vw, 3.9rem);
}

.solution {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
}

.solution__title {
    padding: .5em .25em 0;
    font-size: var(--fs-h3);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.solution__text {
    padding: .6em .8em clamp(1.5rem, 2.8vw, 3.4rem);
    text-align: center;
    font-size: var(--fs-small2);
    line-height: 1.3;
}

.solutions__cta {
    display: block;
    width: clamp(5.5rem, 10.2vw, 12.25rem); /* 196px */
    margin: .6vw auto 0;
    border-radius: 50%;
    transition: transform .2s ease;
}

.solutions__cta:hover {
    transform: scale(1.06);
}

@media (max-width: 62.5em) { /* 1000px */
    .solutions__grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 1.25rem;
    }
}

@media (max-width: 35em) { /* 560px */
    .solutions {
        padding-block: 3.5rem;
    }

    .solutions__grid {
        grid-template-columns: minmax(0, 20rem);
        justify-content: center;
    }
}


/* 10. Gallery (id="testimonials")
   Desktop: wide | two tall, then wide | wide. Mobile: stacked.
   ========================================================================== */
.gallery {
    padding-block: clamp(1.5rem, 3.2vw, 3.8rem);
    background: var(--grey);
}

.gallery__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(.75rem, 1.65vw, 2rem);
}

.gallery__pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(.75rem, 1.65vw, 2rem);
}

.gallery__item {
    position: relative;
    overflow: hidden;
    background: #c4c4c4;
}

.gallery__item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery__item--wide {
    aspect-ratio: 700 / 403;
}

@media (max-width: 43.75em) { /* 700px */
    .gallery__grid {
        grid-template-columns: 1fr;
    }

    .gallery__item--tall {
        aspect-ratio: 340 / 403;
    }
}


/* 11. Pricing
   ========================================================================== */
.pricing {
    padding-block: 5.8vw 6.9vw;
}

.pricing__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(.75rem, 2.34vw, 2.8rem);
    margin-top: clamp(1.5rem, 3.4vw, 4.1rem);
}

.price-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    aspect-ratio: 1;
    padding: 0 .75rem clamp(1.25rem, 2.6vw, 3.1rem);
    text-align: center;
    background: var(--yellow);
    border-radius: clamp(1.5rem, 2.6vw, 3.125rem);
}

.price-card__amount {
    margin-bottom: .55em;
    font-size: var(--fs-price);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.price-card__label {
    font-size: var(--fs-price-label);
    font-weight: 700;
    line-height: 1.15;
    text-transform: uppercase;
}

.price-card__note {
    margin-top: .3em;
    font-size: var(--fs-price-note);
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
}

@media (max-width: 43.75em) { /* 700px */
    .pricing {
        padding-block: 3.5rem;
    }

    .pricing__grid {
        grid-template-columns: minmax(0, 24rem);
        justify-content: center;
        gap: 1rem;
    }

    .price-card {
        aspect-ratio: auto;
        padding: 2.25rem 1rem 2rem;
        justify-content: center;
    }

    .price-card__amount { font-size: 3.5rem; }
    .price-card__label  { font-size: 1.375rem; }
    .price-card__note   { font-size: .8125rem; }
}


/* 12. Contact + footer
   ========================================================================== */
.contact {
    padding-block: 4.4vw 6.2vw;
    color: var(--white);
    background: var(--navy);
    --focus: var(--yellow);
}

.contact__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem 0;
    margin-top: clamp(2rem, 5.7vw, 6.9rem);
}

.contact__item {
    display: inline-flex;
    align-items: center;
    gap: clamp(1rem, 2.6vw, 3.1rem);
    font-size: clamp(1.25rem, 2vw, 2.4rem);
    text-decoration: none;
    transition: color .2s ease;
}

.contact__item:hover {
    color: var(--teal);
}

.contact__item img {
    width: clamp(4.5rem, 7.9vw, 9.5rem);
}

.contact__legal {
    margin-top: clamp(2.5rem, 7.4vw, 8.9rem);
    padding-top: clamp(1.5rem, 4.7vw, 5.6rem);
    font-size: var(--fs-footer);
    line-height: 1.4;
    text-align: center;
    border-top: 2px solid rgba(255, 255, 255, .85);
}

.contact__legal a {
    text-decoration: none;
}

.contact__legal a:hover {
    text-decoration: underline;
}

@media (max-width: 43.75em) {
    .contact {
        padding-block: 3.5rem;
    }

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

/* 13. Terms overlay
   Full-screen, semi-transparent black panel with white text. Sits above the
   fixed header (z-index 100) and the skip link (200). Opened by any element
   with data-terms-open (see the script).
   ========================================================================== */
body.no-scroll {
    overflow: hidden;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: var(--white);
    background: rgba(0, 0, 0, .85);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    --focus: var(--yellow); /* blue focus ring would vanish on black */
}

.overlay.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s ease, transform .2s ease;
}

.overlay-header {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: calc(.75rem + env(safe-area-inset-top, 0px)) var(--gutter) .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .2);
}

.overlay-header h2 {
    font-size: clamp(1.25rem, 1rem + 1vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
}

.close-btn {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    font: inherit;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, .15);
}

.overlay-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1.25rem var(--gutter) calc(2rem + env(safe-area-inset-bottom, 0px));
}

.overlay-content {
    max-width: 46rem;
    margin-inline: auto;
}

.overlay-content h3 {
    margin: 1.75rem 0 .35rem;
    font-size: clamp(1.15rem, 1rem + .5vw, 1.5rem);
    font-weight: 700;
    line-height: 1.25;
}

.overlay-content p {
    margin: 0 0 .9rem;
    font-size: clamp(1rem, .9rem + .35vw, 1.25rem); /* body size is too big for long legal text */
    color: rgba(255, 255, 255, .85);
}

.overlay-content .updated {
    font-size: .9rem;
}

@media (prefers-reduced-motion: reduce) {
    .overlay,
    .overlay.open {
        transition: none;
        transform: none;
    }
}
