/* ==========================================================================
   hand-control/demos/ — three 3D scenes in a framed stage
   Loaded after seidr-v2.css. The scripts (demos-boot.js, demos.js) set the load
   state on <html>: hd-js, hd-ready, hd-failed, hd-nogl, hd-noboot. The rules
   that read those classes, the stage sizing and the phone "slot" layout are
   carried over from the old demos.css; only the look is new.
   ========================================================================== */

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.page-hand-demos { --stage-bg: #050a0b; --panel-bg: #0a1416; --bar-bg: #081113; }

/* ---------- intro (a compact page hero) ---------- */
.hd-intro.page-hero { padding-bottom: clamp(34px, 4vw, 54px); }
.hd-intro-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: end; }
.hd-crumb { text-decoration: none; min-height: 44px; transition: color .25s; }
.hd-crumb:hover { color: var(--sap); }
.hd-intro h1 { max-width: 14ch; }
.hd-intro-copy { position: relative; }
.hd-intro-copy .lead { margin-top: 0; max-width: 54ch; color: #c1cec9; }
.hd-intro-copy strong { color: var(--bone); font-weight: 600; }
.hd-intro-links { display: flex; flex-wrap: wrap; gap: 14px 28px; margin-top: 22px; }
.hd-intro-links .text-link { min-height: 32px; }

/* ---------- the stage ---------- */
.hd-demo { padding: clamp(28px, 4vw, 48px) 0 clamp(60px, 8vw, 100px); position: relative; }
.hd-demo::before { content: ""; position: absolute; left: 50%; top: 18%; width: min(1100px, 90vw); height: 60%; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(126, 232, 201, .08), transparent 70%); }
.hd-stage { position: relative; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--panel-bg); overflow: hidden;
  box-shadow: 0 40px 120px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .4), 0 0 80px -40px rgba(126, 232, 201, .35); }

/* scene tabs */
.hd-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--bar-bg); }
.hd-tab { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: baseline; text-align: left;
  padding: 12px 20px 11px; min-height: 64px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--mist); transition: background .25s, color .25s; }
.hd-tab:last-child { border-right: 0; }
.hd-tab:hover { background: rgba(237, 230, 213, .04); color: var(--bone); }
.hd-tab[aria-selected="true"] { background: linear-gradient(180deg, rgba(243, 183, 95, .07), transparent 80%); color: var(--bone); }
.hd-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--sap); box-shadow: 0 0 14px var(--sap); }
.hd-tab:focus-visible { outline: 2px solid var(--sap); outline-offset: -4px; }
.hd-tab-num { grid-row: span 2; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .08em; color: var(--mist-2); }
.hd-tab[aria-selected="true"] .hd-tab-num { color: var(--sap); }
.hd-tab-name { font-family: var(--f-display); font-size: 1.5rem; font-weight: 500; line-height: 1.1; letter-spacing: -.01em; }
.hd-tab-sub { grid-column: 2; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mist-2); }
.hd-tab[aria-selected="true"] .hd-tab-sub { color: var(--mist); }

.hd-stage-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.viewer { display: flex; flex-direction: column; min-width: 0; background: var(--stage-bg); border-right: 1px solid var(--line); }
/* The 3D frame's height comes from its width and the window height only, never from the
   side panel, so it stays the same on every tab and when a part is selected. */
