/* ═══════════════════════════════════════════════════════════════
   global.css — Friedrich & Weiß Gebäudedienste GbR
   Design-System: CSS Custom Properties, Reset, Typografie, Base
   Agent-09 (UI/UX) + Agent-13 (Frontend)

   WICHTIG: Fonts lokal hosten! Keine Google Fonts CDN-Aufrufe.
   Font-Dateien in assets/fonts/ ablegen (WOFF2 + WOFF):
   - Cormorant: cormorant-light.woff2, cormorant-regular.woff2,
                cormorant-italic.woff2, cormorant-light-italic.woff2
   - Outfit:    outfit-regular.woff2, outfit-medium.woff2, outfit-semibold.woff2
   - DM Mono:   dm-mono-regular.woff2
   Bezugsquelle: fonts.google.com (Lizenzen: SIL Open Font License)
   ═══════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────
   FONT-FACE DEKLARATIONEN (lokal)
   ───────────────────────────────────────── */

@font-face {
  font-family: 'Cormorant';
  src: url('../fonts/cormorant-light.woff2') format('woff2'),
       url('../fonts/cormorant-light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant';
  src: url('../fonts/cormorant-light-italic.woff2') format('woff2'),
       url('../fonts/cormorant-light-italic.woff') format('woff');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant';
  src: url('../fonts/cormorant-regular.woff2') format('woff2'),
       url('../fonts/cormorant-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cormorant';
  src: url('../fonts/cormorant-italic.woff2') format('woff2'),
       url('../fonts/cormorant-italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-regular.woff2') format('woff2'),
       url('../fonts/outfit-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-medium.woff2') format('woff2'),
       url('../fonts/outfit-medium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Outfit';
  src: url('../fonts/outfit-semibold.woff2') format('woff2'),
       url('../fonts/outfit-semibold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Mono';
  src: url('../fonts/dm-mono-regular.woff2') format('woff2'),
       url('../fonts/dm-mono-regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ─────────────────────────────────────────
   DESIGN TOKENS — CSS Custom Properties
   ───────────────────────────────────────── */

:root {
  /* HINTERGRÜNDE — vom Logo abgeleitet */
  --fw-night:      #08111E;   /* Tiefstes Navy — Hero, Footer */
  --fw-navy:       #0D1E35;   /* Navy — Cards, Sektionen */
  --fw-navy-mid:   #1A3052;   /* Navy mittel — Hover, Borders */
  --fw-navy-light: #243D5C;   /* Navy hell — aktive Elemente */

  /* BRAND-AKZENT — Eisblau / Kristall (max. 20% der Fläche) */
  --fw-ice:        #7BBDD4;   /* Primärakzent — CTAs, Links, Icons */
  --fw-ice-light:  #A8D8EE;   /* Hover-Zustände */
  --fw-ice-dark:   #4A90A4;   /* Gedrückter Zustand */
  --fw-crystal:    #D4EEF7;   /* Glitzer, Display-Headlines, Glows */

  /* TEXT */
  --fw-text-primary:   #EEF2F7;   /* Haupttext auf dunkel */
  --fw-text-secondary: #8A9AB0;   /* Subtexte, Labels */
  --fw-text-muted:     #4A6080;   /* Disabled, Placeholder */
  --fw-text-dark:      #0D1E35;   /* Text auf hellen Flächen */

  /* HELL (helle Sektionen) */
  --fw-white:      #FFFFFF;
  --fw-off-white:  #F0F4F8;
  --fw-light-bg:   #E8EEF5;

  /* SEMANTISCH */
  --fw-success:    #2ECC71;
  --fw-warning:    #F59E0B;
  --fw-error:      #EF4444;
  --fw-info:       #7BBDD4;

  /* TYPOGRAFIE */
  --fw-serif:  'Cormorant', Georgia, serif;
  --fw-sans:   'Outfit', system-ui, sans-serif;
  --fw-mono:   'DM Mono', 'Courier New', monospace;

  /* ABSTÄNDE (4px-Raster) */
  --space-xs:  0.25rem;   /*  4px */
  --space-sm:  0.5rem;    /*  8px */
  --space-md:  1rem;      /* 16px */
  --space-lg:  1.5rem;    /* 24px */
  --space-xl:  2rem;      /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  --space-4xl: 6rem;      /* 96px */

  /* BORDER RADIUS */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  /* TRANSITIONS */
  --transition-schnell: 150ms ease;
  --transition-basis:   250ms ease;
  --transition-mittel:  350ms ease;
  --transition-langsam: 500ms ease;
  --transition-spring:  400ms cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-weich:   600ms cubic-bezier(0.22, 1, 0.36, 1);

  /* SCHATTEN */
  --shadow-card:         0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow:         0 0 30px rgba(123, 189, 212, 0.15);
  --shadow-glow-stark:   0 0 60px rgba(123, 189, 212, 0.25);
  --shadow-hover:        0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(123, 189, 212, 0.06);

  /* LAYOUT */
  --container-max:   1320px;
  --container-eng:   900px;
  --section-padding: var(--space-4xl) var(--space-xl);

  /* ── ALIASSE FÜR LANDING-PAGES ──────────────────────────────
     Landing-Pages verwenden --fw-raum-*, --fw-text-* etc.
     Diese Aliasse stellen Kompatibilität sicher.
     ─────────────────────────────────────────────────────────── */

  /* Farben */
  --fw-mist: #4A6080;
  --fw-ash:  #8A9AB0;

  /* Abstände */
  --fw-raum-xs:  0.25rem;
  --fw-raum-sm:  0.5rem;
  --fw-raum-md:  1rem;
  --fw-raum-lg:  1.5rem;
  --fw-raum-xl:  2rem;
  --fw-raum-2xl: 3rem;
  --fw-raum-3xl: 4rem;
  --fw-raum-4xl: 6rem;

  /* Schriftgrößen */
  --fw-text-xs:   0.75rem;
  --fw-text-sm:   0.875rem;
  --fw-text-base: 1rem;
  --fw-text-lg:   1.125rem;
  --fw-text-xl:   1.25rem;
  --fw-text-2xl:  1.5rem;
  --fw-text-3xl:  1.875rem;

  /* Border Radius */
  --fw-radius-sm:   4px;
  --fw-radius-md:   8px;
  --fw-radius-lg:   16px;
  --fw-radius-xl:   24px;
  --fw-radius-full: 9999px;

  /* Transitions */
  --fw-transition-schnell: 150ms ease;
  --fw-transition-basis:   250ms ease;
  --fw-transition-mittel:  350ms ease;
  --fw-transition-langsam: 500ms ease;
}

/* ─────────────────────────────────────────
   CSS RESET (modern, minimal)
   ───────────────────────────────────────── */

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

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

body {
  font-family: var(--fw-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--fw-text-primary);
  background-color: var(--fw-night);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grain-Overlay — subtile Tiefe (aus design-interaktion-vorgabe.md) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
}

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

a {
  color: var(--fw-ice);
  text-decoration: none;
  transition: color var(--transition-basis);
}

a:hover {
  color: var(--fw-ice-light);
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* Fokus-Ring für Tastatur-Navigation (WCAG 2.1 AA) */
:focus-visible {
  outline: 2px solid var(--fw-ice);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ─────────────────────────────────────────
   SKIP-LINK (Barrierefreiheit)
   ───────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--fw-ice);
  color: var(--fw-night);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition-basis);
}

.skip-link:focus {
  top: var(--space-md);
}

/* ─────────────────────────────────────────
   TYPOGRAFIE-SKALA
   ───────────────────────────────────────── */

/* Display — Hero-Headlines, Cormorant Light */
.display {
  font-family: var(--fw-serif);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fw-crystal);
}

/* H1 — Seiten-Headlines */
h1,
.h1 {
  font-family: var(--fw-serif);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--fw-crystal);
}

/* H2 — Abschnitts-Headlines */
h2,
.h2 {
  font-family: var(--fw-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--fw-ice-light);
}

/* H3 — Karten-Titel */
h3,
.h3 {
  font-family: var(--fw-sans);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fw-ice);
}

/* H4–H6 */
h4,
.h4 {
  font-family: var(--fw-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--fw-text-primary);
}

h5, h6 {
  font-family: var(--fw-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fw-text-secondary);
}

/* Body-Text */
p {
  font-family: var(--fw-sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fw-text-secondary);
  max-width: 65ch;
}

/* Großer Body-Text */
.text-lg {
  font-size: 1.125rem;
  line-height: 1.7;
}

/* Klein */
.text-sm {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Label / Tag — DM Mono */
.label,
.tag {
  font-family: var(--fw-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fw-ice);
}

/* Kursiv-Akzent in Headlines */
em.akzent {
  font-style: italic;
  color: var(--fw-ice);
}

/* ─────────────────────────────────────────
   LAYOUT — CONTAINER & SEKTION
   ───────────────────────────────────────── */

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-xl);
}

/* Enger Container für Fließtext-Seiten */
.container--eng {
  max-width: var(--container-eng);
}

/* Sektions-Basisstil */
.sektion {
  padding: var(--space-4xl) 0;
  position: relative;
  z-index: 1;
}

.sektion--dunkel {
  background-color: var(--fw-night);
}

.sektion--navy {
  background-color: var(--fw-navy);
}

.sektion--hell {
  background-color: var(--fw-off-white);
  color: var(--fw-text-dark);
}

/* Sektions-Trenner mit Eisblau-Glow */
.section-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fw-ice), transparent);
  margin: var(--space-xl) 0;
}

