/* home.css: the home page's own placing and sizing of its parts, with the tokens of system.css. */

/* ---------- 1. The header: four fields, each its own clip and its own booking card (kit rotate) ---------- */
.hero { position: relative; isolation: isolate; min-height: max(700px, min(100svh, 960px)); color: var(--c-on-ink); background: var(--c-brand-dark); overflow: hidden; }
.hero__stage { position: absolute; inset: 0; overflow: hidden; }
/* the kit's look for the header that changes its picture: kept as kit.md gives it */
[data-kit-scene="rotate"] [data-kit-slide] { position: absolute; inset: 0; margin: 0; visibility: hidden; overflow: hidden; }
[data-kit-scene="rotate"] [data-kit-slide][data-kit-on] { visibility: visible; z-index: 2; opacity: var(--kit-move, 1); transform: translateX(var(--kit-glide, calc((1 - var(--kit-move, 1)) * 4%))); }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-prev])) [data-kit-slide][data-kit-on] { transform: none; opacity: 1; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { visibility: visible; z-index: 1; }
[data-kit-scene="rotate"] [data-kit-slide] video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-kit-on])) [data-kit-slide]:not([data-kit-slide] ~ [data-kit-slide]) { visibility: visible; }
[data-kit-scene="rotate"] [data-kit-slide] video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; clip-path: inset(2px); }
[data-kit-scene="rotate"] [data-kit-slide] video[data-kit-shown] { clip-path: none; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { opacity: clamp(0, (1 - var(--kit-move, 0)) * 1000, 1); }
/* each slide's clip in a wrapper that clips it, so its card may sit on the slide */
.hero__clip { position: absolute; inset: 0; overflow: hidden; }
.hero__slide--1 video, .hero__slide--1 .kit-first { object-position: 64% 40%; }
.hero__slide--3 video { object-position: 60% 45%; }
/* the grade: one still layer over the stage, navy from the words' side, clear where the cards sit */
.hero__stage::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(90deg, rgba(11, 17, 32, 0.92) 0%, rgba(11, 17, 32, 0.8) 30%, rgba(11, 17, 32, 0.42) 50%, rgba(11, 17, 32, 0.08) 64%, rgba(11, 17, 32, 0) 72%),
    linear-gradient(180deg, rgba(11, 17, 32, 0.55) 0%, rgba(11, 17, 32, 0) 22%); }
.hero__in { position: relative; z-index: 4; box-sizing: border-box; min-height: inherit; display: flex; align-items: center; padding-top: calc(var(--header-h) + 40px); padding-bottom: 64px; pointer-events: none; }
.hero__copy { max-width: 600px; pointer-events: auto; }
.hero__title { color: var(--c-on-ink); font: 800 var(--fs-display)/1.02 var(--font-display); letter-spacing: var(--track-display); max-width: 15ch; }
.hero__line { margin: 18px 0 26px; max-width: 520px; color: rgba(255, 255, 255, 0.88); font-size: var(--fs-lead); line-height: 1.5; }
.hero__box { max-width: 520px; }
.hero__more { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 20px; }
.hero__rating { display: inline-flex; align-items: center; gap: 8px; color: var(--c-on-ink); font: 500 15px/1 var(--font-ui); text-decoration: none; }
.hero__rating b { font-weight: 700; }
.hero__rating:hover { text-decoration: underline; text-underline-offset: 4px; }
/* the booking card, arriving with its picture: it rises and settles, its "Booked" stamps, the sweep draws under its source */
.hero__card { position: absolute; z-index: 2; width: 360px; right: max(var(--gutter), calc((100% - var(--max-w)) / 2)); bottom: 13%;
  opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 26px)); }
