/* site\assets\css\pages\how-it-works.css: the How it works page (plan.md, How it works). Tokens from design\system.css
   only; the components from design\components.css. Under 1180 px (900 for the header) each photo becomes a band at its
   frame's top and its cards or scene stand over the band's foot (Lessons), so no card covers a face and half or more
   of each stays on its picture. */

/* ---------- 1. the header: the words centered over one wide frame of a planner filling up ---------- */
.hiw-hero { padding: clamp(36px, 4.4vw, 64px) 0 clamp(72px, 8vw, 120px); }
.hiw-hero__copy { text-align: center; }
.hiw-hero__title { max-width: 920px; margin-inline: auto; font-size: var(--fs-h1); }
.hiw-hero__title > span { display: inline-block; } /* each sentence on its own line, never "We" left at a line's end */
.hiw-hero__line { max-width: 620px; margin: 20px auto 0; font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); line-height: 1.55; color: var(--c-ink-soft); }
.hiw-hero__cta { justify-content: center; margin-top: 30px; }
.hiw-hero__stage { position: relative; margin: clamp(40px, 4.4vw, 64px) 12px 0; }
.hiw-hero__frame { position: relative; height: clamp(440px, 42vw, 720px); border-radius: var(--radius-l); overflow: hidden; background: var(--c-navy); isolation: isolate; }

/* the kit's gentle change, as kit.md gives it (as the home page's header has it, for this site's kit) */
[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 */
.hiw-hero__slide :is(video, .kit-first) { object-position: 50% 58%; }

/* the goal, then the week's bookings, over the dark desk at the right (the hand and the pen stay clear) */
.hiw-hero__cards { position: absolute; z-index: 4; top: 50%; right: clamp(24px, 3.4vw, 56px); width: 316px; display: grid; gap: 10px; transform: translateY(-50%); }
.hiw-hero__cards [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 14px)); }
.hiw-note { width: 100%; max-width: none; }
.hiw-note .note__icon svg { display: block; }
.hiw-note--goal .note__icon { background: var(--c-brand); color: var(--c-on-brand); }
.hiw-hero__stop { top: 16px; left: 16px; }
@media (max-width: 899px) {
  .hiw-hero__frame { height: auto; aspect-ratio: 16 / 10; }
  /* the cards stand over the frame's foot, more than half of them on the footage */
  .hiw-hero__cards { position: relative; top: auto; right: auto; width: min(340px, calc(100% - 32px)); margin: -124px auto 0; gap: 6px; transform: none; }
  .hiw-note { padding: 9px 14px 9px 9px; gap: 10px; }
  .hiw-note .note__icon { width: 32px; height: 32px; }
}
@media (max-width: 639px) {
  .hiw-hero__stage { margin: 32px 8px 0; }
  .hiw-hero__frame { aspect-ratio: 4 / 5; border-radius: var(--radius-m); }
  .hiw-hero__slide :is(video, .kit-first) { object-position: 52% 50%; }
  .hiw-hero__stop { top: 12px; left: 12px; }
}

