/* how-it-works.css: the How it works page's parts, placed and sized with the tokens of system.css.
   The chain is the arsenal's thread (a composition, never edited), restyled here. */
@import url("../arsenal/thread.css");

/* the kit's header CSS (kit\kit.md), as it is */
[data-kit-scene="rotate"] [data-kit-slide] { position: absolute; inset: 0; margin: 0; visibility: hidden; overflow: hidden; }
[data-kit-scene="rotate"] [data-kit-slide][data-kit-on] { visibility: visible; z-index: 2; opacity: var(--kit-move, 1); transform: translateX(var(--kit-glide, calc((1 - var(--kit-move, 1)) * 4%))); } /* the kit gives the glide in whole device pixels */
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-prev])) [data-kit-slide][data-kit-on] { transform: none; opacity: 1; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { visibility: visible; z-index: 1; }
[data-kit-scene="rotate"] [data-kit-slide] video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-kit-on])) [data-kit-slide]:not([data-kit-slide] ~ [data-kit-slide]) { visibility: visible; }
[data-kit-scene="rotate"] [data-kit-slide] video { inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; clip-path: inset(2px); } /* each clip reaches 1 px past its frame, so no still picture shows beside it; until it has shown its first frames, its first paint is cut 1 px inside the frame, so the first picture stays the largest paint */
[data-kit-scene="rotate"] [data-kit-slide] video[data-kit-shown] { clip-path: none; } /* the kit marks a clip once it has shown its first frames */
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { opacity: clamp(0, (1 - var(--kit-move, 0)) * 1000, 1); } /* the picture that left goes once the new one covers it whole */
[data-kit-scene="rotate"] [data-kit-slide] img.kit-first { inset: -1px !important; width: calc(100% + 2px) !important; height: calc(100% + 2px) !important; max-width: none; } /* the first picture laid like its clip */

/* the chain: the logo's peak, link by link, in one orange */
.thread { --thread-link: 13px; --thread-gap: 25px; --thread-radius: 56px; }
.thread__links use { fill: var(--c-brand); }
.thread__head.is-glyph .thread__glyph { fill: var(--c-ink); stroke: var(--c-paper); }
.thread__halo { display: none; }

/* a number on the chain: the logo's peak, filling orange as the chain plugs in */
.hiw-num { position: relative; display: grid; place-items: center; justify-self: center; width: 64px; height: 66px; --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0))); }
.hiw-num::before { content: ''; position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-raised)); }
.hiw-num::after { content: ''; position: absolute; inset: 0; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); background: var(--c-brand); transform: scale(calc(1 + var(--lit-after, 0) * .7)); opacity: calc((1 - var(--lit-after, 0)) * .34 * clamp(0, var(--lit, 0) * 4, 1)); pointer-events: none; }
.hiw-num b { position: relative; z-index: 1; padding-top: 12px; color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-ink)); font-family: var(--font-display); font-stretch: 110%; font-weight: 800; font-size: 1.45rem; line-height: 1; }

.hiw-words { display: grid; gap: var(--space-2); }
.hiw-words h3 { font-family: var(--font-display); font-stretch: var(--stretch-display); font-weight: 800; font-size: clamp(1.45rem, 1.2rem + .9vw, 2rem); line-height: 1.12; }
.hiw-words p { max-width: 42ch; color: var(--c-ink-soft); font-size: var(--fs-lead); }

/* Chrome draws a card's backdrop blur over the whole clipping box: these scenes stand over a picture, so they do not clip. */
.hiw-hero__scene > .scene, .hiw-handover__scene > .scene, .hiw-step__scene > .scene, .hiw-inside__scene > .scene { overflow: visible; }

