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

/* how-it-works.css: the How it works page's own placing and sizing (plan.md, How it works), with the tokens of system.css only. */

.hw-thread { --thread-ink: var(--c-ink); --thread-bg: var(--c-paper); --thread-w: 1.5px; --thread-radius: 40px; }
/* this site's bands are positioned, so they would cover the line: it rises over their grounds, and what it goes behind rises over it */
.hw-thread .thread__svg { z-index: 1; }
.hw-thread [data-thread-anchor], .hw-thread [data-thread-light] { z-index: 2; }
/* one column: no line, since it would run over the words; the lighting still plays */
@media (max-width: 860px) { .hw-thread { --thread-narrow: 1; } }

/* ---------- hero: a full-width clip, the words on a paper sheet laid low on its left ---------- */
.hw-hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(620px, calc(100svh - var(--masthead-h) - 6px), 800px); overflow: hidden; background: var(--c-paper-alt); }
.hw-hero__media { position: absolute; inset: 0; }
[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); }
[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: 1px; width: calc(100% - 2px); height: calc(100% - 2px); 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; }
/* the calendar clips were shot from across the table: turned, so their numbers read upright and the hand comes from below */
.hw-hero__slide video, .hw-hero__slide .kit-first { transform: rotate(180deg); }
.hw-hero__stop { position: absolute; top: 18px; right: max(var(--gutter), calc((100% - var(--max-w)) / 2)); z-index: 4; }
.hw-hero__in { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 620px) minmax(0, 1fr); gap: clamp(40px, 7vw, 120px); align-items: end; }
.hw-hero__sheet { position: relative; padding: 34px clamp(24px, 3vw, 40px) 30px; background: var(--c-paper); box-shadow: var(--shadow-l); }
.hw-hero__sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-top: 1px solid var(--c-ink); border-bottom: 2px solid var(--c-ink); }
.hw-hero__title { font-size: var(--fs-h1); line-height: 1.06; text-wrap: balance; }
.hw-hero__line { margin-top: 16px; font-size: clamp(1.125rem, 1.05rem + .35vw, 1.3125rem); color: var(--c-ink-soft); }
.hw-hero__go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 24px; }
.hw-hero__go p { font-size: var(--fs-small); color: var(--c-ink-soft); }
.hw-hero__in .hw-hero__scene { align-self: end; height: 372px; margin: 0 0 40px; max-width: 500px; justify-self: end; width: 100%; }
@media (max-width: 1020px) {
  .hw-hero__in { grid-template-columns: minmax(0, 1fr); }
  .hw-hero__in .hw-hero__scene { display: none; }
}
@media (max-width: 760px) {
  .hw-hero { display: block; min-height: 0; overflow: visible; }
  .hw-hero__media { position: relative; height: 330px; overflow: hidden; }
  .hw-hero__stop { right: 16px; top: 14px; }
  .hw-hero__sheet { margin: -28px 0 0; padding: 28px 18px 22px; }
}

