/* ============================================================================
   TECOMON® — MASTER CSS
   Abgeleitet aus: CI-Brandmappe Ausgabe 02 (Entwurf), Stand 08/2026
   Eigentümerin: Mutter-GmbH, Bereich Corporate Identity (T.4)

   GRUNDPRINZIP
   Komponenten referenzieren ausschließlich ROLLEN, niemals Farbnamen.
   "Mitternachtsblau ist die Hauptfläche" gilt nur in einem der beiden Modi.
   Wer --surface-1 schreibt, ist in beiden Modi richtig. Wer #050B1A schreibt,
   ist in einem der beiden Modi falsch.

   MODUSSTEUERUNG
   Standard ist dunkel, unabhängig von der Systemeinstellung des Geräts.
   Umschalten über das Attribut data-mode am <html>-Element:
     <html data-mode="dark">  bzw.  <html data-mode="light">
   Die Wahl wird gespeichert und gilt für alle Einheitenseiten derselben Person.
   Print ist immer hell — der Wechsel ist eine Bildschirmfunktion.

   ABWEICHUNG GEGENÜBER DER MAPPE
   In der Mappe widersprachen sich Farbtabelle und ausgelieferte CSS-Datei bei
   einem Wert: Schrift primär hell steht in der Tabelle mit 78 % Deckkraft, im
   Code mit 92 %. Dieses Master-CSS folgt der Tabelle (78 %), weil sie die
   normative Quelle ist. Die Mappe ist entsprechend zu korrigieren.
============================================================================ */

@layer tokens, base, typography, components, utilities, print;

