/*
 * Reset, Typografie, Layout-Grundlagen.
 * Ersetzt normalize.css + den Basisteil von scentariuminfo.css.
 */

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-var.woff2") format("woff2-variations"),
       url("/assets/fonts/manrope-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------ Reset */

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

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

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

body {
  margin: 0;
  background-color: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

h1,
h2,
h3,
h4 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: var(--leading-tight);
  text-wrap: balance;
  /*
   * Grosse Schriftgrade brauchen engere Laufweite — bei 3rem wirkt die
   * Normalweite der Manrope sonst auseinandergezogen.
   */
  letter-spacing: -.015em;
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); letter-spacing: -.01em; }
h4 { font-size: var(--text-h4); letter-spacing: -.01em; }

/*
 * Absatzabstand grösser als der Zeilenabstand, sonst sind Absatzgrenzen im
 * Fliesstext nicht erkennbar (im Export lief beides auf dieselbe Distanz).
 */
p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}

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

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

a:hover {
  text-decoration: underline;
}

/*
 * Links im Fliesstext werden unterstrichen — Farbe allein reicht nicht,
 * um sie vom umgebenden Text zu unterscheiden (WCAG 1.4.1).
 */
p a {
  text-decoration: underline;
  text-underline-offset: .2em;
}

strong {
  font-weight: 700;
}

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

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

.section {
  padding-block: var(--section-padding);
}

/* ------------------------------------------------------------------- Icons */

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
  display: inline-block;
  vertical-align: -.125em;
}

/* GTM-Fallback-Iframe: unsichtbar, aber im DOM (ersetzt Googles Inline-Style) */
.gtm-noscript {
  display: none;
  visibility: hidden;
}

/* --------------------------------------------------------------- A11y-Hilfen */

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

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: var(--surface);
  color: var(--ink);
  padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0;
  transform: translateY(-110%);
  transition: transform var(--ease);
}

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

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/*
 * <main> trägt tabindex="-1", damit der Skip-Link den Fokus wirklich dorthin
 * bewegt — ohne das bleibt er in manchen Browsern und bei Screenreadern am
 * Link hängen. Einen Rahmen um die halbe Seite braucht es dabei nicht: wer
 * gerade selbst dorthin gesprungen ist, weiss, wo er steht.
 */
main[tabindex="-1"]:focus {
  outline: none;
}

/*
 * Auf den grünen Flächen ging der Fokusrahmen unter — --brand (#4d7a3f) und
 * --brand-mid (#547f45) liegen nur 1,1:1 auseinander. Dort rahmt Weiss.
 */
.site-header :focus-visible,
.site-footer :focus-visible,
.cta-section :focus-visible {
  outline-color: var(--surface);
}

/*
 * Sprungziele nicht unter den Seitenanfang schieben — bei scroll-behavior
 * smooth landet ein Anker sonst bündig an der Fensterkante.
 */
:target {
  scroll-margin-top: var(--space-6);
}

/*
 * Scroll-Reveal.
 * Der versteckte Zustand hängt an .js — ohne JavaScript bleibt alles sichtbar.
 * Der Export löst das mit inline opacity:0 und macht die Seite damit
 * unbenutzbar, sobald das 300-KB-Bundle ausfällt.
 */
/*
 * Der Versatz war mit 10% an die Elementhoehe gekoppelt — hohe Bloecke sind
 * dadurch ueber 80px weit gewandert und wirkten traege. Fester Weg, kuerzere
 * Dauer.
 */
.js .reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .4s ease-out, transform .4s ease-out;
}

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

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
