/* how-it-works.css: the How it works page: the thread (arsenal, never edited) with the site's chain of flags, the
   rail that holds every step number, and each part's layout, with the tokens of system.css and design\components.css. */
@import url("../arsenal/thread.css");

/* ---------- The thread: the page's ground under the line; a part's own ground on a layer beneath it ---------- */
.hiw-thread { --thread-ink: var(--c-brand); --thread-track-ink: var(--c-line-ink-strong); --thread-bg: var(--c-ground); --thread-link: 11px; --thread-gap: 15px; --rail: 4.5rem; background: var(--c-ground); }
.hiw-thread > .band { background: none; }
.hiw-thread > .ground-lit::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--ground-lit); }
.hiw-thread > .ground-lit::after { z-index: -1; }
.hiw-thread > .ground-lit > .wrap { z-index: auto; }

/* ---------- The rail: one column at the left of every part, the chain runs straight down it ---------- */
.hiw-rail { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); column-gap: clamp(1rem, 2.4vw, 2rem); }
.hiw-rail > * { grid-column: 2; }
.hiw-rail > .hiw-steps, .hiw-rail > .hiw-handover { grid-column: 1 / -1; }
.hiw-rail > .hiw-node { grid-column: 1; }
.hiw-head { text-align: left; margin-inline: 0; }
.hiw-num { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; justify-self: center; }
.hiw-num svg { grid-area: 1 / 1; width: 100%; height: auto; overflow: visible; fill: color-mix(in srgb, var(--c-brand) calc(var(--lit, 0) * 100%), var(--c-ground-3)); stroke: var(--c-brand); stroke-width: 0.6; transition: fill 0.2s; }
.hiw-num b { grid-area: 1 / 1; position: relative; font: 700 1.125rem/1 var(--font-display); color: color-mix(in srgb, var(--c-on-brand) calc(var(--lit, 0) * 100%), var(--c-on-ink)); transform: translateX(0.15rem); }
.hiw-num::after { content: ''; grid-area: 1 / 1; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--c-brand); opacity: calc((1 - var(--lit-after, 0)) * var(--lit, 0) * 0.8); transform: scale(calc(0.7 + var(--lit-after, 0) * 0.9)); pointer-events: none; }
.hiw-node { display: grid; place-items: center; grid-column: 1; width: 2.75rem; height: 2.75rem; justify-self: center; border-radius: 50%; background: var(--c-ground-2); border: 1px solid var(--c-line-ink-strong); }
.hiw-node svg { fill: var(--c-brand); opacity: calc(0.45 + var(--lit, 0) * 0.55); }
.hiw-node--big { width: 3.5rem; height: 3.5rem; }

/* a part's stop icon, beside its first moving picture */
.hiw-stop { top: 0.75rem; right: 0.75rem; }

/* ---------- Header: the words centered on top, the photo band under them, the week filling in glass on its left ---------- */
.hiw-hero { padding-top: clamp(3rem, 7vw, 5.5rem); }
.hiw-hero__words { display: grid; justify-items: center; text-align: center; gap: var(--space-2); padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.hiw-hero .page-title { max-width: 17ch; }
.hiw-hero .page-lede { margin-inline: auto; }
.hiw-hero .cta-row { margin-top: var(--space-3); }
.hiw-hero__band { position: relative; height: clamp(30rem, 64vh, 44rem); overflow: clip; }
.hiw-hero__photo { position: absolute; inset: 0; }
.hiw-hero__photo .fill { object-position: 60% 50%; }
.hiw-hero__photo::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgb(13 27 42 / 0.62), rgb(13 27 42 / 0.2) 45%, transparent 70%), linear-gradient(180deg, var(--c-ground) 0%, transparent 18%); }
.hiw-hero__over { position: relative; height: 100%; display: grid; align-items: center; }
.scene.hiw-hero__cal { width: min(540px, 48%); }
@media (max-width: 759px) {
  /* on a phone the card stays on its photo: the band grows, the hands and the phone above, the week over the table */
  .hiw-hero__band { height: clamp(31rem, 132vw, 38rem); }
  .hiw-hero__photo .fill { object-position: 64% 30%; }
  .hiw-hero__photo::after { background: linear-gradient(180deg, var(--c-ground) 0%, transparent 14%, transparent 42%, rgb(13 27 42 / 0.55) 100%); }
  .hiw-hero__over { position: absolute; left: 0; right: 0; bottom: 1rem; height: auto; display: block; }
  .scene.hiw-hero__cal { width: 100%; }
  .hiw-hero__stop { top: 1rem; bottom: auto; }
}

/* ---------- The steps: number in the rail, the words, the scene ---------- */
.hiw-steps { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: clamp(2.5rem, 6vw, 4.5rem); }
.hiw-step { display: grid; grid-template-columns: var(--rail) minmax(0, 0.85fr) minmax(0, 1.15fr); column-gap: clamp(1rem, 2.4vw, 2rem); align-items: start; }
.hiw-step > .hiw-num { grid-column: 1; }
.hiw-step__words { grid-column: 2; display: grid; gap: var(--space-2); align-content: start; padding-top: 0.6rem; }
.hiw-step__title { font-size: var(--fs-h3); letter-spacing: -0.015em; }
.hiw-step__line { color: var(--c-on-ink-soft); max-width: 30rem; }
.hiw-step__time { justify-self: start; margin-top: var(--space-1); font-size: 0.875rem; font-weight: 600; color: var(--c-brand-on-ink, var(--c-brand)); }
.hiw-step > .scene, .hiw-step > .hiw-shot, .hiw-step > .hiw-step__stage { grid-column: 3; }
.hiw-step__stage { position: relative; }
.scene.hiw-step__scene { height: 360px; }
.hiw-steps--ours .hiw-step { grid-template-columns: var(--rail) minmax(0, 0.78fr) minmax(0, 1.22fr); align-items: center; }
.hiw-steps--ours .hiw-step--flip { grid-template-columns: var(--rail) minmax(0, 1.22fr) minmax(0, 0.78fr); }
.hiw-step--flip .hiw-step__words { grid-column: 3; grid-row: 1; }
.hiw-step--flip > .hiw-shot { grid-column: 2; grid-row: 1; }
.hiw-steps--ours .hiw-num { align-self: center; }

