/* ==========================================================================
   HAND · the second module on the home page (after the hero).
   Builds on the story panel in site.css: same pin, bar, copy grid.
   A keyed film of a hand (assets/hand/, 73 WebP frames, 784×1168) is drawn
   on a canvas and scrubbed by scroll: the iPhone turns away and the Apple
   Watch turns into view. Two live overlays ride on the film: the iPhone
   screens (rolling on their own) and the Watch views (rolling on their own).
   While the hand turns, the lime plate with the iPhone copy is pushed up and
   out and the green plate with the Watch copy comes up from below.
   Driven by assets/hand.js.
   ========================================================================== */
.hs { --step: 110svh; }
.hs .story__frame { --axis: clamp(150px, 17cqw, 250px); background: var(--green); }

/* plates: moved by hand.js in step with the scroll */
.hs__bgs, .hs__bgs i { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.hs__bgs i { will-change: transform; }
.hs__bgs i[data-bg="0"] { background: var(--lime); }
.hs__bgs i[data-bg="1"] { background: var(--green); transform: translate3d(0, 100%, 0); }
.hs .ch, .hs .ch.is-on { opacity: 1; visibility: visible; transition: none; will-change: transform; }
.hs .ch[data-key="phone"] { transform: none; }
.hs .ch[data-key="watch"] { transform: translate3d(0, 100%, 0); }

/* the hand rides over both plates and their copy */
.hs__media { position: absolute; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.hs__cam { position: absolute; left: 0; top: 0; will-change: transform; transform-origin: 0 0; }
.hs__cv { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 34px 48px rgb(0 0 0 / .28)); }

/* iPhone display: laid onto the tracked screen corners with a perspective
   matrix (box 450×979 = the screen's 272×592 film px). Screens cross-fade. */
.hs__screen {
  position: absolute; left: 0; top: 0; width: 450px; height: 979px; transform-origin: 0 0;
  border-radius: 70px; overflow: hidden; background: #0b0b0b;
}
.hs__screen img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block;
  opacity: 0; transition: opacity .5s var(--ease-standard, ease);
}
.hs__screen img.is-on { opacity: 1; }
.hs__screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(128deg, rgb(255 255 255 / .07), rgb(255 255 255 / 0) 34%); }

/* Watch display: portrait (the DLS watch, 410/500 with a 7 % bezel), laid
   onto the tracked glass; the watch sits turned about -75° on the wrist. */
.hs__face {
  position: absolute; left: 0; top: 0; width: 360px; height: 452px;
  transform-origin: 0 0; border-radius: 94px / 107px; overflow: hidden;
  background: #000; color: #fff;
}
.hs__wui { position: absolute; inset: 0; container-type: inline-size; opacity: 0; transition: opacity .45s var(--ease-standard, ease); }
.hs__wui.is-on { opacity: 1; }
.hs__face .w-zone { font-size: 8cqw; bottom: 9cqw; }

/* Watch views besides live heart rate: a set being logged, and Now */
.wv { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 2.6cqw; padding: 18cqw 9cqw 10cqw; }
.wv__k { margin: 0; font-size: 7.4cqw; font-weight: 600; color: #a8a8a8; line-height: 1.2; }
.wv__big { margin: 0; font-size: 20cqw; font-weight: 800; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.wv__big small { font-size: 8cqw; font-weight: 600; color: #c8c8c8; margin-left: 1cqw; }
.wv__big i { font-style: normal; font-weight: 600; color: #838383; margin: 0 2cqw; }
.wv__t { margin: 0; font-size: 10.5cqw; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.wv__s { margin: 0; font-size: 7.4cqw; color: #a8a8a8; }
.wv__btn {
  display: block; margin-top: 3cqw; padding: 4.6cqw 0; border-radius: 999px; text-align: center;
  background: var(--lime); color: #0f0f0f; font-size: 8.4cqw; font-weight: 800;
}
.wv__crown { display: flex; align-items: center; gap: 2cqw; margin: 0; font-size: 6.6cqw; color: #838383; }
.wv__crown::before { content: ""; width: 3.4cqw; height: 6cqw; border-radius: 1cqw; background: #5c5c5c; }
.wv__next { margin: 2cqw 0 0; padding-top: 3.4cqw; border-top: 1px solid rgb(255 255 255 / .14); font-size: 6.8cqw; color: #a8a8a8; }
.wv__next b { color: #f3f3f3; font-weight: 700; }

/* which screen is on, under the copy (follows the demo, not a control) */
.hs__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.hs__tabs li {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1;
  color: var(--ink-tertiary); box-shadow: inset 0 0 0 1px var(--line-default);
  transition: background .35s, color .35s, box-shadow .35s;
}
.hs__tabs li.is-on { background: #0f0f0f; color: #f3f3f3; box-shadow: none; }

/* copy: the whole headline left of the hand, the text and chips right of it */
.hs .story__bar { justify-content: flex-end; }
.hs .ch { grid-template-rows: auto; }
.hs .ch__h { grid-column: 1; grid-row: 1; display: block; text-align: left; text-wrap: balance; }
.hs .ch__h .h-l, .hs .ch__h .h-r { display: inline; }
.hs .ch__body { grid-column: 3; grid-row: 1; }
/* dark text on a bright plate reads thinner than light text on graphite:
   one step heavier and a more solid ink, so it matches the body text elsewhere */
.hs .ch__body > p:first-child { font-weight: 500; color: rgb(15 15 15 / .88); }
@media (min-width: 1024px) {
  .hs .ch__h { font-size: clamp(36px, min(3.9cqw, 7.4cqh), 68px); }
  .hs .ch__body { margin-top: .5em; }
}

/* 700–1023: copy left, the hand right of it, in one panel
   (hand.js reads --hand-x / --hand-k / --hand-top off .hs__media) */
@media (min-width: 700px) and (max-width: 1023px) {
  .hs__media { --hand-x: .76; --hand-k: .94; --hand-top: .22; --hand-wmax: 1.16; }
  .hs .ch { max-width: 52%; padding-top: 72px; }
  .hs__tabs { margin-top: 14px; }
}
/* a phone: too narrow for both side by side, so copy on top, media under it */
@media (max-width: 699px) {
  .hs .story__frame { --mt: 44cqh; }
  .hs__media { top: var(--mt); border-top: 1px solid var(--line-default); }
  .hs__tabs { margin-top: 14px; }
  .hs__tabs li { padding: 5px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hs__screen img, .hs__wui, .hs__tabs li { transition: none; }
}
