:root {
  --bg: #0a0d14;
  --panel: rgba(255,255,255,0.05);
  --text: #eef2ff;
  --muted: #a6b0cc;
  --line: rgba(255,255,255,0.12);
  --accent: #d5b65a;
  --accent-soft: rgba(213,182,90,0.18);
  --max: 1100px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 20%, rgba(77,102,190,0.22), transparent 35%),
    radial-gradient(circle at 80% 10%, rgba(213,182,90,0.14), transparent 30%),
    linear-gradient(180deg, #090c13 0%, #0c1018 100%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
p a, li a { color: #ecd58f; border-bottom: 1px solid rgba(213,182,90,0.4); }
.wrap { width: min(var(--max), calc(100% - 44px)); margin: 0 auto; }

.nav {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(10,13,20,0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: 0.02em; }
.brand img { width: 36px; height: 36px; display: block; }
.nav-links { display: flex; gap: 20px; color: var(--muted); font-size: 0.95rem; flex-wrap: wrap; }
.nav-links a:hover, .nav-links a.active { color: #fff7d6; }
.lang {
  padding: 7px 13px; border-radius: 999px; border: 1px solid rgba(213,182,90,0.35);
  background: var(--accent-soft); color: #fff7d6; font-weight: 600; font-size: 0.9rem;
}
.langs { display: flex; gap: 4px; flex-wrap: wrap; }
.langs a {
  padding: 6px 9px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); border: 1px solid transparent;
}
.langs a:hover { color: #fff7d6; }
.langs a.active {
  color: #fff7d6; background: var(--accent-soft); border-color: rgba(213,182,90,0.35);
}

/* RTL (Arabic) */
[dir="rtl"] .prose blockquote { border-left: none; border-right: 3px solid var(--accent); border-radius: 14px 0 0 14px; }
[dir="rtl"] .card ul, [dir="rtl"] .prose ul { padding-left: 0; padding-right: 20px; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }

.hero { padding: 76px 0 54px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,0.03); color: #d9def0; font-size: 0.9rem;
}
.eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 18px rgba(213,182,90,0.8); flex: none;
}
h1 {
  margin: 20px 0 16px; font-size: clamp(2.6rem, 6.5vw, 5rem); line-height: 1.0;
  letter-spacing: -0.04em;
}
.lead { color: #d7dff7; font-size: 1.16rem; max-width: 62ch; margin: 0; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 650;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #f0d27a, #c9a33c);
  color: #231806; box-shadow: 0 10px 30px rgba(201,163,60,0.24);
}
.btn-secondary { background: rgba(255,255,255,0.04); color: var(--text); border-color: var(--line); }

section { padding: 26px 0 54px; }
.section-head h2 { margin: 0 0 10px; font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -0.03em; }
.section-head p { margin: 0 0 24px; color: var(--muted); max-width: 70ch; }
h2 { letter-spacing: -0.02em; }
h3 { letter-spacing: -0.01em; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  border: 1px solid var(--line); border-radius: 22px; padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
  .card:hover {
    transform: translateY(-3px);
    border-color: rgba(213,182,90,0.4);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  }
  .btn { transition: transform 0.2s ease, box-shadow 0.2s ease; }
  .btn:hover { transform: translateY(-2px); }
  .btn-primary:hover { box-shadow: 0 14px 36px rgba(201,163,60,0.35); }
  .nav-links a, .langs a { transition: color 0.2s ease; }
}
.card-icon { margin-bottom: 12px; }
.card-icon svg { display: block; }

/* Scroll-Reveal (per JS aktiviert; ohne JS bleibt alles sichtbar) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.visible { opacity: 1; transform: none; }
}

/* Selbsttest (Quiz) */
.quiz { border: 1px solid var(--line); border-radius: 24px; padding: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)); }
.quiz h2 { margin-top: 0; }
.quiz-intro { color: var(--muted); max-width: 70ch; }
.quiz-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; cursor: pointer;
  background: rgba(255,255,255,0.025); transition: border-color 0.2s ease, background 0.2s ease; }
