/* ═══════════════════════════════════════════════════════════════
   CHARBEL TOUMIEH — PORTFOLIO, MMXXVI
   A gallery on putty paper. Serif for moments, grotesk for systems.
   No frameworks. No gradients. No shadows. Hairlines only.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --putty:    #c4c3b6;
  --ink:      #000000;
  --near-ink: #0c0c0b;
  --bone:     #e7e5e4;
  --chalk:    #ebebeb;
  --vellum:   #dfdcd5;
  --graphite: #595855;
  --ash:      #808080;
  --paper:    #ffffff;

  /* Hairlines */
  --line-on-light: rgba(0, 0, 0, 0.16);
  --line-on-light-soft: rgba(0, 0, 0, 0.09);
  --line-on-dark: rgba(255, 255, 255, 0.18);
  --line-on-dark-soft: rgba(255, 255, 255, 0.10);

  /* Type */
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --grotesk: "Inter", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;

  /* Shape */
  --r-card: 9px;
  --r-pill: 28.8px;
  --r-link: 2px;

  /* Rhythm */
  --gutter: clamp(20px, 4.5vw, 68px);
  --room-pad: clamp(96px, 12vw, 176px);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.76, 0, 0.24, 1);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: var(--putty);
  color: var(--ink);
  font-family: var(--grotesk);
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

section[id] { scroll-margin-top: 56px; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; border-radius: var(--r-link); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; border-radius: var(--r-link); }
ul, ol { list-style: none; }
em { font-style: italic; }

::selection { background: var(--ink); color: var(--putty); }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

@media (pointer: fine) {
  ::-webkit-scrollbar { width: 10px; }
  ::-webkit-scrollbar-track { background: var(--putty); }
  ::-webkit-scrollbar-thumb { background: var(--graphite); border: 3px solid var(--putty); border-radius: 8px; }
}

.skip-link {
  position: fixed; top: -100%; left: var(--gutter); z-index: 300;
  background: var(--ink); color: var(--paper);
  padding: 9px 17px; border-radius: var(--r-pill);
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  transition: top 0.3s var(--ease);
}
.skip-link:focus { top: 14px; }

/* ── Shared vocabulary ─────────────────────────────────────── */
.wall-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--graphite);
}

.hex { width: 13px; height: 15px; flex: none; }
.hex path { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.hex--paper path { stroke: var(--paper); }

.mark-text {
  font-family: var(--serif);
  font-size: 26px;
  fill: currentColor;
  letter-spacing: 0.01em;
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ink); color: var(--paper);
  font-size: 12px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 11px 20px; border-radius: var(--r-pill);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), transform 0.35s var(--ease);
  will-change: transform;
}
.pill:hover { background: var(--graphite); }
.pill--paper { background: var(--paper); color: var(--ink); }
.pill--paper:hover { background: var(--vellum); }

.ghost-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); padding: 11px 2px;
}
.ghost-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 7px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.ghost-link:hover::after { transform: scaleX(1); transform-origin: left; }
.ghost-link--paper { color: var(--paper); }

/* ── Curtain ───────────────────────────────────────────────── */
.curtain {
  position: fixed; inset: 0; z-index: 200;
  background: var(--putty);
  display: grid; place-items: center;
  transition: transform 1s var(--ease-expo) 0.25s, visibility 0s linear 1.3s;
}
.curtain-inner { display: grid; justify-items: center; gap: 20px; color: var(--ink); }
.curtain-mark { animation: curtain-pulse 2.2s var(--ease) infinite; }
.curtain-label {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--graphite);
}
@keyframes curtain-pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.35; }
}
body.is-loaded .curtain { transform: translateY(-100.5%); visibility: hidden; }
body.curtain-skip .curtain { display: none; }
html:not(.js) .curtain { display: none; }

