/* =========================================================
   Bastian Treuheit — Design System
   1. Tokens          5. Hero
   2. Base            6. Sections & components
   3. Utilities       7. Flip cards
   4. Header / Nav    8. Footer, forms, motion
   ========================================================= */

/* ---------------------------------------------------------
   1. TOKENS
   --------------------------------------------------------- */
:root {
  /* Brand */
  --brand-950: #06203F;
  --brand-900: #0A3468;
  --brand-700: #0E55A8;
  --brand-500: #1270D6;
  --brand-400: #3B92E8;
  --brand-200: #B9D9F7;
  --brand-100: #E4F0FC;
  --brand-050: #F2F8FE;

  --accent-600: #C63A25;
  --accent-500: #E4523A;
  --accent-100: #FDEAE5;

  --sand: #F6F2EA;

  /* Neutrals */
  --ink: #0B1524;
  --text: #27374C;
  --muted: #64758D;
  --line: #E2E8F1;
  --line-soft: #EEF2F7;
  --surface: #FFFFFF;
  --surface-2: #F5F8FC;
  --surface-3: #ECF2F9;

  /* Semantic */
  --bg: var(--surface);
  --card: var(--surface);
  --card-2: var(--surface-2);
  --shadow-sm: 0 1px 2px rgba(11, 21, 36, .05), 0 2px 8px rgba(11, 21, 36, .04);
  --shadow-md: 0 4px 12px rgba(11, 21, 36, .06), 0 12px 32px rgba(11, 21, 36, .07);
  --shadow-lg: 0 8px 20px rgba(11, 21, 36, .08), 0 28px 60px rgba(11, 21, 36, .12);
  --shadow-brand: 0 14px 34px rgba(18, 112, 214, .26);

  /* Type */
  --font-display: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Metrics */
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  /* Beschriftung der Sprungleiste (Positionen) – im dunklen Design heller */
  --chip-fg: var(--muted);
  --chip-fg-active: var(--brand-700);

  --ease: cubic-bezier(.22, .72, .28, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --header-h: 76px;
  color-scheme: light;
}

/* Dark scheme — system preference, unless the visitor forced light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EEF4FB;
    --text: #C3D0E1;
    --muted: #8B9BB3;
    --line: #223349;
    --line-soft: #1B2A3D;
    --surface: #0A1421;
    --surface-2: #101E30;
    --surface-3: #16283D;
    --brand-100: #14314F;
    --brand-050: #0E2438;
    --brand-200: #2C5F94;
    --accent-100: #3A1D17;
    --sand: #14202E;
    --chip-fg: #C6D4E6;
    --chip-fg-active: #8CC0F7;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .35);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, .45), 0 30px 70px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* Dark scheme — explicitly chosen */
:root[data-theme="dark"] {
  --ink: #EEF4FB;
  --text: #C3D0E1;
  --muted: #8B9BB3;
  --line: #223349;
  --line-soft: #1B2A3D;
  --surface: #0A1421;
  --surface-2: #101E30;
  --surface-3: #16283D;
  --brand-100: #14314F;
  --brand-050: #0E2438;
  --brand-200: #2C5F94;
  --accent-100: #3A1D17;
  --sand: #14202E;
  --chip-fg: #C6D4E6;
  --chip-fg-active: #8CC0F7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 24px rgba(0, 0, 0, .45), 0 30px 70px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------------------------------------------------------
   2. BASE
   --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0125rem;
  line-height: 1.68;
  font-feature-settings: 'ss01', 'cv05';
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -.022em;
  margin: 0 0 .5em;
  font-weight: 700;
}

h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
h4 { font-size: 1.08rem; }

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-500); text-decoration: none; }
a:hover { color: var(--brand-700); }

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

ul, ol { margin: 0 0 1.2em; padding-left: 1.2em; }
li { margin-bottom: .45em; }

hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }

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

:focus-visible {
  outline: 3px solid var(--brand-400);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem; top: -100px;
  z-index: 200;
  background: var(--brand-700);
  color: #fff;
  padding: .7rem 1.2rem;
  border-radius: 0 0 12px 12px;
  font-weight: 600;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------------------------------------------------------
   3. UTILITIES
   --------------------------------------------------------- */
.wrap {
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - (var(--gutter) * 2), var(--wrap-narrow)); }

