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

:root {
  --bg:      #0d0d0d;
  --surface: #161616;
  --border:  #2a2a2a;
  --text:    #f0f0f0;
  --muted:   #999;
  --focus:   #f0f0f0;
}
[data-theme="light"] {
  --bg:      #f5f5f5;
  --surface: #ffffff;
  --border:  #e0e0e0;
  --text:    #111;
  --muted:   #595959;
  --focus:   #111;
}

html { height: 100%; }
body { min-height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 200;
  background: var(--text);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Nav ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
a.logo { text-decoration: none; }
.logo {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo img { width: 20px; height: 20px; display: block; }
.logo-dim { opacity: 0.45; font-weight: 600; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
}
.theme-toggle:hover { background: var(--surface); border-color: var(--text); }
.icon-sun, .icon-moon { width: 14px; height: 14px; }
[data-theme="dark"]  .icon-sun  { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ── Footer ── */
footer {
  text-align: center;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}
footer a, .footer-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer a:hover, .footer-link:hover { color: var(--text); }
.footer-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 600px) {
  nav { padding: 18px 24px; }
}
