/* =========================================================
   Darum vegan — base.css
   Design-Tokens (zwei Identitäten), Reset, Typo, Chrome.
   Kopf  = hell, kühl, intellektuell.
   Herz  = dunkel, cineastisch, warm.
   ========================================================= */

:root {
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --maxw: 1240px;
  --radius: 14px;
  --header-h: 70px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --speed: 0.8s;

  /* Default = dunkle, cineastische Bühne (Landing) */
  --bg: #0f0c0b;
  --bg-alt: #171110;
  --ink: #f3eae2;
  --muted: #a99c92;
  --line: rgba(243, 234, 226, 0.14);
  --accent: #e2553a;
  --accent-2: #eb9b3e;
  --media-tint: #1a1310;
  --grain-opacity: 0.05;
}

/* Kopf-Modus: hell, kühl, vertrauenswürdig */
body[data-mode="head"] {
  --bg: #f0efe9;
  --bg-alt: #e5ebe7;
  --ink: #14201e;
  --muted: #586762;
  --line: rgba(20, 32, 30, 0.13);
  --accent: #15776e;
  --accent-2: #5a8f4a;
  --media-tint: #dfe6e3;
  --grain-opacity: 0.028;
}

/* Herz-Modus: dunkel, warm, dringlich */
body[data-mode="heart"] {
  --bg: #100c0a;
  --bg-alt: #18110e;
  --ink: #f3eae2;
  --muted: #a99c92;
  --line: rgba(243, 234, 226, 0.14);
  --accent: #e2553a;
  --accent-2: #eb9b3e;
  --media-tint: #1c1410;
  --grain-opacity: 0.06;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* „Ein Scroll = ein Argument" wird in app.js (Section-Snap) gesteuert –
   robuster als CSS-Snap über Trackpad/Touch. Reduced-Motion => nativer Scroll. */

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 65%, transparent);
  border-radius: 999px;
  border: 3px solid var(--bg);
}

/* ---------------- Film-Grain-Overlay ---------------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity var(--speed) var(--ease);
}

/* ---------------- Header ---------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 46px);
  z-index: 100;
  color: var(--ink);
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(8, 6, 5, 0.55), rgba(8, 6, 5, 0));
  opacity: 0;
  transition: opacity var(--speed) var(--ease);
}
body[data-mode=""] .site-header { color: #f6f1ec; }
body[data-mode=""] .site-header::before { opacity: 1; }
.site-header.scrolled {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: var(--line);
  color: var(--ink);
}
.site-header.scrolled::before { opacity: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.015em;
  color: inherit;
  text-decoration: none;
  font-variation-settings: "opsz" 40, "SOFT" 30;
}
.brand-logo {
  width: 28px; height: 28px;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.header-controls { display: flex; align-items: center; gap: clamp(10px, 2vw, 20px); }

.lang-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.lang-switch button {
  background: none; border: none;
  color: inherit; opacity: 0.55;
  font: inherit; cursor: pointer;
  padding: 5px 6px; border-radius: 6px;
  transition: opacity 0.2s var(--ease);
}
.lang-switch button.active { opacity: 1; color: var(--accent); }
body[data-mode=""] .lang-switch button.active { color: #fff; }
.lang-switch button:hover { opacity: 1; }
.lang-sep { width: 1px; height: 12px; background: currentColor; opacity: 0.3; }

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px 8px 13px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s var(--ease), transform 0.18s var(--ease), border-color 0.25s var(--ease);
}
.mode-switch-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  flex: none;
}
.mode-switch:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* Kompakter Header auf kleinen Screens (Mobile-first: alles in einer Zeile) */
@media (max-width: 600px) {
  .site-header { padding: 0 13px; }
  .brand { font-size: 1rem; gap: 8px; }
  .brand-logo { width: 24px; height: 24px; }
  .header-controls { gap: 9px; }
  .mode-switch {
    gap: 7px;
    padding: 6px 12px 6px 10px;
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }
  .lang-switch { font-size: 0.7rem; }
}
/* Sehr schmale Screens: „DarumVegan" bleibt sichtbar, dafür der Modus-Umschalter extra kompakt */
@media (max-width: 380px) {
  .site-header { padding: 0 10px; }
  .brand { font-size: 0.94rem; gap: 6px; }
  .header-controls { gap: 7px; }
  .mode-switch { padding: 5px 10px 5px 9px; font-size: 0.52rem; gap: 6px; }
  .mode-switch-dot { width: 7px; height: 7px; }
}

/* ---------------- Fortschritt ---------------- */
.progress { pointer-events: none; }
.progress-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 150;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
}
.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s var(--ease);
}
.progress-count {
  position: fixed;
  left: clamp(18px, 4vw, 46px);
  bottom: 22px;
  z-index: 90;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  align-items: baseline;
  gap: 3px;
}
.progress-count #progressCurrent { color: var(--accent); font-size: 0.95rem; }
.progress-sep { opacity: 0.5; }

/* ---------------- Footer ---------------- */
.site-footer {
  position: relative;
  z-index: 2;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 30px clamp(18px, 5vw, 46px);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-note {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
}
.footer-nav { display: flex; gap: 20px; align-items: center; }
.footer-nav button, .footer-nav a {
  background: none; border: none; padding: 0;
  color: var(--muted); font-family: var(--font-sans);
  font-size: 0.84rem; cursor: pointer; text-decoration: none;
  transition: color 0.2s var(--ease);
}
.footer-nav button:hover, .footer-nav a:hover { color: var(--accent); }

/* ---------------- Rechtliches-Overlay ---------------- */
.legal-overlay {
  position: fixed; inset: 0;
  z-index: 300;
  background: color-mix(in srgb, #000 60%, transparent);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade 0.3s var(--ease);
}
.legal-modal {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-width: 600px; width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 32px 30px 26px;
  position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  animation: pop 0.4s var(--ease-out);
  text-align: left;
}
.legal-modal h2 {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 14px;
  padding-right: 28px;
  font-size: 1.55rem;
}
#legalBody {
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.62;
}
#legalBody p { margin: 0 0 12px; }
#legalBody p:last-child { margin-bottom: 0; }
#legalBody h4 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  margin: 20px 0 6px;
}
#legalBody strong { color: var(--ink); font-weight: 600; }
#legalBody a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
#legalBody a:hover { border-bottom-color: var(--accent); }
.legal-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none;
  font-size: 1.9rem; line-height: 1;
  color: var(--muted); cursor: pointer;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.legal-close:hover { color: var(--accent); transform: rotate(90deg); }

/* ---------------- Reveal / Utilities ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; filter: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

[hidden] { display: none !important; }
