/* ════════════════════════════════════════════════════════════════
   Lociv.io - Civic Future Interface
   Zentrale Styles für index, impressum, datenschutz, markenstory
   v1.0 - Mai 2026
   ════════════════════════════════════════════════════════════════ */

/* ───── LOKAL GEHOSTETE SCHRIFTEN (DSGVO-konform) ─────────────── */

/* General Sans - Display-Font (Indian Type Foundry, Open Source via Fontshare) */
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'General Sans';
  src: url('../fonts/GeneralSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Inter Variable - UI-Font (rsms.me, OFL) - 1 File deckt alle Weights */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.woff2') format('woff2-variations'),
       url('../fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ───── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  /* Civic Blue */
  --civic-blue:       #6270E5;
  --civic-blue-deep:  #3049D8;
  --civic-blue-soft:  #7E8BFC;
  --civic-blue-pale:  #A4B4FF;

  /* Civic Lime */
  --civic-lime:       #D0F962;
  --civic-lime-deep:  #A8E827;

  /* Deep Background */
  --deep-bg:          #081426;
  --deep-bg-soft:     #0F1F38;

  /* Neutrals */
  --neutral-black:    #131313;
  --white:            #FFFFFF;
  --text-strong:      #0E1420;
  --text-body:        #1E2535;
  --text-muted:       #5C6578;
  --text-soft:        #8891A3;
  --surface-0:        #FFFFFF;
  --surface-1:        #F7F8FB;
  --surface-2:        #EEF1F6;
  --border-1:         #E4E8EF;
  --border-glass:     rgba(255, 255, 255, 0.12);

  /* Gradients */
  --hero-gradient:    radial-gradient(circle at 20% 30%, #6270E5 0%, #3049D8 35%, #081426 100%);
  --civic-gradient:   linear-gradient(135deg, #6270E5 0%, #7E8BFC 100%);
  --civic-gradient-h: linear-gradient(90deg, #6270E5 0%, #7E8BFC 50%, #A4B4FF 100%);
  --lime-gradient-h:  linear-gradient(90deg, #D0F962 0%, #A8E827 100%);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(8, 20, 38, 0.06);
  --shadow-sm: 0 2px 8px rgba(8, 20, 38, 0.08);
  --shadow-md: 0 6px 22px rgba(8, 20, 38, 0.12);
  --shadow-lg: 0 14px 40px rgba(8, 20, 38, 0.20);
  --shadow-xl: 0 28px 80px rgba(8, 20, 38, 0.28);

  /* Radius */
  --radius-sm:   8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-pill: 999px;

  /* Layout */
  --page-max:   1320px;
  --legal-max:   880px;
  --page-padding: 40px;

  /* Typography */
  --font-display: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Easing */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  min-height: 100vh;
  font-family: var(--font-display);
  color: var(--text-body);
  background: var(--surface-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
}

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

a { color: var(--civic-blue); text-decoration: underline; text-decoration-color: rgba(98,112,229,0.32); text-underline-offset: 3px; transition: color 0.2s, text-decoration-color 0.2s; }
a:hover { color: var(--civic-blue-deep); text-decoration-color: currentColor; }

/* Skip-Link für Tastatur-Nutzer */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--civic-lime);
  color: var(--neutral-black);
  padding: 12px 18px;
  font-family: var(--font-ui);
  font-weight: 600;
  z-index: 999;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; outline: 2px solid var(--civic-blue); }

/* Visuell ausgeblendet, aber für Screenreader und Suchmaschinen lesbar
   (z.B. keyword-tragender Zusatz in der Markenstory-H1). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--civic-lime);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ───── LOCIV-WORTMARKE IM FLIESSTEXT ─────────────────────────── */
.lociv-mark {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.lociv-mark strong { font-weight: 700; color: var(--civic-blue); }
.lociv-mark .tld { font-weight: 400; color: var(--text-muted); font-size: 0.85em; letter-spacing: 0; }
/* Dark BG: "Lociv" bleibt Civic Blue als ruhige Markensignatur,
   ".io" in Civic Lime als bewusster Akzent gegen die Deep-BG-Fläche. */
.on-dark .lociv-mark strong,
section.dark .lociv-mark strong { color: var(--civic-blue); }
.on-dark .lociv-mark .tld,
section.dark .lociv-mark .tld { color: var(--civic-lime); }

/* ───── EINHEITLICHER TOPBAR (auf allen Seiten gleich) ────────── */
/* Default-Topbar: transparent (greift auf markenstory/legal/404, wo die
   Topbar entweder direkt über dem Hero-SVG schwebt oder auf hellem
   Light-BG steht und so genug Kontrast hat). */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 20, 38, 0);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  border-bottom: 1px solid transparent;
  transition: background 0.3s var(--ease-out),
              backdrop-filter 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out);
}
/* Startseite (page-home): Topbar bekommt Default-BG, damit sie über
   dem Hero-Civic-Blue-Gradient nicht durchsichtig wirkt. */
.page-home .topbar {
  background: rgba(8, 20, 38, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
/* Beim Scrollen verdichtet sich die Topbar (auf jeder Seite): opaker,
   stärkerer Blur, Padding leicht kompakter. */
@supports (animation-timeline: scroll()) {
  .topbar {
    animation: topbar-condense linear both;
    animation-timeline: scroll(root);
    animation-range: 0 200px;
  }
  @keyframes topbar-condense {
    from {
      background: rgba(8, 20, 38, 0);
      backdrop-filter: blur(0);
      -webkit-backdrop-filter: blur(0);
      border-bottom-color: transparent;
    }
    to {
      background: rgba(8, 20, 38, 0.92);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-bottom-color: rgba(255, 255, 255, 0.10);
    }
  }
  /* Startseite überschreibt den Start-Frame: schon im Top-State
     mit BG, damit Hero nicht durchscheint. */
  .page-home .topbar {
    animation: topbar-condense-home linear both;
    animation-timeline: scroll(root);
    animation-range: 0 200px;
  }
  @keyframes topbar-condense-home {
    from {
      background: rgba(8, 20, 38, 0.65);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border-bottom-color: rgba(255, 255, 255, 0.06);
    }
    to {
      background: rgba(8, 20, 38, 0.92);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-bottom-color: rgba(255, 255, 255, 0.10);
    }
  }
  /* Sub-Pages (Markenstory, Impressum, Datenschutz, 404):
     Topbar startet AUCH opak - sonst scheint bei scroll=0 der weiße
     Body-BG durch und das weiße Logo wird unsichtbar. */
  .page-legal .topbar,
  .page-story .topbar,
  .page-projects .topbar {
    animation: topbar-condense-sub linear both;
    animation-timeline: scroll(root);
    animation-range: 0 200px;
  }
  @keyframes topbar-condense-sub {
    from {
      background: rgba(8, 20, 38, 0.92);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(14px);
      border-bottom-color: rgba(255, 255, 255, 0.10);
    }
    to {
      background: rgba(8, 20, 38, 0.96);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
      border-bottom-color: rgba(255, 255, 255, 0.12);
    }
  }
  .topbar-inner {
    animation: topbar-compact linear both;
    animation-timeline: scroll(root);
    animation-range: 0 200px;
  }
  @keyframes topbar-compact {
    from { padding-top: 14px; padding-bottom: 14px; }
    to   { padding-top: 8px;  padding-bottom: 8px;  }
  }
  /* Logo schrumpft beim Scrollen ebenfalls leicht mit. */
  .topbar-logo svg {
    animation: topbar-logo-shrink linear both;
    animation-timeline: scroll(root);
    animation-range: 0 200px;
  }
  @keyframes topbar-logo-shrink {
    from { height: 50px; }
    to   { height: 38px; }
  }
}

/* ───── SCROLL-PROGRESS-BAR ─────
   Dünne Lime-Linie oben am Viewport-Rand, füllt sich proportional
   zum Scroll-Fortschritt. CSS-only via animation-timeline: scroll(root).
   Fallback für Browser ohne Scroll-Timeline: bleibt unsichtbar. */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg,
    var(--civic-lime) 0%,
    var(--civic-blue-soft) 100%);
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(208, 249, 98, 0.45);
}
/* Bei offenem Mobile-Menü die Progress-Bar (z-index 1000) ausblenden, damit
   sie nicht über dem Menü-Overlay liegt (menu.js setzt body.menu-open). */
body.menu-open .scroll-progress { opacity: 0; }
@supports (animation-timeline: scroll()) {
  .scroll-progress {
    animation: scroll-progress-fill linear both;
    animation-timeline: scroll(root);
  }
  @keyframes scroll-progress-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  .topbar { animation: none !important; background: rgba(8, 20, 38, 0.85); backdrop-filter: blur(10px); }
  .topbar-inner { animation: none !important; }
}

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px var(--page-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topbar-logo { display: inline-flex; align-items: center; }
.topbar-logo svg { height: 50px; width: auto; transition: transform 0.3s var(--ease-out); }
.topbar-logo:hover svg { transform: scale(1.03); }

.topbar-meta {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  display: inline-flex;
  align-items: center;
  gap: 28px;
}

/* ───── HAMBURGER-MENÜ (Mobile) ────────────────────────────── */
.topbar-burger {
  display: none; /* nur auf Mobile sichtbar (siehe @media) */
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  transition: border-color 0.2s, background 0.2s;
}
.topbar-burger:hover { border-color: var(--civic-lime); }
.topbar-burger-line {
  position: absolute;
  left: 12px;
  width: 20px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, top 0.25s;
}
.topbar-burger-line:nth-child(1) { top: 14px; }
.topbar-burger-line:nth-child(2) { top: 21px; }
.topbar-burger-line:nth-child(3) { top: 28px; }
/* X-Animation wenn geöffnet */
.topbar-burger[aria-expanded="true"] .topbar-burger-line:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
  background: var(--civic-lime);
}
.topbar-burger[aria-expanded="true"] .topbar-burger-line:nth-child(2) {
  opacity: 0;
}
.topbar-burger[aria-expanded="true"] .topbar-burger-line:nth-child(3) {
  top: 21px;
  transform: rotate(-45deg);
  background: var(--civic-lime);
}

/* Full-Screen-Overlay-Menü */
.mobile-menu {
  position: fixed;
  inset: 0;
  /* z-index muss UNTER der Topbar liegen, damit der Burger-Button (zum Schließen)
     klickbar bleibt. Topbar hat z-index 10 - Menü 9, Topbar bleibt erreichbar. */
  z-index: 9;
  background: var(--deep-bg);
  background-image: linear-gradient(135deg, #0F1F38 0%, #081426 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  /* Top-Padding so groß, dass Inhalt unter der Topbar startet */
  padding: 104px var(--page-padding) 40px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.25s, transform 0.25s, visibility 0s linear 0.25s;
}
/* Body-Scroll-Lock wenn Menü offen */
body.menu-open { overflow: hidden; }
.mobile-menu--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s, transform 0.25s, visibility 0s;
}
.mobile-menu::before {
  /* Civic-Blue-Strich oben (passt zum Topbar-Strich) */
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--civic-gradient-h);
}
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  text-align: right;
}
.mobile-menu-nav a {
  display: inline-block;
  padding: 18px 20px;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--white);
  text-decoration: none;
  border-radius: 10px;
  border-right: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.mobile-menu-nav a:hover,
