/* ── Color Palette: Dark (default) ── */
:root,
[data-theme="dark"] {
  --bg:          #0c0c14;
  --bg-card:     #14141f;
  --bg-card-alt: #1a1a28;
  --border:      #1e1e2e;
  --border-light:#2a2a3a;
  --text:        #c0c0cc;
  --text-muted:  #6a6a7a;
  --text-bright: #e8e8f0;
  --accent:      #7c5cfc;
  --accent-dim:  #5a3fd4;
  --accent-glow: rgba(124,92,252,0.15);
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:   'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --green:       #34d399;
  --blue:        #60a5fa;
  --orange:      #fb923c;
  color-scheme: dark;
}

/* ── Color Palette: Light ── */
[data-theme="light"] {
  --bg:          #f5f5f0;
  --bg-card:     #ffffff;
  --bg-card-alt: #f0f0eb;
  --border:      #ddd8d0;
  --border-light:#ccc8c0;
  --text:        #3a3a3a;
  --text-muted:  #7a7a7a;
  --text-bright: #1a1a1a;
  --accent:      #6340d4;
  --accent-dim:  #5030b0;
  --accent-glow: rgba(99,64,212,0.1);
  --green:       #16a34a;
  --blue:        #2563eb;
  --orange:      #ea580c;
  color-scheme: light;
}

/* ── Reset / Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Top Nav ── */
.topnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 52px;
}
.topnav__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-bright);
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
}
.topnav__brand:hover { text-decoration: none; }
.topnav__logo {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.topnav__links {
  display: flex;
  gap: 1.8rem;
  list-style: none;
}
.topnav__links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding-bottom: 2px;
  transition: color 0.15s;
}
.topnav__links a:hover { color: var(--text); text-decoration: none; }
.topnav__links a.active {
  color: var(--text-bright);
  border-bottom: 2px solid var(--accent);
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
/* Dark mode: show sun, hide moon */
.theme-toggle__moon { display: none; }
.theme-toggle__sun { display: block; }
/* Light mode: show moon, hide sun */
[data-theme="light"] .theme-toggle__moon { display: block; }
[data-theme="light"] .theme-toggle__sun { display: none; }

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem 1.2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.footer__brand {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-links {
  display: flex;
  gap: 2.5rem;
}
.footer-links__group .label { margin-bottom: 0.35rem; }
.footer-links__group {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
}
.footer-links__group a {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-links__group a:hover { color: var(--text); }
.footer__copy {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Shared Labels ── */
.label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.label--accent { color: var(--accent); }

/* ── Responsive: Nav ── */
@media (max-width: 860px) {
  .topnav__links { display: none; }
}