/* ---------- 2. what changes: one box cut by the logo's diagonal, before on the left, after on the right ---------- */
.hiw-changes { padding: var(--section-y) 0; }
.hiw-changes__head { margin-inline: auto; text-align: center; }
.hiw-changes__head p { margin-inline: auto; }
.hiw-split { position: relative; height: clamp(520px, 44vw, 620px); }
.hiw-half { position: absolute; top: 0; bottom: 0; width: 55%; margin: 0; }
.hiw-half--before { left: 0; }
.hiw-half--after { right: 0; }
.hiw-half__pic { position: absolute; inset: 0; overflow: hidden; isolation: isolate; background: var(--c-paper-alt); }
/* each half is 55% of the box: the cut runs from 55% across at the top to 45% at the foot, a 10 px seam */
.hiw-half--before .hiw-half__pic { border-radius: var(--radius-l) 0 0 var(--radius-l); clip-path: polygon(0 0, calc(100% - 5px) 0, calc(81.82% - 5px) 100%, 0 100%); }
.hiw-half--after .hiw-half__pic { border-radius: 0 var(--radius-l) var(--radius-l) 0; clip-path: polygon(calc(18.18% + 5px) 0, 100% 0, 100% 100%, 5px 100%); }
.hiw-half__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.hiw-half--before .hiw-half__img { object-position: 100% 40%; filter: saturate(.85); }
.hiw-half--after .hiw-half__img { object-position: 0% 45%; }
.hiw-half__tag { position: absolute; z-index: 3; top: 22px; display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; background: rgb(var(--c-shade) / .8); color: var(--c-on-brand); font-family: var(--font-ui); font-size: 14px; font-weight: 600; }
.hiw-half__tag--after { background: var(--c-brand-dark); }
/* the cards face each other across the cut: before over the window and the laptop, after over the porch and the sky */
.hiw-half__cards { position: absolute; z-index: 2; top: 70px; width: 250px; display: grid; gap: 10px; }
.hiw-half--before .hiw-half__tag, .hiw-half--before .hiw-half__cards { left: 40%; }
.hiw-half--after .hiw-half__tag, .hiw-half--after .hiw-half__cards { left: 22%; }
.hiw-half .mini { box-shadow: var(--shadow-m); }
.hiw-half .mini__big { line-height: 1.15; text-wrap: balance; }
.hiw-half__cards [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 10px)); }
.hiw-changes__stop { top: -58px; right: 0; }
@media (max-width: 1179px) {
  /* stacked: the cut a slanted seam between the two photos, each side's cards over its photo's foot */
  .hiw-split { height: auto; display: grid; gap: 30px; }
  .hiw-half { position: relative; top: auto; bottom: auto; width: auto; }
  .hiw-half__pic { position: relative; inset: auto; aspect-ratio: 16 / 10; }
  .hiw-half--before .hiw-half__pic { border-radius: var(--radius-l) var(--radius-l) 0 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), 0 100%); }
  .hiw-half--after .hiw-half__pic { border-radius: 0 0 var(--radius-l) var(--radius-l); clip-path: polygon(0 34px, 100% 0, 100% 100%, 0 100%); }
  .hiw-half--before .hiw-half__img, .hiw-half--after .hiw-half__img { object-position: 50% 40%; }
  .hiw-half--before .hiw-half__tag { left: 16px; top: 16px; }
  .hiw-half--after .hiw-half__tag { left: 16px; top: 46px; }
  .hiw-half--before .hiw-half__cards, .hiw-half--after .hiw-half__cards { position: relative; left: auto; top: auto; width: min(340px, calc(100% - 32px)); margin: -116px 0 0 16px; }
}
@media (max-width: 639px) {
  .hiw-half__pic { aspect-ratio: 4 / 3; }
  .hiw-half--before .hiw-half__pic { border-radius: var(--radius-m) var(--radius-m) 0 0; }
  .hiw-half--after .hiw-half__pic { border-radius: 0 0 var(--radius-m) var(--radius-m); }
  .hiw-half__cards { gap: 6px; }
  .hiw-half--before .hiw-half__cards, .hiw-half--after .hiw-half__cards { margin: -124px 0 0 12px; width: calc(100% - 24px); }
}

