/* home.css: the home page's own placing and sizing (plan.md, Home), with design\system.css's tokens and
   design\components.css's components. */

/* ---------- hero: the split header ---------- */
main > .hero { padding-block: clamp(2.25rem, 1.2rem + 3vw, 4.25rem) clamp(3.5rem, 2rem + 4vw, 6rem); overflow: hidden; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); gap: clamp(2rem, 0.8rem + 4vw, 5rem); align-items: center; }
.hero__copy { display: grid; gap: var(--space-5); min-width: 0; }
/* set so every field word stands on one line beside the picture: no line held empty under a short one */
.hero__title { font-size: calc(var(--fs-h1) * 0.8); }
.hero__words { display: grid; justify-items: start; margin-top: 0.08em; }
.hero__words > * { grid-area: 1 / 1; box-sizing: border-box; max-width: 100%; padding: 0.02em 0.16em 0.08em; border-radius: 0.14em; }
.hero__word { align-self: start; background: var(--c-brand-soft); color: var(--c-on-brand); opacity: calc(1 - var(--kit-swap, 0)); transform: translateY(calc(var(--kit-swap, 0) * 0.12em)); }
.hero__sizer { visibility: hidden; }
.hero__sizer::before { content: attr(data-sizer); } /* the widest word from its attribute, never in the page's text */
.hero__line { max-width: 33rem; font-size: calc(var(--fs-body) * 1.12); color: var(--c-ink-soft); }
.hero__booking { margin-top: var(--space-4); max-width: 31rem; }

.hero__stage { position: relative; min-width: 0; }
.hero__stage::before { content: ""; position: absolute; inset: 9% -5% -6% 11%; border-radius: var(--radius-l); background: var(--c-brand-soft); box-shadow: 0 0 0 var(--edge) var(--c-ink); }
.hero__frame { position: relative; aspect-ratio: 1.08 / 1; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-l); background: var(--c-ink); }
.hero__stop { top: 14px; right: 14px; }

/* the kit's rotate, as kit.md gives it (kept as it is) */
[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); }

/* the route on each slide: the search (A) at the foot, the logo's arrow rising from it, the booking (B) where it lands */
.hero__route { position: absolute; z-index: 3; left: 4%; bottom: 5%; width: 340px; height: 200px; transform-origin: 0 100%; transform: scale(var(--route-scale, 1)); pointer-events: none; }
.hero__slide[data-side="right"] .hero__route { left: auto; right: 4%; transform-origin: 100% 100%; }
.hero__chip { position: absolute; left: 0; bottom: 0; --p: var(--kit-in, 1); opacity: clamp(0, var(--p) * 3, 1); transform: translateY(calc((1 - clamp(0, var(--p) * 1.6, 1)) * 10px)); }
.hero__arrow { position: absolute; left: 4px; bottom: 42px; width: 96px; height: 96px;
  --d: clamp(0, (var(--kit-in, 1) - 0.12) * 1.6, 1);
  clip-path: inset(calc((1 - var(--d)) * 100%) calc((1 - var(--d)) * 100%) 0 0);
  filter: drop-shadow(2px 2px 0 var(--c-ink)); }
.hero__ticket { position: absolute; left: 92px; bottom: 92px; width: 248px;
  --t: clamp(0, (var(--kit-in, 1) - 0.55) * 2.2, 1);
  opacity: clamp(0, var(--t) * 2, 1); transform: translateY(calc((1 - var(--t)) * 12px)) scale(calc(0.94 + 0.06 * var(--t))); transform-origin: 0 100%; }
.hero__slide[data-side="right"] .hero__chip { left: 0; }

@media (max-width: 1180px) { .hero__route { --route-scale: 0.88; } }
@media (max-width: 899px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .hero__booking { max-width: none; }
  .hero__stage { margin-right: 4%; }
  .hero__stage::before { inset: 7% -4% -5% 8%; }
  .hero__frame { aspect-ratio: 16 / 11; }
}
@media (max-width: 560px) {
  .hero__copy { gap: var(--space-4); }
  .hero__booking { padding: 1.3rem 1rem 1.1rem; }
  .hero__route { --route-scale: 0.8; width: 300px; }
  .hero__ticket { width: 214px; left: 84px; }
  .hero__frame { aspect-ratio: 4 / 3.4; }
}

