@import url("../arsenal/thread.css");

/* The How it works page (plan.md "How it works"): the thread, one tangerine line from the header's button through every
   step's number to the close's button. Its parts are never positioned or isolated (they would paint over the line): the
   designed ground is drawn on the part itself, and what stands on a picture takes z-index 2 (the pictures take 1). */
.hiw { --thread-bg: var(--c-ground); --ring: var(--c-ground); }
@media (max-width: 1100px) { .hiw.thread { --thread-narrow: 1; } }

/* the step numbers and the hand-over node: the line plugs into them; they fill with the brand as it does, and one ring
   ripples out (thread's --lit and --lit-after) */
.hiw-num { position: relative; z-index: 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font: 700 1.375rem/1 var(--font-display);
  --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-paper));
  color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-ink-soft));
  box-shadow: 0 0 0 6px var(--ring), inset 0 0 0 1.5px color-mix(in srgb, var(--c-line) calc((1 - var(--l)) * 100%), transparent); }
.hiw-num::after, .hiw-hand__node::after, .hiwf__node::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  --a: var(--lit-after, 0);
  box-shadow: 0 0 0 calc((1 - (1 - var(--a)) * (1 - var(--a))) * 18px) color-mix(in srgb, var(--c-brand) calc((1 - var(--a)) * 26%), transparent); }

/* hero: the words on the ground at the left, the line leaving the button; the planner as a wide band under them, the
   notifications stacking over its right side */
.hiwh { padding-top: clamp(3rem, 6vw, 5rem); }
.hiwh__words { padding-bottom: clamp(2.5rem, 4vw, 3.5rem); }
.hiwh__words h1 { max-width: 20ch; margin: 0 0 1rem; font-size: clamp(2.75rem, 1.7rem + 2.8vw, 4.5rem); line-height: .96; text-wrap: balance; }
.hiwh__line { margin: 0 0 1.75rem; max-width: 30em; font-size: clamp(1.125rem, 1rem + .4vw, 1.375rem); line-height: 1.45; color: var(--c-ink-soft); }
.hiwh__go { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.hiwh__go .cta-line__note { max-width: 24em; }
.hiwh__band { position: relative; margin: 0; height: clamp(440px, 38vw, 560px); overflow: hidden; background: var(--c-ink); }
.hiwh__band > img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 45% 45%; }
/* the stack sits high in the band, so all four notifications are on the first screen; the scene's height is its tag,
   a gap and the stack (wyw hangs the stack 30 px below its box); the stop sits in the tag's row */
.hiwh__demo { position: absolute; z-index: 2; top: 40px; right: max(var(--gutter), calc((100% - var(--max-w)) / 2)); width: 500px; }
.hiwh__scene { width: 100%; min-height: 320px; }
.hiwh__tag { top: -14px; left: 26px; }
.hiwh__stop { top: 16px; right: 26px; }
@media (max-width: 1100px) {
  .hiwh__band { height: clamp(420px, 56vw, 520px); }
  .hiwh__demo { top: 32px; width: min(440px, calc(100% - 2 * var(--gutter))); }
  .hiwh__scene { min-height: 170px; }
  .hiwh__tag { left: 14px; }
  .hiwh__stop { right: 12px; }
}
@media (max-width: 760px) {
  .hiwh__go { display: grid; justify-items: start; }
  .hiwh__band { height: 400px; }
  .hiwh__band > img { object-position: 40% 40%; }
  /* on the phone the stack sits low in the band, the hand writing above it, both notifications on the first screen */
  .hiwh__demo { top: auto; bottom: 50px; left: var(--gutter); right: var(--gutter); width: auto; }
}

/* your steps: the designed ground (sage, the radar's arcs fanning from the lower left with one blip), three cards
   stepping down like stairs so the line runs from number to number; each card holds its scene on a pale stage */
