/* ============================================================
   Zarathustra Interactive v2 — Main Stylesheet
   F.R.Granaria AC · nietzsche.granaria.tokyo
   ============================================================ */

/* ── DARK THEME (default) ─────────────────────────────── */
:root, [data-theme="dark"] {
  --gold:       #C9A84C;
  --gold-light: #E8C870;
  --gold-dim:   #8B6B2A;
  --bg:         #0D0D18;
  --bg-2:       #13131F;
  --bg-3:       #1A1A2E;
  --bg-4:       #242438;
  --mid:        #2E2E4A;
  --text:       #E8E4D8;
  --text-dim:   #9E9A8E;
  --text-faint: #5A5660;
  --accent:     #7B4FC9;
  --green:      #4CAF72;
  --red:        #C95050;
  --border:     rgba(201,168,76,0.18);
  --border-mid: rgba(201,168,76,0.35);
  --shadow:     0 4px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 40px rgba(201,168,76,0.12);
  --grain-op:   0.03;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-body:  'Crimson Text', Georgia, serif;
  --font-mono:  'Space Mono', monospace;
  --radius-lg:  10px;
  --dark-2:     #13131F;
}

/* ── LIGHT THEME ──────────────────────────────────────── */
[data-theme="light"] {
  --gold:       #9B6E1A;
  --gold-light: #7A5214;
  --gold-dim:   #C9940A;
  --bg:         #FAF8F5;
  --bg-2:       #F2EEE8;
  --bg-3:       #EAE4DC;
  --bg-4:       #E0D8CE;
  --mid:        #CCC4B6;
  --text:       #1A1A2E;
  --text-dim:   #4A4438;
  --text-faint: #9A9086;
  --accent:     #5B2FA9;
  --green:      #2A7A4A;
  --red:        #A93030;
  --border:     rgba(155,110,26,0.22);
  --border-mid: rgba(155,110,26,0.45);
  --shadow:     0 4px 24px rgba(0,0,0,0.12);
  --shadow-gold: 0 0 30px rgba(155,110,26,0.1);
  --grain-op:   0.015;
  --dark-2:     #F2EEE8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  opacity: var(--grain-op);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ── NAV ──────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 2rem;
  background: rgba(13,13,24,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}
[data-theme="light"] .nav { background: rgba(250,248,245,0.94); }

.nav-brand { display: flex; align-items: baseline; gap: 0.5rem; text-decoration: none; flex-shrink: 0; }
.nav-logo { font-family: 'Playfair Display', serif; font-size: 1.7rem; color: var(--gold); font-weight: 700; line-height: 1; }
.nav-title { font-family: 'Playfair Display', serif; font-size: 1rem; color: var(--text); font-weight: 600; letter-spacing: 0.03em; }
.nav-sub { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: var(--text-faint); letter-spacing: 0.08em; }

.nav-links { display: flex; align-items: center; gap: 0.2rem; margin-left: auto; }
.nav-link { padding: 0.35rem 0.75rem; border-radius: 6px; color: var(--text-dim); text-decoration: none; font-family: 'Space Mono', monospace; font-size: 0.72rem; letter-spacing: 0.04em; transition: all 0.2s; border: 1px solid transparent; white-space: nowrap; }
.nav-link:hover { color: var(--gold); border-color: var(--border); }
.nav-link.active { color: var(--gold); background: rgba(201,168,76,0.08); border-color: var(--border); }

.nav-chat-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 4px; vertical-align: middle; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

.theme-toggle { background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px; color: var(--gold); padding: 0.3rem 0.55rem; cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.theme-toggle:hover { border-color: var(--border-mid); }

.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text-dim); padding: 0.3rem 0.65rem; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.mobile-menu { display: none; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 1rem 2rem; }
.mobile-menu a { padding: 0.55rem 0; color: var(--text-dim); text-decoration: none; font-family: 'Space Mono', monospace; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.mobile-menu.open { display: flex; }

@media (max-width: 900px) { .nav-links { display: none; } .nav-toggle { display: block; } }
@media (max-width: 600px) { .nav { padding: 0.7rem 1rem; } .nav-sub { display: none; } }

/* ── MAIN & FOOTER ────────────────────────────────────── */
.main { min-height: calc(100vh - 110px); }
.footer { border-top: 1px solid var(--border); padding: 1rem 2rem; background: var(--bg-2); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; font-family: 'Space Mono', monospace; font-size: 0.68rem; color: var(--text-faint); letter-spacing: 0.04em; }
.footer-sep { color: var(--gold-dim); }
.footer-pdf { color: var(--gold-dim); text-decoration: none; }
.footer-pdf:hover { color: var(--gold); }

/* ── HERO ─────────────────────────────────────────────── */
.hero { position: relative; padding: 5rem 2.5rem 3.5rem; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(201,168,76,0.07) 0%, transparent 70%); pointer-events: none; }
.hero-eyebrow { font-family: 'Space Mono', monospace; font-size: 0.7rem; letter-spacing: 0.14em; color: var(--gold); text-transform: uppercase; margin-bottom: 1rem; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.2rem,6vw,4.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--text); max-width: 780px; margin-bottom: 0.5rem; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero-sub { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--text-dim); font-style: italic; margin-bottom: 1.5rem; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--text-faint); letter-spacing: 0.06em; }
.hero-meta span { color: var(--gold-dim); }

