/* DUST devlog — shared stylesheet.
   Used by public/devlog/index.html (style.css) and public/devlog/entries/*.html (../style.css).
   Plain CSS: no external requests, no web fonts, no build step. One deliberate dark, earthy look.
   Works from 360px wide. */

:root {
  color-scheme: dark;
  --bg: #17140f;
  --surface: #201c15;
  --surface-2: #2a251c;
  --border: #3d3629;
  --text: #e9e1d3;
  --muted: #a99d8a;
  --accent: #d19b4b;
  --accent-hover: #e8b96a;
  --code-bg: #100e0a;
  --tag-bg: #2f2920;
  --max-width: 46rem;
}

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

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

body {
  margin: 0;
  padding: 0 1rem;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--accent-hover); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */

.site-header, main, .site-footer {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 1rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.18em;
  text-decoration: none;
  color: var(--text);
}
.brand:hover { color: var(--accent-hover); }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--accent-hover); text-decoration: underline; }
.site-nav [aria-current="page"] { color: var(--text); }

main { padding: 1.5rem 0 3rem; }

.site-footer {
  padding: 1.25rem 0 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer p { margin: 0 0 0.4rem; }

/* ---------- Typography ---------- */

h1, h2, h3 { line-height: 1.25; font-weight: 700; margin: 0 0 0.6em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.6rem, 2.5vw + 1rem, 2.25rem); }
h2 { font-size: 1.35rem; margin-top: 2.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
h3 { font-size: 1.05rem; margin-top: 1.5rem; }

p, ul, ol, table, pre, blockquote { margin: 0 0 1rem; }
ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.35rem; }
li > ul, li > ol { margin-top: 0.35rem; margin-bottom: 0.35rem; }
li > pre { margin-top: 0.5rem; }

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.lead { font-size: 1.05rem; }
.meta { color: var(--muted); font-size: 0.9rem; }
.muted { color: var(--muted); }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  background: var(--surface);
}
blockquote p:last-child { margin-bottom: 0; }

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  font-size: 0.9em;
}
code {
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  line-height: 1.45;
}
pre code { background: none; padding: 0; font-size: 0.85rem; overflow-wrap: normal; }

.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.925rem; }
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
th { color: var(--muted); font-weight: 600; }

/* Design-status markers, same vocabulary as docs/GAME_DESIGN.md */
.marker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
  white-space: nowrap;
}
.marker-known { color: #9cc48a; border-color: #4a5e40; }
.marker-tbd { color: #d9b36a; border-color: #6a5630; }
.marker-open { color: #d78f77; border-color: #6c4438; }

/* ---------- Index: entry list ---------- */

.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list > li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.entry-list h3 { margin: 0 0 0.25rem; font-size: 1.15rem; }
.entry-list h3 a { text-decoration: none; }
.entry-list h3 a:hover { text-decoration: underline; }
.entry-list p:last-of-type { margin-bottom: 0; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
}
.tags li {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  background: var(--tag-bg);
  border-radius: 999px;
  padding: 0.1em 0.6em;
}

/* ---------- Entry pages ---------- */

.entry-header {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.entry-header h1 { margin-bottom: 0.4rem; }
.entry-header .meta { margin-bottom: 0; }

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem 0.9rem 2.4rem;
  font-size: 0.925rem;
  columns: 2;
  column-gap: 1.5rem;
}
.toc li { break-inside: avoid; margin-bottom: 0.2rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

.cols { columns: 2; column-gap: 1.5rem; }
.cols li { break-inside: avoid; }

.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--muted);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  font-size: 0.925rem;
}
.note p:last-child { margin-bottom: 0; }

.entry-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 520px) {
  body { padding: 0 0.9rem; }
  h2 { font-size: 1.2rem; }
  .toc, .cols { columns: 1; }
  .toc { padding-left: 2rem; }
  th, td { padding: 0.35rem 0.4rem; }
  pre { padding: 0.6rem 0.75rem; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