/* ---------- 3. the signature: the six steps on the logo's stadium, cut by its diagonal into two halves ---------- */
.hiw-steps.ground::before { display: none; } /* the part's stadium is the track itself */
.hiw-steps__head { margin-inline: auto; text-align: center; }
.hiw-steps__head p { margin-inline: auto; }
.hiw-tl { --track: 64px; --track-x: 24px; --col: 120px; --cut: 50%; position: relative; max-width: 1120px; margin: 0 auto; padding-left: var(--col); }
.hiw-tl__track { position: absolute; z-index: 0; top: 0; bottom: 0; left: var(--track-x); width: var(--track); }
.hiw-tl__half { position: absolute; left: 0; right: 0; overflow: hidden; background: color-mix(in srgb, var(--c-brand) 14%, var(--c-paper)); }
/* the cut: the you half's foot and the us half's top slant the same way as the logo's diagonal, 10 px apart */
.hiw-tl__half--you { top: 0; height: calc(var(--cut) - 5px); border-radius: 999px 999px 0 0; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 26px), 0 100%); }
.hiw-tl__half--us { top: calc(var(--cut) - 21px); bottom: 0; border-radius: 0 0 999px 999px; clip-path: polygon(0 26px, 100% 0, 100% 100%, 0 100%); }
.hiw-tl__fill { position: absolute; left: 0; right: 0; top: 0; height: calc(var(--p, 0) * 100%); background: var(--c-brand); }
.hiw-tl__half--us .hiw-tl__fill { background: var(--c-navy); }
.hiw-tl__group { position: relative; z-index: 1; }
.hiw-tl__sign { display: flex; width: max-content; align-items: center; gap: 10px; height: 46px; margin: 0 0 24px calc(var(--track-x) - var(--col)); padding: 0 22px 0 20px; border-radius: 999px; background: var(--c-brand-dark); color: var(--c-on-brand); font-family: var(--font-ui); font-size: 15px; box-shadow: var(--shadow-s); }
.hiw-tl__sign b { font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; }
.hiw-tl__group--us .hiw-tl__sign { background: var(--c-navy); }
.hiw-tl__list { display: grid; gap: 24px; margin: 0; padding: 0; list-style: none; }
.hiw-tl__yes { position: relative; z-index: 1; margin: 36px 0; }
.hiw-tl__yes-pill { display: inline-flex; align-items: center; gap: 10px; min-height: 46px; padding: 6px 20px 6px 7px; border-radius: 999px; background: var(--c-paper); color: var(--c-ink); font-family: var(--font-ui); font-size: 1rem; font-weight: 600; line-height: 1.35; box-shadow: var(--shadow-m); box-sizing: border-box; }
.hiw-tl__yes-icon { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c-brand-light); color: var(--c-brand-dark); }
.hiw-tl__yes-icon svg { width: 18px; height: 18px; }
.hiw-step { position: relative; }
.hiw-step__num { position: absolute; z-index: 2; top: 34px; left: calc(var(--track-x) - var(--col) + (var(--track) - 52px) / 2); display: grid; place-items: center; width: 52px; height: 34px; border-radius: 999px; background: var(--c-paper); color: var(--c-ink-soft); font-family: var(--font-display); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; box-shadow: var(--shadow-s); }
.hiw-step.is-reached .hiw-step__num { background: var(--c-brand-dark); color: var(--c-on-brand); box-shadow: 0 0 0 3px var(--c-paper), var(--shadow-m); }
.hiw-tl__group--us .hiw-step.is-reached .hiw-step__num { background: var(--c-navy); }
.hiw-step__card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: clamp(28px, 3.4vw, 48px); align-items: center; padding: clamp(24px, 2.6vw, 36px); border: 1px solid var(--c-line); border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-m); }
.hiw-step__title { font-size: var(--fs-h3); line-height: 1.3; }
.hiw-step__time { position: relative; top: -2px; margin-left: 6px; }
.hiw-step__line { margin-top: 12px; max-width: 440px; color: var(--c-ink-soft); }
.hiw-step__pic { display: flex; flex-direction: column; justify-content: center; min-height: 300px; }
.hiw-step--goal .hiw-step__pic { justify-content: flex-end; height: 300px; } /* the chat grows up from the foot, moving nothing */
.scene.hiw-step__scene { width: 100%; }
.hiw-steps__stop { top: 0; right: 0; }
@media (max-width: 1023px) {
  .hiw-step__card { grid-template-columns: minmax(0, 1fr); }
  .hiw-step__pic { min-height: 0; max-width: 460px; }
  .hiw-step--goal .hiw-step__pic { height: 290px; }
}
@media (max-width: 639px) {
  /* a slimmer track and a scene that runs to the card's edges, so each scene keeps its words whole */
  .hiw-tl { --track: 26px; --track-x: 0px; --col: 36px; }
  .hiw-tl__half--you { clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), 0 100%); }
  .hiw-tl__half--us { top: calc(var(--cut) - 9px); clip-path: polygon(0 14px, 100% 0, 100% 100%, 0 100%); }
  .hiw-tl__sign { height: 40px; gap: 8px; padding: 0 16px 0 14px; font-size: 14px; }
  .hiw-tl__sign b { font-size: 1rem; }
  .hiw-tl__yes-pill { font-size: .9375rem; }
  .hiw-step__num { top: 20px; left: calc(var(--track-x) - var(--col) + (var(--track) - 30px) / 2); width: 30px; height: 24px; font-size: 12px; }
  .hiw-step__card { gap: 16px; padding: 18px 10px 10px; border-radius: var(--radius-m); }
  .hiw-step__text { padding-inline: 4px; }
  .hiw-step__pic { margin-inline: -6px; }
  .hiw-step--goal .hiw-step__pic { height: 276px; }
}

/* ---------- 4. what the free plan holds: the words, the framed photo with the plan over her screen ---------- */
.hiw-inside { padding: var(--section-y) 0; }
.hiw-inside__in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(36px, 4.5vw, 72px); align-items: center; }
.hiw-inside__copy { margin-bottom: 0; }
.hiw-inside__frame { aspect-ratio: 1.3; min-height: 600px; }
.media-frame > .hiw-inside__img { object-position: 100% 30%; }
.scene.hiw-inside__plan { position: absolute; z-index: 2; right: 8px; top: 50%; width: min(500px, 60%); transform: translateY(-50%); }
.media-frame > .hiw-inside__stop { top: 16px; right: 16px; bottom: auto; }
@media (max-width: 1179px) {
  .hiw-inside__in { grid-template-columns: minmax(0, 1fr); }
  .hiw-inside__copy { max-width: 720px; }
  .hiw-inside__frame { --band: 520px; --top: 290px; aspect-ratio: auto; min-height: 0; padding: var(--top) 0 16px; background: var(--c-navy); }
  .media-frame > .hiw-inside__img { inset: -1px -1px auto -1px; height: calc(var(--band) + 2px); object-position: 45% 20%; }
  .scene.hiw-inside__plan { position: relative; right: auto; top: auto; width: calc(100% - 32px); max-width: 560px; margin: 0 auto; transform: none; }
  .media-frame > .hiw-inside__stop { top: calc(var(--top) - 56px); right: 16px; }
}
@media (max-width: 639px) {
  .hiw-inside__frame { --band: 380px; --top: 180px; padding-bottom: 8px; border-radius: var(--radius-m); }
  .scene.hiw-inside__plan { width: calc(100% - 16px); }
}