/* ── CARDS ────────────────────────────────────────────── */
.section { padding: 2.5rem 2.5rem; }
.section-title { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 600; color: var(--text); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.8rem; }
.section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, var(--border), transparent); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; cursor: pointer; transition: all 0.25s; text-decoration: none; color: inherit; display: block; position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(to right, var(--gold-dim), transparent); opacity: 0; transition: opacity 0.25s; }
.card:hover { border-color: var(--border-mid); transform: translateY(-2px); box-shadow: var(--shadow-gold); }
.card:hover::before { opacity: 1; }
.card-part { font-family: 'Space Mono', monospace; font-size: 0.63rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-dim); margin-bottom: 0.5rem; }
.card-icon { font-size: 1.7rem; margin-bottom: 0.5rem; display: block; }
.card h3 { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; color: var(--text); line-height: 1.3; margin-bottom: 0.3rem; }
.card-subtitle { font-size: 0.88rem; color: var(--text-faint); font-style: italic; margin-bottom: 0.7rem; }
.card p { font-size: 0.88rem; color: var(--text-dim); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-arrow { display: flex; align-items: center; justify-content: flex-end; margin-top: 0.9rem; color: var(--gold-dim); font-size: 0.78rem; font-family: 'Space Mono', monospace; gap: 0.4rem; transition: all 0.2s; }
.card:hover .card-arrow { color: var(--gold); gap: 0.6rem; }

/* Progress widget */
.progress-widget { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.3rem; margin-bottom: 1.2rem; }
.progress-widget-label { font-family: 'Space Mono', monospace; font-size: 0.65rem; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }
.progress-widget-bar { height: 4px; background: var(--bg-4); border-radius: 2px; margin-bottom: 0.4rem; }
.progress-widget-fill { height: 100%; background: linear-gradient(to right, var(--gold-dim), var(--gold)); border-radius: 2px; transition: width 0.5s ease; }
.progress-widget-text { font-family: 'Space Mono', monospace; font-size: 0.68rem; color: var(--text-faint); }
.bookmark-panel { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 0.85rem 1.3rem; margin-bottom: 1.2rem; }
.bookmark-panel-title { font-family: 'Space Mono', monospace; font-size: 0.65rem; color: var(--gold-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.5rem; }
.bookmark-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.bookmark-chip { padding: 0.25rem 0.7rem; background: var(--bg-3); border: 1px solid var(--border); border-radius: 20px; text-decoration: none; color: var(--text-dim); font-family: 'Space Mono', monospace; font-size: 0.68rem; transition: all 0.2s; }
.bookmark-chip:hover { border-color: var(--gold-dim); color: var(--gold); }

/* ── CHAPTER ──────────────────────────────────────────── */
.chapter-header { padding: 3.5rem 2.5rem 2.5rem; border-bottom: 1px solid var(--border); background: linear-gradient(to bottom, var(--bg-3), var(--bg)); position: relative; }
.chapter-header::before { content: attr(data-icon); position: absolute; top: 1.5rem; right: 2rem; font-size: 4.5rem; opacity: 0.1; }
.chapter-part { font-family: 'Space Mono', monospace; font-size: 0.68rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.7rem; }
.chapter-header h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.7rem,4vw,2.8rem); font-weight: 700; line-height: 1.2; margin-bottom: 0.4rem; }
.chapter-subtitle { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.15rem; color: var(--text-dim); }
.chapter-body { padding: 2.5rem 2.5rem; max-width: 800px; }
.prose { font-size: 1.08rem; line-height: 1.8; color: var(--text); }
.prose p { margin-bottom: 1.1rem; }
.section-label { font-family: 'Space Mono', monospace; font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-dim); margin: 2rem 0 0.8rem; padding-bottom: 0.3rem; border-bottom: 1px solid var(--border); }
.key-ideas { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.key-ideas li { padding: 0.6rem 1rem; background: var(--bg-3); border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; font-size: 0.93rem; color: var(--text-dim); }
.quote-block { margin: 1rem 0; padding: 1.1rem 1.4rem; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; position: relative; }
.quote-block::before { content: '"'; position: absolute; top: -0.3rem; left: 0.9rem; font-family: 'Playfair Display', serif; font-size: 2.8rem; color: var(--gold-dim); line-height: 1; opacity: 0.35; }
.quote-text { font-family: 'Playfair Display', serif; font-style: italic; font-size: 1.03rem; color: var(--text); line-height: 1.6; padding-left: 0.4rem; }
.quote-source { font-family: 'Space Mono', monospace; font-size: 0.65rem; color: var(--gold-dim); margin-top: 0.5rem; letter-spacing: 0.06em; }
.student-note { background: rgba(123,79,201,0.07); border: 1px solid rgba(123,79,201,0.22); border-radius: 10px; padding: 1.1rem 1.4rem; margin: 1.8rem 0; }
.student-note-label { font-family: 'Space Mono', monospace; font-size: 0.63rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.45rem; }
.student-note p { font-size: 0.93rem; color: var(--text-dim); }
.bookmark-btn { background: none; border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.8rem; color: var(--text-faint); cursor: pointer; font-family: 'Space Mono', monospace; font-size: 0.7rem; transition: all 0.2s; }
.bookmark-btn:hover { border-color: var(--gold-dim); color: var(--gold); }
.bookmark-btn.bookmarked { border-color: var(--gold-dim); color: var(--gold); background: rgba(201,168,76,0.08); }
.chapter-nav { display: flex; gap: 0.8rem; flex-wrap: wrap; padding: 1.8rem 2.5rem; border-top: 1px solid var(--border); }
.chapter-nav-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.1rem; border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text-dim); font-family: 'Space Mono', monospace; font-size: 0.72rem; letter-spacing: 0.04em; transition: all 0.2s; background: var(--bg-2); }
.chapter-nav-btn:hover { border-color: var(--border-mid); color: var(--gold); }
.chapter-nav-btn.next { margin-left: auto; }
.progress-bar { height: 3px; background: var(--bg-4); }
.progress-fill { height: 100%; background: linear-gradient(to right, var(--gold-dim), var(--gold)); transition: width 0.4s ease; }

