/* ==========================================================================
   Collective Incubator — Design Tokens (ci-tokens.css)
   Fuer interne CI-Web-Apps ohne Build-Schritt (FastAPI + Jinja2 + HTMX).

   Quellen-Kuerzel in den Kommentaren ([FW], [VAR], [APP], [BS], [NOVA], [WEB], [SIG], [ABL])
   verweisen auf interne CI-Unterlagen (Farbwelt, CI-Cloud-Styles, Website); die vollstaendige
   Quellenliste steht im internen CI-Design-Kit (Stand 2026-10-01), nicht in diesem Repo.
   [ABL] = abgeleitet: Farbton gehalten, Helligkeit veraendert, bis WCAG AA erreicht ist.

   Theme-Logik: Hell ist Standard. Dunkel folgt dem System
   (prefers-color-scheme), es sei denn <html data-theme="light">.
   <html data-theme="dark"> erzwingt Dunkel.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Schrift: Space Mono (SIL OFL 1.1, Selbsthosting erlaubt) als freier Ersatz
   fuer die CI-Hausschrift GT Pressura Mono (Grilli Type, kommerziell; nicht
   mitgeliefert). Space Mono ist der in [FW]:122 dokumentierte Web-Fallback.
   Lizenz: fonts/OFL-SpaceMono.txt. Quelle: github.com/google/fonts/ofl/spacemono
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/SpaceMono-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Space Mono";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/SpaceMono-Bold.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* ---------- Markenfarben, Originale (nur Flaechen/Deko, NICHT fuer kleinen Text) ---------- */
  --ci-brand-teal:   #0098A1; /* [FW]:17 Original; = CI-Cloud $primary [VAR]:12+24, [NOVA]:175 '500' */
  --ci-brand-purple: #422A80; /* [FW]:18; = CI-Cloud "violet" [VAR]:18; [WEB] --color--purple */
  --ci-brand-amber:  #E2A41A; /* [FW]:19; = CI-Cloud "orange" [VAR]:15; [WEB] --color--yellow */
  --ci-brand-coral:  #F26B43; /* [FW]:20 (optionaler Kampagnen-Akzent) */

  /* ---------- Flaechen (Light) ---------- */
  --ci-bg:             #FAF8F2; /* [FW]:82 Page Background (warmes Off-White) */
  --ci-surface:        #FFFFFF; /* [FW]:83 Cards */
  --ci-surface-raised: #FFFFFF; /* [FW]:84 Modals (+ Schatten) */
  --ci-surface-high:   #F2EFE6; /* [FW]:85 Menues, Hover */
  --ci-surface-sunken: #FAF8F2; /* Eingabefelder auf Karten: [FW]:82; Rolle wie CI-Cloud $input-bg #f7f7f7 [VAR]:101 */
  --ci-row-hover:      var(--ci-surface-high); /* Tabellenzeile unter dem Zeiger */

  /* ---------- Linien ---------- */
  --ci-border-subtle: #ECE8DE; /* [FW]:86 Divider */
  --ci-border:        #D8D3C6; /* [FW]:87 Standard */
  --ci-border-strong: #B0ABA0; /* [FW]:88 */
  --ci-border-input:  #8E897F; /* [ABL] aus [FW]:88, Hue 86 gehalten: >= 3:1 gg. Weiss/Bg/Surface-high (WCAG 1.4.11) */

  /* ---------- Text ---------- */
  --ci-text:          #1C1A2E; /* [FW]:109 15.99:1 auf Bg; = Logo-Schwarz [FW]:141; [SIG]:38 PRIMARY */
  --ci-text-2:        #4A4858; /* [FW]:110 8.38:1 */
  --ci-text-3:        #6A6878; /* [FW]:111 5.12:1 */
  --ci-text-disabled: #B8B6BE; /* [FW]:112 nur fuer deaktivierte Elemente (WCAG-Ausnahme) */

  /* ---------- Primaer = CI-Teal ---------- */
  --ci-primary:        #007078; /* [FW]:17 Light-Variante, 5.85:1 Weiss-auf-Teal; Original #0098A1 haette nur 3.50:1 */
  --ci-primary-hover:  #005F67; /* [ABL] OKLCh L -0.06 */
  --ci-primary-active: #00535B; /* [ABL] OKLCh L -0.10 */
  --ci-on-primary:     #FFFFFF; /* [FW]:55 on-teal light */
  --ci-primary-text:   #007078; /* Links, Text-Akzente */
  --ci-primary-tint:   #E0F3F4; /* [ABL] 12 % #0098A1 auf Weiss */
  --ci-primary-glow:   #72BDC1; /* [WEB] --color--turquoise-light, Versatz-Schatten beim Button-Hover */

  /* ---------- Lila = Navigation / Struktur ---------- */
  --ci-purple:       #422A80; /* [FW]:18, [WEB] Menu-Button, Footer, Ueberschriften-Unterstrich */
  --ci-on-purple:    #FFFFFF; /* [FW]:57 */
  --ci-purple-text:  #422A80;
  --ci-purple-tint:  #E8E5F0; /* [ABL] 12 % Lila auf Weiss; [FW]:338 nutzt rgba(66,42,128,.10) */
  --ci-purple-glow:  #9C88BF; /* [WEB] --color--purple-light */

  /* ---------- Status ---------- */
  --ci-success:      #277C00; /* [ABL] von CI-Cloud success #57AB27 [VAR]:13 (2.89:1 -> 5.29:1) */
  --ci-success-tint: #EBF5E5;
  --ci-warning:      #8D6300; /* [ABL] von [FW]:19 amber light #93690B, leicht abgedunkelt fuer Tint-Hintergrund */
  --ci-warning-tint: #FCF4E4;
  --ci-danger:       #CC071E; /* CI-Cloud $danger "red" [VAR]:16+29, 5.81:1 (Text) */
  --ci-danger-fill:  #CC071E; /* Button-Flaeche, in beiden Themes gleich (Weiss darauf 5.81:1) */
  --ci-danger-fill-hover: #B60003; /* [ABL] OKLCh L -0.06 */
  --ci-on-danger:    #FFFFFF;
  --ci-danger-tint:  #F9E1E4; /* [ABL]; CI-Cloud .is-invalid nutzt rgba(red,.07) [APP]:631 */
  --ci-info:         #2F6FA5; /* [ABL] von CI-Cloud $info lightblue #407FB7 [VAR]:8+27 (4.25:1 -> 5.33:1) */
  --ci-info-tint:    #E8F0F6;
  --ci-coral:        #B74523; /* [ABL] von [FW]:20 coral light #C04D2B */
  --ci-coral-tint:   #FDEDE8;

  /* ---------- Fokus ---------- */
  --ci-focus:      #007078;                /* 5.51:1 gg. Bg -> erfuellt WCAG 2.4.13/1.4.11 (>= 3:1) */
  --ci-focus-glow: rgba(0, 112, 120, .18); /* [FW]:345 "rgba(0,105,112,0.15) glow", leicht verstaerkt */

  /* ---------- Overlay / Kopfzeile ---------- */
  --ci-backdrop:      rgba(28, 26, 46, .55); /* Text-Schwarz [FW]:109 mit Alpha */
  --ci-header-bg:     var(--ci-surface);
  --ci-header-border: var(--ci-border-subtle);

  /* Select-Pfeil (Farbe = --ci-text-2) */
  --ci-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234A4858' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");

  /* ---------- Schatten ---------- */
  --ci-shadow-sm:   0 .125rem .25rem rgba(0, 0, 0, .075); /* [BS] --bs-box-shadow-sm */
  --ci-shadow-card: 0 0 20px rgba(0, 0, 0, .1);           /* [APP]:324 .card */
  --ci-shadow-lg:   0 1rem 3rem rgba(0, 0, 0, .175);      /* [BS] --bs-box-shadow-lg (Dialog) */
  --ci-offset:      .1rem;                                 /* [WEB] Button --button-shadow: .1rem */
  --ci-card-border: transparent;                           /* CI-Cloud: Karten ohne Rand [APP]:322 */

  /* ---------- Typografie ---------- */
  --ci-font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
      /* [WEB] --typography-font--sans; CI-Cloud Helvetica, Arial [VAR]:37; Mail-/Signatur-Stack [SIG]:42 */
  --ci-font-mono: "GT Pressura Mono", "Space Mono", ui-monospace, Menlo, Consolas, monospace;
      /* [WEB] --typography-font--mono (PressuraMono, GT Pressura Mono, ...); Fallback-Reihenfolge [FW]:122.
         GT Pressura Mono greift nur, wenn lokal installiert (keine Auslieferung). */
  --ci-font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; /* [BS] --bs-font-monospace */

  --ci-text-xs:   .75rem;   /* 12px — Labels/Meta. [FW]:133 sagt 10–11px; fuer Lesbarkeit auf 12px angehoben */
  --ci-text-sm:   .875rem;  /* 14px — [BS] $font-size-sm; [FW]:132 Body 14–16 */
  --ci-text-base: 1rem;     /* 16px — [BS] --bs-body-font-size */
  --ci-text-lg:   1.125rem; /* 18px — [FW]:131 Headline min. */
  --ci-text-xl:   1.5rem;   /* 24px — CI-Cloud h2 [APP]:184; [FW]:131 Headline max. */
  --ci-text-2xl:  1.75rem;  /* 28px — CI-Cloud h1 [APP]:172 */
  --ci-text-3xl:  2.25rem;  /* 36px — [FW]:130 Display 32–48 */

  --ci-leading-tight:  1.2;  /* [FW]:131 */
  --ci-leading-normal: 1.55; /* [FW]:132 */
  --ci-tracking-tight: -.01em; /* [WEB] --typography-tracking--tight, [FW]:131 */
  --ci-tracking-wide:  .075em; /* [WEB] --typography-tracking--extra-wide (Labels in Versalien) */

  --ci-weight-regular: 400; /* [FW]:123 */
  --ci-weight-bold:    700; /* [FW]:123 */

  --ci-measure: 60ch; /* [WEB] --typography-measure--medium */

  /* ---------- Abstaende (4px-Raster, Bootstrap-Spacer der CI-Cloud) ---------- */
  --ci-space-1: .25rem; /* [BS] spacer 1 */
  --ci-space-2: .5rem;  /* [BS] spacer 2 */
  --ci-space-3: .75rem; /* [APP]:367 Listen-Trenner */
  --ci-space-4: 1rem;   /* [BS] spacer 3 */
  --ci-space-5: 1.5rem; /* [BS] spacer 4 */
  --ci-space-6: 2rem;   /* [APP]:355 .card-body */
  --ci-space-7: 3rem;   /* [BS] spacer 5 */
  --ci-space-8: 5rem;   /* [APP]:265 .mb-large */

  /* ---------- Radien ---------- */
  --ci-radius-sm:   .25rem;  /* [BS] --bs-border-radius-sm */
  --ci-radius:      .375rem; /* [BS] --bs-border-radius (CI-Cloud Buttons/Inputs) */
  --ci-radius-lg:   .5rem;   /* [APP]:323 .card; [WEB] --layout-border-radius */
  --ci-radius-pill: 999px;

  /* ---------- Masse ---------- */
  --ci-container:  1300px;   /* [APP]:238 Container ab 1500px Viewport */
  --ci-control-h:  2.75rem;  /* 44px; CI-Cloud 45px [APP]:641; = Zielgroesse WCAG 2.5.5 */
  --ci-control-px: 1rem;     /* [APP]:629 */
  --ci-header-h:   4rem;

  /* ---------- Bewegung ---------- */
  --ci-ease:     cubic-bezier(.2, 0, 0, 1);
  --ci-duration: .15s;       /* [APP]:793 transition .15s */
}