.section { padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; }
.section--tight { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.section--alt { background: var(--surface-2); }
.section--sand { background: var(--sand); }
.section--ink { background: var(--brand-950); }
.section--ink h2, .section--ink h3 { color: #fff; }
.section--ink p, .section--ink li { color: rgba(226, 238, 252, .82); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-500);
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 26px; height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.section--ink .eyebrow { color: var(--brand-400); }

.lead {
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.6;
  color: var(--muted);
}
.section--ink .lead { color: rgba(226, 238, 252, .8); }

.section-head { max-width: 680px; margin-bottom: clamp(2.2rem, 5vw, 3.4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }

.grid { display: grid; gap: clamp(1.1rem, 2.4vw, 1.8rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.text-center { text-align: center; }
.mt-l { margin-top: clamp(2rem, 4vw, 3rem); }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Buttons ------------------------------------------------- */
.btn {
  --btn-bg: var(--brand-500);
  --btn-fg: #fff;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .92rem 1.6rem;
  border: 0;
  border-radius: 100px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: .97rem;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .3s var(--ease);
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  z-index: -1;
  background: var(--brand-900);
  transform: translateY(101%);
  transition: transform .45s var(--ease-out);
}
.btn:hover, .btn:focus-visible {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-brand);
}
.btn:hover::after, .btn:focus-visible::after { transform: translateY(0); }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn--accent { --btn-bg: var(--accent-500); }
.btn--accent::after { background: var(--accent-600); }
.btn--accent:hover { box-shadow: 0 14px 34px rgba(228, 82, 58, .3); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.btn--ghost::after { background: var(--ink); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px transparent, var(--shadow-md); color: var(--surface); }

.btn--light {
  --btn-bg: #fff;
  --btn-fg: var(--brand-950);
}
.btn--light::after { background: var(--brand-400); }
.btn--light:hover { color: var(--brand-950); }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

/* Text link with sliding underline */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand-500);
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  /* gap zu animieren wäre wieder Layout – stattdessen wandert der Pfeil. */
  transition: background-size .35s var(--ease-out);
  padding-bottom: 2px;
}
.link-arrow svg { transition: transform .3s var(--ease-out); }
.link-arrow:hover { background-size: 100% 1.5px; }
.link-arrow:hover svg { transform: translateX(5px); }

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .85rem;
  border-radius: 100px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.pill--accent { background: var(--accent-100); color: var(--accent-600); }
.pill--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }

/* ---------------------------------------------------------
   4. HEADER / NAV
   --------------------------------------------------------- */
.progress-bar {
  position: fixed;
  inset: 0 auto auto 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400), var(--accent-500));
  z-index: 120;
  will-change: transform;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 110;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), height .4s var(--ease);
}
.site-header::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--surface);
  opacity: 0;
  border-bottom: 1px solid var(--line-soft);
  transition: opacity .4s var(--ease);
}
.site-header.is-scrolled { height: 64px; box-shadow: var(--shadow-sm); }
.site-header.is-scrolled::before { opacity: 1; }

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(100% - (var(--gutter) * 2), var(--wrap));
  margin-inline: auto;
}

