/* ==========================================================================
   Bergen Home Services - shared stylesheet
   One file for every page. Edit here, it changes everywhere.

   Layout order:
     1. Tokens          5. Buttons        9.  Cost table
     2. Reset & base    6. Hero          10.  FAQ / steps / prose
     3. Header & nav    7. Lead form     11.  Footer & action bar
     4. Sections        8. Cards & grids 12.  Responsive, motion, print
   ========================================================================== */

/* 1. TOKENS ============================================================== */

:root {
    /* Brand */
    --brand: #7C4889;
    --brand-dark: #5E3670;
    --brand-darker: #45274F;
    --brand-deep: #2F1A38;
    --brand-tint: #F4EEF6;
    --brand-tint-2: #EADFEE;

    /* Text. Ratios are against --page unless noted. */
    --ink: #1F1F1F;      /* 16.1:1 */
    --body: #454545;     /*  9.6:1 */
    --muted: #5E5E5E;    /*  6.5:1 */

    /* Surfaces */
    --page: #FFFFFF;
    --surface: #F7F5F8;
    --line: #DDD6E1;         /* borders on white */
    --line-strong: #C7BCCD;  /* borders that must read as edges */
    --line-input: #8C8693;   /* 3.53:1 on #fff - WCAG 1.4.11 for controls */

    /* Accents */
    --urgent: #C2410C;
    --focus: #FFB703;

    /* Hero scrim, as channels so opacity can vary per breakpoint */
    --scrim: 45, 24, 53;

    /* Depth. Purple-tinted rather than neutral grey, so shadows sit in the
       same colour family as everything they fall on. */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 2px rgba(69, 39, 79, .07), 0 2px 6px rgba(69, 39, 79, .05);
    --shadow-md: 0 2px 6px rgba(69, 39, 79, .07), 0 10px 24px rgba(69, 39, 79, .09);
    --shadow-lg: 0 4px 12px rgba(69, 39, 79, .10), 0 22px 48px rgba(69, 39, 79, .14);

    /* Motion. One vocabulary, so nothing is hand-typed at a random speed. */
    --dur-fast: 120ms;
    --dur: 200ms;
    --dur-slow: 380ms;
    --ease-out: cubic-bezier(.22, .61, .36, 1);
    --ease-in-out: cubic-bezier(.65, .05, .36, 1);

    /* Metrics */
    --header-h: 72px;
    --action-bar-h: 76px;
    --wrap: 1160px;
    --measure: 68ch;
}

/* 2. RESET & BASE ======================================================== */

*, *::before, *::after { box-sizing: border-box; }

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
/* Nav and footer lists are unclassed markup, so reset them explicitly.
   Lists inside .prose keep their bullets on purpose. */
.main-nav ul, .footer-grid ul { list-style: none; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    /* Anchors must not land underneath the sticky header. */
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    background: var(--page);
    color: var(--body);
    line-height: 1.65;
    font-size: 1rem;
    overflow-x: hidden;
}

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

h1, h2, h3, .display {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    color: var(--ink);
    line-height: 1.18;
    font-weight: 700;
}

a { color: var(--brand-dark); }

/* No border-radius here: it squares off pills and circles mid-focus. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 1px;
    box-shadow: 0 0 0 6px var(--focus);
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 8px;
    top: -100px;
    z-index: 2000;
    background: var(--ink);
    color: #fff;
    padding: .7rem 1.1rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: top var(--dur) var(--ease-out);
}
.skip-link:focus { top: 0; }

/* 3. HEADER & NAV ======================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--brand);
    color: #fff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .14), 0 2px 16px rgba(47, 26, 56, .22);
}

.site-header__inner {
    max-width: var(--wrap);
    margin-inline: auto;
    padding: 0 1.25rem;
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: #fff; margin-right: auto; min-width: 0; flex: 0 0 auto; }
.brand img {
    height: 44px; width: 44px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: #fff;
    flex: none;
}
.brand__name { font-family: "Playfair Display", Georgia, serif; font-weight: 700; font-size: 1.12rem; color: #fff; line-height: 1.1; white-space: nowrap; }
.brand__tag { display: block; font-family: Roboto, sans-serif; font-size: .68rem; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .86); }

/* Header phone: present on every page, but quieter than the form CTA. */
.header-call {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .45);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: .5rem .9rem;
    border-radius: 999px;
    white-space: nowrap;
    transition: background var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.header-call:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .75); color: #fff; }