/* ---------- 5. who runs it: the words, then the photo offset to the right, his dashboard over the van's door ---------- */
.hiw-team { padding: 0 0 var(--section-y); }
.hiw-team__head { max-width: 560px; margin-bottom: 0; }
.hiw-team__frame { width: 84%; margin: clamp(32px, 3.6vw, 48px) 0 0 auto; aspect-ratio: 1.75; min-height: 520px; }
.media-frame > .hiw-team__img { object-position: 50% 38%; }
.hiw-team__board { position: absolute; z-index: 2; left: 13%; top: 64px; width: 340px; display: grid; gap: 10px; padding: 16px; border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-l); box-sizing: border-box; }
.hiw-team__board [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 10px)); }
.hiw-team__top { position: relative; display: grid; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line); }
.hiw-team__name { display: grid; gap: 2px; }
.hiw-team__name b { font-family: var(--font-ui); font-size: 15px; font-weight: 600; line-height: 1.3; }
.hiw-team__name span { font-size: 13px; line-height: 1.3; color: var(--c-ink-soft); }
.hiw-team__btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border: 1.5px solid var(--c-brand); border-radius: 999px; background: var(--c-paper); color: var(--c-brand-text); font-family: var(--font-ui); font-size: 15px; font-weight: 600; box-sizing: border-box; }
.hiw-team__btn svg { width: 18px; height: 18px; }
.hiw-team__btn--on { position: absolute; left: 0; right: 0; bottom: 14px; border-color: var(--c-brand-dark); background: var(--c-brand-dark); color: var(--c-on-brand); }
.hiw-team__msg { margin: 0; max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; }
.hiw-team__msg--me { justify-self: end; border-bottom-right-radius: 6px; background: var(--c-brand-dark); color: var(--c-on-brand); }
.hiw-team__msg--team { justify-self: start; display: grid; gap: 6px; border-bottom-left-radius: 6px; background: var(--c-brand-light); color: var(--c-ink); }
.hiw-team__who { display: flex; align-items: center; gap: 6px; font-family: var(--font-ui); font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--c-brand-text); }
.hiw-team__who img { width: 18px; height: 18px; }
/* the chat's own field at its foot: before the first message the thread reads as an open chat, never a blank card */
.hiw-team__input { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; margin-top: 4px; padding: 0 6px 0 16px; border: 1px solid var(--c-line); border-radius: 999px; color: var(--c-ink-soft); font-size: 14px; box-sizing: border-box; }
.hiw-team__send { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--c-brand-light); color: var(--c-brand-dark); }
.hiw-team__send svg { width: 16px; height: 16px; }
.media-frame > .hiw-team__stop { top: 64px; left: calc(13% + 352px); right: auto; bottom: auto; }
@media (max-width: 1179px) {
  .hiw-team__frame { --band: 520px; --top: 290px; width: 100%; aspect-ratio: auto; min-height: 0; padding: var(--top) 0 16px; background: var(--c-navy); }
  .media-frame > .hiw-team__img { inset: -1px -1px auto -1px; height: calc(var(--band) + 2px); object-position: 72% 30%; }
  .hiw-team__board { position: relative; left: auto; top: auto; width: min(380px, calc(100% - 32px)); margin: 0 auto; }
  .media-frame > .hiw-team__stop { top: calc(var(--top) - 56px); left: auto; right: 16px; }
}
@media (max-width: 639px) {
  .hiw-team__frame { --band: 440px; --top: 240px; border-radius: var(--radius-m); }
}

/* ---------- 6. the questions ---------- */
.hiw-faq { padding: 0 0 var(--section-y); }
.hiw-faq__in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.hiw-faq__head { margin-bottom: 0; }
@media (max-width: 899px) { .hiw-faq__in { grid-template-columns: minmax(0, 1fr); gap: 24px; } }

/* ---------- 7. the close: the plumber at the door in the right half ---------- */
.hiw-close .close-band__clip { object-position: 62% 40%; }
@media (max-width: 759px) {
  .hiw-close .close-band__copy { padding-top: 240px; }
  .hiw-close .close-band__clip { object-position: 58% 20%; }
}
