/* gallery-room (Definer Group brand section, 2026-11-18): one room of the Selected
   work page. The line's photos hang as framed pieces at their own proportions: a white
   mat, a 1px outer line, the house gilt inset on the photo (hero-index section.css), a
   picture light above (world.css) and a wall label below. The figure carries the
   photo's width and height (--w, --h) so each frame keeps its shape and a tall piece
   stays at most 28rem (phones) or 34rem (from 960px) high.
   Still state (phones, reduced motion, no JS, the pause switch, the still preset):
   every piece hung and lit, the lights gilt.
   Motion (craft limit L6, recipe contract R00): world.js marks the wall is-live from
   960px with motion allowed, then each piece reached (is-in), both ways. Transform and
   opacity only, plus the light's colour on the class change. Semantic tokens only. */
.s-room__head { display: grid; row-gap: var(--space-5); margin-bottom: var(--space-8); }
.s-room__label { margin-bottom: var(--space-3); color: var(--accent); }
.s-room__text { max-width: 30rem; color: var(--fg-soft); }
.s-room__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  margin-top: var(--space-3);
  color: inherit;
  font-weight: var(--fw-ui);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: .3em;
}
.s-room__arrow { width: 20px; height: 20px; transition: transform var(--t-fast) var(--ease); }
.s-room__link:hover .s-room__arrow { transform: translateX(4px); }

.s-room__wall { display: grid; row-gap: var(--space-8); margin: 0; padding: 0; list-style: none; }
.s-room__fig {
  --cap: 28rem;
  /* never wider than the file itself (--w px), so a small scan is not blown up soft */
  width: min(100%, calc(var(--cap) * var(--w) / var(--h) + 2 * var(--space-3)), calc(var(--w) * 1px + 2 * var(--space-3)));
  margin: 0 auto;
}
.s-room__lamp { margin-bottom: var(--space-2); transition: border-color var(--t-fast) var(--ease); }
.s-room__frame {
  position: relative;
  padding: var(--space-3);
  background: var(--surface);
  border: var(--hairline) solid var(--rule-strong);
}
.s-room__frame .media--natural { aspect-ratio: var(--w) / var(--h); border-radius: 0; }
.s-room__frame .media--natural img { height: 100%; }
.s-room__walllabel {
  display: grid;
  row-gap: var(--space-1);
  max-width: 26rem;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: var(--hairline) solid var(--accent);
}
.s-room__name { font-family: var(--font-body); font-size: var(--fs-body); font-weight: var(--fw-ui); line-height: var(--lh-body); letter-spacing: 0; }
.s-room__sub { color: var(--fg-muted); }

@media (min-width: 960px) {
  .s-room__head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--space-8); align-items: end; }
  .s-room__wall { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); row-gap: var(--space-9); align-items: start; }
  .s-room__piece:nth-child(even of :not(.s-room__piece--wide)) { margin-top: var(--space-10); }
  .s-room__fig { --cap: 40rem; }
  .s-room__piece.s-room__piece--wide { grid-column: 1 / -1; margin-top: 0; }
  .s-room__piece--wide .s-room__fig { --cap: 44rem; }
}

@media (prefers-reduced-motion: no-preference) and (min-width: 960px) {
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__wall.is-live .s-room__piece {
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__wall.is-live .s-room__piece:not(.is-in) {
    opacity: .14;
    transform: translateY(16px);
  }
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__wall.is-live .s-room__piece:not(.is-in) .s-room__lamp,
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__wall.is-live .s-room__piece:not(.is-in) .s-room__lamp::before,
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__wall.is-live .s-room__piece:not(.is-in) .s-room__lamp::after { border-color: var(--rule-strong); }
}

/* Quiet luxury pass (2026-11-18): bigger pieces (a piece marked wide spans the wall from
   960px, the others hang up to 40rem high), and the picture lights warm up and the
   photo drifts to rest as each piece comes up the screen, from --warm (world.js), both
   ways; still state: lit and at rest. */
@media (prefers-reduced-motion: no-preference) {
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__fig .s-room__lamp {
    transform: scaleX(calc(.3 + .7 * var(--warm, 1)));
  }
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-room__fig .media > img {
    transform: scale(calc(1.06 - .06 * var(--warm, 1)));
  }
}
