:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #1a1d23;
  --text-muted: #5b6270;
  --brand: #2f5fe0;
  --brand-dark: #1d3f9e;
  --border: #e4e6ea;
  --radius: 10px;
  --max-width: 780px;
  font-size: 17px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --bg-alt: #1b1e24;
    --text: #eef0f3;
    --text-muted: #a4abb8;
    --brand: #6f93ff;
    --brand-dark: #a9bfff;
    --border: #2a2e37;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

header.site {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.brand span { color: var(--brand); }

nav.site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

nav.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

nav.site-nav a:hover { color: var(--brand); }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 20px 70px;
}

main.wide { max-width: 980px; }

h1 {
  font-size: 1.85rem;
  line-height: 1.25;
  margin: 0 0 10px;
}

h2 {
  font-size: 1.35rem;
  margin: 2em 0 0.6em;
}

h3 {
  font-size: 1.1rem;
  margin: 1.6em 0 0.5em;
}

p { margin: 0 0 1em; }

.meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 2em;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.4em; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th { color: var(--text-muted); font-weight: 600; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 28px 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg-alt);
  text-decoration: none;
  color: var(--text);
  display: block;
}

.card:hover { border-color: var(--brand); }

.card h3 { margin-top: 0; color: var(--text); }
.card p { color: var(--text-muted); margin-bottom: 0; font-size: 0.92rem; }

.callout {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 1.4em 0;
  font-size: 0.95rem;
}

.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin: 2em 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-inner a { color: var(--text-muted); }
.footer-inner a:hover { color: var(--brand); }