/* ── Cursor ────────────────────────────────────────────────── */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 250;
  width: 34px; height: 34px;
  border: 1px solid var(--paper); border-radius: 50%;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.4s ease, width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease);
}
body.cursor-on .cursor { opacity: 1; }
body.cursor-on .cursor.is-active {
  width: 56px; height: 56px; margin: -28px 0 0 -28px;
  background: rgba(255, 255, 255, 0.18);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ── Reading progress hairline ─────────────────────────────── */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 170;
  height: 2px;
  background: var(--paper);
  mix-blend-mode: difference;
  transform: scaleX(0); transform-origin: left;
  pointer-events: none;
}

/* ── Header ────────────────────────────────────────────────── */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  color: var(--ink);
  transition: color 0.45s var(--ease), background-color 0.45s var(--ease);
}
.site-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; opacity: 0;
  transition: opacity 0.45s var(--ease);
}
.site-head.is-scrolled { background: var(--putty); }
.site-head.is-scrolled::after { opacity: 0.14; }
.site-head.is-dark { color: var(--paper); }
.site-head.is-dark.is-scrolled { background: var(--ink); }

.head-brand { display: inline-flex; align-items: center; gap: 12px; }
.head-mark { display: block; }
.head-name {
  font-family: var(--serif);
  font-size: 19px; letter-spacing: 0.01em; white-space: nowrap;
}
.head-right { display: flex; align-items: center; gap: clamp(16px, 3vw, 36px); }
.head-clock {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.head-link {
  position: relative;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 0;
}
.head-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.head-link:hover::after { transform: scaleX(1); transform-origin: left; }

.head-menu-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 0;
}
.menu-word::before { content: attr(data-open); }
body.veil-open .menu-word::before { content: attr(data-close); }
.menu-lines { display: grid; gap: 5px; width: 22px; }
.menu-lines i {
  display: block; height: 1.5px; background: currentColor;
  transition: transform 0.45s var(--ease);
}
body.veil-open .menu-lines i:first-child { transform: translateY(3.25px) rotate(45deg); }
body.veil-open .menu-lines i:last-child { transform: translateY(-3.25px) rotate(-45deg); }
body.veil-open .site-head { color: var(--paper); background: transparent; }
body.veil-open .site-head::after { opacity: 0; }

/* ── Index veil ────────────────────────────────────────────── */
.veil {
  position: fixed; inset: 0; z-index: 140;
  background: var(--ink); color: var(--paper);
  transform: translateY(-100%);
  transition: transform 0.7s var(--ease-expo), visibility 0s linear 0.7s;
  visibility: hidden;
  overflow-y: auto;
}
body.veil-open .veil { transform: translateY(0); visibility: visible; transition-delay: 0s; }
body.veil-open { overflow: hidden; }

