
:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel-2: #1f232c;
  --panel-3: #232833;
  --border: #2a2f3a;
  --text: #e8ecf3;
  --muted: #9aa3b2;
  --accent: #ffd166;
  --accent-2: #ff9e5e;
  --link: #8ab4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

header { position: sticky; top: 0; z-index: 10; background: var(--panel);
  border-bottom: 1px solid var(--border); padding: 12px 20px; }
header h1 { margin: 0 0 6px 0; font-size: 18px; }
.stats { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.stats b { color: var(--text); }

.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto auto auto auto;
  gap: 6px; align-items: center; }
.filters input, .filters select { background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); padding: 6px 8px; border-radius: 6px; font-size: 13px;
  min-width: 0; }
.filters input { width: 100%; }
.filters button { background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px;
  cursor: pointer; font-size: 12px; white-space: nowrap; }
.filters button:hover { background: #2a303b; }
.filters label { display: flex; align-items: center; gap: 5px; color: var(--muted);
  font-size: 12px; white-space: nowrap; }

main { padding: 14px 20px 60px; max-width: 1100px; margin: 0 auto; }

.stage { margin-top: 40px; }
.stage-banner { display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 10px; margin-bottom: 6px;
  border-left: 6px solid var(--stage-c, var(--accent));
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--stage-c, var(--accent)) 28%, var(--panel)) 0%,
    color-mix(in srgb, var(--stage-c, var(--accent)) 8%, var(--panel)) 100%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--stage-c, var(--accent)) 15%, transparent);
}
.stage-num-big { background: var(--stage-c, var(--accent)); color: #0a0f1a;
  font-weight: 800; width: 42px; height: 42px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 18px; flex: 0 0 auto; }
.stage-title-wrap { flex: 1 1 auto; min-width: 0; }
.stage-hero { font-size: 22px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--stage-c, var(--accent));
  text-shadow: 0 0 16px color-mix(in srgb, var(--stage-c, var(--accent)) 40%, transparent);
  line-height: 1.1; }
.stage-subtitle { font-size: 13px; color: var(--text); opacity: 0.85; margin-top: 3px; }
.stage-count { color: var(--text); font-size: 13px; flex: 0 0 auto;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--stage-c, var(--accent)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--stage-c, var(--accent)) 40%, var(--border)); }
.stage-desc { color: var(--muted); font-size: 12px; margin: 0 2px 12px 62px;
  font-style: italic; }

.topic-group { margin: 10px 0 4px 0; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); overflow: hidden; }
.topic-group > summary { list-style: none; cursor: pointer; padding: 8px 12px;
  background: var(--panel-2); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 10px; }
