/* chriswang.design — base layer.
 *
 * Shared structure for every art direction: reset, tokens, the hero and work index, the scene
 * layer, the chrome (theme toggle, name mark, director switcher), View Transitions and reveals.
 *
 * A direction (styles/directions/<id>.css) overrides tokens for [data-theme="light"] and
 * [data-theme="dark"] independently, and may restyle any selector here. Only one direction
 * stylesheet applies at a time.
 *
 * The user multipliers --u-* come from the ⌘⇧D panel (js/core/params.js); every size here goes
 * through them so the panel works the same in every direction.
 *
 * Cascade: everything here sits in @layer engine, declared first, so any direction rule in
 * @layer base or @layer utilities wins on order alone, with no specificity contest and no
 * !important. The one exception is the reduced-motion block: an !important inside the
 * earliest layer outranks every later layer, which is exactly the guarantee it needs.
 */
@layer engine, base, utilities;

@layer engine {

/* ── Tokens (neutral defaults; every direction overrides them) ─────────────── */
:root {
  --u-type: 1; --u-text: 1; --u-leading: 1; --u-measure: 1; --u-space: 1; --u-radius: 1; --u-motion: 1;

  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;

  --hero-size: clamp(64px, 11vw, 176px);
  --hero-weight: 400;
  --hero-tracking: -0.03em;
  --hero-leading: 0.92;
  --hero-style: normal;
  --hero-transform: none;
  --tagline-size: clamp(18px, 1.7vw, 24px);
  --tagline-font: var(--font-body);
  --tagline-style: normal;
  --body-size: 16px;

  --radius-sm: calc(6px * var(--u-radius));
  --radius-md: calc(10px * var(--u-radius));
  --radius-lg: calc(16px * var(--u-radius));

  --gutter: calc(clamp(20px, 4vw, 64px) * var(--u-space));
  /* The page's edges. The fixed chrome (name chip, theme toggle) sits on --edge; loose text hangs
     on --edge-text, the line of the name inside its chip (edge + border + padding), so the story's
     words, the close and the footer all read down from the name. Right-aligned text ends on --edge,
     under the controls. */
  --edge: calc(clamp(16px, 3.2vw, 48px) * var(--u-space));  /* breathes with the window (Chris, 2026-10-28) */
  --chip-pad: 12px;
  --edge-text: calc(var(--edge) + 1px + var(--chip-pad));
  --measure: calc(1240px * var(--u-measure));

  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-move: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: calc(160ms * var(--u-motion));
  --dur-enter: calc(640ms * var(--u-motion));
  --stagger: calc(64ms * var(--u-motion));
  --rise: 16px;

  --scrim: none;
  --work-bg: var(--bg);
  --work-blur: 0px;
  --poster-fallback: var(--bg);
  --focus: var(--accent);
}

[data-theme='dark'] {
  --bg: #1a1816; --surface: #22201d; --surface-2: #2a2724;
  --text: #ece6de; --text-2: #c2b9ad; --text-3: #9a9187;
  --accent: #c8a064; --accent-ink: #1a1816;
  --line: rgb(236 230 222 / 0.12); --line-strong: rgb(236 230 222 / 0.24);
  --chrome-bg: rgb(30 28 25 / 0.72); --chrome-text: #ece6de;
}
[data-theme='light'] {
  --bg: #f5f2ee; --surface: #ebe7e1; --surface-2: #e2ddd5;
  --text: #2a2420; --text-2: #4a4440; --text-3: #6b645d;
  --accent: #8a6820; --accent-ink: #faf8f4;
  --line: rgb(42 36 32 / 0.12); --line-strong: rgb(42 36 32 / 0.26);
  --chrome-bg: rgb(250 248 244 / 0.78); --chrome-text: #2a2420;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img, svg, canvas { display: block; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(a, button):focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-sm); }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: calc(var(--body-size) * var(--u-text));
  line-height: calc(1.55 * var(--u-leading));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color calc(600ms * var(--u-motion)) var(--ease-move), color calc(600ms * var(--u-motion)) var(--ease-move);
}
::selection { background: var(--accent); color: var(--accent-ink); }

/* Custom scrollbars: thin, warm, never the OS default. */
html { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.skip-link {
  position: fixed; left: 16px; top: 16px; z-index: 50;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px;
  transform: translateY(-200%); transition: transform var(--dur-fast) var(--ease-enter);
}
.skip-link:focus-visible { transform: none; }

/* ── Scene layer ───────────────────────────────────────────────────────────── */
.scene-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; contain: strict; }
.scene-host { position: absolute; inset: 0; }
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity calc(500ms * var(--u-motion)) var(--ease-enter); }
.scene-poster {
  position: absolute; inset: 0;
  background-color: var(--poster-fallback);
  background-size: cover; background-position: center;
  opacity: 1; transition: opacity calc(700ms * var(--u-motion)) var(--ease-move);
}
.scene-host[data-state='live'] .scene-canvas { opacity: 1; }
.scene-host[data-state='live'] .scene-poster { opacity: 0; }
/* In-scene loading (stage.js): the canvas draws its own build from the look's background, so it
 * comes up quickly and the poster is only a failure fallback. Reduced motion keeps the canvas
 * hidden until the scene is ready and then crossfades it in (see the reduced-motion block). */
.scene-host[data-ready] .scene-canvas { transition: opacity calc(var(--scene-reveal, 320ms) * var(--u-motion)) var(--ease-enter); }
.scene-scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: var(--scrim); }