.veil-inner {
  min-height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 110px var(--gutter) 48px;
}
.veil-label {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ash);
  margin-bottom: clamp(20px, 4vh, 44px);
}
.veil-list { display: grid; }
.veil-link {
  display: flex; align-items: baseline; gap: clamp(14px, 2.5vw, 30px);
  padding: clamp(6px, 1.4vh, 14px) 0;
  border-bottom: 1px solid var(--line-on-dark-soft);
  overflow: hidden;
}
.veil-link sup {
  font-family: var(--serif); font-style: italic; font-size: clamp(15px, 2vw, 22px);
  color: var(--ash); min-width: 2ch;
}
.veil-link span:last-child {
  font-family: var(--serif);
  font-size: clamp(40px, 7.2vh, 78px);
  line-height: 1;
  letter-spacing: -0.01em;
  transition: transform 0.5s var(--ease), color 0.5s var(--ease);
}
.veil-link:hover span:last-child { transform: translateX(14px); color: var(--vellum); }
body.veil-open .veil-link > * {
  animation: veil-rise 0.7s var(--ease) both;
  animation-delay: calc(0.12s + var(--i, 0) * 0.055s);
}
@keyframes veil-rise {
  from { transform: translateY(110%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.veil-list li:nth-child(1) .veil-link > * { --i: 0; }
.veil-list li:nth-child(2) .veil-link > * { --i: 1; }
.veil-list li:nth-child(3) .veil-link > * { --i: 2; }
.veil-list li:nth-child(4) .veil-link > * { --i: 3; }
.veil-list li:nth-child(5) .veil-link > * { --i: 4; }
.veil-list li:nth-child(6) .veil-link > * { --i: 5; }
.veil-foot {
  display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 44px);
  margin-top: clamp(28px, 6vh, 60px);
}
.veil-foot a {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ash);
  transition: color 0.3s ease;
}
.veil-foot a:hover { color: var(--paper); }

/* ── Rooms (shared) ────────────────────────────────────────── */
.room { position: relative; padding: var(--room-pad) var(--gutter); }
.room--light { background: var(--putty); color: var(--ink); }
.room--dark { background: var(--ink); color: var(--paper); }

.room-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 16px;
  margin-bottom: clamp(52px, 8vw, 110px);
}
.room-no, .room-hint {
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--graphite);
  padding-bottom: 10px;
}
.room-hint { text-align: right; }
.room-head--dark .room-no, .room-head--dark .room-hint { color: var(--ash); }
.room-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(52px, 9.2vw, 128px);
  line-height: 0.84;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-align: center;
  text-wrap: balance;
}
.rt-mask { display: block; overflow: hidden; padding: 0.08em 0.05em 0.02em; }
.rt-mask > span { display: block; }
html.js .rt-mask > span {
  transform: translateY(115%);
  transition: transform 1s var(--ease);
}
html.js .is-in .rt-mask > span { transform: translateY(0); }

/* ── Reveal system ─────────────────────────────────────────────
   Animation-based (not transitions) so reveal timing never
   interferes with hover transitions on the same elements. */
html.js [data-reveal] { opacity: 0; }
html.js [data-reveal].is-in {
  opacity: 1;
  animation: reveal-rise 0.85s var(--ease) var(--d, 0s) backwards;
}
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}
html.js .room-title.is-in { animation-name: reveal-fade; }
@keyframes reveal-fade {
  from { opacity: 0; } to { opacity: 1; }
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column;
  padding-top: clamp(104px, 13vh, 152px);
  padding-bottom: 0;
  overflow: hidden;
}
.hero-top {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(16px, 2.6vh, 26px);
  margin-bottom: auto;
}
.hero-top > * { max-width: 100%; }
.hero-line {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(32px, 3.8vw, 56px);
  line-height: 1;
  letter-spacing: -0.009em;
  text-transform: uppercase;
  display: flex; flex-wrap: wrap; justify-content: center;
  column-gap: 0.28em;
  max-width: 24ch;
}
.hl-em { text-transform: none; padding-right: 0.04em; }
.hero-stats {
  display: flex; align-items: center; flex-wrap: wrap; justify-content: center;
  gap: clamp(16px, 2.6vw, 32px);
}
.stat { display: grid; justify-items: center; gap: 4px; }
.stat b {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 3vw, 43px); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat i {
  font-style: normal; font-size: 10px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--graphite);
}
.stat-sep { width: 1px; height: 34px; background: var(--line-on-light); }
.hero-cta { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); flex-wrap: wrap; justify-content: center; }