/* ---------- plan: the free plan, shown working ---------- */
.tour__stage { display: grid; place-items: center; min-height: clamp(500px, 40vw, 580px); }
.tour__panel { position: relative; z-index: 2; box-sizing: border-box; display: grid; place-items: center; width: 100%; padding: clamp(1rem, 0.5rem + 2vw, 2.5rem); }
.tour__scene { width: 100%; }
.tour__scene--fillcal { max-width: 680px; }
.tour__scene--yourpart { max-width: 780px; }
.tour__scene--estimate { max-width: 528px; }
.tour__stop { top: 14px; right: 14px; }
@media (max-width: 760px) {
  .tour__tabs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .tour__stage { min-height: 520px; }
  .tour__panel { padding: 3.6rem 0.75rem 1rem; }
}

/* ---------- how: the route from a 3-minute chat to booked clients, over an owner at work ---------- */
.how__band { position: relative; height: clamp(360px, 38vw, 600px); overflow: hidden; border-block: var(--edge) solid var(--c-ink); background: var(--c-ink); }
.how__footage { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 30%; }
.how__stop { top: 16px; right: var(--gutter); }
.how__panel-wrap { position: relative; z-index: 2; margin-top: calc(-1 * clamp(90px, 9vw, 150px)); }
.how__panel { box-sizing: border-box; padding: clamp(0.75rem, 0.4rem + 1vw, 1.25rem); border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-l); }
.how__map { height: clamp(400px, 34vw, 460px); }
@media (max-width: 760px) {
  .how__band { height: 300px; }
  .how__footage { object-position: 62% 20%; }
  .how__panel-wrap { margin-top: -70px; }
}
@media (max-width: 699px) { .how__map { height: 720px; } }

/* ---------- worth: the calculator, the year as one route from A to B ---------- */
.worth { background: var(--c-paper-alt); }
.worth__box {
  display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem); align-items: center;
  padding: clamp(1.25rem, 0.7rem + 2.2vw, 2.75rem); border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-l);
  --calc-fill: var(--c-brand); --calc-track: color-mix(in srgb, var(--c-ink) 14%, transparent); --calc-thumb: var(--c-paper); --calc-thumb-edge: var(--c-ink);
  --calc-thumb-shadow: var(--shadow-s); --calc-surface: var(--c-paper); --calc-font-figure: var(--font-display); --calc-track-size: 8px; --calc-thumb-size: 30px;
  --calc-value-size: 1.45rem; --calc-total-size: calc(var(--fs-display) * 0.86); --calc-figure-size: 2rem; --calc-gap: var(--space-5);
}
.worth__controls { display: grid; align-content: center; }
.worth .calc-slider__label { font-weight: 600; }
.worth .calc-slider__value { font-family: var(--font-display); font-weight: 800; }
.worth__result { position: relative; display: grid; gap: var(--space-4); min-width: 0; }
.worth .calc-total { padding-right: 52px; }
.worth .calc-total__value { font-weight: 900; letter-spacing: -0.02em; }
.worth .calc-total__label { font: 700 1.05rem/1.3 var(--font-ui); color: var(--c-ink-soft); }
.worth__stop { top: 0; right: 0; }
.worth .calc-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.worth .calc-figure { padding: 0.8rem 1rem; border-radius: var(--radius-m); background: var(--c-paper-alt); box-shadow: 0 0 0 2px var(--c-ink); }
.worth .calc-figure__value { font-weight: 800; }
.worth .calc-figure__label { font: 600 var(--fs-small)/1.3 var(--font-ui); color: var(--c-ink-soft); }
.worth .calc-note { font: 500 var(--fs-small)/1.4 var(--font-ui); color: var(--c-ink-soft); }

