/* public/spindel-refined.css
   FINALE VERSION - DUNKLE ELEGANZ MIT LEBEN
   ================================================== */

/* Crimson Text / Inter / EB Garamond kommen seit 10.6.2026 selbst gehostet
   aus /lib/fonts/fonts.css (global via Layout) — kein Google-Import mehr. */

:root {
  /* Angepasste Farbpalette basierend auf Screenshot */
  --bg-primary: #1a1a1a;
  --bg-secondary: #242424;
  --bg-tertiary: #2a2a2a;
  
  --text-primary: #d4d4d4;
  --text-secondary: #a8a8a8;
  --text-muted: #787878;
  
  --gold-primary: #C9A961;
  --gold-muted: rgba(201, 169, 97, 0.6);
  --gold-subtle: rgba(201, 169, 97, 0.2);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.12);
  
  /* Abstände */
  --raum-klein: 0.75rem;
  --raum-mittel: 1.5rem;
  --raum-gross: 2.5rem;
  --raum-sehr-gross: 4rem;
  
  /* Timing */
  --ease-spindel: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   GLOBALE BASIS-STYLES
   ======================================== */

body {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Tisch Z5: Gold-Selektion */
.geschichte-container ::selection {
  background: rgba(201, 169, 97, 0.3);
  color: #fff;
}

.geschichte-container {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ========================================
   STORY CONTAINER - ZENTRALE SPALTE
   ======================================== */

/* .story-main gehört geschichte.astro (scoped, 800px) — hier keine Doppelfassung. */

.story-sections {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0;
}

/* Kapitel-Header (.chapter-header/-number/-title/-subtitle) gehört geschichte.astro
   (scoped gewinnt) — die alte Doppelfassung hier war tot und wurde entfernt (11.6.2026). */

/* ========================================
   HAUPTTEXT - GESCHICHTE
   ======================================== */

/* Tisch Z2: Staggered Fade-in entfernt — Text ist da, wird nicht vorgeführt */
.story-section.section-text {
  margin: var(--raum-gross) 0;
  opacity: 1;
}

.story-section.section-text p {
  color: var(--text-primary);
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.8;
  margin-bottom: 1.8rem;
  text-align: justify;
  hyphens: auto;
  font-weight: 400;
  letter-spacing: 0.01em;
  word-spacing: 0.05em;
}

/* Große Initiale - goldener Akzent */
.story-section.section-text:first-of-type > p:first-child::first-letter {
  font-family: 'EB Garamond', serif;
  font-size: 4.2rem;
  float: left;
  line-height: 0.8;
  margin: 0.1em 0.15em -0.05em 0;
  font-weight: 400;
  color: var(--gold-primary);
  text-shadow: 0 2px 10px rgba(201, 169, 97, 0.2);
}

/* ========================================
   GEDANKEN-WOLKEN - MIT FARBLICHEN NUANCEN
   ======================================== */

.thought-cloud {
  margin: var(--raum-gross) -1rem;
  padding: 2rem 2.5rem 2rem 3rem;
  position: relative;
  border-left: 2px solid transparent;
  transition: all 0.4s ease;
}

/* Begegnungs-Erwachen (11.6.2026): die innere Stimme taucht erst auf, wenn
   der Leser ihr begegnet — leise, nur Opazität, kein Vorführen. Die Klasse
   wartet-auf-begegnung setzt NUR der Renderer (mit IntersectionObserver);
   ohne JS-Beobachter bleibt der Gedanke schlicht sichtbar. */
.thought-cloud.wartet-auf-begegnung {
  opacity: 0;
  transition: opacity 0.8s var(--ease-breath, cubic-bezier(0.25, 0.46, 0.45, 0.94));
}

.thought-cloud.wartet-auf-begegnung.ist-begegnet {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .thought-cloud.wartet-auf-begegnung {
    opacity: 1;
    transition: none;
  }
}

/* Nebel-Effekt */
.thought-cloud::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -20px;
  right: -20px;
  bottom: -10px;
  background: radial-gradient(ellipse at left center,
    var(--thought-bg-color) 0%,
    transparent 70%);
  opacity: 0.15;
  z-index: -1;
  filter: blur(25px);
  transition: opacity 0.4s ease;
}

.thought-cloud:hover::before {
  opacity: 0.25;
}

/* Akzent-Linie */
.thought-cloud::after {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--thought-accent-color) 50%,
    transparent 100%);
  opacity: 0.4;
}

.thought-cloud p {
  margin: 0;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.8;
  font-family: 'EB Garamond', serif;
  padding-left: 1rem;
  position: relative;
}

/* Gedanken-Marker */
.thought-cloud p::before {
  content: '⟨';
  position: absolute;
  left: -0.5rem;
  top: 0;
  font-size: 1.4rem;
  opacity: 0.2;
  font-style: normal;
  color: var(--thought-accent-color);
}

