:root {
  color-scheme: dark;
  --ink: #f3efe5;
  --muted: #b7b1a3;
  --panel: #171916;
  --panel-raised: #20231e;
  --line: #363a32;
  --accent: #c74a32;
  --accent-bright: #ec674b;
  --paper: #0f110f;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 80% -10%, #343022 0, transparent 30rem), var(--paper); line-height: 1.65; }
a { color: inherit; }
.skip-link { position: absolute; left: -9999px; top: 1rem; z-index: 10; padding: .7rem 1rem; background: var(--ink); color: var(--paper); }
.skip-link:focus { left: 1rem; }

.site-header { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; min-height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .85rem; text-decoration: none; letter-spacing: .02em; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #8f3c2d; background: linear-gradient(145deg, #d4563d, #742719); color: white; font-weight: 900; border-radius: 3px; box-shadow: inset 0 0 0 2px #ffffff18; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .16em; }
.site-header nav { display: flex; align-items: center; gap: .25rem; }
.site-header nav a { padding: .55rem .75rem; text-decoration: none; color: var(--muted); border-radius: 3px; }
.site-header nav a:hover { color: var(--ink); background: #ffffff0c; }

.hero { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; padding: clamp(5rem, 12vw, 10rem) 0 6rem; max-width: 900px; text-align: center; }
.eyebrow { margin: 0 0 .7rem; color: var(--accent-bright); font-size: .76rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.025em; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.7rem, 7vw, 5.8rem); font-weight: 600; }
.lede { max-width: 720px; margin: 1.25rem auto 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero-actions { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; margin-top: 2rem; }
.button { display: inline-block; padding: .75rem 1.1rem; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-weight: 700; }
.button:hover { border-color: var(--muted); background: #ffffff0b; }
.button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.button.primary:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

.home-grid { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto 6rem; display: grid; grid-template-columns: 1.3fr .7fr; gap: 1rem; }
.intro, .latest { padding: clamp(1.5rem, 4vw, 3rem); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.latest h2 { margin-top: 0; }
.latest > a, .page-list > a { display: block; padding: 1rem 0; text-decoration: none; border-top: 1px solid var(--line); }
.latest a span, .page-list a span { display: block; color: var(--muted); font-size: .9rem; }
.latest a:hover strong, .page-list a:hover strong { color: var(--accent-bright); }

.site-shell { width: min(calc(100% - 2rem), var(--max)); margin: 2.5rem auto 5rem; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.sidebar { position: sticky; top: 1.5rem; }
.sidebar label { display: block; margin-bottom: .45rem; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.sidebar input { width: 100%; margin-bottom: 1rem; padding: .7rem .75rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; }
.sidebar nav { display: grid; }
.sidebar nav a { padding: .58rem .7rem; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; }
.sidebar nav a:hover, .sidebar nav a[aria-current="page"] { color: var(--ink); background: #ffffff08; border-left-color: var(--accent); }
.content-panel { min-width: 0; padding: clamp(1.5rem, 4vw, 3.5rem); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.page-header { padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.page-header h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.page-header .lede { margin-left: 0; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 2.3rem; font-size: 1.7rem; }
.prose h3 { margin-top: 1.8rem; }
.prose p, .prose li { color: #d6d1c6; }
.prose a { color: #ff866d; text-underline-offset: 3px; }
.prose code { padding: .15rem .35rem; background: #0005; border: 1px solid var(--line); border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 1rem; background: #090a09; border: 1px solid var(--line); }
.prose pre code { padding: 0; border: 0; }
.page-list { display: grid; margin-top: 2rem; }

footer { width: min(calc(100% - 2rem), var(--max)); margin: 0 auto; padding: 2rem 0 3rem; display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .86rem; }

@media (max-width: 760px) {
  .site-header { align-items: flex-start; padding: 1rem 0; gap: 1rem; }
  .site-header nav { flex-wrap: wrap; justify-content: flex-end; }
  .home-grid, .site-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 500px) {
  .brand small { display: none; }
  .site-header nav a { padding: .45rem; font-size: .9rem; }
  .sidebar nav { grid-template-columns: 1fr; }
}
