/* ─── Inter – lokal gehostet (DSGVO-konform, kein Google-Request) ─────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Design Tokens: Light Mode ─────────────────────────────────────────── */
:root {
  /* Brand */
  --color-primary:        #2B7C77;
  --color-primary-hover:  #226560;
  --color-primary-active: #1C5652;
  --color-primary-light:  #E6F4F3;
  --color-primary-dim:    rgba(43, 124, 119, 0.12);

  /* Backgrounds */
  --color-bg:             #EEF1F5;
  --color-surface:        #FFFFFF;
  --color-surface-2:      #F4F6F9;
  --color-surface-dark:   #18302E;

  /* Text */
  --color-text-primary:   #0F1923;
  --color-text-secondary: #4B5768;
  --color-text-muted:     #8A94A6;
  --color-text-on-dark:   #F1F4F8;
  --color-text-on-primary:#FFFFFF;

  /* Borders */
  --color-border:         #DDE3EC;
  --color-border-strong:  #BCC6D4;

  /* Accent */
  --color-amber:          #E8943A;
  --color-amber-bg:       rgba(232, 148, 58, 0.14);
  --color-success:        #2B7C77;
  --color-success-bg:     #E6F4F3;
  --color-error:          #C94040;
  --color-error-bg:       #FEF2F2;

  /* Typography */
  --font-family:      'Inter', system-ui, -apple-system, sans-serif;
  --text-xs:          0.75rem;
  --text-sm:          0.875rem;
  --text-base:        1rem;
  --text-lg:          1.125rem;
  --text-xl:          1.25rem;
  --text-2xl:         1.5rem;
  --text-3xl:         1.875rem;
  --text-4xl:         2.25rem;
  --text-5xl:         3rem;
  --text-6xl:         3.75rem;

  --weight-regular:   400;
  --weight-medium:    500;
  --weight-semibold:  600;
  --weight-bold:      700;

  --leading-tight:    1.2;
  --leading-snug:     1.4;
  --leading-normal:   1.625;
  --leading-relaxed:  1.75;

  --tracking-tight:   -0.02em;
  --tracking-normal:  0em;
  --tracking-wide:    0.06em;
  --tracking-wider:   0.1em;

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-2xl:  28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.08);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   220ms ease;
  --transition-slow:   350ms ease;
  --transition-theme:  200ms ease;

  /* Nav */
  --nav-height: 64px;
}

/* ─── Design Tokens: Dark Mode ───────────────────────────────────────────── */
[data-theme="dark"] {
  --color-bg:             #14161B;
  --color-surface:        #1E2128;
  --color-surface-2:      #252A33;
  --color-surface-dark:   #0C1614;

  --color-text-primary:   #F0F3F8;
  --color-text-secondary: #9AA3B2;
  --color-text-muted:     #5E6878;
  --color-text-on-dark:   #F0F3F8;

  --color-border:         #2C3240;
  --color-border-strong:  #3A4255;

  --color-primary-light:  rgba(43, 124, 119, 0.18);
  --color-primary-dim:    rgba(43, 124, 119, 0.10);
  --color-amber-bg:       rgba(232, 148, 58, 0.18);
  --color-success-bg:     rgba(43, 124, 119, 0.14);
  --color-error-bg:       rgba(201, 64, 64, 0.14);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.30), 0 2px 6px rgba(0, 0, 0, 0.20);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:
    background-color var(--transition-theme),
    color var(--transition-theme);
}

/* ─── Base Elements ──────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

p {
  color: var(--color-text-secondary);
  line-height: var(--leading-relaxed);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary);
}

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

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: var(--font-family);
  font-size: var(--text-base);
}

ul, ol {
  list-style: none;
}

/* ─── Accessibility ──────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background-color: var(--color-primary-light);
  color: var(--color-primary-active);
}

/* ─── Page Load Animations ───────────────────────────────────────────────── */
@keyframes page-fade-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-fade-in-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: page-fade-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.animate-fade-in-down {
  animation: page-fade-in-down 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-delay-1 { animation-delay: 0.10s; }
.anim-delay-2 { animation-delay: 0.22s; }
.anim-delay-3 { animation-delay: 0.36s; }
.anim-delay-4 { animation-delay: 0.50s; }
.anim-delay-5 { animation-delay: 0.65s; }

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-fade-in-down {
    animation: none;
  }
}

/* ─── Scroll Reveal ──────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(36px) scale(0.97);
  transition:
    opacity 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  will-change: auto;
}

/* ─── Lesefortschritts-Balken ────────────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--color-primary);
  z-index: 200;
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  transition: width 80ms linear;
  pointer-events: none;
}

.reveal--d1 { transition-delay: 0.10s; }
.reveal--d2 { transition-delay: 0.20s; }
.reveal--d3 { transition-delay: 0.32s; }
.reveal--d4 { transition-delay: 0.44s; }

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
  .progress-bar {
    transition: none;
  }
}

/* ─── Accessibility ──────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
