/* ==========================================================================
   Endure Lab – Base Styles
   Reset, Grundtypografie, Fokus-Stile
   ========================================================================== */

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

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Kein horizontales Wischen: dekorative Überhänge (Glow, Ornamente) sauber kappen.
   "clip" statt "hidden", damit position: sticky im Header intakt bleibt. */
html,
body {
  overflow-x: clip;
}

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

svg {
  fill: currentColor;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  margin: 0 0 var(--space-3);
  color: var(--color-text);
}

h1 {
  font-size: var(--text-hero);
  font-weight: 500;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-h2);
  letter-spacing: -0.015em;
}

/* Kursive Akzentwörter in Display-Überschriften (echte Fraunces-Italics) */
h1 em,
h2 em {
  font-style: italic;
  font-weight: inherit;
  color: var(--color-accent-hover);
}

h3 {
  font-size: var(--text-h3);
}

h4 {
  font-size: var(--text-h4);
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
  cursor: pointer;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: var(--text-body);
  color: var(--color-text);
}

blockquote {
  margin: 0;
}

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-4);
  }
}

.visually-hidden {
  position: absolute;
  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;
  top: -100%;
  left: var(--space-2);
  z-index: 1000;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-button);
  transition: top var(--transition-base);
}

.skip-link:focus {
  top: var(--space-2);
}

/* ---- Fokus-Stile: sichtbar & konsistent für Tastaturnavigation ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--color-accent-soft);
  color: var(--color-text);
}
