@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bone: #e7dfce;
  --bone-dark: #beb5a2;
  --soot: #151310;
  --soot-soft: #201d19;
  --brick: #6d3127;
  --amber: #f0a22e;
  --blue: #355dff;
  --signal: #e44931;
  --line: rgba(231, 223, 206, .28);
  --quiet: rgba(231, 223, 206, .68);
  --room-light: #f0a22e;
  --sans: "Instrument Sans", "Arial Narrow", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --edge: clamp(1rem, 2vw, 2rem);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html,
body { min-width: 20rem; min-height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--soot);
  color: var(--bone);
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }
a { color: inherit; text-decoration: none; }

:where(button, a, input):focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: .75rem;
  left: .75rem;
  padding: .75rem 1rem;
  background: var(--bone);
  color: var(--soot);
  transform: translateY(-180%);
  transition: transform 180ms var(--ease-out);
}

.skip-link:focus { transform: none; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.micro-label,
.building-count,
.building-condition,
.step-count,
.building-clock,
.building-nav,
.choice-group legend,
.light-control label,
.light-scale,
.text-button {
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.building-experience {
  position: fixed;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  background: #80786b;
}

.facade-stage,
.time-wash,
.print-grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.facade-stage { background: #aea590; overflow: hidden; }

.facade-stage::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.facade-plane {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.778dvh);
  height: max(100dvh, 56.25vw);
  transform: translate(-50%, -50%);
}

.facade-artwork {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
  filter: saturate(.86) contrast(1.04);
}

.time-wash {
  z-index: 1;
  background: #161718;
  opacity: .18;
  mix-blend-mode: multiply;
  transition: opacity 1.2s var(--ease-out), background-color 1.2s var(--ease-out);
  pointer-events: none;
}

body[data-time="morning"] .time-wash { background: #f0d6a1; opacity: .08; mix-blend-mode: color; }
body[data-time="afternoon"] .time-wash { background: #e9c377; opacity: .04; mix-blend-mode: color; }
body[data-time="evening"] .time-wash { background: #5d3548; opacity: .22; mix-blend-mode: multiply; }
body[data-time="night"] .time-wash { background: #091222; opacity: .4; mix-blend-mode: multiply; }

body[data-age="settled"] .facade-artwork { filter: saturate(.82) contrast(1.055) sepia(.035); }
body[data-age="worn"] .facade-artwork { filter: saturate(.76) contrast(1.075) sepia(.075); }
body[data-age="weathered"] .facade-artwork { filter: saturate(.7) contrast(1.095) sepia(.11); }
body[data-age="worn"] .print-grain { opacity: .18; }
body[data-age="weathered"] .print-grain { opacity: .22; }

body[data-event="passing-train"] .facade-stage::before {
  background: linear-gradient(180deg, transparent 72%, rgba(240, 162, 46, .6) 78%, transparent 84%);
  mix-blend-mode: screen;
  animation: passing-train 9s ease-in-out infinite;
}

body[data-event="lake-storm"] .facade-stage::before {
  background: rgba(53, 93, 255, .28);
  mix-blend-mode: color-burn;
  animation: lake-storm 13s steps(1, end) infinite;
}

body[data-event="power-dip"] .building-window.is-lit { animation: power-dip 11s steps(1, end) infinite; }
body[data-event="rooftop-signal"] .building-window.is-lit:nth-child(10n + 5),
body[data-event="rooftop-signal"] .building-window.is-lit:nth-child(10n + 6) { box-shadow: 0 0 2.4rem var(--blue); }
body[data-event="elevator-pause"] .building-window.is-lit:nth-child(10n + 5) { opacity: .22; }

body[data-weather="cloud"] .time-wash { background: #3a3e45; opacity: .28; }
body[data-weather="fog"] .time-wash { background: #c9c6bd; opacity: .3; mix-blend-mode: screen; }
body[data-weather="rain"] .time-wash { background: #172a45; opacity: .42; }
body[data-weather="rain"] .print-grain { opacity: .2; }
body[data-weather="snow"] .time-wash { background: #cbd7e3; opacity: .23; mix-blend-mode: screen; }
body[data-weather="storm"] .time-wash { background: #10182c; opacity: .56; }

@keyframes passing-train { 0%, 52%, 100% { opacity: 0; transform: translateX(-28%); } 62% { opacity: .58; } 78% { opacity: 0; transform: translateX(28%); } }
@keyframes lake-storm { 0%, 82%, 86%, 100% { opacity: 0; } 83% { opacity: .34; } 84% { opacity: .08; } 85% { opacity: .5; } }
@keyframes power-dip { 0%, 71%, 75%, 100% { filter: none; } 72%, 74% { filter: brightness(.16); } }

.print-grain {
  z-index: 4;
  pointer-events: none;
  opacity: .14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.window-field {
  position: absolute;
  z-index: 3;
  top: 17.2%;
  left: 8.65%;
  width: 82.7%;
  height: 77%;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(13, 1fr);
  pointer-events: none;
}

.building-window {
  position: relative;
  min-width: 0;
  min-height: 0;
  width: 64%;
  height: 76%;
  align-self: center;
  justify-self: start;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 700ms var(--ease-out), background-color 700ms var(--ease-out), box-shadow 700ms var(--ease-out);
}

.building-window.is-lit {
  opacity: .74;
  background: var(--window-light, #f0a22e);
  box-shadow: 0 0 1.75rem color-mix(in srgb, var(--window-light, #f0a22e) 76%, transparent);
  mix-blend-mode: screen;
}

.building-window.is-mine {
  opacity: .96;
  outline: 2px solid var(--bone);
  outline-offset: 4px;
}

.building-window.has-response {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
  animation: neighbor-answer 4.6s ease-in-out infinite;
}

.building-window.is-available {
  opacity: 1;
  border-color: rgba(255, 255, 255, .86);
  box-shadow: 0 0 0 .4rem rgba(255, 255, 255, .08);
  animation: empty-room 2.8s ease-in-out infinite;
}

.building-window.rhythm-breathe { animation: window-breathe 3.8s ease-in-out infinite; }
.building-window.rhythm-flicker { animation: window-flicker 3.2s steps(1, end) infinite; }
.building-window.rhythm-pass { animation: window-pass 5.4s ease-in-out infinite; }
.building-window.rhythm-pulse { animation: window-pulse 1.8s ease-in-out infinite; }

@keyframes empty-room { 0%, 100% { opacity: .42; } 50% { opacity: 1; } }
@keyframes window-breathe { 0%, 100% { opacity: .48; } 50% { opacity: .95; } }
@keyframes window-flicker { 0%, 8%, 12%, 62%, 66%, 100% { opacity: .85; } 9%, 63% { opacity: .18; } }
@keyframes window-pass { 0%, 38%, 100% { opacity: .42; } 50%, 70% { opacity: .96; } }
@keyframes window-pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes neighbor-answer { 0%, 100% { box-shadow: 0 0 1.75rem color-mix(in srgb, var(--window-light) 76%, transparent); } 45% { box-shadow: 0 0 3.4rem color-mix(in srgb, var(--window-light) 84%, var(--blue)); } }

.building-header {
  position: absolute;
  z-index: 10;
  inset: var(--edge) var(--edge) auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  pointer-events: none;
}

.building-nameplate,
.building-clock {
  background: var(--soot);
  color: var(--bone);
  box-shadow: .4rem .4rem 0 var(--signal);
}

.building-nameplate {
  width: min(31rem, 48vw);
  padding: 1.05rem 1.25rem 1.2rem;
}

.building-nameplate .micro-label { margin: 0 0 .8rem; color: var(--amber); }

.building-nameplate h1 {
  margin: 0;
  font-size: clamp(2.15rem, 4.5vw, 5rem);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .76;
  text-transform: uppercase;
}

.building-nameplate h1 span,
.building-nameplate h1 strong { display: block; }
.building-nameplate h1 strong { font-weight: 700; }

.building-clock {
  min-width: 10.5rem;
  padding: .85rem 1rem;
  text-align: right;
}

.building-clock time,
.building-clock span { display: block; }
.building-clock time { color: var(--amber); font-size: 1rem; }
.building-clock span { margin-top: .2rem; color: var(--quiet); font-size: .72rem; }

.arrival {
  position: absolute;
  z-index: 10;
  left: var(--edge);
  bottom: var(--edge);
  width: min(29rem, calc(100vw - 2 * var(--edge)));
  padding: 1.2rem 1.25rem 1.25rem;
  background: var(--bone);
  color: var(--soot);
  box-shadow: .55rem -.55rem 0 var(--blue);
}

.building-count { margin: 0; color: var(--brick); }
.building-condition { margin: .25rem 0 .6rem; color: rgba(21, 19, 16, .58); font-size: .68rem; }

.arrival h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(2.6rem, 5.6vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: .78;
  text-transform: uppercase;
}

.primary-action,
.leave-light-action {
  width: 100%;
  min-height: 3.4rem;
  border: 0;
  background: var(--signal);
  color: #fff9ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .86rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible,
.leave-light-action:hover,
.leave-light-action:focus-visible { background: var(--blue); }

.primary-action:active,
.leave-light-action:active { transform: translateY(2px); }

.primary-action i,
.leave-light-action i { font-size: 1.2rem; font-style: normal; }

.building-nav {
  position: absolute;
  z-index: 10;
  right: var(--edge);
  bottom: var(--edge);
  display: flex;
  align-items: center;
  gap: .2rem;
  padding: .25rem;
  background: var(--soot);
}

.building-nav button,
.text-button,
.dialog-close {
  min-height: 2.75rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.building-nav button { padding: .6rem .9rem; }
.building-nav button:hover,
.building-nav button:focus-visible,
.text-button:hover,
.text-button:focus-visible { color: var(--amber); }

.room-composer,
.room-receipt {
  position: fixed;
  z-index: 100;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease, visibility 0s linear 420ms;
}

.room-composer { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(25rem, .9fr); background: var(--soot); }

body[data-phase="composer"] .room-composer,
body[data-phase="receipt"] .room-receipt {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 520ms var(--ease-out);
}

.room-visual {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #292522;
}

.room-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(.65) contrast(1.06);
}

.room-light {
  position: absolute;
  inset: 0;
  background: var(--room-light);
  opacity: .33;
  mix-blend-mode: screen;
  transition: background-color 160ms linear, opacity 280ms ease;
}

.room-frame {
  position: absolute;
  inset: 1.25rem;
  border: 1px solid rgba(231, 223, 206, .48);
  pointer-events: none;
}

.room-frame::before,
.room-frame::after {
  content: "";
  position: absolute;
  background: rgba(231, 223, 206, .42);
}

.room-frame::before { top: 0; bottom: 0; left: 50%; width: 1px; }
.room-frame::after { left: 0; right: 0; top: 58%; height: 1px; }

.room-motion { position: absolute; inset: 0; pointer-events: none; }
.room-motion i { position: absolute; display: block; opacity: 0; background: var(--room-light); mix-blend-mode: screen; }
.room-motion i:nth-child(1) { width: 22%; height: 100%; left: 14%; }
.room-motion i:nth-child(2) { width: 9%; height: 100%; right: 18%; }
.room-motion i:nth-child(3) { width: 100%; height: 16%; bottom: 8%; }

body[data-rhythm="breathe"] .room-light { animation: room-breathe 3.8s ease-in-out infinite; }
body[data-rhythm="flicker"] .room-light { animation: room-flicker 3.2s steps(1, end) infinite; }
body[data-rhythm="pass"] .room-motion i:nth-child(1) { animation: shadow-pass 4.8s ease-in-out infinite; }
body[data-rhythm="pulse"] .room-motion i:nth-child(3) { animation: room-pulse 1.8s ease-in-out infinite; }

@keyframes room-breathe { 0%, 100% { opacity: .2; } 50% { opacity: .48; } }
@keyframes room-flicker { 0%, 8%, 12%, 62%, 66%, 100% { opacity: .38; } 9%, 63% { opacity: .08; } }
@keyframes shadow-pass { 0%, 18%, 100% { opacity: 0; transform: translateX(-35vw); } 36%, 62% { opacity: .24; } 82% { opacity: 0; transform: translateX(65vw); } }
@keyframes room-pulse { 0%, 100% { opacity: .04; } 50% { opacity: .3; } }

.room-console {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  padding: var(--edge);
  background: var(--bone);
  color: var(--soot);
}

.room-console__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(21, 19, 16, .26);
}

.room-console__header p,
.room-console__intro p { margin: 0; }

.room-console__header .text-button { color: var(--brick); }

.room-console__intro { padding: clamp(1.6rem, 4vh, 3.5rem) 0 1.25rem; }
.step-count { color: var(--brick); }

.room-console__intro h2 {
  max-width: 11ch;
  margin: .7rem 0 0;
  font-size: clamp(2.5rem, 4vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: .84;
  text-transform: uppercase;
}

.room-form { display: flex; flex-direction: column; gap: 1.3rem; }

.choice-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  padding: 1px;
  border: 0;
  background: rgba(21, 19, 16, .3);
}

.choice-group label { position: relative; min-width: 0; }
.choice-group input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice-group label span {
  min-height: 3rem;
  display: grid;
  place-items: center;
  padding: .55rem .45rem;
  background: var(--bone);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  transition: background-color 160ms ease, color 160ms ease;
}

.choice-group input:checked + span { background: var(--soot); color: var(--bone); }
.choice-group input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: -3px; }

.rhythm-choices { grid-template-columns: repeat(5, 1fr); }
.rhythm-choices legend {
  float: left;
  width: 100%;
  margin: 0 0 .6rem;
  color: var(--brick);
}

.light-control { padding: .9rem 0 .2rem; }
.light-control label { display: flex; justify-content: space-between; gap: 1rem; color: var(--brick); }
.light-control output { color: var(--soot); }

.light-control input[type="range"] {
  width: 100%;
  height: 2rem;
  margin: .8rem 0 .25rem;
  accent-color: var(--signal);
  cursor: ew-resize;
}

.light-scale { display: flex; justify-content: space-between; color: rgba(21, 19, 16, .62); font-size: .7rem; }
.leave-light-action { margin-top: .3rem; }

.room-receipt {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 13, 11, .84);
  backdrop-filter: blur(14px);
}

.receipt-card {
  width: min(42rem, 100%);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  padding: clamp(1.5rem, 5vw, 4rem);
  background: var(--bone);
  color: var(--soot);
  box-shadow: 1rem 1rem 0 var(--blue), -1rem -1rem 0 var(--signal);
}

.receipt-card .micro-label { margin: 0 0 1rem; color: var(--brick); }
.receipt-card h2 { margin: 0; font-size: clamp(3.8rem, 10vw, 8.5rem); letter-spacing: -.08em; line-height: .8; text-transform: uppercase; }
.receipt-card > p:not(.micro-label) { max-width: 31rem; margin: 1.5rem 0 2rem; font-size: 1.12rem; line-height: 1.5; }
.receipt-card .neighbor-reply {
  margin: -1rem 0 1.5rem;
  padding: .75rem 1rem;
  border-left: .35rem solid var(--blue);
  background: rgba(53, 93, 255, .09);
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.neighbor-glimpse {
  --glimpse-light: var(--amber);
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: stretch;
  margin: 0 0 1.6rem;
  padding: .8rem;
  border: 1px solid rgba(21, 19, 16, .22);
  background: var(--soot);
  color: var(--bone);
}

.neighbor-glimpse[hidden] { display: none; }
.neighbor-glimpse__light { min-height: 5.25rem; background: var(--glimpse-light); box-shadow: 0 0 2rem color-mix(in srgb, var(--glimpse-light) 72%, transparent); animation: glimpse-breathe 3.8s ease-in-out infinite; }
.neighbor-glimpse .micro-label { margin: .15rem 0 .45rem; color: var(--amber); font-size: .68rem; }
.neighbor-glimpse strong { display: block; font-size: 1.15rem; line-height: 1.12; }
.neighbor-glimpse strong + span { display: block; margin-top: .6rem; color: var(--quiet); font-family: var(--mono); font-size: .65rem; letter-spacing: .05em; }
@keyframes glimpse-breathe { 0%, 100% { opacity: .48; } 50% { opacity: 1; } }
.receipt-actions { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.2rem; }

.building-dialog {
  position: relative;
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: clamp(1.6rem, 5vw, 3.8rem);
  border: 0;
  border-radius: 0;
  background: var(--bone);
  color: var(--soot);
  box-shadow: .8rem .8rem 0 var(--signal);
}

.building-dialog::backdrop { background: rgba(15, 13, 11, .82); backdrop-filter: blur(10px); }
.building-dialog .micro-label { margin: 0 0 1rem; color: var(--brick); }
.building-dialog h2 { max-width: 11ch; margin: 0; font-size: clamp(2.8rem, 7vw, 5.8rem); letter-spacing: -.075em; line-height: .82; text-transform: uppercase; }
.building-dialog h2 + p { margin: 1.7rem 0 0; font-size: 1.1rem; line-height: 1.58; }
.dialog-close { position: absolute; top: .6rem; right: .7rem; width: 2.8rem; font-size: 2rem; line-height: 1; }
.dialog-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 2rem; font-family: var(--mono); font-size: .85rem; text-transform: uppercase; }
.dialog-links a:hover { color: var(--signal); }

.night-sheet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: .3rem;
  margin-top: 2rem;
  aspect-ratio: 2;
  padding: 1rem;
  background: var(--soot);
}

.night-sheet i { background: rgba(231, 223, 206, .1); }
.night-sheet i.is-lit { background: var(--sheet-light, var(--amber)); box-shadow: 0 0 .55rem color-mix(in srgb, var(--sheet-light, var(--amber)) 54%, transparent); }

.night-download {
  width: 100%;
  min-height: 3.25rem;
  margin-top: 1rem;
  padding: .75rem 1rem;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--soot);
  color: var(--bone);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.night-download:hover,
.night-download:focus-visible { background: var(--blue); }

.ledger { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid rgba(21, 19, 16, .28); }
.ledger .micro-label { margin-bottom: .5rem; }
.ledger h3 { margin: 0 0 1rem; font-size: clamp(1.6rem, 4vw, 2.5rem); letter-spacing: -.05em; line-height: .92; text-transform: uppercase; }
.ledger-list { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.ledger-list details { border: 1px solid rgba(21, 19, 16, .24); background: rgba(21, 19, 16, .035); }
.ledger-list summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; padding: .7rem .8rem; cursor: pointer; font-family: var(--mono); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }
.ledger-list summary::marker { color: var(--signal); }
.ledger-signals { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0 .8rem .8rem; color: rgba(21, 19, 16, .66); font-family: var(--mono); font-size: .66rem; text-transform: uppercase; }
.ledger-signals span { padding: .35rem .5rem; border-left: .35rem solid var(--ledger-color); background: rgba(21, 19, 16, .06); }
.ledger-empty { padding: .8rem; border: 1px solid rgba(21, 19, 16, .22); font-family: var(--mono); font-size: .72rem; text-transform: uppercase; }

.impossible-dialog { width: min(68rem, calc(100% - 2rem)); padding: 0; display: none; grid-template-columns: minmax(0, 1.15fr) minmax(20rem, .85fr); overflow: hidden; background: var(--soot); color: var(--bone); }
.impossible-dialog[open] { display: grid; }
.impossible-dialog .dialog-close { z-index: 2; color: var(--bone); }
.impossible-room-visual { position: relative; min-height: min(70dvh, 42rem); overflow: hidden; background: var(--blue); }
.impossible-room-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(53, 93, 255, .32), transparent 48%, rgba(228, 73, 49, .38)); mix-blend-mode: color; }
.impossible-room-visual img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.35) contrast(1.2) hue-rotate(155deg); }
.impossible-room-copy { align-self: end; padding: clamp(1.5rem, 4vw, 3.5rem); }
.impossible-room-copy .micro-label { color: var(--amber); }
.impossible-dialog h2 { max-width: 8ch; color: var(--bone); }
.impossible-dialog h2 + p { color: var(--quiet); }

.noscript {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 1rem;
  width: min(32rem, calc(100% - 2rem));
  transform: translateX(-50%);
  margin: 0;
  padding: 1rem;
  background: var(--bone);
  color: var(--soot);
  text-align: center;
}

body[data-phase="composer"] .building-experience,
body[data-phase="receipt"] .building-experience { transform: scale(.985); filter: brightness(.62); transition: transform 700ms var(--ease-out), filter 500ms ease; }

@media (max-width: 800px) {
  .building-header { inset: .75rem .75rem auto; }
  .building-nameplate { width: min(21rem, calc(100vw - 8.25rem)); padding: .8rem .9rem .9rem; box-shadow: .3rem .3rem 0 var(--signal); }
  .building-nameplate .micro-label { margin-bottom: .55rem; font-size: .68rem; }
  .building-nameplate h1 { font-size: clamp(1.8rem, 8vw, 3.2rem); line-height: .78; }
  .building-clock { min-width: 6.7rem; padding: .65rem .7rem; box-shadow: .3rem .3rem 0 var(--signal); }
  .building-clock time { font-size: .78rem; }
  .building-clock span { font-size: .62rem; }
  .arrival { left: .75rem; right: .75rem; bottom: 4.8rem; width: auto; padding: .95rem; box-shadow: .4rem -.4rem 0 var(--blue); }
  .building-count { font-size: .68rem; }
  .building-condition { font-size: .58rem; }
  .arrival h2 { margin-bottom: .85rem; font-size: clamp(2.6rem, 13vw, 4.4rem); }
  .building-nav { right: .75rem; bottom: .65rem; left: .75rem; justify-content: space-between; }
  .building-nav button { flex: 1; padding-inline: .35rem; font-size: .7rem; }
  .room-composer { grid-template-columns: 1fr; grid-template-rows: minmax(15rem, 42dvh) minmax(0, 1fr); }
  .room-console { padding: 1rem; }
  .room-console__intro { padding: 1.2rem 0 1rem; }
  .room-console__intro h2 { font-size: clamp(2.25rem, 10vw, 3.8rem); }
  .room-form { gap: 1rem; }
  .choice-group { grid-template-columns: repeat(3, 1fr); }
  .rhythm-choices { grid-template-columns: repeat(5, 1fr); overflow-x: auto; }
  .rhythm-choices label span { min-width: 4.6rem; }
  .choice-group label span { min-height: 2.8rem; font-size: .75rem; }
  .light-control { padding-top: .4rem; }
  .receipt-card { box-shadow: .45rem .45rem 0 var(--blue), -.45rem -.45rem 0 var(--signal); }
  .receipt-actions { grid-template-columns: 1fr; }
  .impossible-dialog[open] { grid-template-columns: 1fr; grid-template-rows: minmax(12rem, 38dvh) auto; overflow-y: auto; }
  .impossible-room-visual { min-height: 0; }
  .impossible-room-copy { padding: 1.3rem; }
}

@media (max-height: 650px) and (orientation: landscape) {
  .building-nameplate h1 { font-size: 2.35rem; }
  .arrival { width: 24rem; }
  .arrival h2 { font-size: 3rem; }
  .room-console__intro { padding: 1rem 0 .8rem; }
  .room-console__intro h2 { font-size: 2.6rem; }
  .room-form { gap: .7rem; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation: none !important; transition-duration: .01ms !important; }
}

@media (forced-colors: active) {
  .building-nameplate,
  .building-clock,
  .arrival,
  .building-nav,
  .room-console,
  .receipt-card,
  .building-dialog { border: 2px solid CanvasText; }
  .building-window.is-lit,
  .building-window.is-available { opacity: 1; border: 2px solid CanvasText; background: Highlight; }
}
