/* 06 · how: the steps as keyframes on an editor's timeline. Every rule is scoped to [data-part="how"]. */
[data-part="how"] {
  --hw-panel: #161B24;          /* Night lifted a touch: the editor's panel */
  --hw-line: rgba(234, 220, 195, .34);
  --hw-s: 22px;                 /* the pixel */
  --hw-k: 12px;                 /* a keyframe */
  --hw-air: 150px;              /* room above the track for the pixel's arcs */
  --hw-pad: 28px;               /* the panel's inline padding; the track lines up with the step columns */
  --hw-cg: 28px;                /* gap between step columns */
}
[data-part="how"] .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[data-part="how"] .hw-h { margin-bottom: clamp(40px, 5vw, 72px); }

/* ---------- the editor panel ---------- */
[data-part="how"] .hw-ed { position: relative; background: var(--hw-panel); border: 1px solid var(--wire); border-radius: 10px; }
[data-part="how"] .hw-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px calc(var(--hw-pad) - 10px); border-bottom: 1px solid var(--wire); }
[data-part="how"] .hw-tr { display: flex; gap: 4px; }
[data-part="how"] .hw-b { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; transition: background-color .2s ease; }
[data-part="how"] .hw-b:hover { background: rgba(234, 220, 195, .08); }
[data-part="how"] .hw-b svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
[data-part="how"] .hw-b path[d$="z"] { fill: currentColor; }
[data-part="how"] .hw-play .i-again, [data-part="how"] .hw-play[data-done] .i-play { display: none; }
[data-part="how"] .hw-play[data-done] .i-again { display: inline; }
html[dir="rtl"] [data-part="how"] .hw-b[data-go] svg { transform: scaleX(-1); }
[data-part="how"] .hw-read { font-size: 14px; color: var(--ink-2); direction: ltr; white-space: nowrap; }
[data-part="how"] .hw-read [data-read] { color: var(--ink); }
[data-part="how"] .hw-kfi { font-size: 11px; vertical-align: 1px; }
/* Without JavaScript there's nothing to drive: no transport, no playhead. */
html:not(.js) [data-part="how"] .hw-bar, html:not(.js) [data-part="how"] .hw-ph { display: none; }

/* ---------- the steps: five clips, one per keyframe ---------- */
[data-part="how"] .hw-steps { list-style: none; margin: 0; padding: 30px var(--hw-pad) 6px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: var(--hw-cg); }
[data-part="how"] .hw-step { display: flex; flex-direction: column; border-top: 2px solid var(--wire); padding-top: 18px; transition: border-color .25s ease; }
[data-part="how"] .hw-n { font-size: 13px; color: var(--ink-2); margin: 18px 0 6px; }
[data-part="how"] .hw-t { font: 700 clamp(20px, 1.6vw, 24px)/1.4 var(--f-ar); transition: color .25s ease; }
html[lang="en"] [data-part="how"] .hw-t { font: 650 clamp(20px, 1.55vw, 23px)/1.18 var(--f-en); letter-spacing: -.012em; }
[data-part="how"] .hw-d { margin-top: 8px; font-size: 16.5px; line-height: 1.65; color: var(--ink-2); max-width: 22em; transition: color .25s ease; }
html[lang="en"] [data-part="how"] .hw-d { line-height: 1.45; }
[data-part="how"] .hw-d .tlink { color: var(--ink); }
/* With the script on, the step under the playhead is lit and the rest step back (still easy to read). */
[data-part="how"].hw-live .hw-step { cursor: pointer; }
[data-part="how"].hw-live .hw-step:not(.cur) .hw-t { color: var(--ink-2); }
[data-part="how"].hw-live .hw-step:not(.cur) .hw-d { color: rgba(234, 220, 195, .6); }
[data-part="how"].hw-live .hw-step.cur { border-top-color: var(--ink); }

