/* Monochrome by construction: the scene is a character raster, so chrome that
   competes with it in colour would only muddy the value structure. Every value
   here is on one grey axis, same as the render. */

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

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; /* taste-skill-ignore: character-grid medium */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { position: relative; }

#stage {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ------------------------------------------------------------------ identity */
.id {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: baseline;
  gap: .9em;
  flex-wrap: wrap;
  padding: clamp(13px, 1.9vw, 24px);
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 3;
  /* the canvas draws characters right up to the edges, so the identity needs a
     floor of its own or it becomes unreadable over bright glyphs */
  background: linear-gradient(to bottom, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .72) 45%, rgba(0, 0, 0, 0) 100%);
}
.id__name { color: #fff; font-weight: 600; }
.id__rule { color: #2f2f2f; }
.id__what { color: #6b6b6b; }

/* ------------------------------------------------------------------- markers */
/* positioned by JS at the crown of each monument; the canvas is not focusable,
   so these are the real, reachable controls */
.markers { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

.marker {
  position: absolute;
  top: 0; left: 0;
  margin: 0;
  padding: 3px 7px;
  border: 1px solid transparent;
  background: none;
  color: #e6e6e6;
  font: inherit;
  font-size: 10px;
  letter-spacing: .19em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  will-change: transform;
  transition: opacity .35s ease, border-color .18s ease, background-color .18s ease, color .18s ease;
}
.marker::before { content: "▸"; color: #767676; margin-right: .55em; }
.marker:hover,
.marker:focus-visible {
  border-color: #4c4c4c;
  background-color: rgba(0, 0, 0, .72);
  color: #fff;
  outline: none;
}
.marker:focus-visible { border-color: #fff; }

/* ----------------------------------------------------------------------- hud */
.hud {
  position: fixed;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.2em;
  flex-wrap: wrap;
  padding: clamp(12px, 1.7vw, 22px);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: #646464;
  pointer-events: none;
  z-index: 3;
  transition: opacity .4s ease;
}
.hud--bottom {
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .74) 48%, rgba(0, 0, 0, 0) 100%);
  padding-top: clamp(28px, 4vw, 46px);
}
.is-reading .hud { opacity: 0; pointer-events: none; }

.hint { margin: 0; }
.hint--dim { color: #454545; }
.hint__k { color: #b4b4b4; }
.hint__sep { color: #2d2d2d; margin: 0 .55em; }
.hint a {
  color: #8a8a8a;
  text-decoration: none;
  border-bottom: 1px solid #262626;
  pointer-events: auto;
  transition: color .18s ease, border-color .18s ease;
}
.hint a:hover { color: #fff; border-bottom-color: #6a6a6a; }

/* ------------------------------------------------------------------- readout */
/* The link is DRAWN into the character grid by the canvas. This anchor sits
   exactly on top of those cells so the same thing is a real focusable link —
   the visual and the accessible control share one set of coordinates. */
#readout-open {
  position: fixed;
  left: 0; top: 0;
  width: 0; height: 0;
  border: 1px solid transparent;
  color: transparent;
  text-decoration: none;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  transition: background-color .18s ease, border-color .18s ease;
}
#readout-open.is-on { pointer-events: auto; cursor: pointer; }
#readout-open.is-on:hover { border-color: #5e5e5e; background-color: rgba(255, 255, 255, .055); }
#readout-open:focus-visible { outline: 1px solid #fff; outline-offset: 1px; border-color: #fff; }

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

/* ------------------------------------------------------------------ no-JS */
.fallback {
  position: fixed;
  inset: 0;
  padding: clamp(20px, 4vw, 48px);
  background: #000;
  font-size: 13px;
  line-height: 1.75;
  overflow: auto;
}
.fallback__head {
  margin: 0 0 1.6em;
  font-size: 11px;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: #fff;
}
.fallback ul { padding-left: 1.1em; margin: 0 0 1.8em; }
.fallback li { margin-bottom: .5em; }
.fallback a { color: #fff; text-decoration: none; border-bottom: 1px solid #333; }

/* ------------------------------------------------------------------ narrow */
@media (max-width: 560px) {
  .id { font-size: 10px; letter-spacing: .13em; gap: .7em; }
  .id__rule { display: none; }
  .marker { font-size: 9px; letter-spacing: .14em; padding: 2px 5px; }
  .hud { font-size: 9.5px; letter-spacing: .07em; }
  .hint__extra { display: none; }
}

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