/* the photo of a step, with its scene in glass over the free side */
.hiw-shot { position: relative; aspect-ratio: 4 / 3.3; border-radius: var(--radius-l); overflow: clip; box-shadow: var(--shadow-l); }
.hiw-shot > picture img, .hiw-shot > img { filter: saturate(calc(0.62 + var(--lit, 0) * 0.38)); }
.scene.hiw-shot__scene { position: absolute; left: 1rem; bottom: 1rem; width: min(380px, 60%); height: 330px; }
.hiw-shot--crew .scene.hiw-shot__scene { width: min(420px, 66%); height: 300px; }
.scene.hiw-shot__scene[data-scene="leads"] { transform: scale(1.1); transform-origin: left bottom; }
.hiw-stop--shot { left: 0.75rem; right: auto; }

/* the hand-over between the owner's part and ours */
.hiw-handover { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); column-gap: clamp(1rem, 2.4vw, 2rem); align-items: center; margin-bottom: var(--space-6); }
.hiw-handover__line { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; font: 600 1.0625rem/1.4 var(--font-display); }
.hiw-handover__line span { color: var(--c-on-ink-soft); }
.hiw-handover__line b { color: var(--c-on-ink); }

/* ---------- The plan, on the designed ground ---------- */
.hiw-plan__inner { grid-template-columns: var(--rail) minmax(0, 0.7fr) minmax(0, 1.3fr); align-items: center; }
.hiw-plan__inner > .hiw-node { align-self: start; margin-top: 0.4rem; }
.hiw-plan__words { grid-column: 2; display: grid; gap: var(--space-3); align-self: start; }
.hiw-plan__stage { grid-column: 3; position: relative; }
.scene.hiw-plan__scene { height: 560px; }

/* ---------- The team ---------- */
.hiw-team__inner { grid-template-columns: var(--rail) minmax(0, 0.75fr) minmax(0, 1.25fr); align-items: center; }
.hiw-team__inner > .hiw-node { align-self: start; margin-top: 0.4rem; }
.hiw-team__words { grid-column: 2; display: grid; gap: var(--space-3); align-self: start; }
.hiw-team__frame { grid-column: 3; position: relative; aspect-ratio: 4 / 3.2; border-radius: var(--radius-l); overflow: clip; box-shadow: var(--shadow-l); }
.hiw-team__frame .fill { object-position: 70% 30%; }
.hiw-team__chat { position: absolute; left: 1rem; bottom: 1rem; }

/* ---------- FAQ (as the home page's) ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.faq__grid .section-head { position: sticky; top: 6.5rem; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1099px) {
  .hiw-step, .hiw-steps--ours .hiw-step, .hiw-steps--ours .hiw-step--flip, .hiw-plan__inner, .hiw-team__inner { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .hiw-steps--ours .hiw-num { align-self: start; }
  .hiw-step > .scene, .hiw-step > .hiw-shot, .hiw-step > .hiw-step__stage, .hiw-step--flip .hiw-step__words, .hiw-step--flip > .hiw-shot { grid-column: 2; grid-row: auto; }
  .hiw-step > .scene, .hiw-step > .hiw-shot, .hiw-step > .hiw-step__stage { margin-top: var(--space-4); }
  .hiw-plan__stage, .hiw-team__frame { grid-column: 2; margin-top: var(--space-5); }
}
@media (max-width: 899px) {
  .faq__grid { grid-template-columns: 1fr; }
  .faq__grid .section-head { position: static; margin-bottom: var(--space-3); }
}
@media (max-width: 699px) {
  .hiw-thread { --rail: 2.75rem; }
  .hiw-num { width: 2.6rem; height: 2.6rem; }
  .hiw-num b { font-size: 0.9375rem; }
  .hiw-step > .scene, .hiw-step > .hiw-shot, .hiw-step > .hiw-step__stage, .hiw-step--flip > .hiw-shot, .hiw-plan__stage, .hiw-team__frame { grid-column: 1 / -1; }
  .scene.hiw-step__scene { height: 380px; }
  /* the cards stay on their photos: a tall frame, the faces at its top, the card over its lower part */
  .hiw-shot { aspect-ratio: auto; height: 36rem; }
  .scene.hiw-shot__scene, .hiw-shot--crew .scene.hiw-shot__scene { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; width: auto; height: 330px; }
  .scene.hiw-shot__scene[data-scene="leads"] { right: auto; width: calc((100% - 1.5rem) / 1.1); height: 290px; }
  .hiw-shot--spa .fill { object-position: 76% 10%; }
  .hiw-shot--crew .fill { object-position: 70% 10%; }
  .hiw-shot--law .fill { object-position: 56% 20%; }
  .scene.hiw-plan__scene { height: 700px; }
  .hiw-team__frame { aspect-ratio: auto; height: 38rem; }
  .hiw-team__frame .fill { object-position: 76% 18%; }
  .hiw-team__chat { left: 0.75rem; right: 0.75rem; bottom: 0.75rem; width: auto; }
}
