/* How it works (plan.md, "How it works"). Only the tokens of design\system.css. The page stands inside the thread:
   its parts are not positioned (the line runs over their grounds), what the line passes behind is opaque and lit. */
@import url("../arsenal/thread.css");

.thread.hiw { --thread-ink: var(--c-brand); --thread-bg: var(--c-paper); --thread-radius: 48px; }

/* photos that drift slowly: the page's JS pauses them off screen, the part's stop icon holds them */
@keyframes hiw-drift {
  from { transform: scale(var(--z0, 1.02)) translate3d(0, 0, 0); }
  to { transform: scale(var(--z1, 1.06)) translate3d(var(--dx, -.8%), var(--dy, -.4%), 0); }
}
.drift { transform-origin: var(--origin, 50% 50%); transform: scale(var(--z0, 1.02)); animation: hiw-drift 26s var(--ease-in-out) infinite alternate; will-change: transform; }
.drift[data-off], :is(section, [data-thread-light]):has(.stop[aria-pressed="true"]) .drift { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .drift { animation: none; } }

/* white cards for the scenes (design\brief.md: white where the work shows) */
.hiw .scene { --wy-card: var(--c-on-brand); --gl-card: var(--c-on-brand); --sn-card: var(--c-on-brand); --lb-card: var(--c-on-brand); --ln-card: var(--c-on-brand); --tn-card: var(--c-on-brand); --hc-phone: var(--c-on-brand); }

/* ---- hero: big words on cream, then a full-bleed band of the general shot: a phone face up on an oak table, new
   bookings arriving on its screen, the chat on a white card beside it; the band's top edge rises ---- */
.hiw-hero { padding-top: clamp(40px, 5vw, 72px); }
.hiw-hero__words { display: grid; gap: var(--space-2); justify-items: start; padding-bottom: clamp(40px, 4vw, 64px); }
.hiw-hero__title { max-width: 27ch; font-size: min(var(--fs-display), 8vh); }
.hiw-hero__line { max-width: 36em; font-size: calc(var(--fs-body) * 1.08); color: var(--c-ink-soft); }
.hiw-hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem var(--space-3); margin-top: var(--space-1); }
.hiw-hero__cta .btn-note { margin-top: 0; }
.hiw-band { --edge: clamp(40px, 5.5vw, 80px); height: max(620px, 43vw); overflow: hidden; background: var(--c-paper-alt); clip-path: polygon(0 var(--edge), 100% 0, 100% 100%, 0 100%); }
.hiw-band__media { position: absolute; inset: 0; overflow: hidden; }
/* the photo keeps its own shape, at least 1490 px wide so the phone's screen is 250 px or more, centered and cropped by
   the band (the screen's interface stays exactly on it: no object-fit crop) */
.hiw-band__photo { position: absolute; top: 50%; left: 50%; width: max(calc(100% + 2px), 930px); aspect-ratio: 6634 / 4480; margin: 0; translate: -50% -50%; --z0: 1.02; --z1: 1.06; --origin: 50% 50%; --dx: -.6%; --dy: -.3%; }
.hiw-band__photo > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.hiw-band__stop { position: absolute; z-index: 4; top: calc(var(--edge) * .25 + var(--space-2)); right: var(--gutter); }
.scene.hiw-band__chat { position: absolute; z-index: 3; top: 50%; left: calc(50% + clamp(150px, 13vw, 210px)); width: 340px; transform: translateY(-46%); }
/* the phone's lock screen, under the notifications */
.hiw-screen { position: absolute; inset: 0; overflow: hidden; background: var(--c-ink); color: var(--c-on-brand); font-family: var(--font-ui); }
.hiw-screen__time { margin: 26px 0 0; text-align: center; font-family: var(--font-display); font-size: 40px; font-weight: var(--fw-h3); line-height: 1; letter-spacing: -.02em; }
.hiw-screen__day { margin: 6px 0 0; text-align: center; font-size: 14px; font-weight: 600; }
.scene.hiw-screen__scene { position: absolute; left: 6px; right: 6px; top: 96px; height: 170px; }

