:root {
  --ink: #090b0c;
  --ink-deep: #050607;
  --panel: #0d1011;
  --panel-raised: #111516;
  --paper: #e8e6df;
  --paper-soft: #b6b8b2;
  --paper-dim: #747a78;
  --line: rgba(232, 230, 223, 0.14);
  --line-strong: rgba(232, 230, 223, 0.26);
  --signal: #b8d96f;
  --mint: #61d5b0;
  --coral: #f07167;
  --orange: #f4a261;
  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Manrope", "Space Grotesk", "Avenir Next", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --masthead-height: 60px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--ink);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper-soft);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body::after {
  position: fixed;
  z-index: 1000;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.035;
  pointer-events: none;
}

.fade-in {
  animation: study-fade-in 700ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

@keyframes study-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

button,
input,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

::selection {
  background: var(--signal);
  color: var(--ink-deep);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-160%);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(440px, 1fr) 270px;
  grid-template-rows: var(--masthead-height) minmax(0, 1fr) 30px;
  width: 100vw;
  height: 100dvh;
  min-height: 620px;
  background:
    linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(255, 255, 255, 0.025) calc(100% - 1px)),
    var(--ink);
}

.masthead {
  z-index: 30;
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-width: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 11, 12, 0.93);
}

.brand-mark,
.repository-link {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.logo {
  font-weight: 500;
}

.brand-rule {
  width: 30px;
  height: 1px;
  margin: 0 11px;
  background: var(--line-strong);
}

.brand-title {
  overflow: hidden;
  color: var(--paper-dim);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edition-mark {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.edition-mark span + span::before {
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-right: 20px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(184, 217, 111, 0.62);
  content: "";
  vertical-align: middle;
}

.repository-link {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.repository-link:hover {
  color: var(--paper);
}

.scene-ledger,
.instrument-panel {
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
}

.scene-ledger {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.ledger-heading,
.instrument-heading {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scene-nav {
  display: flex;
  flex-direction: column;
}

.scene-button {
  position: relative;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) 10px;
  gap: 10px;
  align-items: start;
  min-height: 90px;
  padding: 18px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease;
}

.scene-button::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--scene-accent, var(--paper));
  content: "";
  opacity: 0;
  transform: scaleY(0.25);
  transition: opacity 180ms ease, transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.scene-button:hover {
  background: rgba(255, 255, 255, 0.025);
}

.scene-button.is-active {
  background: var(--panel-raised);
  color: var(--paper);
}

.scene-button.is-active::before {
  opacity: 1;
  transform: scaleY(1);
}

.scene-button:nth-child(1) { --scene-accent: var(--coral); }
.scene-button:nth-child(2) { --scene-accent: #bcd89a; }
.scene-button:nth-child(3) { --scene-accent: #aaa79d; }
.scene-button:nth-child(4) { --scene-accent: #e9a86d; }

.scene-number {
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
}

.scene-copy {
  min-width: 0;
}

.scene-copy strong,
.scene-copy small {
  display: block;
}

.scene-copy strong {
  overflow: hidden;
  color: var(--paper-soft);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-button.is-active .scene-copy strong {
  color: var(--paper);
}

.scene-copy small {
  margin-top: 5px;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
}

.scene-swatch {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: var(--scene-accent);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.025);
}

.scene-swatch--01 { background: var(--coral); }
.scene-swatch--02 { background: #7b9a65; }
.scene-swatch--03 { background: #a4a299; }
.scene-swatch--04 { background: #e9a86d; }

.ledger-note {
  margin-top: auto;
  padding: 19px 18px 21px;
  border-top: 1px solid var(--line);
}

.ledger-note__label,
.source-register__title {
  display: block;
  margin-bottom: 7px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ledger-note p {
  max-width: 190px;
  margin: 0;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  line-height: 1.45;
}

.stage {
  display: grid;
  grid-column: 2;
  grid-row: 2;
  grid-template-rows: minmax(0, 1fr) 54px;
  min-width: 0;
  min-height: 0;
  background: var(--ink-deep);
}

.viewport-frame {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 14px 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0c0f10;
  isolation: isolate;
  touch-action: none;
}

.viewport-frame canvas {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.viewport-grid {
  position: absolute;
  z-index: 2;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.027) 1px, transparent 1px);
  background-position: center;
  background-size: 10% 10%;
  opacity: 0.55;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0 18%, #000 86%);
  mask-image: radial-gradient(circle at 50% 50%, transparent 0 18%, #000 86%);
}

.corner {
  position: absolute;
  z-index: 6;
  width: 17px;
  height: 17px;
  pointer-events: none;
}

.corner::before,
.corner::after {
  position: absolute;
  background: var(--paper-dim);
  content: "";
}

.corner::before { width: 17px; height: 1px; }
.corner::after { width: 1px; height: 17px; }
.corner--tl { top: 10px; left: 10px; }
.corner--tr { top: 10px; right: 10px; transform: rotate(90deg); }
.corner--br { right: 10px; bottom: 10px; transform: rotate(180deg); }
.corner--bl { bottom: 10px; left: 10px; transform: rotate(270deg); }

.scene-heading {
  position: absolute;
  z-index: 5;
  top: clamp(27px, 5vh, 58px);
  left: clamp(27px, 4vw, 58px);
  max-width: 46%;
  pointer-events: none;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.38);
}

.scene-heading__index,
.scene-heading p,
.view-readout,
.scale-readout,
.interaction-hint {
  font-family: var(--mono);
  text-transform: uppercase;
}

.scene-heading__index {
  display: block;
  margin-bottom: 18px;
  color: var(--paper-dim);
  font-size: 8px;
  letter-spacing: 0.17em;
}

.scene-heading p {
  margin: 0 0 8px;
  color: var(--paper-soft);
  font-size: 8px;
  letter-spacing: 0.16em;
}

.scene-heading h1 {
  margin: 0;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: -0.04em;
}

.scene-heading h1 em {
  color: var(--paper-soft);
  font-weight: 400;
}

.view-readout {
  position: absolute;
  z-index: 5;
  top: 21px;
  right: 22px;
  display: flex;
  gap: 18px;
  color: var(--paper-dim);
  font-size: 8px;
  letter-spacing: 0.11em;
  pointer-events: none;
}

.view-readout b {
  color: var(--paper-soft);
  font-weight: 400;
}

.scale-readout {
  position: absolute;
  z-index: 5;
  bottom: 23px;
  left: 24px;
  display: flex;
  align-items: center;
  color: var(--paper-dim);
  font-size: 8px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.scale-readout i {
  position: relative;
  width: 31px;
  height: 5px;
  margin: 0 4px;
  border-top: 1px solid var(--paper-dim);
}

.scale-readout i::before,
.scale-readout i::after {
  position: absolute;
  top: -3px;
  width: 1px;
  height: 5px;
  background: var(--paper-dim);
  content: "";
}

.scale-readout i::before { left: 0; }
.scale-readout i::after { right: 0; }

.scene-caption {
  position: absolute;
  z-index: 5;
  right: clamp(26px, 3vw, 44px);
  bottom: clamp(28px, 4vh, 45px);
  width: min(275px, 34%);
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);
  pointer-events: auto;
}

.scene-caption p {
  margin: 0 0 10px;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.38;
}

.scene-caption a {
  display: inline-flex;
  gap: 7px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 160ms ease;
}

.scene-caption a:hover {
  color: var(--paper);
}

.interaction-hint {
  position: absolute;
  z-index: 5;
  right: 22px;
  bottom: 17px;
  display: none;
  align-items: center;
  gap: 8px;
  color: var(--paper-dim);
  font-size: 7px;
  letter-spacing: 0.11em;
  pointer-events: none;
}

.mouse-glyph {
  position: relative;
  display: block;
  width: 10px;
  height: 15px;
  border: 1px solid var(--paper-dim);
  border-radius: 6px;
}

.mouse-glyph i {
  position: absolute;
  top: 2px;
  left: 4px;
  width: 1px;
  height: 4px;
  background: var(--paper-dim);
}

.loading-state,
.error-state {
  position: absolute;
  z-index: 20;
  inset: 0;
  background: #090c0d;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  transition: opacity 360ms ease, visibility 360ms ease;
}

.loading-state.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-state strong,
.loading-state span {
  display: block;
}

.loading-state strong {
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.loading-state div > span {
  margin-top: 5px;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 12px;
  font-style: italic;
}

.loading-orbit {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  animation: orbit-loading 1.4s linear infinite;
}

.loading-orbit i {
  position: absolute;
  top: -2px;
  left: 13px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px rgba(184, 217, 111, 0.6);
}

@keyframes orbit-loading {
  to { transform: rotate(360deg); }
}

.error-state {
  display: grid;
  align-content: center;
  justify-items: start;
  padding: clamp(28px, 6vw, 80px);
}

.error-state[hidden] {
  display: none;
}

.error-code {
  color: #df7b6e;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
}

.error-state h1 {
  max-width: 520px;
  margin: 16px 0 10px;
  color: var(--paper);
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 400;
  line-height: 0.95;
}

.error-state p {
  max-width: 440px;
  margin: 0 0 22px;
  color: var(--paper-dim);
  line-height: 1.65;
}

.error-state button {
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--paper-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.camera-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.control-cluster {
  display: flex;
  align-items: center;
}

.control-cluster--views {
  gap: 2px;
}

.control-cluster--actions {
  gap: 7px;
}

.variant-selector {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  margin: 0 10px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.variant-selector select {
  min-width: 64px;
  height: 29px;
  padding: 0 24px 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 9px;
  color-scheme: dark;
}

.variant-selector output {
  min-width: 43px;
  color: var(--paper-dim);
  font-size: 8px;
}

.control-label {
  margin-right: 8px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.camera-strip button {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.camera-strip button:hover {
  color: var(--paper);
}

.camera-strip button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
  color: var(--paper);
}

kbd {
  min-width: 17px;
  padding: 2px 4px;
  border: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
  line-height: 1.2;
  text-align: center;
}

.motion-button i {
  position: relative;
  width: 18px;
  height: 8px;
  border: 1px solid var(--paper-dim);
  border-radius: 8px;
}

.motion-button i::after {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--paper-dim);
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.motion-button[aria-pressed="true"] i {
  border-color: var(--signal);
}

.motion-button[aria-pressed="true"] i::after {
  background: var(--signal);
  transform: translateX(10px);
}

.instrument-panel {
  display: flex;
  grid-column: 3;
  grid-row: 2;
  flex-direction: column;
  border-left: 1px solid var(--line);
}

.instrument-heading > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.instrument-heading strong {
  color: var(--paper-soft);
  font-weight: 400;
}

.signal-mark {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--paper-dim);
}

.signal-mark i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 7px rgba(184, 217, 111, 0.7);
}

.pass-control {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line);
}

.pass-control__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.pass-control label,
.pass-control output {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pass-control label {
  color: var(--paper-soft);
}

.pass-control label span {
  margin-right: 8px;
  color: var(--paper-dim);
}

.pass-control output {
  color: var(--signal);
}

.pass-control input[type="range"] {
  width: 100%;
  height: 20px;
  margin: 11px 0 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.pass-control input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: linear-gradient(90deg, var(--paper-dim), var(--line-strong));
}

.pass-control input[type="range"]::-moz-range-track {
  height: 1px;
  background: var(--line-strong);
}

.pass-control input[type="range"]::-webkit-slider-thumb {
  width: 7px;
  height: 15px;
  margin-top: -7px;
  appearance: none;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink);
}

.pass-control input[type="range"]::-moz-range-thumb {
  width: 7px;
  height: 15px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
}

.pass-control p {
  margin: 5px 0 0;
  color: var(--paper-dim);
  font-family: var(--serif);
  font-size: 11px;
  font-style: italic;
  line-height: 1.35;
}

.model-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.model-facts div {
  min-width: 0;
  padding: 12px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.model-facts div:nth-child(2n) { border-right: 0; }
.model-facts div:nth-last-child(-n + 2) { border-bottom: 0; }

.model-facts span,
.model-facts strong {
  display: block;
}

.model-facts span {
  margin-bottom: 3px;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.model-facts strong {
  overflow: hidden;
  color: var(--paper-soft);
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-register {
  margin-top: auto;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.source-register ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.source-register li + li {
  margin-top: 2px;
}

.source-register a {
  display: grid;
  grid-template-columns: 21px minmax(0, 1fr) auto;
  gap: 6px;
  padding: 5px 0;
  color: var(--paper-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 160ms ease;
}

.source-register a:hover,
.source-register a[aria-current="true"] {
  color: var(--paper);
}

.source-register a span,
.source-register a i {
  color: var(--paper-dim);
  font-style: normal;
}

.footer-line {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 3;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  border-top: 1px solid var(--line);
  background: var(--ink);
  color: #4f5554;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-line span:nth-child(2) { justify-self: center; }
.footer-line span:last-child { justify-self: end; }

.noscript-note {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 22px;
  text-align: center;
}

@media (min-width: 1550px) {
  .app-shell {
    grid-template-columns: 306px minmax(600px, 1fr) 292px;
  }

  .scene-button {
    min-height: 100px;
    padding: 21px;
  }

  .scene-copy strong { font-size: 13px; }
  .scene-copy small { font-size: 13px; }
}

@media (max-width: 1160px) {
  .app-shell {
    grid-template-columns: 220px minmax(390px, 1fr) 232px;
  }

  .scene-button {
    grid-template-columns: 24px minmax(0, 1fr) 8px;
    min-height: 82px;
    padding: 15px 13px;
  }

  .scene-copy strong { font-size: 11px; }
  .scene-copy small { font-size: 11px; }
  .pass-control { padding: 16px 14px 14px; }
  .source-register { padding-right: 14px; padding-left: 14px; }
  .scene-caption { width: min(240px, 37%); }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--masthead-height) auto min(68dvh, 700px) auto auto;
    width: 100%;
    height: auto;
    min-height: 100dvh;
  }

  .masthead {
    position: sticky;
    top: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .edition-mark span:last-child { display: none; }
  .edition-mark span + span::before { display: none; }

  .scene-ledger {
    grid-column: 1;
    grid-row: 2;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ledger-heading,
  .ledger-note {
    display: none;
  }

  .scene-nav {
    flex-direction: row;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .scene-button {
    flex: 0 0 min(265px, 72vw);
    min-height: 76px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    scroll-snap-align: start;
  }

  .scene-button::before {
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: 2px;
    transform: scaleX(0.25);
  }

  .scene-button.is-active::before { transform: scaleX(1); }

  .stage {
    grid-column: 1;
    grid-row: 3;
  }

  .instrument-panel {
    display: grid;
    grid-column: 1;
    grid-row: 4;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .instrument-heading {
    grid-column: 1 / -1;
  }

  .pass-control {
    border-right: 1px solid var(--line);
  }

  .pass-control:nth-of-type(3) { border-right: 0; }

  .model-facts,
  .source-register {
    grid-column: 1 / -1;
  }

  .source-register {
    display: none;
  }

  .footer-line {
    grid-column: 1;
    grid-row: 5;
    min-height: 30px;
  }
}

@media (max-width: 620px) {
  :root { --masthead-height: 54px; }

  .app-shell {
    grid-template-rows: var(--masthead-height) auto min(66dvh, 580px) auto auto;
  }

  .masthead {
    grid-template-columns: 1fr auto;
    padding: 0 13px;
  }

  .brand-rule { width: 17px; margin: 0 7px; }
  .brand-title { max-width: 150px; }
  .edition-mark { display: none; }
  .repository-link span:first-child { display: none; }
  .repository-link { font-size: 14px; }

  .scene-button {
    flex-basis: min(236px, 78vw);
    min-height: 69px;
    padding: 13px 12px;
  }

  .stage {
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .viewport-frame {
    margin: 8px 8px 0;
  }

  .scene-heading {
    top: 26px;
    left: 22px;
    max-width: 72%;
  }

  .scene-heading__index { margin-bottom: 12px; }
  .scene-heading h1 { font-size: clamp(38px, 12vw, 56px); }
  .scene-heading p { font-size: 7px; }

  .view-readout {
    top: 16px;
    right: 17px;
  }

  .view-readout span:last-child { display: none; }

  .scene-caption {
    right: 21px;
    bottom: 37px;
    width: min(210px, 57%);
  }

  .scene-caption p {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .scale-readout {
    bottom: 18px;
    left: 18px;
  }

  .camera-strip {
    flex-wrap: wrap;
    gap: 4px;
    padding: 6px 8px;
  }

  .variant-selector {
    order: 3;
    width: 100%;
    margin: 2px 0 0;
    justify-content: flex-end;
  }

  .control-label { display: none; }
  .camera-strip button { padding: 5px 7px; }
  .control-cluster--actions { margin-left: auto; }
  .control-cluster--actions kbd { display: none; }

  .instrument-panel {
    grid-template-columns: 1fr;
  }

  .instrument-heading,
  .pass-control,
  .model-facts {
    grid-column: 1;
  }

  .pass-control {
    border-right: 0;
  }

  .footer-line {
    display: flex;
    min-height: 35px;
    justify-content: space-between;
  }

  .footer-line span:nth-child(2) { display: none; }
}

@media (max-width: 420px) {
  .brand-title { max-width: 120px; }
  .scene-caption {
    right: 18px;
    bottom: 39px;
    display: block;
    width: auto;
    padding-top: 0;
    border-top: 0;
  }
  .scene-caption p { display: none; }
  .interaction-hint { display: flex; }
  .scene-heading { max-width: 82%; }
  .scene-heading h1 { font-size: 42px; }
  .camera-strip button span { display: none; }
  .variant-selector > span { display: none; }
  .motion-button i { display: block; }
  .control-cluster--actions kbd { display: block; }
  .footer-line span:last-child { display: none; }
}

@media (min-width: 901px) and (max-height: 619px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    height: 620px;
  }
}

html[data-capture="reference"],
html[data-capture="reference"] body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #eef2f3;
}

html[data-capture="reference"] body::after,
html[data-capture="reference"] .skip-link,
html[data-capture="reference"] .masthead,
html[data-capture="reference"] .scene-ledger,
html[data-capture="reference"] .instrument-panel,
html[data-capture="reference"] .camera-strip,
html[data-capture="reference"] .footer-line,
html[data-capture="reference"] .viewport-grid,
html[data-capture="reference"] .corner,
html[data-capture="reference"] .scene-heading,
html[data-capture="reference"] .view-readout,
html[data-capture="reference"] .scale-readout,
html[data-capture="reference"] .scene-caption,
html[data-capture="reference"] .interaction-hint {
  display: none !important;
}

html[data-capture="reference"] .app-shell {
  display: block;
  width: 100vw;
  height: 100vh;
  min-height: 0;
  animation: none;
  background: transparent;
}

html[data-capture="reference"] .stage {
  display: block;
  width: 100%;
  height: 100%;
}

html[data-capture="reference"] .viewport-frame {
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  .scene-swatch,
  .signal-mark i,
  .loading-orbit i {
    forced-color-adjust: none;
  }
}
