/* home.css: the home page's own layout (plan.md, Home). Components come from components.css; this file only places
   and sizes the page's parts, with the tokens of system.css. */

/* ---------- hero: full-bleed footage in an inset frame (the kit's rotate) ---------- */
.hero { padding: 0 12px 12px; }
.hero__frame { position: relative; height: clamp(620px, calc(100svh - 88px), 860px); border-radius: var(--radius-l); overflow: hidden; background: var(--c-navy); isolation: isolate; }
.hero__media { position: absolute; inset: 0; z-index: -2; }

/* the kit's gentle change, 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(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; } /* the first picture is simply there */
[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; } /* the first picture shows before the scripts run */
[data-kit-scene="rotate"] [data-kit-slide] video { inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); } /* each clip 1 px inside its frame: the first picture stays the largest paint */

/* each field's crop: where its subject and its face stay in view */
.hero__slide video { object-position: var(--pos, 50% 50%); }
.hero__slide--general { --pos: 56% 50%; }
.hero__slide--roofing { --pos: 60% 50%; }
.hero__slide--pools { --pos: 55% 60%; }
.hero__slide--law { --pos: 56% 32%; }
.hero__slide--dental { --pos: 58% 22%; }
/* the general shot (member fix, 10 Nov): a wide handshake of three people, the grip about 42-46% across. On the computer
   the clip (and its first picture) grows from its left edge, so the handshake clears the picker and both faces stay whole */
@media (min-width: 1024px) {
  .hero__slide--general { --pos: 0% 40%; }
  .hero__slide--general :is(video, .kit-first) { transform: scale(1.1); transform-origin: 0 40%; }
}
@media (min-width: 1280px) { .hero__slide--general :is(video, .kit-first) { transform: scale(1.2); } }

/* the shade lies inside each slide, under its card, so the card stays solid white (on the phone it is one band) */
.hero__shade { display: none; }
.hero__slide::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgb(var(--c-shade) / .86) 0%, rgb(var(--c-shade) / .7) 30%, rgb(var(--c-shade) / .3) 52%, rgb(var(--c-shade) / 0) 70%),
    linear-gradient(0deg, rgb(var(--c-shade) / .3) 0%, rgb(var(--c-shade) / 0) 34%);
}
.hero__copy {
  --copy-pad: max(calc(var(--gutter) + 8px), calc((100vw - var(--max-w)) / 2 - 12px)); /* lines the words up with the page's column */
  position: relative; display: flex; flex-direction: column; justify-content: center; height: 100%; box-sizing: border-box;
  width: min(calc(580px + var(--copy-pad)), 100%); padding: 56px 0 56px var(--copy-pad); /* the box grows with its padding, so the words keep 580px on a wide screen ("roofing company." at full size) */
  color: var(--c-on-brand);
}
.hero__title { font-size: clamp(2.5rem, 1.4rem + 3.3vw, 4.4rem); line-height: 1.02; letter-spacing: -0.038em; color: var(--c-on-brand); text-wrap: initial; padding-bottom: .12em; /* room for the stroke under the word */ }
.hero__lead { display: block; text-wrap: balance; } /* the fixed words, balanced on their own, so no word is left alone on a line */
.hero__word { display: block; white-space: nowrap; }
.hero__word [data-kit-word] { position: relative; display: inline-block; opacity: calc(1 - var(--kit-swap, 0)); transform: translateY(calc(var(--kit-swap, 0) * .08em)); }
.hero__word [data-kit-word]::after {
  content: ''; position: absolute; left: .02em; right: .34em; bottom: -.25em; /* the word carries its period (it fades with it); the stroke ends before it and clears the tails of g, p and y */ height: .085em; border-radius: .05em;
  background: var(--c-accent); transform-origin: left center; transform: scaleX(calc(1 - var(--kit-swap, 0)));
}
/* the new word shows with its picture and its card: the kit writes it as the next picture starts to fade in (1.4 s);
   it waits until that picture is half in, as the card does. One rule a field, the names taking turns so each change
   starts it again; none before the first change (no slide is data-prev yet), none under reduced motion (no change). */
