/* Base v2 - Reset, Typografie, Layout-Primitives */

@font-face {
  font-family: "Inter";
  src: url("../files/fonts/inter-latin-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../files/fonts/inter-latin-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../files/fonts/inter-latin-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../files/fonts/jetbrains-mono-latin-regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* Animierte Highlight-Layer - dezent driftende Glow-Spots */
body::after {
  content: "";
  position: fixed;
  inset: -10%;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(ellipse 55% 45% at 50% 0%, rgba(255,91,65,0.10), transparent 55%),
    radial-gradient(ellipse 40% 35% at 80% 30%, rgba(255,180,61,0.07), transparent 55%),
    radial-gradient(ellipse 35% 30% at 20% 70%, rgba(91,103,255,0.05), transparent 60%);
  background-repeat: no-repeat;
  animation: highlight-drift 32s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes highlight-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); }
  33%  { transform: translate3d( 2%,  1%, 0) scale(1.04); }
  66%  { transform: translate3d( 1%, -2%, 0) scale(1.02); }
  100% { transform: translate3d(-1%,  2%, 0) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

/* Background noise/grain für papier-look */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.6;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

ul, ol { list-style: none; }

/* Typografie */
h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 { font-size: var(--text-hero); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { max-width: 65ch; }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.text-accent { color: var(--accent); }
.text-accent-2 { color: var(--accent-2); }
.text-accent-3 { color: var(--accent-3); }
.text-muted { color: var(--text-2); }
.text-dim { color: var(--text-3); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.eyebrow::before { content: "["; opacity: 0.6; }
.eyebrow::after  { content: "]"; opacity: 0.6; }

/* Layout-Primitives */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide   { max-width: var(--container-wide); }

.section { padding-block: clamp(3rem, 8vw, 6rem); }
.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }

.stack > * + * { margin-block-start: var(--space-3); }
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

/* A11y */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%; left: var(--space-2);
  z-index: 1000;
  padding: var(--space-1) var(--space-2);
  background: var(--bg-2);
  color: var(--text);
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
}
.skip-link:focus { top: var(--space-2); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

@supports (scrollbar-color: auto) {
  html { scrollbar-color: var(--bg-3) var(--bg); }
}
