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

/* How it works (architecture 3, The thread): the logo's growth line runs down the page in navy, its head the site's
   mark in a bead, each step's number a white ring it plugs into. On a computer it runs straight down the middle
   (the header's button, steps 1 to 3, the hand-over), steps aside to the ours lane (steps 4 to 6), comes back to the
   middle in the gap above the plan and ends in the closing band, whose footage covers it like every photo; under
   1024 px a short line runs beside each part's numbers. No word lies across it: every head is split around it. */

.hiw { --spine: 96px; --thread-ink: var(--c-brand); --thread-bg: var(--c-paper); --thread-w: 2.5px; }
@media (max-width: 1023.98px) { .hiw { --thread-narrow: 1; } }

/* the parts take no positioned background, so the line runs over their grounds (progress.md, Lessons) */
.hiw > .sec { position: static; }

/* what the line lights: an eased ramp from the script's --lit (whole without scripts) */
.hiw [data-thread-anchor], .hiw [data-thread-light] { --p: var(--lit, 1); --e: calc(var(--p) * var(--p) * (3 - 2 * var(--p))); }
@media (scripting: enabled) { .hiw [data-thread-anchor], .hiw [data-thread-light] { --p: var(--lit, 0); } }

/* ---------- hero: the words centered over a wide framed clip, the owner's part beside ours in a card hanging from it */
.hhero { padding: clamp(36px, 4.5vw, 64px) 0 clamp(80px, 9vw, 128px); }
.hhero__head { max-width: 900px; margin: 0 auto; text-align: center; }
.hhero__head h1 { font-size: var(--fs-h1); max-width: 24ch; margin-inline: auto; }
.hhero__head .lead { max-width: 600px; margin: var(--space-3) auto var(--space-5); }
.hhero__stage { --frame-w: min(var(--max-w), 100vw - 2 * var(--gutter)); position: relative; margin-top: clamp(36px, 4vw, 56px); }
.hhero__frame { aspect-ratio: 5 / 2; box-shadow: var(--shadow-l); }
.hhero__video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-position: 50% 80%; }
/* the card hangs from the clip's foot, under half of it on the clip, so the phone lighting up stays whole */
.hhero__card { position: relative; z-index: 2; width: min(660px, 56%); margin: calc(var(--frame-w) * 2 / 5 * -0.36) clamp(24px, 3vw, 44px) 0 auto; }
.scene.hhero__scene { width: 100%; }
.hhero__stop { top: 16px; right: 16px; }

/* ---------- a part's head, split around the line: the h2 on one side, its line on the other */
.hhead { display: grid; grid-template-columns: minmax(0, 1fr) var(--spine) minmax(0, 1fr); align-items: end; margin-bottom: clamp(56px, 6vw, 96px); }
.hhead h2 { grid-column: 1; font-size: var(--fs-h2); max-width: 15ch; }
.hhead .lead { grid-column: 3; max-width: 500px; }

/* ---------- the steps: the number on the line, the words on one side, the picture on the other */
.hsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(72px, 8vw, 120px); }
.hstep { display: grid; grid-template-columns: minmax(0, 1fr) var(--spine) minmax(0, 1fr); grid-template-areas: "text num pic"; align-items: start; }
.hstep--flip { grid-template-areas: "pic num text"; }
.hstep__num { grid-area: num; justify-self: center; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--c-brand);
  background: color-mix(in srgb, var(--c-brand) calc(var(--e) * 100%), var(--c-paper)); color: color-mix(in srgb, var(--c-on-brand) calc(var(--e) * 100%), var(--c-brand));
  font: 800 1.1875rem/1 var(--font-display); }
/* as the head plugs in, one ring spreads from the number and fades */
.hstep__num::after, .hhand__node::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-accent); pointer-events: none;
  opacity: calc((1 - var(--lit-after, 1)) * var(--p)); transform: scale(calc(1 + 0.9 * var(--lit-after, 1))); }