/* ---------- the track ---------- */
[data-part="how"] .hw-track { position: relative; height: 78px; margin: 10px var(--hw-pad) 0; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
[data-part="how"].hw-live .hw-track { cursor: ew-resize; }
[data-part="how"] .hw-track:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; border-radius: 4px; }
[data-part="how"] .hw-ruler { position: absolute; inset: 0 0 auto; height: 12px; background: repeating-linear-gradient(90deg, var(--hw-line) 0 1px, transparent 1px 14px); opacity: .55; }
[data-part="how"] .hw-line { position: absolute; inset-inline: 0; bottom: 22px; height: 2px; background: var(--hw-line); }
[data-part="how"] .hw-kf { position: absolute; bottom: calc(1px - var(--hw-k) / 2); width: var(--hw-k); height: var(--hw-k); border-radius: 2.4px; border: 1.5px solid rgba(234, 220, 195, .62); background: var(--hw-panel); inset-inline-start: calc(var(--i) * (100% + var(--hw-cg)) / 5); transition: background-color .2s ease, border-color .2s ease; }
[data-part="how"] .hw-kf:nth-child(1) { --i: 0; } [data-part="how"] .hw-kf:nth-child(2) { --i: 1; } [data-part="how"] .hw-kf:nth-child(3) { --i: 2; }
[data-part="how"] .hw-kf:nth-child(4) { --i: 3; } [data-part="how"] .hw-kf:nth-child(5) { --i: 4; }
[data-part="how"] .hw-kf b { position: absolute; top: calc(100% + 6px); inset-inline-start: 50%; translate: -50% 0; font-size: 11px; line-height: 1; color: var(--ink-2); }
html[dir="rtl"] [data-part="how"] .hw-kf b { translate: 50% 0; }
[data-part="how"] .hw-kf.on { background: var(--ink); border-color: var(--ink); }
[data-part="how"] .hw-kf.on b { color: var(--ink); }
/* the playhead: Sand, never teal (teal is the pixel's) */
[data-part="how"] .hw-ph { position: absolute; top: -4px; bottom: 23px; left: 0; width: 0; z-index: 1; pointer-events: none; }
[data-part="how"] .hw-ph i { position: absolute; top: 14px; bottom: 0; left: -.75px; width: 1.5px; background: var(--ink); }
[data-part="how"] .hw-ph::before { content: ""; position: absolute; top: 0; left: -7px; width: 14px; height: 16px; background: var(--ink); clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%); border-radius: 2px; }
html:not(.js) [data-part="how"] .hw-ph { display: none; }
[data-part="how"] .hw-cv { position: absolute; left: 0; bottom: 0; width: 100%; height: calc(100% + var(--hw-air)); pointer-events: none; z-index: 2; }
/* Without the canvas (no script) the pixel stands on the last keyframe, finished: the work is delivered. */
[data-part="how"] .hw-px { position: absolute; bottom: calc(23px + var(--hw-k) / 2); inset-inline-start: calc(4 * (100% + var(--hw-cg)) / 5 + var(--hw-k) / 2 - var(--hw-s) / 2); width: var(--hw-s); height: var(--hw-s); border-radius: 18.5%; background: var(--wadi); }
[data-part="how"].hw-live .hw-px { display: none; }

[data-part="how"] .hw-price { margin-top: clamp(28px, 3vw, 44px); font-size: clamp(18px, 1.4vw, 21px); line-height: 1.6; color: var(--ink-2); max-width: 34em; }
html[lang="en"] [data-part="how"] .hw-price { line-height: 1.45; }

/* ---------- the thumbnails: each step's own small act ---------- */
[data-part="how"] .hw-th { height: 92px; display: flex; align-items: flex-end; gap: 6px; color: var(--ink); --wire2: rgba(234, 220, 195, .3); }

/* 1 · the form: one choice gets picked */
[data-part="how"] .th-form { flex-wrap: wrap; align-content: flex-end; }
[data-part="how"] .th-form .ch { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 999px; border: 1.5px solid var(--wire2); font-size: 13px; line-height: 1; white-space: nowrap; color: var(--ink-2); }
[data-part="how"] .th-form .ch-pick { background: var(--ink); border-color: var(--ink); color: var(--hw-panel); font-weight: 600; }