/* ── GLOSSARY ─────────────────────────────────────────── */
.glossary-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 0.7rem; transition: border-color 0.2s; }
.glossary-item:hover { border-color: var(--border-mid); }
.glossary-header { display: flex; align-items: center; justify-content: space-between; padding: 0.95rem 1.3rem; cursor: pointer; background: var(--bg-2); }
.glossary-term { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 600; color: var(--gold); }
.glossary-toggle { font-size: 1.1rem; color: var(--text-faint); transition: transform 0.25s; user-select: none; }
.glossary-body { display: none; padding: 0.9rem 1.3rem 1.1rem; background: var(--bg-3); border-top: 1px solid var(--border); }
.glossary-body.open { display: block; }
.glossary-def { color: var(--text); font-size: 0.98rem; line-height: 1.7; margin-bottom: 0.7rem; }
.glossary-related { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tag { padding: 0.18rem 0.65rem; background: var(--bg-4); border: 1px solid var(--border); border-radius: 20px; font-family: 'Space Mono', monospace; font-size: 0.65rem; color: var(--text-faint); letter-spacing: 0.04em; }

/* ── QUIZ ─────────────────────────────────────────────── */
.quiz-container { max-width: 700px; margin: 0 auto; padding: 2.5rem 2rem; }
.quiz-header { margin-bottom: 2rem; text-align: center; }
.quiz-header h1 { font-family: 'Playfair Display', serif; font-size: 2rem; margin-bottom: 0.4rem; }
.quiz-header p { color: var(--text-dim); font-style: italic; }
.quiz-progress { margin-bottom: 1.8rem; }
.quiz-progress-text { font-family: 'Space Mono', monospace; font-size: 0.7rem; color: var(--text-faint); margin-bottom: 0.45rem; display: flex; justify-content: space-between; }
.question-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1.8rem; margin-bottom: 0.8rem; display: none; }
.question-card.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.question-num { font-family: 'Space Mono', monospace; font-size: 0.65rem; color: var(--gold-dim); letter-spacing: 0.1em; margin-bottom: 0.7rem; }
.question-text { font-family: 'Playfair Display', serif; font-size: 1.2rem; line-height: 1.5; color: var(--text); margin-bottom: 1.3rem; }
.options { display: flex; flex-direction: column; gap: 0.55rem; }
.option-btn { padding: 0.8rem 1.1rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-3); color: var(--text); cursor: pointer; text-align: left; font-family: 'Crimson Text', serif; font-size: 1rem; line-height: 1.4; transition: all 0.18s; }
.option-btn:hover:not(:disabled) { border-color: var(--gold-dim); background: var(--bg-4); }
.option-btn.correct { border-color: var(--green) !important; background: rgba(76,175,114,0.1) !important; }
.option-btn.wrong { border-color: var(--red) !important; background: rgba(201,80,80,0.08) !important; }
.option-btn:disabled { cursor: default; }
.explanation { margin-top: 0.9rem; padding: 0.9rem 1.1rem; background: var(--bg); border-radius: 6px; border-left: 3px solid var(--gold-dim); font-size: 0.93rem; color: var(--text-dim); display: none; }
.explanation.visible { display: block; animation: fadeUp 0.25s ease; }
.quiz-btn { padding: 0.7rem 1.6rem; background: var(--gold); color: var(--bg); border: none; border-radius: 6px; font-family: 'Space Mono', monospace; font-size: 0.78rem; letter-spacing: 0.06em; cursor: pointer; transition: all 0.2s; display: none; margin-top: 0.8rem; }
.quiz-btn:hover { background: var(--gold-light); }
.quiz-btn.visible { display: inline-block; }
.quiz-result { text-align: center; padding: 2.5rem; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; display: none; }
.quiz-result.visible { display: block; animation: fadeUp 0.4s ease; }
.quiz-score { font-family: 'Playfair Display', serif; font-size: 3.5rem; color: var(--gold); }
.quiz-verdict { font-size: 1.05rem; color: var(--text-dim); margin: 0.4rem 0 1.3rem; font-style: italic; }