.hstep__text { grid-area: text; width: 100%; max-width: 440px; padding-top: 8px; }
.hstep:not(.hstep--flip) .hstep__text { justify-self: end; }
.hstep--flip .hstep__text { justify-self: start; }
.hstep__text h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); }
.hstep__text p { margin-top: var(--space-2); color: var(--c-ink-soft); }
.hstep__text .hstep__time { display: inline-flex; align-items: center; gap: 7px; margin-top: var(--space-3); padding: 6px 13px 6px 10px; border-radius: var(--radius-pill); background: var(--c-accent-light); color: var(--c-accent-text); font: 700 var(--fs-small)/1.2 var(--font-ui); }
.hstep__icon { width: 17px; height: 17px; }
.hstep__pic { grid-area: pic; position: relative; width: 100%; }
.hstep:not(.hstep--flip) .hstep__pic { justify-self: start; }
.hstep--flip .hstep__pic { justify-self: end; }
.scene.hstep__scene { width: 100%; }

/* yours: each step's scene in its solid card on the designed ground, toward the line */
.hpic--goal { max-width: 420px; height: 330px; display: flex; flex-direction: column; justify-content: flex-start; }
.hpic--scan { max-width: 460px; }
.hpic--bars { max-width: 560px; }
.hyours__stop { top: 0; right: -58px; }

/* the hand-over: your side done, ours from here */
.hhand { display: grid; grid-template-columns: minmax(0, 1fr) var(--spine) minmax(0, 1fr); align-items: center; margin-top: clamp(72px, 8vw, 120px); }
.hhand p { display: grid; gap: 2px; }
.hhand b { font: 800 var(--fs-h3)/1.2 var(--font-display); color: var(--c-brand); }
.hhand p span { color: var(--c-ink-soft); }
.hhand__mine { justify-self: end; text-align: right; }
.hhand__ours { justify-self: start; }
.hhand__node { justify-self: center; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--c-brand); background: var(--c-paper); box-shadow: var(--shadow-m); }
.hhand__mark { width: 30px; height: 27px; }

/* ---------- ours: a photo per step, its scene in a solid card on the side clear of faces */
.hours .hhead, .hours .hstep { grid-template-columns: minmax(0, 5fr) var(--spine) minmax(0, 7fr); }
.hours .hstep { grid-template-areas: "text num pic"; }
.hours .hstep__text { justify-self: end; }
.hours .hstep--wide { grid-template-areas: "text num ." "pic pic pic"; row-gap: clamp(32px, 3.5vw, 48px); }
.hfig { position: relative; }
.hfig__frame { position: relative; overflow: hidden; border-radius: var(--radius-l); background: var(--c-brand-dark); box-shadow: var(--shadow-l); }
.hfig__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(calc(0.74 + 0.26 * var(--e))); }
.hfig__card { position: absolute; z-index: 2; left: clamp(16px, 2vw, 28px); bottom: clamp(16px, 2vw, 28px); }
.scene.hfig__scene { width: 100%; }
.hfig__stop { top: 14px; right: 14px; }
.hfig--s4 .hfig__frame, .hfig--s6 .hfig__frame { aspect-ratio: 4 / 3; }
.hfig--s4 .hfig__img { object-position: 100% 50%; }
.hfig--s6 .hfig__img { object-position: 0% 50%; }
.hfig--s4 .hfig__card, .hfig--s6 .hfig__card { width: min(340px, 52%); }
.hfig--s4 .hfig__scene { min-height: 284px; }
.hfig--s5 .hfig__frame { aspect-ratio: 2 / 1; }
.hfig--s5 .hfig__img { object-position: 50% 40%; }
.hfig--s5 .hfig__card { width: min(640px, 54%); }
.hfig--s5 .hfig__scene { height: 420px; }

/* ---------- plan: the chiropractor reading her plan, the three cards on the plain wall beside her */
.hfig--plan .hfig__frame { aspect-ratio: 2 / 1; }
.hfig--plan .hfig__img { object-position: 60% 12%; }
.hfig--plan .hfig__card { top: 50%; bottom: auto; width: min(560px, 45%); transform: translateY(-50%); }

