@import url("../arsenal/thread.css");
/* how-it-works.css: How it works (plan.md, How it works), with the tokens of system.css. The thread (arsenal, restyled)
   is the beam: one gold line down a lane at the left of the content, lighting a lamp at every step's number, ending in
   the close's gold button. The parts carry no z-index and no stacking context of their own, so the line shows over
   their grounds (thread README, "What it needs from a page"). */

.how-thread { --lane: 76px; --thread-ink: var(--c-accent); --thread-track-ink: color-mix(in srgb, var(--c-accent) 34%, transparent); --thread-w: 2.5px; --thread-tail: 120px; }
.how-thread .wrap { padding-left: calc(var(--gutter) + var(--lane)); }
.page-how .yp, .page-how .op, .page-how .team, .page-how .faq-part { padding-block: var(--section-y); }

/* the lamps: every step's number, lit gold as the beam reaches it, one ring spreading as it plugs in */
.step-num { position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--c-paper); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-accent) 55%, var(--c-line)); font: 800 18px/1 var(--font-display); color: var(--c-ink); }
.step-num::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c-accent); box-shadow: 0 0 22px color-mix(in srgb, var(--c-accent) 70%, transparent); opacity: var(--lit, 0); }
.step-num::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-accent); opacity: calc(var(--lit, 0) * (1 - var(--lit-after, 0))); transform: scale(calc(1 + var(--lit-after, 0) * .9)); pointer-events: none; }
.step-num > span { position: relative; }
.hwp .step-num { background: var(--c-ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-on-ink) 34%, transparent); color: var(--c-on-ink); }
.step-num[data-lit] { color: var(--c-on-accent); }

/* ---------- hero: the words on navy at the left, the week's schedule on the tablet at the right ---------- */
.hwh { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: clamp(620px, calc(100svh - 72px), 780px); background: radial-gradient(70% 80% at 0% 0%, color-mix(in srgb, var(--c-accent) 20%, transparent), transparent 62%), var(--c-ink); color: var(--c-on-ink); }
.hwh__in { box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; padding: var(--space-6) var(--space-5) var(--space-6) max(var(--gutter), calc(50vw - var(--max-w) / 2)); }
.hwh__in h1 { margin: 0 0 var(--space-3); max-width: 15ch; font-size: var(--fs-h1); font-weight: 800; color: var(--c-on-ink); }
.hwh__in > p { margin: 0 0 var(--space-5); max-width: 34ch; font-size: 1.1875rem; color: var(--c-on-ink-soft); }
.hwh__in .action--box { max-width: 500px; }
.hwh__media { position: relative; overflow: hidden; }
.hwh__photo { position: absolute; inset: 0; margin: 0; overflow: hidden; }
.hwh__photo > img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 71% 50%; }
.hwh__media::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 38%, transparent), transparent 22%); }
.scene.hwh__wyw { position: absolute; z-index: 2; inset: 0 0 30px 0; }
/* the tablet's screen: a week full of booked visits, no trade */
.sched { box-sizing: border-box; height: 100%; padding: 26px 28px; background: var(--c-paper); font-family: var(--font-ui); color: var(--c-ink); }
.sched__head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 18px; }
.sched__head b { font: 800 26px/1.1 var(--font-display); }
.sched__head span { padding: 6px 12px; border-radius: 999px; background: var(--c-gold-soft); color: var(--c-accent-text); font: 700 18px/1 var(--font-ui); }
.sched__grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.sched__day { display: grid; gap: 10px; }
.sched__day > span { font: 700 18px/1 var(--font-ui); color: var(--c-ink-soft); text-align: center; }
.sched__day i { height: 56px; border-radius: 10px; background: var(--c-paper-alt); box-shadow: inset 0 0 0 1px var(--c-line); }
.sched__day i.is-on { background: var(--c-brand); box-shadow: inset 4px 0 0 var(--c-accent); }
.stop--hero { top: 20px; right: 20px; }
@media (max-width: 860px) {
  .hwh { grid-template-columns: 1fr; min-height: 0; }
  .hwh__in { padding: var(--space-5) var(--gutter) var(--space-5); }
  .hwh__in h1 { max-width: none; }
  .hwh__media { height: 460px; }
  .hwh__photo > img { object-position: 80% 50%; }
  .scene.hwh__wyw { inset: 0 0 30px 0; }
  /* the tablet is small here: its week shows as booked blocks, its words left out */
  .sched__head, .sched__day > span { visibility: hidden; }
}

/* ---------- your part: the lawyer on her call, steps 1 and 2 in glass at the left ---------- */
.yp { position: relative; overflow: hidden; color: var(--c-on-ink); }
.yp__media { position: absolute; inset: 0; }
.yp__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 70% 30%; }
.yp__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 86%, transparent) 0%, color-mix(in srgb, var(--c-ink) 70%, transparent) 40%, transparent 68%); }
.yp__in { position: relative; }
.yp__steps { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 360px)); gap: var(--space-4); align-items: start; }
.yp__label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 12px; margin-bottom: var(--space-3); }
.yp__label h3 { margin: 0; font-size: 1.125rem; line-height: 1.3; color: var(--c-on-ink); }
.yp__who { grid-column: 2; justify-self: start; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c-on-ink) 14%, transparent); font: 700 13px/1.2 var(--font-ui); color: var(--c-on-ink); }
.yp__who--you { background: var(--c-accent); color: var(--c-on-accent); }
.yp .step-num { background: var(--c-ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c-on-ink) 34%, transparent); color: var(--c-on-ink); }
.scene.yp__scene--call { aspect-ratio: 360 / 330; width: 100%; }
.scene.yp__scene--scan { width: 100%; }
.stop--yp { top: 0; right: calc(-1 * 52px); }
@media (max-width: 960px) {
  .yp__media::after { background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 86%, transparent), color-mix(in srgb, var(--c-ink) 62%, transparent)); }
}
@media (max-width: 860px) { .stop--yp { right: 0; top: -52px; } }
@media (max-width: 760px) {
  /* the photo stays under both steps: here its office side, the books and the window, under the navy veil; the
     words above it stand on the navy */
  .yp { background: var(--c-ink); }
  .yp__media { top: auto; height: 900px; }
  .yp__img { object-position: 6% 50%; }
  .yp__media::after { background: linear-gradient(180deg, var(--c-ink) 0%, transparent 14%), linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 84%, transparent), color-mix(in srgb, var(--c-ink) 64%, transparent)); }
  .yp__steps { grid-template-columns: 1fr; gap: var(--space-5); }
}

