/* Music for the Void — tokens duplicated from /styles.css on purpose (same
   known duplication as the Sigil Engine); keep them in sync by hand. */
:root {
  --void: #212736;
  --well: #1a1f2c;
  --ink: #f1e8d7;
  --whisper: rgba(241, 232, 215, 0.6);
  --faint: rgba(241, 232, 215, 0.22);
  --ember: #d69a7d;
  --amp: #d8865d;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: 'Work Sans', system-ui, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  align-items: center;
}
button { font: inherit; }

/* Every ampersand is Zen Dots (brand rule). */
.amp { font-family: 'Zen Dots', sans-serif; font-style: normal; color: var(--amp); }

/* ── Chrome bar (matches /turning/ and /sigil/) ── */
.sv-bar {
  width: min(720px, 92vw);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0 0;
}
.wordmark {
  font-family: 'Zen Dots', 'Oxanium', sans-serif;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dim { color: var(--whisper); }
.wordmark:hover .dim { color: var(--ember); }
.sv-close {
  font-family: 'Oxanium', sans-serif;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--whisper);
  text-decoration: none;
  padding: 10px 8px;
}
.sv-close:hover { color: var(--ember); }
.sv-close:focus-visible, .wordmark:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ── Page ── */
.page {
  width: min(720px, 92vw);
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 26px 0 40px;
}
.plate { text-align: center; }
h1 {
  margin: 0;
  font-family: 'Oxanium', sans-serif;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.2;
  text-wrap: balance;
}
.nameplate {
  margin: 8px 0 0;
  font-family: 'Oxanium', sans-serif;
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--whisper);
}

/* The screen: the line lives here. */
.stage {
  position: relative;
  width: 100%;
  height: clamp(220px, 44vh, 400px);
  background: var(--well);
  border: 1px solid var(--faint);
  border-radius: 4px;
  overflow: hidden;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* First run: a dark screen, one word, one tap. */
.gate {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(26, 31, 44, 0.5);
  transition: opacity 500ms ease;
}
.gate.is-leaving { opacity: 0; pointer-events: none; }
.gate-btn {
  font-family: 'Zen Dots', 'Oxanium', sans-serif;
  font-size: 17px;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  text-transform: lowercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--faint);
  border-radius: 3px;
  padding: 16px 34px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 200ms ease, color 200ms ease;
}
.gate-btn:hover { border-color: var(--ember); color: var(--ember); }
.gate-btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 4px; }

.resume {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  font-family: 'Oxanium', sans-serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--ink);
  background: var(--void);
  border: 1px solid var(--ember);
  border-radius: 3px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
}
.resume:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* Readout: the station and the passage, like the tuner's display. */
.readout {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: 'Oxanium', sans-serif;
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--whisper);
  padding: 0 2px;
}
.readout #ro-station { color: var(--ink); text-shadow: 0 0 6px rgba(214, 154, 125, 0.35); }
.readout #ro-passage { color: var(--whisper); }

/* Transport: three controls, all there is. */
.transport {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.transport button {
  font-family: 'Oxanium', sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--whisper);
  background: transparent;
  border: 1px solid var(--faint);
  border-radius: 3px;
  padding: 11px 22px;
  min-height: 44px;
  min-width: 108px;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease;
}
.transport button:hover { color: var(--ember); border-color: var(--ember); }
.transport button[aria-pressed="true"] { color: var(--ink); border-color: var(--whisper); }
.transport button:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }

.thesis {
  margin: 6px 0 0;
  max-width: 46ch;
  text-align: center;
  font-size: 15px;
  line-height: 1.65;
  color: var(--whisper);
}

footer.site {
  padding: 30px 0 46px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
footer.site .knock .answer { color: var(--amp); }
footer.site .knock {
  font-family: 'Zen Dots', sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--whisper);
}
footer.site .fine {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--faint);
  text-transform: lowercase;
  max-width: 60ch;
}
footer.site a { border: 0; color: var(--whisper); text-decoration: none; }
footer.site a:hover { color: var(--ember); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 8px);
  font-family: 'Oxanium', sans-serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--well);
  border: 1px solid var(--faint);
  border-radius: 3px;
  padding: 10px 16px;
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
  max-width: 88vw;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hud {
  position: fixed;
  left: 8px;
  bottom: 8px;
  margin: 0;
  font: 11px/1.4 ui-monospace, monospace;
  color: var(--whisper);
  background: rgba(26, 31, 44, 0.85);
  padding: 6px 8px;
  border-radius: 3px;
}

/* Embedded in the receiver's screen: the homepage is the chrome, and the
   document sizes to its content so the frame can fit it exactly. */
.embedded .sv-bar, .embedded footer.site, .embedded .thesis, .embedded .plate { display: none; }
html.embedded, .embedded body { height: auto; min-height: 0; }
.embedded .page { padding: 10px 0 14px; gap: 12px; }
.embedded .stage { height: 220px; }

@media (min-width: 640px) {
  h1 { font-size: 30px; }
  .page { gap: 20px; padding: 34px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
