/* One built-in stylesheet. Single fixed palette, no theming surface. */

@font-face { font-family: "Archivo"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/archivo-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/archivo-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Spline Sans Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/spline-sans-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Spline Sans Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/spline-sans-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }

:root {
  --serif: "Source Serif 4", Georgia, serif;
  --display: "Archivo", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, monospace;
  --bg: #faf8f2;
  --surface: #fffefb;
  --ink: #23201b;
  --muted: #6b655c;
  --rule: #e2dccf;
  --accent: #7a3b2e;
  --link: #315b6e;
  --measure: 42rem;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
}

.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.7rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { font-family: var(--display); font-weight: 600; font-size: 0.85rem; color: var(--muted); text-decoration: none; text-transform: uppercase; letter-spacing: 0.04em; }
.topbar nav a:hover { color: var(--accent); }
.topbar .search { margin-left: auto; }
.topbar .search input, .filter, .searchform input, .searchform button {
  font: inherit; padding: 0.35rem 0.6rem; border: 1px solid var(--rule);
  border-radius: 4px; background: var(--bg); color: var(--ink);
}

a { color: var(--link); }

main { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem; }
main.page { display: grid; grid-template-columns: minmax(0, var(--measure)) 18rem; gap: 2.5rem; align-items: start; }
@media (max-width: 60rem) { main.page { grid-template-columns: 1fr; } }

.markdown { font-size: 1.05rem; overflow-wrap: break-word; }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 { font-family: var(--display); line-height: 1.25; color: var(--ink); }
.markdown h1 { font-size: 2rem; font-weight: 800; }
.markdown h2 { font-size: 1.4rem; border-bottom: 1px solid var(--rule); padding-bottom: 0.2rem; margin-top: 2rem; }
.markdown code { font-family: var(--mono); font-size: 0.9em; background: #f0ece1; padding: 0.1em 0.35em; border-radius: 3px; }
.markdown pre { background: #2b2822; color: #f3efe6; padding: 1rem; border-radius: 6px; overflow-x: auto; }
.markdown pre code { background: none; padding: 0; color: inherit; }
.markdown table { border-collapse: collapse; width: 100%; }
.markdown th, .markdown td { border: 1px solid var(--rule); padding: 0.4rem 0.6rem; text-align: left; }
.markdown blockquote { border-left: 3px solid var(--accent); margin: 1rem 0; padding: 0.2rem 1rem; color: var(--muted); }

.sidebar { font-size: 0.9rem; position: sticky; top: 4rem; }
.sidebar h3 { font-family: var(--display); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1.5rem 0 0.5rem; }
.sidebar section:first-child h3 { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0.25rem 0; }
.sidebar .toc-l3 { padding-left: 1rem; }
.sidebar dl { margin: 0; }
.sidebar dt { font-family: var(--display); font-size: 0.7rem; text-transform: uppercase; color: var(--muted); margin-top: 0.5rem; }
.sidebar dd { margin: 0; overflow-wrap: break-word; }

.pill { font-family: var(--mono); font-size: 0.7rem; background: #ece6d8; color: var(--muted); padding: 0.05em 0.4em; border-radius: 3px; }
.tag { font-family: var(--mono); font-size: 0.78rem; color: var(--link); text-decoration: none; margin-right: 0.3rem; }
.tag:hover { text-decoration: underline; }

.listing { max-width: 52rem; }
.listing h1 { font-family: var(--display); font-weight: 800; }
.muted { color: var(--muted); font-size: 0.9rem; }
.filter { width: 100%; margin: 0.5rem 0 1rem; }
.pagelist, .results, .tagcloud { list-style: none; padding: 0; }
.pagelist li, .results li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.pagelist a, .results a { font-family: var(--display); font-weight: 600; text-decoration: none; }
.slug { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); margin: 0 0.5rem; }
.snippet { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 0; font-family: var(--mono); }
.searchform { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0; align-items: center; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tagcloud li { display: flex; align-items: baseline; gap: 0.25rem; }
.count { font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }

.graphview canvas { width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); cursor: grab; }
.legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem; }
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.legend-item i { width: 0.8rem; height: 0.8rem; border-radius: 50%; display: inline-block; }