/* ── Page ──────────────────────────────────────────────────────────────────── */
.site { position: relative; z-index: 2; }

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: calc(96px * var(--u-space)) var(--gutter) calc(32px * var(--u-space));
  pointer-events: none;
}
.hero a { pointer-events: auto; }
.hero-inner {
  align-self: end;
  width: 100%; max-width: var(--measure);
  /* Anchored to the page gutter, not centred in the measure: every scene stages its subject on the
   * right, so a centred 1240px column drifted the name toward it on wide screens and left a dead
   * band on the left. The inset grows a little with the viewport and is capped by --hero-inset. */
  margin-inline: clamp(0px, (100% - var(--measure)) / 2, var(--hero-inset, 2.5vw)) auto;
  padding-bottom: calc(10vh * var(--u-space));
}
.hero-name {
  /* Optical hang measured from the actual glyphs (js/core/optical.js). */
  margin-inline-start: var(--hero-optical, 0px);
  font-family: var(--font-display);
  font-size: calc(var(--hero-size) * var(--u-type));
  font-weight: var(--hero-weight);
  font-style: var(--hero-style);
  letter-spacing: var(--hero-tracking);
  line-height: calc(var(--hero-leading) * var(--u-leading));
  text-transform: var(--hero-transform);
  color: var(--hero-color, var(--text));
  text-wrap: balance;
}
.hero-tagline {
  margin-top: calc(24px * var(--u-space));
  max-width: 30ch;
  font-family: var(--tagline-font);
  font-style: var(--tagline-style);
  font-size: calc(var(--tagline-size) * var(--u-type));
  line-height: calc(1.4 * var(--u-leading));
  color: var(--tagline-color, var(--text-2));
  text-wrap: balance;
}
.hero-cue {
  justify-self: center;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-2);
  transition: color var(--dur-fast) var(--ease-enter);
}
.hero-cue svg { transition: transform calc(320ms * var(--u-motion)) var(--ease-enter); }
.hero-cue:hover { color: var(--text); }
.hero-cue:hover svg { transform: translateY(3px); }

/* ── Work index ────────────────────────────────────────────────────────────── */
/* Unpublished for now: html[data-work='hidden'] (the pre-paint default; ?work=1 shows it). */
html[data-work='hidden'] :is(.skip-link, .hero-cue, .work) { display: none !important; }
.work {
  position: relative;
  padding: calc(96px * var(--u-space)) var(--gutter) calc(64px * var(--u-space));
  background: var(--work-bg);
  backdrop-filter: blur(var(--work-blur));
  -webkit-backdrop-filter: blur(var(--work-blur));
  transition: background-color calc(600ms * var(--u-motion)) var(--ease-move);
}
.work > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.work-heading {
  font-family: var(--font-mono); font-weight: 500; font-size: 12px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: calc(24px * var(--u-space));
}

.featured { margin-bottom: calc(112px * var(--u-space)); }
.featured-link {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: calc(40px * var(--u-space));
  align-items: end;
}
.featured-media {
  display: block; overflow: hidden; border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9; background: var(--surface);
  border: 1px solid var(--line);
}
.featured-media img { width: 100%; height: 100%; object-fit: cover; transition: transform calc(900ms * var(--u-motion)) var(--ease-enter); }
.featured-link:hover .featured-media img { transform: scale(1.03); }
.featured-body { display: grid; gap: calc(16px * var(--u-space)); }
.featured-kicker { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.featured-title {
  font-family: var(--font-display); font-size: calc(clamp(30px, 3.4vw, 48px) * var(--u-type));
  line-height: calc(1.05 * var(--u-leading)); letter-spacing: -0.02em; color: var(--text); text-wrap: balance;
}
.featured-summary { color: var(--text-2); max-width: 44ch; }
.featured-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.featured-cta .icon-arrow { transition: transform calc(320ms * var(--u-motion)) var(--ease-enter); }
.featured-link:hover .featured-cta .icon-arrow { transform: translate(3px, -3px); }

.work-section { margin-bottom: calc(80px * var(--u-space)); }
.work-section-head {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: baseline; gap: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line-strong);
}
.work-section-num, .work-section-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.work-section-title {
  font-family: var(--font-display); font-weight: 400;
  font-size: calc(clamp(22px, 2vw, 28px) * var(--u-type)); letter-spacing: -0.01em; color: var(--text);
}

