/* ============================================================
   HUMBUG LABS — a dark room, one light, the work.
   ============================================================ */

@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-Regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-Medium.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: 'Metropolis';
  src: url('fonts/Metropolis-SemiBold.woff2') format('woff2');
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('fonts/Barlow-800.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow';
  src: url('fonts/Barlow-900.woff2') format('woff2');
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/InstrumentSans-400-700.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

/* the lamp's colour and reach interpolate as you change rooms */
@property --lamp-r { syntax: '<number>'; initial-value: 226; inherits: true; }
@property --lamp-g { syntax: '<number>'; initial-value: 232; inherits: true; }
@property --lamp-b { syntax: '<number>'; initial-value: 229; inherits: true; }
@property --lamp-a { syntax: '<number>'; initial-value: 0.045; inherits: true; }
@property --lamp-size { syntax: '<length>'; initial-value: 520px; inherits: true; }

:root {
  --black: #000;
  --ink: #eef1ef;
  --grey: #8d9490;
  --dim: #505753;
  --hair: #202422;
  --accent: #cdd5d1;
  --phosphor: #85a393;       /* cold instrument glow */
  --sans: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif;
  --industrial: 'Barlow', 'Arial Narrow', Arial, sans-serif;
  --mono: 'Plex Mono', 'SFMono-Regular', Menlo, monospace;
  --ease-walk: cubic-bezier(0.22, 0.6, 0.2, 1);
  --cursor-rgb: 205, 213, 209;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: --lamp-r 2.4s var(--ease-walk), --lamp-g 2.4s var(--ease-walk),
              --lamp-b 2.4s var(--ease-walk), --lamp-a 2.4s var(--ease-walk),
              --lamp-size 2.4s var(--ease-walk);
}

/* room lighting: the lamp changes temperature as you walk */
body[data-room="work"], body[data-room="tools"] {
  --lamp-r: 218; --lamp-g: 224; --lamp-b: 221; --lamp-a: 0.045;
  --cursor-rgb: 205, 213, 209;
}
body[data-room="experiments"] {
  --lamp-r: 185; --lamp-g: 214; --lamp-b: 199; --lamp-a: 0.05;
  --cursor-rgb: 133, 163, 147;
}
body[data-room="notes"] {
  --lamp-r: 214; --lamp-g: 222; --lamp-b: 218; --lamp-a: 0.055; --lamp-size: 430px;
}
body[data-room="contact"] {
  --lamp-r: 226; --lamp-g: 232; --lamp-b: 229; --lamp-a: 0.07; --lamp-size: 820px;
}

::selection { background: var(--accent); color: var(--black); }

a { color: inherit; }

@media (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none !important; }
}

/* ---------- atmosphere ---------- */

.lamp {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    var(--lamp-size) circle at var(--lx, 50%) var(--ly, 38%),
    rgba(var(--lamp-r), var(--lamp-g), var(--lamp-b), var(--lamp-a)),
    rgba(var(--lamp-r), var(--lamp-g), var(--lamp-b), calc(var(--lamp-a) * 0.28)) 45%,
    transparent 72%
  );
}

.grain {
  position: fixed;
  inset: -100px;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 6s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-32px, 18px); }
  34%  { transform: translate(24px, -40px); }
  51%  { transform: translate(-18px, -26px); }
  68%  { transform: translate(40px, 30px); }
  85%  { transform: translate(-28px, 8px); }
  100% { transform: translate(0, 0); }
}

/* one rare pass of monitor interference over the framed exhibits */
.figure::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -2px;
  height: 1px;
  background: rgba(233, 237, 235, 0.14);
  opacity: 0;
  animation: sweep 19s linear infinite;
}
@keyframes sweep {
  0%, 92%   { opacity: 0; top: -2px; }
  93%       { opacity: 1; top: 0; }
  97%       { opacity: 1; top: 100%; }
  98%, 100% { opacity: 0; top: 100%; }
}

/* ---------- the cord (shared) ---------- */

@keyframes sway {
  0%, 100% { transform: rotate(0.6deg); }
  50%      { transform: rotate(-0.6deg); }
}
.cord-line {
  display: block;
  width: 1px;
  height: 34vh;
  background: linear-gradient(rgba(77, 82, 79, 0), rgba(77, 82, 79, 0.9));
}
.cord-ring {
  display: block;
  width: 9px;
  height: 9px;
  border: 1px solid var(--dim);
  border-radius: 50%;
  margin-top: 3px;
}
/* ---------- masthead ---------- */

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: clamp(16px, 3vw, 36px);
  padding: 28px clamp(24px, 5vw, 72px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 1.4s var(--ease-walk), transform 1.4s var(--ease-walk);
  pointer-events: none;
  background: linear-gradient(rgba(7, 7, 7, 0.85), transparent);
}
.masthead.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.wordmark {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.34em;
  text-decoration: none;
}
.index {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  margin-left: auto;
}
.index a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--grey);
  transition: color 0.6s var(--ease-walk);
}
.index a:hover { color: var(--ink); }

/* the cord stays within reach */
.cord-toggle {
  position: relative;
  top: -28px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 6px 8px;
  transform-origin: top center;
  transition: opacity 0.8s var(--ease-walk);
  opacity: 0.75;
}
.cord-toggle:hover { opacity: 1; animation: sway 2.4s ease-in-out infinite; }
.cord-toggle .cord-line { height: 44px; }
.cord-toggle .cord-ring { width: 7px; height: 7px; }

/* ---------- rooms ---------- */

main { position: relative; z-index: 1; }

.room {
  padding: 24vh clamp(24px, 6vw, 96px);
  max-width: 1360px;
  margin: 0 auto;
}

.room-head { margin-bottom: 16vh; }

.room-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 20px;
}
.room-label::before {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--dim);
  vertical-align: middle;
  margin-right: 16px;
}
.room-note {
  color: var(--grey);
  max-width: 44ch;
  font-size: 15px;
  font-weight: 400;
}
.room-note--center {
  margin: 0 auto;
  text-align: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.bench-break { padding: 22vh clamp(24px, 6vw, 96px); }

/* ---------- enter ---------- */

.room--enter {
  min-height: 100vh;
  max-width: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}
.enter-mark {
  font-weight: 700;
  font-size: clamp(3.4rem, 12.5vw, 11rem);
  line-height: 0.98;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
}
/* revealed by transition, not animation — the glitch owns the animation slot */
.enter-line {
  opacity: 0;
  filter: blur(6px);
  transition: opacity 2.6s var(--ease-walk), filter 2.6s var(--ease-walk);
}
.enter-line:nth-child(2) { transition-delay: 0.5s; }
body.lit .enter-line { opacity: 1; filter: blur(0); }
@keyframes emerge {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 1; filter: blur(0); }
}
.enter-sub {
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--grey);
  opacity: 0;
  animation: emerge 2.8s var(--ease-walk) 1.4s forwards;
}
.enter-cue {
  position: absolute;
  bottom: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  animation: emerge 2.4s var(--ease-walk) 2.4s forwards;
}
.cue-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(var(--dim), transparent);
}
.cue-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- the wordmark glitch: cool signal tears in two directions ---------- */