/* Wordmark */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .68rem;
  color: var(--ink);
  font-family: var(--font-display);
  line-height: 1.05;
}
.brand:hover { color: var(--ink); }
.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  flex: none;
  border-radius: 13px;
  background: linear-gradient(140deg, var(--brand-500), var(--brand-900));
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .02em;
  box-shadow: 0 6px 16px rgba(14, 85, 168, .3);
  transition: transform .5s var(--ease-out), box-shadow .4s var(--ease);
}
.brand:hover .brand__mark {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 10px 24px rgba(14, 85, 168, .4);
}
.brand__name { font-size: 1.04rem; font-weight: 700; letter-spacing: -.02em; display: block; }
.brand__role {
  display: block;
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* Desktop nav */
.nav { display: flex; align-items: center; gap: .15rem; }
.nav a {
  position: relative;
  padding: .55rem .82rem;
  border-radius: 100px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: .94rem;
  font-weight: 500;
  transition: color .3s var(--ease);
}
.nav a::before {
  content: '';
  position: absolute;
  /* Links/rechts bündig mit dem horizontalen Innenabstand des Links.
     Skaliert wird per transform – width zu animieren wäre Layout. */
  left: .82rem;
  right: .82rem;
  bottom: 6px;
  height: 2px;
  background: var(--brand-500);
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .35s var(--ease-out);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::before { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--brand-500); font-weight: 600; }
.nav a[aria-current="page"]::before { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: .55rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease), color .3s var(--ease);
}
.icon-btn:hover { background: var(--brand-100); color: var(--brand-700); transform: translateY(-2px); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

.header-cta { display: inline-flex; }

/* Burger */
.burger {
  display: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.burger span {
  position: absolute;
  left: 13px;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .4s var(--ease-out), opacity .25s var(--ease);
}
.burger span:nth-child(1) { top: 17px; }
.burger span:nth-child(2) { top: 23px; }
.burger span:nth-child(3) { top: 29px; width: 12px; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(.3); }
.burger[aria-expanded="true"] span:nth-child(3) { width: 18px; transform: translateY(-6px) rotate(-45deg); }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 105;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--header-h) + 2rem) var(--gutter) 3rem;
  background: var(--surface);
  clip-path: circle(0% at calc(100% - 44px) 38px);
  transition: clip-path .7s var(--ease-out);
  pointer-events: none;
}
.mobile-nav.is-open { clip-path: circle(150% at calc(100% - 44px) 38px); pointer-events: auto; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav li {
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  opacity: 0;
  transform: translateY(18px);
}
.mobile-nav.is-open li {
  opacity: 1;
  transform: none;
  transition: opacity .5s var(--ease) var(--d), transform .5s var(--ease-out) var(--d);
}
.mobile-nav a {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  padding: .95rem 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.02em;
}
.mobile-nav a small {
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 500;
  color: var(--brand-400);
  letter-spacing: .08em;
}
.mobile-nav a[aria-current="page"] { color: var(--brand-500); }
.mobile-nav__foot { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: .8rem; }

@media (max-width: 1040px) {
  .nav, .header-cta { display: none; }
  .burger { display: block; }
}

/* ---------------------------------------------------------
   5. HERO
   --------------------------------------------------------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(2.5rem, 7vw, 5.5rem)) 0 clamp(3rem, 7vw, 5.5rem);
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 130%;
  z-index: -2;
  background:
    radial-gradient(48% 42% at 78% 18%, rgba(59, 146, 232, .28), transparent 65%),
    radial-gradient(42% 46% at 12% 8%, rgba(18, 112, 214, .16), transparent 62%),
    radial-gradient(38% 40% at 62% 92%, rgba(228, 82, 58, .12), transparent 60%);
  animation: drift 24s ease-in-out infinite alternate;
  /* Eigene Compositor-Ebene: die Dauer-Animation soll beim Scrollen
     nicht das darunterliegende Layout neu zeichnen lassen. */
  will-change: transform;
}
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(75% 60% at 50% 30%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(75% 60% at 50% 30%, #000 20%, transparent 78%);
  opacity: .8;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2.5%, 2%, 0) scale(1.06); }
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .5rem .45rem .95rem;
  border-radius: 100px;
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-soft);
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.6rem;
}
.hero__badge b {
  padding: .22rem .6rem;
  border-radius: 100px;
  background: var(--brand-500);
  color: #fff;
  font-size: .72rem;
  letter-spacing: .04em;
}
.hero__badge .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22C07C;
  box-shadow: 0 0 0 0 rgba(34, 192, 124, .55);
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(34, 192, 124, .5); }
  70%  { box-shadow: 0 0 0 9px rgba(34, 192, 124, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 192, 124, 0); }
}

.hero h1 { margin-bottom: .35em; }
/* overflow:hidden maskiert die Einblend-Animation. Das Padding schafft Platz
   für Unterlängen (g, ß) und Umlautpunkte, das Margin gleicht es wieder aus. */
.hero h1 .line {
  display: block;
  overflow: hidden;
  padding-block: .12em .1em;
  margin-block: -.12em -.1em;
}
.hero h1 .line > span {
  display: block;
  transform: translateY(105%);
  animation: rise .95s var(--ease-out) forwards;
  animation-delay: var(--d, 0ms);
}
@keyframes rise { to { transform: translateY(0); } }