.viewer-stage { position: relative; flex: none; width: 100%; aspect-ratio: 16 / 10; min-height: 300px; max-height: calc(100vh - 428px); max-height: calc(100svh - 428px); overflow: hidden;
  background: radial-gradient(ellipse 70% 75% at 55% 42%, #17322f 0%, #0e201f 45%, #081312 75%, #050a0b 100%); }
.viewer-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 90px rgba(0, 0, 0, .55); }
@media (min-width: 901px) {
  .viewer-stage { max-height: max(472px, calc(100vh - 428px)); max-height: max(472px, calc(100svh - 428px)); }
  .viewer-bar { flex: 1 0 auto; align-content: flex-start; }
  /* the three tab panels share one grid cell, so switching tabs never changes the column height */
  .hd-side { display: grid; }
  .hd-side > .hd-panel { grid-area: 1 / 1; }
  .hd-side > .hd-panel[hidden] { display: block !important; visibility: hidden; }
}
/* 901-1199 px: the 3D view fills its column instead of leaving an empty band under the tool bar */
@media (min-width: 901px) and (max-width: 1199px) {
  .viewer-stage { flex: 1 1 auto; aspect-ratio: auto; max-height: none; min-height: 320px; }
  .viewer-stage canvas { position: absolute; inset: 0; }
  .viewer-bar { flex: none; }
  .hd-part .hd-part-desc { min-height: 4.5em; }
  html:not(.hd-js) .viewer-stage, html.hd-failed .viewer-stage, html.hd-nogl .viewer-stage { min-height: 460px; }
}
.viewer-stage canvas { display: block; width: 100%; height: 100%; max-width: none; cursor: grab; outline: none; }
.viewer-stage canvas:active { cursor: grabbing; }
/* while a message shows over the view, the scene behind it is dimmed */
.viewer-stage:has(.viewer-status:not([hidden])) canvas { opacity: .35; transition: opacity .15s; }
@media (prefers-reduced-motion: reduce) { .viewer-stage:has(.viewer-status:not([hidden])) canvas { transition: none; } }
/* keyboard focus only: a click also focuses the view, but must not draw the frame */
.viewer-stage canvas:focus-visible:not(.hd-pointer-focus) { box-shadow: inset 0 0 0 2px var(--sap); }
.viewer-status { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; padding: 10px 18px; border-radius: 99px;
  background: rgba(5, 10, 11, .85); border: 1px solid var(--line-2); color: var(--mist); font-family: var(--f-mono); font-size: .75rem; letter-spacing: .04em; pointer-events: none; text-align: center; max-width: calc(100% - 32px); }

/* fallbacks: shown when there is no 3D (JS off, files failed, no WebGL 2) */
.viewer-fallback { position: relative; display: grid; align-content: center; gap: 8px; padding: 28px 32px; background: var(--panel-bg); }
.viewer-fallback h3 { margin: 0; font-family: var(--f-display); font-size: 2rem; font-weight: 500; line-height: 1.1; color: var(--bone); }
.viewer-fallback p { margin: 0; max-width: 560px; color: var(--mist); font-size: .93rem; }
.viewer-fallback .btn { margin-top: 12px; }
.viewer-static { z-index: 2; }
.viewer-nothreed { display: none; }
html:not(.hd-js) .viewer-nothreed, html.hd-failed .viewer-nothreed, html.hd-nogl .viewer-nothreed { display: block; position: absolute; inset: 0; z-index: 2; overflow: auto; background: var(--panel-bg); container-type: size; }
.viewer-nothreed-in { display: flex; flex-direction: column; height: 100%; }
.viewer-figure { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; min-width: 0; margin: 0; }
.viewer-poster { display: block; flex: 1 1 0; min-height: 0; width: 100%; object-fit: contain; object-position: center bottom; clip-path: inset(0 0 2px 0); }
.viewer-figure figcaption { flex: none; padding: 4px 16px 10px; text-align: center; color: var(--mist-2); font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; line-height: 1.5; }
.viewer-nothreed .viewer-fallback { flex: none; align-content: start; padding-top: 18px; }
@container (min-width: 660px) and (min-aspect-ratio: 3/2) {
  .viewer-nothreed-in { flex-direction: row; }
  .viewer-nothreed .viewer-fallback { order: -1; flex: 0 0 44%; align-content: center; padding-top: 28px; }
  .viewer-figure { height: 100%; }
}
html.hd-js .viewer-static { display: none; }
.viewer-fallback .text-link { margin-top: 6px; }
html.hd-noboot .hd-tabs { display: none; }

/* load states: while loading, controls keep their space but cannot be seen or reached;
   when 3D is not possible, controls and the how-to-use lines go away */
html.hd-js:not(.hd-ready):not(.hd-failed):not(.hd-nogl) .hd-ctl { visibility: hidden; }
html:not(.hd-js) .hd-ctl, html:not(.hd-js) .hd-live, html:not(.hd-js) .hd-tabs, html:not(.hd-js) .viewer-bar, html:not(.hd-js) .viewer-status,
html.hd-failed .hd-ctl, html.hd-failed .hd-live, html.hd-failed .viewer-bar,
html.hd-nogl .hd-ctl, html.hd-nogl .hd-live { display: none; }

/* phone: the scene's main control sits directly under the 3D view (moved here by demos-boot.js) */
.viewer-slot .hd-primary { padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--panel-bg); }
.viewer-slot .hd-field { margin-bottom: 6px; }
.viewer-slot .hd-primary > :last-child { margin-bottom: 0; }