.hero:has([data-prev]):has(.hero__slide--general[data-kit-on]) .hero__word [data-kit-word] { animation: hero-word-a 1.2s linear; }
.hero:has([data-prev]):has(.hero__slide--roofing[data-kit-on]) .hero__word [data-kit-word] { animation: hero-word-b 1.2s linear; }
.hero:has([data-prev]):has(.hero__slide--pools[data-kit-on]) .hero__word [data-kit-word] { animation: hero-word-c 1.2s linear; }
.hero:has([data-prev]):has(.hero__slide--law[data-kit-on]) .hero__word [data-kit-word] { animation: hero-word-a 1.2s linear; }
.hero:has([data-prev]):has(.hero__slide--dental[data-kit-on]) .hero__word [data-kit-word] { animation: hero-word-b 1.2s linear; }
@keyframes hero-word-a { 0%, 55% { opacity: 0; } 100% { opacity: 1; } }
@keyframes hero-word-b { 0%, 55% { opacity: 0; } 100% { opacity: 1; } }
@keyframes hero-word-c { 0%, 55% { opacity: 0; } 100% { opacity: 1; } }
.hero__line { margin: 22px 0 30px; max-width: 520px; font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.55; color: rgb(var(--c-paper-rgb) / .92); }
.picker--hero { width: min(540px, 100%); }

.hero__note { position: absolute; right: clamp(24px, 4vw, 56px); bottom: clamp(24px, 4vw, 56px); z-index: 3; opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 16px)); }
.hero__stop { right: 20px; top: 20px; }

@media (max-width: 1023px) and (min-width: 760px) {
  .hero__copy { width: min(560px, 100%); }
  .hero__slide::after { background: linear-gradient(90deg, rgb(var(--c-shade) / .88) 0%, rgb(var(--c-shade) / .74) 45%, rgb(var(--c-shade) / .3) 75%, rgb(var(--c-shade) / .15) 100%); }
  .hero__note { right: 20px; bottom: 20px; }
}
@media (max-width: 759px) {
  /* the phone: the footage on top, the words and the picker under it, on the frame's navy */
  .hero { padding: 0 8px 8px; }
  .hero__frame { height: auto; display: flex; flex-direction: column; border-radius: var(--radius-m); }
  .hero__media { position: relative; inset: auto; z-index: 0; height: max(250px, 40svh); }
  .hero__slide::after { content: none; }
  .hero__shade { display: block; position: absolute; pointer-events: none; inset: auto 0 auto 0; top: 0; height: max(250px, 40svh); z-index: 1; background: linear-gradient(0deg, var(--c-navy) 0%, rgb(var(--c-shade) / .55) 22%, rgb(var(--c-shade) / 0) 48%); }
  .hero__copy { z-index: 2; width: 100%; height: auto; margin-top: -54px; padding: 0 16px 16px; }
  .hero__title { font-size: clamp(2rem, 8.4vw, 2.6rem); }
  .hero__line { margin: 12px 0 18px; font-size: 1rem; }
  .hero__note { top: 12px; left: 12px; right: auto; bottom: auto; max-width: calc(100% - 80px); padding: 9px 14px 9px 9px; }
  .hero__note .note__icon { width: 32px; height: 32px; }
  .hero__note .note__text b { font-size: 14px; }
  .hero__stop { top: 12px; right: 12px; }
  .hero__slide--general { --pos: 56% 50%; }
  .hero__slide--roofing { --pos: 62% 50%; }
  .hero__slide--pools { --pos: 58% 55%; }
  .hero__slide--law { --pos: 60% 30%; }
  .hero__slide--dental { --pos: 58% 20%; }
}