.mobile-menu-nav a:focus-visible {
  background: rgba(98, 112, 229, 0.16);
  border-right-color: var(--civic-lime);
  color: var(--civic-lime);
  outline: none;
}
.mobile-menu-nav a[aria-current="page"] {
  border-right-color: var(--civic-lime);
  color: var(--civic-lime);
}
.mobile-menu-nav a.is-mail {
  font-size: 1.05rem;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0;
  margin-top: 28px;
  padding: 14px 22px;
  border: 1.5px solid var(--civic-lime);
  border-radius: 999px;
  color: var(--civic-lime);
  background: transparent;
  align-self: flex-end;
  text-align: center;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.mobile-menu-nav a.is-mail:hover,
.mobile-menu-nav a.is-mail:focus-visible {
  background: var(--civic-lime);
  color: var(--neutral-black);
  border-color: var(--civic-lime);
  transform: translateY(-1px);
}
.mobile-menu-nav a.is-mail::before { content: none; }
/* Eyebrow „Kontakt" als eigene Zeile über dem Outline-Button */
.mobile-menu-kontakt-label {
  display: block;
  align-self: flex-end;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-top: 36px;
  padding: 0 22px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 26px;
  width: 100%;
  text-align: right;
}
/* Footer-Logo unten im Mobile-Menü (unter dem Outline-Button) -
   gleicher Logo-Stil wie im Site-Footer, mit deutlich mehr Abstand zum Button.
   Rechtsbündig wie der Outline-Button darüber. */
.mobile-menu-footer {
  margin: 72px auto 0;
  max-width: 480px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  padding: 0 22px;
  opacity: 0.9;
}
.mobile-menu-footer svg {
  height: 56px;
  width: auto;
  /* Trailing-Whitespace im SVG kompensieren (~51px bei height 56)
     plus 10px Einrückung zum rechten Rand (Button-Kante) */
  margin-right: -41px;
}

/* Body scroll locken wenn Menü offen */
body.menu-open { overflow: hidden; }

/* ───── TOPBAR-LINK ─────────────────────────────────────────── */
/* Touch-Target ≥ 44 px (Mobile-A11y) */
.topbar-link {
  padding: 12px 6px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s;
}
.topbar-link:hover { color: var(--civic-lime); }
/* Aktive Seite: Lime-Unterstrich via box-shadow (verändert die Höhe nicht) */
.topbar-link[aria-current="page"] {
  color: var(--civic-lime);
  box-shadow: inset 0 -2px 0 var(--civic-lime);
}

/* Mail-Link als Outline-Pill (Pendant zum Mobile-Menu-Button) */
.topbar-link--mail {
  border: 1.5px solid var(--civic-lime);
  border-radius: 999px;
  padding: 11px 18px;
  min-height: 44px;
  letter-spacing: 0.08em;
  text-transform: none;
  color: var(--civic-lime);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.topbar-link--mail:hover,
.topbar-link--mail:focus-visible {
  background: var(--civic-lime);
  color: var(--neutral-black);
  border-color: var(--civic-lime);
  transform: translateY(-1px);
  outline: none;
}

/* Auf Sub-Pages (Impressum, Datenschutz, Markenstory):
   Topbar bekommt Deep-BG-Container und Bottom-Border. */
body.page-legal .topbar,
body.page-story .topbar,
body.page-projects .topbar {
  background: var(--deep-bg);
  background-image: linear-gradient(135deg, #0F1F38 0%, #081426 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
/* Civic-Blue-Akzentstrich unter dem Topbar - auf allen Seiten gleich */
.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--civic-gradient-h);
  z-index: 11;
}

/* ───── BUTTONS ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0.95rem 1.9rem;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out),
              box-shadow 0.2s var(--ease-out),
              background-color 0.2s;
}

.btn-primary-lime {
  background: var(--civic-lime);
  color: var(--neutral-black);
  box-shadow: 0 6px 22px rgba(208,249,98,0.20);
}
.btn-primary-lime:hover {
  background: var(--civic-lime-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(208,249,98,0.30);
}

.btn-glass {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.22);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.btn-glass:hover {
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}

.btn .arrow { transition: transform 0.2s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ───── HERO (index.html) ─────────────────────────────────────── */
/* Sonderfall: Hero hat weder Punkte noch Grid - er trägt den eigenen
   Civic-Blue Hero-Gradient + animiertes hero-network SVG als visuelle
   Signatur. Die "Dark=Punkte / Hell=Grid"-Konvention gilt nur für
   Content-Sections. */
.hero {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--deep-bg);
  background-image: var(--hero-gradient);
  background-position: center;
  padding: 32px var(--page-padding) 100px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 75%, rgba(208,249,98,0.10) 0%, transparent 42%),
    radial-gradient(ellipse at 12% 30%, rgba(126,139,252,0.18) 0%, transparent 55%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -240px; right: -240px;
  width: 720px; height: 720px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: inset 0 0 200px rgba(98,112,229,0.18);
  pointer-events: none;
  animation: float 18s ease-in-out infinite alternate;
}

/* Mobile- und Desktop-Variante des Netzwerks: Toggle bei 880px (gleicher
   Breakpoint wie Hero-Grid-Stacking), sonst liegt das Landscape-SVG über
   einem Portrait-Container und Linien laufen schief ins Off. */
.hero-network--mobile { display: none; }
@media (max-width: 880px) {
  .hero-network--desktop { display: none; }
  .hero-network--mobile  { display: block; }
}

/* Connected Civic Network - SVG-basierte Logo-Hommage:
   Knoten pulsieren langsam, Verbindungslinien fließen.
   Wirkt als Hintergrund-Layer im Hero. */
.hero-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.85;
}
.hero-network .node {
  fill: var(--civic-blue-pale);
  animation: node-pulse 4s ease-in-out infinite;
  transform-origin: center;
}
.hero-network .node-lime {
  fill: var(--civic-lime);
  animation-duration: 5s;
}
.hero-network .link {
  stroke: rgba(164, 180, 255, 0.32);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  animation: link-flow 8s linear infinite;
}
.hero-network .link-lime {
  stroke: rgba(208, 249, 98, 0.55);
  stroke-width: 1.4;
}
@keyframes node-pulse {
  0%, 100% { opacity: 0.65; r: 4; }
  50%      { opacity: 1;    r: 6; }
}
@keyframes link-flow {
  to { stroke-dashoffset: -100; }
}

