/* How it works: plan.md "How it works". The thread (an arsenal composition, its CSS imported first and restyled here)
   holds the page: its line, a chain of the site's rings, starts under the header's button, plugs into each step's
   number, where a ring ripples out as it arrives, and ends in the closing button. Tokens only. */
@import url("../arsenal/thread.css");

/* ---------- the thread, this site's own: a chain of the rings, a ripple at every number ---------- */
.hiw { --thread-link: 13px; --thread-gap: 22px; --thread-radius: 56px; }
/* the parts' grounds are positioned here (bands), so the line is laid over them; what it passes behind (the pictures
   and cards marked data-thread-light, later in the page) stays over it */
.hiw .thread__svg { z-index: 1; }
.hiw-fill { display: block; width: 100%; height: 100%; }

/* a step's number: a cream disc ringed in ember, its numeral in the voice face; it fills ember as the line plugs in,
   and two rings ripple out from it (--lit-after: 0 as the head arrives, 1 once the head is 120 px further on) */
.hiw-num { position: relative; z-index: 2; display: grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--c-card)); box-shadow: inset 0 0 0 2px var(--c-brand), var(--shadow-m); }
.hiw-num b { font-family: var(--font-voice); font-style: italic; font-weight: 600; font-size: 1.6rem; line-height: 1; color: color-mix(in srgb, var(--c-on-brand) calc(var(--lit, 0) * 100%), var(--c-brand-text)); }
.hiw-num::before, .hiw-num::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--c-accent); border-radius: 50%; pointer-events: none; opacity: calc(min(1, var(--lit-after, 0) * 10) * (1 - var(--lit-after, 0))); transform: scale(calc(1 + var(--lit-after, 0) * 1.5)); }
.hiw-num::after { border-width: 1.5px; opacity: calc(min(1, var(--lit-after, 0) * 10) * (1 - var(--lit-after, 0)) * .55); transform: scale(calc(1 + var(--lit-after, 0) * 2.6)); }
/* the main button as a point of the line: its box is the button's, and it takes a ring once the line reaches it */
.hiw-go { display: inline-flex; border-radius: 999px; }
.hiw-go .button { box-shadow: 0 0 0 calc(var(--lit, 0) * 6px) color-mix(in srgb, var(--c-accent) 32%, transparent); }

/* the designed ground's faint rings, under everything in their part */
.hiw-rings { position: absolute; z-index: -1; max-width: none; fill: none; stroke: var(--c-brand); stroke-width: 1.4; pointer-events: none; }
.hiw-rings circle { opacity: calc(.2 - var(--k) * .02); }

/* the steps' words, shared by the owner's three and ours */
.hiw-step__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.875rem); line-height: 1.15; letter-spacing: -0.015em; color: var(--c-ink); text-wrap: balance; }
.hiw-step__time { display: inline-flex; margin: .7rem 0 0; padding: .32rem .8rem; border-radius: 999px; background: var(--c-brand-light); font: 700 var(--fs-small)/1.2 var(--font-ui); color: var(--c-brand-text); }
.hiw-step__line { margin: .75rem 0 0; font-size: var(--fs-body); line-height: 1.5; color: var(--c-ink-soft); text-wrap: pretty; }

/* one stop for a tall part's scenes, kept in sight at the foot of the screen while the part is on it */
.hiw-follow { position: relative; }
.hiw-follow__stop { position: sticky; bottom: 1.5rem; margin: 1.5rem 0 0 auto; }
/* below 1000 px the rows stack and a floating stop would cover their words and cards: the page's script carries this
   one onto the top corner of the photo in view (js\pages\how-it-works.js) */
.hiw-follow .hiw-row__frame > .hiw-follow__stop { position: absolute; z-index: 3; top: .75rem; right: .75rem; bottom: auto; margin: 0; }

