/* Grundgerüst: Reset, Typografie, Kopf, Knöpfe, Fuß.
 * Alle Farben, Schriften, Radien und Schatten kommen aus token.css.
 * Wo eine Stufe sich anders verhalten soll als die Token hergeben, steht das
 * am Ende des jeweiligen Blocks unter [data-stufe="n"].
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Weich scrollen erst nach dem Laden: sonst rollt der Browser bei einer
   Sprungmarke (#stufe-4, Rückweg aus einer Demo) sichtbar durch alle Warps. */
html.weich { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.weich { scroll-behavior: auto; } }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--uebergang) ease, color var(--uebergang) ease;
}
@media (min-width: 760px) { body { font-size: 1.0625rem; } }

/* Abschnitte malen ihre eigene Stufe */
main > section, .fuss {
  position: relative;
  /* Parallaxe und Kippen dürfen nicht seitlich über den Rand ragen, sonst
     zoomt das Handy oder Tablet die ganze Seite heraus (Stufe 4 bei 768 px) */
  overflow-x: clip;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  transition: background-color var(--uebergang) ease, color var(--uebergang) ease;
}

/* Körnung (Stufe 4 und 5), je Abschnitt */
main > section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1.4 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)'/%3E%3C/svg%3E");
}

/* ---------- Typografie ---------- */
h1, h2, h3 { text-wrap: balance; }
h1, h2 {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  font-style: var(--display-style);
  letter-spacing: var(--tracking);
  hyphens: manual;
}
h3 { font-size: 1.05rem; line-height: 1.3; font-weight: 700; }
p { max-width: 65ch; }

a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; transition: color var(--uebergang) ease; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.container {
  width: 100%;
  max-width: calc(var(--breite) + var(--rand) + var(--rand-rechts));
  margin-inline: auto;
  padding-left: var(--rand);
  padding-right: var(--rand-rechts);
}
/* Am PC sitzt der Regler rechts am Rand. Bis 1460 px Breite rückt der Inhalt
   etwas zur Seite, damit nichts darunter liegt. */
@media (min-width: 1024px) and (max-width: 1460px) {
  .container { padding-right: max(var(--rand-rechts), 150px); padding-left: max(var(--rand), 40px); }
}

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.einleitung { font-size: 1.15rem; color: var(--muted); max-width: 58ch; }

/* Sprungmarke für Tastatur */
.sprung {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 6px; text-decoration: none;
}
.sprung:focus { top: 12px; }

/* ---------- Logo ---------- */
.logo { height: 100%; width: auto; overflow: visible; }
.logo__zusatz { color: var(--muted); transition: color var(--uebergang) ease; }

/* ---------- Kopf ---------- */
.kopf {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--kopf-bg);
  border-bottom: 1px solid transparent;
  transition: background-color var(--uebergang) ease, border-color var(--uebergang) ease;
}
.kopf__innen { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.kopf__marke { display: block; height: 34px; color: inherit; }
.kopf__nav { display: flex; align-items: center; gap: 22px; }
.kopf__link { color: var(--fg); text-decoration: none; font-weight: 600; font-size: .95rem; }
.kopf__link:hover { color: var(--accent); }
@media (max-width: 759px) {
  .kopf__innen { min-height: 56px; }
  .kopf__marke { height: 28px; }
  .kopf__link { display: none; }
}
.kopf:is(:is([data-stufe="3"], [data-stufe="4"], [data-stufe="5"], [data-stufe="6"]), :is([data-stufe="3"], [data-stufe="4"], [data-stufe="5"], [data-stufe="6"]) *) {
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent);
}
.kopf:is([data-stufe="1"], [data-stufe="1"] *) { border-bottom-color: #000; }
.kopf__link:is([data-stufe="1"], [data-stufe="1"] *) { color: var(--accent); text-decoration: underline; font-weight: 400; }
.kopf:is([data-stufe="2"], [data-stufe="2"] *) { border-bottom-color: var(--line); }

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 46px;
  padding: .7em 1.4em;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--uebergang) ease, color var(--uebergang) ease, box-shadow var(--uebergang) ease, transform .2s ease;
}
.knopf--klein { min-height: 38px; padding: .5em 1.05em; font-size: .92rem; }
.knopf:disabled { opacity: .6; cursor: progress; }

