/* ==========================================================================
   Base: Reset, Grundtypografie, Text-Styles, Barrierefreiheit, Bewegungs-Einstellungen
   Nur Tokens aus tokens.css, keine Rohwerte für Farbe, Schrift, Abstand oder Dauer.
   ========================================================================== */

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

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

/* Nur vertikal scrollen: nichts darf seitlich überstehen (z. B. die Journey-Landschaft im Hero
   auf Mobile). clip statt hidden, sonst funktionieren sticky Navigation und Sticky-Scroll nicht mehr. */
html,
body {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-surface-default);
  color: var(--color-text-primary);
  font-family: var(--font-family-sans);
  font-size: var(--text-body-font-size);
  font-weight: var(--font-weight-semibold);
  line-height: var(--font-line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Inhalt höchstens grid.max-width (1440 px, wie der Figma-Frame) breit und mittig.
   Navigation (header) und Footer liegen außerhalb von main und laufen immer über die volle Breite. */
main {
  max-inline-size: var(--grid-max-width);
  margin-inline: auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: var(--font-weight-bold);
  line-height: var(--font-line-height-snug);
}

kbd {
  font: inherit;
}

ul {
  padding: 0;
  list-style: none;
}

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

a {
  color: inherit;
}

/* Text-Link im Fließtext: immer Brand-Blau mit Unterstrich (color.text.link). Navigation, Buttons
   und Projektzeilen sind keine Text-Links und behalten ihre eigenen Styles. */
.text-link {
  color: var(--color-text-link);
  text-decoration-line: underline;
  text-decoration-thickness: var(--border-width-thin);
  text-underline-offset: 0.15em;
}

/* Jahreszahl im Holozän-Format 12,025: die vorangestellte 1 und das Komma treten zurück,
   damit das gewohnte Jahr (2025) lesbar bleibt. Markup: <span class="year__prefix">1</span>2<span class="year__prefix">,</span>025 */
.year__prefix {
  color: var(--color-text-year-prefix);
}

.text-link .year__prefix {
  color: var(--color-text-year-prefix-link);
}

/* ---------- Text-Styles (gleiche Namen wie text.* in Figma) ---------- */

.text-display { font: var(--text-display-font-weight) var(--text-display-font-size) / var(--text-display-line-height) var(--font-family-sans); }
.text-hero { font: var(--text-hero-font-weight) var(--text-hero-font-size) / var(--text-hero-line-height) var(--font-family-sans); }
.text-heading-1 { font: var(--text-heading-1-font-weight) var(--text-heading-1-font-size) / var(--text-heading-1-line-height) var(--font-family-sans); }
.text-heading-2 { font: var(--text-heading-2-font-weight) var(--text-heading-2-font-size) / var(--text-heading-2-line-height) var(--font-family-sans); }
.text-heading-3 { font: var(--text-heading-3-font-weight) var(--text-heading-3-font-size) / var(--text-heading-3-line-height) var(--font-family-sans); }
.text-lead { font: var(--text-lead-font-weight) var(--text-lead-font-size) / var(--text-lead-line-height) var(--font-family-sans); }
.text-body-large { font: var(--text-body-large-font-weight) var(--text-body-large-font-size) / var(--text-body-large-line-height) var(--font-family-sans); }
.text-body { font: var(--text-body-font-weight) var(--text-body-font-size) / var(--text-body-line-height) var(--font-family-sans); }
.text-body-small { font: var(--text-body-small-font-weight) var(--text-body-small-font-size) / var(--text-body-small-line-height) var(--font-family-sans); }
.text-label { font: var(--text-label-font-weight) var(--text-label-font-size) / var(--text-label-line-height) var(--font-family-sans); }
.text-label-strong { font: var(--text-label-strong-font-weight) var(--text-label-strong-font-size) / var(--text-label-strong-line-height) var(--font-family-sans); }
.text-caption { font: var(--text-caption-font-weight) var(--text-caption-font-size) / var(--text-caption-line-height) var(--font-family-sans); text-transform: uppercase; }

/* Ziele von Anker-Links liegen nicht unter der festen Navigation */
[id] {
  scroll-margin-top: var(--navigation-bar-height);
}

/* Fokus nur bei Tastatur, immer im Brand-Blau (color.focus.ring) */
:focus-visible {
  outline: var(--border-width-thick) solid var(--color-focus-ring);
  outline-offset: var(--border-width-thick);
  border-radius: var(--radius-small);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  border-radius: var(--radius-small);
}

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

/* Für Screenreader lesbar, visuell unsichtbar (z. B. Skills, wo die Anzeige nur eine
   dekorative Animation ist und aria-hidden bekommt) */
.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}

/* Wer Animationen im System abschaltet, bekommt keine (motion.duration.instant) */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: var(--motion-duration-instant) !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--motion-duration-instant) !important;
  }
}
