/* Viscerapparel: a gallery in six acts over one sticky WebGL canvas.
   Loaded after scrollcraft/scrollcraft.css. The engine is themed only through --sc-* tokens (below);
   .sc-stage, .sc-copy and [data-sc-*] selectors are never restyled here. */

/* ------------------------------------------------------------------ tokens -- */
:root {
  --wall: #eae8e3;
  --paper: #f2f0eb;
  --ink: #16150f;
  --muted: #625e55;          /* 5.6:1 on paper, 5.1:1 on the wall */
  --gold: #7d6131;           /* 5.1:1 on paper, 4.8:1 on the wall */
  --gold-soft: rgba(125, 97, 49, .42);
  --rule: rgba(22, 21, 15, .14);
  color-scheme: light;

  /* The night room. The same in both themes: After Dark is always dark. */
  --night: #131211;
  --night-ink: #ece8df;
  --night-muted: #a39d92;    /* 6.6:1 on night */
  --night-gold: #c7a468;     /* 7.9:1 on night */

  --display: 'Bodoni Moda', Didot, 'Bodoni 72', Georgia, serif;
  --text: 'Hanken Grotesk', 'Helvetica Neue', Arial, sans-serif;

  --gutter: clamp(20px, 4vw, 48px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --pad-l: calc(var(--gutter) + var(--safe-l));
  --pad-r: calc(var(--gutter) + var(--safe-r));
  --ease: cubic-bezier(.23, 1, .32, 1);
  --theme-dur: .6s;
  --foot-b: calc(clamp(28px, 5vh, 48px) + var(--safe-b));
}

:root[data-theme="dark"] {
  --wall: #141312;
  --paper: #1b1a18;
  --ink: #ece8df;
  --muted: #a39d92;          /* 6.5:1 on paper */
  --gold: #c7a468;
  --gold-soft: rgba(199, 164, 104, .45);
  --rule: rgba(236, 232, 223, .14);
  color-scheme: dark;
}

/* Engine theme: mapped from the site tokens, restated for both themes. Drift writes --sc-canvas inline. */
:root,
:root[data-theme="dark"] {
  --sc-canvas: var(--wall);
  --sc-surface: var(--paper);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--muted);
  --sc-accent: var(--gold);
  --sc-accent-ink: var(--paper);
  --sc-font-display: var(--display);
  --sc-font-text: var(--text);
  --sc-gutter: var(--gutter);
  --sc-shadow-color: 40 14% 6%;
}

/* Theme switch: colours ease for one beat, then per-element hover transitions resume. */
@media (prefers-reduced-motion: no-preference) {
  .theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: color var(--theme-dur) var(--ease), background-color var(--theme-dur) var(--ease),
      border-color var(--theme-dur) var(--ease), text-decoration-color var(--theme-dur) var(--ease),
      outline-color var(--theme-dur) var(--ease) !important;
  }
}

