/* masterquest.fyi: the game's own look. Slate panels, brushed-brass
   accents, Philosopher for display (the in-game UI face), system sans for
   reading. One narrow reading column; a hex-framed hero on the home page. */
@font-face {
  font-family: "Philosopher";
  src: url("fonts/Philosopher-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --slate: #12181d;        /* page ground, deeper than the in-game panel */
  --panel: #1c242c;        /* UITheme.PANEL_BG */
  --panel-edge: #786953;   /* UITheme.PANEL_BORDER */
  --brass: #c8a768;        /* UITheme.GOLD */
  --brass-soft: #8f7a52;
  --text: #e5e6e4;         /* UITheme.TEXT_PRIMARY */
  --text-2: #a9b1b8;       /* UITheme.TEXT_SECONDARY */
  --rule: #2c353d;
  --display: "Philosopher", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { background: var(--slate); }
body {
  margin: 0;
  background: var(--slate);
  color: var(--text);
  font: 1rem/1.65 var(--body);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--brass); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }

.wrap {
  max-width: calc(var(--measure) + 2rem);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Header and footer */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1rem; }
.mark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font: 1.25rem/1 var(--display); letter-spacing: 0.02em; }
.mark svg { width: 28px; height: 28px; flex: none; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-head nav a { color: var(--text-2); text-decoration: none; font-size: 0.95rem; padding-block: 0.25rem; border-bottom: 1px solid transparent; }
.site-head nav a:hover { color: var(--text); }
.site-head nav a[aria-current="page"] { color: var(--brass); border-bottom-color: var(--brass-soft); }

.site-foot { border-top: 1px solid var(--rule); margin-top: 4rem; color: var(--text-2); font-size: 0.875rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1.5rem 2.5rem; }
.site-foot a { color: var(--text-2); }

/* Home */
.hero { position: relative; margin-top: 2rem; }
.hero figure {
  margin: 0;
  aspect-ratio: 16 / 9;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--panel-edge);
  border-radius: 3px;
  background: var(--panel);
}
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero figcaption { margin-top: 0.5rem; color: var(--text-2); font-size: 0.8rem; }
.home-title { font: 3rem/1.05 var(--display); color: var(--brass); margin: 2.25rem 0 0.75rem; letter-spacing: 0.01em; text-wrap: balance; }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--text); margin: 0 0 1.5rem; max-width: 34rem; text-wrap: pretty; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0; margin: 2rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts div { padding: 0.9rem 1rem 0.9rem 0; min-width: 0; }
.facts dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }
.facts dd { margin: 0.2rem 0 0; font: 1.15rem/1.3 var(--display); color: var(--text); }
.status { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text-2); font-size: 0.95rem; }
.status::before { content: ""; width: 0.6rem; height: 0.7rem; background: var(--brass); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }

/* Documents */
.doc { padding-top: 2.5rem; }
.doc h1 { font: 2.4rem/1.1 var(--display); color: var(--brass); margin: 0 0 0.5rem; text-wrap: balance; }
.doc .meta { color: var(--text-2); font-size: 0.9rem; margin: 0 0 2rem; }
.doc h2 {
  font: 1.45rem/1.25 var(--display); color: var(--text);
  margin: 2.5rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 0.6rem; text-wrap: balance;
}
.doc h2::before {
  content: ""; flex: none; width: 0.7rem; height: 0.8rem; transform: translateY(-0.05rem);
  background: var(--brass); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.doc h3 { font-size: 1rem; margin: 1.5rem 0 0.4rem; color: var(--text); }
.doc p, .doc li { max-width: var(--measure); }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: 0.3rem 0; }
.doc li::marker { color: var(--brass-soft); }
.summary {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 3px;
  padding: 1rem 1.25rem; margin: 0 0 1rem;
}
.summary p { margin: 0.4rem 0; }
.summary strong { color: var(--brass); font-weight: 600; }
.table-scroll { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--rule); border-radius: 3px; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.92rem; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--text-2); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; background: var(--panel); }
tr:last-child td { border-bottom: 0; }
td:last-child { white-space: nowrap; color: var(--brass); }
.addr {
  display: inline-block; font: 1.25rem/1.3 var(--display); color: var(--brass);
  padding: 0.5rem 0.9rem; border: 1px solid var(--panel-edge); border-radius: 3px; background: var(--panel);
  user-select: all; word-break: break-all;
}
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88em; color: var(--text); background: var(--panel); padding: 0.1em 0.35em; border-radius: 2px; }
.notfound { padding-top: 4rem; }

@media (max-width: 30rem) {
  .home-title { font-size: 2.35rem; }
  .doc h1 { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
