/* how-it-works.css: the How it works page, one katana line (the arsenal's thread) down every part. Tokens of system.css. */
@import url("../arsenal/thread.css");

/* ---------- the kit's header CSS (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%))); }
[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); }
[data-kit-scene="rotate"] [data-kit-slide] video[data-kit-shown] { clip-path: none; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { opacity: clamp(0, (1 - var(--kit-move, 0)) * 1000, 1); }
[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 line: one lane at the left of the content ----------
   Every anchor's middle is 28 px in from the content's left edge (the header's button leaves at bl, 28 px in), so the
   line runs straight from the first button to the last. A part painted over the line would hide it, so no part has a
   ground of its own: each ground (and the close's footage, and the header's band) is a layer at z-index -1, under it. */
.thread { --lane: 76px; --thread-inset: 28px; }
.thread > section { background: none; isolation: auto; }
.part__bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.lane { padding-left: calc(var(--gutter) + var(--lane)); }
.lane__head, .lrow, .urow, .handover { position: relative; }
.lane__num, .lane__node { position: absolute; display: grid; place-items: center; border-radius: 50%; }
.lane__num { left: calc(-1 * var(--lane)); top: -3px; width: 56px; height: 56px; font: 800 1.375rem/1 var(--font-display); font-stretch: 112%; color: var(--c-on-ink);
  background: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--n-2));
  border: 2px solid color-mix(in srgb, var(--c-brand-on-ink) calc(var(--lit, 0) * 100%), var(--n-line-strong)); }
.lane__node { left: calc(8px - var(--lane)); top: 8px; width: 40px; height: 40px; background: var(--n-0);
  color: color-mix(in srgb, var(--c-brand-on-ink) calc(var(--lit, 0) * 100%), var(--n-soft));
  border: 2px solid color-mix(in srgb, var(--c-brand-on-ink) calc(var(--lit, 0) * 100%), var(--n-line-strong)); }
.lane__node svg { width: 18px; height: 18px; }
/* one ring spreads from a number or a node as the line plugs into it */
.lane__num::after, .lane__node::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-brand-on-ink); pointer-events: none;
  opacity: calc((1 - var(--lit-after, 0)) * min(1, var(--lit, 0) * 4)); transform: scale(calc(1 + 0.9 * var(--lit-after, 0))); }
.band--light .lane__node { background: var(--c-paper);
  color: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--c-ink-soft));
  border-color: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--c-line)); }
.lrow h3, .urow h3 { font: 800 var(--fs-h3)/1.15 var(--font-display); font-stretch: 108%; color: var(--c-on-ink); }
.lrow__text p, .urow__text p { margin-top: 10px; max-width: 36ch; color: var(--n-soft); text-wrap: pretty; }
.steps-lane { display: grid; gap: clamp(56px, 6vw, 88px); margin: clamp(44px, 5vw, 72px) 0 0; padding: 0; list-style: none; }

/* ---------- hero: the headline across the top, the footage band under it, cut on the blade's diagonal ---------- */
.ihead--hiw { --band-h: clamp(380px, 42vw, 600px); padding-top: clamp(104px, 8.4vw, 120px); }
.ihead--hiw .ihead__in { gap: 26px; justify-items: stretch; }
.ihead--hiw h1 { font-size: var(--fs-display); text-wrap: balance; }
/* the button first, at the lane, the line beside it */
.ihead--hiw .ihead__row { display: grid; grid-template-columns: auto minmax(0, 540px); justify-content: space-between; align-items: center; gap: 20px 48px; }
.ihead--hiw .ihead__row .cta-row { order: -1; margin-top: 0; }
.ihead--hiw .ihead__line { max-width: 540px; }
.ihead--hiw .ihead__band { position: relative; z-index: -1; height: var(--band-h); margin-top: clamp(32px, 3.4vw, 48px); clip-path: polygon(0 clamp(40px, 5vw, 80px), 100% 0, 100% 100%, 0 100%); }
.ihead--hiw .ihead__stage { position: absolute; inset: 0; }
.ihead--hiw .ihead__slide { --pos: 42% 36%; }
.ihead--hiw .ihead__clip { object-position: var(--pos); }
.ihead--hiw .ihead__stage::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background:
  linear-gradient(180deg, color-mix(in srgb, var(--n-0) 55%, transparent) 0%, color-mix(in srgb, var(--n-0) 0%, transparent) 30%),
  linear-gradient(0deg, color-mix(in srgb, var(--n-0) 45%, transparent) 0%, color-mix(in srgb, var(--n-0) 0%, transparent) 26%),
  color-mix(in srgb, var(--n-0) 12%, transparent); }
