/* The Room — a wall of reliefs. Visual contract modeled on halfthesky.app. */

/* Layout: a paper wall (WebGL paper texture under everything), a 4-up grid of reliefs,
   a fixed right-hand panel that reads like a museum label. */
:root {
  --paper: #f3f1ec;          /* the original white: bright paper with a fine fibre */
  --paper-deep: #e9e6df;
  --plaque: #fbfaf7;
  --ink: #3b3733;
  --ink-2: #56514b;
  --muted: #8d8780;
  --faint: #b6b0a7;
  --rule: rgba(70, 58, 44, 0.08);
  --rule-strong: #d2ccc2;
  --accent: #a9634c;
  --glow: rgba(248, 240, 220, 0.95);
  --veil: rgba(244, 242, 237, 0.94);
  --shadow-ink: #5a4d3c;
  --relief-shadow: drop-shadow(0 22px 26px rgba(92, 76, 54, 0.20)) drop-shadow(0 5px 7px rgba(92, 76, 54, 0.12));
  --relief-shadow-lift: drop-shadow(0 30px 34px rgba(92, 76, 54, 0.24)) drop-shadow(0 7px 9px rgba(92, 76, 54, 0.12));
  --relief-shadow-stage: drop-shadow(0 34px 42px rgba(92, 76, 54, 0.26)) drop-shadow(0 8px 12px rgba(92, 76, 54, 0.12));
  color-scheme: light;
  --header-h: 72px;
  --panel-w: 480px;
  --display: "Cormorant Garamond", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --body: "EB Garamond", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  background: var(--paper);
  color: var(--ink);
  padding-left: max(0px, env(safe-area-inset-left, 0px));
  padding-right: max(0px, env(safe-area-inset-right, 0px));
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* The paper itself: a static WebGL paper texture (vendor/paper-texture.js) under everything.
   If WebGL is missing the body colour and a faint CSS grain stand in. */
.paper {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 252, 245, 0.55), rgba(255, 252, 245, 0) 60%),
    var(--paper);
}
.paper canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.top, .room, .panel { position: relative; z-index: 1; }

.noscript { text-align: center; padding: 40px; font: 400 18px/1.5 var(--body); color: var(--muted); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  background: transparent;
  border-bottom: 1px solid var(--rule);
}
.top-inner {
  max-width: 1040px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.wordmark {
  font: 500 15px/1 var(--display);
  letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--ink-2);
}
.nav { display: flex; align-items: center; gap: 34px; }
.nav-btn {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 9px;
  font: 500 12px/1 var(--display);
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ink-2);
  transition: color 0.25s;
}
.nav-btn:hover { color: var(--ink); }
.nav-btn .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.lang { position: relative; }
.lang-btn { gap: 9px; letter-spacing: 0.22em; }
.lang-btn .chev { width: 11px; height: 11px; opacity: 0.6; transition: transform 0.25s; }
.lang.open .lang-btn .chev { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 40;
  min-width: 180px; margin: 0; padding: 8px 0; list-style: none;
  background: var(--plaque); border: 1px solid var(--rule-strong);
  box-shadow: 0 14px 34px rgba(60, 50, 40, 0.10);
}
.lang-menu li { margin: 0; }
.lang-menu button {
  display: flex; justify-content: space-between; align-items: baseline; gap: 18px; width: 100%;
  padding: 9px 18px; border: 0; background: none; cursor: pointer; text-align: left;
  font: 400 15px/1.3 var(--body); color: var(--ink-2);
}
.lang-menu button small { font: 500 10px/1 var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint); }
.lang-menu button:hover, .lang-menu button:focus-visible { background: rgba(169, 99, 76, 0.07); color: var(--ink); outline: none; }
.lang-menu button[aria-selected="true"] { color: var(--accent); }
.lang-menu button[aria-selected="true"] small { color: var(--accent); }

/* ---------- Wall ---------- */
.room { position: relative; min-height: calc(100vh - var(--header-h)); }
.wall {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 28px 0 64px;
  transition: opacity 0.9s ease;
}
.room.focused .wall { opacity: 0.42; pointer-events: none; }
.room.dimmed .wall { opacity: 0.35; }
.room.focused.dimmed .wall { opacity: 0.42; pointer-events: none; }

