/* swap hero: the /next/ title + KEEP block (NVIDIA lockup, acid App Store key, ink Google Play key with its pink hard
   shadow) on the original site's sky, and the five officers turning on one inclined orbit. Officers stay upright; depth
   is scale, stacking order and a touch of light. Every rule is scoped under .sh (markup: swap/hero.html, motion:
   swap/swap-hero.js). Phone first; two columns from 1024 (the original desktop.css breakpoint, on its --frame). */
.sh {
  --sh-ink: #141414; --sh-ink2: #4b4b4b; --sh-pink: #ff4f9a; --sh-acid: #eeff2d; --sh-cobalt: #1f2bff;
  --sh-t: var(--sh-ink);                                   /* title, lockup, names */
  --sh-t2: var(--sh-ink2);                                 /* jobs */
  --sh-line: rgba(20, 20, 20, .78);                        /* the orbit */
  --sh-shade: rgba(23, 18, 60, .13);                       /* contact shadows under the soles */
  --sh-cjk: "PingFang TC", "Noto Sans TC", "Hiragino Sans", "Heiti TC", "Microsoft JhengHei", sans-serif;
  --sh-grot: "Helvetica Neue", "Arial Nova", Arial, "PingFang TC", "Noto Sans TC", sans-serif;
  --sh-out: cubic-bezier(.2, .9, .2, 1);
  --sh-io: cubic-bezier(.65, 0, .35, 1);
  --sh-gut: var(--gut, 20px);
  position: relative; z-index: 2;                          /* the kingdom's cloud bank (z 1) rises behind the hero, as before */
  display: flex; flex-direction: column;
  min-height: max(640px, 100svh);
  padding: calc(92px + env(safe-area-inset-top, 0px)) 0 calc(18px + env(safe-area-inset-bottom, 0px));
  color: var(--sh-t);
}
:root[data-theme="dark"] .sh { --sh-t: #FFFDF8; --sh-t2: rgba(255, 253, 248, .8); --sh-line: rgba(255, 253, 248, .62); --sh-shade: rgba(5, 3, 20, .34); }
.sh::after { content: none !important; }                    /* no desktop rail through the hero */

/* ---------- copy: the /next/ hero title, gutter to gutter on phones ---------- */
.sh__copy { position: relative; z-index: 3; padding: 0 var(--sh-gut); --cw: calc(100vw - 2 * var(--sh-gut)); }
.sh__h1 {
  margin: 0; font-family: var(--sh-cjk); font-weight: 900; color: var(--sh-t);
  font-size: min(calc(var(--cw) / 5.75), calc(7vw + 40px), 156px); letter-spacing: -.035em; line-height: 1.02; white-space: nowrap;
  -webkit-text-stroke: .018em currentColor; paint-order: stroke fill;   /* PingFang tops out at Semibold: a hair of stroke is the weight */
}
.sh__l { display: block; overflow-x: visible; overflow-y: clip; padding: .1em 0 .06em; margin: -.1em 0 -.06em; }
.sh__l > span { display: block; }
.sh__l:first-child > span { margin-left: -.035em; }         /* optical left edge: the A's foot, then 幫's stem, on the gutter */
.sh__l:last-child > span { margin-left: -.06em; }

/* KEEP block, exactly the /next/ one */
/* owner 2026-11-22: the KEEP block (lockup + keys) 10% larger on every width; every size below is the /next/ one × 1.1 */
.sh__keep { display: flex; flex-direction: column; align-items: flex-start; gap: 19.8px; margin-top: clamp(28px, 2.3vw + 20px, 64px); }
.sh__nv { display: flex; align-items: center; gap: 11px; margin: 0; font: 500 12.1px/1 var(--sh-grot); letter-spacing: .16em; text-transform: uppercase; color: var(--sh-t); }
.sh__nv svg { display: block; height: 19.8px; width: auto; color: var(--sh-t); }
.sh__nv span { border-left: 1px solid color-mix(in srgb, currentColor 32%, transparent); padding-left: 11px; }
.sh__keys { display: flex; gap: 11px; flex-wrap: wrap; }
.sh-key { --sh: var(--sh-ink); position: relative; display: inline-flex; align-items: center; gap: 9.9px; height: 52.8px; padding: 0 15.4px;
  border: 2.75px solid var(--sh-ink); border-radius: 14.3px; background: var(--sh-acid); color: var(--sh-ink); font: 800 15.4px/1 var(--sh-grot);
  text-decoration: none; box-shadow: 4.4px 4.4px 0 var(--sh); white-space: nowrap; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: transform .14s var(--sh-out), box-shadow .14s var(--sh-out); }
.sh-key svg { display: block; width: 19.8px; height: 19.8px; flex: none; }
.sh-key small { display: block; font: 600 9.9px/1 var(--sh-grot); opacity: .72; margin-bottom: 4.4px; letter-spacing: .02em; }
.sh-key__two { display: flex; flex-direction: column; }
.sh-key--ink { background: var(--sh-ink); color: #fff; --sh: var(--sh-pink); }
@media (hover: hover) and (pointer: fine) { .sh-key:hover { transform: translate(-1px, -1px); box-shadow: 5.5px 5.5px 0 var(--sh); } }
.sh-key:active { transform: translate(4.4px, 4.4px); box-shadow: 1px 1px 0 var(--sh); transition-duration: .06s; }
.sh-key:focus-visible { outline: 2.5px solid var(--sh-cobalt); outline-offset: 3px; }
:root[data-theme="dark"] .sh-key--ink { border-color: #FFFDF8; }   /* night: the ink key keeps its edge on the night sky */

/* ---------- the orbit ---------- */
.sh__orbit { position: relative; z-index: 2; flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 18px; }
/* --w front officer box · --rx/--ry the orbit's radii · --sb the farthest scale · --cy the orbit's centre from the stage top
   (room for the back row's heads). Phones: the front officer is 48vw and the ring draws in to .6 w, so the cluster fills
   the width while the widest moment of the turn (a side seat near ±78°) keeps 2.6vw of sky (10 px at 390, 9 at 360);
   the deeper ellipse (ry .8 rx) staggers the side seats up behind the front one instead of beside it. */
.sh__stage {
  --w: min(48vw, 300px); --rx: calc(var(--w) * .6); --ry: calc(var(--rx) * .8); --sb: .5;
  --cy: calc(var(--ry) * .81 + var(--w) * .63 + 4px);
  position: relative; width: 100%; height: calc(var(--cy) + var(--ry) + var(--w) * .1 + 4px);
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.sh__ring { position: absolute; z-index: 0; left: calc(50% - var(--rx)); top: calc(var(--cy) - var(--ry)); width: calc(2 * var(--rx)); height: calc(2 * var(--ry)); overflow: visible; pointer-events: none; }
.sh__arc { fill: none; stroke: var(--sh-line); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
@media (min-resolution: 2.5dppx) { .sh__arc { stroke-width: 1.334px; } }

/* each officer: a w × w box whose bottom centre is its foot on the orbit; the static pose below is the no-JS fallback,
   swap-hero.js drives transform (and z-index, filter) from then on */
.sh__o {
  --a: calc(var(--i) * 72deg); --d: calc((1 + cos(var(--a))) / 2); --s: calc(var(--sb) + (1 - var(--sb)) * var(--d));
  position: absolute; z-index: 3; left: calc(50% - var(--w) / 2); top: calc(var(--cy) - var(--w)); width: var(--w); height: var(--w);
  margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer;
  transform-origin: 50% 100%; transform: translate(calc(sin(var(--a)) * var(--rx)), calc(cos(var(--a)) * var(--ry))) scale(var(--s));
  will-change: transform; -webkit-tap-highlight-color: transparent; touch-action: pan-y;
}
.sh__o:nth-of-type(1) { z-index: 5; } .sh__o:nth-of-type(2), .sh__o:nth-of-type(5) { z-index: 4; }
.sh__o:focus { outline: none; }
.sh__o:focus-visible .sh__fig { outline: 2.5px solid var(--sh-cobalt); outline-offset: 4px; border-radius: 22%; }
.sh__fig { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; transform-origin: 50% 100%; pointer-events: none; }
.sh__fig img { display: block; width: 100%; height: auto; max-height: 100%; object-fit: contain; object-position: 50% 100%;
  margin-bottom: calc(var(--w) * var(--fb, 0) * -1); transform-origin: 50% 100%; -webkit-user-drag: none; user-select: none; }
.sh__shadow { position: absolute; left: 17%; right: 17%; bottom: calc(var(--w) * -.045); height: calc(var(--w) * .09); border-radius: 50%; background: var(--sh-shade); pointer-events: none; }

/* idle: each body breathes up off planted soles, out of phase, only while the orbit is live on screen */
.sh.is-live .sh__fig img { animation: sh-breathe var(--bd, 3.3s) var(--sh-io) infinite; animation-delay: calc(var(--i) * -.73s); }
.sh__o:nth-of-type(2) { --bd: 3.6s; } .sh__o:nth-of-type(3) { --bd: 2.95s; } .sh__o:nth-of-type(4) { --bd: 3.4s; } .sh__o:nth-of-type(5) { --bd: 3.8s; }
@keyframes sh-breathe { 0%, 100% { transform: none; } 50% { transform: scale(.984, 1.032); } }

/* the front officer's name + job, one fixed caption under the front seat */
.sh__tag { display: grid; justify-items: center; margin: 6px 0 0; text-align: center; pointer-events: none; }
.sh__say { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 3px; opacity: 0; }
.sh__say.is-on { opacity: 1; }
.sh__say b { font: 900 clamp(26px, 1.15vw + 21px, 38px)/1.1 var(--sh-cjk); letter-spacing: .02em; color: var(--sh-t); -webkit-text-stroke: .018em currentColor; paint-order: stroke fill; }
.sh__say > span { font: 600 clamp(14px, .3vw + 13px, 18px)/1.4 var(--sh-cjk); letter-spacing: .12em; color: var(--sh-t2); padding-left: .12em; }

/* ---------- the two hands, a quiet background: one cobalt halftone art (the owner's, pixels untouched), mirrored for the
   left; each reaches in from its screen edge (arm cut by the edge) until the index fingertips (43% down the art) almost
   touch on the centre line. Light by opacity alone, so the dots stay the art's own cobalt, only paler; z 0, under the
   title, keys and officers. Phones: a zero-height row on the seam between the keys and the orbit, the fingertips meeting
   --fy below it; desktop: the layer spans the hero and the fingertips meet low on the centre line, under the title and
   orbit. --hw one hand's width (part of the arm runs off screen), --gap the fingertip gap. */
.sh__hands {
  --hw: 76vw; --gap: 3.4vw; --hh: calc(var(--hw) * .3993); --fy: 44px;
  position: relative; z-index: 0; flex: none; height: 0; overflow-x: clip; pointer-events: none; opacity: .16;
}
:root[data-theme="dark"] .sh__hands { opacity: .3; }
.sh__hand { position: absolute; top: calc(var(--fy) - var(--hh) * .43); width: var(--hw); height: var(--hh); }
.sh__hand--l { right: calc(50% + var(--gap) / 2); }
.sh__hand--r { left: calc(50% + var(--gap) / 2); }
.sh__hand img { display: block; width: 100%; height: 100%; -webkit-user-drag: none; user-select: none; }
.sh__hand--l img { scale: -1 1; }
/* motion: the hands slide in from their edges as the officers land, then breathe toward each other by a hair (the gap
   never closes); transform only, and only while the hero is live on screen */
:root[data-motion="on"] .sh__hand { animation: sh-reach 1.8s var(--sh-out) .42s both; }
:root[data-motion="on"] .sh__hand--l { --rx0: -18%; }
:root[data-motion="on"] .sh__hand--r { --rx0: 18%; }
@keyframes sh-reach { from { opacity: 0; translate: var(--rx0) 0; } 35% { opacity: 1; } }
.sh.is-live .sh__hand img { animation: sh-near 5.6s var(--sh-io) 2s infinite; }
.sh.is-live .sh__hand--r img { --nx: -1; }
@keyframes sh-near { 0%, 100% { translate: 0 0; } 50% { translate: calc(var(--nx, 1) * .45vw) -.2vw; } }
@media (prefers-reduced-motion: reduce) { .sh__hand, .sh__hand img { animation: none !important; } }

/* ---------- load-in (motion on): the words rise; the orbit waits for swap-hero.js to draw it and land the officers.
   If the script never runs, a failsafe shows the finished arrangement. ---------- */
:root[data-motion="on"] .sh__l > span { animation: sh-rise .82s var(--sh-out) both; animation-delay: var(--sd, .08s); }
:root[data-motion="on"] .sh__l:last-child > span { --sd: .17s; }
:root[data-motion="on"] .sh__keep { animation: sh-up .7s var(--sh-out) .36s both; }
@keyframes sh-rise { from { transform: translateY(108%); } }
@keyframes sh-up { from { opacity: 0; transform: translateY(14px); } }
:root[data-motion="on"] .sh:not(.is-js) :is(.sh__o, .sh__ring, .sh__tag) { opacity: 0; animation: sh-show .01s 2.6s forwards; }
:root[data-motion="on"] .sh.is-js:not(.is-tag) .sh__tag { opacity: 0; }
.sh.is-js .sh__tag { transition: opacity .5s var(--sh-out); }
@keyframes sh-show { to { opacity: 1; } }
.sh.is-drag .sh__stage, .sh.is-drag .sh__o { cursor: grabbing; }

/* ---------- phones (owner 2026-11-22: 20% smaller than the 46vw cut, which piled up): the front officer is 36.8vw on a
   wide, flat ring (rx .92 w, ry .6 rx). A side seat (±72°, scale .79) then stands just clear of the front officer, the
   widest moment of the turn (±90°) still keeps ~3vw of sky, and back seats shrink to .36 so the far pair stand apart
   with their heads clear above the front one. Free height splits evenly into three gaps (above the title, between the
   keys and the orbit, under the caption), so title → keys → orbit → caption read as one composed first screen, and the
   caption tucks right under the front officer's shadow. ---------- */
@media (max-width: 599.98px) {
  .sh__copy { margin-top: auto; }
  .sh__orbit { flex: none; justify-content: flex-start; margin: auto 0; }
  .sh__stage { --w: min(33.1vw, 173px); --rx: calc(var(--w) * .92); --ry: calc(var(--rx) * .6); --sb: .36;
    --cy: calc(var(--ry) * .81 + var(--w) * .48 + 8px); height: calc(var(--cy) + var(--ry) + var(--w) * .06); }
  .sh__tag { margin-top: 4px; }
}
/* 360-class phones: a hair tighter so title, keys and the whole orbit share the first screen */
@media (max-height: 700px) and (max-width: 599.98px) { .sh { padding-top: calc(80px + env(safe-area-inset-top, 0px)); } .sh__stage { --w: min(30.2vw, 166px); } }

/* ---------- tablet ---------- */
@media (min-width: 600px) { .sh__h1 { letter-spacing: -.05em; } .sh__stage { --w: min(36vw, 320px); --rx: calc(var(--w) * .8); --ry: calc(var(--rx) * .66); --sb: .55; } }

/* ---------- desktop: title + KEEP on the left of the original frame, the orbit in the right half ---------- */
@media (min-width: 1024px) {
  .sh { flex-direction: row; align-items: center; height: max(720px, 100vh); min-height: 0; padding: 76px var(--frame-x) 12px; }
  .sh__copy { flex: 0 0 52%; padding: 0; --cw: calc(var(--frame) * .52 - 16px); margin-top: -1vh; }
  .sh__h1 { font-size: min(calc(var(--cw) / 5.75), 15.5vh, 148px); }
  .sh__keep { gap: 28.6px; }
  .sh__nv { gap: 15.4px; font-size: 15.4px; }
  .sh__nv svg { height: 28.6px; }
  .sh__nv span { padding-left: 15.4px; }
  .sh__keys { gap: 19.8px; flex-wrap: nowrap; }
  .sh-key { height: clamp(55px, 4.62vw, 66px); padding: 0 clamp(17.6px, 1.98vw, 28.6px); gap: 13.2px; font-size: clamp(16.5px, 1.43vw, 20.9px); border-radius: 17.6px; box-shadow: 5.5px 5.5px 0 var(--sh); }
  .sh-key svg { width: 24.2px; height: 24.2px; }
  .sh-key small { font-size: 12.1px; }
  .sh__orbit { flex: 1 1 0; align-self: stretch; margin: 0 calc(var(--frame-x) * -.5) 0 0; }
  .sh__hands { --hw: 58vw; --gap: 1.3vw; --fy: 76%; position: absolute; inset: 0; height: auto; }   /* the orbit may lean into the right margin */
  .sh__stage { --w: min(calc(var(--frame) * .216), 33.3vh, 297px);   /* owner 2026-11-22: the officers 10% smaller than the first desktop cut (.24 frame, 37vh, 330px) */
  --rx: calc(var(--w) * .76); --ry: calc(var(--rx) * .6); --sb: .55; }
  .sh__tag { margin-top: 10px; }
}
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) { .sh-key:hover { box-shadow: 6.6px 6.6px 0 var(--sh); } .sh__stage { cursor: grab; } }

/* lead: night key shadow matches the global keys (light ink on the ink page) */
:root[data-theme="dark"] .sh-key:not(.sh-key--ink) { --sh: #f2f2f5; }

/* owner 2026-11-22 (phone only): the NVIDIA lockup + keys 10% larger */
@media (max-width: 599.98px) { .sh__keep { zoom: 1.1; } }

/* owner 2026-11-22 (phone): the NVIDIA lockup + keys sit a little lower under the title */
@media (max-width: 599.98px) { .sh__keep { margin-top: 44px; } }