.knopf:is([data-stufe="1"], [data-stufe="1"] *) {
  background: #FFFFFF; color: #000; border: 1px solid #000; border-radius: 0;
  font-weight: 400; min-height: 0; padding: 4px 12px;
}
.knopf:hover:is([data-stufe="1"], [data-stufe="1"] *) { background: #EFEFEF; }
.knopf:hover:is([data-stufe="2"], [data-stufe="2"] *) { background: color-mix(in srgb, var(--accent) 88%, #000); }
.knopf:is([data-stufe="3"], [data-stufe="3"] *) { box-shadow: 0 10px 30px rgb(255 106 26 / .28); }
.knopf:hover:is([data-stufe="3"], [data-stufe="3"] *) { transform: translateY(-2px); }
.knopf:is([data-stufe="4"], [data-stufe="4"] *) { box-shadow: 4px 4px 0 var(--accent-2); }
.knopf:hover:is([data-stufe="4"], [data-stufe="4"] *) { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--accent-2); }
.knopf:active:is([data-stufe="4"], [data-stufe="4"] *) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--accent-2); }
.knopf:is([data-stufe="5"], [data-stufe="5"] *) {
  border-radius: 999px;
  background: linear-gradient(110deg, #FFB347 0%, #FFD9A0 45%, #FFB347 55%, #FF8A3D 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  transition: background-position .8s ease, transform .2s ease;
}
.knopf:hover:is([data-stufe="5"], [data-stufe="5"] *) { background-position: 0 0; }
.knopf:is([data-stufe="6"], [data-stufe="6"] *) {
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgb(255 106 26 / .5), 0 0 28px rgb(255 106 26 / .45), 0 0 60px rgb(110 168 255 / .2);
}
.knopf:hover:is([data-stufe="6"], [data-stufe="6"] *) { box-shadow: 0 0 0 1px rgb(255 179 71 / .8), 0 0 36px rgb(255 106 26 / .7), 0 0 80px rgb(110 168 255 / .35); }

/* ---------- Links je Stufe ---------- */
a:visited:is([data-stufe="1"], [data-stufe="1"] *) { color: #551A8B; }
a:not(.knopf):is([data-stufe="2"], [data-stufe="2"] *) { text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
a:not(.knopf):is([data-stufe="4"], [data-stufe="4"] *) { text-decoration-style: dashed; }
a:not(.knopf):hover:is([data-stufe="6"], [data-stufe="6"] *) { text-shadow: 0 0 12px rgb(255 106 26 / .7); }

/* ---------- Rechtsseiten (Impressum, Datenschutz) ---------- */
.recht { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 104px); }
.recht h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin-bottom: 2rem; hyphens: manual; }
.recht h2 { font-size: 1.25rem; line-height: 1.3; margin: 2.4rem 0 .7rem; }
.recht h3 { margin: 1.4rem 0 .5rem; }
.recht p, .recht address { margin-bottom: 1rem; max-width: 70ch; }
.recht address { font-style: normal; }

/* ---------- Fuß ---------- */
.fuss { border-top: 1px solid var(--line); padding-block: 48px; padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); font-size: .92rem; color: var(--muted); }
.fuss__innen { display: grid; gap: 18px; }
.fuss__marke { display: block; height: 30px; width: max-content; }
.fuss__nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.fuss__nav a { color: var(--fg); }
.fuss__stand { font-size: .85rem; }
@media (min-width: 760px) {
  .fuss__innen { grid-template-columns: auto 1fr auto; align-items: center; }
  .fuss__stand { grid-column: 1 / -1; }
}
/* Am Handy liegt unten die Regler-Leiste */
@media (max-width: 1023px) {
  html.mit-js body { padding-bottom: calc(var(--leiste-hoehe) + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Eigener Mauszeiger (Stufe 5 und 6, js/zeiger.js) ---------- */
.zeiger { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.zeiger__ring, .zeiger__punkt {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease, width .25s ease, height .25s ease, margin .25s ease, background-color .25s ease, border-color .25s ease;
}
.zeiger { --z-farbe: #FFB347; }
.zeiger[data-zeiger-stufe="6"] { --z-farbe: #6EA8FF; }
.zeiger__ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 1.5px solid var(--z-farbe); }
.zeiger__punkt { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--z-farbe); box-shadow: 0 0 12px var(--z-farbe); }
.zeiger.ist-an .zeiger__ring { opacity: .9; }
.zeiger.ist-an .zeiger__punkt { opacity: 1; }
.zeiger.ist-gross .zeiger__ring { width: 76px; height: 76px; margin: -38px 0 0 -38px; background: color-mix(in srgb, var(--z-farbe) 14%, transparent); }
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .zeiger { display: none; } }