/* ============================================================================
   01 · TOKENS
============================================================================ */
@layer tokens {

  :root,
  html[data-mode="dark"] {
    color-scheme: dark;

    /* Flächen — die Kachel liegt in beiden Modi HELLER als die Seite */
    --surface-1: #050B1A;   /* Hauptfläche · Mitternacht */
    --surface-2: #0B1329;   /* Zweite Ebene · Schatten */
    --surface-3: #111B36;   /* Dritte Ebene · Hover, gehobene Kachel */

    /* Graubasis — erscheint selbst nirgends, erzeugt nur Abstufungen */
    --grey: 195, 205, 246;  /* #C3CDF6 */

    /* Schrift */
    --text-1: #F4F7FD;                  /* Fließtext · 18,3:1 */
    --text-2: rgba(var(--grey), .70);   /* Labels    ·  6,5:1 */
    --text-3: rgba(var(--grey), .52);   /* Hinweise  ·  4,0:1 */

    /* Linien */
    --line: rgba(var(--grey), .26);         /* Hairline · 1,9:1 zur Kachel */
    --line-strong: rgba(var(--grey), .40);  /* Tabellenkopf, Rahmen */

    /* Akzent — zwei Rollen, weil Gelb als Tinte und als Fläche verschieden bricht */
    --accent: #FAFF80;      /* Akzent Fläche · Funke */
    --on-accent: #050B1A;   /* Schrift auf Akzentfläche */
    --accent-ink: #FAFF80;  /* Akzent Tinte · Punkt, Kante, Zahl */
    --glow: rgba(250, 255, 128, .70);

    /* Redaktioneller Akzent */
    --edit: #E8785A;        /* Glut */
    --on-edit: #050B1A;

    /* Status — ausschließlich Portal */
    --status: #007FFF;      /* Signal */

    /* Marke */
    --signet: #F4F7FD;
    --logo: var(--logo-on-dark);

    /* Sternenfeld */
    --star-1: rgba(244, 247, 253, .62);
    --star-2: rgba(244, 247, 253, .42);
    --star-3: rgba(244, 247, 253, .26);

    /* Codeflächen */
    --code-bg: rgba(var(--grey), .10);
  }

  html[data-mode="light"] {
    color-scheme: light;

    --surface-1: #EAEEF4;   /* Graubasis 4 % auf Lichtweiß */
    --surface-2: #F4F7FD;   /* Lichtweiß · Tageslicht */
    --surface-3: #FFFFFF;

    --grey: 0, 9, 62;       /* #00093E */

    --text-1: rgba(var(--grey), .78);   /* #333B66 · 9,2:1 */
    --text-2: rgba(var(--grey), .60);   /* #5E6587 · 4,9:1 */
    --text-3: rgba(var(--grey), .47);   /* #7C829E · 3,2:1 */

    --line: rgba(var(--grey), .22);
    --line-strong: rgba(var(--grey), .34);

    /* Gelb wechselt im hellen Modus in BEIDEN Rollen auf Messing.
       Als Fläche trägt Messing Lichtweiß (4,91:1), nicht Mitternachtsblau (3,73:1). */
    --accent: #836900;      /* Messing */
    --on-accent: #F4F7FD;
    --accent-ink: #836900;
    --glow: rgba(131, 105, 0, .55);

    --edit: #CB411C;        /* Rost */
    --on-edit: #F4F7FD;

    --status: #006EDE;      /* Leitung */

    --signet: #050B1A;
    --logo: var(--logo-on-light);

    --star-1: rgba(0, 9, 62, .26);
    --star-2: rgba(0, 9, 62, .17);
    --star-3: rgba(0, 9, 62, .10);

    --code-bg: rgba(var(--grey), .07);
  }

  /* --- Markenassets ---------------------------------------------------------
     Zwei freigestellte PNG, eines je Untergrund. Bewusst KEINE CSS-Maske:
     fällt die Maskenunterstützung aus, bleibt sonst ein einfarbiges Rechteck.
     Pfade projektspezifisch überschreiben. */
  :root {
    --logo-on-dark:  url("/assets/tecomon-signet-weiss.png");
    --logo-on-light: url("/assets/tecomon-signet-schwarz.png");
    --logo-ratio: 1.0803;   /* 821 : 760 */
  }

  /* --- Typografie ---------------------------------------------------------- */
  :root {
    --font-display: "Space Grotesk", "Noto Sans", Arial, Helvetica, sans-serif;
    --font-text: "Noto Sans", Arial, Helvetica, sans-serif;

    /* Space Grotesk endet bei 700 — es gibt kein ExtraBold. */
    --weight-display: 700;
    --weight-strong: 600;
    --weight-medium: 500;
    --weight-regular: 400;

    --size-display: 2.25rem;   /* 36px */
    --size-h2: 2.0625rem;      /* 33px */
    --size-heading: 1.4375rem; /* 23px */
    --size-h3: 1.3125rem;      /* 21px */
    --size-lead: 1.0625rem;    /* 17px */
    --size-body: 0.9375rem;    /* 15px */
    --size-small: 0.84375rem;  /* 13.5px */
    --size-label: 0.75rem;     /* 12px — Obergrenze für Versalien */
    --size-micro: 0.65625rem;  /* 10.5px */

    --lh-display: 1.04;
    --lh-heading: 1.2;
    --lh-body: 1.7;
    --lh-tight: 1.55;

    --ls-display: -1.1px;
    --ls-h2: -0.9px;
    --ls-heading: -0.3px;
    --ls-body: 0;
    --ls-label: 0.2em;         /* Bereich 0.16em–0.24em */
    --ls-wordmark: 0.2em;

    --measure: 68ch;           /* Fließtext nie breiter */
  }

  /* --- Raster, Radien, Abstände -------------------------------------------- */
  :root {
    --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
    --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-11: 44px;
    --space-14: 56px; --space-19: 76px;

    --r-xs: 5px;  --r-sm: 7px;  --r-md: 10px;  --r-lg: 12px;
    --r-xl: 14px; --r-pill: 100px;

    /* Einheitenzeichen · optische Kompensation bei gleicher Wirkung */
    --mark: 9px;              /* Referenz = Kreisdurchmesser */
    --mark-square: 0.889;     /* 8 / 9 */
    --mark-tri-w: 1.222;      /* 11 / 9 */
    --mark-tri-h: 1.111;      /* 10 / 9 */
    --mark-tri-rise: 1px;     /* Dreieck sitzt höher, sonst rutscht es optisch */
    --mark-min: 9px;          /* digital · Print 2 mm */
    --mark-min-open: 12px;    /* offene Formen · Print 2,5 mm */

    --signet-min: 18px;       /* darunter entfällt das Binärband */
    --signet-nobinary: 24px;
    --signet-clear: 0.5;      /* Schutzraum = 0,5 × Signethöhe */
  }

  /* --- Nur E-Mail: Zweimodus-Palette --------------------------------------
     Signaturen verlieren beim Einfügen <head> und <style>. Ein automatischer
     Moduswechsel ist dort unmöglich. Diese Werte bestehen AA gegen reines Weiß
     UND reines Schwarz gleichzeitig und sind die einzige ausrollbare Fassung.
     NICHT für Web-Komponenten verwenden. */
  :root {
    --mail-name: #767A00;     /* 4,60 / 4,57 */
    --mail-edit: #D2441D;     /* 4,58 / 4,59 */
    --mail-status: #0072E6;   /* 4,61 / 4,56 */
    --mail-text: #6F7595;     /* 4,53 / 4,63 */
  }
}