.hero h1 .accent {
  background: linear-gradient(105deg, var(--brand-500) 10%, var(--brand-400) 55%, var(--accent-500) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__claim {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  line-height: 1.55;
  color: var(--muted);
  max-width: 34ch;
  margin-bottom: 2rem;
}
.hero__claim strong { color: var(--ink); font-weight: 600; }

/* Portrait */
.portrait {
  position: relative;
  justify-self: center;
  width: min(100%, 440px);
  will-change: transform;
}
.portrait__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: clamp(28px, 6vw, 56px);
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand-100), var(--surface-3));
  box-shadow: var(--shadow-lg);
}
.portrait__frame img { width: 100%; height: 100%; object-fit: cover; }
.portrait__frame::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6, 32, 63, .35), transparent 45%);
}
.portrait__ring {
  position: absolute;
  inset: -16px;
  border-radius: clamp(36px, 7vw, 68px);
  border: 1.5px dashed var(--brand-200);
  z-index: -1;
  animation: spin 46s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.portrait__tag {
  position: absolute;
  left: -10px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1.05rem;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: float 6s ease-in-out infinite;
}
.portrait__tag--top {
  left: auto; right: -14px; bottom: auto; top: 30px;
  animation-delay: -3s;
}
.portrait__tag b {
  display: block;
  font-family: var(--font-display);
  font-size: .95rem;
  color: var(--ink);
  line-height: 1.2;
}
.portrait__tag span { font-size: .74rem; color: var(--muted); }
.portrait__tag i {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--brand-100);
  color: var(--brand-700);
  flex: none;
}
.portrait__tag i svg { width: 17px; height: 17px; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-11px); }
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; }
  .portrait { order: -1; width: min(100%, 320px); }
  .portrait__tag { display: none; }
}

/* ---------------------------------------------------------
   6. SECTIONS & COMPONENTS
   --------------------------------------------------------- */

/* Ticker ------------------------------------------------- */
.ticker {
  overflow: hidden;
  padding: 1rem 0;
  border-block: 1px solid var(--line-soft);
  background: var(--surface);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker__track {
  display: flex;
  width: max-content;
  gap: 2.6rem;
  animation: ticker 38s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker span {
  display: inline-flex;
  align-items: center;
  gap: 2.6rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.ticker span::after {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-400);
}
@keyframes ticker { to { transform: translateX(-50%); } }

/* Split (text + media) ------------------------------------ */
.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.split__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 5 / 4;
  background: var(--surface-3);
}
.split__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease-out); }
.split__media:hover img { transform: scale(1.05); }
.split--reverse .split__media { order: 2; }
@media (max-width: 760px) { .split--reverse .split__media { order: 0; } }

/* Fact list ---------------------------------------------- */
.facts { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: .1rem; }
.facts li {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 1rem;
  padding: .85rem 0;
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  transition: transform .35s var(--ease-out), background .35s var(--ease);
}
.facts li:hover { transform: translateX(6px); background: var(--surface-2); }
.facts dt, .facts b {
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-500);
  padding-top: .18rem;
}
@media (max-width: 560px) { .facts li { grid-template-columns: 1fr; gap: .1rem; } }

/* Timeline / roles --------------------------------------- */
.roles { display: grid; gap: 0; counter-reset: role; }
.role {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2rem) clamp(0rem, 2vw, 1.4rem);
  border-top: 1px solid var(--line);
  /* Nur Farbe animieren. Ein animiertes padding-left würde bei jedem
     Frame das Layout der ganzen Liste neu berechnen – das ruckelt beim
     Wechsel zwischen zwei Zeilen. Der Einzug läuft über transform. */
  transition: background .4s var(--ease);
}
.role:last-child { border-bottom: 1px solid var(--line); }
.role::before {
  counter-increment: role;
  content: counter(role, decimal-leading-zero);
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-200);
  transition: color .4s var(--ease), transform .4s var(--ease-out);
}
/* Titel und Text gehören beide in die mittlere Spalte, das Label nach rechts.
   Ohne explizite Platzierung rutscht das Label in eine eigene Zeile. */
.role h3 { grid-column: 2; grid-row: 1; }
.role p  { grid-column: 2; grid-row: 2; }
.role h3, .role p { transition: transform .4s var(--ease-out); }
.role:hover { background: var(--surface-2); }
.role:hover::before { color: var(--brand-500); transform: translateX(10px) scale(1.12); }
.role:hover h3, .role:hover p { transform: translateX(10px); }
.role h3 { margin-bottom: .3rem; }
.role p { color: var(--muted); font-size: .96rem; margin: 0; max-width: 60ch; }
.role__meta {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  justify-self: end;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  padding: .35rem .85rem;
  border-radius: 100px;
  /* Outline statt Fläche: die Plakette liegt mal auf weißem, mal auf
     grauem Grund – eine gefüllte Variante verschwindet auf einem davon. */
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.role:hover .role__meta {
  background: var(--brand-500);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--brand-500);
}
@media (max-width: 720px) {
  .role { grid-template-columns: 46px 1fr; }
  .role::before { grid-row: 1 / span 3; align-self: start; }
  .role__meta { grid-column: 2; grid-row: 3; justify-self: start; margin-top: .7rem; }
}