/* ---------- hero: the headline centered on cream, a café owner opening up in a wide frame under it ---------- */
.hiw-hero { position: relative; padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(3.5rem, 7vw, 6rem); overflow: clip; }
.hiw-hero__rings { left: 50%; top: clamp(8rem, 13vw, 11.5rem); width: 1100px; height: 1100px; translate: -50% -50%; }
.hiw-hero__words { display: grid; justify-items: center; text-align: center; }
.hiw-hero__title { max-width: 15em; margin: 0; font-family: var(--font-display); font-weight: var(--w-display); font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--ls-display); color: var(--c-ink); text-wrap: balance; }
.hiw-hero__lead { max-width: 34em; margin: 1.25rem 0 0; font-size: clamp(1.0625rem, .95rem + .42vw, 1.25rem); line-height: 1.5; color: var(--c-ink-soft); text-wrap: pretty; }
/* the button and its line side by side, so the thread leaves the button straight down with no words under it */
.hiw-hero__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .75rem 1.5rem; margin-top: 1.75rem; }
.hiw-hero__note { margin: 0; }
.hiw-hero__stage { position: relative; aspect-ratio: 16 / 7; min-height: 440px; margin-top: clamp(2.25rem, 4.5vw, 3.5rem); overflow: hidden; border-radius: var(--radius-l); background: var(--c-night); box-shadow: var(--shadow-l); }
.hiw-hero__clip { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 30%; } /* 1 px past its frame */
/* one still grade: a little deeper at the left, under the card */
.hiw-hero__stage::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-night) 30%, transparent) 0%, transparent 46%); }
/* the week's new clients on a solid cream card at the top left, over the lamp, clear of her face and her sign, so its
   rows land in the first screen; the number she picked under its title; each row lands with a ring going out from its
   dot (the sequence's --kit-in); the stop on the card's corner */
.hiw-hero__deck { position: absolute; z-index: 2; left: 3.5%; top: 7%; width: min(370px, 36%); }
.hiw-hero__card { padding: 1rem 1.15rem .45rem; border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-card); box-shadow: var(--shadow-l); }
.hiw-hero__card-title { margin: 0 0 .5rem; font: 700 1.0625rem/1.3 var(--font-ui); color: var(--c-ink); }
.hiw-hero__goal { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .6rem; padding: .3rem .75rem .3rem .4rem; border-radius: 999px; background: color-mix(in srgb, var(--c-brand) 11%, var(--c-card)); font: 700 .8125rem/1.25 var(--font-ui); color: var(--c-brand-text); }
.hiw-hero__goal-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, var(--c-brand) 0 3px, transparent 3.5px); box-shadow: inset 0 0 0 1.5px var(--c-brand); }
.hiw-hero__list { display: grid; margin: 0; padding: 0; list-style: none; }
.hiw-hero__row { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--c-line); opacity: min(1, calc(var(--kit-in, 1) * 2.5)); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.hiw-hero__dot { position: relative; width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle, var(--c-on-brand) 0 4px, var(--c-brand) 4.5px 9.5px, color-mix(in srgb, var(--c-brand) 16%, var(--c-card)) 10px); }
.hiw-hero__dot::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--c-accent); border-radius: 50%; opacity: calc((1 - var(--kit-in, 1)) * 1.4); transform: scale(calc(1 + var(--kit-in, 1) * 1.3)); }
.hiw-hero__job { min-width: 0; }
.hiw-hero__job b { display: block; font: 700 1rem/1.25 var(--font-ui); color: var(--c-ink); }
.hiw-hero__job span { display: block; margin-top: .15rem; font-size: .875rem; line-height: 1.35; color: var(--c-ink-soft); }
.hiw-hero__stop { position: absolute; z-index: 3; top: -14px; right: -14px; }

/* ---------- yours: the owner's three steps, each over a real photo, the line down a lane at their right ---------- */
/* (clipped sideways: its numbers' ripples spread past the page's right edge) */
.hiw-yours { position: relative; padding-block: var(--section-y); overflow-x: clip; }
.hiw-yours__head { max-width: 44rem; }
/* its stop at the left, clear of the lane */
.hiw-yours .hiw-follow__stop { margin: 1.5rem auto 0 0; }
.hiw-yours__steps { display: grid; gap: clamp(3rem, 6vw, 5rem); margin: 0; padding: 0; list-style: none; }
/* the rows mirror ours: the photo, its words, then the number in the lane at the right */
.hiw-row.hiw-row--mirror { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) 68px; }
.hiw-row.hiw-row--mirror .hiw-row__stage { grid-column: 1; }
.hiw-row.hiw-row--mirror .hiw-row__words { grid-column: 2; }
.hiw-row.hiw-row--mirror .hiw-num { grid-column: 3; }

