/* ==========================================================================
   MR.KNOW — Base: reset, typography primitives, layout helpers, a11y
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-400);
  line-height: var(--lh-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; padding: 0; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Headings --------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold); /* Arial Bold */
  color: var(--text);          /* Styleguide: Headlines = Schwarz/near-black */
  text-wrap: balance;
}
h1 { font-size: var(--fs-800); letter-spacing: -0.015em; }
h2 { font-size: var(--fs-700); letter-spacing: -0.01em; }
h3 { font-size: var(--fs-600); }
h4 { font-size: var(--fs-h4); }

p { text-wrap: pretty; }

/* --- Layout primitives ------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(1rem, 2.5vw, 2rem); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--bg-dark); color: var(--text-on-dark); }
.section--dark h2, .section--dark h3 { color: var(--c-white); }

.grid { display: grid; gap: var(--sp-6); }
@media (min-width: 720px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px)  { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

.stack > * + * { margin-top: var(--sp-4); }

/* --- Eyebrow / section heading patterns ------------------------------- */
/* Eyebrow / Section-Label (Styleguide: rot, klein, Bold, Uppercase) */
.eyebrow {
  display: inline-block;
  font-size: 0.8125rem; /* 13px (Label-Bereich) */
  font-weight: var(--fw-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cta);
  margin-bottom: var(--sp-2);
}
/* Headline darf die volle Spaltenbreite nutzen (kein 16px-ch-Clamp mehr);
   nur die Lead-Zeile wird auf angenehme Lesebreite begrenzt. */
.section__head { max-width: none; margin-bottom: var(--sp-7); }
.section__head h2, .section__head .titlebar { max-width: 26ch; } /* ch in Headline-Größe → großzügig, lange Titel max. 2 Zeilen */
.section__head .lead { color: var(--text-muted); font-size: var(--fs-500); margin-top: var(--sp-3); max-width: none; }
/* Grundregel Sublines: maximale Breite bis zum Burger-Menü der obersten Leiste,
   danach Umbruch in die nächste Zeile (kein einzeiliges Überlaufen nach rechts). */
@media (min-width: 1080px) { .section__head .lead { max-width: calc(100% - 44px); } }

/* Section-Headline — Styleguide: schwarze Headline OHNE roten Strich
   (Eyebrow übernimmt die Akzentuierung). .titlebar bleibt als Hook, ist
   aber nur noch eine reguläre Überschrift. */
.titlebar { position: relative; padding-left: 0; }
.titlebar::before { content: none; }

/* --- Accessibility helpers -------------------------------------------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -120px;
  background: var(--brand); color: #fff; padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm); z-index: 1000; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }

/* Utility */
.text-cta { color: var(--cta); }
.text-purple { color: var(--brand-2); }
.nowrap { white-space: nowrap; }