/* ── CHAT ─────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; height: calc(100vh - 60px - 48px); }
@media (max-width: 768px) { .chat-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; } }
.chat-sidebar { border-right: 1px solid var(--border); background: var(--bg-2); padding: 1.2rem; overflow-y: auto; }
.chat-sidebar-title { font-family: 'Space Mono', monospace; font-size: 0.63rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.8rem; }
.chat-topic-btn { width: 100%; text-align: left; padding: 0.6rem 0.85rem; margin-bottom: 0.35rem; background: var(--bg-3); border: 1px solid var(--border); border-radius: 6px; color: var(--text-dim); cursor: pointer; font-family: 'Crimson Text', serif; font-size: 0.88rem; transition: all 0.18s; line-height: 1.3; }
.chat-topic-btn:hover { border-color: var(--border-mid); color: var(--text); }
.chat-main { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.3rem 1.8rem; display: flex; flex-direction: column; gap: 1.1rem; }
.chat-bubble { max-width: 78%; padding: 0.85rem 1.1rem; border-radius: 10px; font-size: 1rem; line-height: 1.6; animation: fadeUp 0.25s ease; }
.chat-bubble.user { align-self: flex-end; background: rgba(201,168,76,0.1); border: 1px solid rgba(201,168,76,0.22); color: var(--text); }
.chat-bubble.assistant { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--border); color: var(--text); }
.bubble-label { font-family: 'Space Mono', monospace; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.35rem; }
.bubble-label.user-label { color: var(--gold-dim); text-align: right; }
.bubble-label.assistant-label { color: var(--text-faint); }
.chat-typing { align-self: flex-start; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 0.85rem 1.1rem; display: none; margin: 0 1.8rem; }
.chat-typing.visible { display: flex; gap: 4px; align-items: center; }
.typing-dot { width: 6px; height: 6px; background: var(--text-faint); border-radius: 50%; animation: typingBounce 1.2s infinite; }
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce { 0%,80%,100%{transform:scale(0.7);opacity:0.4} 40%{transform:scale(1);opacity:1} }
.chat-input-area { padding: 0.9rem 1.8rem 1.1rem; border-top: 1px solid var(--border); background: var(--bg-2); }
.chat-input-row { display: flex; gap: 0.7rem; align-items: flex-end; }
.chat-input { flex: 1; background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 0.95rem; color: var(--text); font-family: 'Crimson Text', serif; font-size: 1rem; resize: none; max-height: 110px; transition: border-color 0.2s; line-height: 1.5; }
.chat-input:focus { outline: none; border-color: var(--gold-dim); }
.chat-send { padding: 0.75rem 1.1rem; background: var(--gold); color: var(--bg); border: none; border-radius: 10px; cursor: pointer; font-family: 'Space Mono', monospace; font-size: 0.72rem; letter-spacing: 0.06em; transition: all 0.2s; white-space: nowrap; }
.chat-send:hover { background: var(--gold-light); }
.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-hint { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: var(--text-faint); margin-top: 0.45rem; letter-spacing: 0.04em; }

/* ── TIMELINE ─────────────────────────────────────────── */
.timeline { position: relative; padding: 1rem 2.5rem 2rem 5rem; max-width: 860px; }
.timeline::before { content: ''; position: absolute; left: 3.2rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(to bottom, var(--gold-dim), transparent); }
.timeline-item { position: relative; margin-bottom: 2.2rem; }
.timeline-dot { position: absolute; left: -2.4rem; top: 0.35rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--gold-dim); transition: all 0.2s; }
.timeline-item:hover .timeline-dot { background: var(--gold); border-color: var(--gold); }
.timeline-year { font-family: 'Space Mono', monospace; font-size: 0.82rem; color: var(--gold); letter-spacing: 0.1em; margin-bottom: 0.2rem; }
.timeline-phase { font-family: 'Space Mono', monospace; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.2rem; }
.timeline-event { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.timeline-detail { font-size: 0.93rem; color: var(--text-dim); line-height: 1.6; }
.timeline-content { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem 1.3rem; }

/* ── COMPARE (philosophers) ───────────────────────────── */
.phil-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.2rem; transition: all 0.25s; }
.phil-card:hover { border-color: var(--border-mid); box-shadow: var(--shadow-gold); }
.phil-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.phil-icon { font-size: 2rem; }
.phil-name { font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 700; color: var(--text); }
.phil-dates { font-family: 'Space Mono', monospace; font-size: 0.68rem; color: var(--text-faint); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
@media (max-width: 600px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-label { font-family: 'Space Mono', monospace; font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.5rem; }
.compare-label.agree { color: var(--green); }
.compare-label.disagree { color: var(--red); }
.compare-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; }
.compare-list li { font-size: 0.9rem; color: var(--text-dim); padding: 0.3rem 0.7rem; border-radius: 4px; background: var(--bg-3); border-left: 2px solid var(--border); }
.compare-list.disagree-list li { border-left-color: rgba(201,80,80,0.4); }
.verdict-box { background: var(--bg-3); border: 1px solid var(--border); border-radius: 8px; padding: 0.9rem 1.1rem; margin-top: 1rem; }
.verdict-label { font-family: 'Space Mono', monospace; font-size: 0.6rem; color: var(--gold-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.3rem; }
.verdict-text { font-size: 0.95rem; color: var(--text-dim); line-height: 1.6; }
.filter-btn { padding: 0.35rem 0.9rem; border: 1px solid var(--border); border-radius: 20px; background: var(--bg-2); color: var(--text-faint); cursor: pointer; font-family: 'Space Mono', monospace; font-size: 0.7rem; transition: all 0.2s; }
.filter-btn:hover { border-color: var(--border-mid); color: var(--text); }
.filter-btn.active { background: rgba(201,168,76,0.1); border-color: var(--border-mid); color: var(--gold); }

/* ── SEARCH ───────────────────────────────────────────── */
.search-result { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1.1rem 1.3rem; margin-bottom: 0.7rem; text-decoration: none; color: inherit; display: block; transition: all 0.2s; }
.search-result:hover { border-color: var(--border-mid); }

/* ── UTILS ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.3rem; border-radius: 6px; cursor: pointer; font-family: 'Space Mono', monospace; font-size: 0.74rem; letter-spacing: 0.06em; text-decoration: none; transition: all 0.2s; border: none; }
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.btn-outline:hover { border-color: var(--border-mid); color: var(--text); }
.badge { display: inline-block; padding: 0.13rem 0.55rem; background: rgba(201,168,76,0.1); border: 1px solid var(--border); border-radius: 20px; font-family: 'Space Mono', monospace; font-size: 0.62rem; color: var(--gold-dim); letter-spacing: 0.06em; }

@media (max-width: 600px) {
  .section { padding: 1.5rem 1rem; }
  .chapter-header { padding: 2rem 1.2rem; }
  .chapter-body { padding: 1.5rem 1.2rem; }
  .hero { padding: 3rem 1.2rem 2rem; }
  .chat-sidebar { display: none; }
  .timeline { padding: 1rem 1rem 2rem 3.5rem; }
  .timeline::before { left: 1.5rem; }
  .timeline-dot { left: -1.7rem; }
}

/* ── COOKIE BANNER ──────────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--bg-2); border-top: 1px solid var(--border-mid);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  transform: translateY(100%); opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.cookie-banner.cookie-visible { transform: translateY(0); opacity: 1; }
.cookie-banner.cookie-hidden { transform: translateY(100%); opacity: 0; pointer-events: none; }
.cookie-inner {
  max-width: 900px; margin: 0 auto; padding: 1.2rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.cookie-text {
  flex: 1; min-width: 200px; margin: 0;
  font-family: var(--font-body); font-size: 0.9rem; color: var(--text-dim); line-height: 1.5;
}
.cookie-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }
.cookie-btn {
  padding: 0.5rem 1.2rem; border-radius: 6px; font-family: var(--font-mono);
  font-size: 0.75rem; text-decoration: none; cursor: pointer; transition: all 0.2s;
  border: 1px solid var(--border-mid);
}
.cookie-accept {
  background: var(--gold); color: var(--bg); border-color: var(--gold); font-weight: 700;
}
.cookie-accept:hover { background: var(--gold-light); }
.cookie-info { background: transparent; color: var(--text-dim); }
.cookie-info:hover { color: var(--text); border-color: var(--gold-dim); }
@media (max-width: 600px) {
  .cookie-inner { flex-direction: column; text-align: center; padding: 1rem; gap: 1rem; }
  .cookie-actions { justify-content: center; }
}
