/* how-it-works.css: the How it works page, with the tokens of system.css. The line is the arsenal's thread (its code
   unchanged), drawn here as the site's copper orbit down one lane at the page's left edge. */
@import url("../arsenal/thread.css");

/* ---------- the line ---------- */
.hiw {
  --lane: 56px;                                   /* the lane the line runs down, at the left of every part's content */
  --lane-gap: clamp(18px, 2vw, 30px);
  --thread-ink: var(--c-accent);
  --thread-track-ink: color-mix(in srgb, var(--c-accent) 40%, transparent);
  --thread-bg: var(--c-paper);
  --thread-w: 2.5px;
  --thread-radius: 36px;
  position: relative;
  isolation: isolate;
}
/* the line over the parts' grounds and footage, the numbers, panels and photos over the line */
.hiw > .thread__svg { z-index: 1; }
.hiw .ground { isolation: auto; }
.hiw [data-thread-anchor], .hiw [data-thread-light] { position: relative; z-index: 2; }
/* every part's content starts past the lane, so the line never crosses a word */
.hhero__in, .hpart__head, .hfaq__grid, .hclose__in { padding-left: calc(var(--lane) + var(--lane-gap)); }

/* a step's number and a part's node: a ring on the paper, filled copper and circled by the orbit as the line plugs in */
.hstep__num, .hnode {
  --l: calc(var(--lit, 1) * var(--lit, 1) * (3 - 2 * var(--lit, 1)));
  display: grid; place-items: center; width: var(--lane); height: var(--lane); border-radius: 50%;
  background: color-mix(in srgb, var(--c-accent) calc(var(--l) * 100%), var(--c-paper));
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-accent) 60%, transparent), 0 6px 18px color-mix(in srgb, var(--c-ink) calc(var(--l) * 14%), transparent);
  font: 650 1.5rem/1 var(--font-display); color: var(--c-accent-text);
}
.hstep__num[data-lit], .hnode[data-lit] { color: var(--c-on-brand); }
.hnode svg { width: 24px; height: 24px; }
.hstep__num::before, .hnode::before {   /* the orbit around a lit number */
  content: ""; position: absolute; inset: -10px -17px; border-radius: 50%; pointer-events: none;
  border: 2px solid transparent; border-top-color: var(--c-gold); border-left-color: var(--c-accent); border-bottom-color: var(--c-accent);
  transform: rotate(-24deg) scale(calc(.8 + .2 * var(--l))); opacity: var(--l);
}
.hstep__num::after, .hnode::after {     /* one ring spreading as the head plugs in */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 2px var(--c-accent);
  transform: scale(calc(1 + var(--lit-after, 1) * .8)); opacity: calc((1 - var(--lit-after, 1)) * var(--lit, 1));
}