.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: var(--black);   /* opaque: each slice occludes the base — a real tear */
  opacity: 0;
  pointer-events: none;
}
.glitch.glitch-on::before { animation: tear-neutral 0.8s step-end 1 both; }
.glitch.glitch-on::after  { animation: tear-cold 0.8s step-end 1 both; }
/* thin bands, 2–4% tall; polygon poses tear two slices at once */
@keyframes tear-neutral {
  0%   { opacity: 1; color: var(--accent); transform: translate(-7px, 0);
         clip-path: inset(21% 0 76% 0); }
  5%   { opacity: 1; color: var(--accent); transform: translate(11px, 1px);
         clip-path: polygon(0 34%, 100% 34%, 100% 37%, 0 37%, 0 61%, 100% 61%, 100% 63%, 0 63%); }
  10%  { opacity: 1; color: var(--ink); transform: translate(-19px, 0);
         clip-path: inset(49% 0 48% 0); }
  15%  { opacity: 1; color: var(--accent); transform: translate(5px, -1px);
         clip-path: polygon(0 8%, 100% 8%, 100% 11%, 0 11%, 0 84%, 100% 84%, 100% 87%, 0 87%); }
  20%  { opacity: 1; color: var(--accent); transform: translate(-12px, 0);
         clip-path: inset(66% 0 31% 0); }
  25%  { opacity: 1; color: var(--accent); transform: translate(16px, 0);
         clip-path: polygon(0 27%, 100% 27%, 100% 29%, 0 29%, 0 44%, 100% 44%, 100% 46%, 0 46%); }
  30%  { opacity: 1; color: var(--ink); transform: translate(-4px, 1px);
         clip-path: inset(91% 0 6% 0); }
  35%  { opacity: 0; }
  52%  { opacity: 1; color: var(--accent); transform: translate(-23px, 0);
         clip-path: inset(41% 0 55% 0); }
  57%  { opacity: 1; color: var(--accent); transform: translate(8px, 1px);
         clip-path: polygon(0 14%, 100% 14%, 100% 17%, 0 17%, 0 52%, 100% 52%, 100% 54%, 0 54%); }
  62%  { opacity: 1; color: var(--ink); transform: translate(-10px, 0);
         clip-path: inset(74% 0 23% 0); }
  67%  { opacity: 1; color: var(--accent); transform: translate(17px, -1px);
         clip-path: polygon(0 30%, 100% 30%, 100% 32%, 0 32%, 0 90%, 100% 90%, 100% 93%, 0 93%); }
  72%  { opacity: 1; color: var(--accent); transform: translate(-6px, 0);
         clip-path: inset(5% 0 92% 0); }
  78%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes tear-cold {
  0%   { opacity: 1; color: var(--phosphor); transform: translate(9px, 0);
         clip-path: inset(69% 0 28% 0); }
  5%   { opacity: 1; color: var(--phosphor); transform: translate(-14px, -1px);
         clip-path: polygon(0 12%, 100% 12%, 100% 15%, 0 15%, 0 55%, 100% 55%, 100% 57%, 0 57%); }
  10%  { opacity: 1; color: var(--phosphor); transform: translate(7px, 0);
         clip-path: inset(88% 0 9% 0); }
  15%  { opacity: 1; color: var(--ink); transform: translate(-17px, 1px);
         clip-path: inset(26% 0 71% 0); }
  20%  { opacity: 1; color: var(--phosphor); transform: translate(12px, 0);
         clip-path: polygon(0 40%, 100% 40%, 100% 42%, 0 42%, 0 78%, 100% 78%, 100% 81%, 0 81%); }
  25%  { opacity: 1; color: var(--phosphor); transform: translate(-8px, 0);
         clip-path: inset(58% 0 39% 0); }
  30%  { opacity: 1; color: var(--phosphor); transform: translate(4px, -1px);
         clip-path: inset(2% 0 95% 0); }
  35%  { opacity: 0; }
  52%  { opacity: 1; color: var(--phosphor); transform: translate(19px, 0);
         clip-path: polygon(0 22%, 100% 22%, 100% 24%, 0 24%, 0 67%, 100% 67%, 100% 70%, 0 70%); }
  57%  { opacity: 1; color: var(--ink); transform: translate(-9px, -1px);
         clip-path: inset(85% 0 12% 0); }
  62%  { opacity: 1; color: var(--phosphor); transform: translate(13px, 0);
         clip-path: inset(36% 0 61% 0); }
  67%  { opacity: 1; color: var(--phosphor); transform: translate(-21px, 0);
         clip-path: polygon(0 6%, 100% 6%, 100% 8%, 0 8%, 0 48%, 100% 48%, 100% 50%, 0 50%); }
  72%  { opacity: 1; color: var(--phosphor); transform: translate(5px, 1px);
         clip-path: inset(62% 0 35% 0); }
  78%  { opacity: 0; }
  100% { opacity: 0; }
}
/* the base text itself lurches and blows out for single frames */
.glitch.glitch-on { animation: base-jitter 0.8s step-end 1; }
@keyframes base-jitter {
  0%   { transform: translate(2px, 0); }
  5%   { transform: translate(-2px, 0); filter: brightness(1.55); }
  10%  { transform: translate(1px, 0); }
  20%  { transform: translate(-1px, 0); }
  30%  { transform: translate(0, 0); }
  52%  { transform: translate(-2px, 0); filter: brightness(1.4); }
  62%  { transform: translate(2px, 0); }
  72%  { transform: translate(-1px, 0); }
  78%  { transform: translate(0, 0); }
  100% { transform: translate(0, 0); filter: none; }
}

/* ---------- exhibits ---------- */

.exhibit {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  min-height: 108vh;
  padding: 4vh 0;
  border-top: 1px solid var(--hair);
}
.exhibit:first-of-type { border-top: none; }
.plate { padding: 16vh 0 20vh; }

.cat {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--dim);
  margin-bottom: 28px;
}
.exhibit-title {
  font-family: var(--industrial);
  font-weight: 900;
  font-size: clamp(2.6rem, 6.5vw, 6rem);
  line-height: 0.98;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  margin-bottom: 28px;
}
/* letters land one by one as the title enters the light */
.exhibit-title .l {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.9s var(--ease-walk), transform 0.9s var(--ease-walk);
  transition-delay: var(--d, 0s);
}
.is-lit .exhibit-title .l { opacity: 1; transform: none; }

.thesis {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 20px;
}
.body {
  color: var(--grey);
  font-weight: 400;
  font-size: 15px;
  max-width: 54ch;
}
.meta {
  margin-top: 32px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.meta a {
  color: var(--grey);
  text-decoration: none;
  border-bottom: 1px solid var(--dim);
  padding-bottom: 2px;
  transition: color 0.6s var(--ease-walk), border-color 0.6s var(--ease-walk);
}
.meta a:hover { color: var(--ink); border-color: var(--accent); }
.meta-sep { margin: 0 12px; }

/* framed figures hold for a beat while the plate walks past */
.figure {
  position: sticky;
  top: 16vh;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--hair);
  background: #000;
  aspect-ratio: 16 / 11;
  will-change: transform;
}
.fig-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  transition: opacity 2.4s var(--ease-walk);
}
/* once the screen wakes, the diorama recedes to a whisper over it */
.figure.woken .fig-canvas { opacity: 0.22; }
.figure:hover .fig-canvas { opacity: 0.08; }

/* the real product, asleep in the frame until the exhibit wakes */
.figure .shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.5) brightness(0.6) contrast(1.03);
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 2.6s var(--ease-walk), filter 1.4s var(--ease-walk),
              transform 3.2s var(--ease-walk);
}
.figure.woken .shot { opacity: 0.96; transform: none; }
.figure:hover .shot { filter: grayscale(0.2) brightness(0.72) contrast(1.03); }
.figure::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(160deg, rgba(233, 237, 235, 0.05), transparent 38%);
  pointer-events: none;
}

/* ---------- the vast exhibits: the room opens up ---------- */

.exhibit--vast {
  display: flex;
  align-items: center;
  position: relative;
  min-height: 135vh;
  padding: 10vh clamp(24px, 6vw, 96px);
  border-top: none;
  overflow: hidden;
}
.vast-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.vast-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(7, 7, 7, 0.82) 0%, rgba(7, 7, 7, 0.35) 46%, rgba(7, 7, 7, 0) 72%);
  pointer-events: none;
}
.plate--vast {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 0;
}
.plate--vast .cat { color: var(--phosphor); opacity: 0.7; }

/* ---------- tools ---------- */

.tool-wall {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--hair);
  padding-top: 8vh;
}
.tool-head {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 24px;
}
.tool-col ul { list-style: none; }
.tool-col li {
  font-weight: 400;
  font-size: 15px;
  color: var(--grey);
  padding: 9px 0;
  border-bottom: 1px solid var(--hair);
}

/* ---------- notebook ---------- */

.note-stack { border-top: 1px solid var(--hair); }
.note {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: clamp(20px, 4vw, 56px);
  align-items: baseline;
  padding: 7vh 0;
  border-bottom: 1px solid var(--hair);
  text-decoration: none;
  transition: opacity 0.8s var(--ease-walk);
}
.note-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--dim);
}
.note-title {
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  transition: color 0.6s var(--ease-walk);
}
.note:hover .note-title { color: var(--accent); }
.note-excerpt {
  color: var(--grey);
  font-weight: 400;
  font-size: 15px;
  max-width: 58ch;
}

/* ---------- about ---------- */

.about { max-width: 720px; }
.about-name {
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4.6rem);
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}
.body--about {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  max-width: 58ch;
  margin-bottom: 24px;
}

/* ---------- door ---------- */

.room--door { padding-bottom: 16vh; }
.door-line {
  font-weight: 700;
  font-size: clamp(3rem, 9vw, 8rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin-bottom: 48px;
}
.meta--door { margin-top: 0; font-size: 13px; text-transform: none; letter-spacing: 0.06em; }
.meta--door-sub { margin-top: 16px; }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 40px clamp(24px, 6vw, 96px);
  border-top: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- reveal on walk ---------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease-walk), transform 0.9s var(--ease-walk);
}
.reveal.is-lit {
  opacity: 1;
  transform: none;
}

/* ---------- cursor: you are the lamp ---------- */

.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(var(--cursor-rgb), 0.95);
  box-shadow: 0 0 22px 9px rgba(var(--cursor-rgb), 0.16),
              0 0 60px 28px rgba(var(--cursor-rgb), 0.05);
  pointer-events: none;
  transition: width 0.45s var(--ease-walk), height 0.45s var(--ease-walk),
              margin 0.45s var(--ease-walk), background 0.45s var(--ease-walk),
              border 0.45s var(--ease-walk), box-shadow 0.8s var(--ease-walk),
              opacity 0.4s var(--ease-walk);
  opacity: 0;
}
.cursor.awake { opacity: 1; }
.cursor.on-link {
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  background: rgba(var(--cursor-rgb), 0.06);
  border: 1px solid rgba(var(--cursor-rgb), 0.6);
}

/* ---------- page veil (room-to-room transitions) ---------- */

.veil {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
}
.veil.on { opacity: 1; pointer-events: auto; }

/* ---------- after hours ---------- */