/* wyw shows its four notifications from 480 px wide; its feed hangs 30 px under the box */
.ihead--hiw .ihead__band > .ihead__scene { position: absolute; z-index: 4; right: var(--gutter); top: 64px; height: min(320px, calc(var(--band-h) - 112px)); width: 480px; }
.stop--hero { position: absolute; z-index: 6; right: var(--gutter); bottom: calc(var(--band-h) - 60px); }

/* ---------- you: steps 1 to 3 on the designed ground, each number in the lane ---------- */
.you > .part__bg { background:
  radial-gradient(55% 75% at 100% 100%, color-mix(in srgb, var(--c-brand) 14%, transparent), transparent 72%),
  repeating-linear-gradient(-60deg, color-mix(in srgb, var(--c-paper) 4%, transparent) 0 1px, transparent 1px 28px),
  var(--n-0); }
.lrow { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 600px); column-gap: clamp(40px, 6vw, 96px); align-items: start; }
.lrow__text { padding-top: 10px; }
.lrow__scene { position: relative; }
.lrow__scene > [data-scene] { width: min(100%, 520px); }
/* the chat grows down inside a box of its full height, so it moves nothing; the stop icon stands just over it */
.lrow__scene--goal { height: 300px; max-width: 420px; }
.lrow__scene--goal > [data-scene] { position: absolute; left: 0; top: 0; width: 100%; }
.lrow__scene--goal > .stop--corner { top: -50px; right: 0; }
.lrow__scene--wide > [data-scene] { width: 100%; }
.handover { display: flex; align-items: center; min-height: 40px; margin-top: clamp(48px, 6vw, 80px); font: 750 1.125rem/1.3 var(--font-display); font-stretch: 108%; color: var(--c-on-ink); }
.handover .lane__node { top: 0; }
.handover span::before { content: '/'; margin-right: 10px; color: var(--c-brand-on-ink); }

/* ---------- us: steps 4 to 6, a framed photo per step, sides alternating, each scene over its photo ---------- */
.us .steps-lane { gap: clamp(104px, 10vw, 150px); }
.urow { display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 360px); column-gap: clamp(96px, 9vw, 136px); align-items: start; }
.urow--flip { grid-template-columns: minmax(0, 360px) minmax(0, 620px); }
.urow--flip .urow__media { order: 2; }
.urow__text { padding-top: 18px; }
.urow .lane__num { top: 5px; }
.urow__media { position: relative; }
.urow__frame { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--n-2); clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%); }
.urow__frame img, .team__frame img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover;
  filter: saturate(calc(0.62 + 0.38 * var(--lit, 0))); transform: scale(calc(1.05 - 0.05 * var(--lit, 0))); }
.urow__media > .urow__scene { position: absolute; z-index: 2; width: 320px; }
/* each scene clear of the faces: the salon's on the counter at the right, the others at the lower left */
.urow__media > .urow__scene--launch { right: -72px; bottom: -48px; height: 290px; }
.urow__media > .urow__scene--leads { left: -72px; bottom: -48px; width: 380px; height: 280px; }
.urow__media > .urow__scene--tune { left: -72px; bottom: -48px; height: 320px; }
.urow__media > .stop--corner { top: 16px; right: 46px; }

