/* Fonts loaded via <link> in HTML head for parallel loading */

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

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --border: #1e1e1e;
  --border-hover: #333;
  --text: #e0e0e0;
  --text-dim: #999;
  --text-muted: #666;
  --red: #e53935;
  --red-dim: rgba(229, 57, 53, 0.15);
  --red-glow: rgba(229, 57, 53, 0.3);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }
::-webkit-scrollbar-corner { background: transparent; }
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--border-hover) transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── SHARED SIDEBAR ── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px 16px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.9;
}
.sidebar-brand:hover { text-decoration: none; color: #ff5252; }

.sidebar-site-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-site-nav a {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s;
}
.sidebar-site-nav a:hover { color: var(--text); text-decoration: none; }
.sidebar-site-nav a.active { color: var(--red); }

.sidebar-header {
  padding: 16px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h2 {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.sidebar-header p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
}
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 2px; }

.sidebar-nav {
  list-style: none;
  padding: 8px 0;
}
.sidebar-nav li {
  border-left: 2px solid transparent;
}
.sidebar-nav li.active {
  border-left-color: var(--red);
  background: var(--red-dim);
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 0.78rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  line-height: 1.4;
}
.sidebar-nav a:hover {
  color: var(--text);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
}
.sidebar-nav li.active a { color: var(--text); }

.nav-number {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  min-width: 18px;
}

.sidebar-nav .nav-count {
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: auto;
}

.sidebar-stats {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.sidebar-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.7rem;
}
.sidebar-stat-label { color: var(--text-muted); }
.sidebar-stat-value {
  font-family: var(--mono);
  color: var(--red);
  font-weight: 700;
}

/* ── LAYOUT ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── MOBILE HAMBURGER ── */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.sidebar-toggle:hover { border-color: var(--border-hover); color: var(--text); }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .container { padding: 0 16px; }
}
