@import url("../arsenal/thread.css");
/* how-it-works.css: How it works (plan.md, "How it works": 3. The thread): one line of light straight down the page's
   middle, the parts in two columns on either side of it, with the tokens of system.css only. */

/* ---------- the thread: the site's wave in light, its head the mark ---------- */
.thread { --thread-ink: var(--accent-bright); --thread-track-ink: rgb(93 173 226 / 0.07); --thread-bg: var(--bg-1); --thread-w: 3px; --thread-amp: 5px; --thread-wave: 64px; --thread-tail: 170px; }
/* a current of light, not a timeline's stroke: the drawn line glows in the deep, the route still to come is a faint wide
   channel, and the head swells into a comet's tail */
.thread__ink { filter: drop-shadow(0 0 4px rgb(93 173 226 / 0.9)) drop-shadow(0 0 14px rgb(52 152 219 / 0.6)); }
.thread__track { stroke-width: 9; stroke-dasharray: none; }
.thread__tail1 { stroke-width: 24px; stroke-opacity: 0.1; }
.thread__tail2 { stroke-width: 13px; stroke-opacity: 0.16; }
.thread__tail3 { stroke-width: 6px; stroke-opacity: 0.32; }
.thread__head { filter: drop-shadow(0 0 10px rgb(93 173 226 / 0.85)); }
/* the head drawn large enough to read as the site's wave mark leading the line down (a 40 px bead, the mark 22 px) */
.thread__bead { r: 20px; }
.thread__halo { r: 50px; }
.thread__glyph { transform: translate(-11px, -11px) scale(0.9167); }
/* The header and the close give up their own stacking, so their photos sink under the line (the thread's svg, z 0)
   and their words stay over it; the other parts have no fill of their own, and the line shows through them. */
.thread > .ph, .thread > .band { isolation: auto; z-index: auto; }
.thread > .ph, .thread > .band { background: none; }
.thread > .ph > .hh__pic, .thread > .band > img { z-index: -2; }
.thread > .band::before, .thread > .band::after { z-index: -1; }
.thread > .band > .band__box { position: relative; z-index: 1; }

/* ---------- #hero: the words at the top; under them the phone in a pool of light on the walnut, its lock screen
   filling; the line starts at the picture's foot ---------- */
.ph--hiw { display: flex; flex-direction: column; align-items: stretch; min-height: max(820px, 100svh); padding-top: 92px; padding-bottom: 0; text-align: center; }
.hh { display: grid; justify-items: center; }
.hh .ph__title { max-width: 16ch; }
.hh .ph__line { margin-left: auto; margin-right: auto; }
.hh .ph__cta { align-items: center; }
.hh .ph__cta .picker__note { justify-content: center; }
/* the picture under the words: the phone's screen centered with its top 4 px down, the photo drawn from the screen's
   width (--s; the screen is 17.23% of the photo's width, its middle 34.86% across, its top 17.62% down), so its third
   notification lands inside a computer's first screen */
