/* ── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: 'SF Pro';
  src: url('fonts/SF-Pro-Text-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro';
  src: url('fonts/SF-Pro-Text-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro';
  src: url('fonts/SF-Pro-Text-Semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SF-Pro-Display-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'SF Pro Display';
  src: url('fonts/SF-Pro-Display-Semibold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}
/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg:         #0d0d0d;
  --text:       #e8e8e8;
  --text-muted: #666666;
  --border:     rgba(255, 255, 255, 0.08);
  --nav-bg:     rgba(13, 13, 13, 0.7);
  --code-bg:    rgba(255, 255, 255, 0.07);
  --accent:     #ffffff;

  --font-body:    'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;

  --nav-height: 60px;
  --content-left: max(5vw, 2rem);
  --content-max: 780px;
}

[data-theme="light"] {
  --bg:         #f5f5f4;
  --text:       #111111;
  --text-muted: #888888;
  --border:     rgba(0, 0, 0, 0.08);
  --nav-bg:     rgba(245, 245, 244, 0.75);
  --code-bg:    rgba(0, 0, 0, 0.06);
  --accent:     #000000;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s ease, color 0.35s ease;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.35s ease, border-color 0.35s ease;
}

.nav-inner {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-family: var(--font-body);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent);
}

/* ── Theme Toggle ───────────────────────────────────────── */
.theme-toggle {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);

  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  border-radius: 6px;
  transition: color 0.2s ease;
}

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

/* ── Content ────────────────────────────────────────────── */
.content {
  max-width: var(--content-max);
  margin: 0 0 0 var(--content-left);
  padding: calc(var(--nav-height) + 4rem) 1.5rem 8rem;
  animation: fadeUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3 {
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  margin-bottom: 1.5rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  margin-top: 3rem;
  margin-bottom: 0.9rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

h3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1.4rem;
  max-width: 68ch;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

code {
  font-family: 'SF Mono', ui-monospace, 'Fira Code', monospace;
  font-size: 0.85em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  color: var(--text);
  transition: background 0.35s ease;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ── Selection ──────────────────────────────────────────── */
::selection {
  background: rgba(128, 128, 128, 0.25);
  color: var(--text);
}