/* ---------- ours: three real photos, the line down a lane at their left ---------- */
.hiw-ours { position: relative; padding-block: var(--section-y); }
.hiw-ours__head { max-width: 46rem; margin-left: calc(68px + clamp(1.5rem, 3vw, 2.5rem)); }
.hiw-ours__steps { display: grid; gap: clamp(3rem, 6vw, 5rem); margin: 0; padding: 0; list-style: none; }
.hiw-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) minmax(0, 2fr); column-gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start; }
.hiw-row .hiw-num { grid-column: 1; grid-row: 1; }
.hiw-row__words { grid-column: 2; grid-row: 1; padding-top: .9rem; }
.hiw-row__stage { position: relative; grid-column: 3; grid-row: 1; aspect-ratio: 16 / 10; }
.hiw-row__frame { position: absolute; inset: 0; overflow: hidden; border-radius: var(--radius-l); background: var(--c-night); box-shadow: var(--shadow-l); }
.hiw-row__img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* each scene's card on its photo's clear side, growing up from near its foot, off every face */
.hiw-row__scene { position: absolute; z-index: 2; bottom: 6%; width: min(330px, 44%); }
.hiw-row__scene--right { right: 4%; }
.hiw-row__scene--left { left: 4%; }
.hiw-row__stage--hiw-tune .hiw-row__scene { width: min(300px, 40%); }
.hiw-row__scene--leadbars { width: min(370px, 48%); }

/* ---------- inside: the free plan building itself, in front of a mechanic at work ---------- */
.hiw-inside { position: relative; padding-block: var(--section-y); }
.hiw-inside__head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
/* the photo over the right three quarters, the plan's card in front of its left edge, clear of his face */
.hiw-inside__stage { position: relative; min-height: 600px; }
.hiw-inside__frame { position: absolute; top: 0; right: 0; bottom: 0; width: 76%; overflow: hidden; border-radius: var(--radius-l); background: var(--c-night); box-shadow: var(--shadow-l); }
.hiw-inside__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 60% 40%; }
.hiw-inside__card { position: relative; z-index: 2; width: min(620px, 52%); height: 560px; margin-top: 20px; }
/* on the plan card's corner, in sight while it builds */
.hiw-inside__stop { position: absolute; z-index: 3; top: -14px; right: -14px; }

/* ---------- team: the owner's dashboard on a tablet, a person one tap away ---------- */
.hiw-team { position: relative; padding-block: var(--section-y); }
.hiw-team__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.hiw-team__stage { position: relative; justify-self: end; width: min(520px, 100%); }
.hiw-team__frame { position: relative; aspect-ratio: 5 / 6; overflow: hidden; border-radius: var(--radius-l); background: var(--c-night); box-shadow: var(--shadow-l); }
/* the photo laid wide inside its frame, so the tablet and its screen fill it (h.screen lays the dashboard on the glass) */
.hiw-team__shot { position: absolute; margin: 0; width: 230%; left: -28.4%; top: -13.1%; }
.hiw-team__shot > img { display: block; width: 100%; height: auto; }
/* the screen's glass under the dashboard: the photo's bare screen (a cold lavender) never shows round the card or
   while the dashboard fades at its loop */
.hiw-team__shot .screen { background: var(--c-paper); }
/* the dashboard as a card over the photo: on a phone only (the screen's words would be under 13 px there) */
.hiw-team__card { display: none; }
/* the dashboard's button, hung below the frame's corner, clear of the screen and its last line */
.hiw-team__human { position: absolute; z-index: 3; right: -6%; bottom: -64px; display: grid; justify-items: start; gap: .6rem; width: min(250px, 62%); padding: 1rem 1.1rem 1.05rem; border: 1px solid var(--c-line); border-radius: var(--radius-m); background: var(--c-card); box-shadow: var(--shadow-l); }
.hiw-team__who { display: flex; align-items: center; gap: .55rem; font: 700 .9375rem/1.2 var(--font-ui); color: var(--c-ink); }
.hiw-team__who img { width: 28px; height: 28px; border-radius: 8px; }
.hiw-team__btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.1rem; border-radius: 999px; background: var(--c-brand); font: 700 .9375rem/1 var(--font-ui); color: var(--c-on-brand); }
.hiw-team__line { font-size: .9375rem; line-height: 1.4; color: var(--c-ink-soft); }
/* on the frame's top right corner, half outside it: the screen fills the frame on a phone */
.hiw-team__stop { position: absolute; z-index: 4; top: -14px; right: -14px; }
.hiw-team__words { max-width: 32rem; }
.hiw-team__link { font-weight: 700; color: var(--c-ink); text-decoration: underline; text-decoration-color: var(--c-brand); text-underline-offset: .18em; }