.after-hours-line {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 45;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(233, 237, 235, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s var(--ease-walk);
}
body.after-hours .after-hours-line {
  opacity: 1;
  transition: opacity 2.4s var(--ease-walk) 1.1s;
}

body.after-hours { --lamp-a: 0.02; }
body.after-hours .plate,
body.after-hours .room-head,
body.after-hours .bench-break,
body.after-hours .tool-wall,
body.after-hours .note-stack,
body.after-hours .about,
body.after-hours .door,
body.after-hours .enter-mark,
body.after-hours .enter-sub,
body.after-hours .enter-cue,
body.after-hours .vast-scrim,
body.after-hours .foot,
body.after-hours .wordmark,
body.after-hours .index,
body.after-hours .minor-feature,
body.after-hours .scale-readout,
body.after-hours .hero-coordinate,
body.after-hours .index-toggle {
  opacity: 0.045;
  transition: opacity 2s var(--ease-walk);
}
/* the copy panels' opacity is scroll-driven inline (filter keeps the
   crossfade intact); the rail's opacity belongs to .scale-journey */
/* !important: the scroll crossfade writes an inline blur() filter each frame */
body.after-hours .experiment-copy { filter: brightness(0.08) !important; transition: filter 2s var(--ease-walk); }
body.after-hours .scale-rail { opacity: 0.045 !important; }
/* screens stay on after hours, but muted — hover still wakes them */
body.after-hours .figure .shot { filter: grayscale(0.7) brightness(0.35) contrast(1.03); }
body.after-hours .minor-feature-thumb img { filter: grayscale(0.7) brightness(0.35); }
.plate, .room-head, .bench-break, .tool-wall, .note-stack, .about, .door,
.enter-sub, .enter-cue, .vast-scrim, .wordmark, .index,
.minor-feature, .scale-readout, .hero-coordinate, .index-toggle {
  transition: opacity 2s var(--ease-walk);
}
body.after-hours .figure { border-color: rgba(133, 163, 147, 0.12); }
body.after-hours .cord-toggle { opacity: 1; }

/* ---------- notes pages ---------- */

.note-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 20vh clamp(24px, 6vw, 48px) 16vh;
  position: relative;
  z-index: 1;
}
.note-page .note-date { margin-bottom: 20px; }
.note-page h1 {
  font-weight: 700;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 8vh;
}
.note-page p {
  color: var(--grey);
  font-weight: 400;
  font-size: 16px;
  margin-bottom: 28px;
}
.note-page strong { color: var(--ink); font-weight: 600; }
.back {
  display: inline-block;
  margin-top: 8vh;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.6s var(--ease-walk);
}
.back:hover { color: var(--ink); }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .exhibit {
    grid-template-columns: 1fr;
    gap: 40px;
    min-height: 0;
    padding: 12vh 0;
  }
  .plate { padding: 0; }
  .figure { position: relative; top: 0; order: -1; max-width: 480px; }
  .exhibit--vast { min-height: 110vh; }
  .vast-scrim { background: rgba(7, 7, 7, 0.6); }
  .tool-wall { grid-template-columns: repeat(2, 1fr); }
  .note { grid-template-columns: 1fr; gap: 8px; }
  .room { padding-top: 18vh; padding-bottom: 18vh; }
  .switch-scene .cord { right: 15vw; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain, .figure::after, .cord-toggle:hover { animation: none; }
  .enter-line, .enter-sub, .enter-cue { animation: none; opacity: 1; }
  .reveal, .exhibit-title .l { opacity: 1; transform: none; transition: none; }
  .glitch.glitch-on, .glitch.glitch-on::before, .glitch.glitch-on::after { animation: none; }
  body { transition: none; }
  .veil { transition: none; }
}

/* ============================================================
   V2 — the workshop comes into the light
   ============================================================ */

:root {
  --black: #000;
  --surface: #000;
  --surface-cold: #000;
  --ink: #eef1ef;
  --grey: #a8aeab;
  --dim: #747b77;
  --hair: #2a2f2c;
  --mono: var(--sans);
  --gutter: clamp(24px, 6vw, 96px);
}

body {
  line-height: 1.62;
  background: var(--black);
}

main > section { scroll-margin-top: 88px; }

/* navigation is written like navigation, not terminal output */
.masthead {
  align-items: center;
  padding: 24px clamp(24px, 5vw, 72px);
  background: linear-gradient(rgba(0, 0, 0, 0.97), rgba(0, 0, 0, 0.68) 48%, transparent);
}
.wordmark {
  font-family: var(--sans);
  font-weight: 650;
  font-size: 13px;
  letter-spacing: 0.25em;
}
.index {
  align-items: center;
  gap: clamp(18px, 2.3vw, 34px);
}
.index a {
  position: relative;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--grey);
}
.index a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -7px;
  height: 1px;
  background: var(--accent);
  transition: right 0.45s var(--ease-walk);
}
.index a:hover::after,
.index a.is-current::after { right: 0; }
.index a.is-current { color: var(--ink); }
.index-toggle {
  display: none;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 13px/1 var(--sans);
}
.cord-toggle { top: -24px; }

/* hero: a full-canvas instrument field */
.room--enter {
  min-height: 100svh;
  padding: 0;
  isolation: isolate;
  overflow: hidden;
  --hero-exit: 0;
}
.hero-field,
.hero-aperture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hero-field {
  z-index: -3;
  opacity: calc(0.92 - var(--hero-exit) * 0.72);
  transform: scale(calc(1 + var(--hero-exit) * 0.1));
  transition: opacity 0.12s linear;
}
.hero-aperture {
  z-index: -2;
  background:
    radial-gradient(circle at var(--hero-x, 50%) var(--hero-y, 46%), rgba(205, 213, 209, 0.14), rgba(205, 213, 209, 0.025) 19%, transparent 42%),
    radial-gradient(ellipse at 50% 48%, transparent 0 28%, rgba(7, 7, 7, 0.15) 49%, rgba(7, 7, 7, 0.78) 88%);
  transform: scale(calc(1 + var(--hero-exit) * 0.35));
  opacity: calc(1 - var(--hero-exit) * 0.72);
}
.enter-mark {
  position: relative;
  z-index: 2;
  font-size: clamp(4rem, 12.5vw, 11rem);
  transform: translate3d(0, calc(var(--hero-exit) * -54px), 0) scale(calc(1 + var(--hero-exit) * 0.045));
  opacity: calc(1 - var(--hero-exit) * 1.15);
  will-change: transform, opacity;
}
.enter-sub {
  position: relative;
  z-index: 2;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: none;
  color: var(--grey);
  transform: translateY(calc(var(--hero-exit) * -34px));
  opacity: calc((1 - var(--hero-exit)) * 0.9);
}
.hero-coordinate {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  bottom: 42px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--dim);
  opacity: calc(0.65 - var(--hero-exit));
}
.enter-cue {
  z-index: 2;
  color: inherit;
  text-decoration: none;
  transform: translateY(calc(var(--hero-exit) * 26px));
  opacity: calc(1 - var(--hero-exit) * 1.4);
}
.cue-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: none;
  color: var(--dim);
}

/* sections get a real title and a measured rhythm */
.room {
  max-width: 1520px;
  padding: clamp(120px, 16vh, 180px) var(--gutter);
}
.room-head {
  margin-bottom: clamp(104px, 15vh, 160px);
}
.section-index {
  margin-bottom: 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.room-label {
  margin: 0 0 30px;
  max-width: 12ch;
  font-family: var(--industrial);
  font-size: clamp(3.8rem, 7.4vw, 7.4rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--ink);
}
.room-label::before { display: none; }
.room-note {
  max-width: 48ch;
  color: var(--grey);
  font-size: 16px;
  line-height: 1.65;
}
.room-note--lead {
  max-width: 43ch;
  font-size: clamp(1.22rem, 2vw, 1.8rem);
  line-height: 1.42;
  color: #c1c8c4;
}
.proof-ledger {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: clamp(54px, 8vh, 84px);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.proof-ledger p {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 84px;
  padding: 24px clamp(12px, 2vw, 30px);
  border-right: 1px solid var(--hair);
}
.proof-ledger p:first-child { padding-left: 0; }
.proof-ledger p:last-child { border-right: 0; }
.proof-ledger strong {
  font-family: var(--industrial);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
}
.proof-ledger span {
  font-size: 13px;
  color: var(--grey);
}

/* each exhibit has its own weight while sharing one system */
.exhibit {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(48px, 7vw, 116px);
  align-items: center;
  min-height: clamp(700px, 92svh, 940px);
  padding: clamp(76px, 10vh, 116px) 0;
}
.exhibit .plate { padding: 0; }
.exhibit--reverse {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}
.exhibit--reverse .plate { grid-column: 2; grid-row: 1; }
.exhibit--reverse .figure { grid-column: 1; grid-row: 1; }
.cat {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.exhibit-title {
  margin-bottom: 26px;
  font-size: clamp(3.25rem, 6.6vw, 6.7rem);
  white-space: nowrap;
}
.room-label,
.door-line { text-wrap: balance; }
.exhibit--dunts .exhibit-title { font-size: clamp(3rem, 6vw, 6.1rem); }
.thesis {
  font-size: clamp(1.08rem, 1.5vw, 1.35rem);
  line-height: 1.45;
}
.body {
  max-width: 51ch;
  font-size: 16px;
  line-height: 1.68;
  color: var(--grey);
}
.meta {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.035em;
  text-transform: none;
  color: var(--dim);
}
.meta a { color: #b9c0bc; }
.figure {
  position: sticky;
  top: 15vh;
  display: block;
  aspect-ratio: 16 / 10;
  color: inherit;
  text-decoration: none;
  border-color: #343a37;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
}
.figure .shot {
  filter: grayscale(0.65) brightness(0.76) contrast(1.04);
  transition: opacity 1.15s var(--ease-walk), filter 0.75s var(--ease-walk),
              transform 1.5s var(--ease-walk);
}
.fig-canvas { transition: opacity 1.1s var(--ease-walk); }
.figure.woken .shot { opacity: 1; }
.figure:hover .shot,
.figure:focus-visible .shot {
  filter: grayscale(0.04) brightness(0.98) contrast(1.02);
}
.figure.woken .fig-canvas { opacity: 0.13; }
.figure:hover .fig-canvas,
.figure:focus-visible .fig-canvas { opacity: 0.04; }
.figure-open {
  position: absolute;
  z-index: 4;
  right: 18px;
  bottom: 18px;
  padding: 8px 11px;
  background: rgba(7, 7, 7, 0.82);
  border: 1px solid rgba(238, 241, 239, 0.16);
  font-size: 12px;
  font-weight: 550;
  color: var(--ink);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease-walk), transform 0.35s var(--ease-walk);
}
.figure:hover .figure-open,
.figure:focus-visible .figure-open { opacity: 1; transform: none; }
.exhibit--map .figure { aspect-ratio: 4 / 3; }
.exhibit--dunts .figure { aspect-ratio: 16 / 11; }

/* one continuous journey from the galaxy to particle life */
#experiments {
  position: relative;
  background: var(--surface-cold);
}
.bench-break {
  max-width: 1520px;
  margin: 0 auto;
  padding: clamp(150px, 20vh, 220px) var(--gutter) clamp(110px, 14vh, 160px);
}
.experiment-scroll {
  position: relative;
  height: 235svh;
}
.experiment-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
  background: #000;
}
.vast-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  will-change: opacity, transform;
}
.vast-canvas--orrery { opacity: 0; transform: scale(0.92); }
.vast-canvas--primordium { opacity: 1; transform: scale(1); }
.vast-scrim {
  z-index: 1;
  background: linear-gradient(92deg, rgba(0, 0, 0, 0.91) 0%, rgba(0, 0, 0, 0.48) 44%, rgba(0, 0, 0, 0.04) 75%);
}
.experiment-copy {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  top: 50%;
  width: min(640px, 48vw);
  transform: translate3d(0, -50%, 0);
  will-change: opacity, transform;
}
.experiment-copy--primordium {
  opacity: 0;
  transform: translate3d(0, calc(-50% + 42px), 0);
}
.experiment-copy .cat { color: var(--phosphor); }
.experiment-copy .exhibit-title { font-size: clamp(4rem, 7vw, 7rem); }
.experiment-copy--primordium .exhibit-title { font-size: clamp(3.7rem, 6.4vw, 6.45rem); }
.scale-readout {
  position: absolute;
  z-index: 3;
  right: var(--gutter);
  bottom: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(173, 196, 185, 0.62);
}
.scale-readout i {
  display: block;
  width: 76px;
  height: 1px;
  background: rgba(133, 163, 147, 0.35);
  transform-origin: left;
}