.hiwy { --ring: var(--c-sage); padding-block: var(--section-y) calc(var(--section-y) + 1rem);
  background:
    radial-gradient(circle at 311px calc(100% - 311px), var(--c-brand) 0 6px, color-mix(in srgb, var(--c-brand) 22%, transparent) 6.5px 13px, transparent 13.5px),
    radial-gradient(circle at 0 100%, transparent 0 109px, color-mix(in srgb, var(--c-ink) 12%, transparent) 109px 110.5px, transparent 111px 219px, color-mix(in srgb, var(--c-ink) 10%, transparent) 219px 220.5px, transparent 221px 329px, color-mix(in srgb, var(--c-accent) 70%, transparent) 329px 331px, transparent 331.5px 439px, color-mix(in srgb, var(--c-ink) 7%, transparent) 439px 440.5px, transparent 441px 549px, color-mix(in srgb, var(--c-ink) 4%, transparent) 549px 550.5px, transparent 551px),
    var(--c-sage); }
.hiwy__head { max-width: 720px; margin: 0 0 clamp(3rem, 5vw, 4.5rem); padding-left: 96px; }
.hiwy__head h2 { margin: 0 0 .6rem; }
.hiwy__head .lede { margin: 0; }
.hiwy__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; align-items: start; margin: 0; padding: 0; list-style: none; }
.hiwy__step { position: relative; }
.hiwy__step:nth-child(2) { margin-top: 110px; }
.hiwy__step:nth-child(3) { margin-top: 220px; }
.hiwy__step > .hiw-num { position: absolute; top: -26px; left: 18px; }
.hiwy__card { box-sizing: border-box; padding: 2.5rem 1.4rem 1.4rem; border-radius: var(--radius-l); background: var(--c-paper); }
.hiwy__card h3 { margin: 0 0 .45rem; font-size: clamp(1.5rem, 1.2rem + .6vw, 1.75rem); line-height: 1.05; }
.hiwy__card > p { margin: 0 0 1.25rem; font-size: 1rem; line-height: 1.5; color: var(--c-ink-soft); }
.hiwy__stage { position: relative; display: grid; align-items: end; padding: 2.75rem .9rem .9rem; border-radius: var(--radius-m); background: var(--c-ground); }
/* the goal's chat grows as it goes: its stage keeps the whole chat's height (measured: 256 px at a 332 or 305 px
   stage, 219 at 486, 256 at 296, 275 at 266), so the card never changes size and nothing stands empty at its point */
.hiwy__stage--goal { min-height: 256px; }
@media (max-width: 1100px) and (min-width: 761px) { .hiwy__stage--goal { min-height: 220px; } }
@media (max-width: 380px) { .hiwy__stage--goal { min-height: 276px; } }
.hiwy__scene { width: 100%; }
.hiwy__tag { top: 12px; left: 12px; }
.hiwy__stop { top: 8px; right: 8px; }
@media (max-width: 1100px) {
  .hiwy__head { padding-left: 0; }
  .hiwy__steps { grid-template-columns: minmax(0, 560px); row-gap: 3rem; }
  .hiwy__step:nth-child(2), .hiwy__step:nth-child(3) { margin-top: 0; }
}
@media (max-width: 760px) {
  .hiwy { background: var(--c-sage); }
  .hiwy__step > .hiw-num { top: -20px; left: 14px; width: 42px; height: 42px; font-size: 1.125rem; }
  .hiwy__card { padding: 2.1rem 1.1rem 1.1rem; }
  .hiwy__stage { padding: 2.6rem .6rem .6rem; }
}

/* the hand-over: where the owner's part ends and the team's begins, the line passing through "You say yes" */
.hiw-hand { padding-block: clamp(2.5rem, 5vw, 4rem); }
.hiw-hand__in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 1.75rem; font: 600 1.0625rem/1.35 var(--font-ui); }
.hiw-hand__you { text-align: right; color: var(--c-ink-soft); }
.hiw-hand__us { color: var(--c-brand-text); }
.hiw-hand__node { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: .55rem; padding: .7rem 1.2rem; border-radius: 999px; font: 700 1rem/1 var(--font-ui);
  --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-paper));
  color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-ink));
  box-shadow: 0 0 0 6px var(--c-ground), inset 0 0 0 1.5px color-mix(in srgb, var(--c-line) calc((1 - var(--l)) * 100%), transparent); }
.hiw-hand__node svg { width: 18px; height: 18px; fill: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-brand)); }
/* on the phone the three stay in one row, so the line runs through the node alone and crosses no words */
@media (max-width: 760px) {
  .hiw-hand__in { column-gap: .75rem; font-size: .875rem; }
  .hiw-hand__node { padding: .6rem .85rem; font-size: .875rem; white-space: nowrap; }
}