/* 5 GEDANKEN-TIEFEN - Silberasche-Grundfarbe + warm-Halo bei Tiefe
   (System-Tisch Mai 2026: Gold exklusiv fuer dialogue, thought silber-basiert,
   Tiefe orthogonal zu Quelle, depth modifiziert Opazitaet + Text-Shadow-Glow) */
.thought-depth-1 {
  --thought-bg-color: rgba(196, 195, 203, 0.04);
  --thought-accent-color: rgba(196, 195, 203, 0.3);
  border-left-color: rgba(196, 195, 203, 0.1);
}

.thought-depth-1 p {
  color: #C4C3CB;
  opacity: 0.55;
  font-style: italic;
}

.thought-depth-2 {
  --thought-bg-color: rgba(196, 195, 203, 0.05);
  --thought-accent-color: rgba(196, 195, 203, 0.4);
  border-left-color: rgba(196, 195, 203, 0.15);
}

.thought-depth-2 p {
  color: #C4C3CB;
  opacity: 0.70;
  font-style: italic;
}

.thought-depth-3 {
  --thought-bg-color: rgba(196, 195, 203, 0.06);
  --thought-accent-color: rgba(196, 195, 203, 0.5);
  border-left-color: rgba(196, 195, 203, 0.2);
}

.thought-depth-3 p {
  color: #C4C3CB;
  opacity: 0.82;
  font-style: italic;
  text-shadow: 0 0 2px rgba(200, 188, 160, 0.15);  /* erstes Ahnen der Waerme */
}

.thought-depth-4 {
  --thought-bg-color: rgba(200, 188, 160, 0.04);
  --thought-accent-color: rgba(196, 195, 203, 0.5);
  border-left-color: rgba(200, 188, 160, 0.2);
  background: linear-gradient(90deg,
    rgba(200, 188, 160, 0.03) 0%,
    transparent 60%);
}

.thought-depth-4 p {
  color: #C4C3CB;
  opacity: 0.92;
  font-style: italic;
  text-shadow: 0 0 4px rgba(200, 188, 160, 0.35);  /* innere Glut */
  animation: thought-pulse-4 2.4s ease-in-out infinite;
}

.thought-depth-5 {
  --thought-bg-color: rgba(200, 188, 160, 0.06);
  --thought-accent-color: rgba(196, 195, 203, 0.6);
  border-left-color: rgba(200, 188, 160, 0.25);
  background: linear-gradient(90deg,
    rgba(200, 188, 160, 0.05) 0%,
    transparent 70%);
}

.thought-depth-5 p {
  color: #C8D0D8;
  opacity: 0.98;
  font-style: italic;
  text-shadow: 0 0 6px rgba(200, 188, 160, 0.55);  /* dichte Resonanz */
  animation: thought-pulse-5 2.4s ease-in-out infinite;
}

/* Pulsation - atmender Innen-Strom bei tiefer Reflexion (Tisch Z3, DeepSeek-Vorschlag) */
@keyframes thought-pulse-4 {
  0%, 100% { text-shadow: 0 0 4px rgba(200, 188, 160, 0.35); }
  50%      { text-shadow: 0 0 6px rgba(200, 188, 160, 0.50); }
}

@keyframes thought-pulse-5 {
  0%, 100% { text-shadow: 0 0 6px rgba(200, 188, 160, 0.55); }
  50%      { text-shadow: 0 0 8px rgba(200, 188, 160, 0.72); }
}

/* Adaptive Margin (Robin-Entscheidung): innerhalb Innen-Schicht eng,
   an Schicht-Grenzen 8px Atemmoment */
.thought-cloud + .thought-cloud {
  margin-top: 0;
}

.dialogue-section + .thought-cloud,
.thought-cloud + .dialogue-section {
  margin-top: 0.5rem;  /* ~8px */
}

/* voice: fluestern - hörbar gemurmelt im dialogue (Audio: leiser + Reverb;
   visuell: weicher, fast in den Innen-Stil eintauchend) */
.dialogue-box[data-voice="fluestern"] {
  opacity: 0.80;
}

.dialogue-box[data-voice="fluestern"] .dialogue-text {
  font-style: italic;
  text-shadow: 0 0 3px rgba(200, 188, 160, 0.20);
}

/* ========================================
   DIALOGE - MEHR PRÄSENZ
   ======================================== */

.dialogue-section {
  margin: var(--raum-sehr-gross) 0;
  position: relative;
}

.dialogue-box {
  margin: var(--raum-mittel) 0;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  position: relative;
  transition: all 0.3s ease;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

/* Akzent-Striche */
.dialogue-box::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transition: all 0.3s ease;
}