.topic-group > summary::-webkit-details-marker { display: none; }
.topic-group > summary::before { content: "▸"; color: var(--muted); width: 10px; }
.topic-group[open] > summary::before { content: "▾"; }
.topic-group > summary:hover { background: #242a36; }
.topic-group .topic-count { color: var(--muted); font-weight: normal; margin-left: auto; font-size: 12px; }
.topic-group .rows { padding: 0; }

.watch-link { background: #ff0033; color: #fff; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; text-decoration: none;
  flex: 0 0 auto; white-space: nowrap; }
.watch-link:hover { filter: brightness(1.15); text-decoration: none; }
.sim-btn { background: var(--link); color: #0a0f1a; font-weight: 700;
  border: none; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.sim-btn:hover { filter: brightness(1.1); }
.sim-btn.active { background: var(--accent); }
.sim-siblings { border-left: 3px solid var(--link); margin-left: 6px;
  background: rgba(138,180,255,0.04); }
.sim-siblings[hidden] { display: none; }

details.row { border-bottom: 1px solid var(--border); background: var(--panel); }
details.row:last-child { border-bottom: none; }
details.row > summary { list-style: none; cursor: pointer; padding: 8px 12px;
  display: flex; align-items: flex-start; gap: 10px; }
details.row > summary::-webkit-details-marker { display: none; }
details.row > summary::before { content: "▸"; color: var(--muted); flex: 0 0 auto;
  margin-top: 1px; width: 10px; }
details.row[open] > summary::before { content: "▾"; }
details.row > summary:hover { background: var(--panel-3); }
.row .count { background: var(--accent-2); color: #111; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; font-size: 11px; flex: 0 0 auto; }
.row .summary-text { flex: 1 1 auto; font-size: 14px; line-height: 1.4; }
.row .summary-badges { display: flex; flex-wrap: wrap; gap: 4px; flex: 0 0 auto;
  justify-content: flex-end; max-width: 40%; }
.row .summary-date { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
  flex: 0 0 auto; white-space: nowrap; }
.body .src-row .src-date { color: var(--accent); font-variant-numeric: tabular-nums;
  font-size: 12px; margin-right: 4px; }
.row .body { padding: 4px 12px 14px 34px; background: var(--panel);
  border-top: 1px dashed var(--border); }

.badge { font-size: 10px; padding: 2px 6px; border-radius: 999px;
  background: #2a2f3a; color: var(--text); white-space: nowrap; }
.badge.topic { background: #2d4a7d; }
.badge.cert { background: #4a2d6a; }
.badge.tt { background: #5c3d14; }
.badge.tt.imminent { background: #8b2b2b; }
.badge.tt.absolute_date { background: #244f2e; }
.badge.tt.date_range { background: #2a5944; }
.badge.tt.relative { background: #3a4a5c; }
.badge.tt.conditional { background: #5a4e24; }

.body .timing { color: var(--accent); font-size: 13px; margin: 6px 0; }
.body .timing ul { margin: 2px 0 0 18px; padding: 0; color: var(--accent); }
.body .reason { color: #a8c48d; font-size: 12px; margin: 6px 0;
  border-left: 3px solid #3a5a2a; padding: 3px 8px; }
.body .src-list { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.body .src-row { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; color: var(--muted); }
.body .src-row:last-child { border-bottom: none; }
.body .src-row .src-text { color: var(--text); }
.body .src-row .src-quote { font-style: italic; font-size: 12px; margin-top: 2px; }

.empty { color: var(--muted); font-style: italic; padding: 20px; text-align: center; }

@media (max-width: 900px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .row .summary-badges { max-width: 100%; }
}

/* light theme overrides — applied when <html data-theme="light"> */
html[data-theme="light"] {
  --bg: #f7f6f1;
  --panel: #ffffff;
  --panel-2: #f0ece2;
  --panel-3: #e6e1d2;
  --border: #d8d2c2;
  --text: #1a1a1a;
  --muted: #6b6759;
  --accent: #b45309;
  --accent-2: #c2410c;
  --link: #1d4ed8;
}
html { transition: background-color 200ms ease, color 200ms ease; }

/* additions for multi-page site */
.top-bar { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px; }
.top-right { display: flex; align-items: center; gap: 8px; }
.brand { color: inherit; display: inline-flex; align-items: center; padding: 2px 0; }
.brand:hover { text-decoration: none; opacity: 0.85; }
.logo-svg { height: 32px; width: auto; display: block; }
.theme-switch { display: inline-flex; gap: 0; padding: 2px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border); }
.theme-btn { background: transparent; border: none; color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  transition: background 120ms, color 120ms; white-space: nowrap; }
.theme-btn:hover { color: var(--text); }
.theme-btn.is-active { background: var(--accent); color: #0a0f1a; }
html[data-theme="light"] .theme-btn.is-active { color: #fff; }

.visitor-counter { color: var(--muted); font-size: 11px;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--border);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.visitor-counter #visitor-count { color: var(--accent);
  font-weight: 700; font-size: 12px; }
/* Stage nav: auto-fit grid so buttons share each row uniformly and stretch
   to fill available width without leaving a ragged last item. */
.stage-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 4px; margin: 10px 0 12px 0; }
.stage-nav a { display: flex; align-items: center; justify-content: center;
  padding: 6px 10px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  background: color-mix(in srgb, var(--stage-c, var(--accent)) 15%, var(--panel-2));
  color: var(--stage-c, var(--accent));
  border: 1px solid color-mix(in srgb, var(--stage-c, var(--accent)) 40%, var(--border));
  min-height: 30px; line-height: 1.1; }
.stage-nav a:hover { text-decoration: none;
  background: color-mix(in srgb, var(--stage-c, var(--accent)) 25%, var(--panel-2)); }
.stage-nav a.active { background: var(--stage-c, var(--accent)); color: #0a0f1a; }
.stage-nav .nav-home { --stage-c: var(--link); color: var(--link); }
.stage-nav .nav-home.active { background: var(--link); color: #0a0f1a; }
.stage-title-header { display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-radius: 10px; margin: 8px 0 4px 0;
  border-left: 6px solid var(--stage-c, var(--accent));
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--stage-c, var(--accent)) 28%, var(--panel)) 0%,
    color-mix(in srgb, var(--stage-c, var(--accent)) 8%, var(--panel)) 100%);
  box-shadow: 0 0 22px color-mix(in srgb, var(--stage-c, var(--accent)) 15%, transparent); }
.stage-title-header .stage-hero { font-size: 22px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--stage-c, var(--accent));
  text-shadow: 0 0 16px color-mix(in srgb, var(--stage-c, var(--accent)) 40%, transparent);
  line-height: 1.1; }
.stage-title-header .stage-subtitle { font-size: 13px; color: var(--text); opacity: 0.85; margin-top: 3px; }
.stage-title-header .stage-count { color: var(--text); font-size: 13px;
  padding: 6px 12px; border-radius: 999px; font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--stage-c, var(--accent)) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--stage-c, var(--accent)) 40%, var(--border)); margin-left: auto; }
header .stage-desc { color: var(--muted); font-size: 12px; margin: 0 0 12px 0;
  font-style: italic; padding: 0 18px; }
.filters { grid-template-columns: 2fr 1fr 1fr 1fr auto auto auto auto; }
.site-footer { border-top: 1px solid var(--border); padding: 18px 20px;
  max-width: 1100px; margin: 40px auto 0; color: var(--muted); font-size: 12px; text-align: center; }
/* watch buttons and source rows */
.src-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.src-channel { color: var(--muted); font-size: 12px; }
.body .src-row a.watch-link { background: #ff0033; color: #fff; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; text-decoration: none;
  white-space: nowrap; }
.body .src-row a.watch-link:hover { filter: brightness(1.15); text-decoration: none; }
.transcript-link { background: #166534; color: #e6f4ea; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; text-decoration: none;
  border: 1px solid #14532d; white-space: nowrap; }
.transcript-link:hover { background: var(--accent); color: #0a0f1a; text-decoration: none;
  border-color: var(--accent); }

/* video transcript page */
.video-page { max-width: 820px; margin: 0 auto; padding: 24px 20px 60px; }
.video-page h1 { color: var(--accent); font-size: 28px; line-height: 1.25;
  margin: 0 0 12px 0; }
.video-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.video-meta .src-channel { color: var(--text); font-weight: 600; }
.video-meta .watch-link { background: #ff0033; color: #fff; font-weight: 700;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; text-decoration: none; }
.yt-embed { aspect-ratio: 16/9; background: #000; border-radius: 8px;
  overflow: hidden; margin-bottom: 24px; border: 1px solid var(--border); }
.yt-embed iframe { width: 100%; height: 100%; display: block; border: none; }
.scroll-prompt { display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 12px 18px; margin: 0 0 24px 0;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 18%, var(--panel)) 0%,
    color-mix(in srgb, var(--accent) 4%, var(--panel)) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: 8px; color: var(--accent); font-weight: 700; font-size: 13px;
  letter-spacing: 1.5px; text-transform: uppercase; text-decoration: none;
  transition: background 150ms; }
.scroll-prompt:hover { text-decoration: none;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 28%, var(--panel)) 0%,
    color-mix(in srgb, var(--accent) 10%, var(--panel)) 100%); }
.scroll-prompt span:last-child { animation: bounce 1.4s ease-in-out infinite;
  display: inline-block; font-size: 18px; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.transcript-h { scroll-margin-top: calc(var(--header-h, 240px) + 12px); }
.video-prophecies { background: var(--panel-2); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); padding: 16px 20px; border-radius: 8px;
  margin: 0 0 24px 0; }
.video-prophecies h2 { margin: 0 0 8px 0; font-size: 14px; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; }
.video-prophecies ul { padding-left: 18px; margin: 0; font-size: 14px; }
.video-prophecies li { margin: 4px 0; line-height: 1.45; }
.video-prophecies a { font-weight: 700; }
.transcript-h { color: var(--accent-2); font-size: 18px; text-transform: uppercase;
  letter-spacing: 1px; border-bottom: 1px solid var(--border); padding-bottom: 6px;
  margin: 24px 0 12px 0; }
.transcript p { font-size: 16px; line-height: 1.7; margin: 0 0 14px 0;
  color: var(--text); }

/* video index */
.video-index { max-width: 820px; margin: 0 auto; padding: 24px 20px 60px; }
.video-index h1 { color: var(--accent); margin-bottom: 16px; }
.video-list { list-style: none; padding: 0; margin: 0; }
.video-list li { border-bottom: 1px solid var(--border); }
.video-list li:last-child { border-bottom: none; }
.video-list a { display: flex; flex-direction: column; gap: 4px; padding: 12px 0;
  color: var(--text); }
.video-list a:hover { background: var(--panel-2); padding-left: 12px;
  text-decoration: none; }
.vi-title { font-size: 15px; font-weight: 600; color: var(--accent); }
.vi-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted);
  align-items: center; flex-wrap: wrap; }
.vi-meta .src-channel { color: var(--text); }
.vi-prop { background: var(--panel-2); padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--border); }

/* layout: sidebar + main. Sidebar sticks just below the (sticky) page header. */
:root { --header-h: 240px; }
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px;
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  align-items: start; }
.layout > main { padding: 0; max-width: none; min-width: 0; }
.topic-sidebar { position: sticky; top: var(--header-h);
  max-height: calc(100vh - var(--header-h) - 8px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 0 24px 0;
  border-right: 1px solid var(--border);
  scrollbar-width: thin; }
.topic-sidebar::-webkit-scrollbar { width: 6px; }
.topic-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.sidebar-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 0 12px 8px 12px; font-weight: 700; }
.sidebar-empty { color: var(--muted); font-size: 12px; padding: 8px 12px; font-style: italic; }
#topic-list { display: flex; flex-direction: column; }
.topic-link { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 8px 12px; font-size: 13px;
  color: var(--text); border-left: 3px solid transparent; }
.topic-link:hover { background: var(--panel-2); border-left-color: var(--accent);
  text-decoration: none; }
.topic-link.active { background: var(--panel-2); border-left-color: var(--accent);
  color: var(--accent); }
.topic-link-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums;
  background: var(--panel-3); padding: 1px 8px; border-radius: 999px; }

/* prominent topic header */
.topic-section { margin: 28px 0; scroll-margin-top: calc(var(--header-h) + 12px); }
.topic-section:first-child { margin-top: 8px; }
.topic-header { font-size: 22px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--accent); margin: 0 0 10px 0;
  padding: 10px 16px; border-radius: 8px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--accent) 18%, var(--panel)) 0%,
    color-mix(in srgb, var(--accent) 4%, var(--panel)) 100%);
  border-left: 4px solid var(--accent);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.topic-header .topic-count { font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: none; letter-spacing: 0; }
