/* Rhune rules site — plain & clean. No client JS. */

:root {
  --ink: #1c1a17;
  --muted: #6b645c;
  --rule: #e2ddd4;
  --accent: #7a4a2b;
  --accent-soft: #f3ece3;
  --bg: #fbf9f6;
  --maxw: 72ch;
}

* { box-sizing: border-box; }

html { font-size: 17px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

/* Layout: sidebar + content */
body { display: flex; align-items: flex-start; gap: 0; }

.sidebar {
  flex: 0 0 16rem;
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
  padding: 1.25rem 1rem 3rem;
  border-right: 1px solid var(--rule);
  font-size: 0.86rem;
}

.sidebar .brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.sidebar .brand a { color: var(--accent); text-decoration: none; }

.sidebar .sec { margin-bottom: 1.1rem; }
.sidebar .sec-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0.1rem 0; }
.sidebar a { color: var(--ink); text-decoration: none; display: block; padding: 0.12rem 0.35rem; border-radius: 4px; }
.sidebar a:hover { background: var(--accent-soft); }
.sidebar a.here { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--maxw);
  padding: 2.5rem 2rem 6rem;
}

/* Type */
h1, h2, h3, h4 { line-height: 1.25; margin: 2rem 0 0.6rem; font-weight: 700; }
h1 { font-size: 1.9rem; margin-top: 0; }
h2 { font-size: 1.35rem; padding-bottom: 0.2rem; border-bottom: 1px solid var(--rule); }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; color: var(--muted); }

p, li { margin: 0.55rem 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Auto-linked terms: subtle, not shouty */
.content p a, .content li a { text-decoration: none; border-bottom: 1px solid var(--accent-soft); }
.content p a:hover, .content li a:hover { border-bottom-color: var(--accent); }

blockquote {
  margin: 1rem 0;
  padding: 0.4rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-style: italic;
  background: #fff;
}

code {
  background: var(--accent-soft);
  padding: 0.08em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
pre {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

hr { border: none; border-top: 1px solid var(--rule); margin: 2rem 0; }

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.92rem;
}
th, td { border: 1px solid var(--rule); padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--accent-soft); }

ul, ol { padding-left: 1.3rem; }

.lede { font-size: 1.05rem; color: var(--muted); }

/* Mobile */
@media (max-width: 760px) {
  body { display: block; }
  .sidebar {
    position: static;
    flex: none;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 1rem 1rem 1.25rem;
    background: #fff;
  }
  .content { padding: 1.5rem 1.1rem 4rem; max-width: none; }
  html { font-size: 16px; }
}