/* Generic card ------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(1.4rem, 3vw, 2rem);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  overflow: hidden;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease);
}
.card::before {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .5s var(--ease-out);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.card:hover::before { transform: scaleX(1); }
.card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--brand-100);
  color: var(--brand-700);
  margin-bottom: 1.1rem;
  transition: transform .45s var(--ease-out), background .35s var(--ease);
}
.card:hover .card__icon { transform: rotate(-7deg) scale(1.07); }
.card__icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: .45rem; }
.card p { color: var(--muted); font-size: .95rem; }

/* Municipality tiles -------------------------------------- */
.places { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.place {
  position: relative;
  min-height: 210px;
  padding: 1.4rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  transition: transform .5s var(--ease-out), box-shadow .45s var(--ease), background .45s var(--ease);
}
.place__aura {
  position: absolute;
  inset: auto -30% -55% -30%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 112, 214, .22), transparent 68%);
  transform: translateY(35%) scale(.7);
  opacity: 0;
  transition: transform .7s var(--ease-out), opacity .5s var(--ease);
}
.place:hover { transform: translateY(-7px); box-shadow: var(--shadow-md); }
.place:hover .place__aura { transform: translateY(0) scale(1); opacity: 1; }
.place__no {
  position: absolute;
  top: 1.1rem; right: 1.3rem;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--line);
  line-height: 1;
  transition: color .45s var(--ease);
}
.place:hover .place__no { color: var(--brand-200); }
.place h3 { margin-bottom: .25rem; position: relative; }
.place p { font-size: .88rem; color: var(--muted); margin: 0; position: relative; }

/* News --------------------------------------------------- */
.post {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease);
}
.post:hover { transform: translateY(-7px); box-shadow: var(--shadow-md); }
.post__img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-3); }
.post__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.post:hover .post__img img { transform: scale(1.07); }
.post__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.post__meta {
  display: flex; align-items: center; gap: .6rem;
  font-size: .78rem; color: var(--muted);
  margin-bottom: .7rem;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.post__meta .pill { text-transform: none; letter-spacing: 0; }
.post h3 { font-size: 1.16rem; margin-bottom: .5rem; }
.post h3 a { color: inherit; }
.post:hover h3 a { color: var(--brand-500); }
.post p { font-size: .93rem; color: var(--muted); margin-bottom: 1.1rem; }
.post .link-arrow { margin-top: auto; align-self: flex-start; }

/* CTA band ------------------------------------------------ */
.cta {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(2.4rem, 6vw, 4.4rem);
  background: linear-gradient(135deg, var(--brand-900), var(--brand-950) 55%, #0C2E58);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.cta::before {
  content: '';
  position: absolute;
  inset: -50% -20% auto auto;
  width: 60%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 146, 232, .4), transparent 62%);
  z-index: -1;
  animation: float 9s ease-in-out infinite;
}
.cta::after {
  content: '';
  position: absolute;
  inset: auto auto -45% -12%;
  width: 46%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(228, 82, 58, .3), transparent 64%);
  z-index: -1;
  animation: float 11s ease-in-out infinite reverse;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(226, 238, 252, .85); max-width: 52ch; }
.cta__grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(1.8rem, 4vw, 3.4rem);
  align-items: center;
}
@media (max-width: 800px) { .cta__grid { grid-template-columns: 1fr; } }

/* Quote --------------------------------------------------- */
.quote {
  position: relative;
  max-width: 800px;
  margin-inline: auto;
  text-align: center;
  padding-top: 2.4rem;
}
.quote::before {
  content: '”';
  position: absolute;
  top: -.35em; left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 7rem;
  line-height: 1;
  color: var(--brand-200);
}
.quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -.02em;
  color: var(--ink);
}
.quote figcaption { margin-top: 1.2rem; color: var(--muted); font-size: .92rem; }