/* ============================================================================
   02 · BASE
============================================================================ */
@layer base {

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

  /* Die Grundfarbe sitzt auf <html>, nicht auf <body>. Nur so kann die
     Sternenebene als Pseudoelement von <body> mit z-index:-1 darüber liegen
     und trotzdem hinter dem Inhalt bleiben. */
  html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    background: var(--surface-1);
    transition: background .3s ease;
  }

  body {
    margin: 0;
    background: transparent;
    color: var(--text-1);
    font-family: var(--font-text);
    font-size: 1rem;
    line-height: var(--lh-body);
    -webkit-font-smoothing: antialiased;
    transition: color .3s ease;
  }

  /* --- Sternenfeld, ohne Markup -------------------------------------------
     Liegt automatisch hinter jedem Inhalt, in jedem Dokument, das dieses CSS
     einbindet. Zwei Kacheln unterschiedlicher Größe, damit kein sichtbares
     Raster entsteht. Ebene B entfällt im hellen Modus: dunkle Punkte auf
     hellem Grund wirken bei gleicher Anzahl deutlich aufdringlicher, und
     Größenvarianz liest sich dort als Schmutz statt als Tiefe.

     Voraussetzung: <body> darf keinen eigenen Stacking-Context erzeugen —
     also kein transform, filter, opacity < 1 oder will-change auf <body>.

     Abschalten für dichte Arbeitsflächen wie das Portal:
       <html data-stars="off">

     Druck: Punkte nie unter 0,4 mm und nie unter 8 % Tonwert; bei kleinen
     Formaten ganz weglassen. Im Print ist die Ebene generell aus. */
  body::before,
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
  }

  body::before {
    background-size: 560px 560px;
    background-image:
      radial-gradient(circle 0.9px at 253px 313px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 1.1px at 479px 106px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.7px at  88px 442px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.8px at 341px  61px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 1.0px at 145px 199px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.6px at 512px 377px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at  32px  95px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 401px 498px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 1.1px at 208px 540px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.8px at 549px 224px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.6px at 297px 167px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at 122px 351px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 447px  18px, var(--star-3) 0%, transparent 100%);
  }

  body::after {
    background-size: 640px 640px;
    background-image:
      radial-gradient(circle 1.0px at 431px 150px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.8px at  96px 288px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 1.1px at 604px 461px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 271px 592px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at 517px  77px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.6px at  40px 517px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 1.0px at 350px 340px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.8px at 182px  33px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 628px 244px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at 213px 421px, var(--star-2) 0%, transparent 100%);
  }

  html[data-mode="light"] body::after { content: none; }

  html[data-stars="off"] body::before,
  html[data-stars="off"] body::after { content: none; }

  :focus-visible {
    outline: 2px solid var(--accent-ink);
    outline-offset: 2px;
  }

  ::selection { background: var(--accent); color: var(--on-accent); }

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

  hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--space-6) 0;
  }

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