.hero__card--high { bottom: auto; top: 21%; }
.hero__card .bcard__stamp { opacity: clamp(0, calc((var(--kit-in, 1) - 0.5) * 4), 1); transform: scale(calc(1.3 - 0.3 * clamp(0, calc((var(--kit-in, 1) - 0.5) * 4), 1))); }
.hero__card .bcard__src b { background-size: calc(clamp(0, calc((var(--kit-in, 1) - 0.4) * 2), 1) * 100%) 0.36em; }
.hero__stop { right: var(--gutter); bottom: 24px; }

.hero__title .sweep { --sweep-y: 86%; }

/* ---------- 2. #found: six tab cards beside one stage, a phone playing each moment over a homeowner at home ---------- */
.found__grid { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.25fr); gap: clamp(24px, 3vw, 44px); align-items: stretch; }
.found__tabs { display: grid; gap: 10px; align-content: start; }
.found__stage { min-height: 680px; }
.found__media video { object-position: 28% 50%; }
.found__shade { background: linear-gradient(90deg, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, 0.12) 40%, rgba(11, 17, 32, 0.55) 72%, rgba(11, 17, 32, 0.7) 100%); }
.found__panel { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; padding: 40px 7% 40px 40px; outline: none; }
.found__phone { width: 310px; height: 600px; max-height: calc(100% - 40px); }
.found__how { position: absolute; left: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: var(--c-ink); font: 600 14px/1.2 var(--font-ui); text-decoration: none; box-shadow: var(--shadow-m); }
.found__panel:focus-visible { outline: 3px solid var(--c-accent); outline-offset: -3px; }
.found__stop { top: 16px; right: 16px; }

/* ---------- 3. #plan: the route over the neighborhood from above ---------- */
.plan { position: relative; overflow: hidden; isolation: isolate; padding-block: var(--section-y); background: var(--c-brand-dark); color: var(--c-on-ink); }
.plan__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.plan__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.plan__shade { position: absolute; inset: 0; z-index: -1; background: radial-gradient(120% 90% at 50% 55%, rgba(11, 17, 32, 0.5) 0%, rgba(11, 17, 32, 0.78) 70%, rgba(11, 17, 32, 0.9) 100%); }
.plan__route { position: relative; max-width: 1180px; margin: 0 auto; }
.plan__scene { height: 460px; }
.plan__stop { top: -6px; right: 0; }

/* ---------- 4. #work: the compare ---------- */
.work .cmp { aspect-ratio: 1240 / 620; --knob-y: 108px; }
/* the reports sit in the photo's right half: mirrored, they come into the report's side of the line */
.work .before .cmp__photo { object-position: 62% 50%; transform: scaleX(-1); }
.work .after .cmp__photo { object-position: 50% 30%; }

/* ---------- 6. #see: the leads board over the contractor's job ---------- */
.see__stage { height: clamp(540px, 50vw, 640px); }
.see__stage video { object-position: 40% 35%; }
.see__shade { background: linear-gradient(90deg, rgba(11, 17, 32, 0.08) 0%, rgba(11, 17, 32, 0.28) 42%, rgba(11, 17, 32, 0.72) 70%, rgba(11, 17, 32, 0.82) 100%); }
.see__board { position: absolute; z-index: 2; top: 5%; bottom: 5%; right: 3%; width: 40%; }
.see__stop { top: 16px; left: 16px; }

/* 8. #who: the big roofing tile shows both roofers, on the photo's right */
.who .tile--big .tile__photo { object-position: 88% 50%; }