.wordmark-wrap {
  overflow: hidden;
  margin: clamp(20px, 3.4vh, 40px) calc(var(--gutter) * -1) 0;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(64px, 18.5vw, 300px);
  line-height: 0.8;
  transform: translateY(calc(var(--wm-shift, 0) * 1px));
  padding-top: 0.04em;
  user-select: none;
}
.wm-line {
  display: flex; justify-content: space-between;
  overflow: hidden;
  padding: 0 2.5vw;
}
.wm-l {
  display: inline-block;
  transition: transform 0.4s var(--ease);
}
html.js .wm-l { transform: translateY(112%); }
html.js body.is-loaded .wm-l {
  transform: none;
  animation: wm-rise 1.1s var(--ease) calc((var(--l, 0) + var(--lo, 0)) * 0.045s + 0.4s) backwards;
}
@keyframes wm-rise {
  from { transform: translateY(112%); }
  to { transform: translateY(0); }
}
.wm-l:nth-child(1) { --l: 0; } .wm-l:nth-child(2) { --l: 1; }
.wm-l:nth-child(3) { --l: 2; } .wm-l:nth-child(4) { --l: 3; }
.wm-l:nth-child(5) { --l: 4; } .wm-l:nth-child(6) { --l: 5; }
.wm-l:nth-child(7) { --l: 6; }
.wm-line:nth-child(2) .wm-l { --lo: 7; }
body.is-loaded .wm-l:hover { transform: translateY(-2.5%); }

.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--line-on-light);
  margin: 0 calc(var(--gutter) * -1);
  padding: 14px var(--gutter);
}
.hero-scroll {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
}
.hero-scroll svg { animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.hero-est {
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--graphite); text-align: right;
}

/* ── Marquee ───────────────────────────────────────────────── */
.marquee {
  background: var(--putty);
  border-bottom: 1px solid var(--line-on-light);
  overflow: hidden;
  padding: 16px 0;
}
.marquee-track {
  display: inline-flex; align-items: baseline; gap: 28px;
  white-space: nowrap;
  animation: marquee 36s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span { font-family: var(--serif); font-size: 24px; line-height: 1; }
.marquee-track i { font-style: normal; color: var(--graphite); font-size: 18px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ── Room I — Engineer ─────────────────────────────────────── */
.engineer-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(260px, 4fr);
  gap: clamp(40px, 7vw, 110px);
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
}
.lede {
  font-family: var(--serif);
  font-size: clamp(26px, 2.9vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin-bottom: clamp(24px, 3vw, 40px);
  max-width: 24ch;
}
.body-copy {
  color: var(--graphite);
  max-width: 58ch;
  margin-bottom: 18px;
}
.body-copy strong { color: var(--ink); font-weight: 500; }
.engineer-facts {
  margin-top: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line-on-light);
}
.engineer-facts li {
  display: grid; grid-template-columns: 130px 1fr; gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-on-light-soft);
}
.fact-k {
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--graphite);
  padding-top: 2px;
}
.fact-v { font-size: 15px; }

.engineer-portrait { justify-self: end; width: min(100%, 360px); }
.portrait-arch {
  border-radius: 999px 999px var(--r-card) var(--r-card);
  overflow: hidden;
  border: 1px solid var(--line-on-light);
  padding: 10px;
  background: var(--bone);
}
.portrait-arch img {
  width: 100%; aspect-ratio: 9 / 10.4; object-fit: cover;
  border-radius: 999px 999px calc(var(--r-card) - 3px) calc(var(--r-card) - 3px);
  filter: grayscale(1) contrast(1.04) brightness(1.01);
  transition: filter 0.7s var(--ease);
}
.portrait-arch:hover img { filter: grayscale(0) contrast(1) brightness(1); }
.portrait-caption {
  display: flex; gap: 14px; align-items: baseline;
  margin-top: 14px;
  font-size: 12px; color: var(--graphite);
}
.fig-no {
  font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink);
  flex: none;
}

/* ── Interlude ─────────────────────────────────────────────── */
.interlude {
  min-height: 92vh;
  display: grid; place-items: center;
  overflow: hidden;
}
.engraving {
  position: absolute; top: 50%; left: 50%;
  width: min(115vmin, 860px); height: auto;
  translate: -50% -50%;
  transform: translateY(calc(var(--eng-shift, 0) * 1px));
  color: rgba(255, 255, 255, 0.5);
}
.engraving-rays {
  transform-box: view-box; transform-origin: 50% 50%;
  animation: slow-spin 140s linear infinite;
}
@keyframes slow-spin { to { transform: rotate(360deg); } }