/* ================= hero: the words on black, the band of the desk under them ================= */
.hiw-hero { position: relative; padding-top: clamp(2.25rem, 1.25rem + 2.6vw, 3.5rem); }
.hiw-hero__words { display: grid; justify-items: center; gap: var(--space-3); text-align: center; }
.hiw-hero__words h1 { max-width: 22ch; font-size: var(--fs-h1); }
.hiw-hero__words > p:not(.cta__note) { max-width: 54ch; color: #DCDCDC; font-size: var(--fs-lead); }
.hiw-hero__start { display: block; width: 2px; height: 14px; margin-top: calc(var(--space-3) * -1 + 4px); }
.hiw-hero__band { position: relative; height: clamp(400px, calc(100svh - var(--header-h) - 360px), 600px); overflow: hidden; }
.hiw-hero__stage { position: absolute; inset: 0; }
.hiw-hero__stage::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 0) 18%), linear-gradient(0deg, rgb(0 0 0 / .4) 0%, rgb(0 0 0 / 0) 22%), linear-gradient(270deg, rgb(0 0 0 / .42) 0%, rgb(0 0 0 / 0) 34%); }
.hiw-hero__slide video, .hiw-hero__slide img.kit-first { object-position: 50% 20%; transform: scale(1.316); transform-origin: 100% 30%; filter: saturate(.92); } /* the wall's posters and signs stay out of the frame */
.hiw-hero__scene { position: absolute; z-index: 4; top: 20px; bottom: 44px; right: 24px; width: 484px; } /* four notifications from 480 px wide, clear of her face from here up; they hang 30 px under this box */
.hiw-hero__scene > .scene { position: absolute; inset: 0; }
.hiw-hero__band > .stop { top: auto; right: auto; bottom: var(--space-3); left: max(var(--gutter), calc((100% - var(--max-w)) / 2)); }

/* ================= yours: three rows on the designed ground, the chain down their middle ================= */
.hiw-yours { position: relative; padding-block: var(--section-y); }
.hiw-yours__light { position: absolute; inset: 0; z-index: -1; background: radial-gradient(72% 40% at 50% 104%, rgb(255 153 0 / .14), rgb(255 153 0 / 0) 72%); }
.hiw-yours__head { max-width: 560px; margin-bottom: clamp(1rem, .5rem + 1.5vw, 2rem); }
.hiw-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); column-gap: clamp(1.75rem, 3.4vw, 3.25rem); align-items: center; padding-block: clamp(1.5rem, 1rem + 1.6vw, 2.5rem); }
.hiw-row > .hiw-words { grid-column: 1; grid-row: 1; justify-self: end; width: min(100%, 470px); }
.hiw-row > .hiw-num { grid-column: 2; grid-row: 1; }
.hiw-row > .hiw-row__scene { grid-column: 3; grid-row: 1; }
.hiw-row--flip > .hiw-words { grid-column: 3; justify-self: start; }
.hiw-row--flip > .hiw-row__scene { grid-column: 1; justify-self: end; }
.hiw-row__scene { position: relative; width: 100%; }
.hiw-row__scene--goal { max-width: 420px; height: 300px; }
.hiw-row__scene--goal > .scene { position: absolute; right: 0; bottom: 0; left: 0; }
.hiw-row__scene--goal > .stop { top: 0; right: 0; }
.hiw-row__scene--scan { max-width: 560px; min-height: 330px; }
.hiw-row__scene--bars { max-width: 580px; height: 470px; }
.hiw-row__scene--bars > .scene { position: absolute; inset: 0; }

/* ================= handover: the work moves off the owner ================= */
.hiw-handover { padding-bottom: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.hiw-handover .section__head { margin-bottom: clamp(1.25rem, .9rem + 1.2vw, 2rem); }
.hiw-handover__frame { position: relative; height: clamp(500px, 37.5vw, 560px); }
.hiw-handover__media { position: absolute; inset: 0; overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-l); }
.hiw-handover__media img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 42%; filter: saturate(.94) brightness(.9); }
.hiw-handover__node { position: absolute; top: -29px; right: clamp(5rem, 12vw, 11rem); z-index: 2; display: grid; place-items: center; width: 58px; height: 58px; 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-raised)); color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-ink)); box-shadow: 0 0 0 5px var(--c-paper), 0 0 0 calc(5px + var(--lit-after, 0) * 16px) color-mix(in srgb, var(--c-brand) calc((1 - var(--lit-after, 0)) * 30%), transparent); }
.hiw-handover__node svg { width: 28px; height: 28px; fill: currentColor; }
.hiw-handover__scene { position: absolute; left: clamp(.75rem, 1.6vw, 1.5rem); bottom: clamp(.75rem, 1.6vw, 1.5rem); width: min(640px, 52%); top: clamp(.75rem, 1.6vw, 1.5rem); }
.hiw-handover__scene > .scene { position: absolute; inset: 0; display: grid; align-items: end; }
.hiw-handover__frame > .stop { top: auto; right: var(--space-3); bottom: var(--space-3); }

