/* =========================================================================
   PRÜFSERVICE — base.css
   Design tokens, reset, typography, layout primitives
   ========================================================================= */

/* ---------- Self-hosted fonts (DSGVO-konform, KEIN Google CDN) ----------- */
/*  WOFF2-Dateien selbst herunterladen: bash assets/fonts/download-fonts.sh
    Fallback auf system-ui falls Dateien fehlen.                            */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/Inter-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("../assets/fonts/Inter-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
  src: url("../assets/fonts/Inter-Bold.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
}

/* ============================== TOKENS ================================== */

:root {
  /* Steel + Industrial */
  --steel-900: #0F1A24;
  --steel-800: #14202D;
  --steel-700: #1E2F40;
  --steel-600: #324860;
  --steel-500: #4A6076;
  --steel-400: #6B8198;
  --steel-300: #9CAEC2;
  --steel-200: #C8D3E0;
  --steel-100: #E4EBF2;

  /* Signal Blue (Brand Primary) */
  --signal-700: #074880;
  --signal-600: #0B5FA3;
  --signal-500: #1B7BC6;
  --signal-400: #2E8FD9;
  --signal-300: #6BB1E7;
  --signal-100: #DDEBF7;

  /* Safety / DGUV Plakette Yellow */
  --safety-700: #A88200;
  --safety-600: #C29800;
  --safety:     #E2B100;
  --safety-400: #F0C633;
  --safety-200: #FAE19A;

  /* Status */
  --ok-500:   #1F9D55;
  --ok-100:   #D8F2E2;
  --warn-500: #B45309;
  --err-500:  #B91C1C;

  /* Neutral surfaces */
  --paper:    #F5F7FA;
  --paper-2:  #ECF0F5;
  --white:    #FFFFFF;
  --ink-900:  #0A1118;
  --ink-700:  #1F2A36;
  --ink-500:  #475568;
  --ink-300:  #8395A8;

  /* Typography */
  --font-sans: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-30: 1.875rem;
  --fs-36: 2.25rem;
  --fs-48: 3rem;
  --fs-60: 3.75rem;
  --fs-72: 4.5rem;

  --lh-tight: 1.1;
  --lh-snug:  1.25;
  --lh-base:  1.55;
  --lh-loose: 1.75;

  /* Tracking */
  --ls-tight: -0.02em;
  --ls-snug:  -0.01em;
  --ls-wide:   0.02em;
  --ls-mono:   0.04em;

  /* Spacing scale (8pt) */
  --s-1:  4px;
  --s-2:  8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
  --s-11: 160px;

  /* Radii */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 8px;
  --r-4: 12px;
  --r-5: 16px;
  --r-pill: 999px;

  /* Shadows (industrial, restrained) */
  --shadow-1: 0 1px 2px rgba(15, 26, 36, 0.06), 0 1px 3px rgba(15, 26, 36, 0.04);
  --shadow-2: 0 4px 12px rgba(15, 26, 36, 0.08), 0 2px 4px rgba(15, 26, 36, 0.04);
  --shadow-3: 0 12px 32px rgba(15, 26, 36, 0.12), 0 4px 8px rgba(15, 26, 36, 0.06);
  --shadow-cta: 0 6px 16px rgba(226, 177, 0, 0.25);

  /* Layout */
  --container: 1280px;
  --container-narrow: 880px;

  /* Motion (UA-aligned vocabulary — мягкий старт, длиннее durations) */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
  --ease-stamp: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 420ms;
  --dur-4: 680ms;
  --dur-stamp: 640ms;

  /* Z */
  --z-cookie: 9000;
  --z-modal: 8000;
  --z-fab: 600;
  --z-header: 500;
  --z-overlay: 300;
}

/* ============================== RESET =================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; tab-size: 4; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-base);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

a { color: var(--signal-600); text-decoration: none; transition: color var(--dur-2) var(--ease-out); }
a:hover { color: var(--signal-700); }

:focus-visible {
  outline: 2px solid var(--signal-500);
  outline-offset: 2px;
  border-radius: var(--r-2);
}

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

/* ============================== TYPOGRAPHY ============================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s-4);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--steel-900);
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 4.4vw + 0.5rem, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 2.4vw + 0.5rem, 2.625rem); }
h3 { font-size: clamp(1.25rem, 1.2vw + 0.7rem, 1.625rem); }
h4 { font-size: var(--fs-20); }

p { margin: 0 0 var(--s-4); max-width: 65ch; }
.lead { font-size: var(--fs-20); color: var(--ink-700); line-height: var(--lh-base); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--signal-600);
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 18px; height: 1px;
  background: var(--signal-600);
}

.mono { font-family: var(--font-mono); letter-spacing: var(--ls-mono); }

/* ============================== LAYOUT =================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--s-5);
}
.container.narrow { max-width: var(--container-narrow); }

.section {
  padding: var(--s-9) 0;
  position: relative;
}
.section--tight { padding: var(--s-8) 0; }
.section--hero  { padding: var(--s-10) 0 var(--s-9); }

.section--steel { background: var(--steel-900); color: var(--steel-100); }
.section--steel h1, .section--steel h2, .section--steel h3 { color: var(--white); }
.section--steel .eyebrow { color: var(--signal-300); }
.section--steel .eyebrow::before { background: var(--signal-300); }
.section--steel .lead { color: var(--steel-200); }

.section--paper2 { background: var(--paper-2); }

@media (max-width: 900px) {
  .section { padding: var(--s-8) 0; }
  .section--hero { padding: var(--s-8) 0 var(--s-7); }
}

/* Stack utilities */
.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.stack-xl > * + * { margin-top: var(--s-8); }

.cluster { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.split   { display: flex; gap: var(--s-5); align-items: center; justify-content: space-between; flex-wrap: wrap; }

.grid { display: grid; gap: var(--s-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

@media (max-width: 1024px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
}

/* ============================== UTILITIES =============================== */

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

.text-muted { color: var(--ink-500); }
.text-steel { color: var(--steel-500); }
.text-signal { color: var(--signal-600); }

.divider { height: 1px; background: var(--steel-100); border: 0; margin: var(--s-6) 0; }

/* Skip link (a11y) */
.skip-link {
  position: absolute;
  top: -100px; left: var(--s-4);
  background: var(--signal-600); color: var(--white);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-3);
  z-index: 10000;
  font-weight: 600;
  transition: top var(--dur-2) var(--ease-out);
}
.skip-link:focus { top: var(--s-4); color: var(--white); }

/* ============================== MOTION RESPECT ========================== */

@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;
  }
}
