@import url("../arsenal/thread.css");
/* how-it-works.css: places and sizes the page's parts (plan.md, "How it works"), with system.css's tokens. The header
   and the close are the shared components (components.css). */

/* the main button and its note (the header and the close) */
.hero__cta, .close__cta { margin-top: var(--space-4); }
.cta-note { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: color-mix(in srgb, var(--c-on-ink) 78%, transparent); }

/* The signature: one line through the page (the arsenal's `thread`, in the site's mark, its zigzag the spike line's).
   The composition draws its line under every part; here the parts are bands, and the header and the close lay their
   clips in positioned boxes, which would cover it. So the line stands over the bands and the clips (z-index 4), and
   what it plugs into or passes behind stands over it (5): the buttons, the numbers, the goal, the step photos, the
   board and the laptop; the header's words and the close's words are 5 too, so it never crosses a word. */
.hw-thread { --thread-amp: 6px; --thread-wave: 26px; --thread-w: 2.5px; --thread-tail: 80px; }
.hw-thread > .thread__svg { z-index: 4; }
.hw-thread [data-thread-light], .hw-thread [data-thread-anchor] { position: relative; z-index: 5; }
/* a step's number fills with the brand as the head plugs in, and one ring spreads from it */
.hw-num {
  justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  border: 2px solid var(--c-brand); font: 800 1.3rem/1 var(--font-display); color: var(--c-ink);
  background: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--c-paper));
}
.hw-num::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-brand); opacity: calc((1 - var(--lit-after, 1)) * var(--lit, 0)); transform: scale(calc(1 + var(--lit-after, 0) * .8)); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .hw-num::after { display: none; } }

/* 1. Header: a hand circling days on a printed calendar, two stretches of one shot (the hand comes in from the top at
   20 to 65% across, the circle at 55 to 68%); the words low at the left, on the ink rising from the corner; the growth
   plan chat's phone at the right, over the calendar's red days, clear of the hand. The line leaves the button at its
   right and turns down past its note. Under 1024 px the words stand first, the clip under them, the phone overlapping
   its foot. */
.hw-top { align-items: end; }
.hw-top .hero__stage::after {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--c-ink) 92%, transparent) 0%, color-mix(in srgb, var(--c-ink) 74%, transparent) 30%, color-mix(in srgb, var(--c-ink) 20%, transparent) 50%, transparent 60%),
    linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 78%, transparent) 0%, transparent 52%);
}
.hw-top .hero__words { padding-block: var(--space-5) clamp(3rem, 8vh, 5.5rem); }
/* (the note beside the button: the line leaves the button's foot, and a note under it stood in its way) */
@media (min-width: 1024px) {
  .hw-top .hero__cta { display: flex; align-items: center; gap: var(--space-3); }
  .hw-top .hero__cta .cta-note { margin: 0; max-width: 12rem; }
}
.hw-top .hero__words h1 { max-width: 9.5em; }
.hw-top .hero__lede { max-width: 26em; }
/* (two classes: the base scene's own rule on its host sets position: relative) */
.hw-top .hw-top__chat { position: absolute; z-index: 5; top: 50%; right: max(var(--gutter), calc(50% - 640px)); translate: 0 -46%; width: 310px; height: 440px; }
@media (max-width: 1199px) { .hw-top .hw-top__chat { width: 290px; } }
@media (max-width: 1023px) {
  /* (stretch: the hero's own centring would shrink the stage, whose content is all placed, to no width) */
  .hw-top { display: flex; flex-direction: column; align-items: stretch; min-height: 0; }
  .hw-top .hero__words { order: -1; padding-block: var(--space-5) var(--space-4); }
  /* (the chat stands more than half on the clip, as at 1440: the clip runs on under it, the hand and its circle above it) */
  .hw-top .hero__stage { position: relative; inset: auto; height: 494px; }
  .hw-top .hero__stage::after { background: linear-gradient(180deg, var(--c-ink) 0%, transparent 18%), linear-gradient(0deg, var(--c-ink) 0%, transparent 30%); }
  .hw-top .hw-top__chat { position: relative; top: auto; right: auto; translate: none; order: 1; width: min(320px, 90%); height: 428px; margin: -224px auto var(--space-5); }
  .hw-top .hw-top__stop { right: var(--gutter); left: auto; top: 14px; bottom: auto; }
}