/* ---------- plan, how ---------- */
.plan .cta-row { justify-content: flex-start; }
.how { padding: var(--section-y) 0; }
.how__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(40px, 6vw, 96px); align-items: center; }
.how .section-head { margin-bottom: 28px; }
.how__visual { position: relative; display: grid; place-items: center; }
.how__frame { position: relative; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--radius-l); overflow: hidden; background: var(--c-paper-alt); }
.how__clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.how__frame::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(var(--c-shade) / .28), rgb(var(--c-shade) / 0) 60%); }
.how .phone { position: absolute; left: clamp(-56px, -3vw, -16px); top: 50%; transform: translateY(-50%); }
.how__stop { right: 16px; top: 16px; }
@media (max-width: 1100px) and (min-width: 900px) { .how .phone { left: -24px; transform: translateY(-50%) scale(.9); transform-origin: left center; } }
@media (max-width: 899px) {
  /* the phone: the heading, then the owner's clip with the chat rising out of its foot, then the steps it lights; the
     chat keeps its own size (never scaled, so no text under 13px) and never covers the owner's face, high in the clip */
  .how__grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .how__copy { display: contents; }
  .how .section-head { order: 1; margin-bottom: 0; }
  .how__visual { order: 2; display: block; }
  .how .steps { order: 3; }
  .how .cta-row { order: 4; }
  .how__frame { aspect-ratio: 4 / 3; }
  .how__clip { object-position: 78% 28%; }
  .how .phone { position: relative; left: auto; top: auto; transform: none; width: 272px; height: 520px; margin: -104px auto 0; }
  .how__stop { right: auto; left: 16px; } /* over the shelves, away from the owner's face */
}
@media (max-width: 380px) { .how .phone { width: 252px; height: 496px; } }

/* ---------- worth: the calculator, with the map of your area ---------- */
.worth { padding: var(--section-y) 0; background: var(--c-paper-alt); }
.worth__box {
  --calc-fill: var(--c-brand-dark); --calc-thumb-edge: var(--c-brand-dark); --calc-track: var(--c-line); --calc-focus: var(--c-brand);
  --calc-font-figure: var(--font-display); --calc-total-size: clamp(2.5rem, 1.6rem + 3vw, 4.1rem); --calc-figure-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem);
  --calc-value-size: 1.45rem; --calc-thumb-size: 28px;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 56px); align-items: start;
  padding: clamp(24px, 3.4vw, 48px); border-radius: var(--radius-l); background: var(--c-paper); border: 1px solid var(--c-line); box-shadow: var(--shadow-l);
}
.worth__controls { align-self: center; }
.worth__controls .calc-sliders { gap: 34px; }
.worth .calc-slider__label { font-weight: 600; color: var(--c-ink); }
.worth .calc-slider__value { font-family: var(--font-display); font-weight: 800; color: var(--c-brand-text); }
.worth .calc-scale { color: var(--c-ink-soft); }
.worth__result { display: grid; gap: 18px; min-width: 0; }
.worth .calc-total { display: grid; gap: 6px; margin: 0; } /* the label under its number: the number keeps the room of its widest value */
.worth .calc-total__value { font-weight: 800; letter-spacing: -0.035em; color: var(--c-ink); }
.worth .calc-total__label { font-size: 1.05rem; color: var(--c-ink-soft); }
.worth__pic { position: relative; }
.worth__stop { right: 12px; top: 12px; }
.worth .calc-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.worth .calc-figure { margin: 0; padding: 16px 18px; border-radius: var(--radius-m); background: var(--c-paper-alt); }
.worth .calc-figure__value { font-weight: 800; letter-spacing: -0.03em; color: var(--c-ink); }
.worth .calc-figure__label { display: block; margin-top: 2px; font-size: 15px; color: var(--c-ink-soft); }
.worth .calc-note { font-size: 14px; color: var(--c-ink-soft); }
@media (max-width: 899px) {
  .worth__box { grid-template-columns: 1fr; padding: 18px; gap: 22px; }
  .worth__controls { order: 2; }
  .worth__result { display: contents; }
  .worth .calc-total { order: 0; }
  .worth__pic { order: 1; }
  .worth .calc-figures { order: 3; }
  .worth .calc-note { order: 4; }
  .worth__controls .calc-sliders { gap: 22px; }
}

