/* How it works (plan.md, "The thread"): its parts inside the arsenal's thread, the growth line running down a lane at
   the left of every part. Tokens only (design\system.css). */
@import url("../arsenal/thread.css");

/* ---------- The thread: the growth line, in its lane ---------- */
.page-how { --lane: 0px; }
@media (min-width: 700px) { .page-how { --lane: 64px; } }
@media (min-width: 1100px) { .page-how { --lane: 88px; } }
.hiw {
  --thread-ink: var(--c-leaf);
  --thread-track-ink: color-mix(in srgb, var(--c-brand) 24%, transparent);
  --thread-w: 2.5px;
  --thread-radius: 40px;
  --thread-inset: 26px;
}
/* a part paints its ground under the line only when it is not positioned (thread README) */
.hiw > .section { position: static; }
.hiw-lane { position: relative; box-sizing: border-box; padding-left: var(--lane); }

/* the stations: a node with the mark at the head of each part, the team's step numbers; they light as the line plugs in */
.hiw-node, .hiw-num {
  position: absolute; left: calc(var(--lane) / 2 - 22px); display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 50%; box-sizing: border-box; background: var(--c-paper);
  border: 2px solid color-mix(in srgb, var(--c-leaf) calc(var(--lit, 1) * 100%), var(--c-line));
}
.hiw-node { top: 4px; }
.hiw-node svg { width: 24px; height: 24px; fill: color-mix(in srgb, var(--c-accent) calc(var(--lit, 1) * 100%), var(--c-brand)); }
.hiw-num {
  font: 700 18px/1 var(--font-display); color: var(--c-ink);
  background: color-mix(in srgb, var(--c-leaf) calc(var(--lit, 1) * 100%), var(--c-paper));
}
.hiw-node::after, .hiw-num::after {
  content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--c-leaf); pointer-events: none;
  opacity: calc(var(--lit, 0) * (1 - var(--lit-after, 1))); transform: scale(calc(1 + var(--lit-after, 1) * 0.9));
}
.hiw-who { margin: calc(-1 * var(--space-3)) 0 var(--space-4); font: 700 var(--fs-small)/1.3 var(--font-ui); color: var(--c-accent-text); }
@media (max-width: 699.98px) {
  .hiw-node { display: none; }
  .hiw-num { position: static; width: 38px; height: 38px; margin-bottom: var(--space-3); font-size: 16px; }
}

/* ---------- The header: the calendar filling up, the jobs stacking up, the words on the navy ---------- */
.hiw-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); min-height: clamp(560px, calc(100svh - 76px), 820px); background: var(--c-ink); }
.hiw-hero__stage { position: relative; overflow: hidden; background: var(--c-ink); isolation: isolate; }
[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(var(--kit-glide, 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); max-width: none; clip-path: inset(2px); }
[data-kit-scene="rotate"] [data-kit-slide] video[data-kit-shown] { clip-path: none; }
[data-kit-scene="rotate"] [data-kit-slide][data-prev] { opacity: clamp(0, (1 - var(--kit-move, 0)) * 1000, 1); }
.hiw-hero__slide .kit-first { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
/* each clip's hand and its circled date kept on the stage's left, clear of the notifications */
.hiw-hero__slide--a video, .hiw-hero__slide--a .kit-first { object-position: 100% 50%; }
.hiw-hero__slide--b video, .hiw-hero__slide--b .kit-first { object-position: 45% 50%; }
/* the grade, one still layer: a little depth toward the words and under the notifications */
.hiw-hero__stage::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background:
    linear-gradient(90deg, transparent 52%, color-mix(in srgb, var(--c-ink) 34%, transparent) 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--c-ink) 30%, transparent), transparent 42%);
}
.scene.hiw-hero__feed { position: absolute; z-index: 4; right: var(--space-4); top: var(--space-5); bottom: calc(var(--space-5) + 30px); width: min(480px, 58%); }
.hiw-hero .stop--hero { top: var(--space-3); right: var(--space-3); }
.hiw-hero__panel { display: grid; align-content: center; gap: var(--space-4); padding: var(--space-6) clamp(var(--space-4), 4vw, var(--space-6)); color: var(--c-on-ink); }
.hiw-hero__title { font-size: clamp(2.2rem, 1.1rem + 2.4vw, 3.6rem); color: var(--c-on-ink); }
.hiw-hero__line { max-width: 30rem; color: color-mix(in srgb, var(--c-on-ink) 88%, transparent); }
.hiw-hero__cta { flex-direction: column; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-2); }
.hiw-hero__cta .cta-row__note { max-width: 15em; color: color-mix(in srgb, var(--c-on-ink) 84%, transparent); }
@media (max-width: 1100px) {
  .hiw-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hiw-hero__stage { aspect-ratio: 16 / 10; }
  .scene.hiw-hero__feed { top: var(--space-4); right: var(--space-4); bottom: calc(var(--space-4) + 30px); width: min(440px, 46%); }
  .hiw-hero__panel { padding: var(--space-5) var(--gutter) var(--space-6); }
}
@media (max-width: 699.98px) { .hiw-hero__cta .cta-row__note { max-width: none; } }
@media (max-width: 600px) {
  .hiw-hero__stage { aspect-ratio: auto; height: 420px; }
  .scene.hiw-hero__feed { inset: 0 0 30px; width: auto; }
  .hiw-hero__slide--b video, .hiw-hero__slide--b .kit-first { object-position: 30% 50%; }
  .hiw-hero .stop--hero { top: auto; bottom: 168px; right: var(--space-2); }
}