/* 2. Your part: the shop's owner with a tablet (hiw-part: his face at 42 to 62% across and 5 to 40% down; the tablet
   at the lower left), full width under the head; the goal at the left over the tablet, the scan at the right over the
   shop, both on the photo's foot, under his face at every width. The line comes down left of the head into the goal. */
.your { padding-bottom: 0; }
.your__head { margin-inline: auto; text-align: center; }
.your__head .lede { margin-inline: auto; max-width: 36rem; }
.your__stage { position: relative; height: clamp(720px, 56vw, 820px); overflow: hidden; }
.your__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0%; }
.your .your__cards { position: absolute; left: 0; right: 0; bottom: clamp(24px, 3vw, 44px); display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.your__goal { width: 380px; }
.your .your__goalscene { width: 100%; }
.your .your__scan { position: relative; z-index: 5; width: 400px; }
.your__stop { position: absolute; z-index: 6; top: 18px; right: var(--gutter); }
@media (max-width: 1023px) {
  .your__goal { width: calc(50% - 12px); max-width: 380px; }
  .your .your__scan { width: calc(50% - 12px); max-width: 400px; }
}
@media (max-width: 699px) {
  .your__stage { height: 1150px; }
  .your__img { object-position: 52% 0%; }
  .your .your__cards { flex-direction: column; align-items: stretch; gap: 12px; padding-inline: 12px; bottom: 16px; }
  .your__goal, .your .your__scan { width: auto; max-width: none; }
}

/* 3. The steps, each its own band so the line turns in the gaps between them: the photo with its step's card in glass,
   the number between, the words beside; the second step turned the other way. Each photo 6 : 5, its card clear of
   faces: the plan over the wall at the right of the owner reading (hiw-step1), the launch at the left of the mechanic
   under the car (hiw-step2, his face at 66 to 77% across), the tuning at the foot left, over the mechanic's shirt,
   under his face (hiw-step3, the faces at 28% and 73% across and 15 to 35% down). */
.step { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.step--1 { padding-top: var(--section-y); }
.step--3 { padding-bottom: var(--section-y); }
.steps__head { max-width: 40rem; margin-bottom: clamp(var(--space-4), 4vw, var(--space-5)); }
.step__row { display: grid; grid-template-columns: minmax(0, 7fr) 72px minmax(0, 5fr); gap: clamp(1.25rem, 3vw, 3rem); align-items: center; }
.step--2 .step__row { grid-template-columns: minmax(0, 5fr) 72px minmax(0, 7fr); }
.step__frame { position: relative; aspect-ratio: 6 / 5; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-m); background: var(--c-ink); }
.step__frame > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.step--1 .step__frame > img { object-position: 76% 50%; }
.step--2 .step__frame > img { object-position: 70% 50%; }
.step--3 .step__frame > img { object-position: 50% 30%; }
.step .step__scene { position: absolute; z-index: 2; }
.step .step__scene--1 { top: 50%; right: 3%; translate: 0 -50%; width: min(340px, 47%); }
.step .step__scene--2 { top: 50%; left: 3%; translate: 0 -50%; width: min(330px, 47%); height: 300px; }
/* (its changes short enough for one line each: wrapped, the card stood up to the man's chin; and narrow enough to
   leave the keys between their hands in view) */
.step .step__scene--3 { left: 3%; bottom: 3%; width: min(290px, 44%); }
.step__stop { position: absolute; z-index: 3; top: 12px; right: 12px; }
.step--2 .step__stop { right: auto; left: 12px; }
.step__words h3 { margin: 0 0 var(--space-2); font: 700 clamp(1.35rem, 1rem + 1vw, 1.75rem)/1.2 var(--font-display); letter-spacing: -.01em; }
.step__words p { margin: 0; max-width: 26rem; color: var(--c-ink-soft); font-size: var(--fs-lede, 1.1rem); }
@media (max-width: 899px) {
  .step__row, .step--2 .step__row { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "num words" "frame frame"; gap: var(--space-3) var(--space-3); align-items: start; }
  .step__row > .hw-num { grid-area: num; }
  .step__words { grid-area: words; align-self: center; }
  .step__frame { grid-area: frame; }
}
@media (max-width: 699px) {
  .step__frame { aspect-ratio: auto; height: 720px; margin-inline: calc(12px - var(--gutter)); }
  .step--1 .step__frame > img { object-position: 38% 50%; }
  /* (the mechanic's face stands mid-height: the photo drawn taller, from its top, puts it under the card) */
  .step--2 .step__frame > img { inset: 0 auto auto 0; height: 140%; object-position: 72% 0%; }
  .step--3 .step__frame > img { object-position: 30% 30%; }
  .step .step__scene--1, .step .step__scene--3 { top: auto; bottom: 12px; left: 12px; right: 12px; translate: none; width: auto; }
  .step .step__scene--2 { top: 12px; left: 12px; right: 12px; translate: none; width: auto; height: 380px; }
}

/* 4. On your board: the shop's work orders on its pin board, the board's own world in its frame on the ink. Its host
   keeps the scene's shape: 820 x 520, upright (360 x 640) under 600 px of frame. */
.board__head { margin-inline: auto; text-align: center; }
.board__head .lede { margin-inline: auto; max-width: 34rem; }
.board__frame {
  max-width: 940px; margin-inline: auto; padding: clamp(10px, 1.4vw, 18px); border-radius: var(--radius-l); container-type: inline-size;
  background: radial-gradient(90% 70% at 72% 0%, color-mix(in srgb, var(--c-accent) 9%, transparent), transparent 70%), color-mix(in srgb, var(--c-on-ink) 4%, var(--c-ink));
  border: 1px solid color-mix(in srgb, var(--c-on-ink) 12%, transparent); box-shadow: var(--shadow-l);
}
.board__scene { aspect-ratio: 820 / 520; }
@container (width < 640px) { .board__scene { aspect-ratio: 360 / 640; } }
.board__stop { position: absolute; z-index: 3; top: 12px; right: 12px; }
@media (max-width: 599px) { .board__frame { margin-inline: calc(12px - var(--gutter)); padding: 6px; } }

/* 5. Who runs it: the laptop on the workbench (hiw-team, its screen placeable: 41.9% of the photo's width), drawn so
   its screen stands about 560 px wide on a computer and 350 on a phone (its words 14 px at 360 x 225: 13 or more), the
   shop's dashboard on it (team-feed). The words at the left; under 1024 px above the laptop. */
.team__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 4.5vw, 4.5rem); align-items: center; }
.team__words h2 { max-width: 11em; }
.team__words .lede { max-width: 26rem; margin: 0; }
.team__laptop { position: relative; margin: 0; height: 600px; overflow: hidden; border-radius: var(--radius-l); box-shadow: var(--shadow-m); background: var(--c-ink); }
.team__laptop > img { position: absolute; left: calc(50% - 856px); top: -55px; width: 1337px; height: 752px; max-width: none; }
.team__stop { position: absolute; z-index: 3; top: 14px; right: 14px; }
@media (max-width: 1023px) {
  .team__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
}
@media (max-width: 699px) {
  .team__frame { margin-inline: calc(-1 * var(--gutter)); }
  .team__laptop { height: 390px; border-radius: 0; }
  /* the laptop drawn lower than on a computer, so the stop icon at the frame's top right stands over the wall above
     its screen, never on the dashboard's "This week" (step 13) */
  .team__laptop > img { left: calc(50% - 535px); top: -4px; width: 835px; height: 470px; }
}

