/* how-it-works.css: the How it works page (plan.md, How it works). Its architecture, The thread (the arsenal's
   composition, drawn as this site's own): one thick teal line, the logo's rising stroke, runs from the header's button
   down through the six steps to the button after step 6, closing the logo's ring around each step's number as it plugs
   in. On a computer the steps alternate on a spine down the middle; under 1200 px they go to one column, the number
   beside its words, and the line runs beside each part. Then the plan opened up, the team, the FAQ and the close. */
@import url("../arsenal/thread.css");

/* ---------- the thread ---------- */
.hiw-thread {
  --thread-ink: var(--c-brand);
  --thread-track-ink: color-mix(in srgb, var(--c-brand) 22%, transparent);
  --thread-bg: var(--c-paper-alt);
  --thread-w: 6px;
  --thread-tail: 0px;
}
/* the head: the site's mark, drawn larger than the piece's (scaled about its own center, which sits on the line) */
.hiw-thread .thread__glyph { scale: 1.85; }

.hiw-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* a step's number: the line plugs into it; as the head arrives the logo's ring closes, the disc fills teal and a
   ripple goes out (--lit and --lit-after, from the thread's script) */
.hiw-num { position: relative; display: grid; place-items: center; width: 80px; height: 80px; }
.hiw-num::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--c-paper)); box-shadow: var(--shadow-s); }
.hiw-num::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; border: 3px solid var(--c-brand); opacity: calc(var(--lit, 0) * (1 - var(--lit-after, 1))); scale: calc(1 + 0.75 * var(--lit-after, 0)); pointer-events: none; }
.hiw-num__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; rotate: -20deg; }
.hiw-num__ring circle { fill: none; stroke: var(--c-brand); stroke-width: 5; stroke-linecap: round; stroke-dasharray: calc(213.6px * (0.8 + 0.2 * var(--lit, 0))) 300px; }
.hiw-num b { position: relative; font: 800 1.6rem/1 var(--font-display); color: color-mix(in srgb, var(--c-on-brand) calc(var(--lit, 0) * 100%), var(--c-brand-text)); }

/* a step's words: its title with its tag after it ("Your part" in sunflower, "Ours" in teal), and one line */
.hiw-step__title { margin: 0; font: 800 var(--fs-h3)/1.18 var(--font-display); letter-spacing: -0.015em; text-wrap: balance; }
.hiw-tag { display: inline-block; margin-left: 4px; padding: 5px 11px 6px; border-radius: 999px; vertical-align: 0.18em; font: 700 0.875rem/1 var(--font-ui); letter-spacing: 0; white-space: nowrap; background: var(--c-accent); color: var(--c-ink); }
.hiw-tag--ours { background: var(--c-brand); color: var(--c-on-brand); }
.hiw-step__line { margin: 10px 0 0; font-size: var(--fs-body); line-height: 1.55; color: var(--c-ink-soft); text-wrap: pretty; }

/* the steps on the spine: words on one side, the number in the middle lane, the picture on the other side */
.hiw-step { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); grid-template-areas: "a num b"; align-items: center; column-gap: clamp(1.5rem, 0.4rem + 2.2vw, 3rem); }
.hiw-step + .hiw-step { margin-top: clamp(3.5rem, 1.5rem + 4vw, 6rem); }
.hiw-step > .hiw-num { grid-area: num; justify-self: center; }
.hiw-step__words { max-width: 26rem; }
.hiw-step--card-right > .hiw-step__words { grid-area: a; justify-self: end; text-align: right; }
.hiw-step--card-right > .hiw-step__card { grid-area: b; justify-self: start; }
.hiw-step--card-left > .hiw-step__words { grid-area: b; justify-self: start; }
.hiw-step--card-left > .hiw-step__card { grid-area: a; justify-self: end; }