.section-divider--zentriert {
  margin-inline: auto;
}

/* ─────────────────────────────────────────
   SCROLL-ANIMATIONEN (IntersectionObserver)
   ───────────────────────────────────────── */

[data-einblenden] {
  opacity: 0;
  transition: opacity 600ms ease, transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-einblenden="unten"] { transform: translateY(30px); }
[data-einblenden="links"] { transform: translateX(-30px); }
[data-einblenden="rechts"] { transform: translateX(30px); }
[data-einblenden="skalieren"] { transform: scale(0.95); }

[data-einblenden].sichtbar {
  opacity: 1;
  transform: none;
}

/* Gestaffelte Kinder-Einblendung */
[data-einblenden-gruppe] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

[data-einblenden-gruppe].sichtbar > *:nth-child(1) { transition-delay: 0ms; opacity: 1; transform: none; }
[data-einblenden-gruppe].sichtbar > *:nth-child(2) { transition-delay: 100ms; opacity: 1; transform: none; }
[data-einblenden-gruppe].sichtbar > *:nth-child(3) { transition-delay: 200ms; opacity: 1; transform: none; }
[data-einblenden-gruppe].sichtbar > *:nth-child(4) { transition-delay: 300ms; opacity: 1; transform: none; }
[data-einblenden-gruppe].sichtbar > *:nth-child(5) { transition-delay: 400ms; opacity: 1; transform: none; }

/* ─────────────────────────────────────────
   UTILITY-KLASSEN
   ───────────────────────────────────────── */

.text-zentriert  { text-align: center; }
.text-links      { text-align: left; }
.text-rechts     { text-align: right; }
.text-crystal    { color: var(--fw-crystal); }
.text-ice        { color: var(--fw-ice); }
.text-muted      { color: var(--fw-text-muted); }
.text-secondary  { color: var(--fw-text-secondary); }

.breite-voll     { width: 100%; }
.zentriert       { margin-inline: auto; }
.versteckt       { display: none; }

/* Responsives Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .container { padding-inline: var(--space-2xl); }
}

@media (min-width: 1024px) {
  .sektion { padding: var(--space-4xl) 0; }
}

@media (min-width: 1440px) {
  :root { --container-max: 1440px; }
}
