@import url("../arsenal/thread.css");
/* The How it works page's own layout: it places and sizes its parts with the tokens of system.css. "The thread": one
   stream runs down the page from the header's button, plugs into each step's number with a ring, passes behind each
   framed photo, and ends in the close's button. The parts are the thread container's children: none of them makes its
   own stacking context or paints its own background where the line passes over footage (their footage sits under the
   line, their words and cards over it), so the line shows over the photos and hides behind the cards and frames. */

/* ---------- the thread, restyled as the site's stream ---------- */
.how-thread {
  --thread-ink: var(--c-brand);
  --thread-track-ink: color-mix(in srgb, var(--c-brand) 40%, transparent);
  --thread-bg: var(--c-paper);
  --thread-w: 2.5px;
  --thread-radius: 56px;
  --thread-amp: 3px;
  --thread-wave: 64px;
  --thread-tail: 110px;
  background: var(--c-ink);
}
/* under 980 px the steps stack and the line is left out (data-narrow="hide"); the numbers still light as they are read */
@media (max-width: 980px) { .how-thread { --thread-narrow: 1; } }

/* a step's number: the drop the stream lands on, one ring opening from it as the line reaches it */
.mine__num, .row__num, .how-mark {
  position: absolute; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--c-brand); color: var(--c-on-brand); font-family: var(--font-display); font-weight: 700; font-size: 1.125rem;
  box-shadow: 0 0 0 calc(var(--lit, 0) * 7px) color-mix(in srgb, var(--c-brand) 24%, transparent), var(--shadow-m);
}
.mine__ring, .row__ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--c-brand); transform: scale(calc(1 + var(--lit-after, 0) * 1.6)); opacity: calc(var(--lit, 0) * (1 - var(--lit-after, 0)) * 0.9); pointer-events: none; }
.how-mark svg { width: 22px; height: 22px; }
.how-mark { background: var(--c-paper); color: var(--c-brand-text); box-shadow: inset 0 0 0 2px var(--c-brand), 0 0 0 calc(var(--lit, 0) * 7px) color-mix(in srgb, var(--c-brand) 24%, transparent), var(--shadow-m); }

/* ---------- hero: the phone on the desk lighting up; the notifications on the left, the words on the right ---------- */
.how-hero { position: relative; display: grid; align-items: center; min-height: clamp(700px, 100svh, 940px); overflow: hidden; color: var(--c-on-ink); }
.how-hero__stage { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--c-ink); }
.how-hero__slide video, .how-hero__slide .kit-first { object-position: var(--pos, 50% 50%); }
.how-hero__slide .kit-first { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
/* one still grade: deep emerald behind the notifications and deeper behind the words, the phone clear between them */
.how-hero__stage::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 60%, transparent) 0%, transparent 22%, transparent 78%, color-mix(in srgb, var(--c-ink) 60%, transparent) 100%),
              linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 64%, transparent) 0%, color-mix(in srgb, var(--c-ink) 22%, transparent) 30%, color-mix(in srgb, var(--c-ink) 14%, transparent) 44%, color-mix(in srgb, var(--c-ink) 74%, transparent) 62%, color-mix(in srgb, var(--c-ink) 90%, transparent) 100%); }
