:root {
  /* Matches the web player's palette (player/src/Talewright.Player/wwwroot/talewright.css). */
  --bg: #faf8f3;
  --surface: #fffdf8;
  --text: #222222;
  --muted: #6b6558;
  --border: #d8cfbd;
  --accent: #7a4b1f;
  --accent-text: #faf8f3;
  --code-bg: #f0ebe0;
  --heading-font: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --max: 72rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1a17;
    --surface: #26231f;
    --text: #e8e2d6;
    --muted: #a49c8c;
    --border: #3d382f;
    --accent: #e0a96d;
    --accent-text: #1c1a17;
    --code-bg: #2b2823;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }
main:focus { outline: none; }

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; height: auto; }

h1, h2, h3, .brand { font-family: var(--heading-font); line-height: 1.25; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 4px; }
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }

blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 4px solid var(--accent); background: var(--surface); }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: 46rem; padding-top: 1.5rem; padding-bottom: 3rem; }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  background: var(--surface);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.nav a { text-decoration: none; color: var(--text); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); text-decoration: underline; }
.brand { font-weight: 700; font-size: 1.2rem; }

.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 22ch; margin: 0.25rem 0 1rem; }
.lede { font-size: 1.2rem; max-width: 46rem; }
.eyebrow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; font-weight: 600; margin: 0; }
.note { color: var(--muted); max-width: 46rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 1rem; }

.button {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  border: 2px solid var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.button.primary { background: var(--accent); color: var(--accent-text); }

section.container { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.split { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); align-items: start; }
figure { margin: 0; }
figure img { border: 1px solid var(--border); border-radius: 8px; }
figcaption { color: var(--muted); font-size: 0.9rem; margin-top: 0.4rem; }

.features { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.features li { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.25rem; }
.features h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.features p { margin: 0; color: var(--muted); }

.callout { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 8px; padding: 0.25rem 1.25rem; }
.status li { margin-bottom: 0.5rem; }

.steps { padding-left: 1.25rem; }
.steps h2 { font-size: 1.25rem; margin-bottom: 0.25rem; }

.docs { display: grid; gap: 2rem; grid-template-columns: 15rem minmax(0, 1fr); padding-top: 1.5rem; padding-bottom: 3rem; }
.docs-nav { font-size: 0.95rem; position: sticky; top: 1rem; align-self: start; max-height: calc(100vh - 2rem); overflow-y: auto; }
.docs-nav ul { list-style: none; margin: 0 0 1rem; padding: 0; }
.docs-nav li { margin: 0.2rem 0; }
.docs-nav a { text-decoration: none; }
.docs-nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.docs-nav-heading { font-weight: 700; margin: 0.75rem 0 0.25rem; }
.docs-content { min-width: 0; max-width: 50rem; }
.docs-content h1 { margin-top: 0; }
.docs-source { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }

@media (max-width: 48rem) {
  .docs { grid-template-columns: 1fr; }
  .docs-nav { position: static; max-height: none; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
}

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