/* our steps: one row per step, the words beside a framed photo, the number above the photo's inner corner, the step's
   scene in glass on the photo's calm side, clear of faces */
.hiwo { padding-block: var(--section-y); }
.hiwo__head { max-width: 560px; margin: 0 0 clamp(2.5rem, 5vw, 4rem); }
.hiwo__head h2 { margin: 0 0 .6rem; }
.hiwo__head .lede { margin: 0; }
.hiw-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.hiw-row + .hiw-row { margin-top: clamp(4rem, 7vw, 6.5rem); }
.hiw-row__text, .hiw-row__side { grid-row: 1; }
.hiw-row--right .hiw-row__text { grid-column: 1 / span 5; }
.hiw-row--right .hiw-row__side { grid-column: 7 / span 6; }
.hiw-row--left .hiw-row__text { grid-column: 8 / span 5; }
.hiw-row--left .hiw-row__side { grid-column: 1 / span 6; }
.hiw-row__text h3 { margin: 0 0 .7rem; font-size: clamp(2rem, 1.5rem + 1.2vw, 2.75rem); line-height: 1; }
.hiw-row__text p { margin: 0; max-width: 34em; font-size: 1.0625rem; line-height: 1.55; color: var(--c-ink-soft); }
.hiw-row__text .hiw-who { display: inline-flex; align-items: center; gap: .55rem; margin-top: 1.4rem; font: 700 .875rem/1 var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--c-brand-text); }
.hiw-who::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c-brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-brand) 22%, transparent); }
.hiw-row .hiw-num { margin: 0 0 16px 30px; }
.hiw-row--left .hiw-num { margin: 0 30px 16px auto; }
.hiw-row__pic { position: relative; }
/* width: 100% keeps the min-height from widening the box to keep its ratio (sideways scroll at 360) */
.hiw-row__frame { width: 100%; aspect-ratio: 4 / 3; min-height: 400px; }
.hiw-row__demo { position: absolute; z-index: 2; top: 50%; translate: 0 -50%; width: min(320px, 52%); }
.hiw-row__demo--left { left: 22px; }
.hiw-row__demo--right { right: 22px; }
.hiw-row__scene { width: 100%; min-height: 300px; }
.hiw-row__tag { top: -14px; left: 14px; }
.hiw-row__stop { top: -48px; right: 0; }
/* narrower: the number beside the step's heading, the photo under the words, the scene on the photo's calm side (more
   than half of it on the photo at every width) */
@media (max-width: 1100px) {
  .hiw-row { grid-template-columns: 52px minmax(0, 1fr); column-gap: 18px; row-gap: 1.5rem; align-items: start; }
  .hiw-row__side { display: contents; }
  .hiw-row .hiw-num, .hiw-row--left .hiw-num { grid-column: 1; grid-row: 1; margin: 0; }
  .hiw-row--right .hiw-row__text, .hiw-row--left .hiw-row__text { grid-column: 2; grid-row: 1; }
  .hiw-row__pic { grid-column: 1 / -1; grid-row: 2; }
  .hiw-row__frame { aspect-ratio: 16 / 10; }
  .hiw-row__demo { width: min(330px, 46%); }
}
@media (max-width: 760px) {
  .hiw-row { grid-template-columns: 40px minmax(0, 1fr); column-gap: 14px; }
  .hiw-row .hiw-num, .hiw-row--left .hiw-num { width: 40px; height: 40px; font-size: 1.125rem; }
  /* a tall photo, the people in its upper part, the scene whole on its lower part (the photo's crop is set on the img:
     the frame__in's own --pos is inline) */
  .hiw-row__frame { aspect-ratio: 3 / 5; min-height: 560px; }
  #step-4 .frame__in > img, #step-6 .frame__in > img { --pos: 84% 40%; }
  #step-5 .frame__in > img { --pos: 22% 40%; }
  .hiw-row__demo, .hiw-row__demo--left, .hiw-row__demo--right { top: auto; bottom: 12px; left: 12px; right: 12px; translate: none; width: auto; }
  /* the front remodeler's face sits at the middle of his photo: his light-glass card hangs below it, two thirds on it */
  #step-4 .hiw-row__pic { padding-bottom: 96px; }
  #step-4 .hiw-row__demo { bottom: 0; }
}

