/*
 * DOM/CSS Constraints & Notes:
 * 1. Form steps (`fieldset`) are hidden by default and animated in via `@keyframes`.
 * 2. The CSS state machine uses `:has()` to detect checked radio buttons and progressively reveal steps.
 * 3. The transition from Zipcode to Contact is controlled by the `data-valid-zip="1"` attribute.
 * 4. The final form submission transitions to the success state via the `data-result="lead"` attribute.
 * 5. Articles use negative margins on mobile to break out of the section padding and bleed full-width.
 * 6. The `#process` section uses CSS Grid on the `<li>` elements to position the `::before` pseudo-element
 *    as an icon box spanning two rows, avoiding the need for an extra HTML wrapper around the text content.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap');

:root {
    /* Theme Palette */
    --ink: #14181a;
    --ink-soft: #4a4e4f;
    --muted: #7a7d78;
    --cream: #f6f3ee;
    --cream-2: #efe9de;
    --paper: #fefdfb;
    --charcoal: #151b2e;
    --charcoal-deep: #0b0f1c;
    --amber: #ff7a29;
    --amber-hover: #e8661a;
    --amber-tint: #ffe3cf;
    --border: #e6ded2;
    --sub: #c7c9c4;

    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-sans: 'Inter', sans-serif;

    /* Structural & Metrics */
    --max-width: 1200px;
    --transition: 0.2s ease-in-out;
}

/* ==========================================================================
   RESET & BASE
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    color: var(--ink);
    background-color: var(--paper);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    transition: color var(--transition);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background-color: var(--paper);
    border-bottom: 1px solid var(--border);
    max-width: 100%;
}

header > a:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
}

header > a:first-child img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 50%;
}

header > a:first-child span {
    display: flex;
    flex-direction: column;
    font-family: var(--font-display);
    font-size: 12px;
    line-height: 1.05;
    font-weight: 700;
    color: var(--ink);
    text-transform: uppercase;
}

header > a:first-child span strong {
    color: var(--amber-hover);
    font-weight: 700;
}

header > a:last-child {
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}

header > a:last-child:hover {
    color: var(--amber);
}

header > a:last-child::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: var(--ink-soft);
    mask-image: url('../images/icons/phone.svg');
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url('../images/icons/phone.svg');
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    transition: background-color var(--transition);
}

header > a:last-child:hover::before {
    background-color: var(--amber);
}

/* ==========================================================================
   HERO & QUOTE SECTION
   ========================================================================== */
#hero-quote {
    background-color: var(--charcoal);
    padding: 40px 20px;
    color: var(--paper);
}

#hero-quote h1 {
    font-family: var(--font-display);
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    color: var(--paper);
    font-weight: 800;
}

#hero-quote h1 em,
#hero-quote h1 span {
    color: var(--amber);
    font-style: normal;
}

#hero-quote > p {
    font-size: 16px;
    color: var(--sub);
    margin-bottom: 32px;
    line-height: 1.5;
    opacity: 0.9;
}

/* ==========================================================================
   FORM & WIZARD STYLES (STATE MACHINE)
   ========================================================================== */
#lead-form {
    background-color: var(--paper);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    color: var(--ink);
    position: relative;
    overflow: hidden;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#lead-form fieldset {
    display: none; /* Hidden by default */
    border: none;
    margin: 0;
    padding: 0;
    animation: slideUpFade 0.3s ease-out forwards;
}

#lead-form legend {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 14px;
    width: 100%;
    line-height: 1.3;
}

/*
 * CSS-ONLY WIZARD ROUTING
 * Utilizes general sibling states & :has() to progress the UI
 */

/* Step 1: Space (Visible initially) */
#lead-form:not(:has(input[name="space_type"]:checked)) #step-space {
    display: block;
}

/* Step 2: Size */
#lead-form:has(input[name="space_type"]:checked):not(:has(input[name="size"]:checked)) #step-size {
    display: block;
}

/* Step 3: Condition */
#lead-form:has(input[name="size"]:checked):not(:has(input[name="condition"]:checked)) #step-condition {
    display: block;
}

/* Step 4: Finish */
#lead-form:has(input[name="condition"]:checked):not(:has(input[name="finish"]:checked)) #step-finish {
    display: block;
}