/* -------------------------------------------------------------------- base -- */
body {
  background: var(--sc-canvas);
  color: var(--ink);
  font: 400 16px/1.6 var(--text);
}
body.is-detail { overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* Small caps line shared by controls and label meta. */
#themeBtn, #soundBtn, #closeBtn, .step, .seg button, .pill, #hint,
.l-meta, .descent-no, .spec-row dt, .inquiry-contact dt {
  font-family: var(--text);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* Night scope: After Dark, the descent, and (via body.is-night, set by app.js) the fixed chrome over them. */
.room--night,
.descent,
body.is-night .site-header,
body.is-night .gallery-stage,
body.is-night #hint {
  --ink: var(--night-ink);
  --muted: var(--night-muted);
  --gold: var(--night-gold);
  --gold-soft: rgba(199, 164, 104, .45);
  --rule: rgba(236, 232, 223, .14);
  --room-ground: var(--night);
  color: var(--ink);
}

/* ------------------------------------------------------------------ header -- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: calc(22px + var(--safe-t)) var(--pad-r) 18px var(--pad-l);
  pointer-events: none;
}
.site-header::after {
  content: "";
  position: absolute;
  left: var(--pad-l);
  right: var(--pad-r);
  bottom: 0;
  height: 1px;
  background: var(--gold-soft);
  opacity: .5;
}
.site-header > * { pointer-events: auto; }
.wordmark-wrap { font: inherit; line-height: 1; }
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .32em;
  white-space: nowrap;
  color: var(--ink);
}
.site-tools {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
}
#themeBtn, #soundBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  transition: color .18s var(--ease);
  white-space: nowrap;
}
#themeBtn:active, #soundBtn:active { transform: translateY(1px); }
#soundBtn[aria-pressed="true"] { color: var(--ink); }
#soundBtn[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: .18em;
  bottom: 12px;
  height: 1px;
  background: var(--gold);
}
@media (hover: hover) and (pointer: fine) {
  #themeBtn:hover, #soundBtn:hover { color: var(--ink); }
}

/* Object index: built by app.js and appended to #hero. On a wide screen it sits in the header row. */
.rooms {
  position: absolute;
  top: calc(22px + var(--safe-t));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  min-height: 44px;
  max-width: calc(100% - 2 * var(--gutter));
  overflow-x: auto;
  scrollbar-width: none;
}
.rooms::-webkit-scrollbar { display: none; }
.rooms button {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 44px;
  padding: 14px 0 10px;
  border-bottom: 1px solid transparent;
  color: var(--muted);
  font: 500 11px/1 var(--text);
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.rooms-no { font: italic 400 14px/1 var(--display); letter-spacing: 0; color: var(--gold); text-transform: none; }
.rooms button[aria-current="true"] { color: var(--ink); border-bottom-color: var(--gold); }
@media (hover: hover) and (pointer: fine) {
  .rooms button:hover { color: var(--ink); }
}

/* --------------------------------------------------------- the canvas layer -- */
.gallery { position: relative; }
.gallery-stage {
  position: sticky;
  top: 0;
  z-index: 0;
  height: 100vh;
  height: 100svh;
  margin-bottom: -100vh;
  margin-bottom: -100svh;
  overflow: clip;
  isolation: isolate;
  background: var(--wall);
}
.stage-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  z-index: 0;
  transition: opacity 1.4s var(--ease);
}
body.is-ready .stage-poster { opacity: 0; }
body.no-webgl .stage-poster { opacity: 1; }
#stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  display: block;
  touch-action: pan-y;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
}
body.is-detail #stage { touch-action: none; }
body.is-ready #stage { opacity: 1; }
body.no-webgl #stage { display: none; }
#stage:focus-visible { outline: 2px solid var(--gold); outline-offset: -8px; }
body.is-detail .gallery-stage { position: fixed; inset: 0; z-index: 55; margin: 0; }
#stageStatus { position: absolute; top: 145px; left: var(--pad-l); right: var(--pad-r); z-index: 4; max-width: 36rem; margin: 0 auto; padding: 20px; background: var(--paper); border: 1px solid var(--rule); text-align: center; }
#stageStatus[hidden] { display: none; }
#retryBtn { min-height: 44px; margin-top: 8px; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
#stage.can-grab { cursor: grab; }
#stage.is-dragging { cursor: grabbing; }

/* Interaction hint: fixed bottom-right above the room stages, only while a room holds the screen. */
#hint {
  position: fixed;
  right: var(--pad-r);
  bottom: var(--foot-b);
  z-index: 50;
  max-width: 40ch;
  color: var(--muted);
  text-align: right;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s linear .3s;
}
body.in-room #hint { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
body.no-webgl #hint, body.is-detail #hint { display: none; }

/* ------------------------------------------------------------- room acts -- */
.room {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  pointer-events: none;   /* the canvas underneath takes the pointer */
  --room-ground: var(--wall);
}
.room-stage { height: 100vh; height: 100svh; pointer-events: none; background: transparent; }
.room-stage a { pointer-events: auto; }

