/* how-it-works.css: How it works. The thread's spine stands at the page's middle: every part keeps that lane clear of
   words, or holds it behind something opaque. */
@import url("../arsenal/thread.css");

/* Home's rotate, as services.css has it: this site's kit.js has no data-kit-shown */
[data-kit-scene="rotate"] [data-kit-slide] { position: absolute; inset: 0; margin: 0; visibility: hidden; overflow: hidden; }
[data-kit-scene="rotate"] [data-kit-slide][data-kit-on] { visibility: visible; z-index: 2; opacity: var(--kit-move, 1); transform: translateX(calc((1 - var(--kit-move, 1)) * 4%)); }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-prev])) [data-kit-slide][data-kit-on] { transform: none; opacity: 1; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { visibility: visible; z-index: 1; }
[data-kit-scene="rotate"] [data-kit-slide] video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
[data-kit-scene="rotate"]:not(:has([data-kit-slide][data-kit-on])) [data-kit-slide]:not([data-kit-slide] ~ [data-kit-slide]) { visibility: visible; }
[data-kit-scene="rotate"] [data-kit-slide] video { inset: 1px; width: calc(100% - 2px); height: calc(100% - 2px); }

/* ---------- the thread ---------- */
.thread { --thread-ink: var(--c-glow); --thread-bg: var(--c-paper); --thread-link: 13px; --thread-gap: 24px; }
.thread__svg { z-index: 1; }
.thread [data-thread-anchor], .thread [data-thread-light] { z-index: 2; }
.hiw-wide { width: 100%; max-width: 1400px; margin-inline: auto; padding-inline: var(--gutter); }

/* the numbers on the spine: they fill as the head plugs in, one ring spreading from them */
.hiw-num { --on: clamp(0, calc((var(--lit, 0) - .45) * 10), 1); /* a quick turn, so the digit never fades into its disc */ position: relative; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; font: 800 1.875rem/1 var(--font-display); font-stretch: var(--display-stretch); background: color-mix(in srgb, var(--c-accent) calc(var(--on) * 100%), var(--c-night)); color: color-mix(in srgb, var(--c-ink) calc(var(--on) * 100%), var(--c-on-night)); box-shadow: 0 0 0 2px var(--c-glow); }
.hiw-num[data-lit] { box-shadow: 0 0 0 2px var(--c-accent); }
.hiw-num::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-accent); opacity: calc((1 - var(--lit-after, 0)) * var(--lit, 0) * .9); transform: scale(calc(1 + var(--lit-after, 0) * .7)); pointer-events: none; }
.hiw-num--light { background: color-mix(in srgb, var(--c-brand) calc(var(--on) * 100%), var(--c-paper)); color: color-mix(in srgb, var(--c-on-brand) calc(var(--on) * 100%), var(--c-brand-text)); box-shadow: 0 0 0 2px var(--c-brand), var(--shadow-m); }
.hiw-num--light[data-lit] { box-shadow: 0 0 0 2px var(--c-brand), var(--shadow-m); }
.hiw-num--light::after { border-color: var(--c-brand); }
.hiw-step__title { font: 800 clamp(1.375rem, 1.1rem + 0.8vw, 1.75rem)/1.15 var(--font-display); font-stretch: var(--display-stretch); letter-spacing: -0.015em; text-wrap: balance; }
.hiw-step__line { margin-top: 10px; font-size: 1.0625rem; line-height: 1.55; }
.hiw-chip { display: inline-block; margin-top: 14px; padding: 6px 12px; border-radius: 999px; font: 700 0.875rem/1.2 var(--font-ui); background: color-mix(in srgb, var(--c-accent) 16%, transparent); color: var(--c-accent); }

/* ---------- #hero: centered words, a wide stage under them ---------- */
.hiw-hero { padding-top: clamp(26px, 3vw, 40px); }
.hiw-hero__words { max-width: 980px; text-align: center; }
.hiw-hero__title { font-family: var(--font-display); font-stretch: var(--display-stretch); font-weight: 800; font-size: clamp(2.15rem, 1.25rem + 2.3vw, 3.3rem); line-height: 1.05; letter-spacing: -0.024em; text-wrap: balance; }
.hiw-hero__title .em { color: var(--c-brand-text); }
.hiw-hero__line { max-width: 660px; margin: 16px auto 0; font-size: 1.125rem; line-height: 1.55; color: var(--c-ink-soft); }
.hiw-hero__go { margin-top: 22px; padding-bottom: 8px; }
.hiw-hero__stage { position: relative; height: clamp(430px, calc(100svh - 480px), 620px); margin-top: 42px; overflow: hidden; border-radius: var(--radius-l); background: var(--c-night-2); }
.hiw-hero__media { position: absolute; inset: 0; }
.hiw-hero__slide video, .hiw-hero__slide .kit-first { object-position: 50% 50%; }
.hiw-hero__slide--turn video, .hiw-hero__slide--turn .kit-first { rotate: 180deg; object-position: 50% 62%; }
.hiw-hero__stage .hiw-hero__scene { position: absolute; z-index: 3; top: 0; right: 16px; bottom: 0; width: 480px; }
.hiw-hero__stage [data-scene="wyw"] .wy-feed { left: auto; right: 8px; bottom: 16px; width: 340px; }
.hiw-hero__stage [data-scene="wyw"] .wy-tag { left: auto; right: 8px; top: 16px; }
.hiw-hero__stop { position: absolute; z-index: 4; top: 16px; left: 16px; }