/* Step 5: Homeowner */
#lead-form:has(input[name="finish"]:checked):not(:has(input[name="homeowner"]:checked)) #step-homeowner {
    display: block;
}

/* Step 6: Timeline */
#lead-form:has(input[name="homeowner"]:checked):not(:has(input[name="timeline"]:checked)) #step-timeline {
    display: block;
}

/* Step 7: Zipcode (Shown when timeline selected & body lacks data-valid-zip="1") */
body:not([data-valid-zip="1"]) #lead-form:has(input[name="timeline"]:checked) #step-zipcode {
    display: block;
}

/* Step 8: Contact (Shown when body has data-valid-zip="1") */
body[data-valid-zip="1"] #step-contact {
    display: block;
}

/* Final Success Step Visibility Logic */
body[data-result="lead"] #lead-form {
    display: none;
}

#step-done {
    display: none;
}

body[data-result="lead"] #step-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: var(--paper);
    border-radius: 16px;
    padding: 40px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    animation: slideUpFade 0.5s ease forwards;
}

/* --------------------------------------------------------------------------
   Radio Button Cards (Steps 1-6)
   -------------------------------------------------------------------------- */
fieldset > div:has(input[type="radio"]) {
    margin-bottom: 12px;
}

input[type="radio"] {
    appearance: none;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

input[type="radio"] + label {
    display: flex;
    align-items: center;
    padding: 20px 30px 20px 20px;
    background-color: var(--cream-2);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    transition: all var(--transition);
    position: relative;

    /* Right Arrow Icon */
    background-image: url('../images/icons/chevron-right.svg');
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

input[type="radio"]:hover + label {
    background-color: var(--cream);
}

input[type="radio"]:checked + label {
    background-color: var(--amber-tint);
}

input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Step 1 & 2 Specific: Option Cards (With Dark Box & Masked Icons)
   -------------------------------------------------------------------------- */
#step-space input[type="radio"] + label,
#step-size input[type="radio"] + label {
    padding-left: 58px;
}

#step-space input[type="radio"] + label::before,
#step-size input[type="radio"] + label::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    background-color: var(--charcoal);
    border-radius: 8px;
    z-index: 1;
}

#step-space input[type="radio"] + label::after,
#step-size input[type="radio"] + label::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    background-color: var(--amber);
    -webkit-mask-size: 16px;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: 16px;
    mask-repeat: no-repeat;
    mask-position: center;
    z-index: 2;
}

/* Step 1 Icons */
label[for="space-garage"]::after { -webkit-mask-image: url('../images/icons/garage.svg'); mask-image: url('../images/icons/garage.svg'); }
label[for="space-basement"]::after { -webkit-mask-image: url('../images/icons/basement.svg'); mask-image: url('../images/icons/basement.svg'); }
label[for="space-patio"]::after { -webkit-mask-image: url('../images/icons/patio.svg'); mask-image: url('../images/icons/patio.svg'); }
label[for="space-other"]::after { -webkit-mask-image: url('../images/icons/other.svg'); mask-image: url('../images/icons/other.svg'); }

/* Step 2 Icons */
label[for="size-under-250"]::after { -webkit-mask-image: url('../images/icons/1-car.svg'); mask-image: url('../images/icons/1-car.svg'); }
label[for="size-250-500"]::after { -webkit-mask-image: url('../images/icons/2-car.svg'); mask-image: url('../images/icons/2-car.svg'); mask-size: 24px !important; -webkit-mask-size: 24px !important; }
label[for="size-500-plus"]::after { -webkit-mask-image: url('../images/icons/3-car.svg'); mask-image: url('../images/icons/3-car.svg'); mask-size: 22px !important; -webkit-mask-size: 22px !important; }
label[for="size-not-sure"]::after { -webkit-mask-image: url('../images/icons/help.svg'); mask-image: url('../images/icons/help.svg'); }

/* --------------------------------------------------------------------------
   Step 7 & 8: Text Inputs (Zipcode & Contact Form)
   -------------------------------------------------------------------------- */
#step-zipcode label[for="zip"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#step-contact > p:first-of-type {
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 14px;
    line-height: 1.5;
}

#step-zipcode div,
#step-contact div {
    margin-bottom: 14px;
    text-align: left;
}

#step-contact label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