/* Foreground depth plane: the soft edge of a doorway very close to the camera. */
.room-fore {
  position: absolute;
  top: -4%;
  bottom: -4%;
  width: clamp(56px, 9vw, 150px);
  z-index: 3;
  pointer-events: none;
}
.room-fore--right {
  right: calc(-1 * clamp(20px, 2.5vw, 44px));
  /* clear of the header tools above and the hint below */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 64%, transparent 84%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 64%, transparent 84%);
}
.room-fore--left {
  left: calc(-1 * clamp(20px, 2.5vw, 44px));
  /* keep the bottom-left label clear */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 42%, transparent 66%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 42%, transparent 66%);
}
.room-fore > span {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
    transparent 0%,
    color-mix(in oklab, var(--room-ground) 55%, #0c0b0a) 34%,
    color-mix(in oklab, var(--room-ground) 40%, #0c0b0a) 58%,
    transparent 100%);
  filter: blur(14px);
  opacity: .3;
  transform: translate3d(calc((var(--sc-p, .5) - .5) * -12vw), 0, 0);
}
.room--night .room-fore > span {
  background: linear-gradient(to right, transparent 0%, #0a0909 34%, #070606 58%, transparent 100%);
  opacity: .85;
}

/* The wall label: one per room, bottom-left, filled by app.js with the piece nearest the camera. */
.room-scrim {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  width: min(640px, 92vw);
  height: min(420px, 56svh);
  pointer-events: none;
  background: radial-gradient(ellipse 72% 72% at 0% 100%,
    color-mix(in oklab, var(--room-ground) 86%, transparent) 0%,
    color-mix(in oklab, var(--room-ground) 62%, transparent) 42%,
    transparent 78%);
}
.room--night .room-scrim {
  background: radial-gradient(ellipse 78% 80% at 0% 100%,
    color-mix(in oklab, var(--night) 94%, transparent) 0%,
    color-mix(in oklab, var(--night) 78%, transparent) 45%,
    transparent 82%);
}
.room-label {
  position: absolute;
  left: var(--pad-l);
  bottom: var(--foot-b);
  z-index: 2;
  width: min(34ch, calc(100vw - 2 * var(--gutter)));
  pointer-events: none;
}
body.is-detail .room-label,
body.is-detail .room-scrim,
body.is-detail .room-fore,
body.is-detail .rooms,
body.is-detail .site-tools { visibility: hidden; pointer-events: none; }

/* --------------------------------------------------------- label schema -- */
.label { display: grid; gap: 6px; align-content: end; }
.label::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--gold);
  margin-bottom: 10px;
}
.l-no, #dCount {
  color: var(--gold);
  font: 500 12px/1.4 var(--text);
  letter-spacing: .12em;
  font-variant-numeric: tabular-nums lining-nums;
}
.l-title {
  font-family: var(--display);
  font-size: clamp(26px, 2.2vw, 32px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.l-color { color: var(--ink); font-size: 14px; line-height: 1.5; text-wrap: pretty; max-width: 36ch; }
.l-meta { color: var(--muted); margin-top: 2px; line-height: 1.5; }
/* Light type on the night wall: one step more weight and air. */
.room--night .l-color, .descent .l-color { font-weight: 500; letter-spacing: .01em; }

/* -------------------------------------------------------------- descent -- */
.descent {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-items: end;
  justify-items: end;
  padding: 0 var(--pad-r) clamp(96px, 20vh, 200px) var(--pad-l);
  /* Transparent: the room itself goes dark behind it (app.js dims the lights with this act's scroll),
     so no band of ground ever slides across the frame. */
  background: transparent;
  pointer-events: none;
}
.descent-wall { display: grid; gap: 10px; justify-items: end; text-align: right;
  /* the wall text arrives once the room has gone dark enough to carry night ink */
  opacity: clamp(0, min(calc((var(--sc-p, 0) - 0.4) * 6), calc((0.7 - var(--sc-p, 0)) * 9), calc((var(--night-mix, 0) - 0.88) * 9)), 1); }
.descent-no { color: var(--muted); letter-spacing: .24em; }
.descent-title {
  font-family: var(--display);
  font-size: clamp(30px, 3.4vw, 48px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -.01em;
}

/* ---------------------------------------------------------------- plates -- */
.plate {
  position: relative;
  z-index: 1;
  background: var(--paper);
  color: var(--ink);
}
/* A paper strip that sticks under the fixed header while a plate passes beneath it,
   so plate type never scrolls through the header. Invisible at rest (paper on paper). */
.plate-cap {
  position: sticky;
  top: 0;
  z-index: 2;
  height: calc(84px + var(--safe-t));
  margin-bottom: calc(-84px - var(--safe-t));
  background: var(--paper);
  pointer-events: none;
}

/* Specification: split. The figure leads, the sheet trails. */
.plate--spec { border-top: 1px solid var(--rule); }
.plate--spec .spec-grid { padding: clamp(112px, 14vw, 184px) var(--pad-r) clamp(96px, 14vw, 184px) var(--pad-l); }
.spec-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: end;
  max-width: calc(1320px + var(--pad-l) + var(--pad-r));
  margin: 0 auto;
}
.lattice { display: grid; gap: clamp(20px, 2.4vw, 28px); }
.lattice-frame {
  aspect-ratio: 16 / 10;
  background: color-mix(in oklab, var(--paper) 88%, var(--ink));
  overflow: hidden;
}
.lattice-frame img { width: 100%; height: 100%; object-fit: cover; }
.label--caption .l-title { font-size: 20px; }
.label--caption { max-width: 40ch; }

.spec-copy { display: grid; gap: clamp(40px, 5vw, 64px); }
.spec-sheet { border-top: 1px solid var(--rule); }
.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--rule);
}
.spec-row dt { color: var(--muted); line-height: 1.5; }
.spec-row dd {
  font-family: var(--display);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums lining-nums;
}
.spec-approx { font-style: italic; font-size: .6em; color: var(--muted); margin-right: .15em; }

