@font-face { font-family: 'Playfair Display'; font-display: swap; }
@font-face { font-family: 'DM Mono'; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Theme tokens ── */
:root {
  --bg: #080c14;
  --surface: #0f1623;
  --border: #1e2a3d;
  --accent: #7c9fe6;
  --accent-dim: #2d4a7a;
  --text: #dde4f0;
  --muted: #4a5870;
  --red: #e05c7a;
  --green: #4caf82;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f5fb;
    --surface: #ffffff;
    --border: #d0d9ec;
    --accent: #3560c4;
    --accent-dim: #a8bce8;
    --text: #111827;
    --muted: #6b7a99;
    --red: #c0334f;
    --green: #2e8f5e;
  }
}

[data-theme="light"] {
  --bg: #f2f5fb;
  --surface: #ffffff;
  --border: #d0d9ec;
  --accent: #3560c4;
  --accent-dim: #a8bce8;
  --text: #111827;
  --muted: #6b7a99;
  --red: #c0334f;
  --green: #2e8f5e;
}

[data-theme="dark"] {
  --bg: #080c14;
  --surface: #0f1623;
  --border: #1e2a3d;
  --accent: #7c9fe6;
  --accent-dim: #2d4a7a;
  --text: #dde4f0;
  --muted: #4a5870;
  --red: #e05c7a;
  --green: #4caf82;
}

/* ── Base ── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Mono', 'Courier New', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%234a7abf' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Nav ── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  border-bottom: 1px solid var(--border);
  margin: 0 -24px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
}

.site-nav .brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
}

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

.site-nav .nav-links {
  display: flex;
  align-items: center;
}

.site-nav .nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  transition: color 0.2s;
}

.site-nav .nav-links a.active {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  margin-bottom: -1px;
}

.site-nav .nav-links a:hover:not(.active) { color: var(--text); }

.site-nav .nav-right {
  display: flex;
  align-items: center;
}

.theme-toggle {
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  padding: 0 20px;
  height: 56px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0;
  flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 680px) {
  .site-nav { margin: 0 -16px; padding: 0 16px; }
  .site-nav .brand { font-size: 18px; }
  .site-nav .nav-links a { padding: 0 12px; font-size: 9px; }
  .theme-toggle { padding: 0 12px; }
}
