:root {
  --bg: #0a0a0a; --text: #d0d0d0; --text-muted: #888; --text-dim: #666;
  --surface: #111; --border: #1a1a1a;
  --accent: #f97316; --heading: #fff;
  --callout-bg: #111; --footer: #444; --footer-link: #555;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa; --text: #333; --text-muted: #666; --text-dim: #595959;
    --surface: #fff; --border: #e5e5e5;
    --accent: #ea580c; --heading: #111;
    --callout-bg: #f5f5f5; --footer: #595959; --footer-link: #555;
  }
}

/* Manual theme override — !important to beat @media queries */
html[data-theme="light"], html[data-theme="light"] :root {
  --bg: #fafafa !important; --text: #333 !important; --text-muted: #666 !important; --text-dim: #595959 !important;
  --surface: #fff !important; --border: #e5e5e5 !important;
  --accent: #ea580c !important; --heading: #111 !important;
  --callout-bg: #f5f5f5 !important; --footer: #595959 !important; --footer-link: #555 !important;
}
html[data-theme="dark"], html[data-theme="dark"] :root {
  --bg: #0a0a0a !important; --text: #d0d0d0 !important; --text-muted: #888 !important; --text-dim: #666 !important;
  --surface: #111 !important; --border: #1a1a1a !important;
  --accent: #f97316 !important; --heading: #fff !important;
  --callout-bg: #111 !important; --footer: #444 !important; --footer-link: #555 !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.8; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.container { max-width: 680px; margin: 0 auto; padding: 0 24px; }
header { padding: 24px 0; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
header a { color: var(--text-muted); font-size: 14px; } header a span { color: var(--accent); font-weight: 700; }
h1 { font-size: 36px; font-weight: 700; color: var(--heading); letter-spacing: -1px; margin-bottom: 12px; line-height: 1.2; }
.meta { font-size: 13px; color: var(--text-dim); margin-bottom: 40px; }
h2 { font-size: 22px; font-weight: 600; color: var(--heading); margin: 40px 0 16px; }
h3 { font-size: 18px; font-weight: 600; color: var(--heading); margin: 28px 0 12px; }
p { margin-bottom: 16px; font-size: 16px; }
ul, ol { margin: 0 0 16px 24px; } li { margin-bottom: 8px; font-size: 15px; }
.callout { background: var(--callout-bg); border-left: 3px solid var(--accent); padding: 16px 20px; border-radius: 0 8px 8px 0; margin: 24px 0; font-size: 15px; }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
footer { padding: 40px 0; margin-top: 60px; border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--footer); }
footer a { color: var(--footer-link); }

/* Theme toggle */
.theme-toggle {
  position: fixed; top: 16px; right: 16px; z-index: 100;
  background: var(--surface); border: 1px solid var(--border); border-radius: 50%;
  width: 40px; height: 40px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); }

@media (max-width: 600px) { h1 { font-size: 26px; } table { font-size: 12px; } }