/* tools and notes are working surfaces, not tiny technical labels */
.tool-wall { padding-top: 7vh; }
.tool-head {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.tool-col li { color: var(--grey); font-size: 16px; }
.note {
  grid-template-columns: 140px minmax(0, 1fr);
  grid-template-areas:
    'date title'
    '. excerpt';
  gap: 10px clamp(28px, 5vw, 72px);
  padding: clamp(46px, 6vh, 70px) 0;
}
.note-date {
  grid-area: date;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.note-title {
  grid-area: title;
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
}
.note-excerpt {
  grid-area: excerpt;
  font-size: 16px;
  line-height: 1.6;
}

/* the last room is a proper invitation */
.room--door {
  min-height: 92svh;
  display: grid;
  grid-template-columns: minmax(220px, 4fr) minmax(0, 8fr);
  align-items: center;
  gap: clamp(48px, 9vw, 140px);
  padding-bottom: clamp(120px, 16vh, 180px);
}
.room--door .room-head { margin: 0; }
.room--door .room-label { font-size: clamp(3.4rem, 6vw, 6rem); }
.door-line {
  font-family: var(--industrial);
  font-weight: 800;
  font-size: clamp(5rem, 10vw, 10rem);
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
}
.door-note {
  margin: 0 0 28px;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  color: var(--grey);
}
.meta--door { font-size: 15px; }
.meta--door a { padding-bottom: 5px; }
.foot {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-transform: none;
  color: #848b87;
}

/* native cursor stays available; the light is the atmosphere */
@media (pointer: fine) {
  body.has-cursor,
  body.has-cursor * { cursor: auto !important; }
  body.has-cursor a,
  body.has-cursor button { cursor: pointer !important; }
  .cursor { display: none; }
}

@media (max-width: 860px) {
  :root { --gutter: 24px; }

  .masthead {
    align-items: center;
    padding: 22px 24px;
    background: linear-gradient(rgba(0, 0, 0, 0.97), rgba(0, 0, 0, 0.72), transparent);
  }
  .wordmark { position: relative; z-index: 53; font-size: 12px; }
  .index-toggle {
    position: relative;
    z-index: 53;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-left: auto;
    padding: 8px 0;
  }
  .index-toggle-mark {
    position: relative;
    width: 14px;
    height: 14px;
  }
  .index-toggle-mark::before,
  .index-toggle-mark::after {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 14px;
    height: 1px;
    background: currentColor;
    transition: transform 0.35s var(--ease-walk);
  }
  .index-toggle-mark::before { transform: translateY(-3px); }
  .index-toggle-mark::after { transform: translateY(3px); }
  body.index-open .index-toggle-mark::before { transform: rotate(45deg); }
  body.index-open .index-toggle-mark::after { transform: rotate(-45deg); }
  .index {
    position: fixed;
    z-index: 52;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    margin: 0;
    padding: 100px 24px 56px;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-16px);
    transition: opacity 0.45s var(--ease-walk), transform 0.45s var(--ease-walk), visibility 0.45s;
  }
  body.index-open { overflow: hidden; }
  body.index-open .index { opacity: 1; visibility: visible; transform: none; }
  .index a {
    font-family: var(--industrial);
    font-size: clamp(2.7rem, 13vw, 4.1rem);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--ink);
  }
  .index a::after { display: none; }
  .cord-toggle { display: none; }

  .room--enter { min-height: 100svh; }
  .enter-mark { font-size: clamp(3.5rem, 17vw, 5.1rem); }
  .enter-sub { margin-top: 28px; font-size: 12px; }
  .hero-coordinate { bottom: 28px; font-size: 9px; }
  .enter-cue { bottom: 28px; }

  .room {
    padding: clamp(108px, 14vh, 136px) 24px;
  }
  .room-head { margin-bottom: clamp(80px, 12vh, 112px); }
  .room-label {
    font-size: clamp(3.25rem, 16vw, 5rem);
    line-height: 0.88;
  }
  .room-note--lead { font-size: clamp(1.12rem, 5.4vw, 1.4rem); }
  .proof-ledger { grid-template-columns: repeat(2, 1fr); }
  .proof-ledger p {
    min-height: 76px;
    padding: 18px 12px;
  }
  .proof-ledger p:nth-child(2) { border-right: 0; }
  .proof-ledger p:nth-child(-n + 2) { border-bottom: 1px solid var(--hair); }
  .proof-ledger p:nth-child(3) { padding-left: 0; }
  .proof-ledger strong { font-size: 1.65rem; }
  .proof-ledger span { font-size: 12px; }

  .exhibit,
  .exhibit--reverse {
    grid-template-columns: 1fr;
    gap: 42px;
    min-height: 0;
    padding: clamp(84px, 12vh, 116px) 0;
  }
  .exhibit .plate,
  .exhibit--reverse .plate {
    grid-column: 1;
    grid-row: 2;
  }
  .exhibit .figure,
  .exhibit--reverse .figure {
    position: relative;
    top: 0;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: none;
  }
  .exhibit-title { font-size: clamp(3rem, 15vw, 4.4rem); }
  .exhibit--dunts .exhibit-title { font-size: clamp(2.8rem, 13.5vw, 4rem); }
  .body { font-size: 15.5px; }
  .figure-open { display: none; }

  .bench-break {
    padding: clamp(130px, 18vh, 180px) 24px clamp(96px, 13vh, 130px);
  }
  .experiment-scroll { height: 215svh; }
  .experiment-copy {
    left: 24px;
    right: 24px;
    width: auto;
  }
  .experiment-copy .exhibit-title { font-size: clamp(3.4rem, 16vw, 5rem); }
  .experiment-copy--primordium .exhibit-title { font-size: clamp(3rem, 14vw, 4.4rem); }
  .experiment-copy .body { max-width: 36ch; }
  .vast-scrim {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.42) 58%, rgba(0, 0, 0, 0.72));
  }
  .scale-readout { display: none; }

  .tool-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 54px 24px; }
  .tool-col li { font-size: 15px; }
  .note {
    grid-template-columns: 1fr;
    grid-template-areas: 'date' 'title' 'excerpt';
    gap: 12px;
    padding: 48px 0;
  }
  .note-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }

  .room--door {
    min-height: 92svh;
    display: grid;
    grid-template-columns: 1fr;
    align-content: center;
    gap: 72px;
  }
  .room--door .room-label { font-size: 3.4rem; }
  .door-line { font-size: clamp(4.2rem, 21vw, 6.5rem); }
  .foot { flex-direction: column; gap: 12px; line-height: 1.5; }
}