.hero-grid {
  position: relative;
  z-index: 3;
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 80px;
  align-items: center;
  min-height: calc(100vh - 220px);
  padding: 60px 0;
}

.hero-text { animation: fade-up 0.8s var(--ease-out) both; }
.hero-stat { animation: fade-up 0.8s var(--ease-out) 0.2s both; }

.hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--civic-lime);
  margin-bottom: 28px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--civic-lime);
  border-radius: 1px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.8vw, 4.4rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  /* Lime-Highlight-Sweep: läuft sehr langsam von rechts nach links und zurück
     (analog zur Markenstory-Wortmarke). Background-Clip: text -> Lime „leuchtet" durch. */
  background-image: linear-gradient(110deg,
    #FFFFFF 0%, #FFFFFF 40%,
    rgba(208, 249, 98, 0.90) 50%,
    #FFFFFF 60%, #FFFFFF 100%);
  background-size: 250% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: title-sweep 12s ease-in-out infinite;
}
.hero-title em {
  font-style: normal;
  /* „local" bleibt durchgehend Lime - Sweep darf das em nicht übermalen */
  -webkit-text-fill-color: var(--civic-lime);
          background: none;
  -webkit-background-clip: initial;
          background-clip: initial;
}

@keyframes title-sweep {
  0%, 100% { background-position: 100% 50%; }
  50%      { background-position: 0% 50%; }
}

