/* BOSSMA Design-System: Grundlagen und Effekte v1.0
 * Alles hängt an .bx-scope. Kundenfarben und Schriften nur in den Tokens ändern.
 * Effekte laufen mit CSS-Scroll-Animationen (Chrome, Edge, Safari 26+); ältere Browser
 * bekommen dieselben Effekte über bx-effekte.js. Bei "Bewegung reduzieren" ist alles statisch.
 */

/* ---------------------------------------------------------------- Tokens */
.bx-scope {
  --bx-text: #15252E;
  --bx-text-2: #4A5B64;
  --bx-akzent: #0E8F8A;
  --bx-akzent-tief: #0A6E6A;
  --bx-akzent-2: #E0982E;
  --bx-grund: #F7F9F8;
  --bx-flaeche: #FFFFFF;
  --bx-linie: #E1EAE9;
  --bx-font-titel: 'Bricolage Grotesque', system-ui, sans-serif;
  --bx-font-text: 'Hanken Grotesk', system-ui, sans-serif;
  --bx-font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --bx-radius: 22px;
  --bx-radius-klein: 12px;
  --bx-schatten: 0 1px 2px rgba(21, 37, 46, .05), 0 18px 40px -18px rgba(21, 37, 46, .22);
  --bx-ease: cubic-bezier(.2, .8, .2, 1);
  --bx-feder: cubic-bezier(.34, 1.56, .64, 1);
  --bx-breite: 1200px;
  --bx-rand: clamp(20px, 5vw, 64px);

  color: var(--bx-text);
  font-family: var(--bx-font-text);
  font-size: clamp(1rem, .95rem + .2vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  z-index: 1; /* über der Partikel-Szene */
}
.bx-scope *, .bx-scope *::before, .bx-scope *::after { box-sizing: border-box; }
.bx-scope :where(h1, h2, h3, h4, p, ul, ol, figure) { margin: 0; }
.bx-scope :where(h1, h2, h3) { font-family: var(--bx-font-titel); color: var(--bx-text); text-wrap: balance; hyphens: none; }
.bx-scope :where(p, li) { text-wrap: pretty; hyphens: auto; overflow-wrap: break-word; }
.bx-scope img { max-width: 100%; height: auto; display: block; }
.bx-scope :where(a:not(.wp-element-button):not(.bx-knopf)) { color: var(--bx-akzent-tief); text-underline-offset: .2em; }
.bx-scope :focus-visible { outline: 3px solid var(--bx-akzent); outline-offset: 3px; border-radius: 6px; }
.bx-nb { white-space: nowrap; }

/* ---------------------------------------------------------------- Typo */
.bx-kicker { font-family: var(--bx-font-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bx-akzent-tief); }
.bx-display { font-size: clamp(2.5rem, 1.3rem + 3.9vw, 5rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; }
.bx-h2 { font-size: clamp(2rem, 1.2rem + 3.2vw, 4rem); line-height: 1.06; letter-spacing: -.03em; font-weight: 700; }
.bx-h3 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); line-height: 1.2; letter-spacing: -.015em; font-weight: 650; }
.bx-lead { font-size: clamp(1.125rem, 1rem + .6vw, 1.45rem); line-height: 1.5; color: var(--bx-text-2); max-width: 38em; }
.bx-akzent { color: var(--bx-akzent); }

/* ---------------------------------------------------------------- Layout */
.bx-innen { width: min(100% - 2 * var(--bx-rand), var(--bx-breite)); margin-inline: auto; }
.bx-kapitel { min-height: 100svh; display: grid; align-items: center; padding-block: clamp(80px, 12vh, 140px); }
.bx-teilung { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.bx-teilung > * { min-width: 0; }
.bx-stapel > * + * { margin-top: var(--bx-abstand, 1.25rem); }

/* Ruhige Fläche für Text über der Partikel-Szene */
.bx-flaeche {
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--bx-linie);
  border-radius: var(--bx-radius);
  box-shadow: var(--bx-schatten);
  padding: clamp(24px, 3.5vw, 44px);
}

/* Kapitel, das beim Scrollen kurz stehen bleibt (nur Desktop) */
.bx-pin { height: 170svh; }
.bx-pin > .bx-pin-innen { position: sticky; top: 0; min-height: 100svh; display: grid; align-items: center; }

/* ---------------------------------------------------------------- Knöpfe */
.bx-knopf {
  --k-grund: var(--bx-akzent-tief); /* dunkler Akzent: Kontrast zu Weiß ≥ 4,5 : 1 */
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--k-grund); color: #fff; font: 600 1rem/1 var(--bx-font-text); text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 24px -10px var(--k-grund);
  transition: transform .35s var(--bx-feder), box-shadow .3s var(--bx-ease), background-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.bx-knopf:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 16px 30px -12px var(--k-grund); }
