/* The arcade (site name: games.yaml site.title): the one stylesheet for every page the arcade writes
   (templates/). It carries the games' own look (mazegame player.css: the same
   colours, the stage, the caption over the picture, the pill, the bar and its
   quiet buttons), so the site and the games read as one thing. Dark only, as
   the games are. The hover caption is CSS (SPEC_v2); the one script, state.js,
   only picks a node and reorders (SPEC_v3: the rules at the end of this file). */
:root {
  --bg: #121110;
  --panel: #1c1a18;
  --ink: #ece6dc;
  --muted: #a39a8c;
  --line: #3a3530;
  --accent: #d8b46a;
  --accent-ink: #1a1408;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 Georgia, "Times New Roman", serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}
a { color: var(--accent); }
a:focus-visible { outline: 2px solid rgba(236, 230, 220, .8); outline-offset: 2px; }

.skip {
  position: absolute; left: 8px; top: -40px;
  padding: 6px 10px; background: var(--panel); border: 1px solid var(--accent); border-radius: 4px;
}
.skip:focus { top: 8px; }
.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

/* header + nav: identical on every page */
header.top, main, footer.foot {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}
header.top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px; padding-bottom: 20px;
}
.brand {
  margin: 0; font-size: 1.25rem; font-weight: normal; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
}
.brand a { color: inherit; text-decoration: none; }
.home header.top { padding-top: 40px; padding-bottom: 12px; }
.home .brand { font-size: clamp(1.9rem, 5vw, 2.75rem); }
header.top nav ul, footer.foot ul {
  display: flex; flex-wrap: wrap; gap: 4px 20px;
  list-style: none; margin: 0; padding: 0;
}
header.top nav a, footer.foot a { color: var(--muted); text-decoration: none; font-size: 14px; }
header.top nav a:hover, footer.foot a:hover { color: var(--ink); }

main { flex: 1; padding-bottom: 48px; }
.tagline { margin: 0 0 28px; max-width: 60ch; font-size: 1.1rem; }

/* sections and the grid (front page, the about pages' "more" strip) */
.section-h {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: normal;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.videos, .more { margin-top: 48px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 28px 24px;
}
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); }

/* one entry, in the games' form: a picture you click, a caption when you hover */
.stage {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: #000; border-radius: 6px; color: var(--ink); text-decoration: none;
}
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overlay {
  position: absolute; left: 0; right: 0; top: 0; padding: 14px 18px 40px;
  background: linear-gradient(rgba(0, 0, 0, .82), transparent);
  font-size: 15px; line-height: 1.4; text-shadow: 0 1px 3px #000;
  opacity: 0; transition: opacity .15s;
}
.stage:hover .overlay, .room:focus-within .overlay { opacity: 1; }
@media (hover: none) { .overlay { opacity: 1; } }
.found {
  position: absolute; left: 10px; bottom: 10px; padding: 5px 11px; border-radius: 14px;
  background: rgba(0, 0, 0, .65); font-size: 14px; line-height: 1.3;
}
.bar {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px;
  margin: 10px 2px 0;
}
.bar h2, .bar h3 { margin: 0; flex: 1 1 auto; font-size: 17px; font-weight: normal; }
.bar h2 a, .bar h3 a { color: var(--ink); text-decoration: none; }
.bar h2 a:hover, .bar h3 a:hover { color: var(--accent); }
.acts { display: flex; gap: 8px; white-space: nowrap; }
.quiet {
  border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 10px; color: var(--muted); text-decoration: none; font-size: 13px;
}
.quiet:hover { color: var(--ink); }
.quiet.go { border-color: var(--accent); color: var(--accent); }
.quiet.go:hover { background: var(--accent); color: var(--accent-ink); }

/* the launch button on about pages */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid var(--accent); border-radius: 4px;
  color: var(--accent); text-decoration: none; font-size: 14px;
}
.btn-go { background: var(--accent); color: var(--accent-ink); }
.btn-go:hover { filter: brightness(1.1); }
.btn-big { padding: 11px 22px; font-size: 16px; }

/* about pages */
.about-head {
  display: grid; gap: 24px; align-items: center;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .about-head { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}
.cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 6px; }
.about-title h1, .page h1 {
  margin: 0 0 12px; font-weight: normal; line-height: 1.2;
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
}
.lede { margin: 0 0 20px; color: var(--muted); font-size: 1.1rem; }
.launch-foot { margin: 32px 0 0; }

/* markdown text */
.prose { max-width: 68ch; margin-top: 32px; font-size: 1.05rem; }
.page .prose { margin-top: 16px; }
.prose h2 { font-weight: normal; font-size: 1.4rem; margin: 1.8em 0 0.5em; color: var(--accent); }
.prose h3 { font-weight: normal; font-size: 1.15rem; margin: 1.4em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose strong { font-weight: normal; color: var(--accent); }
.prose img { max-width: 100%; height: auto; display: block; border-radius: 6px; margin: 1.5em 0; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose pre { overflow-x: auto; background: var(--panel); padding: 12px; border-radius: 4px; }
.prose code { font-size: 0.9em; }
.prose blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 3px solid var(--line); color: var(--muted); }

footer.foot {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px; padding-bottom: 32px;
  border-top: 1px solid var(--line);
}
footer.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .overlay { transition: none; }
}

/* ------------------------------------------------------------------ v3: the nodes
   state.js puts the node id on <html data-node> and reorders the entries;
   everything a node looks like is here (docs/SPEC_v3.md). Without the script
   there is no data-node and none of this applies. */
.status { margin: 0 0 24px; color: var(--muted); font-size: 14px; letter-spacing: 0.04em; }
.obj, .name { display: none; }
.found[data-n]::after { content: " \00b7  seen " attr(data-n) "\00d7"; }
.reset {
  font: inherit; font-size: 12px; color: var(--muted); background: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px;
}
.reset:hover { color: var(--ink); }

/* A2 regular: the one you keep coming back to leads */
html[data-node="A2"] .room.lead { grid-column: 1 / -1; }

/* A3 index, A4 cabinet, A5 objects: you have seen everything, so the sections
   dissolve into one contact sheet */
html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) :is(.tagline, .section-h) { display: none; }
html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) .videos { margin: 0; }
html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) .grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
  gap: 20px 14px;
}
@media (max-width: 520px) {
  html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) .room :is(h2, h3) { font-size: 14px; }
html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) .quiet { padding: 3px 7px; font-size: 12px; }
html:is([data-node="A3"], [data-node="A4"], [data-node="A5"]) .overlay { padding: 8px 10px 24px; font-size: 12px; }
/* small pictures: no blurb over them, and the pill says only how often you have been */
html:is([data-node="A3"], [data-node="A4"]) .overlay { display: none; }
html:is([data-node="A3"], [data-node="A4"]) .found { left: 6px; bottom: 6px; padding: 3px 8px; font-size: 0; }
html:is([data-node="A3"], [data-node="A4"]) .found[data-n]::after { content: "seen " attr(data-n) "\00d7"; font-size: 11px; }

/* an entry as its object */
.room.as-object .pic { display: none; }
.room.as-object .obj { display: block; }

/* A5 objects: nothing but the things; a name when you point at one */
html[data-node="A5"] :is(.blurb, .found) { display: none; }
html[data-node="A5"] .name { display: block; font-weight: normal; font-size: 13px; }
html[data-node="A5"] .bar { height: 0; margin: 0; overflow: hidden; }
html[data-node="A5"] .room:focus-within .bar { height: auto; margin-top: 8px; }
html[data-node="A5"] .grid { gap: 14px; }