/* --------------------------------------------------------------------------
   Dunkel — Werte aus [FW]:66-76, 96-103, 177-189 bzw. [FWD]. Abweichungen [ABL]
   sind markiert. Block steht zweimal (System + erzwungen), weil es ohne
   Build-Schritt keine Mixins gibt. Bei Aenderungen BEIDE Bloecke pflegen.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ci-bg: #1C1A2E; --ci-surface: #252437; --ci-surface-raised: #2F2E3F; --ci-surface-high: #3C3B4B;
    --ci-surface-sunken: #1C1A2E;
    --ci-row-hover: #2F2E3F; /* [ABL] = surface-raised; auf #3C3B4B fiele --ci-text-3 unter 4.5:1 */
    --ci-border-subtle: #34324C; --ci-border: #494664; --ci-border-strong: #64637E;
    --ci-border-input: #777692; /* [ABL] aus #64637E, >= 3:1 */
    --ci-text: #F1F1F5; --ci-text-2: #B7B6BE;
    --ci-text-3: #9898A3; /* [ABL] [FW]:102 #7F7F89 hat nur 4.29:1 (dort als AA gefuehrt) -> angehoben */
    --ci-text-disabled: #4C4C53;
    --ci-primary: #4CAFBB; --ci-primary-hover: #5ABCC8; --ci-primary-active: #61C2CE;
    --ci-on-primary: #06222A; --ci-primary-text: #4CAFBB; --ci-primary-tint: #2A3749;
    --ci-primary-glow: rgba(76, 175, 187, .45);
    --ci-purple: #8E7FDC; --ci-on-purple: #0F0A26; --ci-purple-text: #A597F6; /* [ABL] #8E7FDC hat auf Surface nur 4.49:1 */
    --ci-purple-tint: #373452; --ci-purple-glow: rgba(142, 127, 220, .45);
    --ci-success: #61B534; --ci-success-tint: #2D3837;
    --ci-warning: #E1AF47; --ci-warning-tint: #3F3739;
    --ci-danger: #FF766E; --ci-danger-tint: #442F3F;
    --ci-info: #68A8E2; --ci-info-tint: #2E364F;
    --ci-coral: #F18762; --ci-coral-tint: #42323D;
    --ci-focus: #4CAFBB; --ci-focus-glow: rgba(76, 175, 187, .25);
    --ci-backdrop: rgba(10, 8, 22, .7);
    --ci-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23B7B6BE' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    --ci-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);                                         /* [FWD]:72 */
    --ci-shadow-card: 0 4px 12px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .5);         /* [FWD]:73 */
    --ci-shadow-lg: 0 12px 40px rgba(10, 6, 30, .6), 0 4px 12px rgba(0, 0, 0, .4);        /* [FWD]:74 */
    --ci-card-border: var(--ci-border-subtle);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ci-bg: #1C1A2E; --ci-surface: #252437; --ci-surface-raised: #2F2E3F; --ci-surface-high: #3C3B4B;
  --ci-surface-sunken: #1C1A2E;
  --ci-row-hover: #2F2E3F;
  --ci-border-subtle: #34324C; --ci-border: #494664; --ci-border-strong: #64637E;
  --ci-border-input: #777692;
  --ci-text: #F1F1F5; --ci-text-2: #B7B6BE;
  --ci-text-3: #9898A3;
  --ci-text-disabled: #4C4C53;
  --ci-primary: #4CAFBB; --ci-primary-hover: #5ABCC8; --ci-primary-active: #61C2CE;
  --ci-on-primary: #06222A; --ci-primary-text: #4CAFBB; --ci-primary-tint: #2A3749;
  --ci-primary-glow: rgba(76, 175, 187, .45);
  --ci-purple: #8E7FDC; --ci-on-purple: #0F0A26; --ci-purple-text: #A597F6;
  --ci-purple-tint: #373452; --ci-purple-glow: rgba(142, 127, 220, .45);
  --ci-success: #61B534; --ci-success-tint: #2D3837;
  --ci-warning: #E1AF47; --ci-warning-tint: #3F3739;
  --ci-danger: #FF766E; --ci-danger-tint: #442F3F;
  --ci-info: #68A8E2; --ci-info-tint: #2E364F;
  --ci-coral: #F18762; --ci-coral-tint: #42323D;
  --ci-focus: #4CAFBB; --ci-focus-glow: rgba(76, 175, 187, .25);
  --ci-backdrop: rgba(10, 8, 22, .7);
  --ci-select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23B7B6BE' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  --ci-shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --ci-shadow-card: 0 4px 12px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .5);
  --ci-shadow-lg: 0 12px 40px rgba(10, 6, 30, .6), 0 4px 12px rgba(0, 0, 0, .4);
  --ci-card-border: var(--ci-border-subtle);
}