/* ---- yours: the owner's three steps for Brightline, on the climbing stripe ---- */
.hiw-yours { padding-block: calc(var(--section-y) * .8) var(--section-y); }
.hiw-yours__top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; column-gap: var(--space-4); margin-bottom: var(--space-5); }
.hiw-yours__head { max-width: 34rem; margin: 0; }
.hiw-chip { grid-column: 2; display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 var(--space-1); padding: .65rem 1.2rem .65rem .65rem; border-radius: 999px; background: var(--c-brand-light); color: var(--c-ink); font-weight: 700; white-space: nowrap; box-shadow: var(--shadow-s); }
.hiw-chip__mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--c-brand); }
.hiw-chip__mark svg { width: 60%; height: 60%; fill: var(--c-on-brand); }
.hiw-yours__stage { position: relative; }
.hiw-yours__stop { position: absolute; z-index: 3; top: -52px; right: 0; }
.hiw-yours__ground { position: absolute; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); top: 8%; width: calc(100% + 2 * var(--gutter)); height: 84%; overflow: visible; }
.hiw-yours__band { fill: var(--c-brand-light); }
.hiw-yours__edge { fill: var(--c-accent); }
.hiw-yours__row { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; margin: 0; padding: 0; list-style: none; }
/* each step a panel: opaque, so the line runs behind it, never over its words */
.hiw-step { display: grid; gap: .5rem; align-content: start; padding: var(--space-3) var(--space-3) var(--space-3); border-radius: var(--radius-l); background: var(--c-paper); box-shadow: var(--shadow-m); }
.hiw-step--1 { margin-top: 200px; }
.hiw-step--2 { margin-top: 100px; }
.hiw-step__label { display: flex; align-items: center; gap: .7rem; }
.hiw-step__num { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--c-brand); color: var(--c-on-brand); font-family: var(--font-display); font-size: 1.25rem; font-weight: var(--fw-h2); }
.hiw-step__title { font-size: var(--fs-h3); font-weight: var(--fw-h3); }
.hiw-step__line { margin: 0 0 var(--space-1); color: var(--c-ink-soft); }
.hiw-step__card { display: grid; justify-items: center; }
.scene.hiw-step__scene { width: 100%; max-width: 420px; }
/* Step 1's chat holds the height its last message needs from the start, so nothing under it moves as it goes (step 13) */
.hiw-step--1 .scene.hiw-step__scene { min-height: 256px; }
@media (max-width: 374px) { .hiw-step--1 .scene.hiw-step__scene { min-height: 276px; } }

/* ---- ours: Cobalt Creek's week, photo and words on either side of the line, each step's card on its photo ---- */
.hiw-ours { padding-block: var(--section-y); }
.hiw-ours__head { max-width: 34rem; }
.hiw-ours__stop { position: absolute; z-index: 3; top: var(--space-2); right: var(--space-2); }
.hiw-ours__list { display: grid; gap: clamp(56px, 7vw, 104px); margin: 0; padding: 0; list-style: none; }
.hiw-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; }
.hiw-row__num { grid-column: 2; grid-row: 1; justify-self: center; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--c-brand); color: var(--c-on-brand); font-family: var(--font-display); font-size: 1.5rem; font-weight: var(--fw-h2); box-shadow: 0 0 0 6px var(--c-paper); }
.hiw-row__photo { grid-row: 1; aspect-ratio: 4 / 3.1; border-radius: var(--radius-l); overflow: hidden; background: var(--c-paper-alt); }
.hiw-row--l .hiw-row__photo { grid-column: 1; }
.hiw-row--r .hiw-row__photo { grid-column: 3; }
.hiw-row__photo > img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }
.hiw-row__text { grid-row: 1; display: grid; gap: .6rem; max-width: 26rem; }
.hiw-row--l .hiw-row__text { grid-column: 3; padding-left: var(--space-3); }
.hiw-row--r .hiw-row__text { grid-column: 1; justify-self: end; padding-right: var(--space-3); }
.hiw-row__title { font-size: var(--fs-h3); font-weight: var(--fw-h3); }
.hiw-row__text p { color: var(--c-ink-soft); }
.scene.hiw-row__scene { position: absolute; z-index: 2; width: min(340px, 58%); }
.hiw-row__photo--l .scene.hiw-row__scene { left: var(--space-3); top: 50%; transform: translateY(-50%); }
.hiw-row__photo--bl .scene.hiw-row__scene { left: var(--space-3); bottom: var(--space-3); }

/* ---- inside: Larkspur Family Law's plan on the paper, over her laptop ---- */
.hiw-inside { padding-block: var(--section-y); }
.hiw-inside__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-5); align-items: center; }
.hiw-inside__words { max-width: 30rem; }
.hiw-inside__frame { --edge: clamp(28px, 3.6vw, 52px); min-height: 600px; border-radius: var(--radius-l); overflow: hidden; background: var(--c-paper-alt); clip-path: polygon(0 var(--edge), 100% 0, 100% 100%, 0 100%); }
.hiw-inside__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 30% 40%; }
.hiw-inside__stop { position: absolute; z-index: 3; top: calc(var(--edge) * .5 + var(--space-1)); right: var(--space-2); }
.scene.hiw-inside__scene { position: absolute; z-index: 2; left: var(--space-3); bottom: var(--space-3); width: min(440px, 60%); }