/* ---------- #yours: the owner's part, on the night panel ---------- */
.hiw-yours { padding-top: clamp(72px, 7vw, 104px); }
.hiw-yours__panel { padding: clamp(44px, 5vw, 76px) clamp(24px, 4.4vw, 64px); border-radius: 28px; }
.hiw-yours__stop { position: absolute; z-index: 3; top: 0; right: 0; }
.hiw-yours__grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); column-gap: clamp(28px, 4vw, 56px); row-gap: clamp(44px, 5vw, 72px); align-items: center; }
.hiw-yours__head { grid-column: 1; grid-row: 1; text-align: left; margin: 0; }
.hiw-yours__head .sec-head__line { margin-inline: 0; }
.hiw-num--1 { grid-column: 2; grid-row: 2; }
.hiw-num--2 { grid-column: 2; grid-row: 3; }
.hiw-num--3 { grid-column: 2; grid-row: 4; }
.hiw-yours__words { color: var(--c-on-night); }
.hiw-yours__words .hiw-step__line { color: var(--c-on-night-soft); }
.hiw-yours__words--1 { grid-column: 1; grid-row: 2; }
.hiw-yours__words--2 { grid-column: 3; grid-row: 3; }
.hiw-yours__words--3 { grid-column: 1; grid-row: 4; }
.hiw-yours__scene { position: relative; z-index: 2; display: flex; } /* the phone's line runs behind it */
.hiw-yours__scene > .scene { width: 100%; }
.hiw-yours__scene--1 { grid-column: 3; grid-row: 1 / span 2; align-self: center; align-items: center; justify-content: center; height: 330px; } /* its chat grows inside this box, moving nothing */
.hiw-yours__scene--1 > .scene { max-width: 470px; }
.hiw-yours__scene--2 { grid-column: 1; grid-row: 3; }
.hiw-yours__scene--3 { grid-column: 3; grid-row: 4; }
.hiw-node { position: relative; grid-column: 1 / -1; grid-row: 5; justify-self: center; display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; background: color-mix(in srgb, var(--c-accent) calc(var(--lit, 0) * 100%), var(--c-night-2)); color: var(--c-on-night); font: 800 1.0625rem/1.2 var(--font-ui); box-shadow: 0 0 0 2px var(--c-accent); }
.hiw-node svg { color: var(--c-accent); }
.hiw-node[data-lit] { color: var(--c-ink); }
.hiw-node[data-lit] svg { color: var(--c-ink); }

/* ---------- #ours: the agency's part, along the spine ---------- */
.hiw-ours { position: relative; padding-top: clamp(84px, 8vw, 120px); }
.hiw-ours__head { position: relative; max-width: 760px; margin: 0 auto; padding-block: 10px; background: var(--c-paper); }
.hiw-step__stop { position: absolute; z-index: 3; top: 12px; left: 12px; }
.hiw-step { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; margin-top: clamp(84px, 8vw, 112px); }
.hiw-step > .hiw-num { position: absolute; z-index: 3; left: 50%; top: 0; translate: -50% -50%; }
.hiw-step__media { position: relative; grid-column: 1 / span 7; grid-row: 1; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-l); background: var(--c-night-2); }
.hiw-step__photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: saturate(calc(.62 + .38 * var(--lit, 0))); }
.hiw-step__words { grid-column: 8 / span 5; grid-row: 1; padding-left: clamp(8px, 2vw, 32px); }
.hiw-step__words .hiw-step__line { color: var(--c-ink-soft); }
.hiw-step--flip .hiw-step__media { grid-column: 6 / span 7; }
.hiw-step--flip .hiw-step__words { grid-column: 1 / span 5; padding-left: 0; padding-right: clamp(8px, 2vw, 32px); }
.hiw-step__media .hiw-step__scene { position: absolute; z-index: 2; left: 16px; top: 50%; width: min(372px, 52%); translate: 0 -50%; }