/* ---------- Your part: three steps side by side on the grid ---------- */
.hiw-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
.hiw-step { display: grid; grid-template-rows: auto 1fr; gap: var(--space-3); min-width: 0; }
.hiw-step__top { position: relative; display: flex; align-items: center; gap: var(--space-2); padding-right: 48px; }
.hiw-step__n {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; box-sizing: border-box;
  font: 700 15px/1 var(--font-display); color: var(--c-ink);
  background: color-mix(in srgb, var(--c-leaf) calc(var(--lit, 1) * 100%), var(--c-paper));
  border: 2px solid color-mix(in srgb, var(--c-leaf) calc(var(--lit, 1) * 100%), var(--c-line));
}
.hiw-step__title { font-size: var(--fs-h3); }
.hiw-step__stage { display: grid; align-items: start; min-height: 360px; }
.scene.hiw-step__scene { position: relative; width: 100%; }
.scene.hiw-step__scene--scan { min-height: 300px; }
.hiw-yours .stop--steps { top: 50%; right: 0; translate: 0 -50%; }
@media (max-width: 1000px) {
  .hiw-steps { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .hiw-step__stage { min-height: 0; }
  .hiw-step:first-child .hiw-step__stage { min-height: 250px; }
}

/* ---------- Our part: a photo per step, its scene in glass on the side clear of the face ---------- */
.hiw-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(3rem, 6vw, 5rem); }
.hiw-row { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.hiw-row__frame { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); }
.hiw-row__photo {
  position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover;
  filter: saturate(calc(0.55 + 0.45 * var(--lit, 1)));
}
.hiw-row--launch .hiw-row__photo { object-position: 100% 50%; }
.hiw-row--leads .hiw-row__photo { object-position: 0% 50%; }
.hiw-row--tune .hiw-row__photo { object-position: 100% 50%; }
.scene.hiw-row__scene { position: absolute; top: 50%; translate: 0 -50%; }
.scene.hiw-row__scene--launch { right: var(--space-3); width: min(300px, 44%); height: 300px; }
.scene.hiw-row__scene--leads { left: var(--space-3); width: min(360px, 54%); height: 290px; }
.scene.hiw-row__scene--tune { left: var(--space-3); width: min(380px, 56%); height: 330px; }
.hiw-row .stop--frame { top: var(--space-2); right: var(--space-2); }
.hiw-row--launch .stop--frame { right: auto; left: var(--space-2); }
.hiw-row__title { font-size: var(--fs-h3); margin-bottom: var(--space-2); }
.hiw-row__line { color: var(--c-ink-soft); }
@media (max-width: 1000px) {
  .hiw-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
}
@media (max-width: 760px) {
  .hiw-row__frame { aspect-ratio: auto; padding-top: 380px; margin-inline: calc(-1 * var(--gutter)); border-radius: 0; overflow: visible; background: none; }
  .hiw-row__photo { inset: 0 0 auto; width: 100%; height: 380px; }
  .hiw-row--launch .hiw-row__photo { object-position: 50% 50%; }
  .hiw-row--leads .hiw-row__photo { object-position: 25% 50%; }
  .hiw-row--tune .hiw-row__photo { object-position: 100% 50%; }
  .scene.hiw-row__scene { position: relative; top: auto; left: auto; right: auto; translate: none; width: calc(100% - 2 * var(--gutter)); margin: -180px auto 0; }
  .hiw-row--launch .stop--frame { left: auto; right: var(--space-2); }
}

