/* Definer Group world: a private gallery of the house's own commissions
   (brands/definer-group/concepts.md, 2026-11-18). Loaded on every page after the
   kit files and before the section files, so each rule here names its scene.

   Materials, all drawn with 1px lines on the tonal ladder of tokens.json (no
   gradient, glow or shadow: signature S5):
   - the gilt frame: a white mat, a 1px outer line, a 1px gilt line round the photo
     (the photo's own gilt inset hairline is in sections/hero-index/section.css)
   - the picture light: a short brass bar on two 1px drops above a frame
   - the wall label: a gilt rule, a small label, one line of caption
   - room numbers in Roman numerals, small (craft limit L3)

   Motion follows the recipe contract R00 (docs/website-skills/recipes/README.md):
   the plain CSS below is the finished still page; every moving rule sits under
   prefers-reduced-motion: no-preference and html.js:not([data-motion="off"]), so
   reduced motion, no JS and the pause switch each show it complete. Nothing loops
   (signature E1). Kinds: the frame draws once (load or reveal), the exhibit tilts a
   little under a fine pointer (world.js), hover finishes on the rooms; the scroll
   scene of how-we-work is in its own section files. */

/* ---- the picture light ---- */
.s-hindex__lamp,
.s-how__lamp,
.s-room__lamp,
.s-rooms__lamp {
  position: relative;
  display: block;
  width: 34%;
  max-width: 14rem;
  height: var(--space-4);
  margin: 0 auto;
  border-top: var(--hairline) solid var(--accent);
}
.s-hindex__lamp::before,
.s-hindex__lamp::after,
.s-how__lamp::before,
.s-how__lamp::after,
.s-room__lamp::before,
.s-room__lamp::after,
.s-rooms__lamp::before,
.s-rooms__lamp::after {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 100%;
  border-left: var(--hairline) solid var(--accent);
}
.s-hindex__lamp::before, .s-how__lamp::before, .s-room__lamp::before, .s-rooms__lamp::before { left: 18%; }
.s-hindex__lamp::after, .s-how__lamp::after, .s-room__lamp::after, .s-rooms__lamp::after { right: 18%; }

/* ---- hero, variant gallery: the entrance hall ---- */
/* rooms: Roman numerals in a small label instead of 01 / 02 / 03 */
.s-hindex--gallery .s-hindex__row::before { content: none; }
.s-hindex--gallery .s-hindex__room {
  grid-column: 1 / -1;
  grid-row: 1;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-ui);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: var(--label-case);
  color: var(--accent);
  white-space: nowrap;
}
.s-hindex--gallery .s-hindex__room::after { content: "\00a0" counter(hindex, upper-roman); }
.s-hindex--gallery .s-hindex__row { grid-template-columns: minmax(0, 1fr) auto; }
.s-hindex--gallery .s-hindex__name,
.s-hindex--gallery .s-hindex__text { grid-column: 1; grid-row: auto; }
.s-hindex--gallery .s-hindex__arrow { grid-column: 2; grid-row: 2 / span 2; }

/* a small framed plate of each line's work (from 640px; phones keep the plain rows) */
.s-hindex__plate { display: none; }
@media (min-width: 640px) {
  .s-hindex--gallery .s-hindex__row { grid-template-columns: minmax(0, 1fr) 7rem auto; }
  .s-hindex--gallery .s-hindex__room { grid-column: 1; }
  .s-hindex--gallery .s-hindex__plate {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 3;
    align-self: center;
    padding: 4px;
    background: var(--surface);
    border: var(--hairline) solid var(--rule);
    transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  }
  .s-hindex--gallery .s-hindex__arrow { grid-column: 3; grid-row: 1 / span 3; }
  .s-hindex__plate .media { aspect-ratio: 4 / 3; border-radius: 0; }
  .s-hindex__plate .media::after { content: none; }
  .s-hindex--gallery a.s-hindex__row:hover .s-hindex__plate { border-color: var(--accent); }
}
@media (min-width: 960px) {
  .s-hindex--gallery .s-hindex__row { grid-template-columns: 6.5rem minmax(0, 4fr) minmax(0, 6fr) 8rem auto; }
  .s-hindex--gallery .s-hindex__room,
  .s-hindex--gallery .s-hindex__name,
  .s-hindex--gallery .s-hindex__text,
  .s-hindex--gallery .s-hindex__plate,
  .s-hindex--gallery .s-hindex__arrow { grid-column: auto; grid-row: 1; }
}