/* ---------- #inside: what the plan holds ---------- */
.hiw-inside { margin-top: clamp(84px, 8vw, 120px); padding-block: clamp(64px, 7vw, 100px); }
.hiw-inside__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 112px; align-items: center; }
.hiw-inside__copy .cta-row { margin-top: 26px; }
.hiw-inside__stage { position: relative; }
.hiw-inside__stage .hiw-inside__scene { width: 100%; height: 560px; }
.hiw-inside__stop { position: absolute; z-index: 3; top: -8px; right: -8px; }

/* ---------- #team: a person one tap away ---------- */
.hiw-team { padding-block: clamp(84px, 8vw, 120px); }
.hiw-team__in { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.hiw-team__copy { grid-column: 1 / span 5; padding-right: clamp(8px, 2vw, 32px); }
.hiw-team__frame { position: relative; grid-column: 6 / span 7; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius-l); background: var(--c-night-2); }
.hiw-team__photo { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 30%; }
.hiw-team__card { position: absolute; z-index: 2; left: 16px; bottom: 16px; width: min(300px, 46%); display: grid; gap: 10px; }
.hiw-team__board { position: relative; display: grid; gap: 12px; padding: 14px; border-radius: var(--radius-m); background: color-mix(in srgb, var(--c-paper) 82%, transparent); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: var(--shadow-l); }
.hiw-team__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; color: var(--c-ink); }
.hiw-team__top b { font: 700 0.9375rem/1.25 var(--font-ui); }
.hiw-team__top small { font: 500 0.8125rem/1.25 var(--font-ui); color: var(--c-ink-soft); }
.hiw-team__btn { position: relative; display: block; overflow: hidden; padding: 12px 14px; border-radius: var(--radius-s); text-align: center; font: 700 0.9375rem/1.2 var(--font-ui); background: var(--c-paper); color: var(--c-ink); box-shadow: inset 0 0 0 1.5px var(--c-brand); }
.hiw-team__press { position: absolute; inset: 0; display: grid; place-items: center; background: var(--c-accent); color: var(--c-ink); opacity: var(--kit-in, 1); }
.hiw-team__reply { padding: 12px 14px; border-radius: var(--radius-m); background: var(--c-paper); color: var(--c-ink); font: 500 0.9375rem/1.35 var(--font-ui); box-shadow: var(--shadow-l); opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.hiw-team__reply small { display: block; margin-bottom: 3px; font: 700 0.8125rem/1.2 var(--font-ui); color: var(--c-brand-text); }
.hiw-team__stop { position: absolute; z-index: 3; top: 12px; left: 12px; }

/* ---------- #faq: an opaque card the line passes behind ---------- */
.hiw-faq { padding-bottom: clamp(84px, 8vw, 120px); }
.hiw-faq__card { position: relative; display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); padding: clamp(28px, 4vw, 56px); border-radius: var(--radius-l); background: var(--c-paper-alt); }
.hiw-faq__card .sec-head { margin: 0; text-align: left; }

/* ---------- #close: the line ends in the button ---------- */
.hiw-close { position: relative; isolation: auto; min-height: clamp(560px, 46vw, 660px); display: flex; align-items: center; overflow: hidden; background: var(--c-paper-alt); }
.hiw-close__media { position: absolute; inset: 0; margin: 0; }
.hiw-close__shot { position: absolute; inset: 0; margin: 0; }
.hiw-close__shot img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hiw-close__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgb(255 255 255 / .4) 0%, rgb(255 255 255 / .3) 36%, rgb(255 255 255 / 0) 56%); }
.hiw-close__in { position: relative; }
.hiw-close__copy { max-width: 500px; }
.hiw-close__copy .sec-head__line { color: var(--c-ink); }
.hiw-close__copy .cta-row { margin-top: 26px; }
.hiw-close .btn[data-lit] { box-shadow: 0 0 0 4px var(--c-brand), var(--shadow-m); }
.hiw-close__stop { position: absolute; z-index: 3; top: 16px; right: 16px; }
.hiw-bk { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 24px 16px; background: linear-gradient(180deg, var(--c-night-2), var(--c-night)); color: var(--c-on-night); }
/* its words are large: on a phone this screen is drawn at about 0.38 */
.hiw-bk__lock { display: grid; justify-items: center; gap: 4px; padding-block: 52px 34px; }
.hiw-bk__lock b { font: 700 5.25rem/1 var(--font-display); }
.hiw-bk__lock span { font: 500 1.875rem/1.2 var(--font-ui); color: var(--c-on-night-soft); }
.hiw-bk__note { padding: 14px 16px; border-radius: 22px; border-left: 12px solid var(--c-accent); background: var(--c-paper); color: var(--c-ink); opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * -14px)); }
.hiw-bk__note b { display: block; font: 800 2rem/1.15 var(--font-ui); }
.hiw-bk__note small { display: block; font: 500 1.875rem/1.2 var(--font-ui); color: var(--c-ink-soft); }