.work-item { border-bottom: 1px solid var(--line); }
.work-link {
  position: relative;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.3fr) auto;
  gap: 8px 24px; align-items: baseline;
  padding: calc(18px * var(--u-space)) 0;
  transition: color var(--dur-fast) var(--ease-enter);
}
.work-link::before {
  content: ''; position: absolute; inset: 0 -12px; border-radius: var(--radius-md);
  background: var(--surface); opacity: 0; transform: scaleY(0.92);
  transition: opacity calc(240ms * var(--u-motion)) var(--ease-enter), transform calc(240ms * var(--u-motion)) var(--ease-enter);
  z-index: -1;
}
.work-link:hover::before, .work-link:focus-visible::before { opacity: 1; transform: none; }
.work-num { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.work-title { display: grid; gap: 2px; }
.work-title-main { font-weight: 500; color: var(--text); font-size: calc(18px * var(--u-text)); line-height: 1.3; }
.work-title-sub { color: var(--text-3); font-size: 14px; }
.work-summary {
  color: var(--text-2); font-size: 15px; line-height: calc(1.5 * var(--u-leading));
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.work-meta { display: inline-flex; align-items: center; gap: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.work-meta .icon-arrow { color: var(--text-2); transition: transform calc(320ms * var(--u-motion)) var(--ease-enter), color var(--dur-fast); }
.work-link:hover .work-title-main { color: var(--accent); }
.work-link:hover .icon-arrow { transform: translate(3px, -3px); color: var(--accent); }

.site-footer {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; gap: 16px 24px; align-items: center;
  max-width: var(--measure); margin: 0 auto;
  padding: calc(48px * var(--u-space)) var(--gutter) calc(112px * var(--u-space));
  font-size: 14px; color: var(--text-3);
  background: var(--work-bg);
}
/* On the landing, until the work index is published, the footer follows the story's close and
   sits on the page's edges with it: links and archive on --edge-text, the credit ending on --edge.
   The step above it (--foot-step) is the step from the close to the footer's rule (story.css). */
html[data-work='hidden'] .site-footer {
  --foot-step: calc(40px * var(--u-space));
  max-width: none; margin: 0;
  padding: var(--foot-step) var(--edge) calc(48px * var(--u-space)) var(--edge-text);
}
.work + .site-footer { max-width: none; padding-left: max(var(--gutter), calc((100% - var(--measure)) / 2)); padding-right: max(var(--gutter), calc((100% - var(--measure)) / 2)); }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); transition: color var(--dur-fast) var(--ease-enter); }
.footer-links a:hover { color: var(--accent); }
.footer-credit { font-family: var(--font-mono); font-size: 12px; }
.footer-archive { grid-column: 1 / -1; font-size: 13px; }
.footer-archive a { color: var(--text-3); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.footer-archive a:hover { color: var(--text-2); }

/* ── Reveals ───────────────────────────────────────────────────────────────── */
[data-reveal] {
  opacity: 0;
  transform: translateY(var(--rise));
  transition:
    opacity var(--dur-enter) var(--ease-enter) calc(var(--i, 0) * var(--stagger)),
    transform var(--dur-enter) var(--ease-enter) calc(var(--i, 0) * var(--stagger));
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* ── Chrome ────────────────────────────────────────────────────────────────── */
.name-mark, .theme-toggle, .director { position: fixed; z-index: 20; }
.chrome-surface, .name-mark, .theme-toggle, .director-bar, .director-panel, .director-shaders, .director-peek, .director-invite, .director-note {
  background: var(--chrome-bg);
  color: var(--chrome-text);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 8px 24px -12px rgb(0 0 0 / 0.28);
  transition: background-color calc(600ms * var(--u-motion)) var(--ease-move), color calc(600ms * var(--u-motion)) var(--ease-move), border-color calc(600ms * var(--u-motion)) var(--ease-move);
}

.name-mark {
  top: var(--edge); left: var(--edge); height: 36px;
  display: inline-flex; align-items: center; padding: 0 var(--chip-pad); border-radius: var(--radius-md);
  font-family: var(--font-display); font-style: var(--hero-style); font-size: 17px; letter-spacing: -0.01em;
  color: var(--text);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity calc(320ms * var(--u-motion)) var(--ease-exit), transform calc(320ms * var(--u-motion)) var(--ease-exit);
}
[data-scrolled] .name-mark { opacity: 1; transform: none; pointer-events: auto; transition-timing-function: var(--ease-enter); }

.theme-toggle {
  top: var(--edge); right: var(--edge);
  display: grid; grid-template-columns: repeat(3, 32px); height: 36px; padding: 1px;
  border-radius: var(--radius-md);
}
.theme-toggle button {
  position: relative; z-index: 1; display: grid; place-items: center;
  border-radius: calc(var(--radius-md) - 2px); color: var(--text-3);
  transition: color var(--dur-fast) var(--ease-enter);
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-checked='true'] { color: var(--text); }
.theme-thumb {
  position: absolute; top: 2px; left: 2px; width: 30px; height: 30px; border-radius: calc(var(--radius-md) - 2px);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform calc(360ms * var(--u-motion)) var(--ease-enter);
}
.theme-toggle[data-pref='dark'] .theme-thumb { transform: translateX(32px); }
.theme-toggle[data-pref='system'] .theme-thumb { transform: translateX(64px); }

/* Director: the art-direction switcher. A row of poster swatches; the current one opens into
   a name pill. --chip-radius lets a direction square the chips off (Swiss, Kiln) or keep them round. */
.director { left: 16px; bottom: 16px; display: grid; justify-items: start; gap: 8px; --spring: cubic-bezier(0.34, 1.56, 0.64, 1); }
.director-bar { display: flex; align-items: center; gap: 2px; height: 48px; padding: 4px; border-radius: var(--radius-lg); }
.director-step, .director-shuffle, .director-all {
  flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: calc(var(--radius-lg) - 4px);
  color: var(--text-2); transition: background-color var(--dur-fast), color var(--dur-fast);
}
.director-step:hover, .director-shuffle:hover, .director-all:hover { background: var(--surface-2); color: var(--text); }
.director-step svg, .director-shuffle svg, .director-all svg { transition: transform calc(420ms * var(--u-motion)) var(--spring); }
.director-step[data-step='-1']:hover svg { transform: translateX(-2px); }
.director-step[data-step='1']:hover svg { transform: translateX(2px); }
.director-shuffle:hover svg { transform: rotate(-14deg) scale(1.08); }
.director-shuffle.is-rolling svg { animation: director-roll calc(640ms * var(--u-motion)) var(--spring); }
@keyframes director-roll { from { transform: rotate(-200deg) scale(0.7); } to { transform: none; } }
.director-all:hover svg { transform: scale(1.1); }
.director-all[aria-expanded='true'] { background: var(--surface-2); color: var(--text); }
.director-all[aria-expanded='true'] svg { transform: rotate(45deg); }
.director-sep { flex: none; width: 1px; height: 20px; margin: 0 4px; background: var(--line-strong); }

/* Shader button: the global finish over any look. Names the kept shader; an accent dot marks
   that one other than Original is on. */
.director-shader {
  position: relative; flex: none; height: 36px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 8px;
  border-radius: calc(var(--radius-lg) - 4px); color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.director-shader:hover, .director-shader[aria-expanded='true'] { background: var(--surface-2); color: var(--text); }
.director-shader svg { flex: none; transition: transform calc(520ms * var(--u-motion)) var(--spring); }
.director-shader:hover svg { transform: rotate(-24deg) scale(1.08); }
.director-shader[aria-expanded='true'] svg { transform: rotate(90deg); }
.director-shader.is-picked svg { animation: director-roll calc(560ms * var(--u-motion)) var(--spring); }
.director-shader:not([data-shader='original']) { color: var(--text); }
.director-shader:not([data-shader='original'])::after {
  content: ''; position: absolute; top: 6px; left: 22px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--chrome-bg);
}
.director-shader:focus-visible { outline: 2px solid var(--text-2); outline-offset: -2px; }
.director-shader-name { text-transform: capitalize; }

/* Shader panel: five chips (thumbnail of the finish, name, one-line note) and a strength slider. */
.director-shaders {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; border-radius: var(--radius-lg);
  opacity: 0; transform: translateY(8px) scale(0.98); transform-origin: bottom left;
  transition: opacity calc(220ms * var(--u-motion)) var(--ease-exit), transform calc(220ms * var(--u-motion)) var(--ease-exit);
}
.director.is-shading .director-shaders {
  opacity: 1; transform: none;
  transition: opacity calc(320ms * var(--u-motion)) var(--ease-enter), transform calc(320ms * var(--u-motion)) var(--ease-enter);
}
.director-shaders[hidden] { display: none; }
.shader-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.shader-chip {
  display: grid; gap: 4px; align-content: start; padding: 4px 4px 8px; border-radius: var(--radius-md); text-align: left;
  transition: background-color var(--dur-fast);
}
.director.is-shading .shader-chip { animation: shader-chip-in calc(420ms * var(--u-motion)) var(--spring) calc(var(--i) * 50ms * var(--u-motion)) both; }
@keyframes shader-chip-in { from { opacity: 0; transform: translateY(6px) scale(0.96); } }
.shader-chip:hover, .shader-chip:focus-visible { background: var(--surface-2); }
.shader-chip:focus-visible { outline: none; }
.shader-chip-art {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden;
  transition: transform calc(420ms * var(--u-motion)) var(--spring);
}
.shader-chip-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shader-chip-art img[data-missing] { visibility: hidden; }
.shader-chip-art::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--dur-fast); }
.shader-chip:hover .shader-chip-art { transform: translateY(-2px) scale(1.03); }
.shader-chip:focus-visible .shader-chip-art::after { box-shadow: inset 0 0 0 2px var(--text-2); }
.shader-chip[aria-checked='true'] .shader-chip-art::after { box-shadow: inset 0 0 0 2px var(--accent); }
.shader-chip.is-picked .shader-chip-art { animation: shader-pick calc(480ms * var(--u-motion)) var(--spring); }
@keyframes shader-pick { 40% { transform: scale(0.94); } }
.shader-chip-name { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; }
.shader-chip-note { padding: 0 4px; font-size: 11px; color: var(--text-3); line-height: 1.35; }
.shader-strength {
  display: grid; grid-template-columns: auto 1fr 40px; align-items: center; gap: 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2);
  transition: opacity var(--dur-fast);
}
.shader-strength[data-disabled] { color: var(--text-3); }
.shader-strength[data-disabled] input { cursor: not-allowed; }
.shader-strength-value { font-family: var(--font-mono); font-size: 11px; text-align: right; color: var(--text-2); }
.shader-strength input {
  -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer;
}
.shader-strength input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.shader-strength input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-strong); }
.shader-strength input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 3px var(--chrome-bg); transition: transform var(--dur-fast);
}
.shader-strength input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--chrome-bg); }
.shader-strength input:hover::-webkit-slider-thumb, .shader-strength input:focus-visible::-webkit-slider-thumb { transform: scale(1.15); }
.shader-strength input:focus-visible { outline: 2px solid var(--text-2); outline-offset: 2px; border-radius: 4px; }
.shader-strength[data-disabled] input::-webkit-slider-thumb { background: var(--text-3); }