/* ============================================================================
   03 · TYPOGRAFIE

   Vier Disziplinregeln — Space Grotesk ist im Tech-Branding verbreitet, der
   Unterschied entsteht durch das Setzen, nicht durch die Schriftwahl:
     1. Nur ein Schnitt: ausschließlich 700, nie 500 oder 600.
     2. Nie in Versalien. Labels stehen in Noto Sans, strikt.
     3. Sprung Display zu Fließtext mindestens 1:3.
     4. Laufweite folgt der Größe, ab 32 px negativ.
   Display einmal pro Seite. Ziffern in Tabellen und Portal bleiben Noto Sans.
============================================================================ */
@layer typography {

  .tec-display,
  .tec-h1 {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: var(--size-display);
    line-height: var(--lh-display);
    letter-spacing: var(--ls-display);
    color: var(--text-1);
    text-wrap: balance;
    margin: 0 0 var(--space-5);
  }

  .tec-h2 {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: var(--size-h2);
    line-height: 1.08;
    letter-spacing: var(--ls-h2);
    color: var(--text-1);
    text-wrap: balance;
    margin: 0 0 var(--space-4);
  }

  .tec-h3 {
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: var(--size-h3);
    line-height: var(--lh-heading);
    letter-spacing: var(--ls-heading);
    color: var(--text-1);
    margin: var(--space-11) 0 var(--space-3);
  }

  .tec-lead {
    font-size: var(--size-lead);
    line-height: var(--lh-body);
    color: var(--text-2);
    max-width: var(--measure);
    text-wrap: pretty;
    margin: 0 0 var(--space-5);
  }

  .tec-body {
    font-size: var(--size-body);
    line-height: var(--lh-body);
    color: var(--text-2);
    max-width: var(--measure);
    text-wrap: pretty;
    margin: 0 0 var(--space-3);
  }

  .tec-body strong { color: var(--text-1); font-weight: var(--weight-medium); }

  /* Labels: Versalien nur hier, nur bis 12 px, nie in Space Grotesk */
  .tec-label {
    font-family: var(--font-text);
    font-weight: var(--weight-strong);
    font-size: var(--size-label);
    letter-spacing: var(--ls-label);
    text-transform: uppercase;
    color: var(--text-3);
    line-height: 1.4;
  }

  .tec-hint {
    font-size: var(--size-small);
    line-height: var(--lh-tight);
    color: var(--text-3);
    max-width: var(--measure);
  }

  /* Wortmarke — eine Zeichnung, keine Typografie. Das ® gehört dazu. */
  .tec-wordmark {
    font-family: var(--font-text);
    font-weight: var(--weight-strong);
    letter-spacing: var(--ls-wordmark);
    text-transform: uppercase;
    color: var(--text-1);
  }
  .tec-wordmark sup {
    font-size: .5em;
    letter-spacing: 0;
    vertical-align: super;
  }

  code, .tec-code {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: .92em;
    background: var(--code-bg);
    color: var(--text-1);
    padding: 1px 6px;
    border-radius: var(--r-xs);
  }
}