#step-zipcode input[type="text"],
#step-contact input[type="text"],
#step-contact input[type="email"],
#step-contact input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--ink);
    transition: all var(--transition);
    outline: none;
    background-color: var(--paper);
    font-weight: 500;
}

#step-zipcode input::placeholder,
#step-contact input::placeholder {
    color: var(--muted);
    font-weight: 500;
}

#step-zipcode input:focus,
#step-contact input:focus {
    border-color: var(--amber);
}

/* Pill Buttons */
#step-zipcode button,
#step-contact button {
    width: 100%;
    padding: 18px;
    background-color: var(--amber);
    color: var(--ink);
    border: none;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all var(--transition);
}

#step-zipcode button::after {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask-image: url('../images/icons/arrow-right.svg');
    mask-image: url('../images/icons/arrow-right.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

#step-zipcode button:hover,
#step-contact button:hover {
    background-color: var(--amber-hover);
}

/* Disabled State Logic via :has(:invalid) */
#step-zipcode:has(input:invalid) button,
#step-contact:has(input:invalid) button {
    opacity: 0.45;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Step 8 Specific: Disclaimers & TrustedForm
   -------------------------------------------------------------------------- */
#step-contact small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 14px;
    line-height: 1.5;
    text-align: left;
}

#step-contact > p:last-of-type {
    background-color: var(--cream-2);
    padding: 12px 14px 12px 40px;
    border-radius: 8px;
    font-size: 11px;
    color: var(--ink-soft);
    margin-top: 14px;
    position: relative;
    text-align: left;
    line-height: 1.5;
}

#step-contact > p:last-of-type strong {
    color: var(--ink-soft);
}

/* Shield Icon */
#step-contact > p:last-of-type::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 14px;
    width: 18px;
    height: 18px;
    background-color: var(--amber);
    -webkit-mask-image: url('../images/icons/shield.svg');
    mask-image: url('../images/icons/shield.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

/* --------------------------------------------------------------------------
   Success State (`#step-done`)
   -------------------------------------------------------------------------- */
#step-done h2 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 12px;
}

/* Amber checkmark circle above the heading */
#step-done h2::before {
    content: '';
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="%2314181a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M20 6L9 17l-5-5"/></svg>') center/24px no-repeat, var(--amber);
}

#step-done p {
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Small Helper Text (Global to Form)
   -------------------------------------------------------------------------- */
#lead-form > p:last-of-type {
    text-align: center;
    margin-top: 16px;
    color: var(--muted);
}

#lead-form > p:last-of-type small {
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   ACCOLADES SECTION
   ========================================================================== */
#accolades {
    padding: 20px 20px;
    background-color: var(--paper);
    text-align: center;
}

#accolades h2 {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    color: var(--amber-hover);
    letter-spacing: 0.02em;
    margin-bottom: 20px;
}

#accolades ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
    margin-bottom: 12px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    list-style: none;
}

#accolades li {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.01em;
}

#accolades p {
    color: var(--muted);
}

#accolades p small {
    font-size: 11px;
}

/* ==========================================================================
   CTA EXPERTS SECTION
   ========================================================================== */
#cta-experts {
    background-color: var(--charcoal);
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#cta-experts h2 {
    font-family: var(--font-display);
    font-size: 26px;
    line-height: 1.25;
    color: var(--cream);
    margin-bottom: 16px;
    font-weight: 700;
}

#cta-experts h2 span,
#cta-experts h2 em {
    color: var(--amber);
    font-style: normal;
}

#cta-experts p {
    font-size: 15px;
    color: var(--sub);
    line-height: 1.5;
    margin-bottom: 32px;
    max-width: 500px;
}

/* CTA Buttons */
#cta-experts a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    padding: 16px;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

/* "Get My Free Quote" Button */
#cta-experts a[href="#lead-form"] {
    background-color: var(--amber);
    color: var(--ink);
}

#cta-experts a[href="#lead-form"]:hover {
    background-color: var(--amber-hover);
    color: var(--paper);
}

/* Phone Number Button */
#cta-experts a[href^="tel"] {
    background-color: transparent;
    color: var(--paper);
    border: 2px solid var(--amber);
    margin-bottom: 0;
}

#cta-experts a[href^="tel"]:hover {
    background-color: var(--charcoal-deep);
    color: var(--amber-hover);
}

