/* How it works: the thread's line through the six steps (plan.md, "How it works"). The components are in design\components.css. */
@import url("../arsenal/thread.css");

/* ---------- the line: a navy chain of the logo's D, on the white and sky bands (no navy band inside) ---------- */
.thread { --thread-ink: var(--c-navy); --thread-link: 12px; --thread-gap: 22px; }
/* the parts that lay their ground on a layer of their own lay it under the line, so the chain runs over it */
.thread > .ground, .thread > .close { isolation: auto; background: none; overflow: clip; }
.hiw-yours__fill { position: absolute; inset: 0; z-index: -2; background: var(--c-sky); }

/* an o-ring number on the line: it fills as the head plugs in, and gives one ring */
.hiw-num { display: grid; place-items: center; box-sizing: border-box; width: 64px; height: 64px; border: 8px solid var(--c-sky); border-radius: 50%; background: color-mix(in srgb, var(--c-navy) calc(var(--lit, 0) * 100%), var(--c-paper)); font-family: var(--font-display); font-size: 1.375rem; font-weight: var(--fw-display); line-height: 1; color: color-mix(in srgb, var(--c-paper) calc(var(--lit, 0) * 100%), var(--c-navy)); font-variant-numeric: tabular-nums; }
.hiw-num::after { content: ""; position: absolute; inset: -8px; border: 3px solid var(--c-navy); border-radius: 50%; opacity: calc((1 - var(--lit-after, 0)) * var(--lit, 0)); transform: scale(calc(1 + var(--lit-after, 0) * 0.7)); pointer-events: none; }
.band--sky .hiw-num { border-color: var(--c-navy); }

/* ---------- hero: the words left, the line leaving the button; the schedule filling up in the D, right ---------- */
.hiw-hero { padding-block: clamp(2rem, 3.4vw, 3.25rem) var(--section-y); }
.hiw-hero__in { display: grid; grid-template-columns: minmax(0, 0.84fr) minmax(0, 1fr); column-gap: var(--space-5); align-items: start; }
.hiw-hero__words { padding-top: var(--space-4); }
.hiw-hero h1 { font-size: var(--fs-h1); }
.hiw-hero__lede { max-width: 34rem; margin: var(--space-3) 0 0; font-size: var(--fs-body); color: var(--c-ink-soft); }
.hiw-hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: var(--space-4); }
.hiw-hero__cta .cta-note { margin: 0; justify-content: flex-start; }
.hiw-hero__stage { --stage-h: 640px; --d-x: calc(var(--stage-h) / 2); height: var(--stage-h); overflow: visible; }
.hiw-hero__clips { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; }
.hiw-hero__slide video { transform: rotate(180deg); } /* seen from across the desk: turned, so the dates read and the hand comes from below */
.hiw-hero__stop { top: 16px; right: auto; left: 56%; }
.hiw-hero__wyw { position: absolute; z-index: 2; top: 16px; left: 8px; width: 330px; height: 270px; }
.hiw-hero__wyw > [data-scene] { display: block; width: 100%; height: 100%; }
.hiw-hero__chat { position: absolute; z-index: 3; right: -24px; bottom: -24px; width: 300px; }
.hiw-hero__chat > [data-scene] { overflow: visible; } /* its phone's shadow, uncut */

/* ---------- yours: the owner's part on the sky; the line down the middle, the rows alternating around it ---------- */
.hiw-yours { --ground-d-x: -12%; --ground-d-y: -4%; --ground-o-x: -7%; --ground-o-y: 3%; }
.hiw-yours__head { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); margin-bottom: var(--space-6); }
.hiw-yours__head h2 { grid-column: 1; margin: 0; font-size: var(--fs-h2); }
.hiw-yours__head .sec-lede { grid-column: 3; align-self: end; margin: 0; }
.hiw-steps { display: grid; row-gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.hiw-step { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); align-items: center; }
.hiw-step__words { grid-column: 1; grid-row: 1; justify-self: end; max-width: 440px; }
.hiw-step__words h3 { margin: 0; font-size: var(--fs-h3); }
.hiw-step__words p { margin: var(--space-2) 0 0; font-size: var(--fs-body); line-height: 1.5; }
.hiw-step .hiw-num { grid-column: 2; grid-row: 1; justify-self: center; }
.hiw-step__scene { position: relative; grid-column: 3; grid-row: 1; justify-self: start; width: 100%; max-width: 480px; }
.hiw-step:nth-child(even) .hiw-step__words { grid-column: 3; justify-self: start; }
.hiw-step:nth-child(even) .hiw-step__scene { grid-column: 1; justify-self: end; }
.hiw-step:last-child .hiw-step__scene { max-width: 560px; }
.hiw-step__scene > [data-scene] { display: block; width: 100%; }
.hiw-step__scene--goal { display: flex; align-items: flex-end; min-height: 300px; }
.hiw-yours__stop { top: auto; bottom: 0; right: -48px; }