/* ---------- faq: the line runs down the gutter between the headline and the questions ---------- */
.hiw .faq__list { position: relative; }
.hiw-faq__node { position: absolute; z-index: 2; left: calc(clamp(2rem, 5vw, 5rem) / -2 - 8px); top: 1.55rem; width: 16px; height: 16px; border-radius: 50%; background: var(--c-paper-alt); box-shadow: inset 0 0 0 2px var(--c-brand); }

/* ---------- close: the wide close (components), the line coming in level with the button ---------- */
.hiw-close .close__bg { object-position: 50% 6%; }
.hiw-close .close__line { text-wrap: balance; }
.hiw-close__go { display: grid; justify-items: center; gap: .9rem; }
.hiw-close__row { position: relative; display: inline-flex; }
/* where the line enters: a ring at the band's left edge, level with the button (the button is centered on the band) */
.hiw-close__node { position: absolute; top: 50%; left: calc(50% - 50vw + var(--gutter)); width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--c-night); box-shadow: inset 0 0 0 2px var(--c-accent); }
.hiw-close__note { justify-content: center; color: var(--c-on-night-soft); }
.hiw-close__note span::before { background: var(--c-accent); }

/* ---------- below 1000 px: the thread runs beside each part's numbers; the rows stack beside a lane ---------- */
@media (max-width: 999.98px) {
  .hiw { --thread-narrow: 1; }
  .hiw-hero__stage { aspect-ratio: 16 / 9; min-height: 0; }
  .hiw-hero__deck { width: min(350px, 48%); }

  .hiw-row, .hiw-row.hiw-row--mirror { grid-template-columns: 56px minmax(0, 1fr); column-gap: 1rem; row-gap: 1.25rem; align-items: start; }
  .hiw-num { width: 56px; height: 56px; }
  .hiw-num b { font-size: 1.35rem; }
  .hiw-row .hiw-num, .hiw-row.hiw-row--mirror .hiw-num { grid-column: 1; grid-row: 1; }
  .hiw-row__words, .hiw-row.hiw-row--mirror .hiw-row__words { grid-column: 2; grid-row: 1; padding-top: .35rem; }
  .hiw-ours__head { margin-left: 0; }
  .hiw-yours .hiw-follow__stop { margin: 1.5rem 0 0 auto; }
  .hiw-row__stage, .hiw-row.hiw-row--mirror .hiw-row__stage { grid-column: 1 / -1; grid-row: 2; aspect-ratio: auto; }
  .hiw-row__frame { position: relative; inset: auto; aspect-ratio: 4 / 3; }
  /* each card over its photo's lower part, under the faces (Lessons) */
  .hiw-row__scene, .hiw-row__stage--hiw-tune .hiw-row__scene { position: relative; bottom: auto; width: min(380px, calc(100% - 2rem)); margin: calc(-1 * clamp(150px, 30vw, 230px)) 1rem 0 auto; }
  .hiw-row__scene--right { right: auto; }
  .hiw-row__scene--left { left: auto; margin-left: 1rem; margin-right: auto; }
  /* the stage never shorter than its photo, and a card that grows as it plays holds room for its tallest moment (--tall,
     measured through its loop), so the photo and the step under it never move */
  .hiw-row__scene, .hiw-row__stage--hiw-tune .hiw-row__scene { min-height: max(clamp(150px, 30vw, 230px), var(--tall, 0px)); }
  .hiw-row__stage--hiw-pick { --tall: 238px; }
  .hiw-row__stage--hiw-phone { --tall: 282px; }

  .hiw-inside__stage { min-height: 0; }
  .hiw-inside__frame { position: relative; width: 100%; aspect-ratio: 16 / 10; }
  .hiw-inside__card { width: min(620px, calc(100% - 2rem)); margin: -150px auto 0; }
  .hiw-team__in { grid-template-columns: 1fr; }
  .hiw-team__stage { order: 2; justify-self: center; }
  /* no line in the close: the narrow line would run on from the button to the band's foot */
  .hiw-faq__node, .hiw-close__node { display: none; }
}
/* the call bar shows under 900 px: the following stop stands above it */
@media (max-width: 899.98px) { .hiw-follow__stop { bottom: 5.5rem; } }
/* plan-builder lays out tall when its box is under 600 px wide */
@media (max-width: 649.98px) { .hiw-inside__card { width: min(360px, calc(100% - 1.5rem)); height: 700px; } }
@media (max-width: 699.98px) {
  /* square, so the card's rows land in the first screen, under her face */
  .hiw-hero__stage { aspect-ratio: 1 / 1; }
  .hiw-hero__clip { object-position: 62% 30%; }
  /* the close: the owner at his client's table, going over the estimate, the couple out of the frame (never a slice of
     a face at its edge, and never the couple alone, which reads as doubt) */
  .hiw-close .close__bg { object-position: 0% 6%; }
  .hiw-hero__deck { left: .75rem; right: .75rem; top: auto; bottom: .75rem; width: auto; }
  /* a tighter card, so its top stays clear of her chin */
  .hiw-hero__card { padding: .75rem .9rem .25rem; }
  .hiw-hero__card-title { margin-bottom: .35rem; font-size: 1rem; }
  .hiw-hero__goal { margin-bottom: .4rem; }
  .hiw-hero__row { padding: .5rem 0; }
  .hiw-hero__row:nth-child(3) { display: none; }
  /* the photos taller, each card over the lower part of its photo (--lap: how much of it), the faces above it */
  .hiw-row__frame, .hiw-inside__frame { aspect-ratio: 4 / 5; }
  .hiw-row__scene, .hiw-row__stage--hiw-tune .hiw-row__scene, .hiw-row__scene--left { width: auto; margin: calc(-1 * var(--lap, .58) * (100vw - 2 * var(--gutter)) * 1.25) .75rem 0; min-height: max(calc(var(--lap, .58) * (100vw - 2 * var(--gutter)) * 1.25), var(--tall, 0px)); }
  .hiw-row__stage--hiw-pick { --lap: .4; --tall: 276px; }
  /* his chin is at 51% of the photo's height: the card's top stands under it, on every phone */
  .hiw-row__stage--hiw-phone { --lap: .45; }
  .hiw-row__stage--hiw-pick .hiw-row__img { object-position: 30% 50%; }
  .hiw-row__stage--hiw-plan .hiw-row__img { object-position: 70% 30%; }
  .hiw-row__stage--hiw-live .hiw-row__img { object-position: 58% 30%; }
  .hiw-row__stage--hiw-phone .hiw-row__img { object-position: 75% 40%; }
  .hiw-row__stage--hiw-tune .hiw-row__img { object-position: 45% 40%; }
  .hiw-inside__img { object-position: 52% 30%; }
  .hiw-inside__card { margin-top: calc(-.45 * (100vw - 2 * var(--gutter)) * 1.25); }
  /* the desk beside the tablet (the plant, the pen), its bare screen out of the frame; the dashboard over the photo's
     lower part as a card */
  .hiw-team__frame { aspect-ratio: 4 / 5; }
  .hiw-team__shot { width: 190%; left: -95%; top: -1%; }
  .hiw-team__shot [data-scene] { display: none; }
  .hiw-team__card { display: block; position: relative; z-index: 2; height: 540px; margin: -80% .75rem 0; }
  .hiw-team__human { position: relative; right: auto; bottom: auto; width: min(260px, 80%); margin: .75rem 0 0 auto; }
}
/* everycall's card is tighter in a box under 360 px wide: its tallest moment is 241 px there, 281 px above */
@media (max-width: 418.98px) { .hiw-row__stage--hiw-phone { --tall: 242px; } }