/* Inquiry: the close. Centred block, set as a label, lit and holding. */
.plate--inquiry {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(ellipse 48% 42% at 50% 44%, color-mix(in oklab, var(--gold) 9%, var(--paper)) 0%, transparent 100%),
    var(--paper);
  border-top: 1px solid var(--rule);
}
.inquiry { display: grid; place-items: center; padding: calc(120px + var(--safe-t)) var(--pad-r) 0 var(--pad-l); }
.label--inquiry { width: min(100%, 30rem); gap: 8px; }
.label--inquiry .l-title { font-size: clamp(40px, 5vw, 64px); line-height: 1.02; letter-spacing: -.015em; }
.label--inquiry .l-color { font-size: 17px; }
.inquiry-action { margin-top: clamp(28px, 4vw, 40px); }
.inquiry-action a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--display);
  font-size: clamp(22px, 2.2vw, 28px);
  font-style: italic;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 8px;
  transition: color .18s var(--ease), text-decoration-color .18s var(--ease);
}
.inquiry-action a:active { transform: translateY(1px); }
.inquiry-contact {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.inquiry-contact div { display: flex; align-items: baseline; gap: 16px; }
.inquiry-contact dt { min-width: 6.5em; color: var(--muted); }
.inquiry-contact dd { font-size: 15px; }
.inquiry-contact a, .plate-foot a {
  display: inline-block;
  padding: 10px 0;
  text-decoration: underline;
  text-decoration-color: var(--gold-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  transition: text-decoration-color .18s var(--ease);
}
.plate-foot {
  display: grid;
  gap: 2px;
  width: calc(100% - var(--pad-l) - var(--pad-r));
  max-width: 1320px;
  margin: clamp(64px, 10vh, 112px) auto calc(36px + var(--safe-b));
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: .03em;
}
.plate-foot a { padding: 4px 0; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) {
  .inquiry-action a:hover { color: var(--gold); }
  .inquiry-contact a:hover, .plate-foot a:hover { text-decoration-color: var(--gold); }
}

/* ------------------------------------------------------------- detail UI -- */
#detailUi[hidden] { display: none; }
body.is-detail #detailUi { display: block; }
#detailUi {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  animation: fade-in .5s var(--ease) both;
}
#detailUi button, #detailUi .detail-foot > * { pointer-events: auto; }
#detailUi .detail-foot > p { pointer-events: none; }

#closeBtn {
  position: absolute;
  top: calc(22px + var(--safe-t));
  right: var(--pad-r);
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  transition: color .18s var(--ease);
}
.step {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 4px;
  font-weight: 400;
  color: var(--muted);
  transition: color .18s var(--ease);
}
#prevBtn { left: calc(var(--pad-l) - 4px); }
#nextBtn { right: calc(var(--pad-r) - 4px); }
.step-line {
  width: 24px;
  height: 1px;
  background: var(--gold);
  transition: transform .18s var(--ease);
  transform-origin: center;
}
.detail-foot {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 var(--pad-r) calc(clamp(24px, 4vh, 40px) + var(--safe-b)) var(--pad-l);
  text-align: center;
  pointer-events: none;
}
#dTitle {
  font-family: var(--display);
  font-size: 36px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
}
#dTitle:focus { outline: none; }
#dTitle:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
#dColor { color: var(--muted); font-size: 14px; min-height: 1.6em; margin-top: -4px; }
.seg { display: inline-flex; gap: 24px; margin-top: 4px; }
.seg button {
  position: relative;
  min-height: 44px;
  padding: 0 2px;
  color: var(--muted);
  transition: color .18s var(--ease);
}
.seg button[aria-pressed="true"] { color: var(--ink); }
.seg button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 2px;
  right: calc(2px + .18em);
  bottom: 10px;
  height: 1px;
  background: var(--gold);
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
  transition: background-color .18s var(--ease), color .18s var(--ease);
}
.pill:active, .step:active, .seg button:active, #closeBtn:active { transform: translateY(1px); }
.step:active { transform: translateY(calc(-50% + 1px)); }
#dHint { color: var(--muted); font-size: 12px; margin-top: 2px; }
@media (hover: hover) and (pointer: fine) {
  #closeBtn:hover { color: var(--gold); }
  .step:hover, .seg button:hover { color: var(--ink); }
  .step:hover .step-line { transform: scaleX(1.5); }
  .pill:hover { background: var(--ink); color: var(--paper); }
}