/* Page hero (subpages) ------------------------------------ */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + clamp(2.8rem, 6vw, 4.6rem)) 0 clamp(2.4rem, 5vw, 3.6rem);
  background: var(--surface-2);
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: -40% -10% auto 40%;
  height: 160%;
  background: radial-gradient(45% 40% at 60% 30%, rgba(59, 146, 232, .22), transparent 66%);
  animation: drift 20s ease-in-out infinite alternate;
  will-change: transform;
}
.page-hero__inner { position: relative; max-width: 780px; }
.page-hero h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .82rem; color: var(--muted); margin-bottom: 1.1rem;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand-500); }
.crumbs span { opacity: .5; }

/* Prose --------------------------------------------------- */
.prose h2 { margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; }
.prose > *:first-child { margin-top: 0; }
.prose ul { padding-left: 1.1em; }
.prose li::marker { color: var(--brand-400); }

/* Accordion ----------------------------------------------- */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.35rem .4rem;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  font-weight: 600;
  color: var(--ink);
  transition: color .3s var(--ease);
}
.acc__btn > span { transition: transform .35s var(--ease-out); }
.acc__btn:hover { color: var(--brand-500); }
.acc__btn:hover > span { transform: translateX(9px); }
.acc__btn i {
  flex: none;
  position: relative;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  transition: background .3s var(--ease), transform .45s var(--ease-out);
}
.acc__btn i::before, .acc__btn i::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 12px; height: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition: transform .4s var(--ease-out), opacity .3s var(--ease);
}
.acc__btn i::after { transform: translate(-50%, -50%) rotate(90deg); }
.acc__btn[aria-expanded="true"] i { background: var(--brand-500); color: #fff; transform: rotate(180deg); }
.acc__btn[aria-expanded="true"] i::after { opacity: 0; }
.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .5s var(--ease-out);
}
.acc__panel > div { overflow: hidden; }
.acc__item.is-open .acc__panel { grid-template-rows: 1fr; }
.acc__panel p, .acc__panel ul { padding-right: 2.6rem; color: var(--muted); }
.acc__panel > div > *:last-child { margin-bottom: 1.6rem; }

/* ---------------------------------------------------------
   7. FLIP CARDS
   --------------------------------------------------------- */
/* 300px Mindestbreite ergibt auf der Startseite drei Spalten – sechs Karten
   teilen sich damit sauber in 3 + 3 statt in ein schiefes 4 + 2. */
.flips { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }

.flip {
  perspective: 1500px;
  min-height: 268px;
  border-radius: var(--radius);
}
.flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transform-style: preserve-3d;
  transition: transform .82s var(--ease-out);
}
.flip:hover .flip__inner,
.flip:focus-within .flip__inner,
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }

.flip__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border-radius: var(--radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

.flip__front {
  justify-content: space-between;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-soft), var(--shadow-sm);
}
.flip__no {
  position: absolute;
  top: 1.2rem; right: 1.35rem;
  font-family: var(--font-display);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--brand-200);
}
.flip__icon {
  display: grid;
  place-items: center;
  width: 50px; height: 50px;
  border-radius: 15px;
  background: var(--brand-100);
  color: var(--brand-700);
}
.flip__icon svg { width: 24px; height: 24px; }
.flip__front h3 { font-size: 1.24rem; margin: 0; }
.flip__hint {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-top: .6rem;
  font-size: .78rem;
  color: var(--muted);
  opacity: .85;
}
.flip__hint svg { width: 14px; height: 14px; }

.flip__back {
  transform: rotateY(180deg);
  justify-content: space-between;
  background: linear-gradient(150deg, var(--brand-700), var(--brand-950));
  color: #fff;
  box-shadow: var(--shadow-md);
}
.flip__back h3 { color: #fff; font-size: 1.06rem; margin-bottom: .5rem; }
.flip__back p { font-size: .9rem; line-height: 1.55; color: rgba(226, 238, 252, .88); }
.flip__back .link-arrow { color: #fff; align-self: flex-start; margin-top: .9rem; }
.flip__back::after {
  content: '';
  position: absolute;
  inset: auto -25% -40% auto;
  width: 66%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 66%);
}

@media (max-width: 480px) { .flip { min-height: 250px; } }

/* ---------------------------------------------------------
   8. FORMS, FOOTER, MOTION
   --------------------------------------------------------- */
.form { display: grid; gap: 1.05rem; }
.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.05rem; }
.field { display: grid; gap: .4rem; }
.field > label {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
}
.field .req { color: var(--accent-500); }
.field input, .field textarea, .field select {
  width: 100%;
  padding: .85rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .97rem;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
}
.field textarea { resize: vertical; min-height: 158px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 0;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-100);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: .7; }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .7rem;
  align-items: start;
  font-size: .88rem;
  color: var(--muted);
}
.check input {
  width: 19px;
  height: 19px;
  margin-top: .18rem;
  flex: none;
  accent-color: var(--brand-500);
  /* Eigener Radius, damit der Schein beim Hover der Kästchenform folgt */
  border-radius: 5px;
  cursor: pointer;
  transition: box-shadow .25s var(--ease);
}
.check input:hover,
.check input:focus-visible {
  box-shadow: 0 0 0 4px var(--brand-100), 0 2px 9px rgba(18, 112, 214, .32);
}
.check input:focus-visible { outline-offset: 4px; }