/* ---------- ours: the agency's part; the number between the words and the photo, the line weaving through the gaps ---------- */
.hiw-ours { padding-block: calc(var(--section-y) * 0.6); }
#ours { padding-top: var(--section-y); }
.hiw-ours__in { display: grid; grid-template-columns: minmax(0, 420px) 88px minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; align-items: center; }
.hiw-ours__head { grid-column: 1; grid-row: 1; align-self: end; margin-bottom: var(--space-4); }
.hiw-ours__words { grid-column: 1; grid-row: 1 / span 2; }
.hiw-ours__head + .hiw-ours__words { grid-row: 2; align-self: start; }
.hiw-ours__words h3 { margin: 0; font-size: var(--fs-h3); }
.hiw-ours__words p { margin: var(--space-2) 0 0; font-size: var(--fs-body); line-height: 1.5; color: var(--c-ink-soft); }
.hiw-ours .hiw-num { grid-column: 2; grid-row: 1 / span 2; justify-self: center; }
.hiw-ours__head ~ .hiw-num { grid-row: 2; align-self: start; }
.hiw-ours__media { grid-column: 3; grid-row: 1 / span 2; }
.hiw-ours--flip .hiw-ours__in { grid-template-columns: minmax(0, 1fr) 88px minmax(0, 420px); }
.hiw-ours--flip .hiw-ours__words { grid-column: 3; }
.hiw-ours--flip .hiw-ours__media { grid-column: 1; }
.hiw-ours__scene > [data-scene] { display: block; width: 100%; height: 100%; }
.hiw-ours__stop { top: 16px; right: auto; left: 16px; }
.hiw-ours--flip .hiw-ours__stop { top: auto; bottom: 16px; left: auto; right: 16px; }

/* the deck: the crew on the right, the card on the clear lawn */
.hiw-ours--deck .hiw-ours__photo { object-position: 100% 50%; }
.hiw-ours--deck .hiw-ours__scene { left: 20px; bottom: 24px; width: 350px; height: 320px; }
/* the pool: mirrored, the tech in the D's round side, the card over the water */
.hiw-ours--pool .pair__media > .hiw-ours__photo { object-position: 100% 50%; transform: scaleX(-1); border-radius: var(--radius-l) var(--d-x) var(--d-x) var(--radius-l) / var(--radius-l) 50% 50% var(--radius-l); }
.hiw-ours--pool .hiw-ours__scene { top: 24px; right: 20px; width: 350px; height: 265px; zoom: 1.1; } /* its tilt draws its 13 px a little under: the zoom holds them */
/* the patio: the card on the finished stretch, the faces clear */
.hiw-ours--patio .hiw-ours__photo { object-position: 100% 30%; }
.hiw-ours--patio .hiw-ours__scene { left: 20px; bottom: 20px; width: 340px; height: 330px; }

/* ---------- inside: the words left; the plan on the white door, the two reading it clear of it ---------- */
.hiw-inside__in { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); column-gap: var(--space-5); align-items: center; }
.hiw-inside__words { margin: 0; }
.hiw-inside .pair__media { --stage-h: 720px; }
.hiw-inside__photo { object-position: 10% 30%; }
.hiw-inside__scene { top: 10px; left: 0; width: 400px; height: 700px; }
.hiw-inside__scene > [data-scene] { display: block; width: 100%; height: 100%; }
.hiw-inside__stop { top: 16px; right: auto; left: 56%; }

/* ---------- team: the hands in the D's round side, the drawn phone at the straight side, bleeding out of its foot ---------- */
.hiw-team { padding-bottom: calc(var(--section-y) + 36px); }
.hiw-team__in { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(0, 0.66fr); column-gap: calc(var(--space-6) + 56px); align-items: center; }
.hiw-team__words { margin: 0; }
.hiw-team .pair__media { --stage-h: 580px; }
.hiw-team__photo { object-position: 30% 40%; }
.hiw-team__phone { position: absolute; z-index: 2; right: -56px; bottom: -36px; width: 296px; height: 620px; }
.hiw-team__screen { position: relative; width: 276px; height: 600px; overflow: hidden; border-radius: 30px; }
.hiw-team__screen > [data-scene] { display: block; width: 100%; height: 100%; }
.hiw-team__stop { top: 16px; right: auto; left: 44%; }

/* ---------- faq: the line passes behind the opaque questions ---------- */
.hiw-faq details { position: relative; z-index: 1; }

/* ---------- close: the words on the shade, the line down the lawn into the button, the booking beside it ---------- */
.hiw-close { min-height: 640px; align-items: start; }
.hiw-close .close__shade { background: linear-gradient(90deg, var(--c-shade) 0%, var(--c-shade) 34%, color-mix(in srgb, var(--c-navy-deep) 30%, transparent) 46%, transparent 54%); }
.hiw-close__in { display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 340px) minmax(0, 1fr); column-gap: var(--space-4); align-items: start; }
.hiw-close__in > h2 { max-width: none; font-size: var(--fs-h2); }
.hiw-close__cta { display: grid; gap: 0.75rem; padding: 1.25rem; }
.hiw-close__cta .cta-note { margin: 0; justify-content: center; font-size: var(--fs-small); }
.hiw-close__seq { display: grid; gap: 0.75rem; align-self: start; }
.hiw-close__seq .sticker { display: flex; align-items: center; gap: 0.75rem; }
.hiw-close__seq [data-kit-at] { opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }

/* ---------- under 1100 px ---------- */
@media (max-width: 1099px) {
  .hiw-hero__in { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr); column-gap: var(--space-4); }
  .hiw-hero__wyw { width: 300px; }
  .hiw-hero__chat { right: -8px; width: 280px; }
  .hiw-ours__in { grid-template-columns: minmax(0, 300px) 80px minmax(0, 1fr); }
  .hiw-ours--flip .hiw-ours__in { grid-template-columns: minmax(0, 1fr) 80px minmax(0, 300px); }
  .hiw-inside__in { grid-template-columns: 100%; row-gap: var(--space-5); }
  .hiw-team__in { grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr); column-gap: calc(var(--space-4) + 28px); }
  .hiw-team__phone { right: -28px; }
  .hiw-close__in { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); row-gap: var(--space-4); }
  .hiw-close__seq { grid-column: 2; }
}

/* ---------- under 900 px: one column: each number beside its words, its picture under them ---------- */
@media (max-width: 899px) {
  .hiw-hero__in { grid-template-columns: 100%; row-gap: var(--space-5); }
  .hiw-hero__words { padding-top: 0; }
  .hiw-hero__stage { --stage-h: 680px; }
  .hiw-hero__chat { right: 50%; bottom: -24px; width: min(320px, 90%); transform: translateX(50%); }
  .hiw-hero__wyw { width: min(320px, 100% - 16px); height: 220px; }
  .hiw-yours__head { grid-template-columns: 100%; row-gap: var(--space-2); }
  .hiw-yours__head .sec-lede { grid-column: 1; }
  .hiw-step { grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; row-gap: var(--space-4); align-items: start; }
  .hiw-step .hiw-num { grid-column: 1; grid-row: 1; justify-self: start; }
  .hiw-step__words, .hiw-step:nth-child(even) .hiw-step__words { grid-column: 2; grid-row: 1; justify-self: start; max-width: none; }
  .hiw-step__scene, .hiw-step:nth-child(even) .hiw-step__scene { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .hiw-yours__stop { bottom: -48px; right: 0; }
  .hiw-ours__in, .hiw-ours--flip .hiw-ours__in { grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; grid-template-rows: none; row-gap: var(--space-4); }
  .hiw-ours__head { grid-column: 1 / -1; grid-row: auto; margin-bottom: 0; }
  .hiw-ours .hiw-num, .hiw-ours__head ~ .hiw-num { grid-column: 1; grid-row: auto; justify-self: start; align-self: start; order: 1; }
  .hiw-ours__words, .hiw-ours--flip .hiw-ours__words, .hiw-ours__head + .hiw-ours__words { grid-column: 2; grid-row: auto; align-self: start; order: 2; }
  .hiw-ours__media, .hiw-ours--flip .hiw-ours__media { grid-column: 1 / -1; grid-row: auto; order: 3; --stage-h: 560px; }
  .hiw-team__in { grid-template-columns: 100%; row-gap: var(--space-5); }
  .hiw-team__words { grid-row: 1; }
  .hiw-team .pair__media { --stage-h: 560px; }
  .hiw-team__phone { right: 50%; transform: translateX(50%); }
  .hiw-team__stop { top: -48px; left: auto; right: 0; }
  .hiw-ours--flip .hiw-ours__stop { top: 16px; bottom: auto; }
  .hiw-ours--deck .hiw-ours__photo { object-position: 92% 50%; }
  .hiw-team { padding-bottom: calc(var(--section-y) + 60px); }
  .hiw-close { background: none; }
  .hiw-close .close__shade { background: linear-gradient(180deg, var(--c-shade) 0%, var(--c-shade) 30%, color-mix(in srgb, var(--c-navy-deep) 30%, transparent) 46%, transparent 56%); }
  .hiw-close__in { grid-template-columns: 100%; }
  .hiw-close__seq { grid-column: 1; }
}

@media (max-width: 599px) {
  .hiw-hero__stage { --d-x: 40%; border-radius: var(--radius-l) 40% 40% var(--radius-l) / var(--radius-l) 50% 50% var(--radius-l); }
  .hiw-hero__cta { flex-direction: column; align-items: flex-start; }
  .pair__media.dframe.hiw-ours__media:not(.dframe--left), .pair__media.dframe.hiw-team__media:not(.dframe--left), .pair__media.dframe.hiw-inside__media { --d-x: 40%; }
  .hiw-ours__scene, .hiw-ours--deck .hiw-ours__scene, .hiw-ours--patio .hiw-ours__scene { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 300px; }
  .hiw-ours--pool .hiw-ours__scene { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 272px; }
  /* the plan over the photo's foot, running on past it, half of it on the photo; the two reading it above */
  .hiw-inside .pair__media { --stage-h: 700px; margin-bottom: 340px; }
  .hiw-inside__photo { object-position: 69% 0; }
  .hiw-inside__scene { top: 360px; left: 0; width: 100%; height: 680px; }
  .hiw-inside__stop { top: 308px; left: auto; right: 12px; }
}