/* Knopf taucht beim Klicken spürbar ein */
.bx-knopf:active { transform: translateY(1px) scale(.95); transition-duration: .08s; box-shadow: inset 0 3px 8px rgba(0, 0, 0, .22); }
.bx-knopf--zart { --k-grund: var(--bx-flaeche); color: var(--bx-text) !important; border: 1px solid var(--bx-linie); box-shadow: none; }
.bx-knopf--zart:hover { box-shadow: 0 10px 24px -14px rgba(21, 37, 46, .35); }
.bx-knopf--zart:active { box-shadow: inset 0 2px 6px rgba(21, 37, 46, .16); }

/* ---------------------------------------------------------------- Tags */
.bx-tag { display: inline-flex; align-items: center; gap: .45em; padding: 6px 12px; border-radius: 999px; background: rgba(14, 143, 138, .08); color: var(--bx-akzent-tief); font: 500 .8rem/1 var(--bx-font-mono); letter-spacing: .04em; }
.bx-tag svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- Liste mit Haken */
.bx-haken { list-style: none; padding: 0; }
.bx-haken li { position: relative; padding-left: 1.9em; }
.bx-haken li + li { margin-top: .6em; }
.bx-haken li::before { content: ""; position: absolute; left: 0; top: .32em; width: 1.1em; height: 1.1em; border-radius: 50%; background: rgba(14, 143, 138, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230A6E6A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat; }

/* ---------------------------------------------------------------- Unterstrich, der sich zieht */
.bx-strich { position: relative; display: inline-block; padding-bottom: .18em; }
.bx-strich::after { content: ""; position: absolute; left: 0; bottom: 0; width: 72px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--bx-akzent), var(--bx-akzent-2)); transform-origin: left; }

/* ================================================================ Scroll-Effekte */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .bx-zeigen { animation: bx-rein linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
    .bx-zeigen-spaet { animation: bx-rein linear both; animation-timeline: view(); animation-range: entry 20% entry 85%; }
    .bx-wachsen { animation: bx-wachsen linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
    .bx-strich::after { animation: bx-strich linear both; animation-timeline: view(); animation-range: entry 30% entry 100%; }
    .bx-folge > * { animation: bx-rein linear both; animation-timeline: view(); animation-range: entry 0% entry 70%; }
    .bx-folge > :nth-child(2) { animation-range: entry 8% entry 78%; }
    .bx-folge > :nth-child(3) { animation-range: entry 16% entry 86%; }
    .bx-folge > :nth-child(4) { animation-range: entry 24% entry 94%; }
  }
  /* Fallback (gesetzt von bx-effekte.js, wenn CSS-Scroll-Animationen fehlen) */
  .bx-js-fallback :is(.bx-zeigen, .bx-zeigen-spaet, .bx-folge > *) { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--bx-ease), transform .9s var(--bx-ease); }
  .bx-js-fallback .bx-wachsen { transform: scale(.88); transition: transform 1.2s var(--bx-ease); }
  .bx-js-fallback .bx-strich::after { transform: scaleX(0); transition: transform 1s var(--bx-ease) .2s; }
  .bx-js-fallback .ist-da:is(.bx-zeigen, .bx-zeigen-spaet), .bx-js-fallback .ist-da.bx-folge > * { opacity: 1; transform: none; }
  .bx-js-fallback .ist-da.bx-folge > :nth-child(2) { transition-delay: .08s; }
  .bx-js-fallback .ist-da.bx-folge > :nth-child(3) { transition-delay: .16s; }
  .bx-js-fallback .ist-da.bx-folge > :nth-child(4) { transition-delay: .24s; }
  .bx-js-fallback .ist-da.bx-wachsen { transform: none; }
  .bx-js-fallback .ist-da.bx-strich::after { transform: none; }

  /* Text der Display-Überschrift baut sich Zeile für Zeile auf (Hero, beim Laden) */
  .bx-aufbau > span { display: block; animation: bx-rein .95s var(--bx-ease) both; }
  .bx-aufbau > span:nth-child(2) { animation-delay: .09s; }
  .bx-aufbau > span:nth-child(3) { animation-delay: .18s; }
  .bx-aufbau > span:nth-child(4) { animation-delay: .27s; }
}

@keyframes bx-rein { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes bx-wachsen { from { transform: scale(.86); border-radius: 36px; } to { transform: scale(1); } }
@keyframes bx-strich { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ================================================================ Mobil */
@media (max-width: 860px) {
  .bx-teilung { grid-template-columns: 1fr; }
  .bx-pin { height: auto; }
  .bx-pin > .bx-pin-innen { position: static; min-height: 0; }
  .bx-kapitel { min-height: 0; padding-block: 72px; }
  .bx-knopf { width: 100%; }
}
@media (max-width: 480px) {
  .bx-display { max-width: calc(100vw - 40px); }
}
