@import url("../arsenal/thread.css");

/* How it works: places and sizes only. The thread runs as the logo's two bars, landing pair after pair (chain), down one
   lane: the nodes' column at the left. Below the steps that lane holds only photos it passes behind, never words, and
   it ends coming into the close's button from the left. */
.hiw-thread { --thread-link: 11px; --thread-gap: 19px; }
/* where the parts go to one column, the words come into the lane: a short line beside each step's part instead */
@media (max-width: 900px) { .hiw-thread { --thread-narrow: 1; } }

/* the parts take no stacking context and paint their grounds on a layer under the line, so it stays in sight over the
   ledger and the tinted part (the thread's README: a part must not cover the line) */
.hiw-thread > .sec--ledger { isolation: auto; background: none; }
.hiw-thread > .sec--alt { background: none; }
.hiw-thread > .sec--ledger::before, .hiw-thread > .sec--alt::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-color: var(--c-paper-alt); }
.hiw-thread > .sec--ledger::before { background-image: repeating-linear-gradient(180deg, transparent 0 47px, var(--c-line) 47px 48px); }
.hiw-yours { --thread-bg: var(--c-paper-alt); }

/* a step's node: a calendar entry with its time; white with a navy edge until the head plugs in, then navy */
.hiw-node {
  --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  grid-area: node;
  align-self: center;
  display: grid; place-content: center; gap: 3px;
  width: 64px; height: 64px;
  border-radius: 12px;
  border: 1.5px solid var(--c-brand);
  background: color-mix(in srgb, var(--c-brand) calc(var(--l) * 100%), var(--c-paper));
  color: color-mix(in srgb, var(--c-on-brand) calc(var(--l) * 100%), var(--c-brand));
  text-align: center;
  box-shadow: 0 0 0 6px var(--thread-bg), 0 12px 24px -12px color-mix(in srgb, var(--c-brand) calc(var(--l) * 70%), transparent);
}
/* as the head plugs in, one ring spreads out from the node and fades */
.hiw-node::after { content: ""; position: absolute; inset: -1.5px; border-radius: 13px; pointer-events: none; --a: var(--lit-after, 0);
  box-shadow: 0 0 0 calc((1 - (1 - var(--a)) * (1 - var(--a))) * 16px) color-mix(in srgb, var(--c-brand) calc((1 - var(--a)) * 24%), transparent); }
.hiw-node small { font: 600 0.8125rem/1 var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.85; }
.hiw-node b { font: 650 1.5rem/1 var(--font-display); letter-spacing: -0.02em; }

/* ---------- hero: words left, the planner tall on the right, the chat phone over its left edge ---------- */
.hiw-hero { padding: calc(var(--section-y) * 0.42) 0 calc(var(--section-y) * 0.7); }
.hiw-hero__in { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(2rem, 1rem + 4vw, 5.5rem); align-items: center; }
.hiw-hero__title { font-size: var(--fs-h1); line-height: var(--lh-tight); letter-spacing: var(--tracking-display); text-wrap: balance; }
.hiw-hero .lead { margin-top: var(--space-4); max-width: 34rem; }
/* the fear line beside the button, so the line leaves the button straight down through clear space */
.hiw-hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-5); }
.hiw-hero__cta .cta-note { margin: 0; max-width: 16rem; }
.hiw-hero__media { position: relative; }
.hiw-hero__frame { aspect-ratio: 4 / 5; }
.hiw-hero__frame img { object-position: 62% 50%; }
.hiw-hero__media > .hiw-hero__chat { position: absolute; z-index: 2; left: -118px; bottom: 26px; width: 300px; }
@media (max-width: 1100px) { .hiw-hero__media > .hiw-hero__chat { left: -60px; width: 280px; } }
@media (max-width: 900px) {
  .hiw-hero__in { grid-template-columns: minmax(0, 1fr); }
  .hiw-hero__media { margin: 0 0 120px; }
  .hiw-hero__frame { aspect-ratio: 4 / 4.2; }
  .hiw-hero__media > .hiw-hero__chat { left: 50%; bottom: -110px; width: min(300px, 84%); transform: translateX(-50%); }
}