/* ---------- team: the bakery owner's morning, her week's work in her dashboard card beside her */
.hfig--team .hfig__frame { aspect-ratio: 21 / 9; }
.hfig--team .hfig__img { object-position: 50% 22%; }
.hfig--team .hfig__card { left: auto; right: clamp(16px, 2vw, 28px); top: 50%; bottom: auto; width: min(360px, 32%); transform: translateY(-50%); }
.hteam .hfig__stop { right: auto; left: 14px; }
.hteam__card { padding: 20px 20px 18px; border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-l); }
.hteam__title { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--c-line); font: 800 1.0625rem/1.25 var(--font-display); color: var(--c-brand); }
.hteam__mark { flex: none; width: 22px; height: 20px; }
.hteam__list { list-style: none; margin: 0; padding: 0; }
.hteam__row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--c-line); font-size: 0.9375rem; line-height: 1.35; }
.hteam__row b { font-weight: 600; color: var(--c-ink); }
.hteam__row span { font: 700 0.8125rem/1.6 var(--font-ui); color: var(--c-ink-soft); }
.hteam__icon { width: 20px; height: 20px; margin-top: 1px; color: var(--c-blue); }
.hteam__talk { display: flex; margin-top: 14px; }
.hteam__btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--radius-pill); background: var(--c-brand); color: var(--c-on-brand); font: 700 0.9375rem/1 var(--font-ui); }
.hteam__btn-icon { width: 18px; height: 18px; }
.hteam__press { position: absolute; inset: -5px; border-radius: inherit; border: 2px solid var(--c-accent); pointer-events: none; }
.hteam__sent { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-m); background: var(--c-accent-light); color: var(--c-accent-text); font: 700 0.875rem/1.3 var(--font-ui); }
.hteam__sent-icon { flex: none; width: 18px; height: 18px; }
/* the kit's sequence with its hold: the rows land one by one, the button is pressed, the message lands */
.hteam__row, .hteam__sent { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 10px)); }
.hteam__press { opacity: var(--kit-in, 1); transform: scale(calc(1.18 - 0.18 * var(--kit-in, 1))); }
@media (scripting: enabled) {
  .hteam__row:not(.is-first), .hteam__sent { opacity: var(--kit-in, 0); transform: translateY(calc((1 - var(--kit-in, 0)) * 10px)); }
  .hteam__press { opacity: var(--kit-in, 0); transform: scale(calc(1.18 - 0.18 * var(--kit-in, 0))); }
}

/* ---------- faq: the head and the questions on either side of the line */
.hfaq .faq__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--spine); }

/* ---------- close: the nail studio owner on the left third, the words on the right */
.hclose .band__video { object-position: 32% 30%; }

/* ---------- under 1024 px: one column, the number beside each step's words, the pictures full width with their
   cards over their lower part (the faces kept above them); a short line runs beside each part's numbers */