/* ================= ours: three framed photos, the chain down their middle ================= */
.hiw-ours { padding-top: clamp(2rem, 1rem + 2.6vw, 3.5rem); }
.hiw-ours__head { max-width: 560px; margin-bottom: clamp(1rem, .5rem + 1.5vw, 2rem); }
.hiw-step { display: grid; grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); column-gap: clamp(1.25rem, 2.4vw, 2.25rem); align-items: center; padding-block: clamp(1.25rem, .8rem + 1.4vw, 2.25rem); }
.hiw-step > .hiw-step__frame { grid-column: 1; grid-row: 1; }
.hiw-step > .hiw-num { grid-column: 2; grid-row: 1; }
.hiw-step > .hiw-words { grid-column: 3; grid-row: 1; }
.hiw-step--flip > .hiw-step__frame { grid-column: 3; }
.hiw-step--flip > .hiw-words { grid-column: 1; justify-self: end; width: min(100%, 470px); }
.hiw-step__frame { position: relative; height: clamp(420px, 33vw, 480px); }
.hiw-step__media { position: absolute; inset: 0; overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-l); }
.hiw-step__media img, .hiw-step__media video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; filter: saturate(.94); }
.hiw-step__scene { position: absolute; bottom: clamp(.75rem, 1.4vw, 1.25rem); left: clamp(-2rem, -1.4vw, -.5rem); width: min(320px, 56%); height: min(320px, 76%); }
.hiw-step__scene > .scene { position: absolute; inset: 0; }
.hiw-step--flip .hiw-step__scene { right: clamp(-2rem, -1.4vw, -.5rem); left: auto; width: min(370px, 62%); height: min(300px, 66%); }
.hiw-step [data-scene="leads"] :is(.ld-top span, .ld-who b, .ld-who small, .ld-src, .ld-av) { font-size: 14.5px; }
.hiw-step__frame > .stop { top: var(--space-2); right: var(--space-2); }

/* ================= inside: the plan itself over the owner reading it ================= */
.hiw-inside { padding-top: clamp(2rem, 1rem + 2.6vw, 3.5rem); padding-bottom: clamp(2rem, 1rem + 2.6vw, 3.5rem); }
.hiw-inside__head { max-width: 590px; margin-bottom: clamp(1.25rem, .9rem + 1.2vw, 2rem); }
.hiw-inside__frame { position: relative; height: 552px; }
.hiw-inside__media { position: absolute; inset: 0; overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-l); }
.hiw-inside__media img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 50% 30%; filter: saturate(.94); }
.hiw-inside__scene { position: absolute; top: 12px; right: 24px; bottom: 12px; width: clamp(610px, 52%, 660px); } /* under 600 wide its layout needs 700 high */
.hiw-inside__scene > .scene { position: absolute; inset: 0; }
.hiw-inside__frame > .stop { top: var(--space-2); right: auto; left: var(--space-2); }
/* the comparison's six chips on one row: on two, the list runs past its card at this height */
.hiw-inside__scene [data-scene="plan-builder"] .pb-row { gap: 5px; }
.hiw-inside__scene [data-scene="plan-builder"] .pb-chip { gap: 5px; padding-inline: 7px 8px; }
@media (max-width: 1200px) and (min-width: 761px) {
  .hiw-inside__frame { height: 900px; }
  .hiw-inside__media { inset: 0 0 auto; height: 640px; }
  .hiw-inside__media img { object-position: 50% 20%; }
  .hiw-inside__scene { top: 300px; right: auto; bottom: auto; left: 50%; width: 640px; height: 580px; transform: translateX(-50%); }
}

