/* ============================================================
   pz.slapstick.be — Base
   Reset, Grundtypografie, Accessibility-Fundament.

   Enthaelt nur elementweite Regeln und Utilities, die jede
   Seite braucht. Komponenten stehen in main.css.
   ============================================================ */

/* ---------- Reset ---------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  /* Slapstick: 0px, ausnahmslos. Kein !important noetig,
     solange keine spaetere Regel dagegen arbeitet. */
  border-radius: 0;
}

html {
  /* Verhindert, dass iOS beim Drehen die Schrift skaliert */
  -webkit-text-size-adjust: 100%;
}

body,
h1, h2, h3, h4,
p, figure, blockquote,
dl, dd, ul, ol {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

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

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

/* ---------- Dokument ------------------------------------- */

html {
  /* Ankersprunge landen nicht unter dem Sticky-Header */
  scroll-padding-top: calc(var(--header-height) + var(--s3));
}

body {
  margin: 0;
  background: var(--bg-deepest);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Kein horizontaler Ueberlauf durch breite Kindelemente */
  overflow-x: hidden;
}

/* Kornstruktur statt Verlauf — gibt der Flaeche Tiefe,
   ohne den Gradient-Reflex zu bedienen. Rein dekorativ,
   deshalb aus dem Pointer- und A11y-Baum genommen. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Typografie ----------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.02em;
  /* Bangers hat lange Unterlaengen — etwas Luft schadet nicht */
  text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p {
  text-wrap: pretty;
  max-width: 68ch;
}

a {
  color: var(--accent-orange);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-gold);
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  color: var(--terminal-green);
}

/* ---------- Accessibility -------------------------------- */

/* Fokus ausschliesslich ueber :focus-visible — Mausklicks
   sollen keinen Ring hinterlassen, Tastatur immer. */
:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

/* .visually-hidden ist nach notice.css gewandert (12.08.2026).
   Sie wird von den ram-notice-Texten gebraucht, und die erscheinen auf
   JEDER Seite im Overlay — base.css laedt aber nur die Startseite. Die
   Folge war eine sichtbare Tabellen-Caption ("Empfohlene Heap-Groesse
   nach System-RAM") mitten im Dialog. Die Klasse bleibt ueberall
   verfuegbar, weil notice.css ebenfalls jede Seite laedt. */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Windows High Contrast: Kacheln behalten ihre Kante.
   Kopf- und Fusszeile deckt chrome.css ab. */
@media (forced-colors: active) {
  .tile { border: 1px solid CanvasText; }
}

/* ---------- Layout-Utilities ----------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--s3);
}