/* 6. Close: a phone on a bedside table in warm low light, lighting up with a new booking (hiw-close: the phone across
   17 to 80%, a third of the way up). The clip stands in the right 64% of the part, its left edge falling into the ink,
   and the words at the left, where the line arrives into the button from the left. Under 1200 px the clip is a band
   across the top and the words stand under it. */
.hw-close .close__in { z-index: 5; display: flex; flex-direction: column; align-items: flex-start; }
.hw-close .close__in > * { max-width: 26rem; }
.hw-close .close__media { inset: 0 0 0 auto; width: 64%; }
.hw-close .close__video { object-position: 50% 50%; }
.hw-close .close__media::after { background: linear-gradient(90deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 50%, transparent) 14%, transparent 34%), linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 35%, transparent), transparent 30%); }
@media (max-width: 1199px) {
  .hw-close { padding-block: 0 clamp(4.5rem, 8vw, 6.5rem); }
  .hw-close .close__media { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 9; max-height: 520px; }
  .hw-close .close__media::after { background: linear-gradient(0deg, var(--c-ink) 0%, color-mix(in srgb, var(--c-ink) 35%, transparent) 24%, transparent 48%); }
  .hw-close .close__in { margin-top: calc(-1 * var(--space-4)); }
  .hw-close .close__in > * { max-width: 30rem; }
  .hw-close .close__stop { top: 16px; }
}
@media (max-width: 599px) {
  .hw-close .close__media { aspect-ratio: 4 / 5; }
  .hw-close .close__video { object-position: 46% 50%; }
}