/* ================= team: the owner's own hand, a person one press away ================= */
.hiw-team { padding-top: clamp(2rem, 1rem + 2.6vw, 3.5rem); padding-bottom: clamp(2rem, 1rem + 2.6vw, 3.5rem); }
.hiw-team__in { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(0, 1fr); gap: clamp(1.75rem, 4vw, 3.75rem); align-items: center; }
.hiw-team__frame { position: relative; height: clamp(600px, 50vw, 720px); overflow: hidden; border: 1px solid var(--c-line); border-radius: var(--radius-l); }
.hiw-team__photo { position: absolute; inset: 0; margin: 0; }
.hiw-team__photo img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 62% 50%; filter: saturate(.94) brightness(.94); }
.hiw-team__copy { display: grid; gap: var(--space-3); }
.hiw-team__copy h2 { font-size: var(--fs-h2); }
.hiw-team__copy p { color: var(--c-ink-soft); font-size: var(--fs-lead); }
.hiw-team__frame > .stop { top: auto; right: auto; bottom: var(--space-3); left: var(--space-3); }

/* ================= faq: words, the chain behind them ================= */
.hiw-faq__in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; gap: clamp(2rem, 5vw, 5rem); }
.hiw-faq .section__head { position: sticky; top: calc(var(--header-h) + 2rem); margin-bottom: 0; }
.hiw-faq .faq { background: var(--c-paper); }

/* ================= close: the chain ends in the button; no isolation here, so it runs over the photo ================= */
.hiw-close { box-sizing: border-box; isolation: auto; min-height: clamp(660px, calc(100svh - var(--header-h)), 800px); padding-block: clamp(9rem, 6rem + 9vw, 14rem) clamp(5rem, 3rem + 6vw, 8rem); }
.hiw-close::before { background: linear-gradient(90deg, rgb(0 0 0 / .82) 0%, rgb(0 0 0 / .6) 26%, rgb(0 0 0 / 0) 46%); }
.hiw-close__media { overflow: hidden; }
.hiw-close__photo { position: absolute; inset: 0; margin: 0; }
.hiw-close__media .hiw-close__photo img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-position: 50% 40%; filter: saturate(.95) brightness(.92); }
.hiw-close__in { justify-items: start; text-align: left; }
.hiw-close__in h2 { max-width: 14ch; }
.hiw-close__in > p { max-width: 30ch; }
.hiw-close .btn--main { --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0))); box-shadow: 0 0 0 calc(var(--l) * 5px) rgb(255 153 0 / .3), 0 0 calc(var(--l) * 34px) rgb(255 153 0 / .55); }