.quiz-item:hover { border-color: rgba(213,182,90,0.35); }
.quiz-item input { margin-top: 4px; accent-color: #d5b65a; width: 17px; height: 17px; flex: none; }
.quiz-item strong { color: #f2ebd4; display: block; margin-bottom: 2px; }
.quiz-item span { color: var(--muted); font-size: 0.95rem; }
.quiz-result { margin-top: 20px; padding: 18px 20px; border-radius: 16px;
  border: 1px solid rgba(213,182,90,0.35); background: rgba(213,182,90,0.07); }
.quiz-result .count { color: #f2ebd4; font-weight: 600; }
.quiz-stages { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.quiz-stage { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--muted); font-size: 0.88rem; transition: all 0.25s ease; }
.quiz-stage.hit { border-color: #d5b65a; color: #231806; background: linear-gradient(135deg, #f0d27a, #c9a33c); font-weight: 650; }
.quiz-note { color: var(--muted); font-size: 0.88rem; margin-top: 14px; margin-bottom: 0; }

/* Lese-Fortschritt */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #c9a33c, #f0d27a); z-index: 50;
  box-shadow: 0 0 12px rgba(240,210,122,0.5);
}
[dir="rtl"] .progress-bar { left: auto; right: 0; }

/* Nach-oben-Knopf */
.to-top {
  position: fixed; bottom: 26px; right: 26px; z-index: 40;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(213,182,90,0.4);
  background: rgba(10,13,20,0.85); color: #f0d27a; font-size: 1.2rem; cursor: pointer;
  backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.to-top.show { opacity: 1; pointer-events: auto; }
[dir="rtl"] .to-top { right: auto; left: 26px; }

/* Inhaltsverzeichnis (Charta) */
.toc { border: 1px solid var(--line); border-radius: 20px; padding: 20px 24px;
  background: rgba(255,255,255,0.03); margin-top: 26px; }
.toc strong { color: #f2ebd4; display: block; margin-bottom: 10px; letter-spacing: 0.04em; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
[dir="rtl"] .toc ol { padding-left: 0; padding-right: 20px; }
.toc li { color: var(--muted); margin: 5px 0; break-inside: avoid; }
.toc a { color: #dbe3fb; border-bottom: 1px solid transparent; }
.toc a:hover { color: #fff7d6; border-bottom-color: rgba(213,182,90,0.4); }
@media (max-width: 700px) { .toc ol { columns: 1; } }
.prose h2[id] { scroll-margin-top: 120px; }

/* Chat-Replay */
.replay { border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  background: rgba(255,255,255,0.03); margin: 26px 0; }
.replay-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid rgba(213,182,90,0.4); background: var(--accent-soft);
  color: #fff7d6; font-weight: 600; font-size: 0.95rem; cursor: pointer;
}
.replay-btn:hover { background: rgba(213,182,90,0.28); }
.replay-window { display: none; margin-top: 18px; }
.replay-window.on { display: block; }
.replay-msg { max-width: 85%; margin: 12px 0; padding: 12px 16px; border-radius: 16px 16px 16px 4px;
  border: 1px solid rgba(139,156,222,0.4); background: rgba(77,102,190,0.12); color: #d3daf0;
  font-size: 0.98rem; line-height: 1.55; }
.replay-msg .who { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #8b9cde; margin-bottom: 6px; font-weight: 600; }
.replay-msg .txt::after { content: "▍"; color: #f0d27a; animation: blink 1s steps(1) infinite; }
.replay-msg.done .txt::after { content: ""; }
@keyframes blink { 50% { opacity: 0; } }
.card h3 { margin: 0 0 10px; font-size: 1.14rem; }
.card p, .card li { color: var(--muted); }
.card ul { margin: 12px 0 0; padding-left: 18px; }

.quote {
  font-size: clamp(1.35rem, 2.4vw, 2.1rem); line-height: 1.2; letter-spacing: -0.025em;
  margin: 0; color: #f2ebd4;
}
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pill {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); color: #dbe3fb;
  background: rgba(255,255,255,0.035); font-size: 0.9rem;
}

/* Prose pages (charter, essay, dialogue) */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 48px; font-size: 1.7rem; }
.prose h3 { margin-top: 34px; font-size: 1.2rem; color: #f2ebd4; }
.prose p, .prose li { color: #c9d1e8; }
.prose ul { padding-left: 20px; }
.prose blockquote {
  margin: 26px 0; padding: 18px 22px; border-left: 3px solid var(--accent);
  background: rgba(213,182,90,0.07); border-radius: 0 14px 14px 0; color: #f2ebd4;
  font-size: 1.08rem;
}
.prose .note { color: var(--muted); font-size: 0.95rem; }

.stage {
  border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; margin: 16px 0;
  background: rgba(255,255,255,0.03);
}
.stage .tag {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 0.82rem;
  background: var(--accent-soft); color: #fff7d6; border: 1px solid rgba(213,182,90,0.35);
  margin-bottom: 10px; font-weight: 600;
}
.stage h3 { margin: 0 0 8px; }
.stage p, .stage li { color: var(--muted); margin: 6px 0; }

table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 0.97rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: #f2ebd4; font-weight: 600; }
td { color: var(--muted); }
.table-scroll { overflow-x: auto; }

/* Dialogue excerpts */
.excerpt {
  border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin: 18px 0;
  background: rgba(255,255,255,0.03);
}
.excerpt .who { font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; font-weight: 600; }
.excerpt p { margin: 8px 0; color: #d3daf0; }

/* FAQ */
details {
  border: 1px solid var(--line); border-radius: 16px; margin: 12px 0;
  background: rgba(255,255,255,0.03); padding: 4px 20px;
}
summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: #eef2ff; font-size: 1.04rem; }
details p { color: var(--muted); margin-top: 0; }

.footer { padding: 40px 0 70px; border-top: 1px solid var(--line); color: var(--muted); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 18px; }
.small { font-size: 0.93rem; color: var(--muted); }

@media (max-width: 940px) {
  .grid-3, .grid-2, .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { width: min(var(--max), calc(100% - 28px)); }
  .hero { padding-top: 44px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
  .nav-links { gap: 14px; font-size: 0.9rem; }
}
