/* =========================================================================
   Base – Reset, Grundtypografie, Layout-Primitiven
   ========================================================================= */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-base);
  color: var(--fg-default);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }
p { text-wrap: pretty; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.15;
  text-wrap: balance;
  color: var(--fg-default);
}

a {
  color: var(--fg-brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--radius-sign);
}

::selection { background: var(--brand-200); color: var(--gray-950); }

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

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--md { max-width: var(--container-lg); }
.container--sm { max-width: var(--container-md); }

.section {
  padding-block: var(--space-section);
  background-color: var(--bg-page);
  color: var(--fg-default);
}

.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.section--surface {
  --bg-page: var(--gray-0);
  background-color: var(--gray-0);
}

/* Altname bleibt gueltig, zeigt jetzt auf die weisse Flaeche */
.section--subtle {
  --bg-page: var(--gray-0);
  background-color: var(--gray-0);
}

.stack > * + * { margin-top: var(--flow, var(--space-4)); }

/* -------------------------------------------------------------------------
   Typografie-Bausteine
   ------------------------------------------------------------------------- */

.eyebrow {
  display: inline-block;
  padding: 0.3rem 1.55rem 0.3rem 0.7rem;
  background: var(--bg-brand);
  color: var(--fg-on-brand);
  border-radius: var(--radius-sign) 0 0 var(--radius-sign);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--display-md);
  line-height: 1.12;
}

.section-lead {
  font-size: var(--text-lg);
  line-height: var(--leading-lg);
  color: var(--fg-muted);
  max-width: 60ch;
  margin-top: var(--space-4);
}

.section-header {
  max-width: var(--container-md);
  margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

.section-header--center {
  margin-inline: auto;
  text-align: center;
}

.section-header--center .section-lead { margin-inline: auto; }

/* -------------------------------------------------------------------------
   Hilfsklassen
   ------------------------------------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: var(--z-overlay);
  padding: var(--space-3) var(--space-5);
  background: var(--bg-brand);
  color: var(--fg-on-brand);
  border-radius: var(--radius-input);
  font-weight: var(--weight-medium);
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--duration-base) var(--ease-out);
}

.skip-link:focus-visible { transform: translateY(0); }

/* -------------------------------------------------------------------------
   Scroll-Reveal
   ------------------------------------------------------------------------- */

/* Das Verstecken hängt bewusst an .js, das im <head> gesetzt wird. Ohne
   JavaScript – oder wenn main.js vorher stolpert – greift die Regel nicht und
   die Seite ist vollständig lesbar. Andernfalls stünde der gesamte Inhalt
   unter dem Hero dauerhaft auf opacity 0 und niemand käme je an ihn heran. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(0.75rem);
  transition:
    opacity var(--duration-slower) var(--ease-out),
    transform var(--duration-slower) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-visible { opacity: 1; transform: none; }

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

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

  .js [data-reveal] { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------------
   Symbole

   Alle Symbole stammen aus Tabler Icons (MIT) und liegen als lokales Sprite
   unter assets/img/icons/sprite.svg. Nichts wird von fremden Servern geladen,
   nichts ist von Hand nachgezeichnet.
   ------------------------------------------------------------------------- */

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.18em;
}
