/* Produktivvariante: IBM Plex vom eigenen Server.
   Dateien nach assets/fonts/ legen (woff2, aus https://github.com/IBM/plex),
   dann in styles.css statt tokens/fonts.css diese Datei importieren.
   Kein Drittanbieter-Request, damit auch kein DSGVO-Thema. */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/IBMPlexSans-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/IBMPlexSans-Text.woff2") format("woff2");
  font-weight: 450;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/IBMPlexSans-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../assets/fonts/IBMPlexSerif-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../assets/fonts/IBMPlexSerif-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../assets/fonts/IBMPlexSerif-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../assets/fonts/IBMPlexSerif-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Serif";
  src: url("../assets/fonts/IBMPlexSerif-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* Farbwelt AMNI — abgeleitet von den Geburtssteinen der Kinder.
   Drei Steine, vier Äste: die Zwillinge teilen den Opal.
   Rubin · Opal · Granat sind die Markenfarben.
   Signal ist eine rein funktionale Warnfarbe und gehört NICHT zur Marke. */
:root {
  /* --- Rubin — Primärfarbe, Aktion --- */
  --amni-rubin-100: #fae3e7;
  --amni-rubin-200: #efb2bc;
  --amni-rubin-300: #dc7484;
  --amni-rubin-400: #c4394f;
  --amni-rubin-500: #a81530;
  --amni-rubin-600: #94132e;
  --amni-rubin-700: #7c0f26;
  --amni-rubin-800: #5c0a1d;
  --amni-rubin-900: #3e0713;

  /* --- Granat — Tiefe, dunkle Flächen --- */
  --amni-granat-100: #efdfe6;
  --amni-granat-200: #d4aebd;
  --amni-granat-300: #af7288;
  --amni-granat-400: #8c4560;
  --amni-granat-500: #6e2440;
  --amni-granat-600: #5c1b33;
  --amni-granat-700: #4e1728;
  --amni-granat-800: #3a0f1d;
  --amni-granat-900: #22080f;

  /* --- Opal — Fortschritt, Erfolg, Nachhaltigkeit --- */
  --amni-opal-100: #e6f4f2;
  --amni-opal-200: #c6e7e3;
  --amni-opal-300: #99d2cb;
  --amni-opal-400: #6bbab0;
  --amni-opal-500: #3f9e93;
  --amni-opal-600: #26766e;
  --amni-opal-700: #1a5a54;
  --amni-opal-800: #12433e;
  --amni-opal-900: #0c2e2b;

  /* --- Signal (funktional, KEINE Markenfarbe) — ausschließlich für Warnungen --- */
  --amni-signal-100: #f7f0df;
  --amni-signal-200: #eddfbf;
  --amni-signal-300: #dcc48e;
  --amni-signal-400: #c9a85c;
  --amni-signal-500: #b08d33;
  --amni-signal-600: #856a28;
  --amni-signal-700: #5e4b1d;
  --amni-signal-800: #443614;
  --amni-signal-900: #2e2409;

  /* --- Neutral, warm (leicht granatgetönt) --- */
  --amni-neutral-000: #ffffff;
  --amni-neutral-50:  #fbf9f6;
  --amni-neutral-100: #f4f0ea;
  --amni-neutral-200: #e7e0d8;
  --amni-neutral-300: #d5ccc2;
  --amni-neutral-400: #b0a69b;
  --amni-neutral-500: #8a8079;
  --amni-neutral-600: #665f5a;
  --amni-neutral-700: #48423f;
  --amni-neutral-800: #2e2a28;
  --amni-neutral-900: #1a1618;

  /* ---------- Semantische Aliase ---------- */
  --color-bg:            var(--amni-neutral-50);
  --color-bg-sunken:     var(--amni-neutral-100);
  --color-surface:       var(--amni-neutral-000);
  --color-surface-muted: var(--amni-neutral-50);
  --color-surface-inverse: var(--amni-granat-800);

  --color-text:          var(--amni-neutral-900);
  --color-text-secondary:var(--amni-neutral-600);
  --color-text-muted:    var(--amni-neutral-500);
  --color-text-inverse:  var(--amni-neutral-50);
  --color-text-on-accent:#ffffff;

  --color-border:        var(--amni-neutral-200);
  --color-border-strong: var(--amni-neutral-300);
  --color-border-inverse: rgba(255,255,255,.16);

  --color-accent:        var(--amni-rubin-500);
  --color-accent-hover:  var(--amni-rubin-600);
  --color-accent-press:  var(--amni-rubin-700);
  --color-accent-soft:   var(--amni-rubin-100);
  --color-accent-text:   var(--amni-rubin-700);

  --color-deep:          var(--amni-granat-700);
  --color-deep-soft:     var(--amni-granat-100);

  --color-success:       var(--amni-opal-600);
  --color-success-soft:  var(--amni-opal-100);
  --color-warning:       var(--amni-signal-600);
  --color-warning-soft:  var(--amni-signal-100);
  --color-danger:        var(--amni-rubin-600);
  --color-danger-soft:   var(--amni-rubin-100);
  --color-info:          var(--amni-granat-500);
  --color-info-soft:     var(--amni-granat-100);

  --color-focus:         var(--amni-rubin-500);
  --color-selection:     var(--amni-rubin-100);

  /* Die drei Steine. Als Set in der Reihenfolge der Äste:
     Rubin · Opal · Opal · Granat — die beiden Opal-Äste sind die Zwillinge. */
  --amni-stone-rubin:  var(--amni-rubin-500);
  --amni-stone-opal:   var(--amni-opal-500);
  --amni-stone-granat: var(--amni-granat-500);

  /* Auf Granat-Grund (dunkle Bänder, Portal-Sidebar, Trennfolien) reichen die
     500er-Stufen nicht — Granat-500 auf Granat-800 liegt bei 1,6:1. Dort gilt
     dieses Set: gleiche Rollen, helle Rampenstufen, jede über 3:1. */
  --amni-stone-rubin-on-dark:  var(--amni-rubin-300);
  --amni-stone-opal-on-dark:   var(--amni-opal-400);
  --amni-stone-granat-on-dark: var(--amni-granat-300);
}

:root {
  --font-sans:  "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, serif;
  --font-mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  --font-display: var(--font-serif);
  --font-body:    var(--font-sans);
  --font-label:   var(--font-mono);

  --text-3xs: .6875rem; /* 11 */
  --text-2xs: .75rem;   /* 12 */
  --text-xs:  .8125rem; /* 13 */
  --text-sm:  .875rem;  /* 14 */
  --text-md:  1rem;     /* 16 */
  --text-lg:  1.125rem; /* 18 */
  --text-xl:  1.375rem; /* 22 */
  --text-2xl: 1.75rem;  /* 28 */
  --text-3xl: 2.25rem;  /* 36 */
  --text-4xl: 3rem;     /* 48 */
  --text-5xl: 4rem;     /* 64 */
  --text-6xl: 5.25rem;  /* 84 */

  --leading-tight: 1.08;
  --leading-snug: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  --tracking-tight: -.02em;
  --tracking-normal: 0;
  --tracking-wide: .04em;
  --tracking-label: .12em;

  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
}

:root {
  --space-0:  0;
  --space-1:  2px;
  --space-2:  4px;
  --space-3:  8px;
  --space-4:  12px;
  --space-5:  16px;
  --space-6:  20px;
  --space-7:  24px;
  --space-8:  32px;
  --space-9:  40px;
  --space-10: 48px;
  --space-11: 64px;
  --space-12: 80px;
  --space-13: 96px;
  --space-14: 128px;

  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 9px;
  --radius-lg: 14px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --border-hairline: 1px;
  --border-strong: 2px;

  --container-sm: 720px;
  --container-md: 960px;
  --container-lg: 1200px;
  --container-xl: 1360px;

  --gutter: var(--space-8);
}

:root {
  /* Warme, granatgetönte Schatten — nie neutrales Schwarz */
  --shadow-xs: 0 1px 2px rgba(34, 8, 15, .06);
  --shadow-sm: 0 1px 3px rgba(34, 8, 15, .07), 0 1px 1px rgba(34, 8, 15, .04);
  --shadow-md: 0 6px 16px -6px rgba(34, 8, 15, .13), 0 2px 4px rgba(34, 8, 15, .05);
  --shadow-lg: 0 20px 44px -20px rgba(34, 8, 15, .22), 0 4px 10px rgba(34, 8, 15, .06);
  --shadow-focus: 0 0 0 3px rgba(168, 21, 48, .22);

  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 420ms;
  --duration-grow: 900ms;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-grow: cubic-bezier(.16, .84, .28, 1);
}

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}

p { margin: 0; }

a {
  color: var(--color-accent-text);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--color-accent) 35%, transparent);
  transition: color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }

::selection { background: var(--color-selection); color: var(--amni-rubin-900); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

.amni-label {
  font-family: var(--font-label);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* Astlinie: die Trennlinie des Systems — verläuft an den Enden aus */
.amni-rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--color-border) 12%, var(--color-border) 88%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
