/* =============================================================
   base.css — Reset, Typografie, CRT-Overlay
   ============================================================= */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;   /* Anker springen nicht unter den Header */
}

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

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

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

img { height: auto; }

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

button { background: none; border: 0; cursor: pointer; }

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

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

::selection { background: var(--accent); color: var(--accent-on-in); }

/* ---------- Sichtbarer Fokus fuer Tastaturbedienung ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

:focus:not(:focus-visible) { outline: none; }

/* =============================================================
   Typografie
   ============================================================= */

h1, h2, h3, h4 {
  font-weight: 400;
  line-height: var(--lh-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  font-family: var(--font-pixel);
  letter-spacing: -0.01em;
  line-height: 0.92;
}

h2 {
  font-size: var(--fs-h2);
  font-family: var(--font-pixel);
  line-height: 1;
}

h3 {
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
}

p { text-wrap: pretty; }

/* Alles auf der Seite ist Monospace — Labels bekommen Versalien + Tracking */
.label {
  font-size: var(--fs-tiny);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 400;
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  line-height: var(--lh-snug);
  color: var(--fg-muted);
  max-width: 46ch;
}

.prose { max-width: 62ch; color: var(--fg-muted); }

.prose strong { color: var(--fg); font-weight: 400; }

/* Akzent-Version einer Lead-Zeile */
.lead--accent { color: var(--accent-deep); }

/* =============================================================
   CRT-Overlay — dezente Scanlines, nur Desktop
   ============================================================= */

.crt {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgb(0 0 0 / 0.035) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}

/* Vignette — leichte Randabdunklung wie bei einer Bildschirmröhre */
.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgb(22 22 26 / 0.05) 100%
  );
}

/* Auf kleinen Schirmen und bei reduzierter Bewegung: weglassen */
@media (max-width: 48rem), (prefers-reduced-motion: reduce) {
  .crt { display: none; }
}

/* =============================================================
   Screenreader-only
   Fuer Text, der fuer Screenreader noetig ist, aber nicht sichtbar
   sein soll (z. B. der Linkzweck "zur Startseite" neben dem Wortbild).
   Weder display:none noch visibility:hidden — beides wuerde den Text
   auch aus dem Accessibility-Baum entfernen. `clip` ist die alte
   Eigenschaft, `clip-path` der aktuelle Standard; beide setzen.
   ============================================================= */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--accent);
  color: var(--accent-on-in);
  font-size: var(--fs-small);
  transform: translateY(-120%);
  transition: transform var(--t-fast) var(--ease);
}

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

/* =============================================================
   Auswahl per Tastatur / Screenreader
   ============================================================= */

[hidden] { display: none !important; }