/* 2 · the reply: our message lands, then the call */
[data-part="how"] .th-reply { align-items: flex-end; gap: 8px; }
[data-part="how"] .th-reply .bub { display: flex; align-items: center; gap: 8px; width: 148px; height: 44px; padding: 0 12px; border-radius: 12px 12px 12px 3px; border: 1.5px solid var(--ink); transform-origin: 0 100%; }
html[dir="rtl"] [data-part="how"] .th-reply .bub { border-radius: 12px 12px 3px 12px; transform-origin: 100% 100%; }
[data-part="how"] .th-reply .av { width: 18px; height: 18px; flex: none; }
[data-part="how"] .th-reply .bub i { display: block; height: 5px; border-radius: 3px; background: var(--ink); opacity: .8; flex: 1; }
[data-part="how"] .th-reply .bub i + i { flex: .55; opacity: .45; }
[data-part="how"] .th-reply .call { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--hw-panel); }
[data-part="how"] .th-reply .call svg { width: 16px; height: 16px; fill: currentColor; }

/* 3 · the price and the date: the price line is set, a day gets ringed */
[data-part="how"] .th-date { gap: 10px; }
[data-part="how"] .th-date .doc { width: 50px; height: 62px; border-radius: 5px; border: 1.5px solid var(--ink-2); padding: 10px 8px; display: grid; align-content: start; gap: 6px; }
[data-part="how"] .th-date .doc i { display: block; height: 4px; border-radius: 2px; background: var(--wire2); }
[data-part="how"] .th-date .doc i:nth-child(2) { width: 70%; }
[data-part="how"] .th-date .doc .pr { height: 6px; width: 85%; margin-top: 8px; background: var(--ink); }
[data-part="how"] .th-date .cal { display: grid; grid-template-columns: repeat(7, 14px); gap: 4px; padding-bottom: 2px; }
[data-part="how"] .th-date .cal i { width: 14px; height: 14px; border-radius: 3px; background: var(--wire2); }
[data-part="how"] .th-date .cal .dy { background: none; box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 3px var(--hw-panel), 0 0 0 4.5px var(--ink); }

/* 4 · the master frames: four sketches, each stamped OK */
[data-part="how"] .th-frames { display: grid; grid-template-columns: repeat(2, 66px); gap: 8px 10px; align-content: end; }
[data-part="how"] .th-frames .fr { position: relative; width: 66px; aspect-ratio: 8 / 5; border-radius: 4px; border: 1.5px solid var(--ink); }
[data-part="how"] .th-frames svg { width: 100%; height: 100%; fill: none; stroke: var(--ink-2); stroke-width: 1.1; }
[data-part="how"] .th-frames .p { stroke: var(--ink); stroke-width: 1.4; fill: rgba(234, 220, 195, .25); }
[data-part="how"] .th-frames .gr { stroke: var(--wire2); }
[data-part="how"] .th-frames .arc { stroke-dasharray: 1.6 2.4; stroke: var(--ink-2); }
[data-part="how"] .th-frames .wd { stroke: var(--ink-2); stroke-width: 2.2; stroke-linecap: round; }
[data-part="how"] .th-frames .ok { position: absolute; top: -8px; inset-inline-end: -7px; width: 19px; height: 19px; border-radius: 4px; display: grid; place-items: center; background: var(--ink); color: var(--hw-panel); font: 700 12px/1 var(--f-en); rotate: -8deg; }

/* 5 · every size: four frames, delivered */
[data-part="how"] .th-sizes { gap: 9px; }
[data-part="how"] .th-sizes .sz { position: relative; flex: none; border-radius: 4px; border: 1.5px solid var(--ink); background: rgba(234, 220, 195, .1); margin-bottom: 17px; }
[data-part="how"] .th-sizes .sz:nth-child(1) { width: 38px; height: 67px; }
[data-part="how"] .th-sizes .sz:nth-child(2) { width: 45px; height: 56px; }
[data-part="how"] .th-sizes .sz:nth-child(3) { width: 45px; height: 45px; }
[data-part="how"] .th-sizes .sz:nth-child(4) { width: 70px; height: 39px; }
[data-part="how"] .th-sizes .sz b { position: absolute; top: calc(100% + 5px); inset-inline-start: 0; font-size: 11px; line-height: 1; color: var(--ink-2); font-weight: 500; }