.cell {
  position: relative;
  aspect-ratio: 1 / 0.86;
  display: grid; place-items: center;
  border: 0; border-radius: 0; font: inherit; color: inherit; appearance: none;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  cursor: pointer; background: none; padding: 0;
  outline: none;
}
.cell:nth-child(4n) { border-right: 0; }
.cell .relief {
  width: 62%; aspect-ratio: 1; margin: 0;
  filter: var(--relief-shadow);
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
  will-change: transform;
}
.cell:hover .relief, .cell:focus-visible .relief { transform: translateY(-4px) scale(1.025); filter: var(--relief-shadow-lift); }
/* the faint halo each tile carries on the reference wall */
.cell::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 78%; aspect-ratio: 1; transform: translate(-50%, -52%);
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 252, 244, 0.9) 0%, rgba(255, 252, 244, 0.45) 38%, rgba(243, 241, 236, 0) 68%);
  opacity: 0.8; transition: opacity 0.6s var(--ease);
}
.cell:hover::before { opacity: 1; }
.cell .name {
  position: absolute; left: 0; right: 0; bottom: 9%;
  text-align: center;
  font: 500 11px/1.5 var(--display);
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted);
  opacity: 0; transition: opacity 0.35s;
  pointer-events: none;
}
.cell:hover .name, .cell:focus-visible .name { opacity: 1; }
.cell.uncarved .name { opacity: 1; color: var(--faint); }
.cell.uncarved .name small { display: block; font-size: 9px; letter-spacing: 0.35em; margin-top: 4px; }

.relief img, .relief svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.relief svg text { fill: var(--rule-strong); }
.relief img { filter: none; }

/* ---------- Stage (focused relief) ---------- */
.stage {
  position: fixed; top: var(--header-h); left: 0; right: var(--panel-w); bottom: 0;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0; transition: opacity 0.5s ease;
  z-index: 10;
}
.room.focused .stage { opacity: 1; }
/* frosted glass over the wall: the busts behind become a muted haze, so nothing on the stage needs a cast shadow */
.stage::before {
  content: ""; position: absolute; inset: 0; top: calc(-1 * var(--header-h)); /* reaches up under the header */
  background: rgba(244, 242, 237, 0.68);
  -webkit-backdrop-filter: blur(22px) saturate(0.85); backdrop-filter: blur(22px) saturate(0.85);
}
.stage .glow {
  position: absolute;
  width: min(92vh, 820px); aspect-ratio: 1; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 250, 236, 1) 0%, rgba(252, 243, 220, 0.9) 22%, rgba(248, 238, 212, 0.55) 40%, rgba(243, 241, 236, 0) 66%);
  opacity: 0; transition: opacity 1.4s ease 0.2s;
}
.room.focused .stage .glow { opacity: 1; }
.stage-relief {
  width: min(54vh, 470px); aspect-ratio: 1; margin: 0; position: relative;
  transform-origin: center center;
  filter: none; /* the frosted wall behind carries the depth; no cast shadow on the stage */
}

/* ---------- The table (two to four people facing each other) ----------
   A round top seen from a little above; far seats sit behind it and smaller, near seats in front.
   Each seat turns toward the centre (rotateY) and mirrors its image when the bust would face away. */
.stage .table { position: absolute; inset: 0; opacity: 0; transition: opacity 0.6s ease; }
.stage.at-table .table { opacity: 1; }
.stage.at-table .stage-relief { display: none; }
.stage.at-table .glow { display: none; } /* no warm glow at the table: frosted paper only */
.table-top {
  position: absolute; left: 50%; top: 53%; z-index: 2;
  width: min(50%, 540px); aspect-ratio: 2.3 / 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #fdfcf9 0%, #f7f5f0 52%, #ece9e2 100%);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 10px 24px rgba(92, 76, 54, 0.06);
}
.table-top::before {
  content: ""; position: absolute; inset: 7% 5%; border-radius: 50%;
  border: 1px solid rgba(70, 58, 44, 0.09);
}
.table-top::after {
  content: ""; position: absolute; left: 8%; right: 8%; bottom: -14%; height: 26%; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(92, 76, 54, 0.05), rgba(92, 76, 54, 0) 70%);
  z-index: -1;
}
.seats { position: absolute; inset: 0; }
.seat {
  position: absolute; width: min(30vh, 250px); aspect-ratio: 1;
  transform: translate(-50%, -50%) perspective(1100px) scale(var(--s, 1)) rotateY(var(--ry, 0deg));
  transition: left 0.8s var(--ease), top 0.8s var(--ease), transform 0.8s var(--ease), opacity 0.6s ease;
}
.seat.far { z-index: 1; }   /* behind the top: the table edge crosses their shoulders */
.seat.near { z-index: 3; }  /* in front of it */
.seat .relief {
  width: 100%; height: 100%; margin: 0;
  filter: none;
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease), opacity 0.5s ease;
}
.seat[data-flip="1"] .relief img { transform: scaleX(-1); }
.seat .plate {
  position: absolute; left: 50%; top: 100%; transform: translate(-50%, -22%);
  white-space: nowrap;
  font: 500 11px/1.5 var(--display); letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--muted); transition: color 0.4s;
}
.seat.far .plate { top: auto; bottom: 100%; transform: translate(-50%, 4%); }
.seat.enter .relief { animation: seat-in 0.9s var(--ease) both; }
@keyframes seat-in { from { opacity: 0; transform: translateY(18px) scale(0.92); } to { opacity: 1; transform: none; } }
.seat.empty .chair { width: 100%; height: 100%; }
.seat.empty .chair svg { width: 100%; height: 100%; display: block; }
.seat.empty .plate { color: var(--faint); letter-spacing: 0.34em; font-size: 10px; }
.table.live .seat:not(.speaking):not(.empty) .relief { opacity: 0.6; }
.table.live .seat:not(.speaking) .plate { color: var(--faint); }
.seat.speaking .relief { transform: translateY(-10px) scale(1.06); }
.seat.speaking .plate { color: var(--accent); }