/* ---------- inside: the laptop's plan, its cards coming out over the window ---------- */
.inside__stage { position: relative; margin-top: clamp(44px, 5vw, 72px); margin-left: calc(-1 * var(--lane)); }
.inside__frame { position: relative; width: 68%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--n-2); clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%); }
.inside__frame > .inside__photo { position: absolute; inset: -1px; margin: 0; }
.inside__photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; filter: saturate(calc(0.62 + 0.38 * var(--lit, 0))); }
.inside__stage > .inside__scene { position: absolute; z-index: 2; top: 0; left: 45%; width: min(560px, 42.5%); }
.inside__stage > .stop--corner { top: 16px; left: 16px; right: auto; }
/* the plan's cover on the laptop's screen (designed at 320 x 230) */
.cover { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto 1fr auto; gap: 8px; padding: 16px 18px 14px; background: var(--c-paper); color: var(--c-ink); font-family: var(--font-ui); }
.cover__top { display: flex; justify-content: space-between; gap: 8px; font-size: 17px; line-height: 1.2; }
.cover__top b { font-weight: 800; }
.cover__top span { color: var(--c-ink-soft); }
.cover__title { font: 850 28px/1 var(--font-display); font-stretch: 112%; }
.cover__bars { display: flex; align-items: flex-end; gap: 5px; min-height: 0; padding-top: 6px; border-bottom: 2px solid var(--c-line); }
.cover__bars i { flex: 1; height: var(--v); background: var(--c-brand); }
.cover__bars i.is-setup { height: 8%; background: var(--c-line); }
.cover__key { display: flex; justify-content: space-between; gap: 8px; font-size: 16px; color: var(--c-ink-soft); }

/* ---------- team: the words, then the owner on the job, the team's cards landing over the free half ---------- */
.team__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: clamp(40px, 6vw, 96px); align-items: center; }
.team__media { position: relative; }
.team__frame { position: relative; overflow: hidden; aspect-ratio: 3 / 2; background: var(--n-2); clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%); }
.team__frame img { object-position: 60% 40%; }
.team__media > .stop--corner { top: 16px; right: 46px; }
.team__cards { position: absolute; z-index: 2; left: 20px; bottom: 20px; width: min(320px, 50%); display: grid; gap: 10px; }
.tcard { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 11px 14px; color: var(--c-on-ink);
  background: color-mix(in srgb, var(--n-1) 92%, transparent); border: 1px solid var(--n-line); border-left: 3px solid var(--c-brand);
  box-shadow: var(--shadow-m); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  opacity: var(--kit-in, 1); } /* the photo's frame is the sequence's first item, always on: the three cards fade in in turn and out together */
.tcard__icon { grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-s); background: var(--n-2); }
.tcard__icon svg { width: 18px; height: 18px; }
.tcard__icon--team { background: var(--c-paper); }
.tcard__icon--team img { width: 28px; height: 28px; }
.tcard__icon--done { background: var(--c-accent); color: var(--c-ink); }
.tcard--tap .tcard__icon { background: var(--c-brand); color: var(--c-on-brand); }
.tcard b { font: 700 15px/1.25 var(--font-ui); }
.tcard small { font-size: 13px; line-height: 1.3; color: var(--n-soft); }

/* ---------- faq: the paper under the line (a part left static paints its own ground under the line) ---------- */
.thread > .faq { position: static; background: var(--c-paper); }
.thread .faq .sec-head { position: relative; top: auto; }

/* ---------- close: the line turns into the main button ---------- */
.iclose--hiw > .iclose__clip, .iclose--hiw > .iclose__shade { z-index: -1; }
.iclose--hiw .iclose__clip { object-position: 50% 30%; }
.iclose--hiw .iclose__shade { background:
  linear-gradient(90deg, color-mix(in srgb, var(--n-0) 88%, transparent) 0%, color-mix(in srgb, var(--n-0) 66%, transparent) 36%, color-mix(in srgb, var(--n-0) 0%, transparent) 62%),
  linear-gradient(180deg, color-mix(in srgb, var(--n-0) 70%, transparent) 0%, color-mix(in srgb, var(--n-0) 0%, transparent) 22%); }
