/* Shared mechanics for game pages: menu, focus, type loading. Each game supplies its own look. */

@font-face {
  font-family: "Silkscreen";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/silkscreen-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Archivo Narrow";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/archivo-narrow-latin.woff2") format("woff2");
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link, var(--accent)); }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.05; letter-spacing: -0.02em; }
p { margin: 0; }
ul, ol { margin: 0.4rem 0 0; padding-left: 1.2rem; }
button { font: inherit; color: inherit; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { top: 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

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

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 0 22px;
  background: var(--bar, var(--bg));
  border-bottom: 1px solid var(--rule);
}

.mark {
  font-family: var(--display);
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.nav { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.bar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  cursor: pointer;
}
.icon { width: 18px; height: 18px; }
.icon-sun { display: none; }
[data-theme="light"] .icon-sun { display: block; }
[data-theme="light"] .icon-moon { display: none; }
.menu-btn { display: none; }
.menu-lines, .menu-lines::before, .menu-lines::after {
  display: block; width: 16px; height: 1.5px; background: currentColor;
}
.menu-lines { position: relative; }
.menu-lines::before, .menu-lines::after { content: ""; position: absolute; left: 0; }
.menu-lines::before { top: -5px; }
.menu-lines::after { top: 5px; }
.menu-open .menu-lines { background: transparent; }
.menu-open .menu-lines::before { transform: translateY(5px) rotate(45deg); }
.menu-open .menu-lines::after { transform: translateY(-5px) rotate(-45deg); }

.crumbs { font-size: 0.88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }

.stage {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 20px 48px;
}
.stage .lede { margin: 18px auto 0; max-width: 42rem; }
.stage .actions, .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stage .actions { justify-content: center; margin-top: 22px; }
.coming { margin: 0 0 12px; font-weight: 700; }

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}
.btn-solid { background: var(--accent); color: var(--on-accent); }
.btn-solid:hover { background: var(--ink); color: var(--bg); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-line:hover { border-color: var(--ink); }

body.nav-open { overflow: hidden; }

.doc-page main {
  width: min(74ch, calc(100% - 32px));
  margin: 28px auto 72px;
}
.footer { border-top: 1px solid var(--rule); padding: 24px 22px 40px; color: var(--muted); font-size: 0.92rem; }
.footer-inner, .footer nav { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: baseline; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); }

.doc {
  background: var(--paper, transparent);
  color: var(--paper-ink, var(--ink));
  padding: 28px 28px 48px;
}
.doc a { color: var(--paper-link, var(--link)); text-underline-offset: 2px; }
.doc h1, .doc h2, .doc h3 { color: inherit; }
.doc h2 { font-size: 1.35rem; margin: 1.6rem 0 0.5rem; }
.doc h3 { font-size: 1.05rem; margin: 1.05rem 0 0.35rem; font-family: var(--sans); font-weight: 650; }
.doc p, .doc li { color: inherit; }
.doc p + p, .doc ul, .doc ol { margin-top: 0.75rem; }
.doc li { margin: 0.25rem 0; }
.doc code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.92em; }

.draft-banner {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 14px;
  font-weight: 700;
  margin: 0 0 18px;
}

@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: fixed;
    inset: 64px 0 0 0;
    margin: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 22px 32px;
    background: var(--bg);
    overflow: auto;
    visibility: hidden;
  }
  .menu-open .nav { visibility: visible; }
  .nav a {
    font-family: var(--display);
    font-size: 1.6rem;
    color: var(--ink);
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