.hero-claim {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 400;
  color: rgba(255,255,255,0.82);
  line-height: 1.65;
  max-width: 540px;
  margin-bottom: 40px;
}
/* Wortmarke im Hero-Claim auf Civic-Blue-Hero (CI §2.1):
   „Lociv" in Weiß, „.io" in Civic Lime - hoher Kontrast, klare Markendarstellung. */
.hero-claim .lociv-mark strong { color: var(--white); }
.hero-claim .lociv-mark .tld { color: var(--civic-lime); }

.cta-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
  padding: 9px 18px;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s, color 0.2s, transform 0.2s, background-color 0.2s;
  list-style: none;
}
.tag:hover {
  border-color: rgba(208,249,98,0.55);
  color: var(--civic-lime);
  background: rgba(208,249,98,0.08);
  transform: translateY(-2px);
}

/* ───── HERO-STAT-CARD (index.html, rechts) ───────────────────── */
.stat-card {
  position: relative;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 44px 40px;
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 32px 90px rgba(8, 20, 38, 0.34);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(208,249,98,0.18) 0%, transparent 70%);
  pointer-events: none;
  animation: float 14s ease-in-out infinite alternate;
}

.stat-card-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--civic-lime);
  margin-bottom: 14px;
  position: relative; z-index: 2;
}
.stat-card-eyebrow .nowrap { white-space: nowrap; }

.stat-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 28px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  position: relative; z-index: 2;
}

/* Pill-CTA innerhalb der Stat-Card (sekundär, kompakt, unten rechts) */
.stat-card-cta {
  position: relative;
  z-index: 2;
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
}

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.6rem 1.15rem;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border-radius: var(--radius-sm); /* kein Pill mehr (Vorgabe: Buttons ohne Pillenform) */
  text-decoration: none;
  background: rgba(208,249,98,0.10);
  color: var(--civic-lime);
  border: 1px solid rgba(208,249,98,0.40);
  transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease-out), border-color 0.2s, box-shadow 0.2s;
}
.btn-pill:hover {
  background: var(--civic-lime);
  color: var(--neutral-black);
  border-color: var(--civic-lime);
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(208,249,98,0.25);
}
.btn-pill .arrow { transition: transform 0.2s; }
.btn-pill:hover .arrow { transform: translateX(3px); }

.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 30px;
  position: relative; z-index: 2;
}

.stat-item { display: flex; flex-direction: column; gap: 6px; }
.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--civic-lime);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  /* Funktionale Datenbeschriftung - 0.85 statt 0.7 ergibt ~4,84:1 auf der
     Glas-Stat-Card (AA erfüllt; 0.7 lag bei 3,83:1 darunter). */
  color: rgba(255,255,255,0.85);
}

.stat-card-divider {
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin-bottom: 22px;
  position: relative; z-index: 2;
}

.stat-card-foot {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(255,255,255,0.75);
  position: relative; z-index: 2;
}
.stat-card-foot strong { color: var(--white); font-weight: 600; }

/* ───── LEGAL-MAIN (impressum/datenschutz) ─────────────────────── */
.legal-main {
  flex: 1;
  max-width: var(--legal-max);
  margin: 0 auto;
  width: 100%;
  padding: 64px var(--page-padding) 80px;
}

.legal-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--civic-blue);
  margin-bottom: 16px;
}

.legal-main h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.legal-lead {
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 720px;
}

.legal-main h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--civic-blue);
  margin-top: 40px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.legal-main h2:first-of-type { margin-top: 0; }

.legal-main h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-strong);
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-main p,
.legal-main ul,
.legal-main ol {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-body);
  margin-bottom: 14px;
}

.legal-main ul, .legal-main ol { padding-left: 22px; }
.legal-main li { margin-bottom: 6px; }
.legal-main strong { color: var(--text-strong); font-weight: 600; }

/* Zweispaltiges Grid für die oberen Impressum-Felder (Diensteanbieter, Register, USt etc.) */
.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 56px;
  margin: 24px 0 40px;
}
.legal-grid .legal-block { break-inside: avoid; }
.legal-grid .legal-block h2 {
  margin-top: 0;
  margin-bottom: 8px;
}
.legal-grid .legal-block p {
  margin-bottom: 0;
}
@media (max-width: 760px) {
  .legal-grid { grid-template-columns: 1fr; gap: 14px; }
}

.legal-note {
  background: var(--white);
  border: 1px solid var(--border-1);
  border-left: 4px solid var(--civic-blue);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 32px 0;
  font-family: var(--font-display);
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-body);
  box-shadow: var(--shadow-xs);
}
.legal-note strong { color: var(--civic-blue); }

.legal-stamp {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-1);
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ───── FOOTER (alle Seiten) ─────────────────────────────────── */
.site-footer {
  background: var(--deep-bg-soft);
  padding: 28px var(--page-padding);
  color: rgba(255,255,255,0.65);
  font-family: var(--font-ui);
  font-size: 13px;
  position: relative;
}
/* Lime-Akzentstrich oberhalb des Footer - Pendant zum Civic-Blue-Strich unter dem Topbar */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #D0F962 0%, #A8E827 50%, #D0F962 100%);
}