.hh__pic { position: relative; flex: 1 0 auto; min-height: 620px; margin: 8px calc(var(--gutter) * -1) 0; overflow: hidden; --s: clamp(224px, 16vw, 252px); }
/* a lower wave line, so the third notification lands clear of it */
.ph--hiw .ph__waves { height: 90px; }
/* the picture fades whole into the deep before the header's foot: no edge of the phone or its table meets the wave */
.hh__pic::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(180deg, var(--bg-1) 0%, rgb(5 13 26 / 0) 16%, rgb(5 13 26 / 0) 66%, var(--bg-1) 90%); }
.hh__photo {
  position: absolute; left: calc(50% - var(--s) * 2.0232); top: calc(4px - var(--s) * 0.5708); width: calc(var(--s) * 5.8038); aspect-ratio: 2752 / 1536; margin: 0;
  /* a wide pool of the walnut table around the phone, fading into the deep at its far edges (no lamp cut by the menu) */
  -webkit-mask-image: radial-gradient(ellipse 48% 88% at 36% 52%, #000 50%, transparent 100%); mask-image: radial-gradient(ellipse 48% 88% at 36% 52%, #000 50%, transparent 100%);
  --deep-shade: radial-gradient(ellipse 54% 72% at 34.86% 52%, rgb(2 8 16 / 0) 50%, rgb(2 8 16 / 0.3) 100%);
}
/* the walnut pulled toward the navy deep, lit around the phone like a pool of light */
.hh__photo::before { opacity: 0.32; }
.hh__photo > img { filter: saturate(0.95) contrast(1.05) brightness(1.55); }
/* the lock screen on the phone's glass, by its measured corners (26.25 to 43.48% across, 17.62 to 87.33% down, its
   corners rounded 13.5% by 6.4%): multiplied into the photo, with a dark ring that falls on the black bezel */
.hh__glass {
  position: absolute; z-index: 2; left: 26.25%; top: 17.62%; width: 17.23%; height: 69.71%; border-radius: 13.5% / 6.4%;
  overflow: hidden; container-type: size; mix-blend-mode: multiply; box-shadow: 0 0 0 4px var(--bg-0);
  --u: calc(100cqw / 300);
}

/* The lock screen, drawn in units of a 300-wide screen (--u): about 1.1 px each on a computer, 0.68 on a phone, so
   nothing in it is under 11 px as shown. */
.lk { position: absolute; inset: 0; display: grid; justify-items: center; align-content: start; gap: calc(8 * var(--u)); padding-top: calc(70 * var(--u)); background: radial-gradient(130% 62% at 50% 0%, var(--bg-3) 0%, var(--bg-1) 58%, var(--bg-0) 100%); }
.lk__time { font: 300 calc(72 * var(--u))/1 var(--font-display); letter-spacing: -0.03em; color: var(--text-bright); }
.lk__day { font: 500 calc(18 * var(--u))/1 var(--font-ui); color: var(--text-muted); }
.lk__n {
  position: absolute; left: calc(12 * var(--u)); right: calc(12 * var(--u)); top: calc((236 + var(--i) * 100) * var(--u));
  display: grid; grid-template-columns: calc(38 * var(--u)) minmax(0, 1fr); column-gap: calc(11 * var(--u)); row-gap: calc(3 * var(--u)); align-items: center;
  padding: calc(13 * var(--u)) calc(14 * var(--u)); border-radius: calc(20 * var(--u));
  background: rgb(232 244 255 / 0.13); box-shadow: inset 0 0 0 1px rgb(232 244 255 / 0.16), 0 calc(14 * var(--u)) calc(30 * var(--u)) calc(-16 * var(--u)) rgb(0 0 0 / 0.8);
  opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 18 * var(--u))) scale(calc(0.95 + var(--kit-in, 1) * 0.05));
}
.lk__app { grid-row: span 2; display: grid; place-items: center; width: calc(38 * var(--u)); height: calc(38 * var(--u)); border-radius: calc(11 * var(--u)); color: var(--bg-0); background: linear-gradient(150deg, var(--accent-bright) 0%, var(--accent) 100%); }
.lk__app .mark { width: calc(22 * var(--u)); height: calc(22 * var(--u)); }
.lk__n b { font: 600 calc(18 * var(--u))/1.2 var(--font-ui); color: var(--text-bright); text-align: left; }
.lk__sub { font: 400 calc(17 * var(--u))/1.25 var(--font-ui); color: var(--text-muted); text-align: left; }
.lk__stars { color: var(--gold); letter-spacing: 0.04em; }

@media (max-width: 899px) {
  .ph--hiw { min-height: 0; padding-top: 100px; }
  .hh__pic { flex: none; min-height: 0; height: 560px; margin-top: 32px; --s: 230px; }
}

/* ---------- the steps: two columns on either side of the line, each number on it ---------- */
.hw__in { position: relative; max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); row-gap: clamp(64px, 7vw, 100px); align-items: start; }
.hw__head { grid-column: 1; max-width: 520px; }
.hw__head .part__line { margin-left: 0; }
.hw__stop { position: absolute; z-index: 3; top: 26px; right: var(--gutter); }
.hw__step { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); align-items: center; }
.hw__num {
  grid-column: 2; grid-row: 1; align-self: center; justify-self: center; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  font: 600 22px/1 var(--font-display); color: var(--text-bright);
  /* lit as the line's head plugs in, glowing like a buoy's lamp, with one ring spreading out (thread.js sets --lit and
     --lit-after) */
  background: color-mix(in srgb, var(--accent) calc(var(--lit, 0) * 100%), var(--bg-2));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-bright) calc(var(--lit, 0) * 100%), var(--border-strong)), 0 0 calc(var(--lit, 0) * 30px) rgb(93 173 226 / calc(var(--lit, 0) * 0.6)), 0 0 0 calc(var(--lit-after, 0) * 20px) rgb(93 173 226 / calc((1 - var(--lit-after, 0)) * 0.32));
}
.hw__words { grid-row: 1; max-width: 420px; }
.hw__title { font: 600 clamp(1.5rem, 1.1rem + 1vw, 2rem)/1.15 var(--font-display); letter-spacing: var(--track-h); color: var(--text-bright); text-wrap: balance; }
.hw__line { margin-top: 12px; font-size: var(--fs-lead); line-height: 1.55; color: var(--text-muted); text-wrap: pretty; }
.hw__vis { grid-row: 1; position: relative; width: 100%; max-width: 520px; }
/* the first step of a part carries the part's heading above its title */
.hw__step--lead .part__title { max-width: 14ch; }
.hw__step--lead .part__line { margin: 16px 0 22px; max-width: 30rem; }
/* under the part's heading, the first step's title is set as the step's label (smaller, in the light), never a second
   headline */