.worth__picture { position: relative; height: 300px; container-type: inline-size; }
.yr__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.yr__bed { fill: none; stroke: color-mix(in srgb, var(--c-ink) 28%, transparent); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.yr__route { fill: none; stroke: var(--c-brand); stroke-width: 15; stroke-linecap: round; filter: drop-shadow(2px 3px 0 var(--c-ink)); }
.yr__head { fill: var(--c-brand); stroke: var(--c-ink); stroke-width: 2.5; stroke-linejoin: round; opacity: 0; }
.yr__head.is-on { opacity: 1; }
.yr__dot { fill: var(--c-paper); stroke: var(--c-ink); stroke-width: 2.5; }
.yr__stop[data-kit-on] .yr__dot { fill: var(--c-accent); }
.yr__stop:not([data-kit-on]) .yr__stack { opacity: 0; }
.yr__stack { translate: 0 calc((1 - var(--kit-in, 1)) * -14px); opacity: var(--kit-in, 1); }
.yr__pile { fill: var(--c-paper); stroke: var(--c-ink); stroke-width: 2.2; }
.yr__lines { fill: none; stroke: var(--c-ink); stroke-width: 1.4; }
.yr__cap { fill: var(--c-brand); stroke: var(--c-ink); stroke-width: 2.2; }
.yr__start circle { fill: var(--c-ink); }
.yr__start path { fill: var(--c-paper); fill-rule: evenodd; }
/* "Today" on its own layer: repainting its words never repaints A's round dot beside it */
.yr__a { position: absolute; left: 39px; bottom: 0; display: flex; align-items: center; height: 2rem; font: 700 0.95rem/1 var(--font-ui); color: var(--c-ink-soft); will-change: transform; }
.yr__b .ticket__ok--drawn { background: none; }
.yr__b .ticket__ok--drawn svg { width: 100%; height: 100%; }
.yr__b .ticket__ok--drawn circle { fill: var(--c-accent); }
.yr__b .ticket__ok--drawn path { fill: none; stroke: var(--c-on-brand); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.yr__b { position: absolute; left: 0; top: 0; width: 232px; opacity: 0; }
.yr__b.is-on { opacity: 1; }
.yr__b .ticket__body { padding-right: 1.9rem; }
@container (max-width: 519px) {
  .yr__b { position: absolute; left: auto; right: 0; top: auto; bottom: 0; }
}
@media (max-width: 899px) {
  .worth__box { grid-template-columns: minmax(0, 1fr); }
  .worth__picture { height: 260px; }
}
@media (max-width: 480px) { .worth__picture { height: 300px; } .worth .calc-figures { grid-template-columns: minmax(0, 1fr); } }

/* ---------- outcomes: one new client, four chapters on one stage ---------- */
.chapters { display: grid; gap: var(--space-5); }
.outcomes .section-head { margin-bottom: var(--space-5); }
.chapters__stage { position: relative; aspect-ratio: 16 / 7; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); box-shadow: 0 0 0 var(--edge) var(--c-paper), 9px 9px 0 var(--edge) var(--c-brand-soft); }
.chapters__panel { position: absolute; inset: 0; }
.chapters__footage { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.chapters__scene { position: absolute; z-index: 2; top: 7%; width: min(380px, 38%); }
.chapters__panel[data-side="right"] .chapters__scene { right: 4%; }
.chapters__panel[data-side="left"] .chapters__scene { left: 4%; }
.chapters__stop { bottom: 14px; right: 14px; }
.outcomes__more { margin-top: var(--space-5); }
@media (max-width: 760px) {
  .chapters__stage { aspect-ratio: 4 / 5.2; }
  .chapters__footage { object-position: 50% 20%; }
  .chapters__scene { top: auto; bottom: 4.5%; width: auto; left: 4% !important; right: 4% !important; }
  .chapters__bar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
  .chapters__tab { flex-direction: column; gap: 0.4rem; padding-right: 0; }
  .chapters__t small { display: none; }
  .chapters__t b { font-size: 0.92rem; }
}

/* ---------- compare: drag the line ---------- */
.compare__box { position: relative; aspect-ratio: 16 / 8.2; overflow: hidden; border-radius: var(--radius-l); background: var(--c-ink); box-shadow: var(--shadow-l); touch-action: pan-y; }
.compare__side { position: absolute; inset: 0; }
.compare__photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
/* the printed reports stand on the before side's half at rest: the photo is mirrored */
.before .compare__photo { object-position: 50% 50%; transform: scaleX(-1); filter: saturate(0.4); }
.after { clip-path: inset(0 0 0 calc(var(--kit-v, 0.5) * 100%)); }
/* the plumber (the owner at work) stands on the after side's half at rest: the photo is mirrored */
.after .compare__photo { object-position: 50% 15%; transform: scaleX(-1); }
.compare__tag { position: absolute; z-index: 2; top: 5%; padding: 0.5rem 0.85rem; border-radius: var(--radius-s); background: var(--c-paper); color: var(--c-ink); box-shadow: var(--shadow-m); font: 800 1rem/1.1 var(--font-display); }
.before .compare__tag { left: 3%; }
.after .compare__tag { right: 3%; }
.compare__tag--us { background: var(--c-brand); color: var(--c-on-brand); }
.compare__cards { position: absolute; z-index: 2; bottom: 6%; display: grid; gap: 0.65rem; width: min(260px, 32%); }
.before .compare__cards { left: 3%; }
.after .compare__cards { right: 3%; }
.compare__range { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.handle { position: absolute; z-index: 4; top: 0; bottom: 0; left: calc(var(--kit-v, 0.5) * 100%); width: 0; pointer-events: none; opacity: clamp(0, calc((min(var(--kit-v, 0.5), 1 - var(--kit-v, 0.5)) - 0.03) * 14), 1); }
.compare__range:focus-visible + .handle { opacity: 1; }
.handle__line { position: absolute; top: 0; bottom: 0; left: -2px; width: 4px; background: var(--c-paper); box-shadow: 0 0 0 2px var(--c-ink); }
.handle__knob { position: absolute; top: 42%; left: 0; display: grid; place-items: center; width: 54px; height: 54px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--c-brand); color: var(--c-on-brand); box-shadow: var(--shadow-m); }
.handle__hint { position: absolute; top: calc(42% + 38px); left: 0; transform: translateX(-50%); padding: 0.35rem 0.65rem; border-radius: var(--radius-s); background: var(--c-ink); color: var(--c-paper); font: 700 0.88rem/1 var(--font-ui); white-space: nowrap; transition: opacity var(--dur-med); }
[data-kit-touched] .handle__hint { opacity: 0; }
.compare [data-kit-whole] { transition: opacity 0.2s, visibility 0s; }
.compare [data-kit-under] { opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0s 0.2s; }
@media (max-width: 760px) {
  .compare__box { aspect-ratio: 3 / 4.1; }
  .after .compare__photo { object-position: 49% 20%; }
  .compare__cards { width: calc(50% - 8% - 8px); gap: 0.5rem; }
  .compare__tag { font-size: 0.86rem; padding: 0.4rem 0.6rem; max-width: calc(50% - 8% - 8px); }
  .compare .note-card { padding: 0.5rem 0.6rem; font-size: 0.82rem; }
  .compare .note-card b { font-size: 0.86rem; }
  .handle__knob { top: 36%; width: 46px; height: 46px; }
  .handle__hint { top: calc(36% + 32px); }
}

/* ---------- who: six kinds and many more ---------- */
.who__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 0.6rem + 1.4vw, 1.75rem); margin: 0; padding: 0; list-style: none; }
.who__more { grid-column: span 2; }
.tile__photo { object-position: var(--pos, 50% 50%); }
/* each kind's own clip (Sean, 13 Nov: "Add more video"): 1 px past its box on every side, as kit.md's Video says */
.tile__clip { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }
.who__tiles { position: relative; }
.who__stop { top: 12px; right: 12px; }
.tile--more { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-4); }
.tile--more .tile__body { padding: 1.5rem; }
.tile--more .tile__name { font-size: 1.7rem; }
.tile__mark { flex: none; width: 7.5rem; height: 7.5rem; margin-right: var(--space-5); }
@media (max-width: 1000px) { .who__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .who__grid { gap: 0.85rem; }
  .who .tile__body { padding: 0.7rem 0.75rem 0.85rem; gap: 0.25rem; }
  .who .tile__name { font-size: 1.05rem; }
  .who .tile__fields { font-size: 0.86rem; line-height: 1.35; }
  .tile--more .tile__name { font-size: 1.3rem; }
  .tile__mark { width: 4rem; height: 4rem; margin-right: var(--space-4); }
}

/* ---------- faq ---------- */
.faq__in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: var(--space-6); align-items: start; }
.faq__head { position: sticky; top: 112px; margin-bottom: 0; }
@media (max-width: 900px) { .faq__in { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); } .faq__head { position: static; } }

/* ---------- close: the last push, over a new booking written into a planner ---------- */
main > .close { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(4.5rem, 3rem + 6vw, 8.5rem); background: var(--c-ink); }
.close__media { position: absolute; inset: 0; z-index: -1; }
.close__footage { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 35% 50%; }
.close__in { display: flex; justify-content: flex-end; }
.close__card { display: grid; gap: var(--space-4); width: min(33rem, 100%); }
.close__title { font-size: var(--fs-h2); padding-right: 4rem; }
.close__line { color: var(--c-ink-soft); }
.close__ticket { position: absolute; top: -2rem; right: -1.5rem; width: 230px; transform: rotate(4deg); }
.close__stop { bottom: 16px; right: var(--gutter); }
@media (max-width: 760px) {
  main > .close { padding-top: 15rem; }
  .close__footage { object-position: 30% 50%; }
  .close__title { padding-right: 0; }
  .close__ticket { top: -7.4rem; right: 0.25rem; width: 252px; }
}