/* ----------------------------------------------------------------- toast -- */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  z-index: 10;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 12px 22px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: .02em;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility 0s linear .24s;
  pointer-events: none;
}
#toast.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility 0s;
}

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

/* ---------------------------------------------------------------- tablet -- */
@media (max-width: 960px) {
  .plate-cap { height: calc(138px + var(--safe-t)); margin-bottom: calc(-138px - var(--safe-t)); }
  /* The object index drops under the header rule. */
  .rooms { top: calc(78px + var(--safe-t)); }
  .spec-grid { grid-template-columns: minmax(0, 1fr); }
  .spec-copy { max-width: 36rem; }
}

/* ----------------------------------------------------------------- phone -- */
@media (max-width: 640px) {
  .plate-cap { height: calc(128px + var(--safe-t)); margin-bottom: calc(-128px - var(--safe-t)); }
  :root { --foot-b: calc(80px + var(--safe-b)); }
  .site-header { padding-top: calc(14px + var(--safe-t)); padding-bottom: 10px; gap: 12px; }
  .wordmark { font-size: 13px; letter-spacing: .24em; }
  .site-tools { gap: 16px; }
  .rooms { top: calc(70px + var(--safe-t)); gap: 18px; left: var(--pad-l); transform: none; max-width: calc(100% - var(--pad-l) - var(--pad-r)); }

  /* Label above, hint on its own line under it, both left. */
  .l-title { font-size: 24px; }
  .l-color { font-size: 13px; }
  .room-label { width: calc(100vw - var(--pad-l) - var(--pad-r)); }
  .room-scrim {
    width: 100%;
    height: min(360px, 50svh);
    background: linear-gradient(to top,
      color-mix(in oklab, var(--room-ground) 88%, transparent) 0%,
      color-mix(in oklab, var(--room-ground) 66%, transparent) 40%,
      transparent 100%);
  }
  #hint { left: var(--pad-l); right: var(--pad-r); bottom: calc(20px + var(--safe-b)); max-width: none; text-align: left; letter-spacing: .12em; line-height: 1.6; }
  .room-fore { width: 44px; }
  .room-fore > span { filter: blur(10px); }

  .descent { justify-items: start; padding-bottom: clamp(88px, 18svh, 160px); }
  .descent-wall { justify-items: start; text-align: left; }

  #dTitle { font-size: 28px; }
  .detail-foot { gap: 8px; }
  .step-line { width: 16px; }

  .spec-row dd { font-size: 26px; }
  .label--inquiry .l-title { font-size: 40px; }
  .inquiry { place-items: center start; }
}

@media (max-width: 380px) {
  .wordmark { font-size: 12px; letter-spacing: .18em; }
  .site-tools { gap: 12px; }
  #themeBtn, #soundBtn { letter-spacing: .12em; }
  .rooms { gap: 12px; }
  .rooms button { gap: 5px; letter-spacing: .1em; font-size: 10px; }
  .spec-row { flex-wrap: wrap; gap: 6px 16px; }
  .plate-foot { margin-top: 20px; margin-bottom: calc(16px + var(--safe-b)); }
}

/* Short landscape screens keep the garment and its controls alongside each other. */
@media (max-height: 540px) and (orientation: landscape) {
  body.is-detail .detail-foot { inset: 84px var(--pad-r) 20px 58%; justify-content: center; padding: 0; gap: 6px; }
  body.is-detail #dTitle { font-size: 28px; }
  body.is-detail #nextBtn { right: calc(42vw + var(--gutter)); }
  body.is-detail .pill { white-space: normal; padding: 8px 16px; }
}

/* ------------------------------------------------------- reduced motion -- */
/* Fewer and gentler, not zero: the engine keeps opacity fades; position changes go. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .room-fore > span { transform: none; }
  #toast, #toast.is-on { transform: translate(-50%, 0); }
  .stage-poster, #stage { transition-duration: .3s; }
}