/* Protagonist - Links */
.dialogue-box[data-speaker="protagonist"]::before,
.dialogue-box.speaker-protagonist::before {
  left: 0;
  background: linear-gradient(180deg,
    rgba(165, 170, 180, 0.6) 0%,
    rgba(165, 170, 180, 0.1) 100%);
}

/* Andere - Rechts */
.dialogue-box:not([data-speaker="protagonist"]):not(.speaker-protagonist)::before {
  right: 0;
  background: linear-gradient(180deg,
    var(--speaker-accent, rgba(165, 170, 180, 0.6)) 0%,
    transparent 100%);
}

.dialogue-box:hover {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%);
  transform: translateX(2px);
}

.dialogue-box:not([data-speaker="protagonist"]):not(.speaker-protagonist):hover {
  transform: translateX(-2px);
}

.dialogue-box .speaker-name {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}

.dialogue-box .dialogue-text {
  color: var(--text-primary);
  font-family: 'EB Garamond', serif;
  font-size: 1.25rem;
  line-height: 1.7;
}

/* Style-Varianten */
.dialogue-box.style-grau {
  border-color: rgba(145, 150, 165, 0.15);
}

.dialogue-box.style-gold {
  --speaker-accent: rgba(201, 169, 97, 0.6);
  border-color: var(--gold-subtle);
  background: linear-gradient(135deg,
    rgba(201, 169, 97, 0.04) 0%,
    rgba(201, 169, 97, 0.01) 100%);
}

.dialogue-box.style-gold .speaker-name {
  color: var(--gold-muted);
}

.dialogue-box.style-schwarz {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.05);
}

.dialogue-box.style-weiss {
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Die stummen Stimmen bekommen ihre Farbe (11.6.2026) — leise wie gold:
   nur Akzentstreifen + Border + Hauch + Name, der Text bleibt Text. */

/* gruen — der Verkäufer (Kap 11): Pfingstrosen, Wurzeln, Yin. Erdiges Moos. */
.dialogue-box.style-gruen {
  --speaker-accent: rgba(143, 168, 130, 0.6);
  border-color: rgba(143, 168, 130, 0.2);
  background: linear-gradient(135deg,
    rgba(143, 168, 130, 0.04) 0%,
    rgba(143, 168, 130, 0.01) 100%);
}

.dialogue-box.style-gruen .speaker-name {
  color: rgba(143, 168, 130, 0.65);
}

/* lila — die Orchideen-Freundinnen (Kap 21): gedämpftes Abend-Violett. */
.dialogue-box.style-lila {
  --speaker-accent: rgba(158, 138, 168, 0.6);
  border-color: rgba(158, 138, 168, 0.2);
  background: linear-gradient(135deg,
    rgba(158, 138, 168, 0.04) 0%,
    rgba(158, 138, 168, 0.01) 100%);
}

.dialogue-box.style-lila .speaker-name {
  color: rgba(158, 138, 168, 0.7);
}

/* gelb — die Frau im gelben Meer (Kap 13): blasses, kühles See-Gelb,
   bewusst getrennt von der warmen Gold-Patina. */
.dialogue-box.style-gelb {
  --speaker-accent: rgba(214, 210, 160, 0.55);
  border-color: rgba(214, 210, 160, 0.18);
  background: linear-gradient(135deg,
    rgba(214, 210, 160, 0.04) 0%,
    rgba(214, 210, 160, 0.01) 100%);
}

.dialogue-box.style-gelb .speaker-name {
  color: rgba(214, 210, 160, 0.65);
}

/* ========================================
   PROSA - ANIMIERTE SYMBOLE
   ======================================== */

.prose-section {
  margin: calc(var(--raum-sehr-gross) * 1.5) auto;
  padding: var(--raum-gross) 0;
  max-width: 580px;
  text-align: center;
  position: relative;
}

.prose-section::before,
.prose-section::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--border-subtle) 50%,
    transparent 100%);
}

.prose-section::before { top: 0; }
.prose-section::after { bottom: 0; }

.prose-symbol-container {
  margin-bottom: 2rem;
}

.prose-symbol {
  display: inline-block;
  font-size: 1.8rem;
  color: var(--text-muted);
  opacity: 0.4;
  transition: opacity 0.4s ease;
}

/* Zeit - langsame Rotation */
.mode-zeit .prose-symbol {
  animation: zeitRotation 40s linear infinite;
}

@keyframes zeitRotation {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Weite - sanfte Expansion */
.mode-weite .prose-symbol {
  animation: weiteAtmung 20s ease-in-out infinite;
}

@keyframes weiteAtmung {
  0%, 100% { 
    letter-spacing: 0.15em;
    opacity: 0.4;
  }
  50% { 
    letter-spacing: 0.3em;
    opacity: 0.5;
  }
}

/* Höhe - Aufsteigen */
.mode-hoehe .prose-symbol {
  color: var(--gold-muted);
  animation: hoeheAufstieg 15s ease-in-out infinite;
}

@keyframes hoeheAufstieg {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-1px); /* Tisch Z3: 3px→1px */
    opacity: 0.5;
  }
}