/* the input readout and view tools */
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; padding: 12px 14px 12px 20px; border-top: 1px solid var(--line); background: var(--bar-bg); }
.readout { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; min-width: 0; flex: 1 1 290px; }
.readout-label { grid-row: span 2; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--aurora); display: inline-flex; align-items: center; gap: 7px; }
.readout-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 10px var(--aurora); opacity: .55; transition: opacity .3s; }
.readout.is-fresh .readout-label::before { opacity: 1; }
.readout-action { color: var(--bone); font-weight: 600; font-size: .95rem; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; transition: color .3s; }
.readout-hand { grid-column: 2; color: var(--mist-2); font-size: .8rem; line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-height: 2.8em; }
.readout.is-fresh .readout-action { color: var(--sap); }
.view-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.tool { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line-2); color: var(--mist); background: rgba(237, 230, 213, .03); transition: background .2s, border-color .2s, color .2s; }
.tool:hover { background: rgba(243, 183, 95, .08); border-color: color-mix(in srgb, var(--sap) 45%, transparent); color: var(--bone); }
.tool:focus-visible { outline: 2px solid var(--sap); outline-offset: 2px; }
.tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tool-text { font-size: .82rem; padding: 0 14px; }

/* full screen takes the whole stage: tabs, 3D view and side panel with its controls */
.hd-stage:fullscreen { display: flex; flex-direction: column; width: 100%; height: 100%; border-radius: 0; border: 0; background: var(--stage-bg); overflow: auto; }
.hd-stage:fullscreen .hd-stage-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.hd-stage:fullscreen .viewer-stage { flex: 1 1 auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.hd-stage:fullscreen .viewer-bar { flex: none; }
.hd-stage:fullscreen .hd-side { overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.hd-stage:-webkit-full-screen { display: flex; flex-direction: column; width: 100%; height: 100%; border-radius: 0; background: var(--stage-bg); overflow: auto; }
.hd-stage:-webkit-full-screen .hd-stage-grid { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
.hd-stage:-webkit-full-screen .viewer-stage { flex: 1 1 auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.hd-stage:-webkit-full-screen .viewer-bar { flex: none; }
.hd-stage:-webkit-full-screen .hd-side { overflow-y: auto; min-height: 0; }
@media (max-width: 900px) {
  .hd-stage:fullscreen .hd-stage-grid { flex: none; grid-template-rows: auto; }
  .hd-stage:fullscreen .viewer-stage { flex: none; height: 62vh; }
  .hd-stage:-webkit-full-screen .hd-stage-grid { flex: none; grid-template-rows: auto; }
  .hd-stage:-webkit-full-screen .viewer-stage { flex: none; height: 62vh; }
}

/* ---------- side panels ---------- */
.hd-side { min-width: 0; background: radial-gradient(90% 50% at 100% 0%, rgba(243, 183, 95, .06), transparent 60%), var(--panel-bg); }
.hd-panel { padding: 20px 22px 20px; }
.hd-panel:focus-visible { outline: 2px solid var(--sap); outline-offset: -4px; }
.kicker { display: inline-flex; align-items: center; gap: .7em; font-family: var(--f-mono); font-size: var(--t-label); letter-spacing: .16em; text-transform: uppercase; color: var(--sap); }
.hd-panel h3 { margin: 8px 0 10px; font-family: var(--f-display); font-size: 1.9rem; font-weight: 500; line-height: 1.05; color: var(--bone); }
.hd-panel > p { color: var(--mist); font-size: .93rem; line-height: 1.6; margin-bottom: 14px; }
.hd-panel .hd-note { font-size: .86rem; line-height: 1.55; color: var(--mist-2); margin: -4px 0 12px; }
.hd-field { margin: 0 0 8px; }
.hd-field label, .hd-part label, .hd-axis legend { display: block; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); margin-bottom: 6px; }
.hd-range-ends { display: flex; justify-content: space-between; gap: 10px; font-size: .76rem; color: var(--mist-2); margin-top: 6px; }
.hd-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.hd-buttons .btn { flex: 1 1 0; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 14px; white-space: nowrap; }
.hd-buttons .btn-primary, .viewer-fallback .btn-primary { --bg: var(--sap); --fg: var(--ink-on-sap); --bd: var(--sap); }
.hd-buttons .btn-primary:hover { --bg: #ffc877; border-color: #ffc877; }
.hd-buttons .btn:disabled, .hd-part-row .btn:disabled { opacity: .45; cursor: default; }

/* range: a big thumb so a pinch-drag in Hand Control can grab it */
.hd-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.hd-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--aurora) 0 var(--fill, 0%), #1f3431 var(--fill, 0%) 100%); }
.hd-range::-moz-range-track { height: 6px; border-radius: 3px; background: #1f3431; }
.hd-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--aurora); }
.hd-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 44px; height: 44px; margin-top: -19px; border-radius: 50%; background: var(--sap); border: 6px solid var(--panel-bg); box-shadow: 0 0 0 1px rgba(243, 183, 95, .6), 0 0 18px rgba(243, 183, 95, .45); }
.hd-range::-moz-range-thumb { width: 32px; height: 32px; border-radius: 50%; background: var(--sap); border: 6px solid var(--panel-bg); box-shadow: 0 0 0 1px rgba(243, 183, 95, .6), 0 0 18px rgba(243, 183, 95, .45); }
.hd-range:focus-visible { outline: 2px solid var(--sap); outline-offset: 2px; border-radius: 22px; }
.hd-range:hover::-webkit-slider-thumb { background: #ffc877; }

/* part card */
.hd-part { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 0; }
.hd-part select { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(4, 8, 9, .7); color: var(--bone); font: inherit; font-size: .92rem; margin-bottom: 8px; }
.hd-part-row { display: flex; gap: 8px; margin-bottom: 8px; }
.hd-part-row select { flex: 1 1 auto; min-width: 0; margin: 0; }
.hd-part-row .btn { flex: none; min-width: 104px; min-height: 44px; padding: 8px 14px; justify-content: center; }
.hd-part-row .btn.is-on { background: rgba(126, 232, 201, .12); border-color: var(--aurora); color: var(--aurora); }
@media (max-width: 1199px) { .hd-part-row { flex-wrap: wrap; } .hd-part-row select { flex-basis: 100%; } .hd-part-row .btn { flex: 1 1 auto; } }
.hd-part select:focus-visible { outline: 2px solid var(--sap); outline-offset: 2px; }
.hd-part-name { margin: 0 0 2px; font-family: var(--f-display); font-size: 1.3rem; color: var(--sap); }
.hd-part-desc { margin: 0 0 10px; color: var(--mist); font-size: .9rem; line-height: 1.5; min-height: 3em; }

/* toggle */
.hd-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 0; border: 0; background: none; color: var(--mist); font-size: .93rem; text-align: left; }
.hd-toggle:hover { color: var(--bone); }
.hd-toggle-box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--mist-2); display: grid; place-items: center; transition: background .2s, border-color .2s; }
.hd-toggle[aria-pressed="true"] .hd-toggle-box { background: var(--aurora); border-color: var(--aurora); box-shadow: 0 0 12px rgba(126, 232, 201, .45); }
.hd-toggle[aria-pressed="true"] .hd-toggle-box::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--night); border-bottom: 2px solid var(--night); transform: translateY(-1px) rotate(-45deg); }
.hd-toggle:focus-visible { outline: 2px solid var(--sap); outline-offset: 4px; }