/* ==========================================================================
   SERVICES SECTION
   ========================================================================== */
#services {
    padding: 40px 18px 0 18px;
    background-color: var(--paper);
    max-width: var(--max-width);
    margin: 0 auto;
}

#services > h2 {
    text-align: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--charcoal-deep);
    margin-bottom: 12px;
    line-height: 1.25;
}

#services > h2 em,
#services > h2 span {
    color: var(--amber-hover);
    font-style: normal;
}

#services > p {
    text-align: center;
    color: var(--ink-soft);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Top Services Overview List */
#services > ul {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    list-style: none;
    margin-bottom: 40px;
}

#services > ul li {
    display: flex;
    align-items: center;
    padding: 13px 14px;
    background-color: var(--paper);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink);
    gap: 8px;
    line-height: 1.4;
    box-shadow: 0 2px 4px rgba(0,0,0,0.01);
}

/* Sparkle Icon Box */
#services > ul li::before {
    content: '';
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background-color: var(--amber-tint);
    border-radius: 8px;
    background-image: url('../images/icons/sparkle.svg');
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* --------------------------------------------------------------------------
   Service Detail Articles (Cards)
   -------------------------------------------------------------------------- */
#services article {
    background-color: var(--cream);
    padding: 32px 18px; /* Internal padding keeps text from touching edges */
    display: flex;
    flex-direction: column;
    gap: 16px;

    /* Negative margins pull the article out of the section's 18px padding to span full viewport width */
    margin-left: -18px;
    margin-right: -18px;
    margin-bottom: 24px;
    border-radius: 0;
}

#services article:last-child {
    margin-bottom: 0;
}

#services article img {
    width: 100%;
    border-radius: 12px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    background-color: var(--cream-2);
}

#services article h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.3;
}

#services article p {
    font-size: 14px;
    color: var(--ink-soft);
    margin: 0;
    line-height: 1.6;
    text-align: left;
}

#services article ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#services article ul li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink);
    font-weight: 400;
    line-height: 1.4;

    /* Resetting the top-level list card styles */
    background-color: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

#services article ul li::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background-color: var(--amber);
    -webkit-mask-image: url('../images/icons/check.svg');
    mask-image: url('../images/icons/check.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    border-radius: 0;
    background-image: none;
    margin-top: 1px;
}

#services article a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    background-color: var(--amber);
    color: var(--ink);
    border-radius: 50px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 16px;
    transition: all var(--transition);
    margin-top: 8px;
}

#services article a:hover {
    background-color: var(--amber-hover);
}

/* ==========================================================================
   TRUST MATCH SECTION
   ========================================================================== */
#trust-match {
    background-color: var(--charcoal);
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#trust-match h2 {
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1.25;
    color: var(--cream);
    margin-bottom: 16px;
    font-weight: 700;
    max-width: 500px;
}

#trust-match h2 em,
#trust-match h2 span {
    color: var(--amber);
    font-style: normal;
}

#trust-match > p:first-of-type {
    font-size: 14px;
    color: var(--sub);
    line-height: 1.5;
    margin-bottom: 24px;
    max-width: 500px;
}

/* CTA Buttons */
#trust-match a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    padding: 16px;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

#trust-match a[href="#lead-form"] {
    background-color: var(--amber);
    color: var(--ink);
}

#trust-match a[href="#lead-form"]:hover {
    background-color: var(--amber-hover);
    color: var(--paper);
}

#trust-match a[href^="tel"] {
    background-color: transparent;
    color: var(--paper);
    border: 2px solid var(--amber);
    margin-bottom: 32px;
}

#trust-match a[href^="tel"]:hover {
    background-color: var(--charcoal-deep);
    color: var(--amber-hover);
}

/* Subtext & Validations */
#trust-match p:nth-of-type(2) {
    margin-bottom: 16px;
}

#trust-match p strong {
    color: var(--amber);
    font-weight: 700;
    font-size: 14px;
}

/* Bullet Point Verification List */
#trust-match ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    width: fit-content;
}

#trust-match ul li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--cream);
    font-weight: 400;
    line-height: 1.4;
}

#trust-match ul li::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background-color: var(--amber);
    -webkit-mask-image: url('../images/icons/check.svg');
    mask-image: url('../images/icons/check.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    margin-top: 3px;
}