.how-hero__grid { position: relative; z-index: 5; display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(32px, 6vw, 110px); align-items: center; padding-top: 128px; padding-bottom: 104px; }
.how-hero__scene { position: relative; height: 430px; }
.how-hero__scene > [data-scene] { position: absolute; inset: 0; }
.how-hero__body { justify-self: end; display: grid; gap: 22px; max-width: 540px; }
.how-hero__title { font-size: clamp(2.3rem, 0.9rem + 3.4vw, 4rem); line-height: 1.03; letter-spacing: -0.03em; }
.how-hero__line { font-size: 1.1875rem; line-height: 1.55; color: color-mix(in srgb, var(--c-on-ink) 90%, transparent); }
/* the words keep their contrast where they meet the lit phone in the first clip */
.how-hero__title, .how-hero__line { text-shadow: 0 2px 22px color-mix(in srgb, var(--c-ink) 70%, transparent), 0 1px 3px color-mix(in srgb, var(--c-ink) 45%, transparent); }
.how-hero__cta { margin-top: 6px; }
.how-hero__stop { position: absolute; z-index: 6; right: var(--gutter); top: 96px; }
@media (max-width: 760px) {
  .how-hero { min-height: 0; }
  .how-hero__stage::after { background: linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 64%, transparent) 0%, color-mix(in srgb, var(--c-ink) 78%, transparent) 46%, color-mix(in srgb, var(--c-ink) 40%, transparent) 70%, color-mix(in srgb, var(--c-ink) 70%, transparent) 100%); }
  .how-hero__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 112px; padding-bottom: 56px; }
  .how-hero__body { order: -1; justify-self: start; gap: 16px; }
  .how-hero__title { font-size: clamp(2.05rem, 1.2rem + 3.6vw, 2.6rem); }
  .how-hero__line { font-size: 1.0625rem; }
  .how-hero__scene { height: 300px; }
  .how-hero__stop { top: 84px; right: 14px; }
}

/* ---------- yours: the owner's three steps, three emerald-glass cards over her photo, the stream along their tops ---------- */
.how-yours { position: relative; overflow: hidden; padding-block: clamp(96px, 9vw, 140px) clamp(80px, 7vw, 112px); color: var(--c-on-ink); }
.how-yours__photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 70% 35%; }
/* deep emerald behind the heading and the cards, her face clear at the top right */
.how-yours__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-ink) 58%, transparent) 0%, color-mix(in srgb, var(--c-ink) 24%, transparent) 30%, color-mix(in srgb, var(--c-ink) 52%, transparent) 50%, color-mix(in srgb, var(--c-ink) 88%, transparent) 100%),
              linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 72%, transparent) 0%, color-mix(in srgb, var(--c-ink) 30%, transparent) 46%, transparent 64%); }
.how-yours__in { position: relative; }
/* the heading leaves a lane on its left for the stream coming down to step 1, and room above the cards for her face */
.how-yours__head { padding-left: 74px; max-width: 640px; margin-bottom: clamp(150px, 15vw, 220px); }
.how-yours__head h2 { font-size: clamp(1.9rem, 1.2rem + 1.9vw, 2.7rem); }
.mine { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.mine__step { position: relative; display: grid; padding-top: 34px; min-width: 0; }
.mine__num { left: 22px; top: 0; }
.mine__card { box-sizing: border-box; display: grid; grid-template-rows: auto auto 1fr; gap: 10px; min-width: 0; padding: 30px 24px 24px; border-radius: 28px; }
.mine__title { font-size: clamp(1.3rem, 1.1rem + 0.5vw, 1.55rem); }
.mine__line { color: color-mix(in srgb, var(--c-on-ink) 86%, transparent); }
.mine__stage { display: grid; align-items: end; justify-items: center; min-height: 300px; margin-top: 8px; }
.mine__stage > [data-scene] { width: 100%; }
/* where the stream leaves the owner's part: just right of the third card, at the cards' foot */
.how-yours__drop { position: absolute; right: calc(var(--gutter) - 30px); bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--c-brand); box-shadow: 0 0 0 calc(var(--lit, 0) * 6px) color-mix(in srgb, var(--c-brand) 26%, transparent); }
/* the stop stands on her photo just above the cards' right end, outside the frosted glass (nothing with a backdrop-filter
   of its own goes inside a .glass card: F4) and outside the phone's sideways row (so it stays in view as it scrolls) */