.form-note {
  padding: 1rem 1.2rem;
  border-radius: 13px;
  background: var(--brand-050);
  box-shadow: inset 0 0 0 1px var(--brand-100);
  font-size: .88rem;
  color: var(--muted);
}

/* Contact tiles */
.contact-tile {
  display: flex;
  gap: 1rem;
  padding: 1.3rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease);
}
.contact-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.contact-tile i {
  display: grid; place-items: center;
  flex: none;
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--brand-100);
  color: var(--brand-700);
}
.contact-tile i svg { width: 19px; height: 19px; }
.contact-tile h3 { font-size: 1rem; margin-bottom: .2rem; }
.contact-tile p, .contact-tile address {
  font-size: .92rem; color: var(--muted); font-style: normal; margin: 0; line-height: 1.55;
}

/* Footer -------------------------------------------------- */
.site-footer {
  background: var(--brand-950);
  color: rgba(226, 238, 252, .75);
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.8rem;
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset: -60% auto auto -10%;
  width: 55%; aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 146, 232, .18), transparent 65%);
}
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: clamp(1.6rem, 4vw, 3rem);
}
.site-footer h4 {
  color: #fff;
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.site-footer a { color: rgba(226, 238, 252, .75); }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; }
.site-footer .brand__role { color: rgba(226, 238, 252, .6); }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.footer-list a {
  display: inline-block;
  transition: transform .3s var(--ease-out);
  font-size: .94rem;
}
.footer-list a:hover { transform: translateX(5px); }
.site-footer address { font-style: normal; font-size: .94rem; line-height: 1.7; }

.socials { display: flex; gap: .55rem; margin-top: 1.2rem; }
.socials a {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  transition: background .35s var(--ease), transform .35s var(--ease-out);
}
.socials a:hover { background: var(--brand-500); transform: translateY(-4px); }
.socials svg { width: 18px; height: 18px; }

.footer-bottom {
  position: relative;
  margin-top: clamp(2.2rem, 5vw, 3.2rem);
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.4rem;
  align-items: center;
  justify-content: space-between;
  font-size: .85rem;
}
.footer-bottom nav { display: flex; flex-wrap: wrap; gap: 1.2rem; }

@media (max-width: 880px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Back to top --------------------------------------------- */
.to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 100;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  opacity: 0;
  transform: translateY(16px) scale(.85);
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease-out), background .3s var(--ease);
}
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--brand-900); transform: translateY(-3px); }
.to-top svg { width: 19px; height: 19px; }

/* ---------------------------------------------------------
   9. THEMENSEITE (Positionen)
   --------------------------------------------------------- */
.topic-nav {
  position: sticky;
  top: 64px;
  z-index: 60;
  /* Bewusst deckend statt Milchglas: ein backdrop-filter auf einem
     sticky Element muss bei jedem Scroll-Frame neu komponiert werden
     und lässt das Scrollen auf schwächerer Hardware ruckeln. */
  background: var(--surface);
  border-block: 1px solid var(--line-soft);
}
.topic-nav__inner { position: relative; }

.topic-nav__track {
  display: flex;
  gap: .45rem;
  padding: .75rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-behavior: smooth;
  /* Damit der erste/letzte Chip nicht dauerhaft unter einem Pfeil klebt */
  scroll-padding-inline: 46px;
}
.topic-nav__track::-webkit-scrollbar { display: none; }

/* Blätterpfeile: liegen über der Leiste und mattieren die Chips darunter,
   statt sie hart abzuschneiden. Sie erscheinen nur, wenn es in die
   jeweilige Richtung tatsächlich etwas zu scrollen gibt (per JS). */