/* ================= one column, the phone ================= */
@media (max-width: 1379px) {
  .hiw-hero__scene { width: min(400px, 32%); } /* narrower, so its two notifications stay clear of her face */
}
@media (max-width: 1024px) {
  .thread { --thread-narrow: 1; --thread-link: 11px; --thread-gap: 21px; }

  .hiw-num { justify-self: start; width: 52px; height: 54px; }
  .hiw-num b { padding-top: 10px; font-size: 1.2rem; }

  .hiw-row { grid-template-columns: 52px minmax(0, 1fr); column-gap: var(--space-3); row-gap: var(--space-3); }
  .hiw-row > .hiw-num, .hiw-row--flip > .hiw-num { grid-column: 1; grid-row: 1; }
  .hiw-row > .hiw-words, .hiw-row--flip > .hiw-words { grid-column: 2; grid-row: 1; justify-self: start; width: auto; }
  .hiw-row > .hiw-row__scene, .hiw-row--flip > .hiw-row__scene { grid-column: 1 / -1; grid-row: 2; justify-self: center; }

  .hiw-step { grid-template-columns: 52px minmax(0, 1fr); column-gap: var(--space-3); row-gap: var(--space-3); }
  .hiw-step > .hiw-step__frame, .hiw-step--flip > .hiw-step__frame { grid-column: 1 / -1; grid-row: 1; }
  .hiw-step > .hiw-num { grid-column: 1; grid-row: 2; }
  .hiw-step > .hiw-words, .hiw-step--flip > .hiw-words { grid-column: 2; grid-row: 2; justify-self: start; width: auto; }

  .hiw-team__in { grid-template-columns: minmax(0, 1fr); }
  .hiw-faq__in { grid-template-columns: 1fr; gap: 0; }
  .hiw-faq .section__head { position: static; margin-bottom: var(--space-4); }
}
@media (max-width: 760px) {
  .hiw-hero__words { padding-bottom: var(--space-3); }
  .hiw-hero__band { height: 460px; }
  .hiw-hero__slide video, .hiw-hero__slide + .hiw-hero__slide video, .hiw-hero__slide img.kit-first { object-position: 70% 40%; transform: none; }
  .hiw-hero__stage::after { background: linear-gradient(180deg, #000 0%, rgb(0 0 0 / 0) 16%), linear-gradient(0deg, rgb(0 0 0 / .55) 0%, rgb(0 0 0 / 0) 40%); }
  .hiw-hero__scene { top: auto; right: auto; bottom: 44px; left: 50%; width: min(380px, calc(100vw - 16px)); height: 120px; transform: translateX(-50%); }
  .hiw-hero__band > .stop { top: var(--space-2); right: var(--space-2); bottom: auto; left: auto; }

  .hiw-row__scene--goal { height: 280px; margin-bottom: 44px; }
  .hiw-row__scene--goal > .stop { top: auto; right: 0; bottom: -50px; }
  .hiw-row__scene--scan { min-height: 0; }
  .hiw-row__scene--bars { height: 450px; }

  .hiw-handover .section__head { margin-bottom: 46px; }
  .hiw-handover__frame { height: 966px; }
  .hiw-handover__media { inset: 0 calc(var(--gutter) * -1) auto; height: 680px; border: 0; border-radius: 0; }
  .hiw-handover__media img { object-position: 57% 50%; }
  .hiw-handover__node { top: -29px; right: 0; }
  .hiw-handover__scene { top: 366px; right: auto; bottom: auto; left: 50%; width: min(380px, calc(100vw - 8px)); height: 600px; transform: translateX(-50%); }
  .hiw-handover__scene > .scene { display: block; }
  .hiw-handover__frame > .stop { top: 312px; right: 0; bottom: auto; }

  .hiw-step__frame { height: 640px; }
  .hiw-step__media { inset: 0 calc(var(--gutter) * -1) auto; height: 490px; border: 0; border-radius: 0; }
  .hiw-step__scene, .hiw-step--flip .hiw-step__scene { top: 290px; right: auto; bottom: auto; left: 50%; width: min(380px, calc(100vw - 16px)); height: 350px; transform: translateX(-50%); }
  .hiw-step__frame > .stop { top: 232px; right: 0; }

  .hiw-inside__frame { height: 1040px; }
  .hiw-inside__media { inset: 0 calc(var(--gutter) * -1) auto; height: 700px; border: 0; border-radius: 0; }
  .hiw-inside__media img { object-position: 30% 26%; }
  .hiw-inside__scene { top: 320px; right: auto; bottom: auto; left: 50%; width: min(380px, calc(100vw - 8px)); height: 720px; transform: translateX(-50%); }
  .hiw-inside__scene [data-scene="plan-builder"] .pb-row { gap: 7px; }
  .hiw-inside__scene [data-scene="plan-builder"] .pb-chip { gap: 7px; padding-inline: 11px 14px; }
  .hiw-inside__frame > .stop { top: 266px; right: 0; left: auto; }

  .hiw-team__frame { height: 660px; margin-inline: calc(var(--gutter) * -1); border: 0; border-radius: 0; }

  .hiw-close { min-height: 0; padding-block: 460px clamp(3.5rem, 2.5rem + 3vw, 5.5rem); }
  .hiw-close::before { background: linear-gradient(180deg, rgb(0 0 0 / 0) 44%, rgb(0 0 0 / .9) 68%, #000 82%); }
  .hiw-close__media { bottom: auto; height: 640px; }
  .hiw-close__media .hiw-close__photo img { object-position: 65% 40%; }
  .hiw-close__in, .hiw-close__in .cta { justify-items: center; text-align: center; }
}