/* Model switch: whose build of each look the dock plays. A thumb slides between the two marks,
   and each mark turns as it is chosen. A dashed thumb means the current look has no build by
   the chosen model (the dock is showing the other model's, and the choice waits for the next look). */
.director-model {
  position: relative; flex: none; display: grid; grid-template-columns: repeat(2, 72px); height: 36px; padding: 2px;
  border-radius: calc(var(--radius-lg) - 4px); background: color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.director-model button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: calc(var(--radius-lg) - 6px); color: var(--text-3); font-size: 12px; font-weight: 600;
  transition: color var(--dur-fast) var(--ease-enter);
}
.director-model button:hover, .director-model button[aria-checked='true'] { color: var(--text); }
.director-model button:focus-visible { outline: 2px solid var(--text-2); outline-offset: -2px; }
.model-mark { display: inline-grid; place-items: center; }
.director-model .model-mark svg { transition: transform calc(560ms * var(--u-motion)) var(--spring); }
.director-model button[data-model='astra'][aria-checked='true'] .model-mark svg { transform: rotate(90deg) scale(1.1); }
.director-model button[data-model='opus'][aria-checked='true'] .model-mark svg { transform: rotate(45deg) scale(1.1); }
.director-model button:hover .model-mark svg { transform: rotate(-20deg) scale(1.15); }
.director-model-thumb {
  position: absolute; top: 2px; left: 2px; width: 72px; height: 32px; border-radius: calc(var(--radius-lg) - 6px);
  background: var(--chrome-bg); box-shadow: inset 0 0 0 1px var(--line-strong), 0 2px 6px -2px rgb(0 0 0 / 0.25);
  transform: translateX(calc(var(--model-i, 0) * 72px));
  transition: transform calc(420ms * var(--u-motion)) var(--spring), background-color var(--dur-fast);
}
.director-model:not([data-missing='']) .director-model-thumb { background: transparent; box-shadow: none; outline: 1px dashed var(--line-strong); outline-offset: -1px; }