.mine-wrap { position: relative; }
.how-yours__stop { position: absolute; z-index: 6; right: 0; top: -54px; }
/* the month chips of step 3 in the ink: the scene's emerald on its pale chip was 4.45:1 */
.mine .mine__stage--leadbars [data-scene="leadbars"] { --lb-chip-ink: var(--c-ink); }
@media (max-width: 980px) {
  /* the heading stands on the ink; her photo fills the rest, her face in its top part (the face with hair and chin is
     15 to 49% of the photo's height, so 600 px of room) and the cards at its foot. The photo is drawn 2750 px wide (its
     file is 2560) from where her face shows (--face-x), so its box reaches under every card of the sideways row */
  .how-yours { --face-x: 560px; padding-top: 72px; padding-bottom: 0; }
  .how-yours__head { padding-left: 0; max-width: 560px; margin-bottom: 600px; }
  .how-yours__photo, .how-yours__shade { top: 210px; bottom: 0; }
  .how-yours__photo { left: calc(var(--face-x) - 1911px); width: 2750px; height: calc(100% - 210px); object-position: 50% 100%; }
  .how-yours__shade { height: auto; background: linear-gradient(180deg, var(--c-ink) 0, transparent 90px, transparent 540px, color-mix(in srgb, var(--c-ink) 50%, transparent) 640px, color-mix(in srgb, var(--c-ink) 78%, transparent) 100%); }
  /* the three cards stand on her photo as a sideways row, the next one peeking in */
  .mine { display: flex; gap: 14px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 64px; scroll-padding-inline: var(--gutter); }
  .mine::-webkit-scrollbar { display: none; }
  .mine__step { flex: 0 0 min(84%, 400px); scroll-snap-align: start; }
  .mine__stage { min-height: 0; }
  .how-yours__drop { display: none; }
}
@media (max-width: 760px) {
  .how-yours { --face-x: 195px; padding-top: 64px; }
  .how-yours__head { max-width: none; }
}

/* ---------- ours: steps 4 to 6, one HVAC company's days, framed photos on alternating sides ---------- */
/* the light bands are not positioned: their ground paints under the line, their frames and numbers over it */
.how-ours { background: var(--c-paper); padding-block: var(--section-y) 0; }
.how-ours--next { padding-top: clamp(72px, 7vw, 108px); }
#ours-6 { padding-bottom: var(--section-y); }
.how-ours__head { max-width: 560px; margin-bottom: clamp(56px, 6vw, 84px); }
.how-ours__head h2 { font-size: clamp(1.9rem, 1.2rem + 1.9vw, 2.7rem); }
.row { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.row--right .row__words { order: -1; }
.row--left { grid-template-columns: minmax(0, 1.38fr) minmax(0, 0.62fr); }
.row__media { position: relative; padding-top: 22px; }
.row__num { left: 50%; top: 0; margin-left: -22px; }
.row__frame { position: relative; margin: 0; height: 520px; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); }
.row__photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.row__stage { position: absolute; width: min(320px, 44%); }
.row__stage > [data-scene] { width: 100%; }
.row__stage--launch { left: 20px; top: 20px; }
.row__stage--leads { left: 20px; bottom: 20px; width: min(380px, 48%); }
.row__stage--tune { left: 20px; top: 20px; }
#ours .row__photo { object-position: 60% 50%; }
#ours-5 .row__photo { object-position: 50% 40%; }
#ours-6 .row__photo { object-position: 60% 50%; }
.row__stop { position: absolute; z-index: 3; right: 14px; top: 36px; }
.row__words { display: grid; gap: 14px; max-width: 440px; }
.row__title { font-size: clamp(1.7rem, 1.1rem + 1.5vw, 2.3rem); }
.row__line { font-size: 1.125rem; line-height: 1.55; color: var(--c-ink-soft); }
@media (max-width: 980px) {
  .row, .row--left { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .row--right .row__words { order: 0; }
  .row__words { order: -1; }
  .row__frame { height: 560px; }
}
@media (max-width: 760px) {
  /* on the phone the photo fills the frame and the scene stands on its foot, the face kept above it */
  .row__frame { height: 620px; }
  .row__stage, .row__stage--launch, .row__stage--leads, .row__stage--tune { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; }
  /* the board's rows keep their whole words on a phone: less room around the board */
  .row__stage--leads [data-scene="leads"] { padding: 8px; }
  .row__stage--leads [data-scene="leads"] .ld-board { padding: 11px; }
  #ours .row__photo { object-position: 30% 50%; }
  #ours-5 .row__photo { object-position: 52% 20%; }
  #ours-6 .row__photo { object-position: 56% 30%; }
}

/* ---------- inside: what the free plan holds, built over the plumber's evening at his desk ---------- */
.how-inside { background: var(--c-paper-alt); padding-block: var(--section-y); }
.how-inside__words { display: grid; gap: 28px; max-width: 600px; margin-bottom: clamp(56px, 6vw, 84px); }
.how-inside__media { position: relative; padding-top: 22px; }
/* the stream comes down beside the words and lands above the plan */
.how-inside__mark { top: 0; right: calc(24px + 240px - 22px); }
.how-inside__frame { position: relative; margin: 0; height: 760px; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); }
.how-inside__photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 30%; }
.how-inside__stage { position: absolute; top: 24px; right: 24px; bottom: 24px; width: 480px; }
.how-inside__stage > [data-scene] { position: absolute; inset: 0; }
.how-inside__stop { position: absolute; z-index: 3; left: 16px; top: 38px; }
@media (max-width: 1100px) {
  .how-inside__mark { right: calc(24px + 200px - 22px); }
  .how-inside__stage { width: 400px; }
}
@media (max-width: 760px) {
  /* on the phone the frame shows his laptop and hand, the plan standing on it whole */
  .how-inside__frame { height: 760px; }
  .how-inside__photo { object-position: 73% 50%; }
  .how-inside__stage { left: 12px; right: 12px; top: 12px; bottom: 12px; width: auto; }
  .how-inside__mark { right: calc(50% - 22px); }
}