.header-call span { font-size: .93rem; }

.nav-toggle {
    display: none;
    align-items: center;
    gap: .5rem;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: .55rem .8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    /* Must sit above the open panel so it can always be used to close it. */
    position: relative;
    z-index: 1002;
    transition: background var(--dur) var(--ease-out);
}
.nav-toggle:hover { background: rgba(255, 255, 255, .24); }

.main-nav > ul { display: flex; align-items: center; gap: .15rem; }
.main-nav a,
.main-nav .submenu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: .95rem;
    padding: .55rem .7rem;
    border-radius: var(--radius-sm);
    background: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease-out);
}
.main-nav a:hover,
.main-nav .submenu-toggle:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff; /* never dim the text on hover */
}
.main-nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); font-weight: 700; box-shadow: inset 0 -2px 0 #fff; }

.has-submenu { position: relative; }
.submenu-toggle::after {
    content: "";
    width: .42em; height: .42em;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--dur) var(--ease-out);
}
.has-submenu.is-open .submenu-toggle::after { transform: rotate(225deg) translate(-2px, -2px); }

.main-nav .submenu {
    padding: .4rem;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 252px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    /* Animated open rather than display:none, so it does not snap. */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(.985);
    transform-origin: top left;
    transition: opacity var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out),
                visibility 0s linear var(--dur-fast);
}
.has-submenu.is-open .submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out),
                visibility 0s;
}
.submenu a { color: var(--ink); display: block; padding: .6rem .75rem; font-size: .93rem; }
.submenu a:hover { background: var(--brand-tint); color: var(--brand-darker); }
.submenu a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-darker); font-weight: 700; }

.nav-cta {
    background: #fff !important;
    color: var(--brand-darker) !important;
    font-weight: 700 !important;
    margin-left: .5rem;
    box-shadow: 0 1px 3px rgba(47, 26, 56, .28);
}
.nav-cta:hover { background: var(--brand-tint) !important; }

/* 4. SECTIONS ============================================================ */

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }

.section { padding: clamp(3.5rem, 1.75rem + 3.2vw, 4.5rem) 0; }
.section--tint { background: var(--surface); }

.section__head { max-width: 760px; margin: 0 0 2.25rem; }
.section__head h2 { font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.35rem); margin-bottom: .55rem; }
.section__head p { color: var(--muted); font-size: 1.05rem; }
/* Centred on the tinted bands, left-aligned on the white ones, so the page
   is not six identical centred stacks. */
.section--tint .section__head { margin-inline: auto; text-align: center; }

.section__head--rule { position: relative; padding-top: 1.1rem; }
.section__head--rule::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 56px; height: 3px;
    border-radius: 2px;
    background: var(--brand);
}
.section--tint .section__head--rule::before { left: 50%; transform: translateX(-50%); }

/* 5. BUTTONS ============================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .9rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    min-height: 48px;
    transition: transform var(--dur-fast) var(--ease-out),
                background var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out);
}
/* Only lift on devices that genuinely hover: on touch the transform sticks
   after the tap. */
@media (hover: hover) {
    .btn:hover { transform: translateY(-2px); }
}
.btn:active { transform: translateY(1px); }

