/* ═══════════════════════════════════════════════════════════════════════
   base.css — Tokens, Reset, Typografie, Atmosphäre

   Farblogik, aus dem Matrix-Reel-Look übernommen:
   GRÜN  = der Code, das Sichtbargewordene, der Kanal
   GOLD  = das Wissen, die Bücher, das Esoterische
   EIS   = die Welt davor, alles Zurückgenommene
   ROT   = der Bruch. Wird rationiert, nie dekorativ.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --void:      #050b07;
  --void-2:    #0a130d;
  --panel:     rgba(8, 15, 11, 0.78);
  --panel-lit: rgba(16, 30, 21, 0.88);

  --code:      #35f07a;
  --code-2:    #1c8f4e;
  --hot:       #d8ffe6;
  --gold:      #c8a96a;
  --gold-lit:  #f0dcac;
  --ice:       #7fa6c8;
  --blood:     #ff3040;

  --text:      #e4f6ea;
  --dim:       #7f9a89;
  --dimmer:    #6b8577;

  --line:      rgba(53, 240, 122, 0.16);
  --line-lit:  rgba(53, 240, 122, 0.42);

  --f-display: 'Chakra Petch', 'Trebuchet MS', sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --f-serif:   'Cormorant Garamond', Georgia, serif;

  --col:       clamp(19rem, 100vw, 30rem); /* die Linktree-Spalte */
  --gutter:    1.15rem;
  --r:         14px;

  --t-fast:    150ms;
  --t:         300ms;
  --t-slow:    620ms;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--void);
  color: var(--text);
  font-family: var(--f-mono);
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, pre, figure { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--code);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 60;
  padding: 0.6rem 1rem;
  background: var(--code); color: var(--void);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
  border-radius: 0 0 8px 8px;
  transition: transform var(--t) var(--ease);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* ── Atmosphäre: vier gestapelte Ebenen hinter dem Inhalt ─────────────── */

.rain {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.62;
  pointer-events: none;
}

/* Vignette + warmer Kerzenschein unten, damit die Mitte lesbar bleibt. */
.veil {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 62% at 50% 0%,   rgba(5, 11, 7, 0) 0%,   rgba(5, 11, 7, 0.62) 80%),
    radial-gradient(90% 48% at 50% 112%,  rgba(200, 169, 106, 0.13) 0%, rgba(5, 11, 7, 0) 62%),
    linear-gradient(180deg, rgba(5, 11, 7, 0.34) 0%, rgba(5, 11, 7, 0.66) 100%);
}

/* CRT-Zeilenraster. Sehr fein, sonst wird es Kostüm statt Textur. */
.scan {
  position: fixed; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0.32;
  background: repeating-linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.5) 3px,
    rgba(0, 0, 0, 0.5) 4px
  );
  mix-blend-mode: multiply;
}

.grain {
  position: fixed; inset: -50%; z-index: 3; pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
  animation: grain 900ms steps(3) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-1.5%, 1%); }
  66%  { transform: translate(1%, -1.5%); }
  100% { transform: translate(0, 0); }
}

/* ── Typografische Grundformen ────────────────────────────────────────── */

.eyebrow {
  font-size: 0.63rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--code);
  opacity: 0.85;
}

.rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--code-2);
}
.rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-lit), transparent);
}

/* ── Reduzierte Bewegung: alles Atmosphärische steht still ───────────── */

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