@import url("../arsenal/thread.css");
/* how-it-works.css: the How It Works page's own layout, with the tokens of system.css. Grounds by plan.md: hero white,
   yours charcoal with the roofline, ours warm tint, inside white with the roofline, team brand tint, faq white, close a
   photo band. The thread, restyled: the line in the roofline's gradient (the page's #hiw-roof), its numbers small
   gables, its head the mark. The line runs in a lane on the left of every part (--lane) and never crosses text. */

.hiw-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.hiw-thread { --lane: 96px; --thread-w: 2.5px; --thread-tail: 80px; --thread-radius: 56px; }
.hiw-thread .thread__ink path { stroke: url(#hiw-roof); }
.hiw-lane { padding-left: calc(var(--gutter) + var(--lane)); }

/* the lit photos: from soft color to full as the head passes (full without the script) */
.hiw-thread .frame[data-thread-light] .frame__pic { filter: saturate(calc(.62 + .38 * var(--lit, 1))); transition: filter .2s linear; }

/* hero: the words centered, the line leaves the button and drops behind the framed tablet */
.hiw-hero { text-align: center; padding-top: clamp(3rem, 6vw, 5rem); }
.hiw-hero__words h1 { max-width: 22ch; margin-inline: auto; font-size: var(--fs-h1); }
.hiw-hero__line { max-width: 34rem; margin: var(--space-3) auto var(--space-4); font-size: 1.1875rem; color: var(--c-ink-soft); }
.hiw-hero__words .btn-note { margin-top: .75rem; }
.hiw-hero__box { position: relative; margin-top: clamp(2.25rem, 4vw, 3.5rem); }
.hiw-hero__frame { aspect-ratio: 3 / 2; box-shadow: var(--shadow-l); }
.hiw-hero__shot { position: absolute; inset: 0; margin: 0; }
.hiw-hero__shot > img { display: block; width: 100%; height: 100%; }
.hiw-screen { display: grid; place-items: start center; align-content: start; box-sizing: border-box; width: 100%; height: 100%; padding: 36px 14px 14px; background: var(--c-paper); text-align: left; }
.hiw-screen .scene { width: 100%; }
.hiw-hero__stop { top: 16px; right: calc(var(--gutter) + 16px); }

/* the heads of yours and ours */
.hiw-head { max-width: 42rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.hiw-head h2 { font-size: var(--fs-h2); }
.hiw-head p { margin-top: var(--space-2); font-size: 1.125rem; color: var(--c-ink-soft); }
.hiw-yours .hiw-head p { color: color-mix(in srgb, var(--c-on-ink) 80%, transparent); }

/* the steps: the number in the lane, a small gable the line plugs into */
.hiw-steps { display: grid; gap: clamp(3.5rem, 7vw, 6rem); margin: 0; padding: 0; list-style: none; }
.hiw-step { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 4vw, 4rem); align-items: start; }
.hiw-step__words h3 { font-size: clamp(1.5rem, 1.15rem + 1vw, 2rem); font-weight: 800; letter-spacing: -.02em; }
.hiw-step__words p { margin-top: .6rem; font-size: 1.0625rem; color: var(--c-ink-soft); }
.hiw-yours .hiw-step__words p { color: color-mix(in srgb, var(--c-on-ink) 80%, transparent); }
.hiw-step__words .hiw-step__tag { margin-top: var(--space-2); font-family: var(--font-ui); font-size: .875rem; font-weight: 700; color: var(--c-accent-text); }
.hiw-yours .hiw-step__words .hiw-step__tag { color: var(--c-accent); }
/* step 3: the line every projection carries (Le, 20 Nov) */
.hiw-step__words .hiw-step__note { margin-top: .5rem; font-size: var(--fs-small); font-style: italic; color: color-mix(in srgb, var(--c-on-ink) 72%, transparent); }

.hiw-num { --p: calc(var(--lit, 1) * var(--lit, 1) * (3 - 2 * var(--lit, 1))); position: absolute; left: calc((var(--lane) - 56px) / 2 - var(--lane)); top: -6px; display: grid; place-items: center; width: 56px; height: 50px; }
.hiw-num svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hiw-num path { fill: color-mix(in srgb, var(--c-brand) calc(var(--p) * 100%), var(--hiw-num-bg, var(--c-paper))); stroke: var(--c-brand); stroke-width: 2.5; stroke-linejoin: round; }
.hiw-num b { position: relative; margin-top: 9px; font-family: var(--font-ui); font-size: 1.125rem; font-weight: 800; color: color-mix(in srgb, var(--c-on-brand) calc(var(--p) * 100%), var(--hiw-num-ink, var(--c-brand-text))); }
.hiw-num::before { content: ""; position: absolute; inset: 0; background: var(--c-brand); clip-path: polygon(50% 6%, 95% 44%, 95% 94%, 5% 94%, 5% 44%); opacity: calc(.45 * min(1, var(--lit-after, 0) * 12) * (1 - var(--lit-after, 0))); transform: scale(calc(1 + var(--lit-after, 0) * .7)); pointer-events: none; }
.hiw-yours { --hiw-num-bg: var(--c-ink); --hiw-num-ink: var(--c-on-ink); }
.hiw-ours { --hiw-num-bg: var(--c-accent-tint); }

/* yours: three base scenes in dark beside the steps */
.hiw-step__stage { position: relative; display: grid; justify-items: start; }
.hiw-step__stage .scene { position: relative; width: min(420px, 100%); }
.hiw-step__stage--1 { height: 300px; }
.hiw-step__stage--1 .scene { position: absolute; left: 0; bottom: 0; }
.hiw-step__stage--2 .scene { min-height: 280px; }
.hiw-step__stage--3 .scene { width: min(560px, 100%); }
.hiw-step__stage .hiw-yours__stop { top: auto; right: auto; bottom: 0; left: calc(min(420px, 100%) + 12px); }
/* each step's scene fills a framed panel of its own (lit from its corner, the roofline faint across it), so the three
   stand as pictures beside their steps, not small cards in an empty field */
.hiw-yours .hiw-step__stage { box-sizing: border-box; min-height: 380px; padding: clamp(28px, 3vw, 44px); justify-items: center; align-content: center; overflow: hidden; border-radius: var(--radius-l); background: url("../../img/ground-roof.svg") 50% 18% / 150% auto no-repeat, radial-gradient(110% 85% at 88% 0%, color-mix(in srgb, var(--c-brand) 32%, transparent), transparent 62%), linear-gradient(165deg, color-mix(in srgb, var(--c-on-ink) 10%, var(--c-ink)), color-mix(in srgb, var(--c-on-ink) 3%, var(--c-ink))); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-on-ink) 11%, transparent), 0 40px 80px -40px rgb(0 0 0 / .75); }
.hiw-yours .hiw-step__stage .scene { width: min(460px, 100%); }
.hiw-yours .hiw-step__stage--1 { height: 400px; }
.hiw-yours .hiw-step__stage--1 .scene { left: 36px; right: 36px; bottom: 36px; width: auto; max-width: 460px; margin-inline: auto; }
.hiw-yours .hiw-step__stage--3 .scene { width: min(560px, 100%); }
.hiw-yours .hiw-step__stage .hiw-yours__stop { top: 14px; right: 14px; bottom: auto; left: auto; }