/* ---------- Panel ---------- */
.panel {
  position: fixed; top: var(--header-h); right: 0; bottom: 0;
  width: var(--panel-w);
  background: var(--veil);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  border-left: 1px solid var(--rule);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform 0.65s var(--ease);
  z-index: 20;
}
.panel.open { transform: none; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 36px 10px;
}
.panel-label {
  font: 500 11px/1 var(--display);
  letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--muted);
}
.close {
  background: none; border: 0; cursor: pointer; padding: 0 2px;
  font: 300 28px/1 var(--display); color: var(--faint);
  transition: color 0.25s;
}
.close:hover { color: var(--ink-2); }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 36px 28px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.panel-foot {
  padding: 14px 36px 22px;
  font: 500 11px/1 var(--display);
  letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--faint);
}
.panel-relief { display: none; }

/* Section headers: ——— • FROM THE WALL • ——— */
.sec {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 34px 0 20px;
}
.sec::before, .sec::after { content: ""; width: 40px; height: 1px; background: var(--rule-strong); }
.sec span {
  font: 500 12px/1 var(--display);
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--accent); white-space: nowrap;
}
.sec span::before, .sec span::after { content: "•"; font-size: 9px; margin: 0 10px; position: relative; top: -2px; }
.sec:first-child { margin-top: 28px; }

.who { text-align: center; }
.who .name {
  margin: 6px 0 8px;
  font: 400 34px/1.15 var(--display);
  color: var(--ink);
}
.who .meta {
  font: 400 12px/1.6 var(--body);
  letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--muted);
}
.bio { margin: 26px 0 8px; font: 400 18.5px/1.62 var(--body); color: var(--ink-2); }

.timeline { list-style: none; margin: 6px 0 0 2px; padding: 0 0 4px 26px; border-left: 1px solid var(--rule-strong); }
.timeline li { position: relative; margin: 0 0 22px; }
.timeline li::before {
  content: ""; position: absolute; left: -31px; top: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--rule-strong);
}
.timeline .year { display: block; font: 400 14px/1.4 var(--body); color: var(--muted); margin-bottom: 3px; }
.timeline .text { font: 400 16.5px/1.55 var(--body); color: var(--ink-2); }

.label {
  margin: 30px 0 10px;
  font: 500 11px/1 var(--display);
  letter-spacing: 0.38em; text-transform: uppercase;
  color: var(--faint);
}
.sources { list-style: none; margin: 0; padding: 0; }
.sources li { font: 400 16px/1.6 var(--body); color: var(--muted); }

.quote {
  margin: 18px 8px 10px;
  font: italic 400 21px/1.5 var(--display);
  color: var(--ink-2);
  text-align: center;
}
.quote-orig { margin: 6px 8px 0; text-align: center; font: italic 400 15px/1.5 var(--display); color: var(--muted); }
.quote-src { margin: 12px 0 0; text-align: center; font: 400 12px/1.6 var(--body); color: var(--faint); letter-spacing: 0.04em; word-break: break-all; }
.quote-src code { font: inherit; }
.quote-none { text-align: center; font: italic 400 16px/1.5 var(--body); color: var(--muted); }