/* ---------- hero: the words centered on the paper, the schedule filling up in a wide frame under them ---------- */
.hwh { padding: clamp(2.25rem, 1rem + 3.4vw, 4.25rem) 0 clamp(3.5rem, 2rem + 4vw, 6rem); text-align: center; }
.hwh__title { max-width: 24ch; margin: 0 auto; font: 800 var(--fs-h1)/1.02 var(--font-display); letter-spacing: -0.032em; text-wrap: balance; }
.hwh__line { max-width: 34em; margin: var(--space-3) auto 0; font-size: clamp(1.08rem, 1rem + 0.35vw, 1.28rem); line-height: 1.5; color: var(--c-ink-soft); text-wrap: balance; }
/* the note beside the button, not under it: the line leaves the button straight down */
.hwh__cta { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 20px; margin-top: var(--space-4); }
.hwh__frame { position: relative; height: clamp(420px, 40vw, 600px); margin-top: clamp(2rem, 1rem + 2.6vw, 3.25rem); border-radius: var(--radius-xl); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); }
.hwh__screen { position: absolute; inset: 0; margin: 0; }
.hwh__screen > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.hwh__stop { position: absolute; z-index: 2; top: 16px; right: 16px; }

/* the week on the tablet's screen (designed at 360 x 480): the bookings it had in mint, new ones landing in teal */
.wk { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 26px 20px 22px; background: var(--c-paper); color: var(--c-ink); font-family: var(--font-ui); text-align: left; }
.wk__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.wk__head b { font: 800 26px/1 var(--font-display); letter-spacing: -0.02em; }
.wk__legend { display: inline-flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 600; color: var(--c-ink-soft); }
.wk__legend i { width: 13px; height: 13px; border-radius: 4px; background: var(--c-brand); }
.wk__grid { flex: 1; display: grid; grid-template-columns: 46px repeat(3, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 9px 8px; }
.wk__day { align-self: center; font: 700 16px/1 var(--font-ui); color: var(--c-ink-soft); }
.wk__slot { position: relative; border-radius: 12px; }
.wk__slot > span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; font: 700 16px/1 var(--font-ui); }
.wk__slot--old > span { background: var(--c-brand-light); color: var(--c-brand-text); }
.wk__slot--new { border: 2px dashed color-mix(in srgb, var(--c-brand) 32%, transparent); }
.wk__slot--new > span { inset: -2px; background: var(--c-brand); color: var(--c-on-brand); opacity: var(--kit-in, 1); scale: calc(0.55 + 0.45 * var(--kit-in, 1)); box-shadow: 0 6px 14px -6px rgb(8 64 62 / 0.55); }

/* ---------- yours: steps 1 to 3 on the sand, the motif's ring arc faint at its corner ---------- */
.hwy { padding-block: var(--section-y); background: var(--c-sand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cpath d='M268 70A150 150 0 1 0 330 140' fill='none' stroke='%230E7C7B' stroke-opacity='.06' stroke-width='22' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right -180px top -160px / 640px 640px; }
/* the heads stay left of the spine: the line comes down beside them */
.hwy__head, .hwo__head { max-width: min(35rem, 44%); margin-bottom: clamp(2.5rem, 1rem + 4vw, 5rem); }
.hwy__head .lead, .hwo__head .lead { margin-top: var(--space-3); }
.hwy .hiw-step__card { position: relative; width: min(100%, 420px); }
/* the chat grows as it plays: its panel fills a box of its full height (the messages from the top), so nothing moves */
.hiw-step__card--goal { height: 300px; }
.hiw-step__card--goal .hiw-scene--goal { height: 100%; }
.hwy .hiw-scene--scan { min-height: 252px; }
.hwy .hiw-scene--bars { width: 100%; }
.hwy__stop { position: absolute; right: 0; bottom: calc(100% + 10px); }

/* ---------- ours: steps 4 to 6, each over a framed photo, its scene in glass over the photo's open side ---------- */
.hwo { padding-block: var(--section-y); }
.hwo .hiw-step__card { width: 100%; max-width: 560px; }
.hiw-photo { position: relative; }
.hiw-photo__img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-xl); box-shadow: var(--shadow-m); }
.hiw-photo--sod, .hiw-photo--window { aspect-ratio: 16 / 9; }
.hiw-photo--salon { aspect-ratio: 5 / 4; }
.hiw-photo--salon .hiw-photo__img { object-position: 8% 50%; }
/* each card hangs a little off its photo's left edge, clear of the faces */
.hiw-photo .hiw-photo__scene { position: absolute; left: -28px; }
.hiw-photo .hiw-photo__scene--launch { top: 16px; width: 300px; height: 310px; } /* four lines at its foot leave the notice its room; it hangs past the photo's foot */
/* the salon's card sits on the lower half, under both faces */
.hiw-photo .hiw-photo__scene--clients { top: 50%; width: 340px; }
.hiw-photo .hiw-photo__scene--tune { top: 18px; width: 268px; }
.hiw-photo--salon { margin-bottom: 96px; }
.hiw-photo--window { margin-bottom: 64px; }
.hiw-photo__stop { position: absolute; top: 14px; right: 14px; }
.hwo__cta { margin-top: clamp(3.5rem, 1.5rem + 4vw, 6rem); }