.notch-card {
  position: relative;
  background: rgba(255, 255, 255, 0.32);
  clip-path: polygon(26px 0, calc(100% - 26px) 0, 100% 26px, 100% calc(100% - 26px), calc(100% - 26px) 100%, 26px 100%, 0 calc(100% - 26px), 0 26px);
  max-width: min(600px, calc(100vw - 2 * var(--gutter)));
  display: grid; gap: 18px;
  padding: clamp(36px, 6vw, 64px) clamp(28px, 5vw, 56px) clamp(52px, 7vw, 72px);
}
.notch-card::before {
  content: ""; position: absolute; inset: 1px;
  background: var(--ink);
  clip-path: polygon(25px 0, calc(100% - 25px) 0, 100% 25px, 100% calc(100% - 25px), calc(100% - 25px) 100%, 25px 100%, 0 calc(100% - 25px), 0 25px);
}
.notch-card > * { position: relative; }
.notch-label {
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ash);
}
.notch-line {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.22;
}
.notch-line--sub { font-size: clamp(16px, 2vw, 20px); color: var(--vellum); }
.notch-micro {
  position: absolute; bottom: 16px; left: 24px;
  font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ash);
}
.notch-micro--r { left: auto; right: 24px; }

/* ── Room II — Provenance ──────────────────────────────────── */
.provenance { padding-bottom: calc(var(--room-pad) * 0.8); }
.prov-list {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
}
.prov-rail {
  position: absolute; top: 0; bottom: 0; left: 0; width: 1px;
  background: var(--line-on-light);
}
.prov-rail i {
  position: absolute; inset: 0;
  background: var(--ink);
  transform-origin: top;
  transform: scaleY(var(--prov, 0));
}
.prov-item {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(36px, 5vw, 60px) 0 clamp(36px, 5vw, 60px) clamp(24px, 3vw, 48px);
  border-top: 1px solid var(--line-on-light-soft);
}
.prov-item:first-of-type { border-top: 0; }
.prov-meta {
  position: sticky; top: 110px;
  align-self: start;
  display: grid; gap: 8px;
}
.prov-ord {
  font-family: var(--serif); font-style: italic;
  font-size: 34px; line-height: 1; color: var(--ink);
  margin-bottom: 6px;
}
.prov-dates {
  font-size: 12px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
}
.prov-loc { font-size: 12px; color: var(--graphite); letter-spacing: 0.06em; text-transform: uppercase; }
.prov-role {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.2vw, 43px);
  line-height: 1.02; letter-spacing: -0.005em;
}
.prov-house {
  font-size: 12px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--graphite);
  margin: 10px 0 22px;
}
.prov-notes { display: grid; gap: 12px; max-width: 68ch; }
.prov-notes li {
  position: relative;
  padding-left: 22px;
  color: var(--graphite);
}
.prov-notes li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 10px; height: 1px; background: var(--ink);
}
.prov-notes b { color: var(--ink); font-weight: 500; }
.prov-tags {
  margin-top: 22px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ash);
}

/* ── Room III — Materials (ink) ────────────────────────────── */
.vignettes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px);
  max-width: 1080px;
  margin: 0 auto clamp(64px, 9vw, 130px);
}
.vignette { display: grid; justify-items: center; gap: 22px; }
.vig-caption {
  font-family: var(--serif); font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1.15; text-align: center;
}
.vig-circle {
  width: clamp(150px, 16vw, 208px); height: clamp(150px, 16vw, 208px);
  border-radius: 50%;
  border: 1px solid var(--line-on-dark);
  display: grid; place-items: center;
  color: rgba(255, 255, 255, 0.85);
  transition: border-color 0.5s var(--ease);
}
.vignette:hover .vig-circle { border-color: rgba(255, 255, 255, 0.55); }
.vig-circle svg { width: 78%; height: 78%; }
.vig-circle circle[stroke-dasharray] {
  transform-box: fill-box; transform-origin: center;
  animation: slow-spin 60s linear infinite;
}

