:root {
  --paper: #f4f0e6; --panel: #fbf8f0; --ink: #1d1a14; --muted: #5e5749; --line: #cfc6b2; --wall: #2a261e;
  --accent: #8c2f1b; --accent-ink: #fff8ef; --print: #8c2f1b; --tag: #8c2f1b;
  --cold: #d4e4e4; --side: #f2d9c4; --ledger: #dfe4c4; --stair: #f1d3cf; --table: #efe2b8; --lobby: #e9e3d4;
  --door-dark: #1a1812; --on-door: #f3ecdc; --on-door-muted: #c9c0ad;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12110d; --panel: #1b1914; --ink: #efe9db; --muted: #aaa18f; --line: #38342a; --wall: #d9d1bf;
    --accent: #e8a25a; --accent-ink: #1a1208; --print: #e8a25a; --tag: #e8a25a;
    --cold: #12282b; --side: #33211a; --ledger: #232914; --stair: #341a1c; --table: #2e2610; --lobby: #1f1d16;
    --door-dark: #050504;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 "Literata", Georgia, serif; overflow-x: hidden; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 18px; }
lab-signup, lab-footer { --lab-muted: var(--muted); --lab-line: var(--line); --lab-field: var(--panel); --lab-accent: var(--accent); --lab-accent-ink: var(--accent-ink); --lab-radius: 3px; }

.top { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 18px 0; flex-wrap: wrap; }
.brand { font: 400 20px "Young Serif", Georgia, serif; }
.status { font: 400 12.5px/1.3 "DM Mono", monospace; color: var(--muted); border: 1px solid var(--line); padding: 5px 9px; border-radius: 3px; }
.hero { padding: 26px 0 28px; }
h1 { font: 400 clamp(40px, 8vw, 78px)/1.03 "Young Serif", Georgia, serif; letter-spacing: -.015em; margin: 0 0 18px; max-width: 13em; }
h2 { font: 400 clamp(26px, 4.2vw, 36px)/1.14 "Young Serif", Georgia, serif; margin: 0 0 12px; }
h3 { font: 500 18px/1.3 "Literata", Georgia, serif; margin: 0 0 6px; }
.lede { font-size: clamp(18px, 2.3vw, 21px); color: var(--muted); margin: 0; max-width: 34em; }
.eyebrow { font: 500 12.5px/1.4 "DM Mono", monospace; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.fine { font-size: 14px; color: var(--muted); margin: 0; }
.center { text-align: center; }
.cta { display: inline-block; background: var(--accent); color: var(--accent-ink); font: 500 15px "DM Mono", monospace; padding: 13px 18px; border: 0; border-radius: 3px; cursor: pointer; text-decoration: none; }
.cta:disabled { opacity: .6; cursor: wait; }
.tool { font: 400 12.5px "DM Mono", monospace; color: inherit; background: none; border: 1px solid var(--line); border-radius: 3px; padding: 6px 9px; cursor: pointer; }

/* The stage. Its background is whatever room you're standing in. */
.stage-wrap { max-width: 1000px; margin: 0 auto; padding: 0 18px 8px; }
.stage { --here: var(--lobby); position: relative; background: var(--here); border: 2px solid var(--wall); transition: background-color .7s ease; overflow: hidden; min-height: 560px; display: flex; flex-direction: column; }
.stage[data-room="cold"] { --here: var(--cold); }
.stage[data-room="side"] { --here: var(--side); }
.stage[data-room="ledger"] { --here: var(--ledger); }
.stage[data-room="stair"] { --here: var(--stair); }
.stage[data-room="table"] { --here: var(--table); }
.stage-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid color-mix(in srgb, var(--wall) 30%, transparent); flex-wrap: wrap; position: relative; z-index: 2; }
.stage-title { font: 500 13px "DM Mono", monospace; letter-spacing: .05em; text-transform: uppercase; }
.stage-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.doors-left { font: 400 12.5px "DM Mono", monospace; color: var(--muted); }
.stage-label { font-size: 13.5px; color: var(--muted); margin: 10px 2px 0; max-width: 56em; }
.view { flex: 1; padding: 24px 22px 26px; min-width: 0; }

.lobby { display: grid; gap: 14px; align-content: center; max-width: 700px; margin: 0 auto; width: 100%; }
.big-q { font: 400 clamp(25px, 4vw, 36px)/1.18 "Young Serif", Georgia, serif; display: block; margin: 0; }
input { width: 100%; font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--wall); border-radius: 3px; padding: 13px; min-width: 0; }
input::placeholder { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { font: 400 13.5px/1.3 "DM Mono", monospace; text-align: left; color: inherit; background: color-mix(in srgb, var(--panel) 60%, transparent); border: 1px solid color-mix(in srgb, var(--wall) 45%, transparent); padding: 8px 10px; border-radius: 3px; cursor: pointer; }
.chip:hover { border-color: var(--wall); }
.lobby-foot { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.lobby-foot .fine { flex: 1; min-width: 240px; }

/* The floor plan. */
.plan-view { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.plan-frame { overflow: hidden; max-width: 640px; width: 100%; margin: 0 auto; }
#plan-svg { display: block; width: 100%; height: auto; transform-origin: 0 0; will-change: transform; }
.floor { fill: transparent; transition: fill .6s; }
.floor[data-lit="cold"] { fill: var(--cold); }
.floor[data-lit="side"] { fill: var(--side); }
.floor[data-lit="ledger"] { fill: var(--ledger); }
.floor[data-lit="stair"] { fill: var(--stair); }
.floor[data-lit="table"] { fill: var(--table); }
.walls path { fill: none; stroke: var(--wall); stroke-width: 3.5; stroke-linecap: square; }
.doors path { fill: none; stroke: var(--wall); stroke-width: 1; }
.fixtures path, .fixtures rect { fill: none; stroke: color-mix(in srgb, var(--wall) 45%, transparent); stroke-width: .9; }
.labels text { font: 500 12px "DM Mono", monospace; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--here); stroke-width: 3px; }
.tags circle { fill: var(--tag); }
.tags circle.used { fill: transparent; stroke: var(--muted); stroke-width: 1; }
#prints circle { fill: var(--print); opacity: .55; }
#walker { fill: var(--ink); stroke: var(--here); stroke-width: 2; }
.plan-note { margin: 0; text-align: center; font-style: italic; }
.door-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 640px; width: 100%; margin: 0 auto; }
.door-btn { display: grid; gap: 2px; text-align: left; color: inherit; background: var(--panel); border: 1px solid var(--wall); padding: 10px 12px; cursor: pointer; border-radius: 3px; font: inherit; min-width: 0; }
.door-btn b { font: 500 13.5px/1.3 "DM Mono", monospace; }
.door-btn small { font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.door-btn:disabled { opacity: .5; cursor: default; }
.door-btn.go { grid-column: 1 / -1; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.door-btn.go small { color: inherit; }

/* Arriving at a door. */
.door { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--door-dark); color: var(--on-door); }
.door .eyebrow { color: var(--on-door-muted); text-align: center; }
.door .fine { color: var(--on-door-muted); max-width: 30em; }
.doorway { width: 150px; height: 220px; border: 3px solid var(--on-door-muted); border-bottom: 0; position: relative; }
.crack { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--on-door); box-shadow: 0 0 18px 5px color-mix(in srgb, var(--accent) 70%, transparent); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.tap { display: inline-flex; align-items: center; gap: 12px; font: 500 15px "DM Mono", monospace; color: var(--door-dark); background: var(--on-door); border: 0; border-radius: 40px; padding: 12px 20px 12px 14px; cursor: pointer; }
.tag-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); position: relative; }
.tag-dot::after { content: ""; position: absolute; inset: -6px; border: 2px solid var(--on-door); border-radius: 50%; animation: ripple 1.6s ease-out infinite; }
@keyframes ripple { from { transform: scale(.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* A room. */
.room { position: relative; display: flex; }
.flood { position: absolute; inset: 0; background: var(--door-dark); clip-path: circle(120% at 50% 90%); transition: clip-path .9s cubic-bezier(.3, .6, .2, 1); pointer-events: none; }
.flood.open { clip-path: circle(0 at 50% 90%); }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }
.room-inner { animation: settle .5s .35s both; position: relative; flex: 1; min-width: 0; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.room h2 { margin: -6px 0 0; }
.said { display: grid; gap: 14px; }
.said-line { margin: 0; font-size: clamp(19px, 2.6vw, 23px); line-height: 1.42; }
.said-line.you { font-size: 16px; color: var(--muted); font-style: italic; padding-left: 12px; border-left: 2px solid var(--wall); }
.said-line.you::before { content: "You: "; }
.said-line.cold { font-family: "Cutive Mono", monospace; font-size: clamp(18px, 2.4vw, 21px); }
.said-line.side { font-style: italic; }
.said-line.ledger { font-family: "DM Mono", monospace; font-size: clamp(16.5px, 2.2vw, 19px); }
.said-line.stair { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 500; }
.said-line.clerk { font-family: "Young Serif", Georgia, serif; }
.live { text-decoration: underline dotted; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.thinking { font: 400 14px "DM Mono", monospace; color: var(--muted); margin: 0; }
.reply { display: grid; gap: 10px; }
.reply-row { display: flex; gap: 8px; }
.reply-row input { flex: 1; }
.reply-row .cta { flex: none; }
.room-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.memory { font-size: 14.5px; min-width: 0; flex: 1 1 240px; }
.memory summary { cursor: pointer; font: 400 12.5px "DM Mono", monospace; padding: 4px 0; }
.memory ul { margin: 8px 0 0; padding-left: 18px; }
.memory li { margin-bottom: 5px; overflow-wrap: anywhere; }
.legend { font: 400 12px/1.4 "DM Mono", monospace; color: var(--muted); margin: 0; }

/* The long table. */
.table { display: grid; gap: 18px; align-content: start; }
.minutes { background: var(--panel); border: 1px solid var(--wall); padding: 20px 20px 18px; max-width: 720px; width: 100%; margin: 0 auto; box-shadow: 5px 5px 0 color-mix(in srgb, var(--wall) 18%, transparent); }
.minutes h3 { font: 400 23px/1.2 "Young Serif", Georgia, serif; margin: 0 0 2px; }
.minutes .eyebrow { margin-bottom: 14px; }
.minutes dl { margin: 0; display: grid; gap: 12px; }
.minutes dt { font: 500 12px "DM Mono", monospace; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.minutes dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.minutes .moved { font: 400 21px/1.3 "Young Serif", Georgia, serif; }
.table .reply, .after { max-width: 720px; width: 100%; margin: 0 auto; }
.after { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.stop { display: flex; align-items: center; max-width: 700px; margin: 0 auto; }

/* Below the stage. */
section.use { padding: 56px 0 8px; }
.story { font-size: 19px; margin: 0 0 16px; max-width: 38em; }
.rooms-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.rooms-list li { border-top: 2px solid var(--wall); padding: 8px 0 4px; }
.rooms-list b { display: block; font: 500 13.5px "DM Mono", monospace; }
.rooms-list span { color: var(--muted); font-size: 15.5px; }
.how, .cases, .limits, .ask { padding: 44px 0 0; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 16px; max-width: 46em; }
.steps li { counter-increment: step; padding-left: 44px; position: relative; }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; font: 500 14px/1.9 "DM Mono", monospace; color: var(--accent); }
.steps li b { font-weight: 500; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 26px; padding: 44px 0 0; }
.two p { margin: 0; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px 26px; margin-top: 16px; }
.case-grid article { border-top: 1px solid var(--wall); padding-top: 12px; }
.case-grid p { margin: 0; font-size: 16px; }
.limits ul { margin: 8px 0 0; padding-left: 20px; max-width: 46em; }
.limits li { margin-bottom: 8px; }
.ask { max-width: 660px; }
.ask-lede { color: var(--muted); margin: 0 0 18px; }
.foot { padding: 48px 0 40px; font-size: 14px; color: var(--muted); }

@media (max-width: 560px) {
  .view { padding: 18px 16px 20px; }
  .stage { min-height: 520px; }
  .reply-row { flex-direction: column; }
  .reply-row .cta { width: 100%; }
  .after .cta { width: 100%; text-align: center; }
  .labels text { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