.hw__step--lead .hw__title { font: 600 clamp(1.125rem, 1rem + 0.4vw, 1.3125rem)/1.3 var(--font-ui); letter-spacing: 0; color: var(--accent-bright); }
/* the words on the left, set toward the line; the picture on the right (and the other way round) */
.hw__step--left .hw__words { grid-column: 1; justify-self: end; text-align: right; }
.hw__step--left .hw__vis { grid-column: 3; justify-self: start; }
.hw__step--right .hw__words { grid-column: 3; justify-self: start; }
.hw__step--right .hw__vis { grid-column: 1; justify-self: end; }

/* the base scenes on the ground, in glass, each in the box its note asks for and lit from under it by a pool of the
   deep's light */
.hw--yours .hw__vis { isolation: isolate; }
.hw--yours .hw__vis::before { content: ''; position: absolute; inset: -18% -14%; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgb(52 152 219 / 0.34), rgb(52 152 219 / 0.1) 58%, transparent); }
.hw__vis--goal { height: 330px; }
.hw__vis--goal > .hw__scene { position: absolute; left: 0; right: 0; bottom: 0; }
@media (min-width: 600px) { .hw__vis--goal [data-scene="goal"] .gl-chips span { white-space: nowrap; } }
/* on a phone the four choices in two rows of two, each on one line */
@media (max-width: 599px) {
  .hw__vis--goal { height: 340px; }
  .hw__vis--goal [data-scene="goal"] .gl-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw__vis--goal [data-scene="goal"] .gl-chips span { white-space: nowrap; }
}
.hw__vis--scan > .hw__scene { min-height: 330px; }
.hw__vis--bars { max-width: 560px; height: 440px; }
.hw__vis--bars > .hw__scene { position: absolute; inset: 0; }

/* the hand-over node: your part done, ours begins */
.hw__hand { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); align-items: center; }
/* from your part to ours the line runs on without a long empty stretch */
@media (min-width: 900px) {
  .hw--yours { padding-bottom: calc(var(--section-y) * 0.45); }
  .hw--ours { padding-top: calc(var(--section-y) * 0.55); }
  .hw__hand { margin-top: -28px; }
}
.hw__hand .hw__node { grid-column: 2; justify-self: center; }
.hw__node {
  grid-column: 2; justify-self: center; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  color: color-mix(in srgb, var(--accent-bright) calc(var(--lit, 0) * 100%), var(--text-muted));
  background: var(--bg-2);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-bright) calc(var(--lit, 0) * 100%), var(--border-strong)), 0 0 0 calc(var(--lit-after, 0) * 20px) rgb(93 173 226 / calc((1 - var(--lit-after, 0)) * 0.32));
}
.hw__node .mark { width: 24px; height: 24px; }

/* the rows of one picture and its words (#inside, #people, #faq): the node on the line between them */
.hw__in--row { align-items: center; }
.hw__in--row > .hw__node { grid-row: 1; }
.hw__in--row > .hw__head { grid-row: 1; }

/* ---------- #ours: an owner at work in each photo, the step's scene in glass over its free corner ---------- */
.hw__shot { margin: 0; aspect-ratio: 5 / 4; max-width: 560px; --deep-shade: linear-gradient(180deg, rgb(2 8 16 / 0) 0%, rgb(2 8 16 / 0) 40%, rgb(2 8 16 / 0.6) 100%); }
.hw__shot > .hw__scene { position: absolute; z-index: 2; bottom: 16px; width: min(380px, calc(100% - 32px)); height: 322px; }
.hw__shot--bl > .hw__scene { left: 16px; }
.hw__shot--br > .hw__scene { right: 16px; }
.hw--ours .hw__shot > img { object-position: 50% 30%; }
/* the dentist drawn larger from the photo's far corner, so her face moves up and left, clear of the card at the right */
.hw--ours .hw__shot--ours-tune > img { object-position: 100% 30%; transform: scale(1.15); transform-origin: 100% 100%; }
/* the florist's white shop is the brightest of the three: graded down further, into the same night; drawn larger from
   the photo's left edge, so her face moves right of the card and stands clear of it at every moment */