/* ---------- the phone ---------- */
@media (max-width: 1080px) {
  .hiw-hero__stage .hiw-hero__scene { width: 400px; }
  .hiw-step__media .hiw-step__scene { width: min(340px, 56%); }
}
@media (max-width: 899px) {
  .hiw-yours__grid { grid-template-columns: 56px minmax(0, 1fr); column-gap: 14px; row-gap: 14px; }
  .hiw-yours__head { grid-column: 1 / -1; grid-row: auto; margin-bottom: 20px; }
  .hiw-num { width: 56px; height: 56px; font-size: 1.375rem; }
  .hiw-num--1, .hiw-num--2, .hiw-num--3 { grid-column: 1; grid-row: auto; align-self: start; margin-top: 18px; }
  .hiw-yours__words--1, .hiw-yours__words--2, .hiw-yours__words--3 { grid-column: 2; grid-row: auto; margin-top: 18px; }
  .hiw-yours__scene--1, .hiw-yours__scene--2, .hiw-yours__scene--3 { grid-column: 1 / -1; grid-row: auto; min-height: 0; }
  .hiw-yours__scene--1 { height: 290px; align-items: flex-start; }
  .hiw-yours__scene--1 > .scene { max-width: none; }
  .hiw-yours__stop { top: 6px; right: 6px; }
  .hiw-node { grid-row: auto; margin-top: 26px; }

  .hiw-step { display: block; margin-top: 56px; }
  .hiw-step > .hiw-num { left: 28px; }
  /* each card stands on its photo, under the faces (the spa's between its two) */
  .hiw-step__media { aspect-ratio: auto; height: 540px; }
  .hiw-step__media--ours-land .hiw-step__photo { object-position: 80% 50%; }
  .hiw-step__media--ours-spa { height: 640px; }
  .hiw-step__media--ours-spa .hiw-step__photo { object-position: 74% 50%; }
  .hiw-step__media--ours-law { height: 580px; }
  .hiw-step__media--ours-law .hiw-step__photo { object-position: 72% 50%; }
  .hiw-step__media .hiw-step__scene { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; translate: none; }
  .hiw-step__media--ours-spa .hiw-step__scene { top: 104px; bottom: auto; }
  .hiw-step__stop { left: auto; right: 12px; }
  .hiw-step__words, .hiw-step--flip .hiw-step__words { padding: 18px 0 0 64px; }

  .hiw-inside__in { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .hiw-inside__stage { max-width: 420px; margin-inline: auto; width: 100%; }
  .hiw-inside__stage .hiw-inside__scene { height: 700px; }
  .hiw-inside__stop { top: 18px; right: 18px; }

  .hiw-team__in { display: flex; flex-direction: column; gap: 22px; }
  .hiw-team__copy { order: 2; padding: 0; }
  .hiw-team__frame { width: 100%; aspect-ratio: 4 / 5; }
  .hiw-team__photo { object-position: 62% 20%; }
  .hiw-team__card { left: 10px; right: 10px; width: auto; bottom: 10px; }

  .hiw-faq__card { grid-template-columns: minmax(0, 1fr); }

  .hiw-close { min-height: 0; flex-direction: column; align-items: stretch; }
  .hiw-close__media { position: relative; inset: auto; height: 520px; }
  .hiw-close__shot img { object-position: 100% 50%; }
  .hiw-close__shade { display: none; }
  .hiw-close__in { padding-block: 26px 40px; }
}
@media (max-width: 699px) {
  .hiw-hero__stage { height: 430px; margin-top: 32px; }
  .hiw-hero__stage .hiw-hero__scene { left: 0; right: 0; top: auto; width: auto; height: 190px; }
  .hiw-hero__stage [data-scene="wyw"] .wy-feed { left: 10px; right: 10px; width: auto; bottom: 10px; }
  .hiw-hero__stage [data-scene="wyw"] .wy-tag { left: 10px; right: auto; top: auto; bottom: 150px; }
  .hiw-hero__stop { left: auto; right: 12px; top: 12px; }
  .hiw-yours__panel { border-radius: var(--radius-l); }
}