/* Tiefe - Spirale ENTFERNT (Tisch Z3: zu invasiv), statischer Skew */
.mode-tiefe .prose-symbol {
  transform: skewX(0.2deg);
  opacity: 0.4;
}

.prose-text {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.15rem;
  line-height: 2;
  letter-spacing: 0.02em;
}

/* Quadrant-spezifisch */
.mode-zeit .prose-text {
  font-style: italic;
  letter-spacing: 0.03em;
}

.mode-weite .prose-text {
  letter-spacing: 0.15em;
  word-spacing: 0.3em;
  text-transform: lowercase;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
}

.mode-hoehe .prose-text {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold-muted);
  font-style: normal;
}

.mode-tiefe .prose-text {
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0.9;
}

/* ========================================
   PAUSE - DEUTLICHE WELLEN-ANIMATION
   ======================================== */

.story-pause {
  margin: var(--raum-sehr-gross) 0;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Fließende Welle im Hintergrund */
.story-pause::before {
  content: '';
  position: absolute;
  left: -50vw;
  right: -50vw;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(200, 200, 200, 0.05) 30%,
    rgba(200, 200, 200, 0.1) 50%,
    rgba(200, 200, 200, 0.05) 70%,
    transparent 100%);
  animation: pauseWellenFluss 12s linear infinite;
  filter: blur(1px);
}

@keyframes pauseWellenFluss {
  from { transform: translateX(-200px); }
  to { transform: translateX(200px); }
}

.pause-lines {
  display: flex;
  gap: 15px;
  align-items: center;
  position: relative;
}

.pause-line {
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(200, 200, 200, 0.3) 50%,
    transparent 100%);
  animation: linienPulsieren 12s ease-in-out infinite; /* Tisch Z3: 8s→12s */
}

.pause-line:nth-child(4) {
  height: 40px;
  animation-delay: 0s;
}

.pause-line:nth-child(3),
.pause-line:nth-child(5) {
  height: 30px;
  animation-delay: 0.3s;
}

.pause-line:nth-child(2),
.pause-line:nth-child(6) {
  height: 20px;
  animation-delay: 0.6s;
}

.pause-line:nth-child(1),
.pause-line:nth-child(7) {
  height: 15px;
  animation-delay: 0.9s;
}

/* Tisch Z3: Pulsieren gedaempft (0.2-0.6 → 0.15-0.4, Scale 0.8-1.2 → 0.9-1.1) */
@keyframes linienPulsieren {
  0%, 100% {
    opacity: 0.15;
    transform: scaleY(0.9);
  }
  50% {
    opacity: 0.4;
    transform: scaleY(1.1);
  }
}

/* Begegnungs-Atem (11.6.2026): begegnet der Leser der Pause, tut das
   Linien-Gefüge EINEN tiefen Atemzug — seine Länge ist die deklarierte
   Dauer (--pause-dauer, vom Renderer gesetzt; Höhe wächst ebenfalls mit
   der Dauer: Zeit wird Raum). Die einzelnen Linien pulsieren darunter
   ungestört in ihrem 12s-Takt weiter. */
.story-pause .pause-lines {
  transform-origin: center;
}

.story-pause.ist-begegnet .pause-lines {
  animation: pauseAtemzug var(--pause-dauer, 2000ms) var(--ease-breath, cubic-bezier(0.25, 0.46, 0.45, 0.94)) 1 both;
}

@keyframes pauseAtemzug {
  0%   { transform: scaleY(1); }
  42%  { transform: scaleY(1.55); }  /* Einatmen */
  58%  { transform: scaleY(1.55); }  /* Halten auf der Höhe */
  100% { transform: scaleY(1); }     /* Ausatmen */
}

@media (prefers-reduced-motion: reduce) {
  .story-pause.ist-begegnet .pause-lines {
    animation: none;
  }
}

/* ========================================
   LESEFORTSCHRITT
   ======================================== */

.reading-progress {
  margin-bottom: 3rem;
  opacity: 0.6;
}

.progress-bar {
  height: 1px;
  background: var(--border-subtle);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold-primary);
  transition: width 0.3s ease;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .story-section.section-text p {
    font-size: 1.15rem;
    text-align: left;
  }
  
  .thought-cloud {
    margin: 2rem -0.5rem;
    padding: 1.5rem 2rem;
  }
  
  .dialogue-box {
    padding: 1.2rem 1.5rem;
  }
}