.btn--brand { background: var(--brand); color: #fff; }
.btn--brand:hover { background: var(--brand-dark); color: #fff; }

.btn--light { background: #fff; color: var(--brand-darker); }
.btn--light:hover { background: var(--brand-tint); color: var(--brand-darker); }

/* Secondary, on dark backgrounds (hero, closing CTA). */
.btn--ghost { background: rgba(255, 255, 255, .10); color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn--ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; border-color: #fff; }

/* Secondary, on light backgrounds (the mobile bar). */
.btn--phone { background: #fff; color: var(--brand-darker); border-color: var(--line-strong); }
.btn--phone:hover { background: var(--brand-tint); color: var(--brand-darker); border-color: var(--brand); }

/* The single most important control on the site. It has to outweigh the
   phone button, the nav CTA and the sticky bar. */
.btn--submit {
    width: 100%;
    background: var(--brand-dark);        /* 9.39:1 with #fff */
    color: #fff;
    font-size: 1.08rem;
    padding: 1.05rem 1.5rem;
    min-height: 56px;
    box-shadow: 0 2px 0 var(--brand-darker), 0 6px 16px rgba(69, 39, 79, .28);
}
.btn--submit:hover { background: var(--brand-darker); color: #fff; box-shadow: 0 2px 0 var(--brand-deep), 0 10px 22px rgba(69, 39, 79, .34); }
.btn--submit:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--brand-darker); }
.btn--submit[disabled] { opacity: .8; cursor: progress; box-shadow: none; transform: none; }

.btn__spinner {
    width: 1.05em; height: 1.05em;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 6. HERO ================================================================ */

.hero {
    position: relative;
    background: var(--brand-darker);
    color: #fff;
    isolation: isolate;
}

/* A real <img> rather than a CSS background: relative URLs inside a custom
   property resolve against the stylesheet, not the page, and it lets the
   browser prioritise the LCP image properly. */
.hero__bg {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: -2;
}
/* Even scrim while the copy is full width. The desktop query below shifts it
   to a diagonal once the copy occupies only the left column. */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(158deg, rgba(var(--scrim), .90) 0%, rgba(var(--scrim), .84) 100%);
}

.hero__inner {
    max-width: var(--wrap);
    margin-inline: auto;
    padding: 2rem 1.25rem 2.5rem;
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.hero h1 { color: #fff; font-size: clamp(1.85rem, 5vw, 2.9rem); margin-bottom: .85rem; }
.hero__sub { color: rgba(255, 255, 255, .94); font-size: 1rem; max-width: 46ch; }

/* Replaces the old button pair, which pointed at a form already on screen. */
.hero__alt {
    margin-top: 1.25rem;
    color: rgba(255, 255, 255, .88);
    font-size: .95rem;
}
.hero__alt a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.hero__alt a:hover { text-decoration-thickness: 2px; }

.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.trust-points { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.1rem; padding: 0; }
.trust-points li {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    padding: .35rem .7rem;
    border-radius: 999px;
    font-size: .87rem;
    font-weight: 500;
}
.trust-points i { color: #E9D5F0; }

/* 7. LEAD FORM =========================================================== */

.lead-card {
    background: #fff;
    color: var(--body);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    border: 1px solid var(--line);
}
.lead-card h2 { font-size: 1.4rem; margin-bottom: .3rem; }
.lead-card__note { font-size: .9rem; color: var(--muted); margin-bottom: 1.15rem; }

.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; font-size: .88rem; color: var(--ink); margin-bottom: .3rem; }
.field .req { color: #B3261E; }
.field .hint { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: .8rem .85rem;
    border: 1px solid var(--line-input);
    border-radius: var(--radius-sm);
    /* 16px minimum: anything smaller makes iOS Safari zoom on focus. */
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    min-height: 48px;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.field textarea { min-height: 104px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { box-shadow: inset 0 0 0 1px var(--brand), 0 0 0 6px var(--focus); }

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #B3261E; border-width: 2px; }
.field .error, .consent .error { display: none; color: #B3261E; font-size: .82rem; font-weight: 600; margin-top: .25rem; }
.field .error.is-shown, .consent .error.is-shown { display: block; }

/* Honeypot: hidden from people, visible to naive bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-start; margin: 1rem 0; }
/* 24x24 is the WCAG 2.5.8 minimum target size. */
.consent input { margin-top: .2rem; width: 24px; height: 24px; flex: none; accent-color: var(--brand); }
.consent input[aria-invalid="true"] { outline: 2px solid #B3261E; outline-offset: 2px; }
.consent label { font-size: .82rem; color: var(--body); line-height: 1.5; flex: 1; }
.consent a { color: var(--brand-dark); }
/* The message is a sibling of the label, not inside it, so it never becomes
   part of the checkbox's accessible name. */
.consent .error { flex-basis: 100%; margin-top: 0; }

.form-status {
    /* Stays in the accessibility tree when empty: a live region that is
       display:none until its text changes does not announce. */
    display: block;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
}
.form-status.is-error, .form-status.is-ok { max-height: none; overflow: visible; padding: .9rem 1rem; margin-bottom: 1rem; }
.form-status.is-error { background: #FCEDEC; color: #8C1D18; border: 1px solid #F2B8B5; }
.form-status.is-ok { background: #E6F4EA; color: #10501F; border: 1px solid #A8D5B5; }

/* Trust strip under the button, then the phone as a quiet last resort. */
.form-trust {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem 1rem;
    margin-top: .9rem;
    font-size: .8rem;
    color: var(--muted);
}
.form-trust span { display: inline-flex; align-items: center; gap: .35rem; }
.form-trust i { color: var(--brand); }
.form-foot { font-size: .8rem; color: var(--muted); margin-top: .6rem; line-height: 1.55; }
.form-foot a { color: var(--brand-dark); }

/* 8. CARDS & GRIDS ======================================================= */

.grid { display: grid; gap: 1.5rem; }
.grid--3 { grid-template-columns: minmax(0, 1fr); }

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out);
}
a.card { text-decoration: none; color: inherit; display: block; }
@media (hover: hover) {
    a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
}
.card h3 { font-size: 1.18rem; margin-bottom: .5rem; }
.card p { color: var(--muted); font-size: .96rem; }

.card__icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: linear-gradient(150deg, var(--brand-tint) 0%, var(--brand-tint-2) 100%);
    border: 1px solid var(--brand-tint-2);
    color: var(--brand-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: .9rem;
    transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
@media (hover: hover) {
    a.card:hover .card__icon { background: var(--brand); border-color: var(--brand); color: #fff; }
}

.card__more { display: inline-flex; align-items: center; gap: .4rem; margin-top: .8rem; color: var(--brand-dark); font-weight: 700; font-size: .92rem; }
.card__more i { transition: transform var(--dur) var(--ease-out); }
@media (hover: hover) {
    a.card:hover .card__more i { transform: translateX(4px); }
}

/* Compact link tiles, for the related-services band. */
.tile-grid { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr); }
.tile {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    transition: border-color var(--dur) var(--ease-out), background var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.tile i:first-child {
    width: 34px; height: 34px;
    flex: none;
    border-radius: var(--radius-sm);
    background: var(--brand-tint);
    color: var(--brand-darker);
    display: flex; align-items: center; justify-content: center;
    font-size: .95rem;
}
.tile__arrow { margin-left: auto; color: var(--brand); transition: transform var(--dur) var(--ease-out); }
@media (hover: hover) {
    .tile:hover { border-color: var(--brand); background: var(--brand-tint); transform: translateX(2px); }
    .tile:hover .tile__arrow { transform: translateX(3px); }
}

/* 9. COST TABLE ========================================================== */

.cost-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    max-width: 960px;
    margin-inline: auto;
}
.cost-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.cost-table caption { text-align: left; padding: 1rem 1.15rem .35rem; color: var(--muted); font-size: .88rem; }
.cost-table th, .cost-table td { padding: .9rem 1.15rem; text-align: left; border-bottom: 1px solid var(--line); font-size: .96rem; vertical-align: top; }
.cost-table thead th { background: var(--surface); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cost-table tbody tr:last-child th, .cost-table tbody tr:last-child td { border-bottom: 0; }
.cost-table tbody th { font-weight: 600; color: var(--ink); width: 34%; }
.cost-table .price { font-weight: 700; color: var(--brand-darker); white-space: nowrap; font-size: 1.02rem; width: 22%; }
.cost-table .note { color: var(--muted); font-size: .91rem; }
@media (hover: hover) {
    .cost-table tbody tr { transition: background var(--dur-fast) var(--ease-out); }
    .cost-table tbody tr:hover { background: var(--brand-tint); }
}

/* 10. FAQ / STEPS / PROSE ================================================ */

.faq-list { max-width: 820px; margin-inline: auto; }
/* No overflow:hidden here - it clipped the focus ring off the summary. */
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: .75rem; transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.faq-item[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.faq-item summary {
    cursor: pointer;
    padding: 1.05rem 3rem 1.05rem 1.15rem;
    font-weight: 600;
    color: var(--ink);
    font-size: 1.03rem;
    list-style: none;
    position: relative;
    min-height: 48px;
    border-radius: var(--radius);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "";
    position: absolute;
    right: 1.25rem;
    top: 50%;
    width: .5em; height: .5em;
    margin-top: -.35em;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform var(--dur) var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item summary:hover { background: var(--brand-tint); }
.faq-item .faq-body { padding: 0 1.15rem 1.15rem; color: var(--body); }
/* CSS-only open animation. A JS height transition needs offsetHeight from
   inside a closed <details>, which Chrome renders with content-visibility,
   so the measurement comes back wrong and the panel sticks part-open. */
.faq-item[open] .faq-body { animation: faq-in var(--dur) var(--ease-out); }
@keyframes faq-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.steps { counter-reset: step; display: grid; gap: 1.75rem; grid-template-columns: minmax(0, 1fr); }
.step { position: relative; padding-left: 3.4rem; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 2.5rem; height: 2.5rem;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-family: "Playfair Display", Georgia, serif;
    box-shadow: 0 0 0 5px var(--surface);
    z-index: 1;
}
.step h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.step p { color: var(--muted); font-size: .96rem; }

.prose { max-width: var(--measure); }
.prose p { margin-bottom: 1rem; }
.prose h2 { font-size: 1.35rem; margin: 1.85rem 0 .6rem; }
.prose h3 { font-size: 1.2rem; margin: 1.75rem 0 .5rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.15rem; }
.prose li { margin-bottom: .4rem; }

/* Numbered, ruled treatment for "Before you hire anyone". */
.checklist { counter-reset: check; display: grid; gap: 0; grid-template-columns: minmax(0, 1fr); }
.checklist > div {
    counter-increment: check;
    position: relative;
    padding: 1.5rem 0 1.5rem 3rem;
    border-top: 1px solid var(--line);
    max-width: 62ch;
}
.checklist > div::before {
    content: counter(check, decimal-leading-zero);
    position: absolute;
    left: 0; top: 1.5rem;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--brand);
}
.checklist > div h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.checklist > div p { color: var(--muted); font-size: .97rem; }

.note-box {
    border-left: 4px solid var(--brand);
    background: var(--brand-tint);
    padding: 1.1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.75rem auto 0;
    max-width: 820px;
}
.note-box p { margin: 0; color: var(--brand-darker); font-size: .96rem; }
.note-box strong { color: var(--brand-darker); }

.callout-urgent {
    background: #FFF4ED;
    border: 1px solid #F5C6A5;
    border-left: 4px solid var(--urgent);
    padding: 1.1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 1.5rem;
}
.callout-urgent strong { color: #8A2C08; }
.callout-urgent p { margin: 0; color: #7A3A1C; }

/* Inline CTA strip, used under the cost table. */
.inline-cta {
    max-width: 960px;
    margin: 1.75rem auto 0;
    padding: 1.35rem 1.5rem;
    background: var(--brand-tint);
    border: 1px solid var(--brand-tint-2);
    border-radius: var(--radius);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}
.inline-cta p { margin: 0; flex: 1 1 22rem; color: var(--brand-darker); font-weight: 600; }

/* 11. FOOTER & ACTION BAR ================================================ */

.closing-cta { background: var(--brand-darker); color: #fff; text-align: center; padding: clamp(3.5rem, 1.75rem + 3.2vw, 4.5rem) 0; }
.closing-cta h2 { color: #fff; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.2rem); margin-bottom: .75rem; }
.closing-cta p { color: rgba(255, 255, 255, .92); max-width: 55ch; margin: 0 auto 1.75rem; }
.closing-cta .hero__actions { justify-content: center; margin-top: 0; }

.site-footer { background: var(--brand-deep); color: #D9D0DD; padding: 3rem 0; font-size: .92rem; }
.site-footer a { color: #EADFEE; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 2rem; }
.footer-grid h3 { color: #fff; font-size: .82rem; margin-bottom: .75rem; font-family: Roboto, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.footer-grid li { margin-bottom: .45rem; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; justify-content: space-between; color: #B7ADBC; font-size: .86rem; }
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-disclaimer { margin-top: 1rem; color: #9E93A3; font-size: .82rem; max-width: 75ch; line-height: 1.6; }

/* Light-background pill list. Kept separate from .trust-points, which is
   white-on-translucent-white and only legible over the dark hero. */
.town-list {
    display: flex; flex-wrap: wrap; gap: .5rem;
    justify-content: center;
    max-width: 900px; margin-inline: auto;
    padding: 0; list-style: none;
}
.town-list li {
    background: #fff;
    border: 1px solid var(--line);
    color: var(--body);
    padding: .4rem .85rem;
    border-radius: 999px;
    font-size: .89rem;
}

.action-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1100;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 20px rgba(47, 26, 56, .16);
    padding: .6rem .75rem calc(.6rem + env(safe-area-inset-bottom));
    gap: .6rem;
}
/* The bar states a preference: the form gets the width, the phone a fixed,
   quieter slot on the right. */
.action-bar .btn { padding: .8rem .5rem; font-size: .97rem; }
.action-bar__primary { flex: 1 1 auto; }
.action-bar__secondary { flex: 0 0 auto; min-width: 104px; gap: .4rem; }

/* The action bar is fixed with a higher z-index than the nav panel, so while
   the menu is open it sat on top of the menu's last items and swallowed taps. */
body.nav-open .action-bar { display: none; }

/* 12. RESPONSIVE ========================================================= */

@media (min-width: 560px) {
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* An odd last card fills the row rather than sitting half-width beside a
       hole. Only index.html is affected; service-page grids have 6 children. */
    .grid--3 > :nth-child(odd):last-child { grid-column: 1 / -1; }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 620px) {
    .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.5rem; }
    .checklist > div:nth-child(2) { border-top: 1px solid var(--line); }
}

@media (min-width: 820px) {
    .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
    /* Connect the three steps so it reads as a process, not a third card grid. */
    .steps .step::after {
        content: "";
        position: absolute;
        top: 1.25rem;
        left: 2.5rem;
        right: -2rem;
        height: 2px;
        background: var(--line-strong);
    }
    .steps .step:last-child::after { display: none; }
    .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Tablet band: pair the form fields so the inputs are not 3x wider than any
   input needs to be. */
@media (min-width: 620px) and (max-width: 899px) {
    .lead-card { max-width: 42rem; margin-inline: auto; }
    [data-lead-form] { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
    [data-lead-form] > * { grid-column: 1 / -1; }
    [data-lead-form] > .field:nth-child(2),
    [data-lead-form] > .field:nth-child(3),
    [data-lead-form] > .field:nth-child(4),
    [data-lead-form] > .field:nth-child(5) { grid-column: span 1; }
    /* Phone and email carry a .hint, so their labels are a line taller than
       the name and town labels beside them. Bottom-align the controls. */
    [data-lead-form] > .field { display: flex; flex-direction: column; }
    [data-lead-form] > .field > input,
    [data-lead-form] > .field > select { margin-top: auto; }
}

/* Below the desktop nav threshold: hamburger, sticky action bar. */
@media (max-width: 899px) {
    .nav-toggle { display: inline-flex; }
    .brand__tag { display: none; }

    .main-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--brand-dark);
        border-top: 1px solid rgba(255, 255, 255, .18);
        box-shadow: 0 14px 30px rgba(47, 26, 56, .32);
        /* Scrolls internally, so long menus can always be reached. */
        max-height: calc(100vh - var(--header-h));
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        padding: .6rem;
        z-index: 1001;
        /* Animated rather than display:none, so it does not snap open. */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity var(--dur) var(--ease-out),
                    transform var(--dur) var(--ease-out),
                    visibility 0s linear var(--dur);
    }
    .main-nav.is-open { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out), visibility 0s; }

    .main-nav > ul { display: block; }
    .main-nav a,
    .main-nav .submenu-toggle { display: flex; width: 100%; padding: .8rem .9rem; font-size: 1rem; justify-content: space-between; }
    .nav-cta { margin: .4rem 0 0; justify-content: center !important; }

    /* Reset the desktop dropdown's transform/visibility inside the panel. */
    .main-nav .submenu {
        margin: .2rem 0 .4rem;
        position: static;
        box-shadow: none;
        border: 0;
        background: rgba(0, 0, 0, .2);
        min-width: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        transition: none;
    }
    .has-submenu.is-open .submenu { display: block; }
    .submenu a { color: #fff; padding-left: 1.6rem; }
    .submenu a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
    .submenu a[aria-current="page"] { background: rgba(255, 255, 255, .2); color: #fff; }

    /* Was display:none, which also stripped the link's accessible name and
       left an unlabelled anchor in the header at every mobile width. */
    .header-call span {
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .header-call { padding: .5rem .7rem; }

    .action-bar { display: flex; }
    .site-footer { padding-bottom: calc(var(--action-bar-h) + 1rem + env(safe-area-inset-bottom)); }
}

/* A centred, rounded bar reads better than full-bleed on a wide phone. */
@media (min-width: 560px) and (max-width: 899px) {
    .action-bar {
        left: 50%; right: auto;
        transform: translateX(-50%);
        width: min(100% - 1.5rem, 30rem);
        border: 1px solid var(--line);
        border-bottom: 0;
        border-radius: 16px 16px 0 0;
    }
}

@media (min-width: 900px) {
    .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid--3 > :nth-child(odd):last-child { grid-column: auto; }
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }

    .hero__inner { grid-template-columns: 1.05fr .95fr; gap: 2.5rem; padding-block: 3rem 3.5rem; }
    .hero--narrow .hero__inner { grid-template-columns: 1fr; max-width: 820px; }
    /* Above 900 the headline lives in half the wrap, so track the column
       rather than the viewport. */
    .hero h1 { font-size: clamp(1.9rem, 3.5vw, 2.9rem); }
    .hero__sub { font-size: 1.08rem; }
    .trust-points { gap: .5rem; margin-top: 1.5rem; }

    /* Now the copy sits in the left column only, so the scrim can open up on
       the right and let the photograph actually show. */
    .hero::after {
        background: linear-gradient(101deg,
            rgba(var(--scrim), .91) 0%,
            rgba(var(--scrim), .86) 30%,
            rgba(var(--scrim), .70) 52%,
            rgba(var(--scrim), .36) 76%,
            rgba(var(--scrim), .28) 100%);
    }
}

/* The desktop nav switches on at 900px, but brand + 6 nav items + the phone
   pill need ~1035px. Between the two, drop the phone label to its icon so the
   row fits and the wordmark stays on one line. */
@media (min-width: 900px) and (max-width: 1059px) {
    .header-call span {
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .header-call { padding: .5rem .7rem; }
    .main-nav a, .main-nav .submenu-toggle { padding: .55rem .5rem; font-size: .92rem; }
    .brand__tag { display: none; }
}

/* Narrow phones: the row is exactly saturated, so the Menu label is what
   pushes the wordmark onto three lines. Keep the accessible name. */
@media (max-width: 430px) {
    .brand img { height: 38px; width: 38px; }
    .brand__name { font-size: 1rem; }
    .site-header__inner { gap: .6rem; padding-inline: .9rem; }
    .nav-toggle__label {
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0;
        overflow: hidden;
        clip: rect(0 0 0 0);
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .nav-toggle { padding: .55rem .65rem; }
}

@media (min-width: 1100px) {
    .hero__inner { gap: 3rem; padding-block: 3.5rem 4rem; }
    .lead-card { padding: 1.75rem; }
}

/* The cost table hid up to 47% of itself behind an invisible overlay
   scrollbar on phones, and stayed cramped (prices wrapping to three lines)
   until about 760px. Stack each row into a self-labelling card below that. */
@media (max-width: 767px) {
    .cost-table-wrap { overflow-x: visible; border: 0; background: none; border-radius: 0; box-shadow: none; position: relative; }
    .cost-table { min-width: 0; display: block; }
    .cost-table caption { display: block; padding: 0 0 .75rem; }
    .cost-table thead {
        position: absolute;
        width: 1px; height: 1px;
        margin: -1px; padding: 0; border: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .cost-table tbody { display: block; }
    .cost-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        padding: .95rem 1.05rem;
        margin-bottom: .75rem;
        box-shadow: var(--shadow-sm);
    }
    .cost-table tbody tr:last-child { margin-bottom: 0; }
    .cost-table tbody th,
    .cost-table tbody td { display: block; padding: 0; border: 0; width: auto; }
    .cost-table tbody th { font-size: 1.02rem; line-height: 1.35; margin-bottom: .35rem; }
    .cost-table .price { width: auto; font-size: 1.2rem; margin-bottom: .4rem; white-space: normal; }
    .cost-table .note { font-size: .92rem; }
}

/* MOTION: scroll reveal ---------------------------------------------------
   The hidden state is added by JS (js-reveal on <html>), so with JavaScript
   off or broken every section is simply visible. */
.js-reveal [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
}
.js-reveal [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

/* Respect a user's OS-level motion preference. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
    /* Never move anything, and never leave revealed content stuck hidden. */
    .btn:hover, .btn:active, a.card:hover, .tile:hover,
    .btn--submit:active, a.card:hover .card__more i, .tile:hover .tile__arrow { transform: none; }
    .js-reveal [data-reveal] { opacity: 1; transform: none; }
    .btn__spinner { animation: none; border-top-color: rgba(255, 255, 255, .45); }
}

@media print {
    .site-header, .action-bar, .lead-card, .closing-cta, .hero__bg, .skip-link { display: none !important; }
    body { color: #000; background: #fff; }
    /* The hero and footer are light-on-dark on screen; invert them for paper
       so the h1 and the footer disclaimer are not printed white on white. */
    .hero, .site-footer { background: #fff !important; color: #000 !important; }
    .hero::after { display: none !important; }
    .hero h1, .hero__sub, .hero__alt, .site-footer a, .footer-grid h3, .footer-bottom, .footer-disclaimer { color: #000 !important; }
    .trust-points li { border-color: #666; color: #000; }
    /* Chrome hides a closed <details> through ::details-content, so a
       display value on the child cannot open it. */
    .faq-item::details-content { content-visibility: visible !important; block-size: auto !important; }
    .faq-item .faq-body { display: block !important; }
    .faq-item summary::after { display: none !important; }
    /* Without this every section never scrolled to prints blank. */
    .js-reveal [data-reveal] { opacity: 1 !important; transform: none !important; }
    a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
}