.materials-list {
  max-width: 1240px;
  margin: 0 auto;
  border-top: 1px solid var(--line-on-dark);
}
.mat-row {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(20px, 2.6vw, 30px) 0;
  border-bottom: 1px solid var(--line-on-dark-soft);
}
.mat-k {
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ash);
  padding-top: 8px;
}
.mat-v {
  font-family: var(--serif);
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1.35;
  letter-spacing: 0.002em;
}
.mat-v i { font-style: normal; color: var(--graphite); padding: 0 0.45em; }
.mat-v em { color: var(--vellum); }

/* ── Room IV — Works ───────────────────────────────────────── */
.plates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
  max-width: 1360px;
  margin: 0 auto clamp(80px, 10vw, 150px);
}
.plate {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bone);
  border: 1px solid var(--vellum);
  border-radius: var(--r-card);
  padding: clamp(22px, 2.6vw, 34px);
  min-height: 340px;
  overflow: hidden;
  transition: border-color 0.5s var(--ease), background-color 0.5s var(--ease);
}
.plate:hover { border-color: var(--ink); background: var(--chalk); }
.plate--wide { grid-column: span 2; }
.plate-ghost {
  position: absolute; right: 8px; bottom: -0.15em;
  font-family: var(--serif);
  font-size: clamp(130px, 14vw, 210px);
  line-height: 1;
  color: var(--vellum);
  pointer-events: none;
  transition: color 0.5s var(--ease), transform 0.7s var(--ease);
}
.plate:hover .plate-ghost { color: #cfccc2; transform: translateY(-6px); }
.plate-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.plate-top .hex path {
  transition: transform 0.6s var(--ease);
  transform-box: view-box; transform-origin: 50% 50%;
}
.plate:hover .plate-top .hex path { transform: rotate(90deg); }
.plate-no {
  font-size: 10px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--graphite);
}
.plate-title {
  position: relative;
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 0.95; letter-spacing: -0.005em;
}
.plate-sub {
  position: relative;
  font-family: var(--serif); font-style: italic;
  font-size: clamp(16px, 1.6vw, 21px);
  color: var(--graphite);
  margin: 8px 0 16px;
}
.plate-desc {
  position: relative;
  color: var(--graphite);
  font-size: 14px;
  max-width: 56ch;
  margin-bottom: 28px;
}
.plate--wide .plate-desc { max-width: 72ch; }
.plate-foot {
  position: relative;
  margin-top: auto;
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.plate-medium {
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ash);
}
.plate-link {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex; gap: 6px;
}
.plate-link b { font-weight: 500; transition: transform 0.4s var(--ease); }
.plate:hover .plate-link b { transform: translate(3px, -3px); }

/* Catalogue */
.catalogue { max-width: 1360px; margin: 0 auto; }
.cat-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.cat-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 46px);
  letter-spacing: -0.005em;
}
.cat-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 7px 14px;
  border: 1px solid var(--line-on-light);
  border-radius: var(--r-pill);
  color: var(--graphite);
  transition: color 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.cat-list { border-top: 1px solid var(--line-on-light); }
.cat-row { border-bottom: 1px solid var(--line-on-light-soft); }
.cat-row.is-hidden { display: none; }
.cat-row a {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1fr) 92px 28px;
  align-items: baseline;
  gap: 18px;
  padding: 18px 6px;
  transition: background-color 0.35s var(--ease), padding 0.35s var(--ease);
}
.cat-row a:hover { background: var(--bone); padding-left: 16px; padding-right: 0; }
.cat-no { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--graphite); }
.cat-name { font-family: var(--serif); font-size: clamp(20px, 2vw, 27px); line-height: 1.1; letter-spacing: -0.003em; }
.cat-medium { font-size: 12px; color: var(--graphite); letter-spacing: 0.02em; }
.cat-tag {
  font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ash); text-align: right;
}
.cat-arrow { justify-self: end; transition: transform 0.35s var(--ease); }
.cat-row a:hover .cat-arrow { transform: translate(3px, -3px); }
.cat-empty { padding: 28px 6px; color: var(--graphite); font-style: italic; font-family: var(--serif); font-size: 20px; }