.topic-section > details.topic-group > summary {
  font-size: 11px; color: var(--muted); padding: 4px 12px;
  background: transparent; font-weight: 500; }
.topic-section > details.topic-group > summary:hover { background: var(--panel-2); }

/* ---- Mobile (≤900px): single-column, compact header, no horizontal overflow ---- */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  /* The full desktop header is sticky and huge — on mobile let it scroll away
     so content has room to breathe. */
  header { position: static !important; padding: 8px 12px; }
  header h1 { font-size: 15px; }
  main, .video-page, .video-index, main.about { padding: 12px; }
  .layout { grid-template-columns: 1fr; padding: 0 12px; gap: 10px; }
  .topic-sidebar { position: static; max-height: none; border-right: none;
    border-bottom: 1px solid var(--border); padding: 8px 0; overflow: visible; }
  #topic-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
    gap: 4px; }
  .topic-link { display: flex; align-items: center; justify-content: center;
    gap: 4px; border-left: none; border-radius: 12px; padding: 6px 8px;
    background: var(--panel-2); text-align: center; min-height: 32px;
    font-weight: 700; letter-spacing: 0.2px; text-transform: uppercase;
    font-size: clamp(8px, 2.3vw, 11px); line-height: 1.1; }
  .topic-link .topic-link-label { flex: 1 1 auto;
    white-space: normal; word-break: break-word; hyphens: auto;
    overflow-wrap: anywhere; }
  .topic-link .topic-link-count { font-size: clamp(8px, 2vw, 10px);
    padding: 0 5px; flex: 0 0 auto; }
  .top-bar { flex-wrap: wrap; row-gap: 6px; gap: 8px; }
  .top-right { gap: 6px; flex-shrink: 0; }
  .logo-svg { height: 26px; }
  .stats { font-size: 11px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 4px; }
  .filters input, .filters select, .filters button { font-size: 12px; padding: 5px 7px; }
  .filters label { font-size: 11px; }
  .stage-title-header { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .stage-title-header .stage-hero { font-size: 18px; }
  .stage-title-header .stage-subtitle { font-size: 12px; }
  .stage-title-header .stage-count { font-size: 11px; padding: 3px 8px; margin-left: 0; }
  .stage-num-big { width: 32px; height: 32px; font-size: 14px; }
  .stage-desc { font-size: 11px; padding: 0 4px; margin-bottom: 8px; }
  /* row summary wraps cleanly so transcript button never pushes past edge */
  details.row > summary { flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; }
  .row .summary-text { font-size: 13px; flex: 1 1 100%; max-width: 100%; line-height: 1.35; }
  .row .summary-badges { max-width: 100%; }
  .row .summary-date { font-size: 10px; }
  .transcript-link { font-size: 10px; padding: 2px 7px; }
  .topic-header { font-size: 18px; padding: 8px 12px; flex-wrap: wrap; }
  .video-page h1 { font-size: 22px; line-height: 1.3; }
  .transcript p { font-size: 15px; }
  .scroll-prompt { font-size: 11px; padding: 10px 14px; letter-spacing: 1px; }
}

/* ---- Very narrow phones (≤480px) ---- */
@media (max-width: 480px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label { grid-column: span 1; }
  .theme-btn { font-size: 10px; padding: 3px 7px; letter-spacing: 0.3px; }
  .visitor-counter { font-size: 10px; padding: 3px 7px; }
  .logo-svg { height: 22px; }
  .stage-title-header { flex-direction: column; align-items: flex-start; }
  .stage-title-header .stage-count { margin-left: 0; }
  .topic-header { font-size: 16px; flex-direction: column; align-items: flex-start; gap: 4px; }
  .topic-header .topic-count { font-size: 11px; }
}

main.about { max-width: 800px; padding: 24px 20px; }
main.about h1 { color: var(--accent); margin-bottom: 8px; }
main.about h2 { color: var(--accent-2); margin-top: 24px; }
main.about ul { padding-left: 20px; }
main.about li { margin: 8px 0; }
main.about li b { color: var(--stage-c, var(--accent)); }
