:root {
  --bg: #0d1117;
  --card-bg: #161b22;
  --card-bg-hover: #1c2128;
  --text-main: #c9d1d9;
  --text-dim: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --border: #30363d;
  --border-hover: #8b949e;
  --success: #3fb950;
  --max-width: 920px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --card-bg: #f6f8fa;
  --card-bg-hover: #eef1f4;
  --text-main: #24292f;
  --text-dim: #57606a;
  --text-muted: #6e7781;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --border: #d0d7de;
  --border-hover: #afb8c1;
  --success: #1a7f37;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
p { color: var(--text-dim); margin-top: 0; }
h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
section { margin-bottom: 88px; scroll-margin-top: 30px; }
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 9px;
  margin-bottom: 24px;
}
.section-note { color: var(--text-muted); font-size: 0.8rem; }
.hero h1, .blog-post h1 {
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 14px;
  font-weight: 700;
}

.container { max-width: var(--max-width); margin: 0 auto; padding: 64px 24px 40px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; margin-bottom: 72px; }
.nav-links { display: flex; align-items: center; gap: 18px; font-size: 0.9rem; }
.nav-links a { color: var(--text-dim); }
.nav-links a:hover { color: var(--text-main); text-decoration: none; }

.theme-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-btn:hover { border-color: var(--border-hover); }

@media (max-width: 700px) {
  .container { padding: 32px 18px; }
  .topbar { margin-bottom: 52px; }
  .nav-links a { display: none; }
  section { margin-bottom: 64px; }
}