/* ---------- asleep, then awake: only with motion on. Without it, every thumbnail above is its finished self. ---------- */
[data-part="how"].hw-armed .hw-step:not(.awake) .ch-pick { background: none; border-color: var(--wire2); color: var(--ink-2); font-weight: 400; }
[data-part="how"].hw-armed .hw-step:not(.awake) .bub { border-color: var(--wire2); }
[data-part="how"].hw-armed .hw-step:not(.awake) .bub > * { opacity: .25; }
[data-part="how"].hw-armed .hw-step:not(.awake) .call { background: none; box-shadow: inset 0 0 0 1.5px var(--wire2); color: var(--wire2); }
[data-part="how"].hw-armed .hw-step:not(.awake) .doc { border-color: var(--wire2); }
[data-part="how"].hw-armed .hw-step:not(.awake) .pr { background: var(--wire2); width: 40%; }
[data-part="how"].hw-armed .hw-step:not(.awake) .dy { box-shadow: none; background: var(--wire2); }
[data-part="how"].hw-armed .hw-step:not(.awake) .fr { border-color: var(--wire2); }
[data-part="how"].hw-armed .hw-step:not(.awake) .ok { visibility: hidden; }
[data-part="how"].hw-armed .hw-step:not(.awake) .sz { border-color: var(--wire2); background: none; }

[data-part="how"].hw-armed .awake .ch-pick { animation: hw-press .42s var(--ease) both; }
[data-part="how"].hw-armed .awake .bub { animation: hw-land .46s cubic-bezier(.55, .085, .68, .53) both; }
[data-part="how"].hw-armed .awake .call { animation: hw-pop .36s .42s var(--ease) both; }
[data-part="how"].hw-armed .awake .pr { animation: hw-set .34s var(--ease) both; }
[data-part="how"].hw-armed .awake .dy { animation: hw-ring .4s .3s var(--ease) both; }
[data-part="how"].hw-armed .awake .fr { animation: hw-ok-frame .01s calc(var(--n) * .17s + .12s) both; }
[data-part="how"].hw-armed .awake .ok { animation: hw-stamp .3s calc(var(--n) * .17s) cubic-bezier(.55, .085, .68, .53) both; }
[data-part="how"] .fr:nth-child(1) { --n: 0; } [data-part="how"] .fr:nth-child(2) { --n: 1; } [data-part="how"] .fr:nth-child(3) { --n: 2; } [data-part="how"] .fr:nth-child(4) { --n: 3; }
[data-part="how"].hw-armed .awake .sz { animation: hw-drop .42s calc(var(--n) * .09s) cubic-bezier(.55, .085, .68, .53) both; }
[data-part="how"] .sz:nth-child(1) { --n: 0; } [data-part="how"] .sz:nth-child(2) { --n: 1; } [data-part="how"] .sz:nth-child(3) { --n: 2; } [data-part="how"] .sz:nth-child(4) { --n: 3; }