/* inside the free plan: the agent's framed photo at the left, the plan's three cards coming forward beside it */
.hiwi { padding-block: var(--section-y); background: var(--c-paper); }
.hiwi__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.hiwi__frame { aspect-ratio: 4 / 5; }
.hiwi__head { margin: 0 0 1.5rem; }
.hiwi__head h2 { margin: 0 0 .6rem; }
.hiwi__head .lede { margin: 0; }
.hiwi__demo { position: relative; z-index: 2; }
.hiwi__scene { width: 100%; }
.hiwi__tag { top: -14px; left: 14px; }
.hiwi__stop { top: -48px; right: 0; }
/* beside the photo the scene is under 760 px wide, where plancards stacks its captions: here they sit three in a row,
   so the stage, its captions and the stop fit one screen */
@media (min-width: 1101px) {
  .hiwi .hiwi__scene .pc-caps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .hiwi .hiwi__scene .pc-caps li { padding: 14px 14px 16px; }
  .hiwi .hiwi__scene .pc-caps p { font-size: 14px; line-height: 1.5; }
}
@media (max-width: 1100px) {
  .hiwi__in { grid-template-columns: minmax(0, 1fr); row-gap: 2rem; }
  .hiwi__frame { aspect-ratio: 16 / 10; max-width: 720px; }
  .hiwi__side { display: contents; }
  .hiwi__head { grid-row: 1; margin: 0; }
  .hiwi__frame { grid-row: 2; }
  .hiwi__demo { grid-row: 3; }
}
@media (max-width: 760px) {
  .hiwi__frame { aspect-ratio: 4 / 3; }
}

/* the team: the caterer's framed photo at the right, Kevin's one-tap chat in glass beside her, over the photo's edge */
.hiwt { padding-block: var(--section-y); }
.hiwt__in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 2rem; align-items: start; }
.hiwt__head { grid-column: 1 / span 5; grid-row: 1; }
.hiwt__head h2 { margin: 0 0 .6rem; }
.hiwt__head .lede { margin: 0; }
.hiwt__frame { grid-column: 6 / -1; grid-row: 1 / span 2; align-self: stretch; min-height: 600px; }
.hiwt__demo { position: relative; z-index: 2; grid-column: 1 / -1; grid-row: 2; width: 780px; max-width: calc(100% - 120px); }
.hiwt__scene { width: 100%; height: 560px; }
.hiwt__tag { top: -14px; left: 14px; }
.hiwt__stop { top: -48px; right: 0; }
@media (max-width: 1100px) {
  .hiwt__in { grid-template-columns: minmax(0, 1fr); }
  .hiwt__head, .hiwt__frame, .hiwt__demo { grid-column: 1; }
  .hiwt__frame { grid-row: 2; min-height: 0; aspect-ratio: 16 / 10; max-width: 720px; }
  .hiwt__demo { grid-row: 3; width: min(100%, 420px); max-width: none; margin-top: -5rem; justify-self: end; }
  .hiwt__scene { height: 600px; }
}
@media (max-width: 760px) {
  .hiwt__frame { aspect-ratio: 4 / 3; }
  .hiwt__demo { justify-self: stretch; width: 100%; margin-top: -2.5rem; }
}

/* the questions: the line runs down its own lane between the head and the answers */
.hiwf__in { grid-template-columns: minmax(0, .7fr) 28px minmax(0, 1.3fr); column-gap: clamp(1.5rem, 3vw, 2.5rem); }
.hiwf__node { position: relative; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; margin-top: .4rem; border-radius: 50%;
  --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-paper));
  box-shadow: 0 0 0 6px var(--c-ground), inset 0 0 0 1.5px color-mix(in srgb, var(--c-line) calc((1 - var(--l)) * 100%), transparent); }
.hiwf__node svg { width: 14px; height: 14px; fill: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-brand)); }
@media (max-width: 1100px) {
  .hiwf__in { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
  .hiwf__node { display: none; }
}
@media (max-width: 900px) { .hiwf__in { grid-template-columns: minmax(0, 1fr); } }

/* the close: the detailer's footage under the line (no stacking of its own, so the line shows over it), the words on
   the plate above the line, the line ending in the button */
.hiw .endband { isolation: auto; }
.hiwc__plate { z-index: 2; }