/* ---------- the steps (yours and ours): the node in the lane at the left, the words, the picture ---------- */
.hiw-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(3.5rem, 2rem + 4vw, 6rem); }
.hiw-step { display: grid; grid-template-columns: 64px minmax(0, 5fr) minmax(0, 6fr); grid-template-areas: "node text stage"; column-gap: clamp(1.25rem, 0.5rem + 2.4vw, 3.25rem); align-items: center; }
.hiw-step__text { grid-area: text; }
.hiw-step__text h3 { font-size: var(--fs-h3); line-height: var(--lh-snug); letter-spacing: var(--tracking-h); }
.hiw-step__text p { margin-top: var(--space-2); color: var(--c-ink-soft); max-width: 30rem; }
.hiw-step__stage { grid-area: stage; position: relative; display: flex; justify-content: center; align-items: center; min-height: 240px; }
.hiw-step__stage > .stop { top: 0; right: 0; }
.hiw-step__scene { width: min(420px, 100%); }
.hiw-steps > .hiw-step:nth-child(3) .hiw-step__scene { width: min(560px, 100%); }

.hiw-step--photo { grid-template-columns: 64px minmax(0, 4fr) minmax(0, 7fr); grid-template-areas: "node text media"; }
.hiw-step--photo.hiw-step--l { grid-template-columns: 64px minmax(0, 7fr) minmax(0, 4fr); grid-template-areas: "node media text"; }
.hiw-ours__media { grid-area: media; position: relative; }
.hiw-ours__frame { aspect-ratio: 16 / 10.5; }
.hiw-ours__frame img { object-position: var(--pos, 50% 50%); }
.hiw-ours__media > .hiw-ours__scene { position: absolute; z-index: 2; top: 50%; width: min(400px, 56%); transform: translateY(-50%); }
.hiw-steps--ours > :nth-child(1) .hiw-ours__scene { left: 4%; }
.hiw-steps--ours > :nth-child(2) .hiw-ours__scene,
.hiw-steps--ours > :nth-child(3) .hiw-ours__scene { right: 4%; }
.hiw-ours__media > .stop { top: 12px; right: 12px; }
@media (max-width: 900px) {
  .hiw-step, .hiw-step--photo, .hiw-step--photo.hiw-step--l { grid-template-columns: 60px minmax(0, 1fr); grid-template-areas: "node text" "stage stage"; row-gap: var(--space-4); column-gap: var(--space-3); }
  .hiw-step--photo, .hiw-step--photo.hiw-step--l { grid-template-areas: "node text" "media media"; }
  .hiw-node { align-self: start; width: 60px; height: 56px; }
  .hiw-node small { font-size: 0.75rem; letter-spacing: 0.02em; }
  .hiw-node b { font-size: 1.25rem; }
  .hiw-step__stage { min-height: 0; }
  .hiw-steps > .hiw-step:first-child .hiw-step__stage { padding-top: 52px; }
  .hiw-ours__frame { aspect-ratio: 16 / 11; }
}
/* on a phone each card stays on its photo: a taller photo, the card over its lower part, the person above it */
@media (max-width: 700px) {
  .hiw-ours__frame { aspect-ratio: 4 / 5; }
  .hiw-ours__media > .hiw-ours__scene { position: relative; top: auto; left: auto !important; right: auto !important; width: auto; margin: -210px 12px 0; transform: none; }
}

/* ---------- inside: the photo upper left (the lane passes behind it), the words beside it, the plan being built
   below them, over the photo's lower right corner ---------- */
