/* ============================================================
   VIFTECH Hero-Prototypen · Shared Styles
   Phase 1 Design (HTML/CSS), DSGVO-konform durch lokale Fonts.

   Brand-Farben aus dem bestehenden Viftech-CSS extrahiert:
   - Grün:       #0a875a (Logo-Block, Buttons, Akzente)
   - Helles Grau: #F3F5F8 (Section-BG, Janusch's Lieblingsgrau)
   - Mid-Text:   #515962 (Body-Text)
   - Schwarz:    #0c0d0e (Headlines, Borders)
   ============================================================ */

/* ---------- @font-face: Self-hosted (DSGVO) ---------- */

/* IBM Plex Sans Variable (Premium-Variante 1) */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex-sans/IBMPlexSans-Variable.ttf') format('truetype-variations');
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

/* IBM Plex Mono (Premium-Variante 1) */
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono/IBMPlexMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex-mono/IBMPlexMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Geist Variable (Tech-Variante 2 + Bildvarianten 4+5) */
@font-face {
  font-family: 'Geist';
  src: url('../fonts/geist/Geist-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('../fonts/geist-mono/GeistMono-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Switzer Variable (Neutral-Variante 3) */
@font-face {
  font-family: 'Switzer';
  src: url('../fonts/switzer/Switzer-Variable.ttf') format('truetype-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono Variable */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono/JetBrainsMono-Variable.ttf') format('truetype-variations');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ---------- CSS-Variablen: Echte Brand-Farben ---------- */

:root {
  /* Brand-Gruen: aus dem echten Logo extrahiert (#024802) */
  --color-green: #024802;          /* Logo-Brand-Green (sehr dunkel) */
  --color-green-deep: #013601;     /* Hover/Active auf hellem BG */
  --color-green-soft: rgba(2, 72, 2, 0.12);
  --color-green-glow: #1c8a3e;     /* heller Akzent fuer dunkle BGs (Glow-Highlight) */

  /* Neutrale (aus bestehender Site) */
  --color-text: #515962;          /* Body-Text */
  --color-text-strong: #0c0d0e;   /* Headlines */
  --color-bg-light: #F3F5F8;      /* Janusch's helles Grau */
  --color-bg-light-warm: #ECEEF1; /* leicht abgesetzt vom Light-Grey */
  --color-border: #e6e8ea;
  --color-border-bold: #d5d8dc;
  --color-white: #FFFFFF;

  /* Dark-Theme-Untergruende fuer Variante 2 */
  --color-dark: #1A1F1C;
  --color-dark-soft: #232826;

  /* Typografie-Skala (fluid) */
  --fs-display-xl: clamp(2.75rem, 1.5rem + 5.5vw, 5.5rem);
  --fs-display-lg: clamp(2.25rem, 1.25rem + 4vw, 4.5rem);
  --fs-h2: clamp(1.5rem, 1rem + 1.8vw, 2.25rem);
  --fs-body-lg: clamp(1.0625rem, 0.95rem + 0.4vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-mono-sm: 0.8125rem;
  --fs-mono-xs: 0.75rem;

  /* Spacing */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  /* Layout */
  --container-max: 1320px;
  --container-pad: clamp(1.25rem, 4vw, 3rem);

  /* Logo */
  --logo-h-default: 44px;
  --logo-h-large: 56px;
}

/* ---------- Reset ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* Drucker, qs-stage etc. ragen seitlich raus, sollen aber keinen Scroll erzeugen */
  /* scroll-behavior: smooth NICHT verwenden — Konflikt mit Lenis. */
}

/* Lenis Setup-Klassen (von Lenis automatisch gesetzt) */
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
.lenis.lenis-stopped {
  overflow: hidden;
}

/* ---------- Custom Scrollbar ---------- */

/* Firefox */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--color-green) transparent;
}

/* Webkit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    to bottom,
    var(--color-green-glow),
    var(--color-green)
  );
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    to bottom,
    var(--color-green),
    var(--color-green-deep)
  );
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- Page-Load Print-Line ---------- */

.page-load-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    transparent,
    var(--color-green-glow) 30%,
    var(--color-green) 70%,
    transparent
  );
  box-shadow: 0 0 12px var(--color-green-glow);
  z-index: 9998;
  pointer-events: none;
  animation: page-load-sweep 1.1s cubic-bezier(0.5, 0, 0.3, 1) forwards;
}

@keyframes page-load-sweep {
  0%   { width: 0; opacity: 1; }
  50%  { width: 100vw; opacity: 1; }
  100% { width: 100vw; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .page-load-line { display: none; }
}

body {
  position: relative; /* Containing block fuer .printer-stage */
  min-height: 100vh;
  line-height: 1.5;
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-feature-settings: 'kern', 'liga', 'calt';
  color: var(--color-text);
  background: var(--color-white);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* ---------- Reduced Motion ---------- */

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

/* ---------- Mobile Globalanpassungen ---------- */

@media (max-width: 880px) {
  /* Custom Cursor (Crosshair auf Print-Targets) auf Touch unsinnig */
  [data-print="highlight"] {
    cursor: auto !important;
  }
  /* Tap-Highlight auf iOS dezent halten */
  a, button {
    -webkit-tap-highlight-color: rgba(2, 72, 2, 0.15);
  }
  /* Body-Scroll-Smoothing fuer Lenis-fluss */
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* ---------- Logo (geteilt ueber alle Varianten) ---------- */

.brand-logo {
  display: inline-block;
  height: var(--logo-h-default);
  width: auto;
}

.brand-logo--large {
  height: var(--logo-h-large);
}

/* ---------- Index/Vergleichsseite ---------- */

.compare-label {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: var(--fs-mono-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: var(--space-md) var(--container-pad);
  background: #111;
  color: #ddd;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-md);
  border-bottom: 1px solid #2a2a2a;
}

.compare-label strong {
  color: var(--color-green);
  font-weight: 500;
  letter-spacing: 0.16em;
}

.compare-label small {
  color: #777;
  letter-spacing: 0.1em;
}