/* the main exhibit: hung frame, picture light, a second plate over its corner, wall label */
.s-hindex__exhibit { display: grid; row-gap: var(--space-5); }
.s-hindex__hang { position: relative; padding-bottom: var(--space-7); }
.s-hindex__frame {
  position: relative;
  padding: var(--space-2);
  background: var(--surface);
}
.s-hindex__frame .media { border-radius: 0; outline: var(--hairline) solid var(--accent); }
/* the outer line of the frame: top and bottom, then the two sides (drawn once, below) */
.s-hindex__frame::before,
.s-hindex__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.s-hindex__frame::before { border-block: var(--hairline) solid var(--rule-strong); transform-origin: 0 50%; }
.s-hindex__frame::after { border-inline: var(--hairline) solid var(--rule-strong); transform-origin: 50% 0; }
.s-hindex__second {
  position: absolute;
  right: var(--space-5);
  bottom: 0;
  width: 5.5rem;
  padding: 4px;
  background: var(--surface);
  border: var(--hairline) solid var(--rule-strong);
}
.s-hindex__second .media { border-radius: 0; }
.s-hindex__second .media::after { inset: 4px; }
.s-hindex__walllabel {
  display: grid;
  row-gap: var(--space-2);
  max-width: 22rem;
  padding-top: var(--space-3);
  border-top: var(--hairline) solid var(--accent);
}
.s-hindex__walllabel .s-hindex__no { margin: 0; }
.s-hindex__walllabel .s-hindex__cap { margin: 0; }
@media (min-width: 640px) {
  .s-hindex__frame { padding: var(--space-3); }
  .s-hindex__second { width: 8.5rem; right: var(--space-7); }
}
@media (min-width: 960px) {
  .s-hindex__exhibit { grid-template-columns: minmax(0, 9fr) minmax(0, 3fr); column-gap: var(--space-8); align-items: end; }
  .s-hindex__hang { padding-bottom: var(--space-8); }
  .s-hindex__second { width: 10rem; right: auto; left: var(--space-5); }
  .s-hindex__walllabel { margin-bottom: var(--space-8); }
}

/* ---- motion (R00): frame draws once, exhibit follows a fine pointer ---- */
@media (prefers-reduced-motion: no-preference) {
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-hindex__exhibit:not(.is-waiting) .s-hindex__frame::before {
    animation: g-draw-x 1100ms var(--ease) 150ms both;
  }
  html.js:not([data-motion="off"]):not([data-motion-preset="still"]) .s-hindex__exhibit:not(.is-waiting) .s-hindex__frame::after {
    animation: g-draw-y 900ms var(--ease) 450ms both;
  }
  html.js:not([data-motion="off"]) [data-tilt] {
    transform: perspective(1600px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
    transition: transform 700ms var(--ease);
  }
  .s-hindex--gallery a.s-hindex__row:hover .s-hindex__plate { transform: translateY(-4px); }
}
@media (min-width: 1280px) {
  .s-hindex__second { left: calc(-1 * var(--space-6)); }
}

@keyframes g-draw-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes g-draw-y { from { transform: scaleY(0); } to { transform: none; } }

/* Chinese serif loads at weight 400 only (tokens.json google_css2_subset, zh-fw-heading 400;
   design/2026-11-18-craft/speed.md): the small unit beside a figure asks for 500 in the
   section files, so on Chinese pages it is set to the weight that loads. */
:lang(zh) .s-scale__figure small,
:lang(zh) .s-features__figure small { font-weight: 400; }

/* ---- house rules for every page (moved here from sections/hero-index/section.css on
   2026-11-18, quiet luxury pass: home and the line pages now open with the entrance
   section, so these must not depend on hero-index being on the page) ---- */
/* Kit sections on the pages this hero opens (home, about). The display face draws
   old-style numerals by default ("1,000+" reads as "I,ooo+", "01" as "OI"), and the
   kit lays three figures or three steps out on a four-column grid. The kit has no
   token for numeral style and no brand stylesheet, so the rules live here. This file
   loads before the kit section files, so each selector carries one more class. */
.s-features .s-features__figure, .s-features .s-features__figure [data-count], .s-steps .s-steps__item::before { font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 639px) {
  .s-features.s-features--figures .s-features__list { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 960px) {
  .s-features.s-features--figures .s-features__list,
  .s-steps .s-steps__body:not(.s-steps__body--media) .s-steps__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- photos on every Definer page (content step 2026-11-17, checker round 1) ----
   One house treatment for every real photo, in any section: a 1px accent hairline
   inset like a hallmark (signature S2), and a gentle grade so stage light reads warm
   and quiet beside ink and gilt. Placeholder slots (no img) get neither. */
.media:has(> img)::after {
  content: "";
  position: absolute;
  inset: var(--space-3);
  border: var(--hairline) solid var(--accent);
  opacity: .7;
  pointer-events: none;
}
.media > img { filter: saturate(.72) contrast(1.03); }

/* Showcase titles in the body face at normal tracking, like the work captions
   (checker round 2). Kit work with three (or two) cards runs that many across (no empty cell). */
.s-showcase .s-showcase__bar h3 { letter-spacing: 0; font-weight: var(--fw-body); }
@media (min-width: 640px) {
  .s-work .s-work__cards:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-work .s-work__cards:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Kit steps on the line pages and home: three steps beside a photo stack in one
   column (no empty cell); four steps without a photo run in one row of four; the
   photo beside the steps stays at most 20rem wide so small sources stay sharp. */
@media (min-width: 960px) {
  .s-steps .s-steps__body--media .s-steps__figure { max-width: 20rem; justify-self: end; }
  .s-steps .s-steps__body--media .s-steps__list:has(> :nth-child(3):last-child) { grid-template-columns: minmax(0, 1fr); }
  .s-steps .s-steps__body:not(.s-steps__body--media) .s-steps__list:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Kit services with four cards (the design page's recent work since 2026-11-18): one row
   of four from 960px, two by two below (the kit's two columns), never three and one. */
@media (min-width: 960px) {
  .s-services .s-services__list:has(> :nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
