/* ─── THEMES ──────────────────────────────────────────── */
:root[data-theme="dark"] {
  --bg:           #0a0a0f;
  --bg2:          #13131a;
  --bg3:          #1c1c26;
  --border:       #2a2a3a;
  --text:         #f0f0f0;
  --text2:        #aaa;
  --text3:        #555;
  --accent:       #c0392b;
  --accent2:      #e74c3c;
  --tag-bg:       transparent;
  --tag-color:    #e74c3c;
  --tag-border:   #c0392b;
  --nav-bg:       #0a0a0f;
  --toggle-bg:    #2a2a3a;
  --card-bg:      #13131a;
  --card-hover:   #1c1c26;
  --pullquote-bg: #13131a;
  --pullquote-border: #c0392b;
}
:root[data-theme="light"] {
  --bg:           #fafaf8;
  --bg2:          #ffffff;
  --bg3:          #f0efe9;
  --border:       #e0ddd6;
  --text:         #1a1a2e;
  --text2:        #555;
  --text3:        #999;
  --accent:       #1a1a2e;
  --accent2:      #c0392b;
  --tag-bg:       #1a1a2e;
  --tag-color:    #ffffff;
  --tag-border:   #1a1a2e;
  --nav-bg:       #ffffff;
  --toggle-bg:    #e0ddd6;
  --card-bg:      #ffffff;
  --card-hover:   #f0efe9;
  --pullquote-bg: #f0efe9;
  --pullquote-border: #c0392b;
}

/* ─── RESET ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 17px;
  line-height: 1.6;
  transition: background .25s, color .25s;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ─── NAV ─────────────────────────────────────────────── */
nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  min-height: 56px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background .25s;
}
.logo {
  order: 1;
  margin-right: auto;          /* pushes links + toggle to the right */
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: system-ui, sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.3px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.logo img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.logo-accent { color: var(--accent2); }
.nav-links {
  order: 2;
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--text2);
  text-decoration: none;
  letter-spacing: .3px;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }
.theme-toggle {
  order: 3;
  background: var(--toggle-bg);
  border: none;
  border-radius: 20px;
  padding: 5px 14px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--text2);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .25s;
  white-space: nowrap;
}
.theme-toggle:hover { color: var(--text); }

/* Mobile: logo + toggle on row 1, category links on row 2 (scrollable) */
@media (max-width: 640px) {
  nav { padding: 0 14px; }
  .theme-toggle { order: 2; }
  .nav-links {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
    gap: 18px;
    padding-bottom: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
}

/* ─── FOOTER ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  color: var(--text3);
  margin-top: 64px;
}
footer p + p { margin-top: 6px; }
footer a { color: var(--text3); text-decoration: none; }
footer a:hover { color: var(--text2); }

/* ─── SHARED ──────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--tag-bg);
  color: var(--tag-color);
  border: 1px solid var(--tag-border);
  padding: 3px 9px;
  border-radius: 2px;
}

.case-file {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 16px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text3);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}
.case-file .case-num  { color: var(--text2); font-weight: 700; }
.case-file .case-div  { color: var(--border); }
.case-file .case-ref  { color: var(--text3); }
.case-file .status-closed   { color: #4ade80; }
.case-file .status-ongoing  { color: #f0b429; }
.case-file .status-fugitive { color: #ef4444; animation: pulse 2s infinite; }
.case-file .status-unsolved { color: #888; }

@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

.story-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background .2s;
}
.story-card:hover { background: var(--card-hover); }
.story-card .tag  { margin-bottom: 10px; }
.story-card h3    { font-size: 15px; line-height: 1.35; color: var(--text); margin-bottom: 6px; }
.story-card h2    { font-size: 20px; line-height: 1.3; color: var(--text); margin-bottom: 10px; }
.story-card p     { font-size: 13px; line-height: 1.6; color: var(--text2); }
.story-card .year {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--text3);
  margin-top: 12px;
}

.video-thumb {
  aspect-ratio: 16/9;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-btn {
  width: 52px; height: 52px;
  background: rgba(192,57,43,.9);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.play-btn svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }

.section-label {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 20px;
}

.prose { color: var(--text); }
.prose p { margin-bottom: 20px; }
.prose p.hook { font-size: 20px; font-weight: 700; line-height: 1.4; }
.prose blockquote {
  border-left: 3px solid var(--pullquote-border);
  background: var(--pullquote-bg);
  padding: 16px 20px;
  margin: 28px 0;
  border-radius: 0 4px 4px 0;
}
.prose blockquote p { font-style: italic; margin: 0; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag-pill {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 12px;
  text-decoration: none;
}
.tag-pill:hover { color: var(--text); }