/* cut direction */
.hd-axis { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.hd-axis label { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); margin-top: -1px; cursor: pointer; color: var(--mist); font-size: .93rem; transition: background .2s, color .2s; }
.hd-axis label:first-of-type { border-radius: 12px 12px 0 0; }
.hd-axis label:last-of-type { border-radius: 0 0 12px 12px; }
.hd-axis input { width: 18px; height: 18px; margin: 0; accent-color: var(--sap); flex: none; }
.hd-axis label:has(input:checked) { position: relative; background: rgba(243, 183, 95, .08); color: var(--bone); border-color: color-mix(in srgb, var(--sap) 45%, transparent); }
.hd-axis input:focus-visible { outline: 2px solid var(--sap); outline-offset: 3px; }

/* ---------- gesture legend ---------- */
.hd-legend { padding-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--night-2), transparent 70%); }
.hd-legend-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.hd-legend h2 { margin: 18px 0 20px; font-size: var(--t-h2); }
.hd-legend-side { color: var(--mist); max-width: 42ch; }
.hd-legend-side strong { color: var(--bone); font-weight: 600; }
.hd-table-wrap { min-width: 0; padding: clamp(18px, 2.4vw, 28px); border-radius: var(--r-l); border: 1px solid var(--line); background: linear-gradient(180deg, var(--moss), var(--night-2)); }
.hd-table-scroll { overflow-x: auto; }
.hd-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.hd-table th, .hd-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.hd-table tbody tr:last-child > * { border-bottom: 0; }
.hd-table thead th { text-wrap: balance; font-family: var(--f-mono); font-size: .75rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--mist-2); border-bottom-color: var(--line-2); }
.hd-table tbody th { font-family: var(--f-display); font-size: 1.45rem; font-weight: 500; line-height: 1.15; color: var(--bone); white-space: nowrap; padding-left: 0; }
.hd-table thead th:first-child { padding-left: 0; }
.hd-table td { color: var(--mist); }
.hd-table td small { display: block; margin-top: 4px; color: var(--sap); font-family: var(--f-mono); font-size: .75rem; letter-spacing: .02em; opacity: .85; }
.hd-table tbody tr { transition: background .25s; }
.hd-table tbody tr:hover { background: rgba(237, 230, 213, .025); }
.hd-keys { margin: 18px 0 0; color: var(--mist); font-size: .92rem; }
html:not(.hd-js) .hd-keys, html.hd-failed .hd-keys, html.hd-nogl .hd-keys { display: none; }
/* touch-only devices: touch hints replace the keyboard and mouse hints */
.hd-touch-hint { display: none; }
@media (hover: none) and (pointer: coarse) { .hd-keys-hint, .hd-pointer-hint { display: none; } .hd-touch-hint { display: block; } }