/* ==========================================================================
   PROCESS SECTION (What to Expect)
   ========================================================================== */
#process {
    padding: 40px 18px;
    background-color: var(--paper);
    max-width: var(--max-width);
    margin: 0 auto;
}

#process h2 {
    text-align: center;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 32px;
    line-height: 1.25;
}

#process h2 em,
#process h2 span {
    color: var(--amber-hover);
    font-style: normal;
}

#process ol {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 600px;
}

#process li {
    display: grid;
    grid-template-columns: 48px 1fr;
    grid-template-rows: auto 1fr;
    column-gap: 8px;
    row-gap: 4px;
    align-items: start;
}

/* Icon Box spanning both text rows */
#process li::before {
    content: '';
    grid-column: 1;
    grid-row: 1 / 3;
    width: 40px;
    height: 40px;
    background-color: var(--cream-2);
    border-radius: 12px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px;
}

/* Specific SVG Icons inline via background-image for precision mapping */
#process li:nth-child(1)::before {
    background-image: url('../images/icons/house.svg');
}

#process li:nth-child(2)::before {
    background-image: url('../images/icons/tool.svg');
}

#process li:nth-child(3)::before {
    background-image: url('../images/icons/house-with-door.svg');
}

#process h3 {
    grid-column: 2;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    padding-top: 2px;
    line-height: 1.3;
}

#process p {
    grid-column: 2;
    font-size: 13px;
    color: var(--ink-soft);
    margin: 0;
    line-height: 1.5;
}

/* ==========================================================================
   FINAL CTA SECTION
   ========================================================================== */
#final-cta {
    background-color: var(--charcoal);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#final-cta img {
    width: 100%;
    border-radius: 16px;
    margin-bottom: 24px;
    object-fit: cover;
    background-color: var(--ink);
    height: 180px;
}

#final-cta h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--cream);
    margin-bottom: 12px;
    line-height: 1.25;
}

#final-cta h2 em,
#final-cta h2 span {
    color: var(--amber);
    font-style: normal;
}

#final-cta p {
    font-size: 14px;
    color: var(--sub);
    line-height: 1.5;
    margin-bottom: 14px;
}

#final-cta a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
    border-radius: 50px;
    background-color: var(--amber);
    color: var(--ink);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 16px;
    transition: all var(--transition);
}

#final-cta a:hover {
    background-color: var(--amber-hover);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background-color: var(--charcoal-deep);
    color: var(--sub);
    padding: 40px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

footer p:first-of-type strong {
    color: var(--amber);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.02em;
}

footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 24px;
}

footer nav a {
    color: var(--sub);
    font-size: 12px;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: all var(--transition);
}

footer nav a:hover {
    color: var(--amber);
    text-decoration-color: var(--amber);
}

footer p:last-of-type small {
    display: block;
    font-size: 12px;
    color: #8b8e89;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   DESKTOP ADJUSTMENTS
   ========================================================================== */
@media (min-width: 374px) {
    #services > ul {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
}

@media (min-width: 768px) {

    #hero-quote {
        align-items: center;
        padding: 40px max(10vw, calc(50vw - 400px));
    }

    #hero-quote h1 {
        font-size: 48px;
    }

    #hero-quote > p {
        font-size: 18px;
    }

    #lead-form {
        padding: 32px;
    }

    /* Convert #services into a grid to layout articles nicely side by side */
    #services {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        padding-top: 80px;
        padding-bottom: 80px;
    }

    /* Make introductory elements span full width */
    #services > h2,
    #services > p,
    #services > ul {
        grid-column: 1 / -1;
    }

    #services article {
        /* Reset mobile full-bleed styles to restore card behavior on desktop */
        margin: 0;
        border-radius: 16px;
        padding: 32px;
    }

    /* Process steps flow horizontally on desktop */
    #process ol {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        max-width: none;
    }

    /* Desktop adjustments for the Final CTA Section */
    #final-cta {
        padding: 80px calc(50vw - (var(--max-width) / 2));
        align-items: center;
        text-align: center;
    }

    #final-cta img {
        max-width: 800px;
        margin: 0 auto 40px;
    }

    #final-cta h2, #final-cta p {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    #final-cta a {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}