/* ---------- yours: one broadsheet sheet on the designed ground ---------- */
.hw-yours .head { margin-bottom: clamp(44px, 5vw, 64px); }
/* the line keeps the page's middle: every headline stays on its left half */
.hw-yours .head--row > div, .hw-inside .head--row > div { max-width: calc(50% - 56px); }
@media (max-width: 860px) { .hw-yours .head--row > div, .hw-inside .head--row > div { max-width: none; } }
.hw-node { position: relative; z-index: 2; display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto -23px; border: 1px solid var(--c-ink); border-radius: 50%; background: var(--c-card); color: var(--c-ink); }
.hw-sheet { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 6px; background: var(--c-card); box-shadow: 0 0 0 1px var(--c-line), var(--shadow-l); }
.hw-sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; border-top: 1px solid var(--c-ink); border-bottom: 2px solid var(--c-ink); }
.hw-col { display: flex; flex-direction: column; min-width: 0; padding: 34px clamp(18px, 2.2vw, 30px) 20px; border-left: 1px solid var(--c-line); }
.hw-col:first-child { border-left: 0; }
.hw-num { font: 500 clamp(3.25rem, 2.4rem + 2.6vw, 5rem)/.9 var(--font-display); letter-spacing: -.03em; color: var(--c-brand-text); }
.hw-col__title { margin-top: 12px; font-size: var(--fs-h3); line-height: 1.15; }
.hw-col__tag { align-self: flex-start; margin: 10px 0 0; }
.hw-col__line { margin-top: 10px; font-size: 1rem; line-height: 1.45; color: var(--c-ink-soft); }
.hw-col__scene { display: flex; align-items: flex-end; justify-content: center; margin-top: auto; padding-top: 18px; min-height: 366px; }
.hw-col__box { position: relative; width: 100%; max-width: 420px; }
.hw-col__box--first { padding-top: 46px; }
.hw-col__stop { position: absolute; top: 0; right: 0; }
.hw-col__scene .hw-col__stage { width: 100%; }
@media (max-width: 1020px) {
  .hw-sheet { grid-template-columns: minmax(0, 1fr); }
  .hw-col { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; border-left: 0; border-top: 1px solid var(--c-line); padding: 22px 16px 16px; }
  .hw-col:first-child { border-top: 0; }
  .hw-num { font-size: 3rem; grid-row: span 3; }
  .hw-col__title { margin-top: 2px; }
  .hw-col__tag { justify-self: start; }
  .hw-col__line, .hw-col__scene { grid-column: 1 / -1; }
  .hw-col__scene { min-height: 0; }
  /* the chat's panel stands at its full height from the first frame and fills from the bottom, so nothing under it moves */
  .hw-col__scene .hw-col__stage[data-scene="goal"] { min-height: 258px; justify-content: flex-end; }
}