/* ---------- 7. #adam ---------- */
.adam__grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.adam__me { margin: 0; display: grid; justify-items: center; gap: 18px; text-align: center; }
.adam__photo { width: 280px; height: 280px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1.5px var(--c-accent), 0 0 0 10px var(--c-paper-alt), 0 0 0 11px var(--c-line-strong), var(--shadow-l); }
.adam__photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); }
.adam__me figcaption { display: grid; gap: 3px; }
.adam__me figcaption b { font: 700 19px/1.3 var(--font-display); color: var(--c-ink); }
.adam__me figcaption span { font-size: 14.5px; color: var(--c-ink-soft); }
.adam__words h2 { font: 800 var(--fs-h2)/1.08 var(--font-display); letter-spacing: var(--track-h2); }
.adam__quote { margin: 20px 0 24px; padding-left: 20px; border-left: 3px solid var(--c-accent); }
.adam__quote p { font: 600 clamp(1.2rem, 1rem + 0.6vw, 1.5rem)/1.45 var(--font-display); color: var(--c-ink); }
.adam__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; margin-top: 26px; }
.adam__rating { display: inline-flex; align-items: center; gap: 8px; color: var(--c-ink); font: 500 15px/1 var(--font-ui); text-decoration: none; }
.adam__rating .stars { color: var(--c-accent-text); }
.adam__rating:hover { text-decoration: underline; text-underline-offset: 4px; }
.adam .review .stars { color: var(--c-accent-text); }

/* ---------- 9. #close: the handshake ---------- */
.closing { position: relative; overflow: hidden; isolation: isolate; padding-block: clamp(80px, 9vw, 130px); background: var(--c-brand-dark); color: var(--c-on-ink); }
.closing__media { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.closing__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 50%; }
.closing__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(11, 17, 32, 0.92) 0%, rgba(11, 17, 32, 0.8) 34%, rgba(11, 17, 32, 0.3) 56%, rgba(11, 17, 32, 0.12) 70%, rgba(11, 17, 32, 0.3) 100%); }
.closing__in { display: grid; grid-template-columns: minmax(0, 540px); gap: 26px; }
.closing__title { color: var(--c-on-ink); font: 800 clamp(2.5rem, 1.4rem + 3.4vw, 4.25rem)/1.02 var(--font-display); letter-spacing: var(--track-display); }
.closing__line { margin-top: 16px; max-width: 480px; color: rgba(255, 255, 255, 0.88); font-size: var(--fs-lead); line-height: 1.5; }
.closing__more { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 26px; margin-top: 20px; }
.closing__phone { display: inline-flex; align-items: center; gap: 8px; color: var(--c-on-ink); font: 600 16px/1 var(--font-ui); text-decoration: none; }
.closing__phone .i-phone { color: var(--c-accent); }
.closing__box { max-width: 520px; }
.closing__stop { right: var(--gutter); bottom: 24px; }