@media (max-width: 1023.98px) {
  .hhero__frame { aspect-ratio: 16 / 10; }
  .hhero__card { width: min(100%, 680px); margin: calc(var(--frame-w) * 10 / 16 * -0.16) auto 0; }
  .hhead, .hours .hhead { grid-template-columns: minmax(0, 1fr); align-items: start; margin-bottom: var(--space-6); }
  .hhead h2 { max-width: 20ch; }
  .hhead .lead { grid-column: 1; margin-top: var(--space-3); }
  .hsteps { gap: clamp(56px, 9vw, 80px); }
  .hstep, .hstep--flip, .hours .hstep, .hours .hstep--wide { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "num text" "pic pic"; column-gap: 14px; row-gap: 24px; }
  .hstep__num { justify-self: start; width: 44px; height: 44px; font-size: 1rem; }
  .hstep__text, .hstep:not(.hstep--flip) .hstep__text, .hstep--flip .hstep__text, .hours .hstep__text { justify-self: stretch; max-width: 600px; padding-top: 5px; }
  .hstep:not(.hstep--flip) .hstep__pic, .hstep--flip .hstep__pic { justify-self: start; }
  .hpic--goal { height: 310px; }
  .hyours__stop { top: -50px; right: 0; }
  .hhand { grid-template-columns: 44px minmax(0, 1fr); grid-template-areas: "node mine" "node ours"; column-gap: 14px; row-gap: 8px; margin-top: 56px; }
  .hhand__node { grid-area: node; justify-self: start; width: 44px; height: 44px; }
  .hhand__mark { width: 22px; height: 20px; }
  .hhand__mine { grid-area: mine; justify-self: start; text-align: left; }
  .hhand__ours { grid-area: ours; }
  .hhand b { font-size: 1.125rem; }
  .hfig__card, .hfig--plan .hfig__card, .hfig--team .hfig__card { position: relative; left: auto; right: auto; top: auto; bottom: auto; transform: none; margin: 0 clamp(12px, 3vw, 28px); }
  .hfig--s4 .hfig__frame, .hfig--s6 .hfig__frame { aspect-ratio: 16 / 10; }
  .hfig--s4 .hfig__card, .hfig--s6 .hfig__card { width: min(380px, calc(100% - 24px)); margin-top: -190px; }
  .hfig--s5 .hfig__frame { aspect-ratio: 4 / 3; }
  .hfig--s5 .hfig__img { object-position: 100% 40%; }
  .hfig--s5 .hfig__card { width: min(640px, calc(100% - 24px)); margin-top: -246px; }
  .hfig--plan .hfig__frame { aspect-ratio: 4 / 3; }
  .hfig--plan .hfig__img { object-position: 68% 0%; }
  .hfig--plan .hfig__card { width: min(460px, calc(100% - 24px)); margin-top: -280px; }
  .hfig--team .hfig__frame { aspect-ratio: 16 / 10; }
  .hfig--team .hfig__card { width: min(380px, calc(100% - 24px)); margin-top: -200px; margin-left: auto; }
  .hfaq .faq__grid { column-gap: clamp(2rem, 1rem + 4vw, 5rem); }
}
@media (max-width: 860px) { .hfaq .faq__grid { grid-template-columns: minmax(0, 1fr); } }

/* the phone: taller photos, so each card stands over its lower part with the faces above it */
@media (max-width: 599.98px) {
  .hhero__frame { aspect-ratio: 4 / 3; }
  .hhero__video { object-position: 50% 50%; }
  .hhero__card { margin-top: calc(var(--frame-w) * 3 / 4 * -0.16); }
  .hfig__card, .hfig--plan .hfig__card, .hfig--team .hfig__card { margin-inline: 10px; }
  .hfig--s4 .hfig__frame { aspect-ratio: 3 / 4; }
  .hfig--s4 .hfig__img { object-position: 85% 50%; }
  .hfig--s4 .hfig__card { margin-top: -190px; }
  .hfig--s6 .hfig__frame { aspect-ratio: 3 / 4; }
  .hfig--s6 .hfig__img { object-position: 55% 50%; }
  .hfig--s6 .hfig__card { margin-top: -270px; }
  .hfig--s5 .hfig__frame { aspect-ratio: 3 / 5; }
  .hfig--s5 .hfig__img { object-position: 92% 40%; }
  .hfig--s5 .hfig__card { margin: -285px 8px 0; }
  .hfig--s5 .hfig__scene { height: 520px; }
  .hfig--plan .hfig__frame { aspect-ratio: 3 / 4; }
  .hfig--plan .hfig__img { object-position: 68% 0%; }
  .hfig--plan .hfig__card { margin-top: -262px; }
  .hfig--team .hfig__frame { aspect-ratio: 3 / 4; }
  .hfig--team .hfig__img { object-position: 50% 0%; }
  .hfig--team .hfig__card { margin-top: -277px; }
}
