/* Hidden Spheres: shared design language.
   No frameworks, no fonts fetched, no build step. */

:root {
  --bg: #0b0e14;
  --bg-raised: #11151f;
  --ink: #e8e4d9;
  --ink-dim: #9a958a;
  --gold: #d9a94e;
  --blue: #8ab4d8;
  --line: #232937;
  --serif: "Iowan Old Style", "Palatino", "Georgia", serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f4ec;
    --bg-raised: #fffdf7;
    --ink: #232019;
    --ink-dim: #6f6a5e;
    --gold: #a87b1e;
    --blue: #33628c;
    --line: #ddd6c6;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold); }

h1, h2, h3 { font-weight: 500; line-height: 1.2; letter-spacing: 0.01em; }
h1 { font-size: 2.1rem; margin: 0.2em 0 0.3em; }
h2 { font-size: 1.35rem; margin-top: 2.2em; }

.smallcaps {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

header.site { padding: 2.5rem 0 0; }
header.site .mark { display: flex; align-items: center; gap: 0.75rem; }
header.site a.home { color: var(--ink); text-decoration: none; }

footer.site {
  margin-top: 5rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  font-size: 0.9rem;
}
footer.site p { margin: 0.3em 0; }

/* Exhibit cards on the atlas page */
.exhibits { list-style: none; padding: 0; margin: 2.5rem 0 0; }
.exhibits li {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: 10px;
  margin-bottom: 1rem;
  transition: border-color 200ms ease;
}
.exhibits li:hover { border-color: var(--gold); }
.exhibits a, .exhibits .soon {
  display: block; padding: 1.1rem 1.3rem; text-decoration: none; color: inherit;
}
.exhibits .num { font-family: var(--mono); font-size: 0.8rem; color: var(--gold); }
.exhibits .title { font-size: 1.2rem; margin: 0.15em 0; }
.exhibits .blurb { color: var(--ink-dim); font-size: 0.95rem; margin: 0; }
.exhibits li.forthcoming { opacity: 0.55; }
.exhibits li.forthcoming:hover { border-color: var(--line); }

/* Exhibit pages */
.stage-frame {
  border: 1px solid var(--line);
  background: var(--bg-raised);
  border-radius: 10px;
  overflow: hidden;
  margin: 1.5rem 0 0.6rem;
}
canvas.stage { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
canvas.stage:active { cursor: grabbing; }
canvas.stage:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

.controls {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  margin: 0.4rem 0 0; font-size: 0.9rem;
}
.controls button {
  font: inherit; font-size: 0.88rem;
  color: var(--ink); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: 7px;
  padding: 0.35rem 0.85rem; cursor: pointer;
}
.controls button:hover { border-color: var(--gold); color: var(--gold); }
.controls button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold); }
.controls .hint { color: var(--ink-dim); font-size: 0.85rem; margin-left: auto; }
.controls input[type="range"] { accent-color: var(--gold); width: 10rem; }
.controls label { font-size: 0.88rem; color: var(--ink-dim); display: flex; align-items: center; gap: 0.5rem; }
.whisper {
  text-align: center; color: var(--blue); font-style: italic; font-size: 0.95rem;
  min-height: 1.4em; margin: 0.6rem 0 0; opacity: 0; transition: opacity 2s ease;
}
.whisper.on { opacity: 1; }

.prose-levels h2 { margin-top: 2.6em; }
.prose-levels .level { color: var(--gold); }
blockquote {
  margin: 1.5em 0; padding: 0.1em 1.2em;
  border-left: 2px solid var(--gold);
  color: var(--ink-dim); font-style: italic;
}

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

/* The hunt: the front door is a dark room */
body.hunt { overflow: hidden; height: 100dvh; }
canvas#space {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; cursor: grab;
}
canvas#space:active { cursor: grabbing; }
canvas#space:focus-visible { outline: 2px solid var(--gold); outline-offset: -3px; }
.hunt-brand {
  position: fixed; top: 1rem; left: 1.2rem; margin: 0;
  font-variant-caps: all-small-caps; letter-spacing: 0.14em;
  color: var(--ink-dim); pointer-events: none;
}
.hunt-intro {
  position: fixed; top: 24%; left: 50%; transform: translateX(-50%);
  width: min(34rem, calc(100% - 3rem)); text-align: center;
  pointer-events: none; transition: opacity 1400ms ease;
}
.hunt-intro.gone { opacity: 0; }
.hunt-intro h1 { font-size: 2rem; margin-bottom: 0.2em; }
.hunt-intro p { color: var(--ink-dim); }
.hunt-intro a { pointer-events: auto; }
.hunt-intro.gone a { pointer-events: none; }
.atlas-link {
  position: fixed; right: 1.2rem; bottom: 1rem;
  font-size: 0.85rem; color: var(--ink-dim);
}
a.skip {
  position: fixed; top: 0.7rem; left: 50%; z-index: 10;
  transform: translate(-50%, -300%);
  background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: 7px; padding: 0.4rem 0.9rem; font-size: 0.9rem;
}
a.skip:focus { transform: translate(-50%, 0); }