/* ── Room V — Formation ────────────────────────────────────── */
.formation { padding-top: calc(var(--room-pad) * 0.75); }
.edu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
  max-width: 1240px;
  margin: 0 auto clamp(56px, 8vw, 110px);
}
.edu-card {
  background: var(--bone);
  border: 1px solid var(--vellum);
  border-radius: var(--r-card);
  padding: clamp(24px, 3vw, 40px);
  display: grid; gap: 10px; align-content: start;
  transition: border-color 0.5s var(--ease);
}
.edu-card:hover { border-color: var(--ink); }
.edu-badge {
  justify-self: start;
  font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  border: 1px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  margin-bottom: 14px;
}
.edu-badge--muted { border-color: var(--line-on-light); color: var(--graphite); }
.edu-degree {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.05; letter-spacing: -0.004em;
}
.edu-school { font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--graphite); }
.edu-meta {
  font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ash); margin-top: 8px;
}

.leadership { max-width: 1240px; margin: 0 auto; }
.leadership .wall-label { display: block; margin-bottom: 18px; }
.lead-list { border-top: 1px solid var(--line-on-light); }
.lead-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 18px; align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-on-light-soft);
}
.lead-name { font-family: var(--serif); font-size: 24px; }
.lead-desc { color: var(--graphite); font-size: 14px; }
.lead-date {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  color: var(--graphite); font-variant-numeric: tabular-nums;
}

/* ── Room VI — Inquiries (ink) ─────────────────────────────── */
.inquiries { min-height: 92vh; display: flex; flex-direction: column; }
.inquiries .room-head { margin-bottom: clamp(40px, 6vw, 80px); }
.inq-body {
  margin: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: clamp(22px, 3.4vh, 38px);
  width: 100%;
}
.inq-body > * { max-width: 100%; }
.inq-lede {
  font-family: var(--serif);
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.25;
  color: var(--vellum);
}
.inq-lede em { color: var(--paper); }
.inq-mail { display: block; max-width: 100%; padding: 0.1em 0.2em; }
.inq-mail-text {
  position: relative;
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(26px, 5.6vw, 82px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  word-break: break-all;
  border-bottom: 1px solid var(--line-on-dark);
  padding-bottom: 0.06em;
}
.inq-mail-text .digit {
  font-family: var(--grotesk);
  font-size: 0.8em;
  letter-spacing: 0;
}
.inq-mail-text::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.02em;
  height: 2px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.6s var(--ease);
}
.inq-mail:hover .inq-mail-text::after { transform: scaleX(1); transform-origin: left; }
.inq-actions { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 28px); flex-wrap: wrap; justify-content: center; }
.inq-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  font-size: 11px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ash);
}
.inq-links { display: flex; gap: clamp(20px, 4vw, 44px); flex-wrap: wrap; justify-content: center; }
.inq-links a {
  position: relative;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--vellum);
  padding: 4px 0;
  transition: color 0.3s ease;
}
.inq-links a:hover { color: var(--paper); }
.inq-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.4s var(--ease);
}
.inq-links a:hover::after { transform: scaleX(1); transform-origin: left; }

/* ── Colophon ──────────────────────────────────────────────── */
.colophon {
  background: var(--chalk);
  padding: clamp(48px, 7vw, 90px) var(--gutter) 28px;
}
.colo-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
  padding-bottom: clamp(36px, 5vw, 64px);
  border-bottom: 1px solid var(--line-on-light-soft);
}
.colo-brand { display: flex; gap: 18px; align-items: flex-start; }
.colo-brand p { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.colo-brand span { font-family: var(--grotesk); font-size: 12px; color: var(--graphite); }
.colo-nav { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 36px; }
.colo-nav a {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--graphite);
  transition: color 0.3s ease;
  justify-self: start;
}
.colo-nav a:hover { color: var(--ink); }
.colo-hexes { display: flex; gap: 10px; padding-top: 6px; }
.colo-bottom {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 22px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite);
}
.colo-set a { text-decoration: underline; text-underline-offset: 3px; }
.colo-set a:hover { color: var(--ink); }