/* ours: three framed pictures, sides alternating, each with its step's scene in glass */
.hiw-step--pic { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: center; }
.hiw-step--pic.hiw-step--l { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); }
.hiw-step--l .hiw-ours__pic { order: -1; }
.hiw-step--pic .hiw-num { top: 50%; margin-top: -25px; }
.hiw-ours__pic { aspect-ratio: 4 / 3; box-shadow: var(--shadow-l); }
.hiw-ours__pic .frame__pic img, .hiw-ours__pic .frame__pic video { object-position: var(--pos, 50% 40%); }
.hiw-ours__scene { position: absolute; z-index: 2; bottom: 16px; width: min(380px, 58%); height: 300px; }
.hiw-ours__scene .scene { position: absolute; inset: 0; }
.hiw-ours__pic--launch .hiw-ours__scene { right: 16px; width: min(340px, 46%); height: 344px; }
.hiw-ours__pic--leads { --pos: 30% 30%; }
.hiw-ours__pic--leads .hiw-ours__scene { right: 16px; height: 280px; }
.hiw-ours__pic--tune { aspect-ratio: 16 / 10; min-height: 392px; --pos: 50% 42%; }
.hiw-ours__pic--tune .hiw-ours__scene { left: 16px; width: min(360px, 50%); bottom: 16px; height: 352px; }
.hiw-ours__stop { top: 14px; right: 14px; }