@media (max-width: 1100px) {
  .hero__card { width: 320px; }
  .hero__title { font-size: clamp(2.5rem, 1.2rem + 3.6vw, 3.6rem); }
  /* 2: a narrower stage: her face moves left, clear of the phone (story: scenes\m-phone.md) */
  .found__media video { object-position: 50% 50%; }
  .found__panel { padding-right: 4%; }
  .found__phone { width: 300px; height: 580px; }
}
@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero__in { display: block; padding-top: calc(var(--header-h) + 28px); padding-bottom: 206px; }
  .hero__stage::after { background: linear-gradient(180deg, rgba(11, 17, 32, 0.86) 0%, rgba(11, 17, 32, 0.78) 52%, rgba(11, 17, 32, 0.3) 78%, rgba(11, 17, 32, 0.1) 100%); }
  .hero__copy { max-width: 560px; }
  .hero__card, .hero__card--high { top: auto; bottom: 20px; left: var(--gutter); right: var(--gutter); width: auto; max-width: 440px; }
  .hero__stop { bottom: 152px; right: var(--gutter); }
  /* 2: the stage on top, tall: her face above, the phone below it at full size (every word 13px or more); the six
     cards as a row that swipes, in step with it */
  .found__grid { grid-template-columns: minmax(0, 1fr); }
  .found__stage { order: -1; min-height: 0; height: 920px; background: var(--c-brand-dark); }
  .found__media { bottom: auto; height: 340px; }
  .found__media video { object-position: 41% 25%; }
  .found__shade { background: linear-gradient(180deg, rgba(11, 17, 32, 0) 0px, rgba(11, 17, 32, 0.08) 170px, rgba(11, 17, 32, 0.8) 300px, var(--c-brand-dark) 340px); }
  .found__panel { align-items: flex-start; justify-content: center; padding: 262px 12px 0; }
  .found__phone { width: 300px; height: 580px; max-height: none; }
  .found__how { left: 12px; right: 12px; bottom: 12px; justify-content: center; }
  .found__tabs { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 14px; }
  .found__tabs::-webkit-scrollbar { display: none; }
  .found__tabs .tcard { flex: 0 0 min(300px, 82%); scroll-snap-align: start; }
  /* 3 */
  .plan__scene { height: 780px; }
  /* 4 */
  .work .cmp { aspect-ratio: auto; height: 580px; --knob-y: 190px; }
  .work .before .cmp__photo { object-position: 70% 50%; }
  .work .after .cmp__photo { object-position: 55% 30%; }
  .work .cmp__cards { bottom: 14px; gap: 8px; }
  .work .before .cmp__cards { left: 10px; width: calc(44% - 22px); }
  .work .after .cmp__cards { right: 10px; width: calc(56% - 22px); }
  .work .cmp__card { padding: 10px 11px; font-size: 13.5px; }
  .work .cmp__card--done { grid-template-columns: auto 1fr; }
  .work .cmp__card--done span { grid-column: 2; }
  .work .cmp__card--done .i-check { width: 22px; height: 22px; padding: 4px; }
  .work .cmp__tag { top: 12px; font-size: 13px; padding: 8px 10px; }
  .work .before .cmp__tag { left: 10px; }
  .work .cmp__tag--gold { right: 10px; }
  /* 5 */
  .worth { grid-template-columns: minmax(0, 1fr); }
  .worth__pic { min-height: 420px; }
  /* 6 */
  .see__stage { height: 760px; }
  .see__stage video { object-position: 47% 20%; }
  .see__shade { background: linear-gradient(180deg, rgba(11, 17, 32, 0.05) 0%, rgba(11, 17, 32, 0.2) 30%, rgba(11, 17, 32, 0.75) 46%, rgba(11, 17, 32, 0.85) 100%); }
  .see__board { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; height: 440px; }
  /* 7 */
  .adam__grid { grid-template-columns: minmax(0, 1fr); justify-items: start; }
  .adam__me { justify-self: center; }
  /* 9 */
  .closing { padding-top: 300px; padding-bottom: 72px; }
  .closing__media video { object-position: 50% 30%; }
  .closing__shade { background: linear-gradient(180deg, rgba(11, 17, 32, 0.1) 0%, rgba(11, 17, 32, 0.15) 22%, rgba(11, 17, 32, 0.82) 42%, rgba(11, 17, 32, 0.94) 100%); }
  .closing__stop { bottom: auto; top: 24px; }
}
@media (max-width: 600px) {
  .hero__title { font-size: 2.45rem; line-height: 1.04; }
  .hero__line { margin: 14px 0 18px; font-size: 1.0625rem; }
  .hero__line-more { display: none; }
  .hero .picker-box { padding: 18px 16px 14px; }
  .hero .picker__legend { font-size: 16px; }
  .hero .picker__num { height: 50px; font-size: 19px; }
  .hero__more { gap: 10px 18px; margin-top: 16px; }
  .hero__more .link-quiet { font-size: 14.5px; }
  .hero .picker__go { padding: 0 14px; font-size: 15.5px; }
  .hero__card { padding: 13px 15px 14px; }
  .hero__card .bcard__head { padding-bottom: 9px; margin-bottom: 5px; }
  .hero__card .bcard__job { font-size: 16px; }
  .adam__photo { width: 220px; height: 220px; }
  .found__media video { object-position: 50% 25%; }
  .closing .picker-box { padding: 18px 16px 14px; }
  .closing .picker__go { padding: 0 14px; font-size: 15.5px; }
}
