/* Shared styles for all pages */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f7f5f0;
  --text: #1a1a1a;
  --muted: #5b6270;
  --accent: #2563eb;
  --border: #e8e2d9;
  --hover-bg: #f0ece4;
}

html[data-theme='dark'] {
  --bg: #1a1814;
  --text: #f0ece4;
  --muted: #9a9080;
  --accent: #7b9fd4;
  --border: #2d2820;
  --hover-bg: #252018;
}

html[data-theme='dark'] .badge-sigcomm { background: #3d2e10; color: #fbbf24; }
html[data-theme='dark'] .badge-nsdi { background: #1e2a3d; color: #60a5fa; }
html[data-theme='dark'] .badge-eurosys { background: #0f2a1f; color: #34d399; }
html[data-theme='dark'] .badge-infocom { background: #2a1f3d; color: #a78bfa; }
html[data-theme='dark'] .badge-other { background: #2a2520; color: #9ca3af; }
html[data-theme='dark'] .badge-conext { background: #2d1f2a; color: #f9a8d4; }
html[data-theme='dark'] .ops-tag { color: #fbbf24; background: #3d2e10; border-color: #5c4a1e; }
html[data-theme='dark'] .badge-perfect { background: #3d2e10; color: #fbbf24; border-color: #5c4a1e; }
.badge-perfect { background: #fef9c3; color: #854d0e; border: 1px solid #fde047; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 2rem;
  overflow-x: hidden;
}

/* NAV */
nav { display: flex; align-items: center; gap: 0.25rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--border); }
nav a { text-decoration: none; font-size: 0.88rem; font-weight: 500; color: var(--muted); padding: 0.5rem 1rem; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s, border-color 0.15s; }
nav a:hover, nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* THEME TOGGLE */
.theme-toggle { margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 4px; padding: 0.3rem; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; transition: color 0.15s, border-color 0.15s; flex-shrink: 0; margin-bottom: -1px; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-icon-sun { display: none; }
html[data-theme='dark'] .theme-icon-moon { display: none; }
html[data-theme='dark'] .theme-icon-sun { display: block; }

/* FOOTER */
footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); }

/* SCROLL-IN REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none; opacity: 1; transform: none; }
}

/* RESPONSIVE */
@media (max-width: 600px) {
  body { font-size: 16px; padding: 1.5rem 1rem; }
  nav { flex-wrap: wrap; gap: 0; justify-content: center; border-bottom: none; position: relative; padding-right: 2.5rem; }
  nav::after { content: ""; display: block; width: 100%; border-bottom: 1px solid var(--border); margin-top: -1px; }
  nav a { padding: 0.35rem 0.5rem; font-size: 0.78rem; letter-spacing: -0.01em; }
  .theme-toggle { position: absolute; right: 0; top: 0.15rem; margin-left: 0; }
  h1 { font-size: 1.3rem; }
}

/* Focus-visible accessibility */
a:focus-visible,
button:focus-visible,
.filter-btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