/* ---------- #hero: the phone on the desk lighting up with new clients, the words on its left ---------- */
.hhero .phero__media { container-type: size; }
.hhero .phero__media::after { background: linear-gradient(90deg, color-mix(in srgb, var(--c-navy-deep) 94%, transparent) 0%, color-mix(in srgb, var(--c-navy-deep) 74%, transparent) 30%, color-mix(in srgb, var(--c-navy-deep) 10%, transparent) 46%, transparent 62%, color-mix(in srgb, var(--c-navy-deep) 18%, transparent) 100%); }
/* the photo kept at its own shape, the phone's centre at 58% of the width (the screen's box is measured on the 1920 x 1080 still) */
.hhero__photo { --w: max(100cqw, 210cqh); position: absolute; top: 47%; left: calc(58cqw - var(--w) * .4805); width: var(--w); aspect-ratio: 16 / 9; transform: translateY(-50%); }
.hhero__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hhero__screen { position: absolute; z-index: 1; left: 37.9%; top: 15.8%; width: 20.3%; height: 75.3%; overflow: hidden; border-radius: 10% / 4.8%; transform: rotate(-1.2deg); background: radial-gradient(120% 55% at 50% 0%, #1d3350 0%, #0d1726 62%, #0a121d 100%); }
.scene.hhero__wyw { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the lock screen: its clock high, the new clients landing under it */
.hhero__clock { position: absolute; left: 0; right: 0; top: 11%; display: grid; justify-items: center; gap: 2px; color: color-mix(in srgb, var(--c-on-ink) 94%, transparent); }
.hhero__clock b { font: 600 clamp(2.4rem, 4.2cqw, 3.6rem)/1 var(--font-ui); letter-spacing: -.02em; }
.hhero__clock span { font: 500 clamp(.8rem, 1.1cqw, 1rem)/1.3 var(--font-ui); color: color-mix(in srgb, var(--c-on-ink) 78%, transparent); }
.hhero .hhero__screen [data-scene="wyw"] .wy-feed { top: 34%; bottom: auto; left: 8px; right: 8px; }
.phero__title em { font-style: italic; color: var(--c-accent-on-ink); }
.hhero .phero__words { max-width: 33rem; }

/* ---------- the parts' heads ---------- */
.hpart__head { max-width: calc(760px + var(--lane) + var(--lane-gap)); margin-bottom: clamp(2rem, 1.2rem + 2.4vw, 3.5rem); }
.hpart__head .lede { margin-top: var(--space-3); }

/* ---------- #yours: the owner's three steps on the designed ground ---------- */
.hyours { padding-block: var(--section-y); }
.hyours__ring { left: -12%; right: -12%; top: 10%; width: 124%; height: 82%; opacity: .55; }
.hyours__ring path, .hinside__ring path { stroke-width: 2.5px; }
.hsteps { display: grid; gap: clamp(2.5rem, 1.5rem + 3vw, 4.5rem); margin: 0; padding: 0; list-style: none; }
.hstep { display: grid; grid-template-columns: var(--lane) minmax(0, 1fr) minmax(0, 560px); column-gap: var(--lane-gap); align-items: center; }
.hstep--photo { grid-template-columns: var(--lane) minmax(0, 4fr) minmax(0, 7fr); }
.hstep__num { align-self: start; margin-top: 4px; }
.hstep__text { max-width: 30rem; padding-right: clamp(0px, 2vw, 24px); }
.hstep__title { font: 650 clamp(1.45rem, 1.1rem + 1vw, 1.9rem)/1.15 var(--font-display); color: var(--c-ink); }
.hstep__line { margin-top: var(--space-3); font-size: 1.06rem; line-height: 1.6; color: var(--c-ink-soft); }
.hstep__who { display: inline-flex; align-items: center; gap: 8px; margin-top: var(--space-4); padding: 6px 14px 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c-accent) 12%, transparent); font: 600 .9rem/1.3 var(--font-ui); color: var(--c-accent-text); }
.hstep__who svg { width: 16px; height: 16px; color: var(--c-accent); }
/* each base scene brings its own card: goal and scan 260 to 420 wide, leadbars up to 580 */
.hstep__panel { position: relative; display: grid; justify-items: center; align-items: center; height: 290px; }
.scene.hstep__scene { position: relative; width: min(100%, 420px); height: 100%; }
.hstep__panel--bars { height: 340px; }
.hstep__panel--bars .hstep__scene { width: 100%; }
.hstep__panel .stop { top: 0; right: 0; bottom: auto; }

/* ---------- #ours: the agency's three steps, each over an owner at work ---------- */
.hours { padding-block: var(--section-y); }
.hstep--photo { align-items: center; }
.hstep__frame { height: clamp(420px, 35vw, 500px); filter: saturate(calc(.62 + .38 * var(--lit, 1))); }
.hstep__frame .frame__media { transform: scale(calc(1.04 - .04 * var(--lit, 1))); }
.hstep__img--launch { object-position: 30% 50%; }
.hstep__img--leads { object-position: 30% 35%; }
.hstep__img--tune { object-position: 22% 45%; }
/* each glass scene its own panel, 260 to 420 wide and about 280 high, over the photo's calm side */
.scene.hstep__glass { position: absolute; z-index: 1; left: clamp(14px, 2vw, 24px); bottom: clamp(14px, 2vw, 24px); width: min(400px, calc(100% - 28px)); height: 290px; }
.hstep__glass--right { left: auto; right: clamp(14px, 2vw, 24px); }
.hstep__frame .stop { top: 14px; right: 14px; bottom: auto; }

/* ---------- #inside and #team: a node in the lane, the words, the picture ---------- */
.hinside { padding-block: var(--section-y); }
.hinside__ring { left: 20%; top: 6%; width: 90%; height: 88%; opacity: .5; }
.hrow { display: grid; grid-template-columns: var(--lane) minmax(0, 4fr) minmax(0, 7fr); column-gap: var(--lane-gap); align-items: center; }
.hrow .hnode { align-self: start; margin-top: 6px; }
.hrow__words .lede { margin-top: var(--space-3); }
/* plan-builder lays itself out from 600 to 900 wide, 520 to 640 high (under 600: 360 x 700) */
.hinside__stage { position: relative; height: 640px; }
.scene.hinside__scene { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; } /* the card's shadow, not cut square at the scene's box */
.hinside__stage .stop { top: 0; right: 0; bottom: auto; }

.hteam__frame { height: clamp(460px, 38vw, 540px); }
.hteam__img { object-position: 62% 40%; }
.hteam__frame::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-navy-deep) 40%, transparent), transparent 55%); }
.hteam__chat { position: absolute; z-index: 1; left: clamp(14px, 2vw, 26px); bottom: clamp(14px, 2vw, 26px); display: grid; gap: 8px; width: min(58%, 340px); padding: 16px; border-radius: 18px; background: color-mix(in srgb, var(--c-paper) 76%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5); box-shadow: 0 18px 40px color-mix(in srgb, var(--c-navy-deep) 28%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--c-paper) 60%, transparent); opacity: calc(1 - var(--kit-out, 0)); }
.hteam__head { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font: 700 .95rem/1.2 var(--font-ui); color: var(--c-ink); }
.hteam__dot { width: 9px; height: 9px; border-radius: 50%; background: #2E9E5B; box-shadow: 0 0 0 3px color-mix(in srgb, #2E9E5B 25%, transparent); }
.hteam__msg { max-width: 88%; margin: 0; padding: 9px 13px; border-radius: 14px; font: 500 .95rem/1.4 var(--font-ui); opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 8px)); }
.hteam__msg[hidden] { display: none; }
.hteam__msg--you { justify-self: end; border-bottom-right-radius: 4px; background: var(--c-ink); color: var(--c-on-ink); }
.hteam__msg--team { justify-self: start; border-bottom-left-radius: 4px; background: var(--c-paper); color: var(--c-ink); box-shadow: inset 0 0 0 1px var(--c-line); }
.hteam__msg--typing { justify-self: start; display: inline-flex; gap: 4px; padding: 12px 14px; background: var(--c-paper); box-shadow: inset 0 0 0 1px var(--c-line); }
.hteam__msg--typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-ink-soft); animation: hteam-dot 1s ease-in-out infinite; }
.hteam__msg--typing i:nth-child(2) { animation-delay: .15s; }
.hteam__msg--typing i:nth-child(3) { animation-delay: .3s; }
@keyframes hteam-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.hteam__frame .stop { top: 14px; right: 14px; bottom: auto; }

