/* Home page — layout the shared system (site.css) does not already cover. Tokens only. */

/* Estimate form extras (shared partial) */
.estimate-form legend small { font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--ink-3); font-size: .8rem; }
.estimate-form__more { margin: 10px 0 0; font-size: .88rem; color: var(--ink-2); }
.estimate-form__more a, .estimate-form__note a { color: var(--link); font-weight: 600; }
.estimate-form__actions { display: grid; gap: 10px; }
.estimate-form--compact { gap: 16px; }
.estimate-form--compact .chip span { min-height: 44px; padding: 8px 12px; font-size: .9rem; }

/* Cover */
.cover__grid { grid-template-columns: minmax(0, 1fr) minmax(380px, 480px); }
.cover__form > p { margin-bottom: 18px; }
.cover__title { font-size: clamp(2.5rem, 1.1rem + 3.5vw, 4.6rem); max-width: 19ch; text-wrap: balance; }
.cover__scope { margin-bottom: 24px; }
.cover__stamps .stamp-row { grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; grid-template-columns: none; gap: 8px; }
.cover__stamps .stamp { min-height: 64px; padding: 8px 4px; font-size: .64rem; letter-spacing: .05em; }
.cover__stamps .stamp b { font-size: 1.15rem; }
/* The plate fills the rest of the cover; callouts are pinned in photo pixels (1920x1080)
   and follow the object-fit crop through container units, so they stay on target at any size. */
.cover__plate { container-type: size; flex: 1 1 auto; aspect-ratio: auto; min-height: 400px; margin-top: 0; }
.cover__plate img { position: absolute; inset: 0; object-position: center; }
.cover__plate .callout {
    --u: max(100cqw / 1920, 100cqh / 1080);
    top: calc(50cqh + (var(--ty) - 540) * var(--u) - 1.05em);
    white-space: nowrap; max-width: none;
}
.cover__plate .callout--r { right: calc(50cqw - (var(--tx) - 960) * var(--u) + var(--lead)); }
.cover__plate .callout--l { left: calc(50cqw + (var(--tx) - 960) * var(--u) + var(--lead)); }
@supports not (width: 1cqw) { .cover__plate .callout { display: none; } }
.cover__plate figcaption { flex-wrap: wrap; row-gap: 2px; z-index: 3; }
@media (max-width: 980px) {
    .cover__grid { grid-template-columns: 1fr; }
    .cover__plate { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
}
@media (max-width: 560px) {
    .cover__plate { aspect-ratio: 16 / 10; margin-top: 18px; }
    .cover__plate figcaption { font-size: .66rem; }
    .cover__title { margin-bottom: .25em; }
    .cover__scope { font-size: var(--step-0); margin-bottom: 0; }
    /* Short form: every control stays a 44px+ target, the air between groups goes */
    .cover__form { padding-block: 20px; }
    .cover__form h2 { margin-bottom: .1em; }
    .cover__form > p { margin-bottom: 12px; font-size: .92rem; }
    .estimate-form--compact { gap: 12px; }
    .estimate-form--compact legend, .estimate-form--compact .field label { margin-bottom: 5px; }
    .estimate-form--compact .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
    .estimate-form--compact .chip span { display: flex; min-height: 44px; padding: 6px 10px; font-size: .86rem; line-height: 1.15; }
    .estimate-form--compact fieldset:first-of-type .chips { grid-template-columns: repeat(3, auto); }
    .estimate-form--compact fieldset:first-of-type .chip span { padding-inline: 8px; gap: 5px; font-size: .8rem; }
    .estimate-form--compact .estimate-form__more { margin-top: 6px; font-size: .8rem; }
    .estimate-form--compact .field input { min-height: 46px; }
    .estimate-form--compact .estimate-form__submit { min-height: 54px; }
    .estimate-form--compact .estimate-form__actions { gap: 8px; }
    .cover__stamps { margin-top: 16px; padding-top: 14px; }
    .cover__stamps .stamp-row { gap: 6px; }
    .cover__stamps .stamp { min-height: 54px; padding: 6px 2px; font-size: .56rem; letter-spacing: .03em; }
    .cover__stamps .stamp b { font-size: 1rem; }
}

/* Home runs on a tighter vertical rhythm than the inner pages */
main#content { --section: clamp(32px, 4vw, 56px); }
main#content .section-header { margin-bottom: clamp(18px, 2.4vw, 30px); }
main#content .section-header h2 { margin-bottom: .3em; }
main#content .section-header p { font-size: var(--step-0); }
/* A sheet section that follows a paper section still needs its top padding */
.section + .section--sheet { padding-top: var(--section); }

/* Links with a trailing arrow */
.audience__link, .story__link, .resources__all, .areas__link {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    font-weight: 700; color: var(--link); text-decoration: underline; text-underline-offset: .2em;
}
.audience__link .icon, .story__link .icon, .resources__all .icon, .areas__link .icon { width: 1em; height: 1em; }

/* 2. Who we work for: three ruled columns, not cards */
.audiences__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: var(--rule); border-bottom: var(--rule); }
.audience { display: flex; flex-direction: column; padding: 26px clamp(18px, 2.4vw, 34px) 22px; min-width: 0; }
.audience:first-child { padding-left: 0; }
.audience:last-child { padding-right: 0; }
.audience + .audience { border-left: 1px solid var(--hair); }
.audience h3 { margin-bottom: .4em; }
.audience h3 a { font: 850 clamp(1.6rem, 1.2rem + 1vw, 2.1rem)/1 var(--font-display); font-stretch: 78%; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.audience h3 a:hover { box-shadow: inset 0 -.2em 0 var(--mark); }
.audience__who { color: var(--ink-2); }
.audience .check-list { margin-bottom: 14px; }
.audience .check-list li { padding-block: 9px; }
.audience .check-list li::before { top: 14px; }
.audience__link { margin-top: auto; }
@media (max-width: 860px) {
    .audiences__grid { grid-template-columns: 1fr; }
    .audience, .audience:first-child, .audience:last-child { padding: 22px 0; }
    .audience + .audience { border-left: 0; border-top: 1px solid var(--hair); }
}

/* 3. Scope of work */
.scope__estimate { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--link); white-space: nowrap; }
.scope__also { margin: 18px 0 0; color: var(--ink-2); }
.scope__also a { color: var(--link); }
.scope .scope-table td:first-child a { color: var(--ink); }
@media (min-width: 761px) {
    .scope .scope-table th, .scope .scope-table td { padding-block: 13px; }
    .scope .scope-table thead th { padding-block: 10px; }
}
.scope__service .icon { display: none; }
.scope__cta { display: none; margin: 18px 0 0; }
/* Mobile: the whole row is one link to the service page; the single estimate action follows the table */
@media (max-width: 760px) {
    .scope .scope-table tr { position: relative; grid-template-columns: 1fr; padding: 13px 0; }
    .scope .scope-table td { padding-right: 52px; }
    .scope .scope-table td:nth-child(3) { grid-column: 1 / -1; }
    .scope .scope-table td:last-child { display: none; }
    .scope__service { display: block; }
    .scope__service::after { content: ""; position: absolute; inset: 0; }
    .scope__service .icon { display: block; position: absolute; right: 14px; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: var(--ink-2); }
    .scope .scope-table td:first-child a:hover { box-shadow: none; }
    .scope__cta { display: block; }
    .scope__cta .button { width: 100%; }
}

