/* Myth Quests user manual. Dark by default (the editor's own look), light on request of the reader's system. */
:root {
  --bg: #17181a;
  --panel: #1f2023;
  --panel-2: #26282c;
  --line: #34373c;
  --text: #e4e2dd;
  --muted: #a7a49c;
  --accent: #c8834b;
  --accent-2: #e0a571;
  --ok: #7fb37a;
  --warn: #d6b25e;
  --bad: #d4746a;
  --code-bg: #121315;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f4f0;
    --panel: #ffffff;
    --panel-2: #f0ede7;
    --line: #dcd7ce;
    --text: #23211d;
    --muted: #6b665d;
    --accent: #a85f24;
    --accent-2: #8a4c1b;
    --code-bg: #f3f0ea;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Segoe UI", "Inter", system-ui, sans-serif;
}
a {
  color: var(--accent-2);
}
.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}
nav.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 18px 40px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  font-size: 14px;
}
nav.toc .brand {
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 4px;
}
nav.toc .brand span {
  color: var(--accent);
}
nav.toc .brand .brand-mark {
  width: 22px;
  height: 22px;
  margin-right: 8px;
  vertical-align: -4px;
}
nav.toc .brand .brand-marker {
  fill: var(--accent);
}
nav.toc .sub {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 18px;
}
nav.toc .lang {
  display: inline-block;
  margin: -10px 0 16px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  text-decoration: none;
}
nav.toc .lang:hover {
  border-color: var(--accent);
}
nav.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: sec;
}
nav.toc > ol > li {
  counter-increment: sec;
  margin: 2px 0;
}
nav.toc > ol > li > a::before {
  content: counter(sec) ". ";
  color: var(--muted);
}
nav.toc a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}
nav.toc a:hover {
  background: var(--panel-2);
}
nav.toc ol ol a {
  padding-left: 26px;
  color: var(--muted);
  font-size: 13px;
}
nav.toc .soon {
  color: var(--muted);
  opacity: 0.6;
}
main {
  min-width: 0;
  padding: 40px clamp(16px, 4vw, 64px) 120px;
  max-width: 1180px;
}
h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 8px;
}
h2 {
  font-size: 27px;
  margin: 72px 0 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
h2 .num {
  color: var(--accent);
  margin-right: 10px;
}
h3 {
  font-size: 20px;
  margin: 40px 0 8px;
}
h4 {
  font-size: 16px;
  margin: 24px 0 6px;
}
p,
li {
  max-width: 78ch;
}
.lead {
  color: var(--muted);
  font-size: 18px;
  max-width: 70ch;
}
figure {
  margin: 20px 0 28px;
}
figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
  max-width: 90ch;
}
figcaption b {
  color: var(--text);
}
.callout {
  border-left: 4px solid var(--accent);
  background: var(--panel);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 18px 0;
  max-width: 86ch;
}
.callout.warn {
  border-color: var(--warn);
}
.callout.bad {
  border-color: var(--bad);
}
.callout.ok {
  border-color: var(--ok);
}
.callout > :first-child {
  margin-top: 0;
}
.callout > :last-child {
  margin-bottom: 0;
}
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 56px;
  margin: 10px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 90ch;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #1b130c;
  font-weight: 700;
  text-align: center;
  line-height: 28px;
}
.steps .expect {
  color: var(--ok);
}
.steps .fail {
  color: var(--bad);
}
kbd,
.ui {
  font: 600 13px/1 "Segoe UI", system-ui, sans-serif;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  white-space: nowrap;
}
code {
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}
pre code {
  background: none;
  padding: 0;
}
table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 15px;
  max-width: 100%;
}
th,
td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--panel-2);
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}
.grid-2 figure {
  margin: 0;
}
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: zoom-out;
}
.lightbox.open {
  display: flex;
}
.lightbox img {
  max-width: 98vw;
  max-height: 96vh;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  nav.toc {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
