/* =========================
   Design tokens (Light)
   ========================= */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --border: #e5e7eb;
}

/* =========================
   System Dark Mode
   ========================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #60a5fa;
    --border: #1f2933;
  }
}

/* =========================
   Base styles
   ========================= */
* {
  box-sizing: border-box;
}

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

/* =========================
   Layout
   ========================= */
.container {
  max-width: 960px;
  margin: auto;
  padding: 3rem 1.5rem;
}

header {
  margin-bottom: 3.5rem;
}

section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  margin-bottom: 1.6rem;
}

/* =========================
   Typography
   ========================= */
h1 {
  font-size: 2.6rem;
  margin-bottom: 0.6rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 0;
}

h3 {
  margin-bottom: 0.3rem;
}

p {
  max-width: 760px;
}

ul {
  padding-left: 1.2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* =========================
   Links
   ========================= */
a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

a:hover {
  text-decoration: underline;
}

/* =========================
   Tags
   ========================= */
.tags span {
  display: inline-block;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
  padding: 0.35rem 0.7rem;
  margin: 0.25rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

/* =========================
   Grid helpers
   ========================= */
.grid {
  display: grid;
  gap: 1.2rem;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================
   Footer
   ========================= */
footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