.btn {
  display: block; margin: 42px auto 10px;
  padding: 17px 44px;
  border: 1px solid var(--rule-strong); background: transparent;
  font: 500 13px/1 var(--display);
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--ink-2); cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.btn:hover { border-color: var(--muted); color: var(--ink); background: rgba(255, 255, 255, 0.35); }
.btn.small { margin: 18px auto 0; padding: 12px 26px; font-size: 11px; }
.btn.link { border: 0; padding: 8px; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.fine { font: 400 13px/1.55 var(--body); color: var(--faint); text-align: center; margin: 16px 0 0; }
.fine .warn { color: var(--accent); }
.card-actions { margin-top: 30px; }
.card-actions .btn { margin-top: 12px; }
.card-actions .fine { margin-top: 18px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 1px dotted var(--faint); }
.linkish:hover { color: var(--accent); }
.btn.ghost { margin-top: 14px; border-color: var(--rule); color: var(--muted); }
.btn.ghost:hover { border-color: var(--rule-strong); color: var(--ink-2); }
.btn.ghost.on { color: var(--accent); border-color: rgba(169, 99, 76, 0.45); }

/* ---------- Seating (the table panel) ---------- */
.seatlist { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: seat; }
.seatlist li { display: flex; align-items: baseline; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.seatlist .num { font: 500 10px/1 var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: var(--faint); min-width: 72px; }
.seatlist .who { flex: 1; font: 400 19px/1.3 var(--display); color: var(--ink); }
.seatlist .who.empty { font: italic 400 15px/1.4 var(--body); color: var(--faint); }
.seatlist li button { background: none; border: 0; padding: 0; font: 400 13px/1 var(--body); color: var(--faint); cursor: pointer; border-bottom: 1px dotted var(--faint); }
.seatlist li button:hover { color: var(--accent); }
.roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 8px; margin: 12px 0 24px; }
.mini {
  background: none; border: 0; padding: 4px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: var(--muted); position: relative;
}
.mini .relief { width: 62px; height: 62px; margin: 0; filter: drop-shadow(0 7px 9px rgba(92, 76, 54, 0.14)); transition: transform 0.4s var(--ease), filter 0.4s var(--ease); }
.mini:hover .relief, .mini:focus-visible .relief { transform: translateY(-2px) scale(1.05); filter: drop-shadow(0 10px 12px rgba(92, 76, 54, 0.18)); }
.mini:focus-visible { outline: none; }
.mini span { font: 500 9px/1.35 var(--display); letter-spacing: 0.16em; text-transform: uppercase; text-align: center; }
.mini.seated { color: var(--accent); }
.mini.seated::before {
  content: ""; position: absolute; top: 2px; right: 10%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.mini.full:not(.seated) { opacity: 0.45; }
.panel-table { display: none; }

/* seated people are marked on the wall */
.cell.seated .name { opacity: 1; color: var(--accent); }
.cell.seated .name small { display: block; font-size: 8.5px; letter-spacing: 0.35em; margin-top: 4px; color: var(--muted); }
.cell.seated::after {
  content: ""; position: absolute; top: 14%; right: 16%; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); opacity: 0.85;
}
.translating { font: italic 400 13px/1.5 var(--body); color: var(--faint); text-align: center; margin: 8px 0 0; letter-spacing: 0.04em; }

/* ---------- Ask (chat) ---------- */
.ask { display: flex; flex-direction: column; min-height: 100%; }
.thread { display: flex; flex-direction: column; gap: 20px; padding: 8px 0 18px; flex: 1; }
.direction { text-align: right; font: italic 400 15px/1.5 var(--body); color: var(--muted); }
.turn .speaker {
  font: 500 11px/1 var(--display);
  letter-spacing: 0.36em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 9px;
}
.turn.keeper .speaker { color: var(--muted); }
.turn .text { margin: 0; font: 400 17px/1.6 var(--body); color: var(--ink-2); white-space: pre-wrap; }
.turn.user { text-align: right; }
.turn.user .speaker { color: var(--faint); }
.turn.user .text { color: var(--ink); }
.turn .cites { margin: 8px 0 0; font: 400 12px/1.5 var(--body); color: var(--faint); letter-spacing: 0.03em; }
.turn .cites a { border-bottom: 1px dotted var(--faint); }
.turn.pending .text { color: var(--faint); letter-spacing: 0.3em; }

.composer { position: sticky; bottom: 0; background: transparent; padding: 14px 0 4px; }
.composer .box { position: relative; border: 1px solid var(--rule-strong); background: rgba(255, 255, 255, 0.25); }
.composer textarea {
  display: block; width: 100%; min-height: 112px;
  border: 0; background: transparent; resize: none; outline: none;
  padding: 18px 64px 18px 20px;
  font: 400 17px/1.5 var(--body); color: var(--ink);
}
.composer textarea::placeholder { color: var(--faint); font-style: italic; }
.composer .send {
  position: absolute; right: 14px; bottom: 14px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--rule-strong); background: var(--plaque);
  color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: color 0.25s, border-color 0.25s;
}
.composer .send:hover { color: var(--ink); border-color: var(--muted); }
.composer .send svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.composer .hint { margin: 8px 2px 0; font: 400 12px/1.5 var(--body); color: var(--faint); display: flex; justify-content: space-between; gap: 12px; }
.composer .hint button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 1px dotted var(--faint); }

