:root {
  --bg:      #1b1d1f;
  --fg:      #eee7d4;
  --muted:   #767f7d;
  --accent:  #e7a85d;
  --bright:  #f2c96b;
  --rule:    #2c2f31;
  --panel:   #15181a;
  --sel-bg:  #3b4647;
  --measure: 40rem;
  --serif: "Iowan Old Style", Charter, Palatino, Georgia, Cambria, serif;
  --sans:  system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono:  "IBM Plex Mono", "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main { max-width: var(--measure); margin: 0 auto; padding: 4rem 1.5rem 6rem; }

h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2.5rem 0 1rem;
}
h1 { font-size: 1.8rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p, ul, ol, blockquote, table, pre { margin: 0 0 1.25rem; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule);
}
a:hover { color: var(--bright); text-decoration-color: var(--accent); }

strong { font-weight: 700; }
.muted, time { color: var(--muted); }

ul, ol { padding-left: 1.4rem; }
li { margin: 0.3rem 0; }
li::marker { color: var(--muted); }

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--panel); padding: 0.12em 0.35em; border-radius: 3px; }
pre {
  background: var(--panel);
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 4px;
  line-height: 1.55;
}
pre code { background: none; padding: 0; }

blockquote { margin-left: 0; padding-left: 1.2rem; border-left: 2px solid var(--accent); color: var(--muted); }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.5rem 0.8rem; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; }

hr { border: none; border-top: 1px solid var(--rule); margin: 3rem 0; }
img, svg, video { max-width: 100%; height: auto; }

.katex-display { overflow-x: auto; overflow-y: hidden; padding: 0.2rem 0; }

::selection { background: var(--sel-bg); color: var(--fg); }
