/* ==========================================================================
   okapio – Base (Reset, Typografie, Fokus, Utilities)
   Besitzer: Agent FRONTEND · Werte ausschließlich aus tokens.css
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  /* Fläche hinter der Seite (iOS-Overscroll beim Herunterziehen): dunkel wie der Header */
  background-color: var(--night-950);
}

body {
  margin: 0;
  /* Dunkel wie Header/Hero: Lücken beim iOS-Bounce oder Neuladen zeigen keinen hellen Streifen.
     Alle Sektionen setzen ihren eigenen Hintergrund. */
  background: var(--night-950);
  color: var(--c-text);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-text);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, address { margin: 0; }
address { font-style: normal; }
ul, ol { padding: 0; list-style: none; }

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

/* ---------- Überschriften: Space Grotesk ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-wrap: balance;
  font-optical-sizing: auto;
}
h1 { font-size: var(--fs-h1); font-weight: var(--fw-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

/* Zweiter Teil einer Sektionsüberschrift: gedämpfte Textfarbe. Typografisches Leitmotiv:
   Aussage in voller Farbe, Einordnung zurückgenommen. (Kontrast ≥ 7:1 auf allen Flächen.) */
.h-accent { color: var(--c-text-muted); }

p { max-inline-size: var(--measure); text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 0.14em; }

strong { font-weight: var(--fw-bold); }

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

/* ---------- Fokus (sichtbar auf allen Untergründen) ---------- */
:focus { outline: none; }
:focus-visible {
  outline: var(--focus-w) solid var(--c-focus);
  outline-offset: var(--focus-offset);
  border-radius: var(--r-xs);
}

::selection { background: var(--blue-500); color: var(--frost-50); }

/* ---------- Skip-Link ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: var(--space-3);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-5);
  background: var(--frost-50);
  color: var(--ink-900);
  font-weight: var(--fw-bold);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-2);
}
/* Nur bei Tastaturfokus sichtbar; sonst komplett ausgeblendet (auch im iOS-Overscroll-Bereich) */
.skip-link:not(:focus) {
  inline-size: var(--line-w); block-size: var(--line-w);
  padding: 0; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap; box-shadow: none;
}
.skip-link:focus { outline: var(--focus-w) solid var(--blue-500); outline-offset: var(--line-w-strong); }

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  inline-size: var(--line-w); block-size: var(--line-w);
  margin: calc(var(--line-w) * -1); padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

/* Kicker: technische Marke in JetBrains Mono, mit Linie davor */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  justify-self: start;
  padding: var(--space-1) var(--space-3);
  border: var(--line-w) solid color-mix(in srgb, var(--c-accent) 35%, transparent);
  border-radius: var(--r-pill);
  background: var(--c-accent-tint);
  font-family: var(--font-mono);
  font-size: var(--fs-kicker);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--c-accent-text);
}
.kicker::before {
  content: "";
  inline-size: var(--size-dot);
  block-size: var(--size-dot);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.5rem currentColor;
}

.mono { font-family: var(--font-mono); letter-spacing: var(--ls-mono); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--c-text-muted); }
.muted { color: var(--c-text-muted); }
.small { font-size: var(--fs-sm); }

/* Sichtbar markierte Platzhalter (Inhaber muss ausfüllen) */
.ph {
  background: var(--placeholder-bg);
  color: var(--placeholder-fg);
  padding: 0.05em 0.35em;
  border-radius: var(--r-xs);
  font-weight: var(--fw-semibold);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Druck: Hintergründe neutral */
@media print {
  .site-header, .skip-link, .bg-grid, .site-footer__mark { display: none !important; }
  body { background: var(--frost-50); color: var(--ink-900); }
}
