:root {
  --paper: #e9dec9;
  --ink: #1d1c1a;
  --rule: rgba(29, 28, 26, 0.25);
  color-scheme: light;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
}

:root[data-theme="dark"] {
  --paper: #111c26;
  --ink: #d9e8ed;
  --rule: rgba(217, 232, 237, 0.3);
  color-scheme: dark;
}

html, body { margin: 0; background: var(--paper); color: var(--ink); }

#appearance {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 10px var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  padding-left: 10px;
  border: 1px solid var(--rule);
}
#theme {
  font: inherit;
  color: inherit;
  background: var(--paper);
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  padding: 10px;
  min-height: 40px;
  cursor: pointer;
}
#theme:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* The page only scrolls; the scene stays fixed and reads the scroll position. */
#track { height: 900vh; }

#scene, #labels {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}
#labels { pointer-events: none; }

.room-label {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.35;
  white-space: nowrap;
}
.room-label small {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.02em;
  text-transform: none;
  opacity: 0.75;
}
.room-label.street { font-size: 12px; letter-spacing: 0.4em; }
.dim-label {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--paper);
  padding: 0 4px;
}
.rot { display: inline-block; transform: rotate(-90deg); }
.room-label.minor { font-size: 7.5px; letter-spacing: 0.04em; opacity: 0.8; }
.dim-label.small { font-size: 9px; background: none; }

#titleblock {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 220px;
  border: 1px solid var(--ink);
  padding: 14px 16px 12px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--paper);
}
.tb-name {
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 10px;
}
.tb-row {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding: 4px 0;
}
.north { width: 40px; height: 40px; margin-top: 8px; display: block; }
/* north points straight down the sheet; the letter sits at the arrow tip */
.north-label { width: 40px; text-align: center; margin-top: -2px; }

#hint, #loading {
  position: fixed;
  left: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#hint { bottom: 28px; }
#loading { top: 28px; }
body.ready #loading { display: none; }

/* mini plan in the title block's corner during the walk (the title block is gone by then);
   main.js sets its viewBox and aspect ratio from the plan */
#minimap {
  position: fixed;
  right: 28px;
  bottom: 28px;
  height: min(34vh, 300px);
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
}
#minimap path {
  stroke: var(--paper);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
  paint-order: stroke;
}
#minimap circle { fill: #c8402a; stroke: var(--paper); }

@media (max-width: 700px) {
  #appearance { top: 12px; right: 12px; padding-left: 0; }
  #appearance > span { display: none; }
  #theme { border-left: 0; min-height: 44px; }
  #titleblock { right: 12px; bottom: 12px; width: 170px; padding: 10px; }
  #minimap { right: 12px; bottom: 12px; height: 150px; padding: 6px; }
  .tb-name { font-size: 22px; }
  #hint, #loading { left: 16px; }
}