@media (max-width: 479px) {
  /* one figure a row on the phone: each number keeps its full size at every width, never shrunk to fit its tile */
  .worth .calc-figures { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .worth .calc-figure { padding: 12px 16px; }
}

/* the map: your area, a year from now */
.amap { position: relative; aspect-ratio: 720 / 450; border-radius: var(--radius-m); overflow: hidden; background: var(--c-paper-alt); box-shadow: inset 0 0 0 1px var(--c-line); }
.amap__svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.amap__ground { fill: color-mix(in srgb, var(--c-paper-alt) 70%, var(--c-line)); }
.amap__water { fill: color-mix(in srgb, var(--c-brand) 20%, var(--c-paper)); }
.amap__park { fill: var(--c-park); }
.amap__roads path { fill: none; stroke: var(--c-paper); stroke-linecap: round; stroke-linejoin: round; }
.amap__houses rect { fill: color-mix(in srgb, var(--c-ink) 12%, var(--c-paper-alt)); }
.amap__month:not([data-kit-on]) { opacity: 0; }
.amap__month[data-kit-on] { opacity: var(--kit-in, 1); }
.amap__month circle { fill: var(--c-violet); stroke: var(--c-paper); stroke-width: 1.6; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; transform: scale(calc(.2 + .8 * var(--kit-in, 1))); }
.amap__halo { fill: rgb(var(--c-brand-rgb) / .18); }
.amap__pin { fill: var(--c-brand-dark); stroke: var(--c-paper); stroke-width: 3; vector-effect: non-scaling-stroke; }
.amap__you-label { position: absolute; transform: translate(16px, -50%); padding: 4px 10px; border-radius: 999px; background: var(--c-brand-dark); color: var(--c-on-brand); font-family: var(--font-ui); font-size: 13px; font-weight: 700; line-height: 1.2; box-shadow: var(--shadow-s); }
.amap__key { position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px); padding: 6px 12px 6px 9px; border-radius: 999px; background: rgb(var(--c-paper-rgb) / .94); box-shadow: var(--shadow-s); font-family: var(--font-ui); font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--c-ink); }
.amap__key i { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--c-violet); box-shadow: 0 0 0 2px var(--c-paper); }

/* ---------- outcomes: each chapter's crop ---------- */
.stage__panel--out-found .stage__clip { object-position: 30% 40%; }
.stage__panel--out-answer-loop .stage__clip { object-position: 40% 30%; }
.stage__panel--out-reviews .stage__clip { object-position: 72% 30%; }
/* the reviews chapter shows its card once the scene has filled its stars (0.4 to 1.8 s) and landed the rating: "187
   reviews" beside empty stars would read as a wrong value. Starts again each time its tab opens (the panel was hidden). */
.stage__panel--out-reviews:not([hidden]) [data-scene="out-reviews"] { animation: oc-card-late 2.2s linear; }
@keyframes oc-card-late { 0%, 84% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stage__panel--out-reviews [data-scene="out-reviews"] { animation: none; } }
.stage__panel--out-work-hands .stage__clip { object-position: 55% 50%; }

/* ---------- who, faq ---------- */
.who { padding: var(--section-y) 0; }
.tile--who-outdoor .tile__img { object-position: 76% 50%; }
.tile--who-health .tile__img { object-position: 30% 50%; }
.tile--who-realestate .tile__img { object-position: 24% 50%; }
.tile--who-events .tile__img { object-position: 40% 50%; }
.tile--who-home .tile__img { object-position: 50% 60%; }
.faq-sec { padding: var(--section-y) 0; background: var(--c-paper); }
.faq-sec__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.faq-sec__head h2 { font-size: var(--fs-h2); }
.faq-sec__head p { margin-top: 16px; color: var(--c-ink-soft); }
@media (max-width: 899px) { .faq-sec__grid { grid-template-columns: 1fr; } }

.compare-sec { padding: var(--section-y) 0 calc(var(--section-y) * .8); }