.site-footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 28px;
  align-items: center;
}

.site-footer-brand {
  display: inline-flex;
  /* center statt flex-end: Logo (32px) und Social-Icon (44px-Touchfeld) auf
     gemeinsamer Mittellinie - flex-end hob das Icon-Glyph ~7px über die Wortmarke */
  align-items: center;
  gap: 16px;
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.85);
}
.site-footer-logo {
  height: 32px;
  width: auto;
  flex-shrink: 0;
  opacity: 0.95;
  /* Trailing-Whitespace im SVG-viewBox teilweise kompensieren - mit etwas Atemraum */
  margin-right: -16px;
}
.site-footer-brand-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  /* Meta-Text nach oben schieben, damit die Schrift-Unterkante auf gleicher Höhe
     wie die Wortmarken-Baseline (im SVG bei y=148/230 = 64% von oben) sitzt */
  margin-bottom: 8px;
}
.site-footer-brand strong { font-weight: 700; color: var(--civic-blue-pale); }
.site-footer-brand .tld { font-weight: 400; color: rgba(255,255,255,0.55); font-size: 0.85em; }
.site-footer-brand .meta {
  color: rgba(255,255,255,0.45);
  font-family: var(--font-ui);
  font-size: 12px;
}
/* Trenner-Bullet vor Meta-Info kommt aus CSS (nur Desktop), damit
   auf Mobile - wo der Span als eigene Zeile bricht - kein freier Bullet vorne steht. */
.site-footer-brand .meta::before {
  content: "\00B7\00A0";
  color: rgba(255,255,255,0.35);
}

/* Credit-Links nicht mitten im Wort umbrechen */
.site-footer-credits a { white-space: nowrap; }

.site-footer-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 24px;
}
.site-footer-links a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.2s;
  /* Touch-Target ≥ 44 px (Mobile-A11y) */
  display: inline-flex;
  align-items: center;
  padding: 12px 0;
  min-height: 44px;
}
.site-footer-links a:hover { color: var(--civic-lime); }
/* E-Mail-Link (obfuscatedMail ohne explizite Class) im Footer immer in Lime -
   Desktop UND Mobile, damit er sich klar von den Nav-Links abhebt. */
.site-footer-links a[data-u][data-d] {
  color: var(--civic-lime);
  font-weight: 600;
}
.site-footer-links a[data-u][data-d]:hover { color: var(--white); }
/* Social-Icon (LinkedIn) - dezent rechts neben dem Footer-Logo, vertikal
   mittig zum Logo (align-self überschreibt das flex-end des Brand-Containers).
   margin-left gleicht die -16px-Whitespace-Kompensation des Logos aus. */
.site-footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 16px;
  border-radius: 8px;
  background: var(--civic-blue);
  color: #fff;
  transition: background 0.2s, transform 0.2s;
}
.site-footer-social svg { display: block; width: 16px; height: 16px; }
.site-footer-social:hover { background: var(--civic-blue-soft); transform: translateY(-1px); }
/* Kontakt-Wrapper (E-Mail + Social-Icon) ist auf Desktop transparent:
   display:contents löst den Span auf, die E-Mail bleibt reguläres Flex-Item
   in der Link-Zeile. Erst auf Mobile wird er zur eigenen Flex-Zeile (E-Mail links,
   Icon rechts). Das Nav-Icon erscheint nur dort - auf Desktop steht es neben dem Logo. */
.site-footer-contact { display: contents; }
/* Spezifität .site-footer-links a (0,0,1,1) würde sonst dem Nav-Icon
   display:inline-flex aufzwingen - daher hier mit gleicher Tiefe überschreiben. */
.site-footer-links a.site-footer-social--nav { display: none; }

.site-footer-credits {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.04em;
  /* 0.55 statt 0.4 ergibt ~5,82:1 auf deep-bg-soft #0F1F38 (AA erfüllt; 0.4
     lag bei 3,74:1 darunter). Die Links (a) nutzen bereits 0.55. */
  color: rgba(255,255,255,0.55);
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.site-footer-credits a {
  color: rgba(255,255,255,0.55);
  text-decoration: none;
}
.site-footer-credits a:hover { color: var(--civic-lime); }
.site-footer-credits .credit-right { margin-left: auto; }

/* ───── ANIMATIONEN ──────────────────────────────────────────── */
@keyframes float {
  0%   { transform: translate(0, 0); }
  100% { transform: translate(20px, -16px); }
}

@keyframes fade-up {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes orbit-breathe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.04); opacity: 0.9; }
}

/* Reduced Motion: Animationen aus */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ───── RESPONSIVE BREAKPOINTS ────────────────────────────────── */

/* Tablet & kleiner Desktop (<= 1024px) */
@media (max-width: 1024px) {
  :root { --page-padding: 32px; }
  .hero-grid { gap: 56px; }
  .stat-card { padding: 38px 32px; }
}

/* Tablet (<= 960px) - Hero stacked */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    min-height: auto;
    padding: 24px 0 12px;
  }
  .hero-eyebrow { margin-bottom: 22px; }
  .hero-title { font-size: clamp(2.7rem, 8vw, 3.8rem); }
  .hero-claim { max-width: none; }
  .stat-card { padding: 36px 28px; }
  .stat-value { font-size: 1.8rem; }
}

/* Mobil-Landscape / großes Handy (<= 768px) */
@media (max-width: 768px) {
  :root { --page-padding: 24px; }
  .topbar-inner { padding: 14px var(--page-padding); gap: 10px; }
  .topbar-logo svg { height: 56px; }
  .topbar-meta { font-size: 11px; gap: 12px; }
  /* Hero: Inner-Padding einzig auf .hero-grid, weil die SVG-Network-Layer
     in .hero per position:absolute liegen und kein Padding brauchen.
     32px spürbares Inner-Padding gegen Viewport-Rand. */
  .hero { padding: 16px 0 64px !important; }
  .hero-grid { padding: 24px 32px 12px !important; box-sizing: border-box; }
  .legal-main { padding: 48px var(--page-padding) 64px; }
  .stat-card-grid { gap: 18px; }
  .site-footer { padding: 24px var(--page-padding); }
}