/* 4. Site record: 7 plates + note */
/* 6 plates: one large (left half), a 2x2 of small ones, then a wide plate beside the note */
.home-record .plate:nth-child(1) { grid-column: span 6; }
.home-record .plate:nth-child(n+2) { grid-column: span 3; aspect-ratio: 4 / 3; }
.home-record .plate:nth-child(6) { grid-column: span 6; aspect-ratio: 16 / 6; }
.home-record__note { grid-column: span 6; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; padding: 18px 0 0; border-top: var(--rule); }
.home-record__note p { margin: 0; color: var(--ink-2); }
.home-record__note .button { align-self: flex-start; }
@media (max-width: 860px) {
    .home-record .plate:nth-child(1) { grid-column: span 2; }
    .home-record .plate:nth-child(n+2) { grid-column: span 1; }
    .home-record .plate:nth-child(6) { grid-column: span 2; aspect-ratio: 16 / 9; }
    .home-record__note { grid-column: span 2; }
}
@media (max-width: 480px) {
    .home-record { gap: 8px; }
    .home-record .plate:nth-child(1), .home-record .plate:nth-child(6) { aspect-ratio: 16 / 10; }
    /* Small plates: caption sits under the photo so two lines never cover it */
    .home-record .plate:nth-child(n+2):nth-child(-n+5) { aspect-ratio: auto; display: flex; flex-direction: column; }
    .home-record .plate:nth-child(n+2):nth-child(-n+5) img { aspect-ratio: 4 / 3; height: auto; }
    .home-record .plate:nth-child(n+2):nth-child(-n+5) figcaption { position: static; flex: 1; flex-direction: column; gap: 1px; padding: 6px 8px; font-size: .62rem; letter-spacing: .04em; }
}