.director-name-model {
  margin-left: 8px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-3);
}
/* A look the chosen model did not build: its swatch plays the other build, drained of colour. */
.director-swatch.is-fallback:not(.is-current) .director-swatch-art img { filter: grayscale(0.85) contrast(0.9); }
.director-swatch.is-fallback:not(.is-current):hover .director-swatch-art img { filter: none; }

/* Note: a short status bubble, e.g. a look the chosen model did not build. */
.director-note {
  position: absolute; left: 0; bottom: calc(100% + 12px); max-width: min(380px, calc(100vw - 32px));
  padding: 8px 12px; border-radius: var(--radius-md); font-size: 13px; line-height: 1.4; color: var(--text);
  opacity: 0; transform: translateY(8px) scale(0.96); transform-origin: 16px 100%;
  transition: opacity calc(220ms * var(--u-motion)) var(--ease-exit), transform calc(220ms * var(--u-motion)) var(--ease-exit);
}
.director.is-noting .director-note { opacity: 1; transform: none; transition: opacity calc(320ms * var(--u-motion)) var(--ease-enter), transform calc(520ms * var(--u-motion)) var(--spring); }
.director-note[hidden] { display: none; }
.director.is-noting .director-invite, .director.is-open .director-note { opacity: 0; }

.director-swatches { display: flex; align-items: center; gap: 2px; padding: 0 2px; }
.director-swatch {
  flex: none; display: flex; align-items: center; height: 36px; padding: 4px; border-radius: var(--chip-radius, 999px);
  transition: background-color calc(240ms * var(--u-motion)) var(--ease-move), padding calc(420ms * var(--u-motion)) var(--spring);
}
.director-swatch-art {
  position: relative; flex: none; display: block; width: 28px; height: 28px; overflow: hidden;
  border-radius: var(--chip-radius, 999px); box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: transform calc(420ms * var(--u-motion)) var(--spring), box-shadow calc(240ms * var(--u-motion)) var(--ease-move);
}
.director-swatch-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; transform: scale(1.5); }
.director-swatch:hover .director-swatch-art, .director-swatch:focus-visible .director-swatch-art { transform: translateY(-3px) scale(1.14); }
.director-swatch:active .director-swatch-art { transform: scale(0.92); transition-duration: 90ms; }
.director-swatch-label { display: grid; grid-template-columns: 0fr; opacity: 0; transition: grid-template-columns calc(460ms * var(--u-motion)) var(--spring), opacity calc(200ms * var(--u-motion)) var(--ease-exit); }
.director-swatch-label > .director-name { min-width: 0; overflow: hidden; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); }
.director-swatch.is-current { background: var(--surface-2); padding-right: 12px; cursor: default; }
.director-swatch.is-current .director-swatch-art { box-shadow: 0 0 0 2px var(--chrome-bg), 0 0 0 3.5px var(--accent); transform: none; }
.director-swatch.is-current .director-swatch-label { grid-template-columns: 1fr; opacity: 1; padding-left: 8px; transition-timing-function: var(--spring), var(--ease-enter); transition-delay: 0ms, calc(120ms * var(--u-motion)); }
.director.is-busy .director-swatch.is-current .director-swatch-art { animation: director-pulse 900ms var(--ease-move) infinite alternate; }
@keyframes director-pulse { to { opacity: 0.5; transform: scale(0.9); } }
.director.is-inviting .director-swatch-art { animation: director-hop calc(720ms * var(--u-motion)) var(--spring) calc(var(--i) * 60ms * var(--u-motion)) 2 both; }
@keyframes director-hop { 0%, 100% { transform: none; } 40% { transform: translateY(-6px) scale(1.12); } }

