/* ==========================================================================
   AI BRIDGE PARTNERS — base.css
   Design tokens, reset, typography, utilities.

   Konzept "Ein System, vier Formen":
   Ein durchgehend dunkler, tiefblauer Raum. Farbe wird ausschließlich als
   Signal eingesetzt — ein einziges Blau in fünf Abstufungen. Kontrast
   entsteht über Typografie, Weißraum und Haarlinien, nicht über Buntheit.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Tinte / Flächen */
  --ink-900: #04060c;
  --ink-800: #05070e;
  --ink-700: #080c16;
  --ink-600: #0c111d;
  --ink-500: #111827;

  /* Papier (helles Band) */
  --paper: #eef1f7;
  --paper-2: #e2e7f0;

  /* Signalblau */
  --blue-100: #dce9ff;
  --blue-200: #a8c7ff;
  --blue-300: #7aa7ff;
  --blue-400: #4c8dff;
  --blue-500: #2f6ee0;
  --blue-600: #1b4bab;
  --blue-700: #10306e;

  /* Text */
  --fg: #e7ecf6;
  --fg-dim: #97a3ba;
  --fg-mute: #8593ab;   /* 5,6:1 auf --ink-800 — WCAG AA für Kleintext */
  --fg-on-paper: #0a0f1a;
  --fg-on-paper-dim: #4a5568;

  /* Linien */
  --hair: rgba(148, 176, 226, 0.14);
  --hair-strong: rgba(148, 176, 226, 0.28);
  --hair-dark: rgba(10, 15, 26, 0.14);

  /* Typografie */
  --font-sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Raster */
  --shell: 1440px;
  --gut: clamp(1.25rem, 4vw, 4.5rem);
  --sec-y: clamp(6rem, 13vh, 11rem);

  /* Bewegung */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);

  --radius: 4px;
  --radius-lg: 14px;
}

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Höhe der fixierten Kopfzeile — Ankerziele rutschen sonst darunter. */
  --nav-h: 5.5rem;
}

:where(section[id], [id="top"]) { scroll-margin-top: var(--nav-h); }

body {
  background: var(--ink-800);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.005em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-loading { overflow: hidden; }
body.menu-open { overflow: hidden; }

/* muss stärker sein als die display-Regeln der Komponenten */
[hidden] { display: none !important; }

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

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

/* Kein 300-ms-Warten auf einen möglichen Doppeltipp, kein grauer Blitzer. */
a, button, [role="button"], input, textarea, label, summary {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
ul, ol { list-style: none; }
fieldset { border: 0; }
legend { padding: 0; }

::selection { background: var(--blue-400); color: var(--ink-900); }

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

/* Scrollbar (WebKit) */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb { background: #1a2233; border-radius: 99px; border: 3px solid var(--ink-900); }
::-webkit-scrollbar-thumb:hover { background: #26314a; }

/* ---------- Typografie ---------- */
h1, h2, h3, h4 {
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.98;
  text-wrap: balance;
}

em {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--blue-200);
}

.h2 {
  font-size: clamp(2.6rem, 6.2vw, 5.6rem);
}

.h3 {
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  line-height: 1.05;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

/* Sektionslabel: 00 — Titel */
.sec-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-300);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.sec-label i {
  font-style: normal;
  color: var(--fg-mute);
}
.sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--hair-strong), transparent);
  max-width: 8rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.eyebrow__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue-400);
  box-shadow: 0 0 0 4px rgba(76, 141, 255, 0.14);
  animation: pulse 2.8s var(--ease-io) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.16); }
  50%      { box-shadow: 0 0 0 8px rgba(76, 141, 255, 0); }
}

/* ---------- Zeilen-Reveal (Maske) ---------- */
.line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.line__i { display: block; will-change: transform; }

/* ---------- Utilities ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gut);
}

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

.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 999;
  padding: 0.7rem 1.1rem;
  background: var(--blue-400);
  color: var(--ink-900);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus-visible { transform: none; }

/* Helles Band */
.theme-light {
  background: var(--paper);
  color: var(--fg-on-paper);
}
.theme-light .mono { color: var(--fg-on-paper-dim); }
.theme-light .sec-label { color: var(--blue-600); }
.theme-light .sec-label i { color: var(--fg-on-paper-dim); }
.theme-light .sec-label::after { background: linear-gradient(90deg, var(--hair-dark), transparent); }
.theme-light em { color: var(--blue-600); }
.theme-light ::selection { background: var(--blue-600); color: #fff; }

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