/* ---------- What the plan holds: the owner reading it, the plan building beside him ---------- */
.hiw-inside__stage { position: relative; min-height: 600px; }
.hiw-inside__frame { position: relative; width: 66%; height: 600px; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); }
.hiw-inside__photo {
  position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 0% 40%;
  filter: saturate(calc(0.55 + 0.45 * var(--lit, 1)));
}
.scene.hiw-inside__scene { position: absolute; z-index: 2; right: 0; top: 50%; translate: 0 -50%; width: min(620px, 54%); height: 560px; }
.hiw-inside .stop--frame { top: var(--space-2); left: var(--space-2); }
@media (max-width: 1100px) {
  .hiw-inside__stage { min-height: 0; }
  .hiw-inside__frame { width: 100%; height: 520px; }
  .hiw-inside__photo { object-position: 40% 30%; }
  .scene.hiw-inside__scene { position: relative; top: auto; right: auto; translate: none; width: min(680px, 100%); margin: -290px auto 0; }
}
@media (max-width: 760px) {
  .hiw-inside__frame { width: auto; height: 600px; margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
  .hiw-inside__photo { object-position: 42% 30%; }
  .scene.hiw-inside__scene { width: 100%; height: 700px; margin-top: -350px; }
  .hiw-inside .stop--frame { top: 206px; left: auto; right: var(--space-2); }
}

/* ---------- AI at work: the call answered and booked, the three places AI works ---------- */
.hiw-ai__grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.hiw-ai__stage { position: relative; }
.scene.hiw-ai__scene { position: relative; width: 100%; aspect-ratio: 820 / 520; }
.hiw-ai__stage .stop--frame { top: var(--space-2); right: var(--space-2); }
.hiw-ai__ways { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.hiw-ai__team { margin-top: var(--space-4); padding-left: calc(44px + var(--space-3)); font-weight: 700; }
@media (max-width: 1000px) { .hiw-ai__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .scene.hiw-ai__scene { aspect-ratio: auto; height: 660px; } .hiw-ai__team { padding-left: 0; } }

/* ---------- The team: the owner's dashboard, a person one tap away ---------- */
.hiw-team__grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.hiw-team__frame { position: relative; aspect-ratio: 3 / 2; border-radius: var(--radius-l); overflow: hidden; background: var(--c-ink); }
.hiw-team__photo {
  position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; object-position: 0% 40%;
  filter: saturate(calc(0.55 + 0.45 * var(--lit, 1)));
}
.hiw-team .stop--frame { top: var(--space-2); right: var(--space-2); }
.hiw-team__title { font-size: var(--fs-h2); }
.hiw-team__line { margin-top: var(--space-3); max-width: 30rem; color: var(--c-ink-soft); }
.hiw-chat {
  position: absolute; left: var(--space-3); top: 50%; translate: 0 -50%; width: min(300px, 42%); min-height: 252px;
  display: grid; align-content: start; gap: 8px; padding: 12px; box-sizing: border-box; border-radius: var(--radius-l);
  background: var(--c-glass); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid color-mix(in srgb, var(--c-paper) 60%, transparent); box-shadow: var(--shadow-l);
  font: 500 14px/1.4 var(--font-ui); color: var(--c-ink);
}
.hiw-chat__msg { margin: 0; opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 10px)); }
.hiw-chat__msg:not(:first-child) { opacity: calc(var(--kit-in, 1) * (1 - var(--kit-out, 0))); }
.hiw-chat__dash { display: grid; gap: 10px; padding: 10px 12px 12px; border-radius: var(--radius-m); background: var(--c-ink); color: var(--c-on-ink); }
.hiw-chat__dash-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: color-mix(in srgb, var(--c-on-ink) 80%, transparent); }
.hiw-chat__dash-top b { font: 700 14px/1.2 var(--font-ui); color: var(--c-on-ink); }
.hiw-chat__human {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 7px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c-on-ink) 40%, transparent); font: 700 13px/1 var(--font-ui); color: var(--c-on-ink);
  transition: background-color .3s, color .3s, border-color .3s;
}
.hiw-chat__human[data-kit-on] { background: var(--c-leaf); border-color: var(--c-leaf); color: var(--c-ink); }
.hiw-chat__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-leaf-light); }
.hiw-chat__human[data-kit-on] .hiw-chat__dot { background: var(--c-ink); }
.hiw-chat__msg--you { justify-self: end; max-width: 86%; padding: 8px 12px; border-radius: 12px 12px 4px 12px; background: var(--c-brand); color: var(--c-on-brand); }
.hiw-chat__typing { justify-self: start; display: inline-flex; gap: 5px; padding: 11px 12px; border-radius: 12px; background: var(--c-paper); }
.hiw-chat__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--c-ink-soft); animation: hiw-dot 1.2s ease-in-out infinite; }
.hiw-chat__typing i:nth-child(2) { animation-delay: .2s; }
.hiw-chat__typing i:nth-child(3) { animation-delay: .4s; }
@keyframes hiw-dot { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.hiw-chat__msg--team { justify-self: start; max-width: 92%; padding: 8px 12px; border-radius: 12px 12px 12px 4px; background: var(--c-paper); border: 1px solid var(--c-line); }
.hiw-chat__by { display: block; margin-top: 4px; font: 700 13px/1.2 var(--font-ui); color: var(--c-accent-text); }
@media (prefers-reduced-motion: reduce) { .hiw-chat__typing i { animation: none; } }
@media (max-width: 1000px) { .hiw-team__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .hiw-team__frame { aspect-ratio: auto; padding-top: 420px; margin-inline: calc(-1 * var(--gutter)); border-radius: 0; overflow: visible; background: none; }
  .hiw-team__photo { inset: 0 0 auto; width: 100%; height: 420px; object-position: 62% 30%; }
  .hiw-chat { position: relative; left: auto; top: auto; translate: none; width: min(320px, calc(100% - 2 * var(--gutter))); min-height: 270px; margin: -200px auto 0; }
}

/* ---------- The close: the line ends in the button ---------- */
.hiw-close .pclose__media::after { background: linear-gradient(90deg, var(--c-shade) 0%, color-mix(in srgb, var(--c-shade) 82%, transparent) 36%, color-mix(in srgb, var(--c-shade) 10%, transparent) 64%, transparent 78%); }
.hiw-close .pclose__photo { object-position: 70% 55%; }
@media (min-width: 761px) {
  /* not a stacking context here, so the line draws over the photo into the button (thread README) */
  .page-how .hiw-close { isolation: auto; background: none; }
  .hiw-close.pclose .pclose__in { justify-items: start; text-align: left; padding-top: 140px; padding-right: 44%; }
  .hiw-close.pclose .pclose__title { font-size: var(--fs-h1); }
  .hiw-close .pclose__cta { justify-content: flex-start; }
}

/* the phone never scrolls sideways: whatever a scene or a ring draws past the page edge is cut at the thread (overflow-x: clip keeps the FAQ head sticky) */
.hiw { overflow-x: clip; }