/* Peek: the poster of whatever swatch is under the pointer, gliding along the row. */
.director-peek {
  position: absolute; left: var(--peek-x, 0px); bottom: calc(100% + 12px); width: 208px; padding: 6px;
  display: grid; gap: 8px; border-radius: var(--radius-lg); pointer-events: none;
  opacity: 0; transform: translate(-50%, 8px) scale(0.92); transform-origin: 50% 100%;
  transition: opacity calc(160ms * var(--u-motion)) var(--ease-exit), transform calc(220ms * var(--u-motion)) var(--ease-exit), left calc(320ms * var(--u-motion)) var(--spring);
}
.director.is-peeking .director-peek {
  opacity: 1; transform: translate(-50%, 0) scale(1);
  transition: opacity calc(200ms * var(--u-motion)) var(--ease-enter), transform calc(420ms * var(--u-motion)) var(--spring), left calc(320ms * var(--u-motion)) var(--spring);
}
.director:not(.is-peeking) .director-peek { transition-property: opacity, transform; }
.director-peek-art { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.director-peek-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.director-peek-text { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; padding: 0 4px 4px; align-items: baseline; }
.director-peek-num { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.director-peek-name { font-size: 13px; font-weight: 600; color: var(--text); }
.director-peek-renderer { grid-column: 2; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.director-peek-model {
  position: absolute; top: 12px; left: 12px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--chrome-bg); color: var(--text);
  font-family: var(--font-mono); font-size: 10px; line-height: 16px;
}
.director-peek-model .model-mark svg { width: 10px; height: 10px; }

/* Invite: once per visitor, a nudge that the site has more than one look. */
.director-invite {
  position: absolute; left: 0; bottom: calc(100% + 12px); display: flex; align-items: center; gap: 8px;
  padding: 8px 8px 8px 12px; border-radius: var(--radius-md); font-size: 13px; color: var(--text); white-space: nowrap;
  opacity: 0; transform: translateY(8px) scale(0.96); transform-origin: 16px 100%;
  transition: opacity calc(220ms * var(--u-motion)) var(--ease-exit), transform calc(220ms * var(--u-motion)) var(--ease-exit);
}
.director.is-inviting .director-invite { opacity: 1; transform: none; transition: opacity calc(320ms * var(--u-motion)) var(--ease-enter), transform calc(520ms * var(--u-motion)) var(--spring); }
.director.is-open .director-invite, .director.is-peeking .director-invite, .director.is-shading .director-invite { opacity: 0; }
.director.is-shading .director-peek { opacity: 0; }
.director-invite[hidden] { display: none; }
.director-invite-close { width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--text-3); }
.director-invite-close:hover { background: var(--surface-2); color: var(--text); }

.director-panel {
  width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; border-radius: var(--radius-lg);
  opacity: 0; transform: translateY(8px) scale(0.98); transform-origin: bottom left;
  transition: opacity calc(220ms * var(--u-motion)) var(--ease-exit), transform calc(220ms * var(--u-motion)) var(--ease-exit);
}
.director.is-open .director-panel {
  opacity: 1; transform: none;
  transition: opacity calc(320ms * var(--u-motion)) var(--ease-enter), transform calc(320ms * var(--u-motion)) var(--ease-enter);
}
.director-panel-head { display: grid; gap: 4px; margin-bottom: 12px; }
.director-panel-title { font-size: 13px; font-weight: 600; color: var(--text); }
.director-panel-hint { font-size: 12px; color: var(--text-3); }
.director-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* One card per look. Each model's build is a half of the art; the hovered half widens. */
.director-look { display: grid; gap: 8px; padding: 4px 4px 8px; border-radius: var(--radius-md); transition: background-color var(--dur-fast); }
.director-look:hover, .director-look:focus-within { background: var(--surface-2); }
.director-look-art { display: flex; gap: 2px; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; }
.director-tile {
  position: relative; flex: 1 1 0; min-width: 0; display: block;
  transition: flex-grow calc(460ms * var(--u-motion)) var(--spring);
}
.director-look-art:hover .director-tile:hover, .director-look-art:focus-within .director-tile:focus-visible { flex-grow: 2.4; }
.director-tile:focus-visible { outline: none; }
.director-tile-art { position: absolute; inset: 0; display: block; }
.director-tile-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.director-tile::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--dur-fast); }
.director-tile:focus-visible::after { box-shadow: inset 0 0 0 2px var(--text-2); }
.director-tile.is-current::after { box-shadow: inset 0 0 0 2px var(--accent); }
.director-tile-model {
  position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 4px; max-width: calc(100% - 8px);
  padding: 2px 6px 2px 4px; border-radius: 999px; background: var(--chrome-bg); color: var(--text);
  font-family: var(--font-mono); font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.director-tile-model .model-mark { flex: none; }
.director-tile-model .model-mark svg { width: 10px; height: 10px; }
.director-tile-text { display: grid; gap: 1px; padding: 0 4px; }
.director-tile-num { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.director-tile-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.25; }
.director-tile-renderer { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
img[data-poster][data-missing] { opacity: 0; }
.director-panel-stack { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; color: var(--text-2); min-height: 2.6em; }

/* Swatches behind each tile until its poster loads: a fixed signature per direction, not the current tokens. */
[data-tile='observatory'] { background: radial-gradient(120% 90% at 70% 20%, #2b3350, #0e1220 70%); }
[data-tile='paper'] { background: linear-gradient(160deg, #f1ebe1 10%, #d9cfc0 60%, #b9ab97); }
[data-tile='swiss'] { background: linear-gradient(90deg, #f2f0eb 0 62%, #e3361c 62% 70%, #f2f0eb 70%); }
[data-tile='ink'] { background: repeating-linear-gradient(-35deg, #f3eee4 0 5px, #2b2722 5px 6px); }
[data-tile='lightlab'] { background: radial-gradient(60% 70% at 40% 40%, #bfe7ff, #5b6cff 45%, #120f26 85%); }
[data-tile='clay'] { background: radial-gradient(70% 80% at 45% 40%, #e7a982, #b0643e 55%, #3b2219); }
[data-tile='toybox'] { background: conic-gradient(from 210deg at 50% 60%, #ff5a36, #ffc531, #2f7dff, #ff5a36); }
[data-tile='kiln'] { background: linear-gradient(180deg, #e9e3d8 0 58%, #cfc3b0 58%), #e9e3d8; }
[data-tile='ensemble'] { background: radial-gradient(28% 40% at 50% 58%, #17171a 0 60%, transparent 62%), radial-gradient(9% 12% at 24% 50%, #c43e1c 0 70%, transparent 72%), radial-gradient(9% 12% at 76% 48%, #107c10 0 70%, transparent 72%), radial-gradient(8% 11% at 36% 28%, #8764b8 0 70%, transparent 72%), radial-gradient(8% 11% at 66% 26%, #0f6cbd 0 70%, transparent 72%), linear-gradient(180deg, #efe9e0, #d8cfc2); }
[data-tile='stilllife'] { background: radial-gradient(20% 28% at 36% 58%, #d97652 0 70%, transparent 72%), radial-gradient(14% 30% at 68% 50%, #a4ceda 0 70%, transparent 72%), linear-gradient(165deg, #f5e9d8 55%, #a488c2); }
/* Shared Still Life style row: both model variants use the normal scene style param. */
.stilllife-styles {
  display: flex; align-items: center; gap: 4px; justify-self: start; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--chrome-bg); color: var(--chrome-text);
  box-shadow: 0 4px 20px -8px color-mix(in srgb, var(--text) 20%, transparent);
  animation: stilllife-controls-in 320ms var(--ease-enter) both;
}
.stilllife-styles[hidden] { display: none; }
.stilllife-styles button {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px;
  border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; color: var(--text-2);
  transition: color var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast);
}
.stilllife-styles button:hover, .stilllife-styles button[aria-checked='true'] { background: var(--surface-2); color: var(--text); }
.stilllife-styles button:focus-visible { outline: 2px solid var(--text-2); outline-offset: -2px; }
.stilllife-styles button:active { transform: scale(0.96); }
.stilllife-style-swatch { position: relative; width: 32px; height: 24px; overflow: hidden; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line-strong); }
.stilllife-style-swatch img { width: 100%; height: 100%; object-fit: cover; }
[data-look-style-value='pop'] .stilllife-style-swatch { background: linear-gradient(135deg, #d97652 50%, #a488c2 50%); }
[data-look-style-value='print'] .stilllife-style-swatch { background: repeating-linear-gradient(45deg, #9ac2c5 0 3px, #db7149 3px 5px, #f1ead8 5px 8px); }
[data-look-style-value='wash'] .stilllife-style-swatch { background: radial-gradient(ellipse at 30% 30%, #c2683e, transparent 70%), #7da6ad; }
[data-theme='dark'] [data-look-style-value='pop'] .stilllife-style-swatch { background: linear-gradient(135deg, #f77571 50%, #a479b9 50%); }
[data-theme='dark'] [data-look-style-value='print'] .stilllife-style-swatch { background: repeating-linear-gradient(45deg, #80c6c8 0 3px, #e87950 3px 5px, #e9dfc6 5px 8px); }
[data-theme='dark'] [data-look-style-value='wash'] .stilllife-style-swatch { background: radial-gradient(ellipse at 30% 30%, #c68168, transparent 70%), #83b6c0; }
.director-model button:disabled { color: var(--text-3); background: var(--surface); cursor: not-allowed; }
.director-model button:disabled:hover .model-mark svg { transform: none; }
@keyframes stilllife-controls-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
[data-shader-tile='cel'] { background: linear-gradient(135deg, #f4ede4 0 46%, #b9a3c6 46% 54%, #6f5f86 54%); }
[data-shader-tile='pop'] { background: radial-gradient(circle at 30% 30%, #ff3d7f 0 22%, transparent 23%), radial-gradient(#1b1b1f 1.2px, transparent 1.6px) 0 0 / 5px 5px, #ffd23f; }
[data-shader-tile='print'] { background: radial-gradient(circle at 42% 50%, rgb(0 174 239 / 0.85) 0 30%, transparent 31%), radial-gradient(circle at 56% 46%, rgb(236 0 140 / 0.8) 0 30%, transparent 31%), radial-gradient(circle at 50% 58%, rgb(255 222 0 / 0.85) 0 30%, transparent 31%), #f4efe6; }
[data-shader-tile='wash'] { background: radial-gradient(60% 55% at 40% 45%, rgb(70 110 160 / 0.55), transparent 70%), radial-gradient(50% 45% at 65% 60%, rgb(190 120 90 / 0.45), transparent 70%), #f3eee3; }

/* ── View Transitions (animations are driven from js/core/swap.js) ─────────── */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
::view-transition-old(root) { z-index: 1; }

/* Swap VFX (js/core/swap-vfx.js): the overlay carries the words; the new scene opens behind a
   feathered front that leaves from the clicked control. --swapvfx-p runs 0 → 1 from swap-vfx.js. */
@property --swapvfx-p { syntax: '<number>'; inherits: true; initial-value: 0; }
.swap-vfx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 40; pointer-events: none; display: none; }
.swapvfx-text { visibility: hidden !important; }
.is-swapvfx-measure * { transition: none !important; }
html.is-swapvfx::view-transition { pointer-events: none; }
html.is-swapvfx::view-transition-old(swap-vfx) { display: none; }
html.is-swapvfx::view-transition-group(swap-vfx), html.is-swapvfx::view-transition-new(swap-vfx) { animation: none; mix-blend-mode: normal; }
html.is-swapvfx::view-transition-group(swap-vfx) { z-index: 3; }
html.is-swapvfx::view-transition-new(root) {
  --swapvfx-a: calc(var(--swapvfx-p) * (var(--swapvfx-r) + var(--swapvfx-f)));
  -webkit-mask: radial-gradient(circle at var(--swapvfx-x) var(--swapvfx-y), #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)) no-repeat;
  mask: radial-gradient(circle at var(--swapvfx-x) var(--swapvfx-y), #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)) no-repeat;
}
html.is-swapvfx[data-swapvfx-front='right']::view-transition-new(root) { -webkit-mask: linear-gradient(to right, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); mask: linear-gradient(to right, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); }
html.is-swapvfx[data-swapvfx-front='left']::view-transition-new(root) { -webkit-mask: linear-gradient(to left, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); mask: linear-gradient(to left, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); }
html.is-swapvfx[data-swapvfx-front='down']::view-transition-new(root) { -webkit-mask: linear-gradient(to bottom, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); mask: linear-gradient(to bottom, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); }
html.is-swapvfx[data-swapvfx-front='up']::view-transition-new(root) { -webkit-mask: linear-gradient(to top, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); mask: linear-gradient(to top, #000 calc(var(--swapvfx-a) - var(--swapvfx-f)), transparent var(--swapvfx-a)); }

.swap-cover { position: fixed; inset: 0; z-index: 100; background: var(--bg); opacity: 0; pointer-events: none; transition: opacity 220ms var(--ease-move); }
.swap-cover.is-on { opacity: 1; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .featured-link { grid-template-columns: 1fr; }
  .work-link { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .work-summary { grid-column: 2 / -1; grid-row: 2; }
  .work-meta .work-kind, .work-meta .work-year { display: none; }
}
@media (max-width: 1180px) {
  .director-shader { width: 36px; padding: 0; justify-content: center; }
  .director-shader-name { display: none; }
  .director-shader:not([data-shader='original'])::after { left: 20px; }
  .director-model { grid-template-columns: repeat(2, 40px); }
  .director-model-thumb { width: 40px; transform: translateX(calc(var(--model-i, 0) * 40px)); }
  .director-model-name { display: none; }
}
@media (max-width: 760px) {
  /* Narrow: the row would not fit, so only the current look's pill shows between the arrows. */
  .director { left: 12px; right: 12px; bottom: 12px; justify-items: stretch; }
  .director-swatches { flex: 1; min-width: 0; }
  .director-swatch:not(.is-current) { display: none; }
  .director-swatch.is-current { flex: 1; min-width: 0; }
  .director-swatch-label, .director-swatch-label > .director-name { min-width: 0; text-overflow: ellipsis; }
  .director-peek { display: none; }
  .director-model { grid-template-columns: repeat(2, 36px); }
  .director-model-thumb { width: 36px; transform: translateX(calc(var(--model-i, 0) * 36px)); }
  .director-model-name { display: none; }
}
@media (max-width: 640px) {
  .director-panel, .director-shaders { width: 100%; }
  .shader-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shader-chip-note { display: none; }
  .director-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-bottom: 80px; }
  :root { --edge: 12px; }
  .site-footer { grid-template-columns: 1fr; padding-bottom: 128px; }
  /* Clear of the viewer's pills, bottom right, which the credit's row would otherwise run under. */
  html[data-work='hidden'] .site-footer { --foot-step: 32px; padding-bottom: 88px; }
  .work-section-head { grid-template-columns: 32px 1fr auto; }
  .work-link { grid-template-columns: 32px minmax(0, 1fr) auto; gap: 4px 12px; }
}
@media (max-width: 480px) {
  /* Phone: a label truncated to one letter reads as a bug. The thumbnail alone carries the look;
     its name is still announced (aria-label) and shown in the grid panel. */
  .director-swatches { justify-content: center; }
  .director-swatch.is-current { flex: 0 0 auto; }
  .director-swatch-label { display: none; }
}
@media (max-width: 360px) {
  .director-bar { gap: 0; min-width: 0; }
  .director-step, .director-shuffle, .director-all, .director-shader { width: 32px; }
  .director-sep { margin: 0 2px; }
  .director-model { grid-template-columns: repeat(2, 32px); }
  .director-model-thumb { width: 32px; transform: translateX(calc(var(--model-i, 0) * 32px)); }
}

/* ── Reduced motion: stills, not slow motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  html { scroll-behavior: auto; }
  /* A quiet crossfade is the reduced-motion loading treatment: no build motion, one fade. */
  .scene-host[data-ready] .scene-canvas { transition-duration: 700ms !important; }
}

/* The hand has the camera: one cursor everywhere, no text selection mid-drag. */
html.is-camera-drag, html.is-camera-drag * { cursor: grabbing !important; user-select: none !important; }

} /* @layer engine */