/* a chip pressed: down, then it springs back filled */
@keyframes hw-press {
  0% { transform: scale(1); background: none; border-color: rgba(234, 220, 195, .3); color: rgba(234, 220, 195, .74); }
  30% { transform: scale(.88, .84); }
  31% { background: var(--ink); border-color: var(--ink); color: var(--hw-panel); }
  62% { transform: scale(1.06, 1.04); }
  100% { transform: scale(1); }
}
/* the reply drops in from above, finished, and lands with a squash */
@keyframes hw-land {
  0% { transform: translateY(-34px) scale(.96, 1.06); opacity: 0; }
  12% { opacity: 1; }
  58% { transform: translateY(0) scale(.96, 1.06); animation-timing-function: ease-out; }
  70% { transform: translateY(0) scale(1.06, .86); }
  86% { transform: scale(.98, 1.03); }
  100% { transform: none; }
}
@keyframes hw-pop { 0% { transform: scale(0); } 60% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes hw-set { 0% { width: 40%; background: rgba(234, 220, 195, .3); } 100% { width: 85%; background: var(--ink); } }
@keyframes hw-ring {
  0% { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 10px var(--hw-panel), 0 0 0 11.5px rgba(234, 220, 195, 0); background: none; }
  70% { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 2px var(--hw-panel), 0 0 0 3.5px var(--ink); }
  100% { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 3px var(--hw-panel), 0 0 0 4.5px var(--ink); background: none; }
}
@keyframes hw-ok-frame { from { border-color: rgba(234, 220, 195, .3); } to { border-color: var(--ink); } }
/* a stamp: comes down hard, squashes, settles at its angle */
@keyframes hw-stamp {
  0% { transform: translateY(-14px) scale(1.5); opacity: 0; visibility: visible; }
  55% { transform: translateY(0) scale(1.08); opacity: 1; animation-timing-function: ease-out; }
  72% { transform: scale(1.2, .82); }
  100% { transform: none; visibility: visible; }
}
@keyframes hw-drop {
  0% { transform: translateY(-26px); opacity: 0; border-color: rgba(234, 220, 195, .3); background: none; }
  60% { transform: translateY(0); opacity: 1; border-color: var(--ink); background: rgba(234, 220, 195, .1); animation-timing-function: ease-out; }
  76% { transform: scale(1.08, .9); transform-origin: 50% 100%; }
  100% { transform: none; }
}

/* ---------- phones and narrow screens: the steps stack, and the track sticks under the header while they scroll ---------- */
@media (max-width: 899px) {
  [data-part="how"] { --hw-s: 19px; --hw-k: 11px; --hw-air: 96px; --hw-pad: 16px; }
  [data-part="how"] .wrap { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  [data-part="how"] .hw-h { padding-inline: 4px; }
  [data-part="how"] .hw-ed { display: flex; flex-direction: column; border-radius: 8px; }
  [data-part="how"] .hw-bar { order: 0; padding: 6px 8px 6px 12px; }
  html[dir="rtl"] [data-part="how"] .hw-bar { padding: 6px 12px 6px 8px; }
  [data-part="how"] .hw-track { order: 1; position: sticky; top: var(--hd); z-index: 3; margin: 0; height: 74px; padding: 0; background: var(--hw-panel); border-bottom: 1px solid var(--wire); }
  [data-part="how"] .hw-ruler { inset-inline: var(--hw-pad); }
  [data-part="how"] .hw-line { inset-inline: var(--hw-pad); }
  [data-part="how"] .hw-kf { inset-inline-start: calc(var(--i) * (100% - var(--hw-k)) / 4); }
  [data-part="how"] .hw-px { inset-inline-start: calc(100% - var(--hw-pad) - var(--hw-k) / 2 - var(--hw-s) / 2); }
  [data-part="how"] .hw-steps { order: 2; display: block; padding: 4px var(--hw-pad) 8px; }
  [data-part="how"] .hw-step { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; border-top: 0; border-bottom: 1px solid var(--wire); padding: 24px 0 26px; scroll-margin-top: calc(var(--hd) + 90px); scroll-margin-bottom: 60px; }
  [data-part="how"] .hw-step:last-child { border-bottom: 0; }
  [data-part="how"] .hw-step > * { grid-column: 2; }
  [data-part="how"] .hw-step .hw-n { grid-column: 1; grid-row: 1; margin: 5px 0 0; }
  [data-part="how"] .hw-step .hw-t { grid-row: 1; }
  [data-part="how"] .hw-step .hw-th { order: 9; grid-row: 3; height: auto; margin-top: 18px; }
  [data-part="how"] .hw-step .hw-d { grid-row: 2; }
  [data-part="how"].hw-live .hw-step.cur { border-top-color: transparent; }
  [data-part="how"].hw-live .hw-step.cur .hw-n { color: var(--ink); }
  [data-part="how"] .hw-price { padding-inline: 4px; }
}