.hiw-inside__in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-rows: auto 1fr; column-gap: clamp(2rem, 1rem + 3vw, 4rem); }
.hiw-inside__frame { grid-column: 1; grid-row: 1 / 3; align-self: start; aspect-ratio: 4 / 3.5; }
.hiw-inside__frame img { object-position: 60% 30%; }
.hiw-inside__head { grid-column: 2; grid-row: 1; margin: 0; padding-top: clamp(0.5rem, 2vw, 2rem); }
.hiw-inside__in > .hiw-inside__scene { grid-column: 1 / 3; grid-row: 2; justify-self: end; position: relative; z-index: 2; width: min(660px, 60%); height: 560px; margin-top: 56px; }
/* its stop icon just over the plan's top right corner */
.hiw-inside__in > .stop { position: relative; top: auto; right: auto; grid-column: 2; grid-row: 2; justify-self: end; align-self: start; margin-top: 6px; }
@media (max-width: 900px) {
  .hiw-inside__in { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .hiw-inside__head { grid-column: 1; grid-row: 1; padding: 0; margin-bottom: var(--space-5); }
  .hiw-inside__frame { grid-column: 1; grid-row: 2; aspect-ratio: 4 / 3; }
  .hiw-inside__in > .hiw-inside__scene { grid-column: 1; grid-row: 3; justify-self: stretch; width: auto; height: 720px; margin: -48px 12px 0; }
  .hiw-inside__in > .stop { grid-column: 1; grid-row: 3; margin: -100px 12px 0 0; }
}

/* ---------- team: the owner's photo left (the lane passes behind it), three cards landing over its racks, the words
   right ---------- */
.hiw-team__in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(2rem, 1rem + 3vw, 4rem); align-items: center; }
.hiw-team__stage { grid-column: 1; grid-row: 1; aspect-ratio: 16 / 11; }
.hiw-team__head { grid-column: 2; grid-row: 1; margin: 0; }
.hiw-team__stage > img { object-position: 64% 30%; }
.hiw-team__cards { position: absolute; z-index: 2; left: 5%; top: 50%; width: min(330px, 50%); margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; transform: translateY(-50%); }
.hiw-team__cards [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.hiw-tcard { display: grid; gap: 6px; padding: 0.85rem 1rem; background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--radius-m); box-shadow: var(--shadow-l); }
.hiw-tcard small { font: 600 var(--fs-small)/1.2 var(--font-ui); color: var(--c-meta); }
.hiw-tcard b { font: 600 var(--fs-ui)/1.35 var(--font-ui); color: var(--c-ink); }
.hiw-tcard--reply { border-left: 3px solid var(--c-brand); }
.hiw-tcard__pill { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 1.1rem; border-radius: var(--radius-pill); background: var(--c-brand); color: var(--c-on-brand); font: 600 var(--fs-ui)/1 var(--font-ui); }
@media (max-width: 900px) {
  .hiw-team__in { grid-template-columns: minmax(0, 1fr); }
  .hiw-team__stage, .hiw-team__head { grid-column: auto; grid-row: auto; }
  .hiw-team__stage { aspect-ratio: 4 / 5; }
  .hiw-team__stage > img { object-position: 70% 30%; }
  .hiw-team__cards { top: auto; bottom: 14px; left: 12px; width: calc(100% - 24px); transform: none; gap: 8px; }
}

/* ---------- close: the words and the main button centered (the line comes into the button from the left), the
   carpenter's clip a wide framed band under them ---------- */
.hiw-close { text-align: center; }
.hiw-close__in > h2 { max-width: 18ch; margin-inline: auto; }
.hiw-close .lead { margin: var(--space-3) auto 0; max-width: 34rem; }
.hiw-close .button[data-thread-anchor] { --l: calc(var(--lit, 0) * var(--lit, 0) * (3 - 2 * var(--lit, 0)));
  box-shadow: 0 0 0 calc(var(--l) * 7px) color-mix(in srgb, var(--c-brand) 16%, transparent), 0 10px 24px -12px rgba(5, 10, 48, 0.55); }
.hiw-close__media { margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem); aspect-ratio: 1442 / 559; }
@media (max-width: 700px) { .hiw-close__media { aspect-ratio: 392 / 433; } }
