/* =========================================================================
   PfotenSicht — Base: Reset, Basis-Typografie, Layout-Primitive, A11y
   Sektionsabstände laufen ausschließlich über .section (keine kollidierenden
   Selektoren), siehe Brief-Hinweis zur Spezifität.
   ========================================================================= */

/* --- Reset (zurückhaltend) --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-300);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

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

/* --- Typografie --- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  color: var(--text);
  text-wrap: balance;
}

h2 {
  font-size: var(--fs-600);
}

h3 {
  font-size: var(--fs-500);
}

p {
  text-wrap: pretty;
}

/* Absatz-Rhythmus: aufeinanderfolgende Absätze bekommen vertikale Luft
   (Lead → Fließtext im "Über"-/"Das Buch"-Block, mehrteilige Rechtstexte usw.).
   Container mit eigenem Gap-Spacing nehmen das gezielt zurück (siehe .section-head). */
p + p {
  margin-top: var(--space-3);
}

strong {
  font-weight: 600;
  color: var(--text);
}

/* Lead-Absatz (ruhige Einleitung unter Headlines) */
.lead {
  font-size: var(--fs-400);
  color: var(--text);
  max-width: var(--measure);
  line-height: 1.5;
}

.muted {
  color: var(--text-muted);
}

/* Versal-Label mit Tracking (Inter) */
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--fs-100);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* --- Layout-Primitive --- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: 760px;
}

/* Einziger Sektions-Rhythmus. Abstände NUR hierüber. */
.section {
  padding-block: var(--section-pad);
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--line);
}

/* Sektionskopf (Eyebrow + Headline + Lead), ruhig gesetzt */
.section-head {
  max-width: 56ch;
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

/* .section-head verteilt seine Abstände bereits über gap -> kein Doppel-Margin. */
.section-head p + p {
  margin-top: 0;
}

/* --- Buttons / CTA --- */
.btn {
  --btn-fg: var(--bg);
  --btn-bg: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-size: var(--fs-200);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.95em 1.7em;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  border-color: var(--line);
}

.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--surface);
}

/* Dezenter Text-Link mit feiner Unterlinie */
.link {
  color: var(--text);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.link:hover {
  border-color: var(--accent);
}

/* --- A11y: sichtbarer Keyboard-Fokus --- */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Maus-Klicks erzeugen keinen Ring, Tastatur schon (:focus-visible regelt das). */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip-Link für Tastatur-/Screenreader-Nutzer */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 0.6em 1em;
  border-radius: var(--radius-sm);
  /* Höhenunabhängig komplett über den Viewport schieben (kein durchlugender Rand). */
  transform: translateY(-150%);
  transition: transform var(--dur-1) var(--ease-out);
}

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

/* Kleine Abstands-Utilities (statt Inline-Styles, CSP-konform) */
.u-mt-3 {
  margin-top: var(--space-3);
}

.u-mt-4 {
  margin-top: var(--space-4);
}

.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;
}

/* --- Scroll-Reveal Grundzustand (wird per JS aktiviert) --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
  will-change: opacity, transform;
}

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

/* JS aktiviert Reveals erst, wenn die Klasse 'js' am <html> gesetzt ist;
   ohne JS bleibt alles sichtbar (Progressive Enhancement). */
html:not(.js) [data-reveal] {
  opacity: 1;
  transform: none;
}

/* --- prefers-reduced-motion: Bewegung aus, Inhalte sofort sichtbar --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

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