@media (max-width: 430px) {
  .hero-coordinate { display: none; }
  .room-label { max-width: 100%; }
  .enter-cue { bottom: 24px; }
  .tool-wall { grid-template-columns: 1fr 1fr; }
  .meta-sep { margin: 0 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-field,
  .hero-aperture,
  .enter-mark,
  .enter-sub,
  .enter-cue { transform: none !important; }
  .experiment-scroll { height: auto; }
  .experiment-stage {
    position: relative;
    height: auto;
    overflow: hidden;
  }
  .vast-canvas { position: absolute; opacity: 0.38 !important; transform: none !important; }
  .experiment-copy {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    min-height: 90svh;
    padding: 22vh var(--gutter);
    opacity: 1 !important;
    transform: none !important;
  }
  .experiment-copy--primordium { background: rgba(0, 0, 0, 0.58); }
}

/* ============================================================
   V3 — off-axis cinema, bright cuts, quieter supporting type
   ============================================================ */

.room--enter {
  align-items: flex-start;
  justify-content: center;
  padding: 0 var(--gutter);
  text-align: left;
  background:
    linear-gradient(90deg, rgba(7, 7, 7, 0.94) 0%, rgba(7, 7, 7, 0.62) 45%, rgba(7, 7, 7, 0.08) 82%),
    #000;
}
.hero-aperture {
  background:
    radial-gradient(circle at var(--hero-x, 76%) var(--hero-y, 43%), rgba(226, 232, 229, 0.2), rgba(205, 213, 209, 0.045) 17%, transparent 43%),
    radial-gradient(ellipse at 77% 44%, transparent 0 19%, rgba(7, 7, 7, 0.16) 49%, rgba(7, 7, 7, 0.86) 91%);
}
.hero-horizon {
  position: absolute;
  z-index: -1;
  left: 52%;
  right: 0;
  top: 43%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(238, 241, 239, 0.12) 30%, rgba(238, 241, 239, 0.82) 78%, transparent 97%);
  box-shadow: 0 0 24px rgba(238, 241, 239, 0.12), 0 0 90px rgba(205, 213, 209, 0.12);
  opacity: calc(0.82 - var(--hero-exit) * 0.8);
  transform: translateY(calc(var(--hero-exit) * -16px));
}
.hero-horizon::after {
  content: '';
  position: absolute;
  right: 22%;
  top: -50vh;
  width: 1px;
  height: 100vh;
  background: linear-gradient(transparent, rgba(238, 241, 239, 0.16), transparent);
}
.enter-mark {
  align-items: flex-start;
  width: max-content;
  max-width: 92vw;
  margin: -2vh 0 0 clamp(0px, 1.8vw, 32px);
  font-family: var(--industrial);
  font-size: clamp(4.5rem, 11.2vw, 10.4rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: 0.015em;
}
.enter-line {
  display: block;
  opacity: 1;
  filter: none;
  white-space: nowrap;
  transition: none;
}
.enter-line:nth-child(2) { margin-left: 0.92em; }
.enter-line.is-lettered .hero-letter {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translate3d(var(--from-x), var(--from-y), 0) rotate(var(--from-r)) scale(0.88);
  transform-origin: 50% 55%;
  will-change: transform, opacity, filter;
}
body.lit .enter-line.is-lettered .hero-letter {
  animation: hero-letter-land 1.28s cubic-bezier(0.16, 0.82, 0.18, 1) var(--letter-delay) forwards;
}
@keyframes hero-letter-land {
  0% {
    opacity: 0;
    filter: blur(10px);
    transform: translate3d(var(--from-x), var(--from-y), 0) rotate(var(--from-r)) scale(0.88);
  }
  58% { opacity: 1; filter: blur(1px); }
  100% { opacity: 1; filter: blur(0); transform: translate3d(0, 0, 0) rotate(0) scale(1); }
}
.enter-sub {
  margin: 34px 0 0 clamp(4px, 2.1vw, 36px);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.075em;
  color: #a8aeab;
}
.hero-coordinate {
  left: var(--gutter);
  right: auto;
  color: #858c88;
}
.enter-cue {
  right: var(--gutter);
  align-items: flex-end;
}
.cue-line { margin-right: 11px; }

/* The experiments open in daylight before dropping into the simulation. */
#experiments { background: #000; }
.bench-break {
  position: relative;
  max-width: none;
  min-height: 72svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: #000;
  color: var(--ink);
}
.bench-break::before,
.bench-break::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.bench-break::before {
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), rgba(238, 241, 239, 0.055) calc(12.5% - 1px) 12.5%),
    linear-gradient(90deg, transparent 0 54%, rgba(238, 241, 239, 0.08) 54% calc(54% + 1px), transparent calc(54% + 1px));
}
.bench-break::after {
  left: 50%;
  right: -8%;
  top: 52%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 241, 239, 0.9) 68%, transparent);
  box-shadow: 0 0 34px rgba(238, 241, 239, 0.14);
}
.bench-break > * { position: relative; z-index: 1; }
.bench-break .section-index { color: #9aa8a1; }
.bench-break .room-label { color: var(--ink); }
.bench-break .room-note--lead { color: #bcc2bf; }
.experiment-scroll { background: #000; }

.light-cut {
  position: relative;
  z-index: 2;
  height: clamp(94px, 15vh, 160px);
  overflow: hidden;
  background: #000;
}
.light-cut::before,
.light-cut::after {
  content: '';
  position: absolute;
  inset: 0;
}
.light-cut::before {
  background: repeating-linear-gradient(90deg, transparent 0 calc(12.5% - 1px), rgba(238, 241, 239, 0.11) calc(12.5% - 1px) 12.5%);
}
.light-cut::after {
  left: 54%;
  width: 1px;
  background: rgba(238, 241, 239, 0.72);
  box-shadow: 18vw 0 0 rgba(238, 241, 239, 0.18), -36vw 0 0 rgba(238, 241, 239, 0.18);
}
.light-cut i {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, rgba(238, 241, 239, 0.08), rgba(238, 241, 239, 0.95) 72%, rgba(238, 241, 239, 0.08));
  box-shadow: 0 0 28px rgba(238, 241, 239, 0.13);
}
.light-cut--warm { background: #000; }

#tools,
#notes,
#contact { max-width: none; }
#tools { background: #000; }
#notes { background: #000; }
#contact { background: #000; }
#tools .room-head,
#tools .tool-wall,
#notes .room-head,
#notes .note-stack {
  max-width: 1328px;
  margin-left: auto;
  margin-right: auto;
}
#tools .tool-wall { margin-top: 0; }
#tools .tool-col li { border-color: #343a37; }
#tools .tool-head { color: #eef1ef; }
#notes .note-stack { border-color: #272c29; }

@media (max-width: 860px) {
  .room--enter { padding: 0 24px; }
  .enter-mark {
    max-width: calc(100vw - 48px);
    margin-left: 0;
    font-size: clamp(3.9rem, 18.2vw, 6.4rem);
  }
  .enter-line:nth-child(2) { margin-left: 0.52em; }
  .enter-sub { margin-top: 26px; margin-left: 2px; }
  .hero-horizon { left: 43%; top: 37%; }
  .hero-coordinate { left: 24px; right: auto; }
  .enter-cue { right: 24px; }
  .bench-break { min-height: 66svh; }
  .light-cut { height: clamp(74px, 12vh, 110px); }
}

@media (max-width: 430px) {
  .enter-mark { font-size: clamp(3.55rem, 18vw, 4.85rem); }
  .enter-line:nth-child(2) { margin-left: 0.38em; }
}

@media (prefers-reduced-motion: reduce) {
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
  .hero-horizon { transform: none !important; }
}

/* ============================================================
   V4 — cellular first, mechanical type assembly
   ============================================================ */

.vast-canvas--primordium {
  opacity: 1;
  transform: scale(1);
}
.vast-canvas--orrery {
  opacity: 0;
  transform: scale(0.92);
}
.experiment-copy--primordium {
  opacity: 1;
  transform: translate3d(0, -50%, 0);
}
.experiment-copy--orrery {
  opacity: 0;
  transform: translate3d(0, calc(-50% + 42px), 0);
}

.hero-slot {
  position: relative;
  display: inline-block;
  overflow: visible;
  clip-path: inset(-190% -3% -190% -3%);
  vertical-align: top;
}
.hero-slot::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 0.025em;
  height: 1px;
  background: rgba(238, 241, 239, 0.52);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
}
body.lit .hero-slot::after {
  animation: hero-slot-register 0.52s linear var(--letter-delay) both;
}
.enter-line.is-lettered .hero-letter {
  display: block;
  opacity: 0;
  filter: none;
  transform: translate3d(var(--from-x), var(--from-y), 0);
}
body.lit .enter-line.is-lettered .hero-letter {
  animation: hero-letter-lock 0.78s cubic-bezier(0.2, 0.78, 0.16, 1) var(--letter-delay) forwards;
}
@keyframes hero-letter-lock {
  0% { opacity: 0.12; transform: translate3d(var(--from-x), var(--from-y), 0); }
  68% { opacity: 1; transform: translate3d(0, 0, 0); }
  82% { transform: translate3d(0, -0.026em, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes hero-slot-register {
  0%, 18% { opacity: 0; transform: scaleX(0); }
  35% { opacity: 0.74; transform: scaleX(1); }
  74% { opacity: 0.45; transform: scaleX(1); transform-origin: right; }
  100% { opacity: 0; transform: scaleX(0); transform-origin: right; }
}

.minor-feature {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 620px);
  align-items: center;
  gap: clamp(34px, 6vw, 86px);
  margin-top: clamp(96px, 14vh, 170px);
  padding: clamp(44px, 6vh, 70px) 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
}
.minor-feature-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid #343a37;
}
.minor-feature-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.38) brightness(0.72);
  transition: filter 0.55s var(--ease-walk), transform 0.8s var(--ease-walk);
}
.minor-feature-thumb:hover img,
.minor-feature-thumb:focus-visible img {
  filter: grayscale(0.08) brightness(0.94);
  transform: scale(1.025);
}
.minor-feature-title {
  margin: 8px 0 14px;
  font-family: var(--industrial);
  font-size: clamp(2.2rem, 4vw, 4rem);
  font-weight: 800;
  line-height: 0.92;
  text-transform: uppercase;
}
.minor-feature .body { margin-bottom: 22px; }

@media (max-width: 860px) {
  .minor-feature {
    grid-template-columns: minmax(110px, 34vw) minmax(0, 1fr);
    gap: 24px;
    margin-top: 96px;
    padding: 36px 0;
  }
  .minor-feature-title { font-size: clamp(1.9rem, 9vw, 2.8rem); }
  .minor-feature .body { font-size: 14px; line-height: 1.5; }
}