.hw--ours .hw__shot--ours-launch > img { filter: saturate(0.85) contrast(1.12) brightness(0.46); object-position: 0% 30%; transform: scale(1.22); transform-origin: 0% 0%; }
/* the scenes over the photos float as their own cards: their stages paint no box of their own (no box in a box) */
.hw .hw__shot > .hw__scene[data-scene] {
  --ln-stage: transparent; --ln-edge: transparent; --ld-stage: transparent; --ld-edge: transparent; --tn-stage: transparent; --tn-edge: transparent;
  background: none; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
/* daylight photos pulled into the site's night by light, not by color: darker, with more contrast, the deep's color
   wash kept faint, so white walls go deep instead of milky and skin keeps its own tone */
.hw__shot > img { filter: saturate(0.88) contrast(1.14) brightness(0.6); }
.hw__shot::before { opacity: 0.12; }

/* ---------- #inside: plan-builder on the ground, at the right of the line ---------- */
.hw--inside .hw__head { grid-column: 1; justify-self: end; text-align: right; }
.hw--inside .hw__head .part__line { margin-left: auto; margin-right: 0; }
.hw__vis--plan { grid-column: 3; grid-row: 1; max-width: 520px; height: 680px; }
.hw__vis--plan > .hw__scene { position: absolute; inset: 0; background: none; }
/* the plan card in front of the list is solid, and the list steps back fully behind it (plan-builder.js), so no row
   shows through it or stands cut by its edge */
.hw .hw__vis--plan [data-scene="plan-builder"] .pb-plan, .hw .hw__vis--plan [data-scene="plan-builder"] .pb-veil { background: var(--pb-card); }

/* ---------- #people: the dashboard over the photo's free left side ---------- */
.hw--people .hw__shot { grid-column: 1; grid-row: 1; justify-self: end; }
.hw--people .hw__head { grid-column: 3; }
.hw__shot--people > img { object-position: 60% 40%; }
.hp { position: absolute; z-index: 2; left: 16px; bottom: 16px; width: min(300px, calc(100% - 32px)); display: grid; gap: 10px; }
.hp__card, .hp__msg {
  border-radius: 18px; background: rgb(10 22 40 / 0.72); box-shadow: inset 0 0 0 1px var(--border-strong), inset 0 1px 0 var(--edge-light), 0 18px 40px -20px rgb(0 0 0 / 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
}
.hp__card { display: grid; gap: 12px; padding: 14px 16px 16px; }
.hp__top { display: flex; align-items: center; gap: 10px; }
.hp__top b { font: 600 15px/1.2 var(--font-ui); color: var(--text-bright); }
.hp__badge { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: var(--bg-0); background: linear-gradient(150deg, var(--accent-bright) 0%, var(--accent) 100%); }
.hp__badge .mark { width: 18px; height: 18px; }
.hp__btn { display: grid; place-items: center; height: 42px; border-radius: 999px; font: 600 15px/1 var(--font-ui); color: var(--text-bright); background: rgb(52 152 219 / 0.18); box-shadow: inset 0 0 0 1px rgb(93 173 226 / 0.45); }
.hp__msg { margin: 0; padding: 11px 14px; font: 400 14px/1.4 var(--font-ui); color: var(--text); opacity: var(--kit-in, 1); transform: translateY(calc((1 - var(--kit-in, 1)) * 12px)); }
.hp__msg--you { justify-self: end; max-width: 86%; color: var(--bg-0); background: linear-gradient(150deg, var(--accent-bright) 0%, var(--accent) 100%); box-shadow: 0 12px 28px -16px var(--glow); -webkit-backdrop-filter: none; backdrop-filter: none; }
.hp__msg--team b { display: block; margin-bottom: 3px; font: 600 13px/1.2 var(--font-ui); color: var(--accent-bright); }

/* ---------- #faq: the heading at the left of the line, the questions at its right ---------- */
.hw--faq .hw__head { grid-column: 1; justify-self: end; text-align: right; align-self: start; }
.hw__faq { grid-column: 3; grid-row: 1; max-width: none; margin: 0; }

/* ---------- #close: the shop owner at dusk; the line ends in the glass box ---------- */
/* the photo drawn larger from its left edge, so her face sits right of the glass box */
.hw-close > img { object-position: 60% 30%; transform: scale(1.22); transform-origin: 0% 30%; }
.hw-close .band__box { box-shadow: var(--shadow-l), 0 0 0 calc(var(--lit-after, 0) * 22px) rgb(93 173 226 / calc((1 - var(--lit-after, 0)) * 0.28)); }
.hw-close .band__box[data-lit] .btn--main { box-shadow: 0 0 0 4px rgb(93 173 226 / 0.28), 0 14px 34px -12px var(--glow); }

/* ---------- a phone: one column, each number beside its step's title ---------- */
@media (max-width: 899px) {
  .hw__in, .hw__step, .hw__hand { grid-template-columns: minmax(0, 1fr); row-gap: 56px; }
  .hw__step { grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; row-gap: 26px; align-items: start; }
  .hw__num { grid-column: 1; grid-row: 1; align-self: start; width: 48px; height: 48px; font-size: 19px; }
  .hw__step--lead .hw__num { align-self: end; margin-bottom: 34px; }
  .hw__step--left .hw__words, .hw__step--right .hw__words { grid-column: 2; grid-row: 1; justify-self: start; text-align: left; }
  .hw__step--left .hw__vis, .hw__step--right .hw__vis { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; max-width: none; }
  .hw__vis--goal, .hw__vis--scan { max-width: 440px; justify-self: start; }
  .hw__vis--bars { height: 400px; }
  .hw__hand { grid-template-columns: 52px minmax(0, 1fr); column-gap: 14px; }
  .hw__hand .hw__node { grid-column: 1; grid-row: 1; justify-self: center; }
  .hw__in--row > .hw__node { display: none; }
  .hw__in--row > * { grid-row: auto !important; grid-column: 1 !important; }
  .hw--inside .hw__head, .hw--faq .hw__head { justify-self: start; text-align: left; }
  .hw--inside .hw__head .part__line { margin-left: 0; }
  .hw__vis--plan { max-width: none; height: 700px; }
  .hw--people .hw__head { order: -1; }
  /* each photo first, whole, and its scene under it, rising over its foot */
  .hw__shot { max-width: none; aspect-ratio: auto; overflow: visible; background: none; box-shadow: none; border-radius: 0; }
  .hw__shot > img { position: relative; inset: auto; display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: var(--radius-l); }
  .hw__shot::before, .hw__shot::after { bottom: auto; aspect-ratio: 4 / 3; border-radius: var(--radius-l); }
  .hw__shot > .hw__scene { position: relative; left: auto; right: auto; bottom: auto; width: auto; height: 344px; margin: -56px 10px 0; }
  .hw--ours .hw__shot--ours-leads > img { object-position: 82% 35%; }
  .hw--ours .hw__shot--ours-tune > img, .hw--ours .hw__shot--ours-launch > img { object-position: 50% 30%; transform: none; }
  /* her photo taller on a phone, and the dashboard with the messages on it, over its foot, clear of her face */
  .hw__shot--people { --deep-shade: linear-gradient(180deg, rgb(2 8 16 / 0) 38%, rgb(2 8 16 / 0.72) 100%); }
  .hw__shot--people > img { aspect-ratio: 3 / 4; object-position: 66% 30%; }
  .hw__shot--people::before, .hw__shot--people::after { aspect-ratio: 3 / 4; }
  .hp { left: 10px; right: auto; bottom: 10px; width: 52%; }
  /* the close: her photo first, whole, and the glass box under it */
  .band.hw-close { display: block; padding: 0 var(--gutter) 96px; --deep-shade: linear-gradient(180deg, rgb(5 13 26 / 0) 0, rgb(5 13 26 / 0) 40vw, var(--bg-1) 76vw, var(--bg-1) 100%); }
  .hw-close > img { position: relative; display: block; inset: auto; width: calc(100% + var(--gutter) * 2); height: auto; margin: 0 calc(var(--gutter) * -1); aspect-ratio: 4 / 3.1; object-position: 74% 30%; transform: none; }
  .band.hw-close .band__box { margin: -40px auto 0; }
}
/* a narrower computer: the frames keep their height, so each card stays on its photo at its foot and each face stands
   above it */
@media (min-width: 900px) and (max-width: 1279px) {
  .hw--ours .hw__shot { aspect-ratio: auto; height: 520px; }
  .hw--ours .hw__shot--ours-launch > img { object-position: 60% 30%; transform: none; }
  .hw--ours .hw__shot--ours-leads > img { object-position: 100% 30%; }
  .hw--ours .hw__shot--ours-tune > img { object-position: 30% 30%; transform: scale(1.15); transform-origin: 30% 100%; }
}
