:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #0ea5e9;
  --primary-strong: #0284c7;
  --border: #cbd5e1;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

:root[data-theme='dark'] {
  --bg: #020617;
  --surface: #0f172a;
  --surface-muted: #1e293b;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-strong: #0ea5e9;
  --border: #334155;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; scroll-behavior: smooth; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 35%), var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--primary); }
a:hover { color: var(--primary-strong); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.skip-link:focus { left: 10px; z-index: 2000; }

.header {
  position: sticky;
  top: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.logo { font-weight: 800; text-decoration: none; }
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; font-weight: 500; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.hero {
  padding: 4.5rem 0 2.5rem;
  text-align: center;
}

.eyebrow {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1.15;
  margin-bottom: 0.9rem;
}

.hero-copy {
  width: min(60ch, 100%);
  margin: 0 auto;
  color: var(--text-muted);
}

.hero-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  text-decoration: none;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0.62rem 1rem;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.btn-secondary { background: var(--surface); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }

.section { margin-top: 2.5rem; }
.section h2 { margin-bottom: 1rem; font-size: 1.7rem; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 0.8rem; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 0.6rem;
}

.chip-list li {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.card, .post-card, .stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.card, .post-card { padding: 1rem; }
.post-card { margin-bottom: 0.85rem; }
.post-card p, .muted { color: var(--text-muted); }
.post-card h3 { margin-bottom: 0.45rem; }
.read-more { font-weight: 600; text-decoration: none; }

.quote cite {
  display: block;
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-style: normal;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.stat-card {
  padding: 1rem;
  display: grid;
  gap: 0.25rem;
}

.stat-card strong { font-size: 1.4rem; }
.stat-card span { color: var(--text-muted); }

.post {
  width: min(760px, 100%);
  margin: 0 auto;
}

.post h1 { margin-bottom: 0.6rem; }
.meta { color: var(--text-muted); margin-bottom: 1.25rem; }
.post h2, .post h3 { margin-top: 1rem; }
.post ul, .post ol { margin-left: 1.2rem; }

.footer {
  padding: 1.2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
}

.footer-links {
  margin-top: 0.35rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 700px) {
  .header { justify-content: center; }
  .container { padding-top: 1.3rem; }
}