.keybox { margin: 10px 0 0; padding: 14px 16px; border: 1px dashed var(--rule-strong); font: 400 14px/1.55 var(--body); color: var(--muted); }
.keybox input { width: 100%; margin: 8px 0 6px; padding: 8px 10px; border: 1px solid var(--rule-strong); background: transparent; font: 400 14px/1.4 var(--body); color: var(--ink); outline: none; }
.keybox .row { display: flex; gap: 12px; align-items: center; }

/* ---------- Carve ---------- */
.form { display: flex; flex-direction: column; gap: 22px; margin-top: 6px; }
.field label { display: block; font: 500 11px/1 var(--display); letter-spacing: 0.36em; text-transform: uppercase; color: var(--faint); margin-bottom: 8px; }
.field input, .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--rule-strong); background: transparent;
  padding: 8px 2px 10px; outline: none; resize: vertical;
  font: 400 17px/1.5 var(--body); color: var(--ink);
}
.field input:focus, .field textarea:focus { border-bottom-color: var(--muted); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); font-style: italic; }
.lede { font: 400 18px/1.6 var(--body); color: var(--ink-2); margin: 8px 0 4px; }
.nominations { list-style: none; padding: 0; margin: 6px 0 0; }
.nominations li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); font: 400 16px/1.5 var(--body); color: var(--ink-2); }
.nominations li span:last-child { font-size: 13px; color: var(--muted); }
.nominations li button { background: none; border: 0; color: var(--faint); cursor: pointer; font: 400 14px/1 var(--body); }
.nominations li button:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  :root { --panel-w: 420px; }
  .wall { grid-template-columns: repeat(3, 1fr); }
  .cell:nth-child(4n) { border-right: 1px solid var(--rule); }
  .cell:nth-child(3n) { border-right: 0; }
}
@media (max-width: 900px) {
  :root { --header-h: 60px; --panel-w: 100vw; }
  .top-inner { padding: 0 16px; }
  .nav { gap: 18px; }
  .nav-btn .txt { display: none; }
  .wordmark { letter-spacing: 0.3em; font-size: 13px; }
  .wall { grid-template-columns: repeat(2, 1fr); padding: 12px 0 48px; }
  .cell:nth-child(3n) { border-right: 1px solid var(--rule); }
  .cell:nth-child(2n) { border-right: 0; }
  .cell .relief { width: 70%; }
  .stage { display: none; }
  .panel { width: 100vw; border-left: 0; }
  .panel-head { padding: 18px 20px 6px; }
  .panel-body { padding: 4px 20px 20px; }
  .panel-foot { padding: 12px 20px 18px; }
  .panel-relief { display: block; width: 52%; margin: 4px auto 0; }
  .panel-table { display: flex; justify-content: center; gap: 6px; margin: 4px 0 8px; }
  .panel-table .relief { width: 64px; height: 64px; margin: 0; filter: drop-shadow(0 7px 9px rgba(92, 76, 54, 0.14)); }
  .roster { grid-template-columns: repeat(3, 1fr); }
  .room.focused .wall { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* A navigable reading room. The wall moves; the reading surface stays still. */
:root { --ink:#211e1b; --ink-2:#302c28; --muted:#514b44; --faint:#62594f; --accent:#854733; --panel-w:540px; }
body { overflow:hidden; }
.top { position:fixed; inset:0 0 auto; background:rgba(245,243,238,.84); backdrop-filter:blur(24px) saturate(.8); -webkit-backdrop-filter:blur(24px) saturate(.8); }
.top.scrolled { background:rgba(245,243,238,.94); }
.top-inner { max-width:none; padding:0 clamp(20px,4vw,64px); }
.nav-btn { min-height:44px; color:var(--ink); font-weight:600; }
.room { height:100dvh; padding:0; }
.wall-viewport { position:absolute; inset:var(--header-h) 0 66px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#bfb7aa transparent; cursor:grab; touch-action:pan-x pan-y; }
.wall-viewport.dragging { cursor:grabbing; user-select:none; }
.wall { position:relative; width:1960px; max-width:none; margin:0; padding:32px 0 80px; display:grid; grid-template-columns:repeat(7,280px); }
.wall .cell { aspect-ratio:1/.98; min-height:250px; border:0; padding:22px; cursor:inherit; }
.wall .cell[hidden] { display:none; }
.wall .name { opacity:1; color:var(--ink); font-size:14px; font-weight:600; letter-spacing:.08em; transform:none; }
.wall .relief { width:78%; height:196px; margin:auto; transition:transform .4s var(--ease); }
.wall .cell:hover .relief { transform:translateY(-7px); }
.wall .cell:focus-visible { outline:2px solid #776a59; outline-offset:-12px; border-radius:12px; }
.wall.filtered { width:max(100%,840px); grid-template-columns:repeat(3,280px); }
.archive-portrait img { object-fit:cover; object-position:50% 25%; border-radius:48% 48% 5% 5%; filter:grayscale(1) sepia(.12); }
.wall .archive-portrait .relief { width:58%; }
.wall-tools { position:fixed; z-index:20; inset:auto 0 0; height:66px; display:flex; align-items:center; gap:24px; padding:0 clamp(20px,4vw,64px); background:rgba(245,243,238,.93); backdrop-filter:blur(20px); border-top:1px solid var(--rule-strong); font:14px/1.4 system-ui,sans-serif; color:var(--muted); }
.wall-tools button { border:0; background:none; cursor:pointer; font:inherit; padding:12px; color:var(--ink); }
.wall-search { display:flex; align-items:center; gap:10px; }
.wall-search>span { font-size:28px; }
.wall-search input { width:160px; border:0; background:transparent; font:inherit; color:var(--ink); padding:12px 0; outline-offset:4px; }
.library-count { margin-left:auto; }
.share-room { white-space:nowrap; }
.wall-search input::placeholder, .box textarea::placeholder { color:var(--muted); opacity:1; }
.room.focused .wall-tools { display:none; }
.panel { z-index:25; background:rgba(248,246,241,.98); }
.panel-body { scroll-behavior:smooth; overscroll-behavior:contain; }
.panel .bio, .panel .timeline .text, .panel .text { font-size:20px; line-height:1.55; color:var(--ink); }
.panel .fine, .panel .meta, .panel .sources { color:var(--muted); }
.panel .fine, .panel .sources li { font-size:17px; line-height:1.6; }
.panel .quote-src { font-size:14px; color:var(--muted); word-break:normal; overflow-wrap:anywhere; }
.panel .label, .panel-label { color:var(--ink-2); font-size:12px; letter-spacing:.22em; }
.panel .quote { color:var(--ink); font-size:24px; }
.reply-heading { display:flex; align-items:center; gap:14px; margin-bottom:14px; }
.reply-portrait { width:58px; height:66px; flex:none; margin:0; }
.reply-portrait img { width:100%; height:100%; object-fit:contain; }
.reply-portrait.archive-portrait img { object-fit:cover; }
.reply-kind { display:block; margin-top:5px; font:11px/1.5 system-ui,sans-serif; color:var(--muted); }
.turn { padding:20px 0; scroll-margin-top:16px; }
.turn .speaker { margin:0; color:var(--ink); }
.turn .text { white-space:pre-wrap; }
.source-passage { margin:20px 0; padding:16px 0 16px 18px; border-left:2px solid #a89a86; }
.passage-label { font:10px/1.5 system-ui,sans-serif; letter-spacing:.14em; color:#61584e; }
.source-passage blockquote { margin:10px 0; color:#27231f; font:400 24px/1.35 var(--display); }
.source-passage figcaption, .portrait-credit { font:12px/1.6 system-ui,sans-serif; color:#635b52; }
.source-passage a, .portrait-credit a, .cites a { text-decoration:underline; text-underline-offset:3px; }
.passage-context { display:block; margin-top:6px; }
.ask .hint { font:11px/1.4 system-ui,sans-serif; color:#625a51; gap:10px; padding-bottom:env(safe-area-inset-bottom); }
.send:disabled { opacity:.4; cursor:wait; }
.panel-table { min-height:0; }
@media (max-width:600px) { .wall-tools .library-count { display:none; } .share-room { margin-left:auto; } }
@media (max-width:900px) {
  :root { --header-h:76px; }
  .top-inner { padding:0 18px; }
  .nav { gap:14px; }
  .nav-btn { letter-spacing:.05em; }
  .wordmark { font-size:13px; letter-spacing:.2em; }
  .wall { width:1540px; grid-template-columns:repeat(7,220px); padding-top:16px; }
  .wall .cell { min-height:218px; padding:18px 10px; }
  .wall .relief { height:162px; }
  .wall-tools { gap:10px; padding:0 18px; height:62px; }
  .wall-search input { width:125px; }
  .pan-hint { display:none; }
  .library-count { font-size:12px; }
  .wall.filtered { width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); }
  .panel { width:100%; max-width:none; top:var(--header-h); height:calc(100dvh - var(--header-h)); }
  .panel-body { padding:22px; }
  .panel .bio, .panel .text { font-size:20px; }
  .panel-table { display:flex; height:90px; gap:12px; margin:0 0 12px; }
  .panel-table:empty { display:none; }
  .panel-table .relief { height:86px; width:75px; margin:0; }
  .source-passage blockquote { font-size:24px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; }
}
.carve-match { display:flex; gap:20px; padding:24px 0; border-bottom:1px solid var(--rule); }
.carve-match img { width:90px; height:120px; object-fit:cover; filter:grayscale(1); border-radius:44px 44px 3px 3px; }
.carve-match h3 { font:400 27px/1.1 var(--display); margin:0 0 10px; }
.carve-match p { font:15px/1.5 system-ui; margin:0 0 14px; }
.personal-list { margin-top:30px; display:flex; flex-direction:column; gap:12px; align-items:flex-start; }
.personal-name { border:0; background:none; font:20px var(--display); cursor:pointer; }
.share-profile { margin:18px 0; }
.form .btn:disabled { opacity:.55; }
.composer { background:#f8f6f1; z-index:3; box-shadow:0 -12px 16px #f8f6f1; }
.composer .box { background:#f8f6f1; border-radius:8px; }
img.archive-photo { object-fit:cover; object-position:50% 25%; border-radius:48% 48% 5% 5%; filter:grayscale(1) sepia(.12); }
.panel .sources a { text-decoration:underline; text-underline-offset:4px; }
/* Conversation scrolls independently of the fixed reply field. */
.panel-body:has(.ask) { overflow:hidden; display:flex; flex-direction:column; min-height:0; padding-bottom:0; }
.ask { height:100%; min-height:0; flex:1; overflow:hidden; }
.ask .panel-table { flex-shrink:0; }
.ask .thread { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scroll-behavior:smooth; padding-right:4px; }
.ask .composer { position:relative; bottom:auto; flex-shrink:0; box-shadow:none; border-top:1px solid var(--rule); }
@media (max-width:900px) { .ask .panel-table { height:60px; margin-bottom:8px; } .ask .panel-table .relief { height:60px; width:54px; } }
/* Captions sit below portraits, including the optional seated label. */
.wall .cell { display:flex; flex-direction:column; justify-content:flex-start; gap:16px; aspect-ratio:auto; min-height:302px; }
.wall .cell .relief { flex:none; margin:0 auto; }
.wall .cell .name { position:relative; inset:auto; display:block; width:100%; min-height:34px; font-size:13px; }
.wall .cell .name small:not([hidden]) { display:block; font-size:9px; margin-top:4px; }
@media (max-width:900px) { .wall .cell { min-height:248px; gap:12px; } .wall .cell .name { font-size:12px; } }

/* The table is a chooser, with the search and selected company always in reach. */
.panel:has(.table-builder) { --panel-w:600px; }
.panel-body:has(.table-builder) { overflow:hidden; display:flex; min-height:0; padding-bottom:0; }
.panel:has(.table-builder) .panel-foot { display:none; }
.table-builder { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
.table-heading h2 { font:400 35px/1.1 var(--display); margin:18px 0 8px; color:var(--ink); }
.table-heading p { font:14px/1.5 system-ui,sans-serif; color:var(--muted); margin:0 0 20px; }
.table-tabs { display:flex; flex-shrink:0; border-bottom:1px solid var(--rule-strong); gap:26px; margin-bottom:20px; }
.table-tabs button { border:0; border-bottom:2px solid transparent; background:none; color:var(--muted); padding:0 0 12px; cursor:pointer; font:500 14px/1.3 system-ui,sans-serif; }
.table-tabs button[aria-pressed=true] { border-color:var(--ink); color:var(--ink); }
.table-scroll { overflow-y:auto; min-height:0; overscroll-behavior:contain; padding:0 4px 24px 0; scrollbar-width:thin; }
.search-label { display:block; font:500 13px/1.5 system-ui,sans-serif; margin-bottom:8px; color:var(--ink); }
.table-search { position:relative; }
.table-search input, #challengeInput { width:100%; box-sizing:border-box; padding:13px 38px 13px 14px; background:#fffdf8; border:1px solid #b9b1a6; border-radius:8px; color:var(--ink); font:16px/1.5 system-ui,sans-serif; }
.table-search input::placeholder, #challengeInput::placeholder { color:#736b62; }
.table-search>span { position:absolute; right:14px; top:10px; pointer-events:none; font-size:26px; }
.topic-filters { display:flex; gap:7px; overflow-x:auto; padding:12px 0 7px; scrollbar-width:thin; }
.topic-filters button, .challenge-examples button { flex-shrink:0; padding:8px 12px; border:1px solid #c5bdb1; border-radius:20px; background:transparent; color:#514b44; font:12px/1.3 system-ui,sans-serif; cursor:pointer; }
.topic-filters button[aria-pressed=true] { color:#fffdf7; background:#35332d; border-color:#35332d; }
.roster-status { color:#61594e; font:12px/1.5 system-ui,sans-serif; margin:15px 0; min-height:18px; }
.table-builder .roster { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0; }
.person-choice { position:relative; cursor:pointer; display:flex; flex-direction:column; align-items:flex-start; text-align:left; padding:14px; background:#eeebe4; color:var(--ink); border:1px solid transparent; border-radius:10px; transition:background .2s,border-color .2s,transform .2s; min-width:0; }
.person-choice:hover { background:#e7e2d8; }
.person-choice .relief { margin:0 auto 8px; width:100%; height:112px; }
.person-choice .relief img { width:100%; height:100%; object-fit:contain; }
.person-choice strong { font:500 19px/1.15 var(--display); margin-bottom:6px; }
.choice-reason { font:12px/1.5 system-ui,sans-serif; color:#534d44; margin-bottom:10px; }
.source-availability { margin-top:auto; font:11px/1.4 system-ui,sans-serif; color:#625a4e; }
.choice-check { position:absolute; right:10px; top:10px; width:23px; height:23px; border:1px solid #c0b6a7; border-radius:50%; display:grid; place-items:center; color:#6b6255; font:16px/1 system-ui,sans-serif; }
.person-choice.seated { background:#e5e3d7; border-color:#656851; }
.person-choice.seated .choice-check { background:#424b39; color:white; border-color:#424b39; }
.person-choice.full { opacity:.6; }
.table-dock { flex-shrink:0; border-top:1px solid var(--rule-strong); padding:14px 0 20px; background:#f8f6f1; }
.selection-heading { display:flex; align-items:center; justify-content:space-between; font:12px/1.5 system-ui,sans-serif; gap:12px; }
.selected-people { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0; }
.selected-people button { background:#e7e3da; color:var(--ink); border:0; border-radius:16px; padding:6px 10px; font:12px/1.4 system-ui,sans-serif; cursor:pointer; }
.selected-people button span { margin-left:9px; }
.table-dock .table-continue { width:100%; margin:6px 0 0; padding:13px 12px; border-radius:7px; background:#333a2e; color:#fffdf7; border:1px solid #333a2e; font:500 14px/1.4 system-ui,sans-serif; letter-spacing:0; text-transform:none; }
.table-continue:disabled { opacity:.45; cursor:default; }
#challengeInput { resize:vertical; min-height:104px; max-height:190px; padding:12px; }
.find-perspectives.btn { margin:10px 0; font:500 13px/1.4 system-ui,sans-serif; letter-spacing:0; text-transform:none; }
.challenge-examples { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 15px; }
.challenge-examples button { font-size:11px; padding:6px 9px; }
.conversation-tools { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; gap:12px; padding:8px 0 15px; border-bottom:1px solid var(--rule); margin-bottom:12px; font:12px/1.4 system-ui,sans-serif; }
.conversation-tools select { padding:7px 6px; margin-left:4px; color:var(--ink); background:transparent; border:1px solid #b9b1a6; border-radius:5px; font:12px/1.3 system-ui,sans-serif; }
.table-builder button:focus-visible, .table-builder input:focus-visible, .table-builder textarea:focus-visible { outline:2px solid #696f4f; outline-offset:3px; }
@media (max-width:900px) {
  .panel:has(.table-builder) { width:100%; }
  .table-heading h2 { font-size:30px; margin-top:5px; }
  .table-heading p { margin-bottom:15px; }
  .table-tabs { margin-bottom:15px; }
  .table-dock { padding-bottom:max(14px,env(safe-area-inset-bottom)); }
  .person-choice { padding:12px; }
  .person-choice .relief { height:96px; }
}
@media (max-width:380px) { .table-heading h2 { font-size:27px; } .person-choice strong { font-size:18px; } .conversation-tools { gap:6px; } }

/* An open wall, with the same direct two-axis gesture as the artwork gallery. */
.wall-viewport {scrollbar-width:none;touch-action:none;}
.wall-viewport::-webkit-scrollbar {display:none;}
.wall .cell {content-visibility:auto;contain-intrinsic-size:280px 274px;}
.card-actions-top {margin:22px 0 28px;display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.card-actions-top .btn {margin:0;padding:14px 10px;font-size:13px;min-height:50px;}
.card-actions-top .fine {grid-column:1/-1;margin:4px 0 0;}
.wall-tools {gap:16px;}
.wall-search {flex:1;max-width:440px;border:1px solid var(--rule-strong);border-radius:30px;padding:0 16px;}
.wall-search input {width:100%;min-width:0;}
.wall-tools button {min-height:42px;border:1px solid var(--rule-strong);border-radius:28px;padding:10px 18px;}
.panel-relief {max-height:180px;}
@media(max-width:600px){.wall-tools{gap:8px;padding-inline:12px}.wall-tools button{padding:10px 12px;font-size:12px}.wall-search{padding:0 12px}.wall-search input{font-size:14px}.card-actions-top{position:relative}.panel-relief{height:130px;max-height:130px;margin:0 auto 12px}}