@media (max-width: 520px) {
  .minor-feature {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .minor-feature-thumb { width: min(72vw, 280px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slot::after,
  body.lit .hero-slot::after { animation: none; }
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* The raster fault reconstitutes through the glyphs instead of snapping off. */
.enter-mark.sync-recover {
  animation: hero-signal-recover 0.32s cubic-bezier(0.16, 0.72, 0.2, 1) both;
}
.enter-mark.sync-recover::after {
  animation: hero-sync-release 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes hero-signal-recover {
  0% {
    filter: blur(0.45px) brightness(1.18) contrast(1.08);
  }
  42% {
    filter: blur(0) brightness(1.03) contrast(1.02);
  }
  100% {
    filter: none;
  }
}
@keyframes hero-sync-release {
  0% { top: 98%; opacity: 0.24; transform: scaleX(0.72); }
  100% { top: 100%; opacity: 0; transform: scaleX(0.3); }
}
@media (prefers-reduced-motion: reduce) {
  .enter-mark.sync-recover,
  .enter-mark.sync-recover::after {
    animation: none;
  }
}

/* ============================================================
   V7 — instrument typography, servo lock and visible signal
   ============================================================ */

/* Supporting type reads as editorial UI; Barlow remains the display face. */
.enter-sub {
  margin-top: 32px;
  font-family: var(--sans);
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 450;
  line-height: 1.25;
  letter-spacing: -0.012em;
  color: #a8aeab;
}
.cue-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.hero-coordinate,
.cat,
.meta,
.section-index,
.scale-readout,
.proof-module dt,
.scale-rail button {
  font-family: var(--sans);
}
.meta {
  font-size: 12px;
  letter-spacing: 0.015em;
  text-transform: none;
}
.proof-module dt {
  font-size: 10px;
  letter-spacing: 0.025em;
  text-transform: none;
}

/* Servo travel: one clean acceleration, a physical brake, then a short recoil. */
.hero-slot {
  clip-path: inset(-260% 0 -260% 0);
  transform: translateZ(0);
}
.enter-line.is-lettered .hero-letter {
  display: block;
  opacity: 0;
  filter: none;
  transform: translate3d(var(--from-x), var(--from-y), 0);
  will-change: transform, opacity;
}
body.lit .enter-line.is-lettered .hero-letter {
  animation: hero-letter-lock 1.08s linear var(--letter-delay) forwards;
}
@keyframes hero-letter-lock {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0);
    animation-timing-function: cubic-bezier(0.13, 0.72, 0.13, 1);
  }
  7% { opacity: 0.92; }
  64% {
    opacity: 1;
    transform: translate3d(var(--brake-x), var(--brake-y), 0) scale(0.996);
    animation-timing-function: cubic-bezier(0.2, 0.72, 0.2, 1);
  }
  73% {
    transform: translate3d(0, 0, 0) scale(1.002);
    animation-timing-function: cubic-bezier(0.25, 0.7, 0.25, 1);
  }
  84% { transform: translate3d(var(--recoil-x), var(--recoil-y), 0) scale(0.999); }
  94%, 100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
body.lit .hero-slot::before {
  animation: hero-slot-clamp 1.08s linear var(--letter-delay) both;
}
@keyframes hero-slot-clamp {
  0%, 56% { opacity: 0; transform: scaleY(0.72); }
  64% { opacity: 0.5; transform: scaleY(1); }
  73% { opacity: 0.16; transform: scaleY(1); }
  86%, 100% { opacity: 0; transform: scaleY(1); }
}
body.lit .hero-slot::after {
  animation: hero-slot-register 1.08s linear var(--letter-delay) both;
}
@keyframes hero-slot-register {
  0%, 57% { opacity: 0; transform: scaleX(0); transform-origin: left; }
  65% { opacity: 0.62; transform: scaleX(1); transform-origin: left; }
  76% { opacity: 0.2; transform: scaleX(1); transform-origin: right; }
  88%, 100% { opacity: 0; transform: scaleX(0); transform-origin: right; }
}

/* Phosphor cadence is confined to the glyphs, preserving the uniform #000 hero. */
@supports (-webkit-background-clip: text) {
  .enter-line.is-lettered .hero-letter {
    color: transparent;
    background: repeating-linear-gradient(
      to bottom,
      #f1f4f2 0 2px,
      #cbd3cf 2px 3px,
      #f7f9f8 3px 4px,
      #aebbb5 4px 5px
    );
    background-size: 100% 5px;
    background-position: 0 0;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}

/* A short monochrome raster fault replaces the generic RGB-style tear. */
.glitch::before,
.glitch::after {
  z-index: 4;
  background: #000;
  color: #eef1ef;
  text-shadow: none;
  opacity: 0;
}
.glitch.glitch-on::before {
  animation: raster-shear-white 0.4s steps(1, end) both;
}
.glitch.glitch-on::after {
  color: var(--phosphor);
  animation: raster-shear-green 0.4s steps(1, end) both;
}
@keyframes raster-shear-white {
  0%, 7%, 24%, 46%, 66%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  8% { opacity: 0.84; transform: translateX(0.055em); clip-path: inset(18% 0 73% 0); }
  13% { opacity: 0.92; transform: translateX(-0.032em); clip-path: polygon(0 43%,100% 43%,100% 48%,0 48%,0 71%,100% 71%,100% 74%,0 74%); }
  25% { opacity: 0.7; transform: translateX(-0.07em); clip-path: inset(61% 0 32% 0); }
  47% { opacity: 0.8; transform: translateX(0.026em); clip-path: inset(5% 0 89% 0); }
  67% { opacity: 0.55; transform: translateX(-0.018em); clip-path: inset(82% 0 13% 0); }
}
@keyframes raster-shear-green {
  0%, 12%, 31%, 56%, 78%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  13% { opacity: 0.62; transform: translateX(-0.045em); clip-path: inset(30% 0 64% 0); }
  32% { opacity: 0.48; transform: translateX(0.036em); clip-path: inset(74% 0 20% 0); }
  57% { opacity: 0.54; transform: translateX(-0.022em); clip-path: polygon(0 12%,100% 12%,100% 15%,0 15%,0 53%,100% 53%,100% 56%,0 56%); }
  79% { opacity: 0.34; transform: translateX(0.014em); clip-path: inset(91% 0 5% 0); }
}
.enter-mark::after {
  content: '';
  position: absolute;
  z-index: 5;
  left: -3%;
  right: -3%;
  top: 0;
  height: 1px;
  pointer-events: none;
  opacity: 0;
  background: rgba(238, 241, 239, 0.86);
  box-shadow: 0 0 10px rgba(133, 163, 147, 0.44);
}
.enter-mark.sync-on::after {
  animation: hero-sync-roll 0.4s cubic-bezier(0.32, 0, 0.68, 1) both;
}
.enter-mark.sync-on { animation: hero-sync-chassis 0.4s steps(1, end) both; }
@keyframes hero-sync-roll {
  0%, 8% { top: 4%; opacity: 0; transform: scaleX(0.45); }
  12% { opacity: 0.74; }
  72% { top: 92%; opacity: 0.48; transform: scaleX(1); }
  88%, 100% { top: 98%; opacity: 0; transform: scaleX(0.72); }
}
@keyframes hero-sync-chassis {
  0%, 10%, 22%, 48%, 61%, 100% { filter: none; }
  11% { filter: contrast(1.28) brightness(1.08); }
  49% { filter: contrast(1.16) brightness(0.96); }
}

/* CRT behaviour belongs to the project displays, not the page background. */
.figure::before {
  background:
    repeating-linear-gradient(to bottom, rgba(238, 241, 239, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, rgba(233, 237, 235, 0.06), transparent 38%);
}
.figure::after {
  z-index: 3;
  height: 2px;
  background: rgba(173, 196, 185, 0.44);
  box-shadow: 0 0 12px rgba(133, 163, 147, 0.25);
  animation: figure-sync-sweep 12s linear infinite;
}
@keyframes figure-sync-sweep {
  0%, 84% { top: -3px; opacity: 0; }
  85% { top: 0; opacity: 0.5; }
  94% { top: 100%; opacity: 0.32; }
  95%, 100% { top: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter,
  body.lit .hero-slot::before,
  body.lit .hero-slot::after,
  .enter-mark.sync-on,
  .enter-mark.sync-on::after,
  .figure::after {
    animation: none;
  }
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter {
    opacity: 1;
    transform: none;
  }
  .enter-mark::after { display: none; }
}

/* Keep full-screen compositing cheap; blend effects stay inside transition patterns. */
.grain { mix-blend-mode: normal; }

/* ============================================================
   V6 — one continuous scale
   ============================================================ */

.scale-engine {
  position: fixed;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.74;
  mix-blend-mode: normal;
  transition: opacity 0.55s var(--ease-walk);
}
body[data-scale-active="primordium"] .scale-engine,
body[data-scale-active="orrery"] .scale-engine { opacity: 0; }
main { z-index: 2; }
.room--enter {
  background: #000;
}
.room--enter .hero-aperture { background: none; }
.hero-field { display: none; }
body[data-room="enter"] .lamp,
body[data-room="enter"] .grain { opacity: 0; }

/* A functional scale index, not another decorative readout. */
.scale-rail {
  position: fixed;
  z-index: 45;
  right: 24px;
  top: 50%;
  display: grid;
  gap: 2px;
  width: 112px;
  padding: 8px 0;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(12px, -50%, 0);
  transition: opacity 0.5s var(--ease-walk), transform 0.5s var(--ease-walk);
}
body.scale-journey .scale-rail {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(0, -50%, 0);
}
.scale-rail::before {
  content: '';
  position: absolute;
  right: 3px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: rgba(238, 241, 239, 0.16);
}
.scale-rail button {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  padding: 0 13px 0 0;
  border: 0;
  background: none;
  color: #747b77;
  font: 500 10px/1 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: color 0.35s var(--ease-walk);
}
.scale-rail button::after {
  content: '';
  position: absolute;
  right: 0;
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: #000;
  transition: background 0.35s var(--ease-walk), box-shadow 0.35s var(--ease-walk), transform 0.35s var(--ease-walk);
}
.scale-rail button span { color: #575d5a; }
.scale-rail button b {
  font-weight: 500;
  letter-spacing: 0.035em;
}
.scale-rail button:hover,
.scale-rail button[aria-current="step"] { color: var(--ink); }
.scale-rail button[aria-current="step"]::after {
  background: var(--phosphor);
  border-color: var(--phosphor);
  box-shadow: 0 0 18px rgba(133, 163, 147, 0.48);
  transform: scale(1.15);
}

/* Hero and Primordium now share a boundary with no holding room between them. */
#experiments { background: transparent; }
.experiment-scroll { height: 255svh; background: transparent; }
.experiment-stage { background: rgba(0, 0, 0, 0.52); }
.vast-scrim {
  background: linear-gradient(92deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.48) 44%, rgba(0, 0, 0, 0.04) 75%);
}
.experiment-copy { width: min(680px, 50vw); }
.experiment-copy .body { max-width: 55ch; }
.scale-readout { right: max(146px, var(--gutter)); }

.room--work {
  padding-top: clamp(32px, 5vh, 64px);
  background: transparent;
}
.room--work .exhibit:first-child { padding-top: clamp(82px, 12vh, 130px); }
.exhibit[data-scale-scene] { scroll-margin-top: 10vh; }
.plate,
.figure,
.minor-feature { position: relative; z-index: 3; }

/* Evidence sits on the page as a ledger, never a card. */
.proof-module {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 30px 0 22px;
  border-top: 1px solid rgba(238, 241, 239, 0.16);
  border-bottom: 1px solid rgba(238, 241, 239, 0.16);
}
.proof-module div {
  min-width: 0;
  padding: 14px 14px 15px 0;
  border-right: 1px solid rgba(238, 241, 239, 0.11);
}
.proof-module div + div { padding-left: 14px; }
.proof-module div:last-child { border-right: 0; }
.proof-module dt {
  margin-bottom: 5px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #747b77;
}
.proof-module dd {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: #c2c8c5;
}
.proof-action {
  position: relative;
  z-index: 4;
  min-height: 34px;
  margin: 0 0 22px;
  padding: 8px 14px;
  border: 1px solid rgba(238, 241, 239, 0.24);
  background: rgba(7, 7, 7, 0.3);
  color: #c5cbc8;
  font: 500 11px/1 var(--sans);
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: color 0.3s var(--ease-walk), border-color 0.3s var(--ease-walk), background 0.3s var(--ease-walk);
}
.proof-action:hover,
.proof-action:focus-visible,
.proof-action.is-active {
  color: var(--ink);
  border-color: rgba(133, 163, 147, 0.72);
  background: rgba(133, 163, 147, 0.09);
}
.proof-control {
  display: flex;
  align-items: center;
  gap: 14px;
}
.proof-control .proof-action { margin-bottom: 22px; }
.proof-control output {
  margin-bottom: 22px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #808783;
}
.exhibit .proof-module { margin-top: 32px; }
.exhibit .meta,
.experiment-copy .meta { margin-top: 0; }

#tools {
  position: relative;
  background: transparent;
}
#contact {
  position: relative;
  overflow: hidden;
  background: transparent;
}
#contact::before {
  display: none;
}

@media (max-width: 860px) {
  .scale-engine { opacity: 0.58; }
  .scale-rail {
    left: 18px;
    right: 18px;
    top: auto;
    bottom: 12px;
    width: auto;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.97);
    border: 1px solid rgba(238, 241, 239, 0.1);
    transform: translate3d(0, 12px, 0);
  }
  body.scale-journey .scale-rail { transform: none; }
  .scale-rail::before {
    left: 22px;
    right: 22px;
    top: 12px;
    bottom: auto;
    width: auto;
    height: 1px;
  }
  .scale-rail button {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 8px;
    min-height: 36px;
    padding: 11px 2px 0;
    text-align: center;
  }
  .scale-rail button::after {
    top: 0;
    right: 50%;
    transform: translateX(50%);
  }
  .scale-rail button[aria-current="step"]::after { transform: translateX(50%) scale(1.15); }
  .scale-rail button span { display: none; }
  .scale-rail button b { font-size: 8px; }

  .experiment-scroll { height: 235svh; }
  .experiment-copy {
    left: 24px;
    right: 24px;
    width: auto;
  }
  .experiment-copy .body { max-width: 38ch; }
  .proof-module { margin: 22px 0 17px; }
  .proof-module div { padding: 11px 8px 12px 0; }
  .proof-module div + div { padding-left: 8px; }
  .proof-module dt { font-size: 8px; }
  .proof-module dd { font-size: 9px; }
  .proof-action { margin-bottom: 17px; }
  .proof-control .proof-action,
  .proof-control output { margin-bottom: 17px; }
  .room--work { padding-top: 24px; }
  #contact { padding-bottom: 150px; }
}

@media (max-width: 430px) {
  .scale-rail button b { font-size: 7px; letter-spacing: -0.01em; }
  .experiment-copy .exhibit-title { margin-bottom: 18px; }
  .experiment-copy .thesis { margin-bottom: 14px; }
  .experiment-copy .body { font-size: 13.5px; line-height: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .scale-engine { opacity: 0.4; }
  .scale-rail { transition: none; }
  .proof-action { transition: none; }
}

/* ============================================================
   V5 — optical blends and a final mechanical lock
   ============================================================ */

.grain { mix-blend-mode: normal; }
.hero-field {
  mix-blend-mode: screen;
  filter: saturate(1.06) contrast(1.04);
}
.hero-horizon { mix-blend-mode: screen; }
.hero-horizon::before {
  content: '';
  position: absolute;
  right: calc(22% - 72px);
  top: -31px;
  width: 144px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(245, 248, 247, 0.3), rgba(205, 213, 209, 0.08) 28%, transparent 68%);
  mix-blend-mode: color-dodge;
  opacity: 0.58;
  animation: optic-breathe 5.8s ease-in-out 2.1s infinite;
}
@keyframes optic-breathe {
  0%, 100% { opacity: 0.36; transform: scaleX(0.82); }
  48% { opacity: 0.72; transform: scaleX(1.08); }
}

.bench-break::before {
  mix-blend-mode: screen;
  animation: instrument-grid-drift 26s linear infinite;
}
.bench-break::after {
  mix-blend-mode: color-dodge;
  opacity: 0.76;
  animation: dodge-breathe 6.4s ease-in-out infinite;
}
.light-cut::before {
  mix-blend-mode: screen;
  animation: instrument-grid-drift 22s linear infinite reverse;
}
.light-cut::after,
.light-cut i {
  mix-blend-mode: screen;
}
.light-cut i::after {
  content: '';
  position: absolute;
  top: -22px;
  left: -8%;
  width: 18%;
  height: 45px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(245, 248, 247, 0.44), rgba(205, 213, 209, 0.08) 34%, transparent 72%);
  mix-blend-mode: color-dodge;
  animation: line-dodge 7.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes instrument-grid-drift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 12.5vw 0, 0 0; }
}
@keyframes dodge-breathe {
  0%, 100% { opacity: 0.48; filter: brightness(0.88); }
  52% { opacity: 0.92; filter: brightness(1.22); }
}
@keyframes line-dodge {
  0%, 12% { left: -18%; opacity: 0; transform: scaleX(0.62); }
  24% { opacity: 0.72; }
  70% { opacity: 0.86; }
  88%, 100% { left: 102%; opacity: 0; transform: scaleX(1.18); }
}

.hero-slot::before {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0.035em 0.01em 0.055em;
  border: 1px solid rgba(238, 241, 239, 0.28);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
body.lit .hero-slot::before {
  animation: hero-slot-clamp 0.76s linear var(--letter-delay) both;
}
.enter-line.is-lettered .hero-letter {
  backface-visibility: hidden;
  transform-origin: 50% 55%;
}
body.lit .enter-line.is-lettered .hero-letter {
  animation: hero-letter-lock 0.86s cubic-bezier(0.16, 0.72, 0.1, 1) var(--letter-delay) forwards;
}
@keyframes hero-letter-lock {
  0% {
    opacity: 0;
    text-shadow: 0 0 0 rgba(245, 248, 247, 0);
    transform: translate3d(var(--from-x), var(--from-y), 0);
  }
  12% {
    opacity: 0.34;
    text-shadow: 0 0 10px rgba(245, 248, 247, 0.16);
    transform: translate3d(var(--from-x), var(--from-y), 0);
  }
  62% {
    opacity: 1;
    text-shadow: 0 0 16px rgba(245, 248, 247, 0.46);
    transform: translate3d(0, 0, 0);
  }
  76% { transform: translate3d(0, -0.018em, 0) scaleY(1.005); }
  88% { text-shadow: 0 0 5px rgba(245, 248, 247, 0.18); transform: translate3d(0, 0.009em, 0); }
  100% { opacity: 1; text-shadow: none; transform: translate3d(0, 0, 0); }
}
@keyframes hero-slot-clamp {
  0%, 24% { opacity: 0; transform: scaleY(0.7); }
  38% { opacity: 0.54; transform: scaleY(1); }
  66% { opacity: 0.2; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-horizon::before,
  .bench-break::before,
  .bench-break::after,
  .light-cut::before,
  .light-cut i::after,
  .hero-slot::before,
  body.lit .hero-slot::before {
    animation: none;
  }
  .hero-horizon::before,
  .light-cut i::after,
  .hero-slot::before { display: none; }
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter {
    animation: none;
    opacity: 1;
    text-shadow: none;
    transform: none;
  }
}

/* Final cascade: the servo motion must sit after the legacy optical layer. */
.figure.woken .fig-canvas { opacity: 0.26; mix-blend-mode: screen; }
.figure:hover .fig-canvas,
.figure:focus-visible .fig-canvas { opacity: 0.18; }
.figure.woken .shot { opacity: 0.9; }
.proof-module dt {
  font-size: 10px;
  letter-spacing: 0.025em;
  text-transform: none;
}
body.lit .enter-line.is-lettered .hero-letter {
  animation: hero-letter-lock 1.08s linear var(--letter-delay) forwards;
}
body.lit .hero-slot::before {
  animation: hero-slot-clamp 1.08s linear var(--letter-delay) both;
}
body.lit .hero-slot::after {
  animation: hero-slot-register 1.08s linear var(--letter-delay) both;
}
@keyframes hero-letter-lock {
  0% {
    opacity: 0;
    text-shadow: none;
    transform: translate3d(var(--from-x), var(--from-y), 0);
    animation-timing-function: cubic-bezier(0.13, 0.72, 0.13, 1);
  }
  7% { opacity: 0.92; }
  64% {
    opacity: 1;
    text-shadow: none;
    transform: translate3d(var(--brake-x), var(--brake-y), 0) scale(0.996);
    animation-timing-function: cubic-bezier(0.2, 0.72, 0.2, 1);
  }
  73% {
    transform: translate3d(0, 0, 0) scale(1.002);
    animation-timing-function: cubic-bezier(0.25, 0.7, 0.25, 1);
  }
  84% { transform: translate3d(var(--recoil-x), var(--recoil-y), 0) scale(0.999); }
  94%, 100% { opacity: 1; text-shadow: none; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes hero-slot-clamp {
  0%, 56% { opacity: 0; transform: scaleY(0.72); }
  64% { opacity: 0.5; transform: scaleY(1); }
  73% { opacity: 0.16; transform: scaleY(1); }
  86%, 100% { opacity: 0; transform: scaleY(1); }
}
@keyframes hero-slot-register {
  0%, 57% { opacity: 0; transform: scaleX(0); transform-origin: left; }
  65% { opacity: 0.62; transform: scaleX(1); transform-origin: left; }
  76% { opacity: 0.2; transform: scaleX(1); transform-origin: right; }
  88%, 100% { opacity: 0; transform: scaleX(0); transform-origin: right; }
}
@media (prefers-reduced-motion: reduce) {
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter,
  body.lit .hero-slot::before,
  body.lit .hero-slot::after {
    animation: none;
  }
  .enter-line.is-lettered .hero-letter,
  body.lit .enter-line.is-lettered .hero-letter {
    opacity: 1;
    transform: none;
  }
}

/* Recovery override follows the entrance lock in the cascade. */
.enter-mark.sync-recover {
  animation: hero-signal-recover 0.32s cubic-bezier(0.16, 0.72, 0.2, 1) both;
}
.enter-mark.sync-recover::after {
  animation: hero-sync-release 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@media (prefers-reduced-motion: reduce) {
  .enter-mark.sync-recover,
  .enter-mark.sync-recover::after { animation: none; }
}

/* The wordmark reads as illuminated type; CRT registration stays barely present. */
@supports (-webkit-background-clip: text) {
  .enter-line.is-lettered .hero-letter {
    background: repeating-linear-gradient(
      to bottom,
      #f8faf9 0 7px,
      #e4e9e6 7px 8px
    );
    background-size: 100% 8px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-text-stroke: 0.28px rgba(255, 255, 255, 0.48);
  }
}
body.lit .enter-line.is-lettered .hero-letter {
  filter:
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.62))
    drop-shadow(0 0 18px rgba(205, 213, 209, 0.11));
}

/* Product evidence stays readable; Howff reveals one deeper working state. */
.exhibit--rota .figure,
.exhibit--map .figure { aspect-ratio: 16 / 9; }
.figure .shot--detail,
.figure.woken .shot--detail {
  z-index: 1;
  opacity: 0;
  transform: scale(1.018);
  filter: grayscale(0.24) brightness(0.74) contrast(1.02);
  transition: opacity 0.7s var(--ease-walk), transform 1.2s var(--ease-walk), filter 0.7s var(--ease-walk);
}
.exhibit--map .figure:hover .shot--primary,
.exhibit--map .figure:focus-visible .shot--primary {
  opacity: 0.14;
  transform: scale(1.012);
}
.exhibit--map .figure:hover .shot--detail,
.exhibit--map .figure:focus-visible .shot--detail {
  opacity: 0.94;
  transform: none;
  filter: grayscale(0.08) brightness(0.9) contrast(1.01);
}

/* The masthead acquires a quiet phosphor edge as the page gains depth. */
.masthead {
  --nav-depth: 0;
  isolation: isolate;
}
.masthead::after {
  content: '';
  position: absolute;
  z-index: 0;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 7px;
  height: 1px;
  pointer-events: none;
  opacity: calc(var(--nav-depth) * 0.72);
  transform: scaleX(calc(0.38 + var(--nav-depth) * 0.62));
  transform-origin: center;
  background: linear-gradient(90deg, transparent, rgba(238, 241, 239, 0.88) 24%, #f8faf9 50%, rgba(238, 241, 239, 0.88) 76%, transparent);
  box-shadow:
    0 3px 12px rgba(238, 241, 239, 0.24),
    0 8px 28px rgba(133, 163, 147, 0.16);
  transition: opacity 0.12s linear, transform 0.12s linear;
}

/* Real Primordium footage sits beneath a live, screen-blended instrument layer. */
.primordium-film {
  position: absolute;
  z-index: 0;
  inset: 0 auto 0 0;
  width: 100vw;
  max-width: none;
  overflow: hidden;
  pointer-events: none;
  background: #000;
}
.primordium-film::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.64) 0%, rgba(0, 0, 0, 0.28) 36%, transparent 62%);
}
.primordium-film__clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.02);
  transform-origin: center;
  filter: saturate(1.16) brightness(0.86) contrast(1.04);
  will-change: opacity, transform;
}
.primordium-film__clip--a { opacity: 0.82; }
.vast-canvas--primordium {
  z-index: 1;
  mix-blend-mode: screen;
}
.vast-canvas--orrery { z-index: 1; }
.vast-scrim { z-index: 2; }
.experiment-copy { z-index: 3; }
.scale-readout { z-index: 4; }