/* ── Performance: defer offscreen rendering ────────────────── */
.provenance, .materials, .works, .formation, .inquiries, .colophon {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .prov-item { grid-template-columns: 200px minmax(0, 1fr); }
  .plate--wide { grid-column: span 1; }
  .plates { grid-template-columns: 1fr; max-width: 720px; }
  .engineer-grid { grid-template-columns: 1fr; }
  .engineer-portrait { justify-self: center; order: -1; }
  .colo-top { grid-template-columns: 1fr auto; }
  .colo-hexes { display: none; }
}

@media (max-width: 768px) {
  .head-clock { display: none; }
  .head-name { display: none; }
  .head-link { display: none; }
  .room-head { grid-template-columns: 1fr 1fr; }
  .room-title {
    grid-column: 1 / -1; grid-row: 2;
    white-space: normal; text-align: left;
    font-size: clamp(48px, 13.5vw, 84px);
  }
  .room-hint { text-align: right; }
  .prov-item { grid-template-columns: 1fr; gap: 18px; padding-left: 20px; }
  .prov-meta { position: static; grid-template-columns: 1fr; gap: 4px; }
  .prov-ord { margin-bottom: 2px; }
  .mat-row { grid-template-columns: 1fr; gap: 10px; }
  .mat-k { padding-top: 0; }
  .vignettes { grid-template-columns: 1fr; gap: 44px; }
  .edu-grid { grid-template-columns: 1fr; }
  .cat-row a { grid-template-columns: 40px minmax(0, 1fr) 24px; row-gap: 4px; }
  .cat-medium { grid-column: 2; grid-row: 2; }
  .cat-tag { display: none; }
  .cat-arrow { grid-row: 1; }
  .lead-row { grid-template-columns: 1fr; gap: 4px; }
  .lead-date { color: var(--ash); }
  .hero-est { display: none; }
  .hero-foot { justify-content: space-between; }
  .colo-top { grid-template-columns: 1fr; gap: 32px; }
  .colo-brand { flex-direction: column; gap: 14px; }
  .wordmark { font-size: 22vw; }
}

@media (max-width: 520px) {
  .hero-line { font-size: clamp(32px, 10vw, 44px); }
  .stat b { font-size: 27px; }
  .hero-stats { gap: 12px 20px; }
  .stat-sep { display: none; }
  .stat i { font-size: 9px; letter-spacing: 0.12em; }
  .marquee-track span { font-size: 19px; }
  .veil-link span:last-child { font-size: clamp(34px, 9.4vw, 48px); }
  .notch-card { gap: 14px; }
  .inq-mail-text { font-size: clamp(22px, 7.4vw, 40px); }
}

/* ── Debug flat mode (?flat) — static render for visual QA ──── */
html.debug-flat .curtain { display: none; }
html.debug-flat [data-reveal], html.debug-flat .rt-mask > span, html.debug-flat .wm-l {
  opacity: 1 !important; transform: none !important; animation: none !important;
}
html.debug-flat .hero, html.debug-flat .interlude, html.debug-flat .inquiries { min-height: 0; }
html.debug-flat .provenance, html.debug-flat .materials, html.debug-flat .works,
html.debug-flat .formation, html.debug-flat .inquiries, html.debug-flat .colophon {
  content-visibility: visible;
}

/* ── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  html.js [data-reveal], html.js .rt-mask > span, html.js .wm-l {
    opacity: 1 !important; transform: none !important; animation: none !important;
  }
  .curtain { display: none; }
  .marquee-track { animation: none; }
  .cursor { display: none; }
  .prov-rail i { transform: scaleY(1); }
}