/* Tablet + Mobile (<= 880px): Inline-Nav zu Burger umschalten,
   passend zum Hero-Grid-Stacking-Breakpoint in page-home.css */
@media (max-width: 880px) {
  .topbar-meta { display: none; }
  .topbar-burger { display: block; }
}

/* Mobil-Portrait (<= 640px) */
@media (max-width: 640px) {
  .topbar-inner { gap: 8px; }
  .hero-title { font-size: clamp(2.7rem, 10.5vw, 3.5rem); line-height: 1.04; }
  .cta-row { gap: 10px; }
  .btn { padding: 0.85rem 1.5rem; font-size: 0.95rem; width: 100%; justify-content: center; }
  .stat-card { padding: 28px 22px; border-radius: var(--radius-md); }
  .stat-card-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .stat-value { font-size: 1.5rem; }
  .stat-label { font-size: 10px; letter-spacing: 0.12em; }
  /* Eyebrow auf Mobile kompakter, damit „Erstes Produkt · Live-Prototyp" sauber bricht */
  .stat-card-eyebrow { letter-spacing: 0.2em; font-size: 0.72rem; }

  .site-footer { padding: 20px var(--page-padding) 18px; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 14px; }
  /* Logo mobil in Desktop-Größe + zentriert (flex-start hob das Social-Icon an) */
  .site-footer-brand { flex-wrap: wrap; align-items: center; gap: 8px; }
  .site-footer-logo { height: 40px; margin-right: 0; }  /* mobil auf Kachelhöhe (40px) */
  .site-footer-social { margin-left: 0; }
  /* Brand-Icon (neben Logo) auf Mobile aus, dafür das Nav-Icon in der E-Mail-Zeile an.
     Nav-Icon mit .site-footer-links a-Tiefe, damit es die Desktop-Hide-Regel schlägt. */
  .site-footer-social--brand { display: none; }
  .site-footer-links a.site-footer-social--nav { display: inline-flex; }
  .site-footer-brand .meta { margin-left: 0; margin-top: 2px; flex-basis: 100%; font-size: 13px; }
  .site-footer-brand .meta::before { display: none; }
  /* Nav-Links auf Mobile in 2 Spalten (Startseite/Markenstory links,
     Impressum/Datenschutz rechts), E-Mail spannt unten über volle Breite. */
  .site-footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 0;
    font-size: 14px;
  }
  .site-footer-links a {
    padding: 10px 0;
    min-height: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  /* Letzte Nav-Zeile (Impressum/Datenschutz) ohne Bottom-Border -
     der E-Mail-Link bringt darunter selbst einen Top-Border mit. */
  .site-footer-links a:nth-child(3),
  .site-footer-links a:nth-child(4) {
    border-bottom: none;
  }
  /* E-Mail + LinkedIn-Icon teilen sich die letzte Zeile (E-Mail links, Icon rechts),
     mit klarem Trenner nach oben über die volle Breite. */
  .site-footer-contact {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .site-footer-links a[data-u][data-d] {
    padding: 10px 0;
    border-bottom: none;
  }
  /* Credits: jeder Eintrag eigene Zeile, Trenner-Bullets weg, kompakter Block */
  .site-footer-credits {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    line-height: 1.5;
    padding-top: 10px;
  }
  .site-footer-credits .credit-right { margin-left: 0; }
  .site-footer-credits .sep { display: none; }

  .legal-main h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); }
  .legal-lead { font-size: 1rem; margin-bottom: 36px; }
  .legal-main h2 { font-size: 1.15rem; margin-top: 32px; }
}

/* Sehr kleines Handy (<= 380px) */
@media (max-width: 380px) {
  .stat-card-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card-grid .stat-item:last-child { grid-column: span 2; }
  .topbar-logo svg { height: 48px; }
}

/* ════════════════════════════════════════════════════════════════════
   SECTION-PATTERNS - Globale Konvention für alle Seiten
   ════════════════════════════════════════════════════════════════════
   Einheitliche vertikale Rhythmik (Desktop 100px / Mobile 64px) +
   Hintergrund-Patterns für Dark/Light/Soft + Sparkles + Cursor-Glow.
   Greift auf .stack-section, .values-section, .cta-section in index.html
   sowie section.dark / section.alt / section.soft in markenstory.html.
   ──────────────────────────────────────────────────────────────────── */

/* Globale Section-Vertikale (Desktop) */
.stack-section,
.values-section,
.cta-section {
  padding-top: 100px;
  padding-bottom: 100px;
  padding-left: var(--page-padding);
  padding-right: var(--page-padding);
  scroll-margin-top: 24px;
  position: relative;
  overflow: hidden;
}

/* Wenn das erste Element ein .eyebrow oder h2 ist, KEIN zusätzlicher
   margin-top - sonst addiert sich der Section-Padding-Top mit dem
   Element-Margin und der visuelle Abstand wird zu groß. */
.stack-section > :first-child,
.stack-section .stack-inner > :first-child,
.stack-section .stack-head > :first-child,
.values-section > :first-child,
.values-section .container > :first-child,
.cta-section > :first-child,
.cta-section .container > :first-child {
  margin-top: 0;
}
/* Analog für letztes Element: kein margin-bottom, das den Padding
   nach unten erweitert. */
.stack-section > :last-child,
.stack-section .stack-inner > :last-child,
.values-section > :last-child,
.values-section .container > :last-child,
.cta-section > :last-child,
.cta-section .container > :last-child {
  margin-bottom: 0;
}

/* ─── Dark-Section-Pattern: Punktraster + Doppel-Glow + Sparkles ───
   Greift auf .stack-section (index.html) und kann auf weitere Dark-
   Sections gelegt werden, die nicht über markenstory.css laufen. */
