/* Reset, Grundtypografie, geteilte Bausteine (Buttons, Grain, Footer) */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Papier-Textur: gibt dem warmen Off-White Atmosphäre statt Flachheit */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 320 320' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: 'SOFT' 30, 'WONK' 1;
}

p {
  margin: 0;
  max-width: var(--measure);
}

a {
  /* --accent schafft auf hellem Grund nur 3.43:1. --accent-hover: 4.97:1. */
  color: var(--accent-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--duration-fast) var(--ease-out-quart);
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

/* ---------- Layout ---------- */

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}

.container--narrow {
  width: min(100% - 2.5rem, var(--container-narrow));
}

.section {
  padding-block: var(--space-section);
}

/* ---------- Eyebrow ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hover);
  margin-bottom: var(--space-md);
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
}

/* ---------- Buttons ---------- */

.btn {
  /* --accent traegt weisse Schrift nur mit 3.91:1 und faellt durch WCAG AA.
     --accent-hover kommt auf 5.67:1 und steht bereits im Design-System. */
  --btn-bg: var(--accent-hover);
  --btn-fg: #FBFAF6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 1rem 2rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
  transition:
    transform var(--duration-normal) var(--ease-out-expo),
    box-shadow var(--duration-normal) var(--ease-out-expo),
    background-color var(--duration-fast) var(--ease-out-quart);
}

.btn:hover {
  --btn-bg: color-mix(in srgb, var(--accent-hover) 84%, #000);
  color: var(--btn-fg);
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -8px rgba(27, 138, 153, 0.5);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px -6px rgba(27, 138, 153, 0.5);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--border-hover);
  box-shadow: none;
}

.btn--ghost:hover {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  box-shadow: var(--shadow-md);
}

.btn--lg {
  padding: 1.25rem 2.75rem;
  font-size: var(--text-lg);
}

.btn__note {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-block: var(--space-md);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-normal) var(--ease-out-quart);
}

.site-header[data-scrolled='true'] {
  border-bottom-color: var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.logo b {
  color: var(--accent);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-nav a:not(.btn) {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:not(.btn):hover {
  color: var(--accent);
}

.site-nav .btn {
  padding: 0.6rem 1.4rem;
  font-size: var(--text-sm);
}

@media (max-width: 720px) {
  .site-nav__links {
    display: none;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 2;
  padding-block: var(--space-xl) var(--space-lg);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.site-footer__tagline {
  margin-top: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  max-width: 34ch;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--accent);
}

/* Partnerprogramm: eigener Block, bewusst nicht in der Rechtliches-Navigation,
   weil es inhaltlich ein Angebot ist und kein Pflichtlink. */
.site-footer__partner {
  max-width: 34ch;
}

.site-footer__heading {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.site-footer__partner-link {
  display: inline-block;
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-hover);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color 150ms ease;
}

.site-footer__partner-link:hover {
  color: var(--accent);
}

.site-footer__bottom {
  padding-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ---------- Utilities ----------
   Bewusst wenige. Ersetzen inline style-Attribute, damit die CSP ohne
   'unsafe-inline' auskommt. */

.text-sm { font-size: var(--text-sm); }
.text-xl { font-size: var(--text-xl); }
/* Nur an Kleintext-Stellen im Einsatz, daher secondary statt muted (2.57:1). */
.text-muted { color: var(--text-secondary); }
.text-left { text-align: left; }
.mt-xl { margin-top: var(--space-xl); }
.eyebrow--center { justify-content: center; }

/* ---------- Motion-Präferenz ---------- */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