/* ---------- step 3: the free plan building, large, on the navy ground with the beam's glow ---------- */
.hwp { padding-block: var(--section-y); background: radial-gradient(60% 70% at 0% 0%, color-mix(in srgb, var(--c-accent) 18%, transparent), transparent 64%), var(--c-ink); color: var(--c-on-ink); }
.hwp__beam { display: none; }
.hwp__in { position: relative; display: grid; grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); gap: var(--space-5); align-items: center; }
.hwp__text { position: relative; }
.hwp__text h2 { margin: var(--space-3) 0 var(--space-2); font-size: var(--fs-h2); font-weight: 800; color: var(--c-on-ink); }
.hwp__text p { margin: 0; font-size: 1.125rem; color: var(--c-on-ink-soft); max-width: 40ch; }
.hwp__stage { position: relative; }
.scene.hwp__scene { width: 100%; aspect-ratio: 720 / 560; min-height: 580px; }
.stop--hwp { top: 12px; right: 12px; }
@media (max-width: 960px) { .hwp__in { grid-template-columns: 1fr; } }
@media (max-width: 599px) { .scene.hwp__scene { aspect-ratio: 360 / 700; } }

/* ---------- steps 4 to 6: one landscaping company's months, a framed photo per step ---------- */
.op { background: var(--c-paper-alt); }
.op__row { position: relative; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: var(--space-5); align-items: center; }
.op__row + .op__row { margin-top: var(--space-6); }
.op__text { position: relative; }
.op__text h3 { margin: var(--space-3) 0 var(--space-2); font-size: var(--fs-h3); }
.op__text p { margin: 0; color: var(--c-ink-soft); max-width: 40ch; }
.op__frame { position: relative; height: clamp(440px, 36vw, 500px); border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); }
.op__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.op__frame--1 .op__img { object-position: 70% 40%; }
.op__frame--2 .op__img { object-position: 30% 40%; }
.op__frame--3 .op__img { object-position: 72% 45%; }
.op__frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 30%, transparent), transparent 55%); }
.op__frame--2::after { background: linear-gradient(270deg, color-mix(in srgb, var(--c-ink) 30%, transparent), transparent 55%); }
.scene.op__scene { position: absolute; z-index: 2; top: 50%; translate: 0 -50%; left: 24px; width: min(380px, calc(100% - 48px)); }
.op__frame--2 .scene.op__scene { left: auto; right: 24px; }
.op .stop { top: 16px; right: 16px; }
.op__frame--2 .stop { right: auto; left: 16px; }
@media (max-width: 860px) {
  .op__row { grid-template-columns: 1fr; gap: var(--space-4); }
  .op__frame { height: 520px; }
  .scene.op__scene, .op__frame--2 .scene.op__scene { top: auto; bottom: 16px; translate: none; left: 16px; right: 16px; width: auto; }
  .op__frame--1 .op__img { object-position: 82% 30%; }
  .op__frame--2 .op__img { object-position: 22% 30%; }
  .op__frame--3 .op__img { object-position: 84% 30%; }
}

/* ---------- the team: a person answers, over the plumber at his van ---------- */
.team { background: var(--c-paper); }
.team__frame { position: relative; height: clamp(480px, 42vw, 600px); border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); }
.team__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 70% 35%; }
.team__frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 40%, transparent), transparent 50%); }
.scene.team__scene { position: absolute; z-index: 2; left: 32px; top: 50%; translate: 0 -50%; width: min(420px, calc(100% - 64px)); }
.stop--team { top: 16px; right: 16px; }
@media (max-width: 760px) {
  .team__frame { height: 560px; }
  .team__img { object-position: 78% 30%; }
  .scene.team__scene { top: auto; bottom: 16px; translate: none; left: 16px; right: 16px; width: auto; }
}

/* ---------- the questions ---------- */
.faq-part { background: var(--c-paper); }

/* ---------- the close: the line runs over the footage into the gold button ---------- */
.how-close.band { isolation: auto; background: transparent; }
/* the phone: the photo stands above the words, so the words keep the band's own navy under them (step 13, row 3) */
@media (max-width: 760px) { .how-close.band { background: var(--c-ink); } }
.band__in { box-sizing: border-box; }
.how-close .band__media img { object-position: 64% 40%; }
.how-close .band__seq { left: calc(max(var(--gutter), 50vw - var(--max-w) / 2) + var(--lane) + 24px); }

/* the phone: no lane; the thread draws a short line beside each part (thread README, Behavior) */
@media (max-width: 699.98px) {
  .how-thread { --lane: 0px; }
  .how-close .band__seq { left: 16px; }
}
@media (min-width: 700px) {
  /* every number from step 3 on stands in the lane, beside its words */
  .hwp__text .step-num, .op__text .step-num { position: absolute; left: calc(-1 * var(--lane)); top: 0; }
  .hwp__text h2, .op__text h3 { margin-top: 0; }
}