/* ---------- ours: three rows along the line, the numerals on it ---------- */
.hw-hand { display: table; margin: 0 auto clamp(40px, 5vw, 64px); padding: 9px 16px; border: 1px solid var(--c-ink); border-radius: var(--radius-s); background: var(--c-card); font: 600 .9375rem/1.2 var(--font-ui); }
.hw-ours .head { max-width: calc(50% - 56px); }
.hw-rows { display: grid; gap: clamp(44px, 5.5vw, 76px); }
.hw-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr); gap: 0; align-items: center; }
.hw-row__words { grid-column: 1; padding-right: clamp(16px, 3vw, 44px); }
.hw-row__media { grid-column: 3; position: relative; margin: 0; height: clamp(400px, 34vw, 460px); overflow: hidden; border-radius: var(--radius-m); background: var(--c-paper-alt); }
.hw-num--line { grid-column: 2; grid-row: 1; justify-self: center; display: grid; place-items: center; width: 76px; height: 76px; border: 1px solid var(--c-ink); border-radius: 50%; background: var(--c-card); font-size: 2.75rem; line-height: 1; }
.hw-row--flip .hw-row__words { grid-column: 3; grid-row: 1; padding: 0 0 0 clamp(16px, 3vw, 44px); }
.hw-row--flip .hw-row__media { grid-column: 1; grid-row: 1; }
.hw-row__title { font-size: clamp(1.6rem, 1.3rem + 1vw, 2.15rem); line-height: 1.1; }
.hw-row__words p { margin-top: 12px; color: var(--c-ink-soft); }
.hw-row__words .tag { margin: 10px 0 0; }
.hw-row__pic { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.hw-row__pic--launch { object-position: 70% 40%; }
.hw-row__pic--leads { object-position: 34% 30%; }
.hw-row__pic--tune { object-position: 72% 40%; }
.hw-row__stop { position: absolute; top: 12px; right: 12px; z-index: 3; }
.hw-row__media .hw-row__scene { position: absolute; z-index: 2; bottom: 12px; width: min(330px, 60%); }
.hw-row__media .hw-row__scene--left { left: 12px; }
.hw-row__media .hw-row__scene--right { right: 12px; }
/* the board alone stands on the clip, with no panel around it */
.hw-row__media [data-scene="leads"] { --ld-stage: transparent; --ld-edge: transparent; }
@media (max-width: 860px) {
  .hw-ours .head { max-width: none; }
  .hw-row, .hw-row--flip { grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
  .hw-num--line { grid-column: 1; grid-row: 1; width: 54px; height: 54px; font-size: 2rem; }
  .hw-row__words, .hw-row--flip .hw-row__words { grid-column: 2; grid-row: 1; padding: 0; }
  /* the picture on top with its faces clear, the card over its lower half and past its foot */
  .hw-row__media, .hw-row--flip .hw-row__media { grid-column: 1 / -1; grid-row: 2; margin-top: 16px; height: auto; padding-top: 176px; overflow: visible; background: none; }
  .hw-row__pic { inset: 0 0 auto; width: 100%; height: 350px; border-radius: var(--radius-m); }
  .hw-row__pic--launch { object-position: 84% 40%; }
  .hw-row__pic--tune { object-position: 100% 40%; }
  .hw-row__media .hw-row__scene { position: relative; bottom: auto; left: auto; right: auto; width: calc(100% - 24px); margin: 0 auto; }
  /* the lawyer's chin stays above the card, and the card stays half on the photo */
  .hw-row:first-of-type .hw-row__media { padding-top: 206px; }
  .hw-row:first-of-type .hw-row__pic { height: 380px; }
}

/* ---------- list: the full-bleed clip, the shade only behind the words ---------- */
.hw-list { position: relative; display: flex; align-items: center; min-height: clamp(620px, 52vw, 760px); padding: clamp(48px, 6vw, 80px) 0; overflow: hidden; background: var(--c-ink-deep); }
.hw-list__media { position: absolute; inset: 0; }
.hw-list__video { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; }
.hw-list__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13, 15, 38, .76) 0%, rgba(13, 15, 38, .44) 34%, rgba(13, 15, 38, 0) 62%); }
.hw-list__stop { position: absolute; top: 18px; right: 18px; z-index: 3; }
.hw-list__in { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.hw-list__title { font-size: var(--fs-h2); color: var(--c-white); }
.hw-list__line { margin-top: 14px; max-width: 30em; font-size: 1.125rem; color: rgba(255, 255, 255, .92); }
.hw-list__in .hw-list__scene { position: relative; display: block; align-self: end; }
@media (max-width: 860px) {
  /* the words on the ink, the carpenter in the clear under them, the lists over the clip's lower half */
  .hw-list { display: block; padding: 40px 0 24px; min-height: 0; }
  .hw-list__media { top: 200px; height: 620px; bottom: auto; overflow: hidden; }
  .hw-list__video { top: -190px; height: 810px; object-position: 40% 50%; }
  .hw-list__in { grid-template-columns: minmax(0, 1fr); gap: 230px; }
  .hw-list__shade { background: linear-gradient(180deg, var(--c-ink-deep) 0%, rgba(13, 15, 38, 0) 14%); }
  .hw-list__stop { top: 214px; right: 12px; }
}

/* ---------- inside: the plan's cards over the framed photo ---------- */
.hw-inside__frame { position: relative; margin: 0; height: clamp(500px, 42vw, 560px); overflow: hidden; border-radius: var(--radius-m); background: var(--c-paper-alt); }
.hw-inside__pic { position: absolute; left: -32%; top: -6%; width: 142%; height: 120%; max-width: none; object-fit: cover; }
.hw-inside__stop { position: absolute; top: 14px; left: 14px; z-index: 3; }
.hw-inside__frame .hw-inside__scene { position: absolute; z-index: 2; top: 0; right: 0; bottom: 0; width: min(760px, 62%); }
.hw-inside__frame .hw-inside__scene .pc-stage { height: 100%; border: 0; background: transparent; box-shadow: none; }
.hw-inside__frame .hw-inside__scene .pc-stage::before { display: none; }
/* from 700 px the back cards stand 58% of a card's width to each side: at 46% of the stage every card stays whole on the photo */
@container (width >= 700px) {
  .hw-inside__frame .hw-inside__scene .pc-card { width: 46%; }
  .hw-inside__frame .hw-inside__scene .pc-row { grid-template-columns: 26px minmax(0, 1fr) 46px auto; gap: 8px; }
  .hw-inside__frame .hw-inside__scene .pc-ic { width: 26px; height: 26px; }
}
@media (max-width: 860px) {
  .hw-inside__frame { height: auto; overflow: visible; background: none; padding-top: 200px; }
  .hw-inside__pic { left: 0; top: 0; width: 100%; height: 440px; border-radius: var(--radius-m); object-position: 44% 20%; }
  .hw-inside__frame .hw-inside__scene { position: relative; width: 100%; }
  .hw-inside__frame .hw-inside__scene .pc-stage { height: 440px; }
}

/* ---------- team: Ross's card, the phone that reaches the team ---------- */
.hw-team__in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hw-team .person { margin-top: 26px; max-width: 520px; }
.hw-team__frame { position: relative; height: clamp(520px, 46vw, 620px); border-radius: var(--radius-m); overflow: hidden; background: var(--c-ink); }
.hw-team__pic { position: absolute; inset: 0; margin: 0; }
.hw-team__pic > img { position: absolute; left: -38%; top: -8%; width: 190%; height: 118%; max-width: none; }
.hw-team__stop { position: absolute; top: 14px; right: 14px; z-index: 3; }
.hw-team .screen { border-radius: 30px; box-shadow: 0 0 0 3px var(--c-ink-deep); }
.hw-dash { position: relative; display: flex; flex-direction: column; gap: 10px; width: 100%; height: 100%; padding: 44px 13px 16px; background: var(--c-card); color: var(--c-ink); font-family: var(--font-ui); }
.hw-dash__top { display: grid; gap: 8px; }
.hw-dash__title { font: 600 30px/1.1 var(--font-display); }
.hw-dash__tile { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-paper); }
.hw-dash__tile span { font-size: 22px; line-height: 1.15; color: var(--c-ink-soft); }
.hw-dash__tile b { font: 600 30px/1 var(--font-display); }
.hw-dash__button { position: relative; padding: 12px; border-radius: 12px; background: var(--c-brand); color: var(--c-on-brand); text-align: center; font-size: 23px; font-weight: 700; }
.hw-dash__pressed { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 12px; background: var(--c-brand-dark); opacity: var(--kit-in, 1); }
.hw-dash__msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 22px; line-height: 1.2; opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 14px)); }
.hw-dash__msg b { display: block; font-size: 21px; color: var(--c-brand-text); }
.hw-dash__msg--out { align-self: flex-end; background: var(--c-brand); color: var(--c-on-brand); }
.hw-dash__msg--in { align-self: flex-start; background: var(--c-paper-alt); }
@media (max-width: 860px) {
  .hw-team__in { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- faq: the line runs down the gap between its columns ---------- */
.hw-faq .faq__grid { position: relative; }
.hw-lane { position: absolute; left: calc(36.4% - 10px); top: 0; width: 1px; height: 1px; }
.hw-lane--foot { top: auto; bottom: 0; }
.hw-lane--out { top: auto; bottom: calc(10px - var(--section-y)); left: calc(var(--hw-go-x) + 1px); }

/* ---------- close: the words and the button low, the owner's face clear above them; the line runs on into the button, in white over the clip ---------- */
.hw-thread { --hw-go-x: calc(var(--gutter) + 480px + clamp(28px, 5vw, 72px) + 170px); }
.hw-close { z-index: 2; align-items: flex-end; padding-bottom: 44px; }
.hw-close .closing__video { object-position: 60% 40%; }
.hw-close .closing__shade { background: linear-gradient(90deg, rgba(13, 15, 38, .86) 0%, rgba(13, 15, 38, .6) 40%, rgba(13, 15, 38, 0) 70%); }
.hw-close .closing__in { grid-template-columns: 480px 340px; justify-content: start; align-items: end; }
.hw-close .closing__go { position: relative; }
.hw-close .closing__go::before { content: ""; position: absolute; left: 50%; bottom: 100%; width: 2px; height: 900px; margin-left: -1px; background: var(--c-white); }
@media (max-width: 960px) {
  .hw-close { display: block; padding-top: 272px; }
  .hw-close .closing__in { grid-template-columns: minmax(0, 1fr); }
  .hw-close .closing__video { object-position: 80% 40%; }
  .hw-close .closing__shade { background: linear-gradient(180deg, rgba(13, 15, 38, 0) 0%, rgba(13, 15, 38, 0) 30%, rgba(13, 15, 38, .84) 48%, rgba(13, 15, 38, .9) 100%); }
  .hw-close .closing__stop { top: 14px; left: 14px; right: auto; }
  .hw-close .closing__go::before { display: none; }
  .hw-lane--out { left: 50%; }
}
