*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #ffffff;
  --bg-panel:     #f9fafb;
  --bg-header:    rgba(255,255,255,0.9);
  --bg-hover:     #f3f4f6;
  --text:         #111827;
  --text-body:    #374151;
  --text-muted:   #9ca3af;
  --text-faint:   #d1d5db;
  --border:       #f3f4f6;
  --border-mid:   #e5e7eb;
  --link:         #2563eb;
  --heart:        #f87171;
  --amber-bg:     #fffbeb;
  --amber-border: #fef3c7;
}

html.dark {
  --bg:           #030712;
  --bg-panel:     #111827;
  --bg-header:    rgba(3,7,18,0.9);
  --bg-hover:     #1f2937;
  --text:         #f9fafb;
  --text-body:    #d1d5db;
  --text-muted:   #6b7280;
  --text-faint:   #374151;
  --border:       #1f2937;
  --border-mid:   #374151;
  --link:         #60a5fa;
  --amber-bg:     rgba(69,26,3,0.3);
  --amber-border: rgba(120,53,15,0.5);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Header ─────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-header);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s;
}
.site-logo:hover { color: var(--link); }

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lang-switch a { color: var(--text-muted); transition: color 0.15s; }
.lang-switch a:hover { color: var(--text-body); }
.lang-switch a.active { color: var(--text); font-weight: 600; }
.lang-sep { color: var(--border-mid); user-select: none; }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  border: none;
  border-radius: 0.25rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.theme-toggle:hover { color: var(--text-body); background: var(--bg-hover); }
.theme-toggle svg { width: 1rem; height: 1rem; display: block; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
html.dark .theme-toggle .icon-sun  { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

/* ── Page wrapper ────────────────────────── */

.site-wrapper {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 2rem;
}

/* ── Main content ────────────────────────── */

.salutation {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.intro {
  color: var(--text-body);
  margin-bottom: 2.5rem;
}

/* Table of contents */
.toc {
  margin-bottom: 2.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}

.toc-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.toc a {
  font-size: 0.875rem;
  color: var(--link);
}
.toc a:hover { text-decoration: underline; }

/* Sections */
.content-section { margin-bottom: 2.5rem; }

.content-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.content-section p { color: var(--text-body); }
.content-section p + p { margin-top: 0.75rem; }

/* Lists */
.styled-list {
  list-style: none;
  border-left: 2px solid var(--border);
  padding-left: 1rem;
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-body);
}
.styled-list.compact { gap: 0.25rem; }
.styled-list .term { font-weight: 500; color: var(--text); }

/* Note box */
.note-box {
  margin-bottom: 2.5rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
}
.note-box h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.note-box p { color: var(--text-body); }

/* ── Footer ──────────────────────────────── */

.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  margin-bottom: 1rem;
}
.site-footer nav a { color: var(--text-muted); transition: color 0.15s; }
.site-footer nav a:hover { color: var(--text-body); }

.footer-copy,
.footer-credit,
.footer-freepik { text-align: center; }
.footer-credit  { margin-top: 0.25rem; }
.footer-freepik { margin-top: 0.5rem; font-size: 0.75rem; color: var(--text-faint); }
.footer-freepik a { color: var(--text-faint); }
.footer-freepik a:hover { color: var(--text-muted); }
.heart { color: var(--heart); }

/* ── Impressum / Datenschutz ─────────────── */

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.back-link:hover { color: var(--text-body); }

.legal-section { margin-bottom: 2rem; }
.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.legal-section h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.legal-section p { color: var(--text-body); }
.legal-section p + p { margin-top: 0.75rem; }
.legal-section strong { font-weight: 600; color: var(--text); }
.legal-section a { color: var(--link); }
.legal-section a:hover { text-decoration: underline; }

.legal-footer { font-size: 0.875rem; color: var(--text-muted); }
.legal-footer a { text-decoration: underline; }
.legal-footer a:hover { color: var(--text-body); }
