/*
  index.css
  Wiki Startseite – wiki.simonwied.com
*/

:root {
  --bg: #0f0f13;
  --surface: #16161d;
  --surface2: #1e1e28;
  --border: #2a2a3a;
  --accent: #00ff88;
  --accent2: #ff4466;
  --accent3: #4488ff;
  --accent4: #ffaa00;
  --text: #e8e8f0;
  --muted: #7070a0;
}

[data-theme="light"] {
  --bg: #f2f2f6;
  --surface: #ffffff;
  --surface2: #e8e8f0;
  --border: #d0d0e0;
  --accent: #009955;
  --accent2: #dd2244;
  --accent3: #2255cc;
  --accent4: #bb7700;
  --text: #1a1a2a;
  --muted: #666680;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 100;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  user-select: none;
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Syne', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 0 20px;
  margin-bottom: 16px;
}

.sidebar-logo .logo-img {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  display: block;
  margin-bottom: 10px;
}

.sidebar-logo .logo-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.06em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.nav-section { padding: 0 12px; margin-bottom: 8px; }

.nav-section-title {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.15s;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover, .nav-item.active {
  background: var(--surface2);
  color: var(--text);
}

.nav-item .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Main ── */
.main {
  flex: 1;
  padding: 60px 80px;
  max-width: 1040px;
}

/* Hero */
.hero {
  margin-bottom: 56px;
  animation: fadeInUp 0.6s ease both;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-title {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.hero-title span {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  margin-top: 28px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 40px;
  max-width: 520px;
  transition: border-color 0.2s;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.search-bar:focus-within { border-color: rgba(0,255,136,0.4); }

.search-bar span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.search-bar input::placeholder { color: var(--muted); }

.search-bar .kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Article card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease 0.15s both;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.card:hover {
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.card:hover::before { opacity: 1; }

.card.cat-security::before { background: linear-gradient(90deg, var(--accent2), var(--accent4)); }
.card.cat-coding::before   { background: linear-gradient(90deg, var(--accent3), var(--accent)); }
.card.cat-tools::before    { background: linear-gradient(90deg, var(--accent4), var(--accent3)); }
.card.cat-other::before    { background: linear-gradient(90deg, var(--muted), var(--accent3)); }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon {
  font-size: 28px;
  line-height: 1;
}

.card-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  padding: 3px 7px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  font-family: 'JetBrains Mono', monospace;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 2px 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
}

.card-arrow {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
}

.card:hover .card-arrow { transform: translateX(4px); color: var(--accent); }

/* Placeholder card */
.card-placeholder {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.45;
}

.card-placeholder .card-title { color: var(--muted); }
.card-placeholder .card-desc  { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Footer */
.wiki-footer {
  margin-top: 24px;
  padding: 24px 0 60px;
  border-top: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

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

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 32px 24px; }
  .hero-title { font-size: 34px; }
  .card-grid { grid-template-columns: 1fr; }
  .wiki-footer { flex-direction: column; gap: 8px; }
}