.stack-section {
  background-color: var(--deep-bg);
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1.2px, transparent 1.5px);
  background-size: 28px 28px;
  background-position: 0 0;
  color: rgba(255, 255, 255, 0.92);
}
.stack-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 700px 480px at 8% 12%, rgba(98, 112, 229, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 560px 420px at 92% 88%, rgba(208, 249, 98, 0.10) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.stack-section .stack-inner,
.stack-section > .container,
.stack-section > * {
  position: relative;
  z-index: 2;
}
.stack-section > .section-sparkles,
.stack-section > .section-cursor-glow { z-index: 1; }

/* ─── Light-Section-Pattern: Civic-Blue-Grid + Doppel-Glow ───
   Greift auf .values-section (index.html) und section.alt / section.soft
   (markenstory.html via markenstory.css - hier zusätzlich global). */
.values-section,
.cta-section.is-light {
  background-color: var(--surface-1);
  background-image:
    linear-gradient(to right, rgba(98, 112, 229, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(98, 112, 229, 0.05) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px;
  background-position: 0 0, 0 0;
  color: var(--text-body);
}
.values-section::before,
.cta-section.is-light::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 8% 12%, rgba(98, 112, 229, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 380px at 92% 88%, rgba(208, 249, 98, 0.07) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.values-section .container,
.values-section > *,
.cta-section .container,
.cta-section > * {
  position: relative;
  z-index: 1;
}

/* ─── CTA-Section: optionale Dark-Variante (Default ist Light) ─── */
.cta-section.is-dark {
  background-color: var(--deep-bg);
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1.2px, transparent 1.5px);
  background-size: 28px 28px;
  color: var(--white);
}
.cta-section.is-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 500px at 50% 50%, rgba(98, 112, 229, 0.22) 0%, transparent 65%),
    radial-gradient(circle at 85% 80%, rgba(208, 249, 98, 0.10) 0%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* ─── Sparkles: kleine pulsierende Knotenlichter ───
   Markup: <svg class="section-sparkles" ...><circle class="sparkle" .../>...</svg>
   Wird absolut in eine Section gelegt. Auf hellem BG mit .section-sparkles--light
   einfärben (Civic-Blue statt Pale-Blau). */
.section-sparkles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}
.section-sparkles .sparkle {
  fill: rgba(164, 180, 255, 0.55);
  animation: section-sparkle-glow 5.5s ease-in-out infinite;
}
.section-sparkles .sparkle-lime { fill: rgba(208, 249, 98, 0.75); }
.section-sparkles--light .sparkle {
  fill: rgba(98, 112, 229, 0.42);
}
.section-sparkles--light .sparkle-lime {
  fill: rgba(168, 232, 39, 0.58);
}
@keyframes section-sparkle-glow {
  0%, 100% { opacity: 0.15; r: 1.6; }
  50%      { opacity: 1;    r: 2.4; }
}

/* ─── Cursor-Glow: folgt der Maus innerhalb einer Section ───
   Aktiviert durch JS, das --cursor-x/y setzt. */
.stack-section,
.values-section,
.cta-section {
  --cursor-x: 50%;
  --cursor-y: 50%;
}
.stack-section::after,
.cta-section.is-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--cursor-x) var(--cursor-y),
    rgba(98, 112, 229, 0.10) 0%, transparent 60%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 1;
}
.stack-section:hover::after,
.cta-section.is-dark:hover::after { opacity: 1; }

/* Mobile: kompakteres vertikales Padding (zwischen Sections weniger Luft,
   damit der Wechsel von Light->Dark->Light nicht so dramatisch wird).
   Top kleiner als Bottom - so wirkt der Sektionswechsel ruhiger. */
@media (max-width: 760px) {
  .stack-section, .values-section, .cta-section {
    padding-top: 40px;
    padding-bottom: 56px;
  }
}
@media (max-width: 480px) {
  .stack-section, .values-section, .cta-section {
    padding-top: 32px;
    padding-bottom: 44px;
  }
}

/* ─── Scroll-Dynamik: Parallax + Stagger-Reveal ───
   Glow-Spots, Punktraster und Hintergrund-Glyphen wandern beim
   Scrollen leicht in unterschiedlichen Geschwindigkeiten - macht
   die Seite beim Durchscrollen lebendiger ohne abzulenken. */