/* ============================================================================
   04 · KOMPONENTEN
============================================================================ */
@layer components {

  /* --- Signet -------------------------------------------------------------
     Höhe setzen, Breite folgt über das Seitenverhältnis. */
  .tec-signet {
    display: inline-block;
    flex: none;
    height: var(--signet-h, 26px);
    width: calc(var(--signet-h, 26px) * var(--logo-ratio));
    background-image: var(--logo);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
  }
  .tec-signet--on-light { background-image: var(--logo-on-light); }
  .tec-signet--on-dark  { background-image: var(--logo-on-dark); }

  /* Logo-Verbund: Signet plus Wortmarke auf einer Achse, Abstand 0,33 × Höhe */
  .tec-lockup {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--signet-h, 26px) * .33);
  }

  /* --- Einheitenzeichen ---------------------------------------------------
     Immer einfarbig, nie in einer Buntfarbe. Vier Formen sind vergeben,
     vier sind für künftige Einheiten reserviert.
       Kompass  ▲  triangle        Forge    ■  square
       Connects ✚  cross           Orbit    ▼  triangle-down */
  .tec-mark {
    display: inline-block;
    flex: none;
    background: var(--text-1);
    width: var(--mark);
    height: var(--mark);
  }
  .tec-mark--circle { border-radius: 50%; }
  .tec-mark--square {
    width: calc(var(--mark) * var(--mark-square));
    height: calc(var(--mark) * var(--mark-square));
  }
  .tec-mark--triangle,
  .tec-mark--triangle-down {
    width: calc(var(--mark) * var(--mark-tri-w));
    height: calc(var(--mark) * var(--mark-tri-h));
    position: relative;
    top: calc(var(--mark-tri-rise) * -1);
  }
  .tec-mark--triangle      { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
  .tec-mark--triangle-down { clip-path: polygon(0 0, 100% 0, 50% 100%); }
  .tec-mark--cross {
    clip-path: polygon(37% 0, 63% 0, 63% 37%, 100% 37%, 100% 63%,
                       63% 63%, 63% 100%, 37% 100%, 37% 63%, 0 63%, 0 37%, 37% 37%);
  }
  /* reserviert, noch nicht vergeben */
  .tec-mark--semicircle {
    border-radius: 0 var(--mark) var(--mark) 0;
    width: calc(var(--mark) * .62);
  }
  .tec-mark--bar   { width: calc(var(--mark) * .42); }
  .tec-mark--angle { clip-path: polygon(0 0, 26% 0, 26% 74%, 100% 74%, 100% 100%, 0 100%); }
  .tec-mark--ring {
    /* offene Form: nie unter --mark-min-open verwenden */
    background: transparent;
    border: calc(var(--mark) * .18) solid var(--text-1);
    border-radius: 50%;
  }

  /* Markerzeile: extern Name plus Deskriptor, intern zusätzlich die Ordnungsnummer */
  .tec-marker { display: inline-flex; align-items: center; gap: var(--space-3); }
  .tec-marker__label {
    font-family: var(--font-text);
    font-weight: var(--weight-strong);
    font-size: .6875rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-2);
  }

  /* --- Signature-Element · drei Punkte, eine Linie ------------------------
     Erster Punkt Sandrot, zweiter Schriftfarbe, dritter Systemblau. */
  .tec-signature { display: inline-flex; align-items: center; }
  .tec-signature i { width: 9px; height: 9px; border-radius: 50%; display: block; }
  .tec-signature i:nth-of-type(1) { background: var(--edit); }
  .tec-signature i:nth-of-type(2) { background: var(--text-1); }
  .tec-signature i:nth-of-type(3) { background: var(--status); }
  .tec-signature u {
    width: 34px; height: 1px; background: var(--line-strong);
    display: block; text-decoration: none;
  }

  /* --- Buttons ------------------------------------------------------------
     Akzentfläche trägt immer --on-accent. In beiden Modi automatisch richtig. */
  .tec-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--accent);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--r-sm);
    font-family: var(--font-text);
    font-weight: var(--weight-strong);
    font-size: .75rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease;
  }
  .tec-btn:hover { transform: translateY(-1px); }
  .tec-btn--quiet {
    background: transparent;
    color: var(--text-2);
    border: 1px solid var(--line-strong);
  }
  .tec-btn--quiet:hover { border-color: var(--accent-ink); color: var(--text-1); }
  .tec-btn--pill { border-radius: var(--r-pill); }
  .tec-btn--done { background: var(--status); color: #F4F7FD; }

  /* --- Kachel -------------------------------------------------------------
     Liegt in beiden Modi heller als die Seite. Immer mit Hairline, sonst ist
     die zweite Ebene bei 1,07:1 gegen die Hauptfläche nicht wahrnehmbar. */
  .tec-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: var(--space-5) var(--space-6);
  }
  .tec-card--raised { background: var(--surface-3); }

  /* --- Hinweisblock ------------------------------------------------------- */
  .tec-callout {
    border-left: 3px solid var(--accent-ink);
    background: var(--code-bg);
    padding: var(--space-4) var(--space-5);
  }
  .tec-callout--warn { border-left-color: var(--edit); }

  /* --- Leitsatz ----------------------------------------------------------- */
  .tec-quote {
    font-family: var(--font-display);
    font-weight: var(--weight-medium);
    font-size: 1.25rem;
    line-height: 1.35;
    letter-spacing: -.3px;
    color: var(--text-1);
    border-left: 2px solid var(--edit);
    padding-left: var(--space-5);
    max-width: 56ch;
    margin: var(--space-5) 0;
  }

  /* --- Chip --------------------------------------------------------------- */
  .tec-chip {
    display: inline-block;
    font-size: .65625rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-pill);
    color: var(--text-3);
    padding: 3px 10px;
  }
  .tec-chip--status { border-color: var(--status); color: var(--status); }
  .tec-chip--edit   { border-color: var(--edit);   color: var(--edit); }

  /* --- Tabelle ------------------------------------------------------------ */
  .tec-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
  .tec-table th {
    text-align: left;
    font-size: .65625rem;
    font-weight: var(--weight-strong);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 9px var(--space-3) 9px 0;
    border-bottom: 1px solid var(--line-strong);
  }
  .tec-table td {
    padding: 11px var(--space-3) 11px 0;
    border-bottom: 1px solid var(--line);
    color: var(--text-2);
    vertical-align: top;
  }
  .tec-table td strong { color: var(--text-1); font-weight: var(--weight-medium); }

  /* --- Fremdmarken-Raster ------------------------------------------------
     Quarantänezone: die einzige Stelle im System mit fremder Farbe.
     IMMER auf Lichtweiß, nie auf der dunklen Fläche — viele Fremdlogos
     existieren nur dunkel oder nur als Weiß-Aussparung. Gilt in beiden Modi.
     Zwei Anwendungsfälle: Produktmarken der Wert-GmbHs und Kundenreferenzen. */
  .tec-foreign-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
  }
  .tec-foreign-grid > * {
    background: #F4F7FD;               /* bewusst fest, nicht --surface-2 */
    aspect-ratio: 5 / 3;
    display: grid;
    place-items: center;
    padding: 12%;                      /* Schutzraum ≈ 20 % der Zellenhöhe */
  }
  .tec-foreign-grid img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    filter: none;                      /* nie umfärben, nie Graustufen */
  }

  /* --- Porträtkachel -----------------------------------------------------
     Porträts werden auf Mitternachtsblau fotografiert. Damit die Kachel im
     hellen Modus kein Fehler, sondern eine Absicht ist, bleibt sie in BEIDEN
     Modi dunkel. Kein zweiter Shoot nötig. */
  .tec-portrait {
    background: #050B1A;
    border-radius: var(--r-md);
    overflow: hidden;
    aspect-ratio: 4 / 5;
  }
  .tec-portrait img { width: 100%; height: 100%; object-fit: cover; }
  .tec-portrait--placeholder { display: grid; place-items: center; }
  .tec-portrait--placeholder .tec-mark { background: #F4F7FD; --mark: 22px; }

  /* --- Moduswechsel-Schalter --------------------------------------------
     Nie versteckt, feste Position, trägt immer den Zustand als Wort — nie
     nur ein Symbol. */
  .tec-modeswitch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--accent);
    color: var(--on-accent);
    border: 0;
    border-radius: var(--r-pill);
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    font-size: 1.0625rem;
    letter-spacing: -.2px;
    padding: 14px 26px;
    cursor: pointer;
  }
  .tec-modeswitch__track {
    width: 44px; height: 22px; flex: none;
    border-radius: var(--r-pill);
    background: rgba(0, 0, 0, .22);
    position: relative;
  }
  .tec-modeswitch__knob {
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: var(--on-accent);
    transition: left .25s cubic-bezier(.4, 0, .2, 1);
  }
  html[data-mode="light"] .tec-modeswitch__knob { left: 25px; }

  .tec-modeswitch--pulse { animation: tec-glow 1.7s ease-out 2; }
  @keyframes tec-glow {
    0%   { box-shadow: 0 0 0 0 var(--glow); }
    45%  { box-shadow: 0 0 0 22px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
  @media (prefers-reduced-motion: reduce) {
    .tec-modeswitch--pulse {
      animation: none;
      outline: 3px solid var(--accent-ink);
      outline-offset: 4px;
    }
  }
}

/* ============================================================================
   05 · UTILITIES
============================================================================ */
@layer utilities {

  /* --- Sternenfeld, klassenbasiert ---------------------------------------
     AUSNAHME. Regulär kommt das Sternenfeld ohne Markup über die
     Pseudoelemente von <body> (siehe Layer base). Diese Variante ist nur für
     Fälle gedacht, in denen das nicht möglich ist: eingebettete Widgets,
     Iframes, ein abgegrenzter Hero mit eigenem Stacking-Context, oder ein
     <body>, das aus technischen Gründen transform oder filter tragen muss.
     Nie beides gleichzeitig aktiv — sonst verdoppelt sich die Dichte. */
  .tec-starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
  }
  .tec-starfield__a,
  .tec-starfield__b { position: absolute; inset: 0; }

  .tec-starfield__a {
    background-size: 560px 560px;
    background-image:
      radial-gradient(circle 0.9px at 253px 313px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 1.1px at 479px 106px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.7px at  88px 442px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.8px at 341px  61px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 1.0px at 145px 199px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.6px at 512px 377px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at  32px  95px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 401px 498px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 1.1px at 208px 540px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.8px at 549px 224px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.6px at 297px 167px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at 122px 351px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 447px  18px, var(--star-3) 0%, transparent 100%);
  }
  .tec-starfield__b {
    background-size: 640px 640px;
    background-image:
      radial-gradient(circle 1.0px at 431px 150px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.8px at  96px 288px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 1.1px at 604px 461px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 271px 592px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at 517px  77px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.6px at  40px 517px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 1.0px at 350px 340px, var(--star-1) 0%, transparent 100%),
      radial-gradient(circle 0.8px at 182px  33px, var(--star-2) 0%, transparent 100%),
      radial-gradient(circle 0.7px at 628px 244px, var(--star-3) 0%, transparent 100%),
      radial-gradient(circle 0.9px at 213px 421px, var(--star-2) 0%, transparent 100%);
  }
  html[data-mode="light"] .tec-starfield__b { display: none; }

  /* Modusgebundene Sichtbarkeit — für Inhalte, die je Modus anders lauten */
  html[data-mode="dark"]  .tec-only-light { display: none !important; }
  html[data-mode="light"] .tec-only-dark  { display: none !important; }

  /* Flächen und Schrift als Hilfsklassen */
  .tec-surface-1 { background: var(--surface-1); }
  .tec-surface-2 { background: var(--surface-2); }
  .tec-surface-3 { background: var(--surface-3); }
  .tec-ink-1 { color: var(--text-1); }
  .tec-ink-2 { color: var(--text-2); }
  .tec-ink-3 { color: var(--text-3); }
  .tec-ink-accent { color: var(--accent-ink); }
  .tec-ink-edit   { color: var(--edit); }
  .tec-ink-status { color: var(--status); }

  .tec-measure { max-width: var(--measure); }

  .tec-sr-only {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ============================================================================
   06 · PRINT — immer hell, unabhängig vom Schalter
============================================================================ */
@layer print {
  @media print {
    html[data-mode] {
      --surface-1: #FFFFFF; --surface-2: #FFFFFF; --surface-3: #FFFFFF;
      --grey: 0, 9, 62;
      --text-1: rgba(var(--grey), .92);
      --text-2: rgba(var(--grey), .72);
      --text-3: rgba(var(--grey), .55);
      --line: rgba(var(--grey), .28);
      --line-strong: rgba(var(--grey), .42);
      --accent: #836900; --on-accent: #FFFFFF; --accent-ink: #836900;
      --edit: #CB411C; --status: #006EDE; --signet: #050B1A;
      --logo: var(--logo-on-light);
    }
    body::before, body::after { content: none; }
    .tec-starfield { display: none; }
    .tec-card, .tec-callout, .tec-quote { break-inside: avoid; }
  }
}

/* ============================================================================
   07 · SPERREN — was dieses System nicht tut

   Diese Punkte sind bewusst NICHT als CSS abbildbar und gehören ins Review:

   · Kennfarben je Einheit gibt es nicht. Einheiten werden über Name, Deskriptor
     und Zeichen unterschieden, nie über Farbe. Wer eine fünfte Buntfarbe
     einführt, bricht das System.
   · Signalgelb nie als Schrift und nie als Haarlinie auf hellem Grund
     (1,01:1). Für Tinte existiert --accent-ink, nicht --accent.
   · Systemblau ausschließlich Status im Portal. Nie Flächenfarbe der Website.
   · Sandrot hell (#CB411C) als Fläche trägt Lichtweiß, nicht Mitternachtsblau
     (4,54:1 gegen 4,03:1) — genau umgekehrt zu Signalgelb.
   · Das Signet ist die einzige Bildmarke. Kein zweites Logo tritt daneben,
     auch nicht für eine Einheit, auch nicht für ein Produkt.
   · Farbverteilung als Faustregel: 58 % Hauptfläche, 26 % Gegenfläche,
     8 % Signalgelb, 4 % Sandrot, 4 % Systemblau. Gelb wirkt, weil es selten ist.
   · Kein Inhalt existiert nur in einem Modus. Wenn eine Grafik den Wechsel
     nicht überlebt, ist die Grafik falsch, nicht der Modus.
   · Die Ordnungsnummer T.X.Y.Z erscheint ausschließlich intern.
   · Das Sternenfeld liegt automatisch hinter jedem Dokument. Es wird nicht
     seitenweise eingebaut, sondern höchstens bewusst abgeschaltet
     (data-stars="off") — etwa im Portal, wo dichte Tabellen einen ruhigen
     Grund brauchen. Wer es zusätzlich als .tec-starfield einbaut, verdoppelt
     die Dichte und verletzt die Regel der homogenen Fläche.
   · E-Mail-Signaturen nutzen die --mail-* Werte, nie die Web-Rollen. Ein
     automatischer Moduswechsel ist dort technisch unmöglich.

   OFFENE PUNKTE, die dieses CSS nicht schließen kann:
   · Signet als Vektordatei — bis dahin sind die PNG ein Zwischenstand.
   · CMYK-Werte für #836900, #CB411C und #006EDE aus demselben Profil.
   · Markenrechtliche Prüfung der Einheitennamen.
============================================================================ */