.topic-nav__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  -webkit-backdrop-filter: blur(7px) saturate(150%);
  backdrop-filter: blur(7px) saturate(150%);
  box-shadow: inset 0 0 0 1px var(--line), 0 3px 12px rgba(11, 21, 36, .16);
  color: var(--ink);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background .3s var(--ease), color .3s var(--ease), box-shadow .3s var(--ease);
}
.topic-nav__arrow svg { width: 18px; height: 18px; }
.topic-nav__arrow--prev { left: -6px; }
.topic-nav__arrow--next { right: -6px; }
.topic-nav__arrow:hover {
  background: var(--brand-500);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--brand-500), var(--shadow-brand);
}
.topic-nav__arrow[hidden] { display: none; }

/* Ohne backdrop-filter (ältere Browser): deckender Hintergrund,
   damit die Chips nicht durch den Pfeil hindurchscheinen. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .topic-nav__arrow { background: var(--surface); }
}
.topic-nav a {
  flex: none;
  padding: .45rem .95rem;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--chip-fg);
  font-family: var(--font-display);
  font-size: .87rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease-out);
}
.topic-nav a:hover { background: var(--brand-500); color: #fff; transform: translateY(-2px); }
.topic-nav a.is-current { background: var(--brand-100); color: var(--chip-fg-active); font-weight: 600; }

.topic {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(1.4rem, 4vw, 3.2rem);
  padding: clamp(2rem, 4.5vw, 3.2rem) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 145px;
}
.topic:first-of-type { border-top: 0; padding-top: 0; }
/* Der Kopf füllt die Zeilenhöhe und zentriert seinen Inhalt darin:
   Symbol und Überschrift stehen dadurch mittig neben dem Fließtext. */
.topic__head { display: flex; align-items: center; gap: 1rem; }
.topic__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 54px; height: 54px;
  border-radius: 16px;
  background: var(--brand-100);
  color: var(--brand-700);
  transition: transform .5s var(--ease-out), background .4s var(--ease), color .4s var(--ease);
}
.topic__icon svg { width: 26px; height: 26px; }
.topic:hover .topic__icon { transform: rotate(-8deg) scale(1.06); background: var(--brand-500); color: #fff; }
.topic__head h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); margin: 0; }
.topic__body .lead { margin-bottom: 1.2rem; }
@media (max-width: 860px) { .topic { grid-template-columns: 1fr; } }

/* Häkchen-Liste */
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: .62rem; }
.ticks li {
  position: relative;
  margin: 0;
  padding-left: 2rem;
  transition: transform .3s var(--ease-out);
}
.ticks li::before {
  content: '';
  position: absolute;
  left: 0; top: .32em;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--brand-100);
}
.ticks li::after {
  content: '';
  position: absolute;
  left: 5.5px; top: .6em;
  width: 8px; height: 4px;
  border-left: 2px solid var(--brand-700);
  border-bottom: 2px solid var(--brand-700);
  transform: rotate(-45deg);
}
.ticks li:hover { transform: translateX(4px); }

/* Filter (Aktuelles) -------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: clamp(1.6rem, 4vw, 2.4rem);
}
.filter {
  padding: .55rem 1.1rem;
  border: 0;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease-out);
}
.filter:hover { transform: translateY(-2px); color: var(--ink); }
.filter.is-active { background: var(--brand-500); color: #fff; box-shadow: var(--shadow-brand); }
.post.is-hidden { display: none; }
.filter-empty { text-align: center; color: var(--muted); padding: 2.5rem 0; }

/* Reveal on scroll ---------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s var(--ease), transform .8s var(--ease-out);
  transition-delay: var(--d, 0ms);
}
[data-reveal="left"]  { transform: translateX(-30px); }
[data-reveal="right"] { transform: translateX(30px); }
[data-reveal="zoom"]  { transform: scale(.94); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* Motion preferences -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .hero h1 .line > span { transform: none; }
  .flip:hover .flip__inner { transform: none; }
  .flip.is-flipped .flip__inner, .flip:focus-within .flip__inner { transform: rotateY(180deg); }
}

/* Print --------------------------------------------------- */
@media print {
  .site-header, .mobile-nav, .to-top, .progress-bar, .ticker, .site-footer::before { display: none !important; }
  body { color: #000; }
  .flip__inner { transform: none !important; }
  .flip__back { display: none; }
}