@media (max-width: 860px) {
  .primordium-film__clip {
    object-position: center;
    filter: saturate(1.08) brightness(0.8) contrast(1.04);
  }
  .primordium-film::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.1) 72%, transparent 100%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .masthead::after { transition: none; }
  .primordium-film { display: none; }
  body.lit .enter-line.is-lettered .hero-letter {
    filter: drop-shadow(0 0 14px rgba(205, 213, 209, 0.1));
  }
}

/* keyboard focus mirrors hover where it was missing */
.index a:focus-visible,
.wordmark:focus-visible,
.project-link:focus-visible,
.enter-cue:focus-visible,
.scale-rail button:focus-visible,
.index-toggle:focus-visible,
.cord-toggle:focus-visible {
  outline: 1px solid rgba(169, 140, 95, 0.7);
  outline-offset: 4px;
}

/* ---------- the badger: humbug stripes in the dark ---------- */

.hero-badger {
  position: absolute;
  z-index: -1;
  right: 6vw;
  top: 43%;
  width: clamp(300px, 30vw, 470px);
  height: auto;
  /* feet on the horizon line, walking toward the wordmark (scaleX flips it) */
  transform: translateY(calc(-97% + var(--hero-exit) * -22px)) scaleX(-1);
  opacity: calc(1 - var(--hero-exit) * 1.25);
  pointer-events: none;
}
.hero-badger .ink {
  opacity: 0;
  filter: blur(9px);
  transition: opacity 3s var(--ease-walk) 1.2s, filter 3s var(--ease-walk) 1.2s;
}
body.lit .hero-badger .ink {
  opacity: 1;
  filter: blur(0);
}
body.after-hours .hero-badger {
  filter: brightness(0.12);
  transition: filter 2s var(--ease-walk);
}
@media (max-width: 860px) {
  .hero-badger {
    right: 6vw;
    top: 37%;
    width: clamp(180px, 46vw, 280px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero-badger .ink { opacity: 1; filter: none; transition: none; }
}

/* ---------- hero composition: Rab's lab values (1920x911, 2026-07-19) ---------- */

.enter-block   { position: relative; z-index: 2; width: max-content; max-width: 92vw; translate: 15.8vw 8.8vh; }
.enter-cue     { translate: -10.3vw -25.6vh; }
.hero-horizon  { translate: -6.1vw 13.2vh; }
.hero-badger   { translate: -9.2vw -1.9vh; }
/* subtitle centres on the wordmark block at every size */
.enter-sub     { width: 100%; text-align: center; margin-top: 18px; translate: none; }
@media (max-width: 860px) {
  .enter-block, .enter-cue, .hero-horizon, .hero-badger { translate: none; }
  .enter-sub { margin-top: 22px; margin-left: 0; }
}

/* ---------- badger glitch: same burst, same raster fault ---------- */

.badger-tear { opacity: 0; pointer-events: none; }
/* the shared .glitch base-jitter would clobber the badger's layout transform */
.hero-badger.glitch-on { animation: none; }
.hero-badger.glitch-on .ink { animation: badger-jitter 0.8s step-end 1; }
.hero-badger.glitch-on .badger-tear--warm { animation: badger-tear-warm 0.8s step-end 1 both; }
.hero-badger.glitch-on .badger-tear--cold { animation: badger-tear-cold 0.8s step-end 1 both; }
@keyframes badger-jitter {
  0%   { transform: translate(2px, 0); filter: brightness(1.5); }
  8%   { transform: translate(-2px, 0); }
  16%  { transform: translate(1px, 0); filter: brightness(1.25); }
  30%  { transform: none; filter: none; }
  52%  { transform: translate(-2px, 0); filter: brightness(1.4); }
  64%  { transform: translate(2px, 0); }
  76%, 100% { transform: none; filter: none; }
}
@keyframes badger-tear-warm {
  0%   { opacity: 0.6; transform: translate(-8px, 0);  clip-path: inset(18% 0 74% 0); }
  6%   { opacity: 0.6; transform: translate(10px, 1px); clip-path: inset(52% 0 40% 0); }
  12%  { opacity: 0.5; transform: translate(-14px, 0);  clip-path: inset(70% 0 22% 0); }
  18%  { opacity: 0.6; transform: translate(6px, -1px); clip-path: inset(30% 0 62% 0); }
  26%  { opacity: 0; }
  52%  { opacity: 0.5; transform: translate(-10px, 0);  clip-path: inset(44% 0 48% 0); }
  60%  { opacity: 0.6; transform: translate(12px, 0);   clip-path: inset(8% 0 84% 0); }
  68%, 100% { opacity: 0; }
}
@keyframes badger-tear-cold {
  0%   { opacity: 0.6; transform: translate(9px, 0);    clip-path: inset(64% 0 28% 0); }
  6%   { opacity: 0.6; transform: translate(-12px, -1px); clip-path: inset(12% 0 80% 0); }
  12%  { opacity: 0.5; transform: translate(7px, 0);    clip-path: inset(38% 0 54% 0); }
  18%  { opacity: 0.6; transform: translate(-6px, 1px); clip-path: inset(78% 0 14% 0); }
  26%  { opacity: 0; }
  52%  { opacity: 0.5; transform: translate(11px, 0);   clip-path: inset(24% 0 68% 0); }
  60%  { opacity: 0.6; transform: translate(-9px, 0);   clip-path: inset(56% 0 36% 0); }
  68%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-badger.glitch-on .ink,
  .hero-badger.glitch-on .badger-tear--warm,
  .hero-badger.glitch-on .badger-tear--cold { animation: none; }
}
