:root {
  --fg: #e9e7f2;
  --muted: #8e8ca3;
  --pill: rgba(10, 11, 18, .6);
  --pill-line: rgba(255, 255, 255, .12);
  --veil: #07080d;
  --link: #ff5a4e;
  --mark: #2f6bff;
  --body: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --display: "VT323", "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
:root[data-tone="light"] {
  --fg: #14141a;
  --muted: #4d4f5c;
  --pill: rgba(252, 252, 249, .72);
  --pill-line: rgba(20, 20, 26, .14);
  --veil: #f4f1ea;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--veil); color: var(--fg); font: 13px/1.6 var(--body); }
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }

#hud {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
.who {
  font: 400 32px/1 var(--display); margin: 0; padding: 8px 12px 6px; border-radius: 10px;
  background: var(--pill); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.who small { display: block; font: 12px/1.6 var(--body); color: var(--muted); margin-top: 4px; }
#sections { display: flex; flex-wrap: wrap; gap: 6px; }
#sections button {
  font: inherit; color: var(--muted); background: var(--pill);
  border: 1px solid var(--pill-line); border-radius: 999px; padding: 4px 12px; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: color .15s, border-color .15s;
}
#sections button:hover { color: var(--fg); }
#sections button[aria-pressed="true"] { color: var(--fg); border-color: var(--link); }
#sections button:focus-visible, a:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
#links { display: flex; gap: 16px; min-height: 1.6em; margin-top: 10px; }
#links a { padding: 0 4px; border-radius: 4px; background: var(--pill); }
a { color: var(--fg); text-decoration: underline 2px var(--link); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 4px; }

.corner {
  position: fixed; top: 16px; right: 16px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  max-width: calc(100% - 32px);
}
.corner a {
  color: var(--muted); text-decoration: none; padding: 2px 10px; border-radius: 999px;
  background: var(--pill); border: 1px solid var(--pill-line);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.corner a:hover { color: var(--fg); }
.corner a[aria-current="page"] { color: var(--fg); border-color: var(--link); }

#tip {
  position: fixed; left: 0; top: 0; pointer-events: none; opacity: 0;
  font: 400 20px/1 var(--display); color: var(--fg); padding: 4px 8px; border-radius: 4px;
  background: var(--pill); border: 1px solid var(--pill-line);
  transform: translate(14px, 14px); transition: opacity .12s; white-space: nowrap;
}
#veil {
  position: fixed; inset: 0; display: grid; place-items: center; background: var(--veil);
  font: 400 28px var(--display); color: var(--muted); transition: opacity .8s; z-index: 2;
}
#veil.gone { opacity: 0; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 600px) {
  #hud { flex-direction: column; align-items: stretch; }
  .who { font-size: 26px; }
}