/* ---- team: Bluestem's owner and her dashboard chat ---- */
.hiw-team { padding-block: var(--section-y); }
.hiw-team__in { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-5); align-items: center; }
.hiw-team__frame { --edge: clamp(28px, 3.6vw, 52px); min-height: 560px; border-radius: var(--radius-l); overflow: hidden; background: var(--c-paper-alt); clip-path: polygon(0 var(--edge), 100% 0, 100% 100%, 0 100%); }
.hiw-team__img { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 40% 50%; }
.hiw-team__stop { position: absolute; z-index: 3; top: calc(var(--edge) * .5 + var(--space-1)); right: var(--space-2); }
.hiw-team__words { max-width: 28rem; }
.hiw-dash { position: absolute; z-index: 2; right: var(--space-2); bottom: var(--space-3); width: min(300px, 44%); display: grid; gap: .6rem; padding: var(--space-2) var(--space-2) var(--space-3); border-radius: var(--radius-l); background: var(--c-on-brand); color: var(--c-ink); box-shadow: var(--shadow-l); font-size: var(--fs-small); }
.hiw-dash p { margin: 0; }
.hiw-dash [data-kit-at] { opacity: var(--kit-in, 1); }
/* each line lands once when its time comes and stays; as the loop starts again it is simply gone, never taken back (step 13) */
.hiw-dash [data-kit-at][data-kit-on] { opacity: 1; animation: hiw-dash-land .5s var(--ease-out) both; }
@keyframes hiw-dash-land { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .hiw-dash [data-kit-at][data-kit-on] { animation: none; } }
.hiw-dash__head { display: grid; gap: .1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--c-line); }
.hiw-dash__head b { font-family: var(--font-display); font-size: 1.05rem; font-weight: var(--fw-h3); }
.hiw-dash__head span { color: var(--c-ink-soft); }
.hiw-dash__btn { justify-self: start; padding: .45rem .9rem; border-radius: 999px; background: var(--c-brand); color: var(--c-on-brand); font-weight: 700; }
.hiw-dash__msg { max-width: 88%; padding: .55rem .8rem; border-radius: var(--radius-m); line-height: 1.35; }
.hiw-dash__msg--me { justify-self: end; background: var(--c-brand-light); }
.hiw-dash__msg--team { justify-self: start; display: grid; gap: .3rem; background: var(--c-paper-alt); }
.hiw-dash__msg--team b { font-size: .8125rem; color: var(--c-brand-text); }

/* ---- the questions and the close ---- */
.hiw-faq .faq__item { background: var(--c-paper); }
/* the close's clip starts behind the block's edge, so the patient arriving at the desk shows beside the receptionist */
.hiw-close .close__media { left: 40%; }
.hiw-close .close__media > video { object-position: var(--pos, 0% 40%); }
@media (max-width: 860px) { .hiw-close .close__media { left: auto; } .hiw-close .close__media > video { object-position: var(--pos-m, 40% 40%); } }

/* ---- narrow screens ---- */
@media (max-width: 1100px) {
  .hiw-yours__top { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-3); }
  .hiw-chip { grid-column: 1; justify-self: start; }
  .hiw-yours__row { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; }
  .hiw-step--1, .hiw-step--2 { margin-top: 0; }
  .hiw-yours__ground { display: none; }
  .hiw-inside__in, .hiw-team__in { grid-template-columns: minmax(0, 1fr); }
  .hiw-team__words { order: -1; }
}
@media (max-width: 860px) {
  .hiw-row, .hiw-row--l, .hiw-row--r { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-2); }
  .hiw-row__num { grid-column: 1; grid-row: 1; justify-self: start; }
  .hiw-row--l .hiw-row__photo, .hiw-row--r .hiw-row__photo { grid-column: 1; grid-row: 3; }
  .hiw-row--l .hiw-row__text, .hiw-row--r .hiw-row__text { grid-column: 1; grid-row: 2; justify-self: start; padding: 0; }
}
@media (max-width: 760px) {
  .hiw-band { height: auto; padding-top: 0; }
  /* the phone on top, the chat's card overlapping the oak under it: more than half of the card on the photo */
  .hiw-band__media { position: relative; inset: auto; height: 833px; }
  .hiw-band__photo { top: -180px; width: 1500px; translate: -50% 0; }
  .scene.hiw-band__chat { position: relative; top: auto; left: auto; width: auto; max-width: 340px; margin: -217px auto var(--space-4); transform: none; }
  .hiw-row__photo { aspect-ratio: auto; height: 560px; }
  .scene.hiw-row__scene, .hiw-row__photo--l .scene.hiw-row__scene, .hiw-row__photo--bl .scene.hiw-row__scene { left: .75rem; right: .75rem; top: auto; bottom: .75rem; width: auto; transform: none; }
  .hiw-inside__frame, .hiw-team__frame { min-height: 0; height: 620px; }
  /* Her face sits at 38-52% of the photo's height: the photo drawn taller and raised keeps it above the dashboard
     card, in a frame short enough that the stop icon and the card fit in one view. */
  .hiw-team__frame { height: 660px; }
  .hiw-team__img { top: -170px; height: 820px; }
  .hiw-inside__img { object-position: 58% 40%; }
  .scene.hiw-inside__scene { left: .75rem; right: .75rem; width: auto; }
  .hiw-dash { left: .75rem; right: .75rem; width: auto; }
}