.hd-cta-rune { font-size: 2.6rem; color: var(--sap); }
.cta .lead strong { color: var(--bone); font-weight: 600; }

/* ---------- responsive ---------- */
@media (min-width: 1200px) { .hd-stage-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1100px) { .hd-stage-grid { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 900px) {
  .hd-intro-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hd-stage-grid { grid-template-columns: minmax(0, 1fr); }
  .viewer { border-right: 0; border-bottom: 1px solid var(--line); }
  .hd-legend-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 600px) {
  .hd-intro.page-hero { padding-top: calc(110px + env(safe-area-inset-top, 0px)); }
  .hd-demo { padding: 20px 0 48px; }
  .hd-demo > .container { padding-inline: 10px; }
  .hd-stage { border-radius: var(--r-m); }
  .hd-tab { grid-template-columns: 1fr; padding: 10px 10px 9px; min-height: 60px; }
  .hd-tab::after { left: 10px !important; right: 10px !important; }
  .hd-tab-num { grid-row: auto; font-size: .75rem; }
  .hd-tab-name { font-size: 1.15rem; }
  .hd-tab-sub { grid-column: 1; font-size: .75rem; letter-spacing: .06em; }
  .viewer-stage { aspect-ratio: 1 / 1; min-height: 0; }
  /* no 3D possible: the frame grows to fit its message instead of clipping it */
  html:not(.hd-js) .viewer-stage, html.hd-failed .viewer-stage, html.hd-nogl .viewer-stage { aspect-ratio: auto; max-height: none; min-height: 300px; display: grid; }
  html:not(.hd-js) #viewer-canvas, html.hd-failed #viewer-canvas { display: none; }
  html:not(.hd-js) .viewer-fallback, html.hd-failed .viewer-fallback, html.hd-nogl .viewer-fallback { position: relative; inset: auto; background: var(--panel-bg); }
  html:not(.hd-js) .viewer-nothreed, html.hd-failed .viewer-nothreed, html.hd-nogl .viewer-nothreed { position: relative; inset: auto; overflow: visible; container-type: normal; }
  .viewer-nothreed-in { height: auto; }
  .viewer-figure, .viewer-poster { flex: none; }
  .viewer-poster { height: auto; aspect-ratio: 800 / 650; }
  .viewer-fallback { padding: 24px 18px; }
  .viewer-fallback h3 { font-size: 1.7rem; }
  .viewer-bar { padding: 10px 12px; }
  .view-tools { width: 100%; }
  .tool { flex: 1 1 0; }   /* the six arrows fill their row; Reset and Full screen share the next */
  .tool-text { flex: 1 1 auto; }
  .hd-panel { padding: 20px 16px 22px; }
  /* the legend reflows into labelled rows on a phone */
  .hd-table-wrap { padding: 6px 18px; }
  .hd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .hd-table, .hd-table tbody, .hd-table tr { display: block; }
  .hd-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .hd-table tbody tr:last-child { border-bottom: 0; }
  .hd-table th, .hd-table td { display: block; padding: 0; border: 0; }
  .hd-table tbody th { grid-column: 1 / -1; margin-bottom: 4px; white-space: normal; }
  .hd-table td::before { display: block; font-family: var(--f-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mist-2); margin-bottom: 2px; }
  .hd-table td:nth-of-type(1)::before { content: "Your hands"; }
  .hd-table td:nth-of-type(2)::before { content: "Mouse / touch"; }
}
@media (prefers-reduced-motion: reduce) { .hd-tab, .tool, .btn { transition: none; } }

/* the intro sits in the right column here, where the header tree grows: keep the tree as a faint backdrop */
.page-hero canvas.sapling { opacity: .22; }
.page-hero .page-rune { display: none; }

/* no one-word last lines in the readout and legend notes */
.page-hand-demos :is(.readout-hand, .hd-table td, .hd-table small) { text-wrap: pretty; }
.hd-nw { white-space: nowrap; }