/* ---------- inside: the free plan opened up, over a framed photo ---------- */
.hwi__frame { position: relative; height: clamp(640px, 48vw, 700px); border-radius: var(--radius-xl); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); container-type: inline-size; }
.hwi__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; }
.hwi__frame .hwi__scene { position: absolute; top: 32px; right: clamp(20px, 3vw, 40px); width: max(600px, 52%); height: calc(100% - 32px - 76px); }
.hwi__stop { position: absolute; right: clamp(20px, 3vw, 40px); bottom: 18px; }

/* ---------- team: the clip of the owner on a job, the dashboard's chat beside him ---------- */
.hwt { background: var(--c-brand-light); }
.hwt__frame { position: relative; height: clamp(560px, 44vw, 640px); border-radius: var(--radius-xl); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); container-type: inline-size; }
.hwt__video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 40% 50%; }
.hwt__frame .hwt__scene { position: absolute; top: 40px; right: clamp(20px, 3vw, 44px); width: 400px; height: 440px; }
.hwt__stop { position: absolute; right: clamp(20px, 3vw, 44px); bottom: 16px; }
.hwt__words { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3) var(--space-6); align-items: end; margin-top: clamp(2rem, 1rem + 2.5vw, 3.5rem); }

/* ---------- close: the owner at his desk at night, smiling at a new booking; mirrored so he sits right of center ---------- */
.close--desk .close__video { transform: scaleX(-1); object-position: 50% 32%; }
.close--desk .close__bg::after { background: linear-gradient(90deg, color-mix(in srgb, var(--c-brand-deep) 94%, transparent) 0%, color-mix(in srgb, var(--c-brand-deep) 88%, transparent) 40%, color-mix(in srgb, var(--c-brand-deep) 32%, transparent) 56%, color-mix(in srgb, var(--c-brand-deep) 8%, transparent) 80%); }
.close--desk .close__title { max-width: 8.5em; font-size: clamp(2.5rem, 1.6rem + 3vw, 4.25rem); }
.close--desk .close__stop { top: auto; bottom: 20px; right: max(var(--gutter), calc((100% - var(--max-w)) / 2)); }

/* ---------- under 1200 px: one column, the number beside its words, the line beside each part ---------- */
@media (max-width: 1199.98px) {
  .hiw-thread { --thread-narrow: 1; }
  .hiw-step { grid-template-columns: 80px minmax(0, 1fr); grid-template-areas: "num words" ". card"; align-items: start; column-gap: var(--space-4); row-gap: var(--space-4); }
  .hiw-step > .hiw-num { justify-self: start; margin-top: -12px; }
  .hiw-step--card-right > .hiw-step__words, .hiw-step--card-left > .hiw-step__words { grid-area: words; justify-self: start; text-align: left; }
  .hiw-step--card-right > .hiw-step__card, .hiw-step--card-left > .hiw-step__card { grid-area: card; justify-self: start; }
  .hiw-step__words { max-width: 36rem; }
  .hwy__head, .hwo__head { max-width: 40rem; }
  .hwo .hiw-step__card { max-width: none; }
  .hiw-photo--salon { aspect-ratio: 4 / 3; }
  .hiw-photo .hiw-photo__scene { left: -24px; }
  .hwo__cta { align-items: flex-start; text-align: left; margin-left: calc(80px + var(--space-4)); }
  /* the slots' times would fall under 13 px on the smaller screen */
  .wk__slot > span { font-size: 0; }
  .wk__legend { display: none; }
  .wk__day { font-size: 18px; }
}

