/*
 * Design-Tokens nur für WordPress – Figma-Entwurf „Entwurf“ (hell 1386:2480,
 * dunkel 1393:7981). Wird NACH tokens.css geladen und überschreibt dessen Werte.
 *
 * Bewusste Abweichungen von Figma (WCAG 2.1 AA):
 *   --color-label (dunkel): Figma #876cb1 liegt auf dunklem Grund knapp unter 4,5:1,
 *   daher minimal heller #8b70b6 (4,6:1) für Links und Labels.
 *   --color-footer-link (dunkel): Figma #5e6574 ist auf dunklem Grund zu schwach.
 *   --color-text-muted und --color-footer-link (hell): #525866 statt Figma #5e6574 – mit
 *   Rasterlinien des Hintergrunds dahinter fiel #5e6574 knapp unter 4,5:1 (jetzt ca. 6:1).
 *   Schrift JetBrains Mono → Roboto Mono (bereits lokal eingebunden).
 */

/* ------------------------------------------------------------------ Basis */
:root {
  --color-primary: var(--wp--preset--color--primary, #78519a); /* SF Lila – Buttons, Linien, Icons */
  --color-on-primary: #ffffff;
  --color-divider: var(--wp--preset--color--divider, #78519a);
  --color-status: var(--wp--preset--color--status, #1d9e75);
  --color-hud-track: #1d3d55;

  /* Schriften und Größen aus theme.json (Design → Stile → Typografie) */
  --font-sans: var(--wp--preset--font-family--sans);
  --font-mono: var(--wp--preset--font-family--mono);
  --font-size-s: var(--wp--preset--font-size--s);
  --font-size-m: var(--wp--preset--font-size--m);
  --font-size-l: var(--wp--preset--font-size--l);
  --font-size-xl: var(--wp--preset--font-size--xl);
  --font-size-2xl: var(--wp--preset--font-size--2-xl);
  --font-size-3xl: var(--wp--preset--font-size--3-xl);
  --font-size-4xl: var(--wp--preset--font-size--4-xl);

  --font-size-hero: var(--wp--preset--font-size--5-xl); /* 80 */
  --font-size-claim: clamp(1.75rem, 2.6vw + 0.8rem, 3.125rem); /* 50 */
  /* Abschnittstitel, Einleitung darunter und Call-to-Action-Überschrift – unter Design → Stile → Typografie → Schriftgrößen änderbar */
  --font-size-section: var(--wp--preset--font-size--abschnittstitel, clamp(2rem, 2.2vw + 1rem, 3rem)); /* 48 */
  --font-size-lead: var(--wp--preset--font-size--einleitung, 1.125rem); /* 18 */
  --font-size-cta-titel: var(--wp--preset--font-size--calltoaction, clamp(2rem, 2.2vw + 1rem, 3rem)); /* 48, Überschrift im Call to Action */
  --font-size-cta: var(--wp--preset--font-size--4-xl); /* 64 */

  --radius-panel: 8px;

  /* Leiste über der Kopfzeile: Blau → Lila (#377bc2 → #78519a) */
  --gradient-brand: linear-gradient(90deg, #377bc2 0%, #78519a 100%);

  /* Helles Lila-Band (Figma „Final“: „Mehr erfahren?“ 1411:133102, Zahlenkasten) –
     halbtransparent, dunkle Schrift; wirkt im dunklen Design als gedämpftes Lila. */
  --gradient-cta: linear-gradient(114.6deg, rgb(170 137 221 / 50%) 0%, rgb(146 142 222 / 50%) 57.9%, rgb(174 115 224 / 50%) 110.4%);

  /* Gesättigtes Lila (für Block „AC4DC Hub“ mit heller Schrift). Startfarbe minimal
     dunkler als Figma (#7f63ab statt #876cb1), damit weißer Fließtext AA erreicht. */
  --gradient-band: linear-gradient(116deg, #7f63ab 0%, #78519a 55%);
  --color-on-band: #ffffff;
  --color-on-band-muted: rgb(255 255 255 / 88%);
  --shadow-media: 0 8px 40px rgb(0 0 0 / 15%); /* Figma: Bilder auf Unterseiten */

  /* Einblenden beim Scrollen (Klassen ac-einblenden / ac-einblenden-nacheinander).
     Noch nicht im Styleguide – Werte vorläufig. Zum Ausprobieren hier ändern, dann
     Theme bauen (docker compose run --rm node npm run build) und Seite neu laden. */
  --motion-reveal-duration: 1.8s; /* Dauer der Animation je Element */
  --motion-reveal-ease: cubic-bezier(0.15, 1, 0.25, 1); /* Verlauf: schnell los, lange auslaufend */
  --motion-reveal-distance: 5rem; /* Weg von unten (3rem = 48 px); 0 = nur Überblenden */
  --motion-reveal-scale: 1; /* Startgröße (0.96 = 96 %); 1 = ohne Zoom */
  --motion-reveal-blur: 0px; /* Startunschärfe; 0px = scharf */
  --motion-reveal-stagger: 0.20s; /* Versatz je Element bei „nacheinander“ */
  --motion-reveal-offset: 18%; /* Startpunkt: so weit muss das Element über dem unteren Rand sein; 0% = sofort beim Erscheinen */
}

/* Helle Werte kommen aus der Palette in theme.json (Design → Stile → Farben):
   Änderungen dort wirken direkt auf die Website. Dunkle Werte stehen unten fest. */
/* --------------------------------------------------------- Theme: hell */
:root {
  --color-bg: var(--wp--preset--color--background, #eef0f9);
  --color-bg-page: var(--wp--preset--color--background, #eef0f9);
  --hero-glow: none;
  /* Datenstrom im Hintergrund (assets/js/datenstrom.js): Blau → Lila wie die Kopfzeilen-Leiste */
  --strom-from: #377bc2;
  --strom-to: #78519a;
  --strom-alpha: 0.6;
  /* Punkt-Bänder (datenstrom.js, Punkt-Modus) wie die Figma-Wellen: vorne Cyan, hinten Lila */
  --punkte-from: #1aa3e0;
  --punkte-to: #8a5cc7;
  --punkte-alpha: 0.9;
  /* Leuchtknoten im Hintergrund (assets/js/leuchtknoten.js): Wabenraster und Felder in Lila
     bzw. Blau, Deckkraft des Rasters, Kern der Leuchtpunkte (0 = Feldfarbe, 1 = weiß) */
  --waben-lila: #78519a;
  --waben-blau: #377bc2;
  --waben-alpha: 0.6;
  --waben-kern: 0;

  --color-text: var(--wp--preset--color--text, #252431);
  --color-text-muted: var(--wp--preset--color--text-muted, #525866);
  --color-heading: var(--wp--preset--color--text, #252431);
  --color-label: var(--wp--preset--color--primary, #78519a);
  --color-subtitle: var(--wp--preset--color--primary, #78519a);
  --color-accent: var(--wp--preset--color--primary, #78519a);
  --color-link: var(--wp--preset--color--primary, #78519a);
  --color-focus: var(--wp--preset--color--primary, #78519a);

  --color-surface: rgb(255 255 255 / 45%);
  --color-surface-border: rgb(255 255 255 / 55%);
  --color-section-bg: rgb(255 255 255 / 45%);
  --color-section-border: rgb(255 255 255 / 55%);
  /* Kacheln auf Glasabschnitten (is-style-band): mehr Weiß, feine Kante, spürbarer Schatten –
     sonst liegt 50 % Weiß auf 50 % Weiß und die Kachel hebt sich kaum ab (theme.css „Glasfläche“) */
  --color-surface-raised: rgb(255 255 255 / 65%);
  --color-surface-edge: rgb(255 255 255 / 75%);
  --shadow-card-raised: 0 1px 2px rgb(37 36 49 / 5%), 0 10px 28px rgb(37 36 49 / 9%);
  --color-icon-card-bg: rgb(120 81 154 / 8%);
  --color-icon-card-border: #78519a;

  --color-button-secondary-text: #78519a;
  --color-button-secondary-border: #78519a;

  --color-header-bg: rgb(255 255 255 / 80%); /* Kopfzeile deckender als die übrigen Glasflächen (50 %) */
  --color-header-border: rgb(255 255 255 / 50%);
  --color-menu-bg: #ffffff;
  --color-menu-hover: rgb(120 81 154 / 10%);

  --color-hud-bg: rgb(255 255 255 / 75%);
  --color-hud-border: rgb(255 255 255 / 85%);
  --color-hud-text: #060606;
  --color-hud-bar: #78519a;

  --color-footer-bg: rgb(255 255 255 / 50%);
  --color-footer-link: #525866;
}

/* ------------------------------------------------------- Theme: dunkel */
/* Zwei identische Blöcke: Systemeinstellung bzw. expliziter Schalter. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #111015;
    --color-bg-page: #111015;
    --strom-alpha: 0.57;
    --punkte-alpha: 0.75;
    --waben-lila: #8b70b6;
    --waben-blau: #4f93d6;
    --waben-alpha: 0.5;
    --waben-kern: 0.55;

    /* Palette-Farben (Blöcke mit Farbwahl) im dunklen Design */
  --wp--preset--color--text: #e9e9e9;
  --wp--preset--color--text-muted: #e9e9e9;
  --wp--preset--color--background: #111015;
  --wp--preset--color--surface: #21202a;
  --wp--preset--color--primary: #78519a;
  --wp--preset--color--blau: #33b4ec;

  --color-text: #e9e9e9;
    --color-text-muted: #e9e9e9;
    --color-heading: #e9e9e9;
    --color-label: #8b70b6;
    --color-subtitle: #8b70b6;
    --color-accent: #8b70b6;
    --color-link: #8b70b6;
    --color-focus: #8b70b6;

    --color-surface: rgb(33 32 42 / 45%);
    --color-surface-border: rgb(33 32 42 / 55%);
    --color-section-bg: rgb(33 32 42 / 45%);
    --color-section-border: rgb(0 0 0 / 55%);
    --color-surface-raised: rgb(48 47 60 / 65%);
    --color-surface-edge: rgb(48 47 60 / 75%);
    --shadow-card-raised: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
    --color-icon-card-bg: rgb(120 81 154 / 8%);
    --color-icon-card-border: #78519a;

    --color-button-secondary-text: #e9e9e9;
    --color-button-secondary-border: #e9e9e9;

    --color-header-bg: rgb(33 32 42 / 80%);
    --color-header-border: rgb(0 0 0 / 50%);
    --color-menu-bg: #1c1b24;
    --color-menu-hover: rgb(169 139 208 / 15%);

    --color-hud-bg: rgb(38 36 40 / 75%);
    --color-hud-border: rgb(4 4 4 / 85%);
    --color-hud-text: #ffffff;
    --color-hud-bar: #7f77dd;

    --color-footer-bg: rgb(33 32 42 / 50%);
    --color-footer-link: #8a92a3;
  }
}

:root[data-theme="dark"] {
  --color-bg: #111015;
  --color-bg-page: #111015;
  --strom-alpha: 0.57;
  --punkte-alpha: 0.75;
  --waben-lila: #8b70b6;
  --waben-blau: #4f93d6;
  --waben-alpha: 0.5;
  --waben-kern: 0.55;

  /* Palette-Farben (Blöcke mit Farbwahl) im dunklen Design */
  --wp--preset--color--text: #e9e9e9;
  --wp--preset--color--text-muted: #e9e9e9;
  --wp--preset--color--background: #111015;
  --wp--preset--color--surface: #21202a;
  --wp--preset--color--primary: #78519a;
  --wp--preset--color--blau: #33b4ec;

  --color-text: #e9e9e9;
  --color-text-muted: #e9e9e9;
  --color-heading: #e9e9e9;
  --color-label: #8b70b6;
  --color-subtitle: #8b70b6;
  --color-accent: #8b70b6;
  --color-link: #8b70b6;
  --color-focus: #8b70b6;

  --color-surface: rgb(33 32 42 / 50%);
  --color-surface-border: rgb(33 32 42 / 50%);
  --color-section-bg: rgb(33 32 42 / 50%);
  --color-section-border: rgb(0 0 0 / 50%);
  --color-surface-raised: rgb(48 47 60 / 65%);
  --color-surface-edge: rgb(48 47 60 / 75%);
  --shadow-card-raised: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px rgb(0 0 0 / 35%);
  --color-icon-card-bg: rgb(120 81 154 / 8%);
  --color-icon-card-border: #78519a;

  --color-button-secondary-text: #e9e9e9;
  --color-button-secondary-border: #e9e9e9;

  --color-header-bg: rgb(33 32 42 / 80%);
  --color-header-border: rgb(0 0 0 / 50%);
  --color-menu-bg: #1c1b24;
  --color-menu-hover: rgb(169 139 208 / 15%);

  --color-hud-bg: rgb(38 36 40 / 75%);
  --color-hud-border: rgb(4 4 4 / 85%);
  --color-hud-text: #ffffff;
  --color-hud-bar: #7f77dd;

  --color-footer-bg: rgb(33 32 42 / 50%);
  --color-footer-link: #8a92a3;
}