.iclose--hiw .iclose__in { justify-items: start; text-align: left; }
.iclose--hiw .iclose__in .sec-head { justify-items: start; max-width: 560px; }
.iclose--hiw .btn--main { box-shadow: 0 0 0 calc(var(--lit-after, 0) * 16px) color-mix(in srgb, var(--c-brand-on-ink) calc((1 - var(--lit-after, 0)) * min(1, var(--lit, 0) * 4) * 70%), transparent); }

/* ---------- narrower ---------- */
@media (max-width: 900px) {
  .ihead--hiw .ihead__row { grid-template-columns: minmax(0, 1fr); }
  .ihead--hiw .ihead__row .cta-row { order: 0; }
}
@media (max-width: 1000px) {
  .lrow { grid-template-columns: minmax(0, 1fr); row-gap: 22px; }
  .urow, .urow--flip { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
  .urow__text { order: 1; padding-top: 0; }
  .urow__media, .urow--flip .urow__media { order: 2; align-self: stretch; margin-bottom: 48px; }
  .urow .lane__num { top: -14px; }
  .urow__media > .urow__scene--launch { right: 16px; }
  .urow__media > .urow__scene--leads, .urow__media > .urow__scene--tune { left: 16px; }
  .inside__frame { width: 100%; }
  .inside__stage > .inside__scene { position: relative; top: auto; left: auto; width: auto; max-width: 560px; margin: -24px 0 0 auto; }
  .team__grid { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .team__media { align-self: stretch; }
}
@media (max-width: 760px) {
  .thread { --lane: 48px; }
  .lane__num { top: -8px; width: 36px; height: 36px; font-size: 1rem; }
  .lane__node { left: calc(3px - var(--lane)); top: 2px; width: 30px; height: 30px; }
  .lane__node svg { width: 14px; height: 14px; }
  .ihead--hiw { --band-h: 320px; padding-top: 100px; }
  .ihead--hiw .ihead__band { margin-top: 36px; clip-path: polygon(0 36px, 100% 0, 100% 100%, 0 100%); }
  .ihead--hiw .ihead__slide { --pos: 30% 40%; }
  .ihead--hiw .ihead__band > .ihead__scene { left: var(--gutter); right: var(--gutter); width: auto; top: 52px; bottom: 16px; }
  .lrow__scene--goal { max-width: none; }
  .lrow__scene--goal > .stop--corner { top: 10px; right: 10px; }
  .lrow__scene--wide { margin-left: calc(-1 * var(--lane)); }
  .cover__top, .cover__key { display: none; }
  .cover { align-content: center; }
  .cover__title { font-size: 34px; }
  /* the photos stand tall on the phone, each scene on its lower half, under the faces */
  .urow__frame { aspect-ratio: 3 / 4; }
  .urow__frame--salon img { object-position: 60% 50%; }
  .urow__frame--hvac img { object-position: 50% 50%; }
  .urow__frame--dental { aspect-ratio: 8 / 11.5; }
  .urow__frame--dental img { object-position: 42% 50%; }
  .urow__media, .urow--flip .urow__media { margin-bottom: 180px; }
  /* the scenes reach into the lane and half the gutter, so their words keep their size */
  .urow__media > .urow__scene, .urow__media > .urow__scene--launch, .urow__media > .urow__scene--leads, .urow__media > .urow__scene--tune { left: calc(-1 * var(--lane)); right: calc(-0.5 * var(--gutter)); width: auto; top: 54%; bottom: auto; }
  .team__frame { aspect-ratio: 3 / 4; }
  .team__frame img { object-position: 85% 40%; }
  .team__media { margin-bottom: 48px; }
  .team__cards { left: 12px; right: 12px; bottom: auto; top: 46%; width: auto; }
  .iclose--hiw { align-items: end; }
  .iclose--hiw .iclose__clip { object-position: 75% 30%; }
  .iclose--hiw .iclose__shade { background: linear-gradient(0deg, color-mix(in srgb, var(--n-0) 92%, transparent) 0%, color-mix(in srgb, var(--n-0) 70%, transparent) 42%, color-mix(in srgb, var(--n-0) 0%, transparent) 66%); }
}