/* 5. How a job runs: a real sequence */
.work-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: var(--rule); counter-reset: step; }
.work-steps li { counter-increment: step; padding: 20px 18px 22px; min-width: 0; }
.work-steps li:first-child { padding-left: 0; }
.work-steps li + li { border-left: 1px solid var(--hair); }
.work-steps li::before {
    content: counter(step); display: block; margin-bottom: 12px;
    font: 850 2.6rem/1 var(--font-display); font-stretch: 74%; color: var(--ink);
}
.work-steps h3 { font-size: 1.12rem; }
.work-steps p { margin: 0; color: var(--ink-2); font-size: .98rem; }
@media (max-width: 1080px) {
    .work-steps { grid-template-columns: 1fr; }
    .work-steps li, .work-steps li:first-child { display: grid; grid-template-columns: 56px 1fr; column-gap: 12px; padding: 16px 0; }
    .work-steps li + li { border-left: 0; border-top: 1px solid var(--hair); }
    .work-steps li::before { grid-row: span 2; margin: 0; font-size: 2.2rem; }
    .work-steps h3 { margin-bottom: .25em; }
}

/* 6. The work, big: dark band with a full-bleed photo */
.work-band { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); }
.work-band__plate { border: 0; aspect-ratio: 16 / 9; max-height: 640px; width: 100%; }
.work-band__text { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 64px) var(--gutter) clamp(28px, 4vw, 64px) clamp(24px, 3.4vw, 56px); min-width: 0; }
.work-band__text h2 { font-size: clamp(2rem, 1.3rem + 2.2vw, 3.4rem); max-width: 12ch; }
.work-band__text p { font-size: var(--step-1); max-width: 40ch; }
.work-band__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.work-band__actions .button { flex: 1 1 220px; }
.work-band__actions .button .icon { width: 1.1em; height: 1.1em; }
@media (max-width: 980px) {
    .work-band { grid-template-columns: 1fr; }
    .work-band__plate { max-height: none; }
    .work-band__text { padding: 26px var(--gutter) 32px; }
    .work-band__text h2 { max-width: none; }
}
@media (max-width: 560px) {
    .work-band__plate { aspect-ratio: 4 / 3; }
    .work-band__plate figcaption { flex-wrap: wrap; row-gap: 2px; font-size: .66rem; }
    .work-band__text p { font-size: var(--step-0); }
    .work-band__actions .button { flex-basis: 100%; }
}

/* 7. Why hire us: story, written terms, credentials as plain text in one ruled sheet */
.work-band + .section { padding-top: var(--section); }
.why__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: var(--rule); background: var(--sheet); }
.why__col { padding: clamp(20px, 2.4vw, 34px); min-width: 0; }
.why__col + .why__col { border-left: var(--rule); }
.why__col h3 { font: 850 clamp(1.4rem, 1.1rem + .8vw, 1.8rem)/1.05 var(--font-display); font-stretch: 78%; text-transform: uppercase; letter-spacing: 0; margin-bottom: .7em; }
.story p { color: var(--ink-2); }
.why .terms-table { border-top: var(--rule); }
.why .terms-table th { width: 42%; }
.why .terms-table td { color: var(--ink-2); }
.terms__note { margin: 14px 0 0; color: var(--ink-3); font-size: .9rem; }
.creds { margin: 0; border-top: var(--rule); }
.creds > div { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.creds > div:last-child { border-bottom: 0; padding-bottom: 0; }
.creds dt { font-weight: 700; }
.creds dd { margin: 0; color: var(--ink-2); }
.creds dd a { color: var(--link); font-weight: 600; }
@media (max-width: 1080px) {
    .why__grid { grid-template-columns: 1fr 1fr; }
    .why__col.story { grid-column: 1 / -1; border-bottom: var(--rule); }
    .why__col.story + .why__col { border-left: 0; }
}
@media (max-width: 700px) {
    .why__grid { grid-template-columns: 1fr; }
    .why__col + .why__col { border-left: 0; border-top: var(--rule); }
    .why__col.story { border-bottom: 0; }
    .why__col { padding: 18px 16px; }
    .creds > div { display: grid; grid-template-columns: 42% 1fr; column-gap: 12px; }
}

/* 9. Resources: text-led entries */
.resources__head { display: flex; justify-content: space-between; align-items: end; gap: 12px 24px; flex-wrap: wrap; }
.resources__head .section-header { margin-bottom: 20px; }
.resources__all { margin-bottom: 20px; }
.resources__list { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
@media (min-width: 1080px) {
    .resources__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: var(--rule); }
    .resources__list .resource { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding: 20px 22px; border-bottom: 0; }
    .resources__list .resource:first-child { padding-left: 0; }
    .resources__list .resource:last-child { padding-right: 0; }
    .resources__list .resource + .resource { border-left: 1px solid var(--hair); }
    .resources__list .resource img { aspect-ratio: 1; }
}
.resource { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(16px, 3vw, 32px); align-items: start; padding: 20px 0; border-bottom: 1px solid var(--hair); }
.resource img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: var(--rule); background: var(--asphalt); }
.resource__meta { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.resource h3 { font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); margin-bottom: .35em; }
.resource h3 a { text-decoration: none; }
.resource h3 a:hover { text-decoration: underline; }
.resource p:last-child { margin: 0; color: var(--ink-2); max-width: 70ch; }
@media (max-width: 560px) { .resource { grid-template-columns: 96px minmax(0, 1fr); } }

