/* ============================================================
   ScheibMedia — main.css
   Fonts · Tokens · Reset · Base Typography · Fade-in System
   Dark Cinematic Theme
   ============================================================ */

/* ── 0. Fonts (self-hosted, Google Fonts/SIL Open Font License) ──
   Je eine Variable-Font-Datei pro Familie, latin-Subset (deckt
   deutsche Umlaute und ß vollstaendig ab, liegen in U+0000-00FF).
   font-weight als Bereich macht alle Zwischenwerte nutzbar. */
@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/Instrument-Sans-Variable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../fonts/Manrope-Variable.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ── 1. Design Tokens ─────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Grund-Ebenen — pastelliges Blau (Hue ~218 aus dem Brand-Blau),
     Karten fast weiß */
  --bg:         #E3EBF7;  /* Seitengrund */
  --bg-deep:    #070B12;  /* dunkler Anker: Hero-Basis, Footer, Nav-Overlay */
  --panel:      #D8E2F2;  /* section--alt Bänder */
  --surface:    #F7FAFD;  /* Karten, Formularfelder */
  --surface-hi: #FFFFFF;  /* Hover / erhöhte Flächen */

  /* Text-Hierarchie */
  --ink:      #0B101A;  /* Primärtext (der ehemalige Seitengrund) */
  --sub:      #3E4C66;  /* Sekundärtext */
  --mid:      #5B6A85;  /* gedämpft */
  --on-media: #FFFFFF;  /* Text über Fotos/Video */

  /* Akzent: nur Blau. Grün existiert ausschließlich im Logo. */
  --accent-b:     #4974B9;  /* Flächen, Buttons, Fokus-Basis (Logo-Blau) */
  --accent-b-deep:#3E6BB0;  /* Verlaufs-Stops, gedrückte Flächen */
  --accent-b-ink: #2F5DA0;  /* Links, Text-Akzente, Icons (AA-sicher auf hell) */

  /* Borders */
  --border:        rgba(11,16,26,0.10);
  --border-hi:     rgba(11,16,26,0.18);
  --border-accent: rgba(73,116,185,0.40);

  /* Feedback */
  --error-ink: #A93E32;

  /* Shadows — hell, blau getönt, gelayert; Glow für Feature-Elemente */
  --shadow-card:  0 1px 3px rgba(43,72,116,0.10), 0 8px 28px rgba(43,72,116,0.12);
  --shadow-hover: 0 4px 12px rgba(43,72,116,0.12), 0 20px 52px rgba(43,72,116,0.18);
  --glow-accent:  0 0 48px rgba(73,116,185,0.22);
  --edge-light:   inset 0 1px 0 rgba(255,255,255,0.85);

  /* Spacing (8pt base) */
  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  1.5rem;
  --sp-lg:  2.5rem;
  --sp-xl:  4rem;
  --sp-2xl: 6rem;
  --sp-3xl: 8rem;

  /* Sektions-Rhythmik — waechst stufenlos mit, 64px auf dem Handy bis 104px
     auf grossen Schirmen. Ersetzt den frueheren festen 8rem-Wert samt
     768px-Bruchpunkt. */
  --sp-section: clamp(4rem, 7vw, 6.5rem);

  /* Abstand Seitenkopf -> erster Inhalt, bewusst knapper als --sp-section:
     eine Ueberschrift und das, was sie einleitet, gehoeren naeher
     zueinander als zwei aufeinanderfolgende Sektionen. 32px auf dem Handy
     bis 48px auf grossen Schirmen. */
  --sp-header-gap: clamp(2rem, 3.2vw, 3rem);

  /* Border Radius — Karten deutlich rund, Interaktives etwas enger */
  --r-sm: 16px;
  --r-md: 12px;
  --r-lg: 24px;

  /* Easing */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);

  /* Z-index */
  --z-base:    0;
  --z-raised:  10;
  --z-overlay: 20;
  --z-nav:     50;
  --z-modal:   100;

  /* Fonts */
  --font-display: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Manrope', 'Segoe UI', system-ui, sans-serif;
}

/* ── 2. Reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
img, video, svg { display: block; max-width: 100%; }
picture { display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; background: none; border: none; padding: 0; }
input, textarea, button, select { font: inherit; }

/* ── 3. Base ──────────────────────────────────────────────── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Viewport-feste Blau-Waschung — gibt dem hellen Grund Tiefe, damit
   die Fläche nicht "nackig" wirkt. Scrollt nicht mit. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 15% 0%, rgba(73,116,185,0.14) 0%, transparent 58%),
    radial-gradient(ellipse 50% 40% at 90% 100%, rgba(140,176,232,0.20) 0%, transparent 55%),
    radial-gradient(ellipse 55% 40% at 50% -5%, rgba(255,255,255,0.55) 0%, transparent 60%);
}

/* Feines Grain über dem gesamten hellen Grund — nimmt den sterilen
   Flat-Look, wie Filmkorn im Kinosaal */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.84' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='280' height='280' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 280px 280px;
}

::selection {
  background: rgba(73,116,185,0.28);
  color: var(--ink);
}

/* ── 4. Typography Roles ──────────────────────────────────── */
.t-label {
  display: block;
  font-size: 0.67rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mid);
}

.t-display {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  padding-bottom: 0.07em; /* descender clearance for y g j p q */
}

.t-heading {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ── 5. Section Layout Helpers ────────────────────────────── */
.section {
  padding: var(--sp-section) 0;
}

.section--alt {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3rem;
}

.section-header {
  margin-bottom: clamp(2rem, 4vw, 4rem);
}

/* Für einen zweiten .section-header innerhalb derselben Section
   (z.B. zwei Vorher/Nachher-Slider hintereinander) */
.section-header--spaced {
  margin-top: var(--sp-2xl);
}

.section-header .t-label {
  margin-bottom: var(--sp-sm);
}

.section-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  padding-bottom: 0.07em;
}

/* ── 6. Media Frame — Bildbehandlung sitewide ─────────────── */
/* Jedes Content-Foto sitzt in einem .media-frame: Rundung, Hairline,
   Schatten und ein Grade-Layer, der das Bild in den dunklen Grund
   einbettet. */
.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card), var(--edge-light);
  background: var(--surface);
}

.media-frame picture,
.media-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(200deg, rgba(11,16,26,0) 55%, rgba(11,16,26,0.20) 100%);
}

/* ── 7. Fade-in Animation ─────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.72s var(--ease-smooth),
              transform 0.72s var(--ease-smooth);
}

.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

.fade-in[data-delay="1"] { transition-delay: 0.09s; }
.fade-in[data-delay="2"] { transition-delay: 0.18s; }
.fade-in[data-delay="3"] { transition-delay: 0.27s; }
.fade-in[data-delay="4"] { transition-delay: 0.36s; }

/* ── 8. Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── 9. Mobile ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .section-inner {
    padding: 0 1.5rem;
  }
  /* .section-Padding kommt jetzt stufenlos aus --sp-section (clamp),
     kein fester Bruchpunkt mehr noetig. */
}