/* inside: the plan builds on white with the faint roofline */
.hiw-inside { --ground-top: 30px; }
.hiw-inside__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hiw-inside__words h2 { font-size: var(--fs-h2); }
.hiw-inside__words p { margin-top: var(--space-2); font-size: 1.125rem; color: var(--c-ink-soft); }
.hiw-inside__stage { position: relative; height: 580px; }
.hiw-inside__stage .scene { position: absolute; inset: 0; }
.hiw-inside__stop { top: -8px; right: -8px; }

/* team: Le's portrait in a tall frame, cut differently from Home's, her message answered in glass at its foot */
.hiw-team__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hiw-team__pic { width: 100%; max-width: 460px; aspect-ratio: 4 / 5; box-shadow: var(--shadow-l); }
.hiw-team__pic .frame__pic img { object-position: 0% 30%; }
.hiw-team__scene { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 14px; height: 210px; }
.hiw-team__scene .scene { position: absolute; inset: 0; }
.hiw-team__stop { top: 14px; right: 14px; }
.hiw-team__words h2 { font-size: var(--fs-h2); }
.hiw-team__words p { margin-top: var(--space-2); font-size: 1.125rem; color: var(--c-ink-soft); }

/* close: the photo band; the line ends in its button */
.hiw-close .close__pic .frame__pic img { object-position: 50% 18%; }
.close--p2 .close__note { margin-top: .85rem; color: color-mix(in srgb, var(--c-on-ink) 80%, transparent); font-size: var(--fs-small); }

/* in between: one column for the steps, the lane kept */
@media (max-width: 1000px) {
  .hiw-step, .hiw-step--pic, .hiw-step--pic.hiw-step--l, .hiw-inside__grid, .hiw-team__grid { grid-template-columns: minmax(0, 1fr); }
  .hiw-step--l .hiw-ours__pic { order: 0; }
  .hiw-step--pic .hiw-num { top: -6px; margin-top: 0; }
  .hiw-step__stage--1 { height: 310px; }
}

/* the phone: no line (data-narrow="hide"), no lane; each number above its heading */
@media (max-width: 760px) {
  .hiw-thread { --lane: 0px; }
  .hiw-num { position: relative; left: auto; top: auto; margin: 0 0 var(--space-2); }
  .hiw-step--pic .hiw-num { top: auto; }
  .hiw-steps { gap: var(--space-5); }
  .hiw-step { gap: var(--space-3); }
  .hiw-ours__pic { aspect-ratio: auto; height: 560px; }
  .hiw-ours__pic, .hiw-ours__pic--tune { aspect-ratio: auto; height: 560px; }
  .hiw-ours__scene, .hiw-ours__pic--launch .hiw-ours__scene, .hiw-ours__pic--leads .hiw-ours__scene, .hiw-ours__pic--tune .hiw-ours__scene { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; height: 290px; }
  .hiw-ours__pic--leads { --pos: 28% 10%; }
  .hiw-ours__pic--tune { --pos: 60% 36%; }
  .hiw-ours__pic--launch { --pos: 50% 20%; }
  .hiw-inside__stage { height: 700px; }
  .hiw-team__pic { max-width: none; aspect-ratio: auto; height: 560px; }
  .hiw-team__pic .frame__pic img { object-position: 30% 20%; }
  .hiw-hero__stop { right: calc(var(--gutter) + 10px); top: 10px; }
  /* the tablet fills the phone's frame, so its week reads at 11 px or more */
  .hiw-hero__frame { aspect-ratio: auto; height: 620px; }
  .hiw-hero__shot > img { object-fit: cover; object-position: 20% 50%; }
  .hiw-step__stage--1 { height: 320px; }
  .hiw-step__stage--1 .scene { width: calc(100% - 56px); }
  .hiw-step__stage .hiw-yours__stop { left: auto; right: 0; }
  .hiw-yours .hiw-step__stage { min-height: 0; padding: 60px 14px 14px; }
  .hiw-yours .hiw-step__stage--1 { height: 400px; }
  .hiw-yours .hiw-step__stage--1 .scene { left: 14px; right: 14px; bottom: 14px; }
  .hiw-ours__pic--launch .hiw-ours__scene { height: 330px; }
  .hiw-ours__pic--tune { min-height: 0; }
  .hiw-ours__pic--tune .hiw-ours__scene { height: 340px; }
}
@media (max-width: 480px) {
  .btn--main { width: 100%; padding-inline: 1rem; }
}