/* 10. Service area */
.areas__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(20px, 4vw, 64px); align-items: start; }
.areas__grid h2 { font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.6rem); }
.areas__grid p { color: var(--ink-2); margin-bottom: 6px; }
.areas .areas-line { font-size: clamp(1.05rem, .95rem + .4vw, 1.3rem); line-height: 1.7; padding-top: 14px; border-top: var(--rule); }
@media (max-width: 760px) { .areas__grid { grid-template-columns: 1fr; } }

/* 11. FAQ + contact block */
.home-faq__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.home-faq .faq-list { max-width: none; }
.home-faq .faq-item__question { min-height: 52px; padding-block: 10px; }
.faq-contact { position: sticky; top: 96px; padding: clamp(20px, 2.4vw, 30px); border: var(--rule); background: var(--sheet); display: grid; gap: 14px; justify-items: start; }
.faq-contact h3 { margin: 0; font: 850 clamp(1.4rem, 1.1rem + .8vw, 1.8rem)/1.05 var(--font-display); font-stretch: 78%; text-transform: uppercase; letter-spacing: 0; }
.faq-contact__phone { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; font: 850 clamp(2rem, 1.5rem + 1.4vw, 2.7rem)/1 var(--font-display); font-stretch: 78%; color: var(--ink); text-decoration: none; white-space: nowrap; box-shadow: inset 0 -.14em 0 var(--mark); }
.faq-contact__phone:hover { box-shadow: inset 0 -.3em 0 var(--mark); }
.faq-contact__phone .icon { width: .7em; height: .7em; flex: none; }
.faq-contact__hours { margin: 0; width: 100%; border-top: var(--rule); border-bottom: var(--rule); }
.faq-contact__hours > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; }
.faq-contact__hours > div + div { border-top: 1px solid var(--hair); }
.faq-contact__hours dt { font-weight: 700; }
.faq-contact__hours dd { margin: 0; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.faq-contact .button { width: 100%; }
@media (max-width: 900px) {
    .home-faq__grid { grid-template-columns: 1fr; }
    .faq-contact { position: static; }
}
/* Answers visible without JavaScript */
html:not(.js) .faq-item__answer { display: block; }
.home-faq .faq-item__answer p { margin: 0; }
.home-faq .faq-item__answer a { color: var(--link); }
.faq__more { margin: 18px 0 0; }
.faq__more a { color: var(--link); font-weight: 700; }

/* 12. Close */
.close-panel { padding-block: clamp(36px, 4.4vw, 60px); }
.close-panel__actions { margin-top: 0; }
.close-panel__actions .button .icon { width: 1.1em; height: 1.1em; }

/* Mobile scope table: the row's action sits at the END of its own stack (it read as the previous row's) */
@media (max-width: 760px) {
    .scope .scope-table td:last-child { grid-column: 1 / -1; grid-row: auto; justify-self: start; padding-top: 10px; }
}
/* Guides: meta now follows the title */
.resource .resource__meta { margin-top: 4px; }

/* Compact pieces on phones */
@media (max-width: 560px) {
    /* The per-audience checklists live on who-we-serve.php; the phone keeps who + link */
    main#content { line-height: 1.5; }
    .audience .check-list { display: none; }
    .audience__who { margin-bottom: 4px; }
    .scope .scope-table tr { padding: 10px 0; }
    .scope .scope-table td:first-child { padding-bottom: 3px; }
    .scope .scope-table td:nth-child(3) { padding-top: 3px; }
    .work-steps p { font-size: .94rem; }
    .work-band__plate { aspect-ratio: 16 / 10; }
    .work-band__text { padding: 20px var(--gutter) 26px; }
    .why .terms-table th, .why .terms-table td { padding-block: 9px; }
    .creds > div { padding: 8px 0; }
    .resource img { aspect-ratio: 1; }
    .close-panel__grid { gap: 16px; }
    .close-panel__actions .button { flex: 1 1 100%; }
    .audience, .audience:first-child, .audience:last-child { padding: 16px 0; }
    .audience .check-list { margin-bottom: 6px; }
    .audience .check-list li { padding-block: 6px; }
    .audience .check-list li::before { top: 11px; }
    .work-steps li, .work-steps li:first-child { padding: 12px 0; grid-template-columns: 44px 1fr; }
    .resource { padding: 14px 0; }
    .areas .areas-line { font-size: 1rem; line-height: 1.55; }
}
.close-panel h2 { max-width: 26ch; }

/* finished-lot photo: when the plate crops (4:3 / 16:10 on small screens), keep the lot in frame, not the roofs */
.work-band__plate img { object-position: 50% 72%; }

/* Cover: the job photo is the background of the whole lead block, darkened where the text sits.
   Text is always light here (the photo is dark in both themes). Callouts stay pinned in photo pixels
   because the plate still fills its box with object-fit: cover centred. */
.cover .cover__lead { position: relative; isolation: isolate; overflow: hidden; background: #0d0f12; }
.cover .cover__lead::after { content: ""; display: block; flex: 1 0 auto; min-height: clamp(220px, 30vw, 400px); }
.cover .cover__plate {
    position: absolute; inset: 0; z-index: -1; margin: 0; border: 0;
    aspect-ratio: auto; min-height: 0; flex: none;
}
.cover .cover__plate::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        linear-gradient(180deg, rgba(9, 11, 14, .9) 0%, rgba(9, 11, 14, .78) 34%, rgba(9, 11, 14, .32) 62%, rgba(9, 11, 14, .12) 82%, rgba(9, 11, 14, .5) 100%),
        linear-gradient(90deg, rgba(9, 11, 14, .45) 0%, rgba(9, 11, 14, 0) 65%);
}
.cover .cover__plate .callout { z-index: 2; }
.cover .cover__plate figcaption { z-index: 3; background: rgba(13, 15, 18, .82); color: #e9e8e3; }
.cover .cover__title { color: #fff; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); }
.cover .cover__scope { color: rgba(255, 255, 255, .88); text-shadow: 0 1px 10px rgba(0, 0, 0, .5); }
@media (max-width: 980px) {
    .cover .cover__plate { margin: 0; }
    .cover .cover__lead { padding-bottom: 0; }
}
@media (max-width: 560px) {
    .cover .cover__lead::after { min-height: 230px; }
}
/* A tall, narrow cover (form beside it, or a phone) crops the photo's sides away, so the pinned
   callouts would point at nothing; show them only when the photo box is landscape. */
@container (aspect-ratio < 1.25) {
    .cover .cover__plate .callout { display: none; }
}
/* Cover overlay, revised: the photo stays at full strength; only the corner behind the text is darkened. */
.cover .cover__plate::after {
    background: radial-gradient(ellipse 72% 66% at 0% 0%, rgba(9, 11, 14, .9) 0%, rgba(9, 11, 14, .72) 48%, rgba(9, 11, 14, 0) 100%);
}
/* Form beside the cover (tall, narrow box) or a phone: the text spans the full width, so darken a top band instead. */
@media (min-width: 981px), (max-width: 560px) {
    .cover .cover__plate::after {
        background: linear-gradient(180deg, rgba(9, 11, 14, .9) 0%, rgba(9, 11, 14, .74) 38%, rgba(9, 11, 14, 0) 60%);
    }
}
@media (max-width: 560px) {
    .cover .cover__plate::after {
        background: linear-gradient(180deg, rgba(9, 11, 14, .9) 0%, rgba(9, 11, 14, .78) 52%, rgba(9, 11, 14, 0) 74%);
    }
}
.cover .cover__title { text-shadow: 0 2px 22px rgba(0, 0, 0, .6); }
.cover .cover__scope { text-shadow: 0 1px 12px rgba(0, 0, 0, .7); }