@supports (animation-timeline: view()) {

  /* Glow-Layer: faded leicht beim Scrollen und shifted vertikal */
  .stack-section::before,
  .values-section::before,
  .cta-section::before {
    animation: section-glow-drift linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
  @keyframes section-glow-drift {
    0%   { transform: translateY(40px) scale(1.05); opacity: 0.55; }
    50%  { transform: translateY(0)    scale(1);    opacity: 1; }
    100% { transform: translateY(-40px) scale(1.08); opacity: 0.6; }
  }

  /* Punktraster faded leicht ein/aus, je nach Scroll-Position */
  .stack-section,
  .cta-section.is-dark {
    animation: section-grid-pulse linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
  @keyframes section-grid-pulse {
    0%, 100% { background-position: 0 -14px, 0 -14px; }
    50%      { background-position: 0 0,     0 0;     }
  }

  /* Sparkles erscheinen gestaffelt beim Scroll-Eintritt -
     macht das Aufleuchten als bewusst inszeniert wirken,
     nicht "immer schon da". */
  .section-sparkles .sparkle {
    animation:
      section-sparkle-glow 5.5s ease-in-out infinite,
      sparkle-reveal linear both;
    animation-timeline: auto, view();
    animation-range: auto, entry 0% cover 30%;
  }
  @keyframes sparkle-reveal {
    from { opacity: 0; transform: scale(0); }
    to   { opacity: 1; transform: scale(1); }
  }

  /* Hintergrund-Glyphen (01/02/03 / LO/CIV/.IO) bewegen sich entgegen
     dem Scroll - klassischer Parallax-Effekt, sehr subtil. */
  .mission .big-num,
  .origin-card .brand-glyph,
  .stack-card .big-num {
    animation: glyph-parallax linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }
  @keyframes glyph-parallax {
    from { transform: translateY(-18px); }
    to   { transform: translateY(18px); }
  }

  /* Hero-Stat-Card: drift leicht hoch beim Scroll */
  .hero-stat {
    animation: hero-stat-drift linear both;
    animation-timeline: view();
    animation-range: cover 0% cover 100%;
  }
  @keyframes hero-stat-drift {
    from { transform: translateY(0); }
    to   { transform: translateY(-30px); }
  }

  /* Section-Headings (eyebrow + h2 + lead) reveal gestaffelt -
     für Sections OHNE Inline-Override (z.B. .stack-section, .values-section,
     .cta-section ohne markenstory.css-Regeln). */
  .stack-section .eyebrow,
  .values-section .eyebrow,
  .cta-section .eyebrow {
    animation: heading-rise linear both;
    animation-timeline: view();
    animation-range: entry -5% cover 18%;
  }
  .stack-section h2,
  .values-section h2,
  .cta-section h2 {
    animation: heading-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }
  .stack-section .lead,
  .values-section .lead,
  .cta-section .lead {
    animation: heading-rise linear both;
    animation-timeline: view();
    animation-range: entry 4% cover 25%;
  }
  @keyframes heading-rise {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Cards in Stack/Values gestaffelt - alle gleicher End-Zeitpunkt,
     nur Start versetzt (verhindert dass letzte Card halb-transparent
     im Screenshot landet). */
  .stack-grid .stack-card,
  .values-grid .origin-card {
    animation: card-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 26%;
  }
  .stack-grid .stack-card:nth-child(2),
  .values-grid .origin-card:nth-child(2) {
    animation-range: entry 4% cover 26%;
  }
  .stack-grid .stack-card:nth-child(3),
  .values-grid .origin-card:nth-child(3) {
    animation-range: entry 8% cover 26%;
  }
  .stack-grid .stack-card:nth-child(4) {
    animation-range: entry 12% cover 26%;
  }
  @keyframes card-rise {
    from { opacity: 0; transform: translateY(40px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
  }
}

/* ════════════════════════════════════════════════════════════════════
   KONVENTION: Hintergrund-Pattern an Helligkeit gebunden
   ════════════════════════════════════════════════════════════════════
   Jede Section bekommt entweder .is-bg-dark oder .is-bg-light. Das
   bestimmt automatisch:
     - Pattern: Dunkel = Punktraster (28px) / Hell = Linien-Grid (96px)
     - Sparkles: nur auf .is-bg-dark sichtbar
   So muss nie wieder pro Section entschieden werden, ob Sparkles drin
   sind oder ob Pattern und Helligkeit zusammenpassen.  */

.is-bg-dark {
  background-image: radial-gradient(circle, rgba(255,255,255,0.055) 1.2px, transparent 1.5px) !important;
  background-size: 28px 28px !important;
  background-position: 0 0 !important;
}
.is-bg-light {
  background-image:
    linear-gradient(to right, rgba(98,112,229,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(98,112,229,0.05) 1px, transparent 1px) !important;
  background-size: 96px 96px, 96px 96px !important;
  background-position: 0 0, 0 0 !important;
}
/* Sparkles sind ausschließlich auf Dark-Sections sichtbar. Wenn das JS
   trotzdem versehentlich auf einer Light-Section ein SVG injiziert,
   wird es hier hart ausgeblendet. */
.is-bg-light .section-sparkles { display: none !important; }

/* Reduced-Motion: alle Scroll-Animationen ausschalten */
@media (prefers-reduced-motion: reduce) {
  .section-sparkles .sparkle { animation: none !important; opacity: 0.4; }
  .stack-section::after,
  .cta-section.is-dark::after { display: none; }
  .stack-section::before,
  .values-section::before,
  .cta-section::before,
  .mission .big-num,
  .origin-card .brand-glyph,
  .stack-card .big-num,
  .hero-stat,
  .stack-section .eyebrow,
  .stack-section h2,
  .stack-section .lead,
  .values-section .eyebrow,
  .values-section h2,
  .values-section .lead,
  .cta-section .eyebrow,
  .cta-section h2,
  .cta-section .lead,
  .stack-grid .stack-card,
  .values-grid .origin-card {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE GLASS-FALLBACK
   iOS Safari rendert backdrop-filter beim Scrollen oft fehlerhaft:
   teilweise sichtbare Cards wirken abgedunkelt/matschig. Auf Mobile
   deaktivieren wir backdrop-filter für Content-Cards und ersetzen
   den Glaseffekt durch leicht erhöhte Background-Opacity. Topbar &
   Menü-Overlay bleiben unangetastet (fixed Layer, kein Problem).
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .stack-card,
  .compare-card.us,
  .stat-card,
  .cta-path,
  .values-section .origin-card,
  .hero-pill,
  .btn-glass,
  .tag {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .stack-card,
  .compare-card.us,
  .stat-card,
  .cta-path {
    background: rgba(255, 255, 255, 0.10) !important;
  }
  .btn-glass {
    background: rgba(255, 255, 255, 0.12) !important;
  }
  .tag {
    background: rgba(255, 255, 255, 0.10) !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   MOBILE: SCROLL-DRIVEN ANIMATIONS AUS
   Auf Mobile sind Content-Cards oft 60-90% Viewport-Höhe, dadurch
   bleibt eine Card länger im "animation-range" und steht halb-
   transparent im sichtbaren Bereich. Auf Desktop ist der Effekt
   designgewollt, auf Mobile stört er. Lösung: alle view()-Animations
   auf Cards/Headings auf Mobile neutralisieren - Inhalt sofort opak.
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  @supports (animation-timeline: view()) {
    .stack-grid .stack-card,
    .values-grid .origin-card,
    .stack-card,
    .origin-card,
    .origin-card--local,
    .origin-card--civic,
    .origin-card--tech,
    .compare-card,
    .compare-card.them,
    .compare-card.us,
    .mission,
    .problem,
    .stack-product,
    .stack-platform,
    .stack-takeaway,
    .pullquote,
    .origin-result,
    .closing-quote,
    .origin-plus,
    .hero-stat,
    section,
    section .eyebrow,
    section h2,
    section .lead {
      animation: none !important;
      opacity: 1 !important;
      transform: none !important;
    }
    /* Sparkles + Glow-Layer dürfen laufen (rein dekorativ, Störung gering) */
  }
}