/* ---------- team: a person one tap away, on the owner's dashboard in a real hand ---------- */
.how-team { background: var(--c-paper); padding-block: var(--section-y); }
.how-team__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: clamp(40px, 6vw, 96px); align-items: center; }
.how-team__words h2 { font-size: clamp(1.9rem, 1.2rem + 1.9vw, 2.7rem); }
.how-team__media { position: relative; padding-top: 22px; }
.how-team__mark { top: 0; left: 50%; margin-left: -22px; }
.how-team__frame { position: relative; height: 660px; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); box-shadow: var(--shadow-l); }
/* the photo is drawn 1.44 times the frame, around the phone, so the dashboard's words on its screen read at 13 px or
   more (at the frame's own size the screen was 172 px wide and the smallest words 10.6 px) */
.how-team__photo { position: absolute; inset: -22%; margin: 0; }
.how-team__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 66% 50%; }
.how-team__stop { position: absolute; z-index: 3; right: 14px; top: 36px; }
@media (max-width: 980px) {
  .how-team__grid { grid-template-columns: minmax(0, 1fr); }
  .how-team__media { max-width: 560px; }
}
@media (max-width: 760px) {
  .how-team__frame { height: 620px; }
}

/* ---------- FAQ: the stream runs down the left margin beside it, to the close ---------- */
.how-faq__grid { position: relative; }
.how-faq__rail { position: absolute; left: -36px; width: 2px; height: 2px; }
.how-faq__rail--top { top: 0; }
.how-faq__rail--bottom { bottom: 0; }

/* ---------- close: the contractor at dusk before the house he is framing; the stream ends in the button ---------- */
.how-close { isolation: auto; background: none; }
.how-close .band__film { object-position: 50% 30%; }
.how-close__cta { margin-top: 4px; }
@media (max-width: 760px) {
  .how-close .band__film { height: 440px; bottom: auto; object-position: 70% 30%; }
}