@media (max-width: 1099.98px) {
  /* the plan card under the photo, half on it */
  .hwi__frame { height: auto; overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  .hwi__photo { position: relative; display: block; height: auto; aspect-ratio: 3 / 2; border-radius: var(--radius-xl); box-shadow: var(--shadow-m); }
  .hwi__frame .hwi__scene { position: relative; top: auto; right: auto; width: min(600px, 100%); height: 560px; margin: -290px 0 0 auto; }
  .hwi__stop { top: calc(66.667cqw - 342px); right: 14px; bottom: auto; }
}

@media (max-width: 960px) {
  /* the chat under the clip, half on it */
  .hwt__frame { height: auto; overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  .hwt__video { position: relative; display: block; height: auto; aspect-ratio: 16 / 10; border-radius: var(--radius-xl); box-shadow: var(--shadow-m); }
  .hwt__frame .hwt__scene { position: relative; top: auto; right: auto; width: min(400px, 100%); height: 440px; margin: -230px 16px 0 auto; }
  .hwt__stop { top: calc(62.5cqw - 282px); right: 14px; bottom: auto; }
  .hwt__words { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- the phone ---------- */
@media (max-width: 760px) {
  .hwh__frame { height: auto; aspect-ratio: 4 / 5; }
  .wk__day { display: none; }
  .wk__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wk__head b { font-size: 27px; }

  .hiw-step { grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "num words" "card card"; column-gap: 14px; row-gap: var(--space-3); }
  .hiw-step > .hiw-num { margin-top: -6px; }
  .hiw-num { width: 60px; height: 60px; }
  .hiw-num::before, .hiw-num::after { inset: 9px; }
  .hiw-num b { font-size: 1.25rem; }
  .hwy .hiw-step__card { width: 100%; }
  .hiw-step__card--goal { height: 330px; }

  /* each photo at 4:5, its card hanging under it, more than half on it */
  .hiw-photo--sod, .hiw-photo--salon, .hiw-photo--window { aspect-ratio: 4 / 5; }
  .hiw-photo--sod .hiw-photo__img { object-position: 75% 50%; }
  .hiw-photo--salon .hiw-photo__img { object-position: 70% 50%; }
  .hiw-photo--window .hiw-photo__img { object-position: 80% 50%; }
  .hiw-photo .hiw-photo__scene { left: 50%; translate: -50% 0; width: min(300px, calc(100% - 24px)); }
  .hiw-photo .hiw-photo__scene--launch { top: calc(100% - 176px); height: 320px; }
  .hiw-photo .hiw-photo__scene--clients { top: calc(100% - 180px); }
  .hiw-photo .hiw-photo__scene--tune { top: calc(100% - 190px); height: 350px; }
  .hiw-photo--sod { margin-bottom: 160px; }
  .hiw-photo--salon { margin-bottom: 150px; }
  .hiw-photo--window { margin-bottom: 176px; }
  .hiw-photo__stop { top: 12px; right: 12px; }
  .hwo__cta { margin-left: calc(60px + 14px); }

  .hwi__photo { aspect-ratio: 16 / 25; object-position: 21% 40%; }
  .hwi__frame .hwi__scene { width: 100%; height: 700px; margin-top: -360px; }
  .hwi__stop { top: calc(156.25cqw - 412px); }

  .hwt__video { aspect-ratio: 4 / 5; object-position: 44% 50%; }
  .hwt__frame .hwt__scene { width: 100%; max-width: 420px; margin: -230px auto 0; }
  .hwt__stop { top: calc(125cqw - 282px); }

  .close--desk { padding-top: calc(125vw + 24px); }
  .close--desk .close__bg { bottom: auto; height: 125vw; }
  .close--desk .close__bg::after { background: linear-gradient(180deg, transparent 55%, var(--c-brand-deep) 100%); }
  .close--desk .close__video { object-position: 34% 30%; }
  .close--desk .close__stop { top: 14px; right: 14px; bottom: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hiw-num::after { display: none; }
}