/* ---------- #faq ---------- */
.hfaq__grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: start; }
.hfaq__intro { display: grid; gap: var(--space-3); }
.hfaq__list .faq__item:first-child { border-top: 1px solid var(--c-line); }

/* ---------- #close: the café owner turning her sign to Open; the line ends in the button ---------- */
.hclose__video { object-position: 64% 35%; }
.hclose .band__media::after { background: linear-gradient(90deg, color-mix(in srgb, var(--c-navy-deep) 90%, transparent) 0%, color-mix(in srgb, var(--c-navy-deep) 62%, transparent) 44%, color-mix(in srgb, var(--c-navy-deep) 8%, transparent) 72%, transparent 100%); }
.hclose__in { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.hclose__cta { margin-top: clamp(1.5rem, 1rem + 1.4vw, 2.25rem); }

@media (prefers-reduced-motion: reduce) { .hteam__msg--typing i { animation: none; } }

/* ---------- phones and narrow screens: no line (data-narrow="hide"), the numbers beside the headings ---------- */
@media (max-width: 899px) {
  .hiw { --lane: 46px; --lane-gap: 14px; }
  .hhero__in, .hfaq__grid, .hclose__in { padding-left: var(--gutter); }
  .hpart__head { padding-left: 0; }
  /* the header: the words, then the phone on its desk under them */
  .hhero { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding-bottom: 0; }
  .hhero .phero__media { order: 2; position: relative; inset: auto; z-index: 0; height: clamp(480px, 140vw, 620px); margin-top: var(--space-5); }
  .hhero .phero__media::after { background: linear-gradient(180deg, var(--c-navy-deep) 0%, transparent 14%, transparent 86%, var(--c-navy-deep) 100%); }
  .hhero__photo { --w: max(100cqw, 215cqh); top: 50%; left: calc(50cqw - var(--w) * .4805); }
  .hstep, .hrow { grid-template-columns: var(--lane) minmax(0, 1fr); row-gap: var(--space-5); }
  .hstep__panel, .hstep__frame, .hinside__stage, .hteam__frame { grid-column: 1 / -1; }
  .hstep__panel { height: 300px; }
  .hstep__panel--bars { height: 420px; margin-inline: calc(-1 * var(--gutter) + 4px); }
  .scene.hstep__glass { height: 340px; }
  .hhero .stop--hero { top: auto; bottom: 20px; right: 16px; }
  .hyours__ring, .hinside__ring { opacity: .22; }
  .hstep__frame { height: 520px; }
  .hinside__stage { height: 700px; }
  .hteam__frame { height: 520px; }
  .hteam__chat { width: auto; right: 14px; }
  .hfaq__grid { grid-template-columns: minmax(0, 1fr); }
  .hclose__in { grid-template-columns: minmax(0, 1fr); }
  .hclose { padding-top: 0; }
  .hclose .band__media { bottom: auto; height: clamp(300px, 80vw, 440px); }
  .hclose .band__media::after { background: linear-gradient(180deg, transparent 35%, var(--c-navy-deep) 100%); }
  .hclose__video { object-position: 62% 30%; }
  .hclose__in { padding-top: calc(clamp(300px, 80vw, 440px) - 72px); }
  .hclose .stop--band { top: 16px; bottom: auto; }
}
