/* ============================================================
   N3RA Design Tokens — "Daylight" CI (v1.0)
   ------------------------------------------------------------
   Light mode is the DEFAULT. Dark mode via [data-theme="dark"].
   Import this file (or copy the blocks) in website + dashboard.

   Fonts (Google Fonts):
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
   <link href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
   ============================================================ */

:root {
  /* ---------- brand core ---------- */
  --violet-50:  #F4F1FF;
  --violet-100: #ECE7FF;
  --violet-200: #D8CDFF;
  --violet-300: #B7A3FF;
  --violet-400: #9B82FF;  /* dark-mode accent / decorative */
  --violet-500: #7C5CFF;  /* BRAND violet — graphics, gradients, big accents */
  --violet-600: #5B3DF5;  /* interactive: buttons, links (AA on white) */
  --violet-700: #4B2FE0;  /* hover / pressed */
  --violet-800: #3A23AF;

  --mint-50:  #EDFDF9;
  --mint-100: #D9FBF3;
  --mint-200: #AFF5E4;
  --mint-300: #5FEBD0;
  --mint-400: #19E3C2;   /* BRAND mint — live dot, charts, dark-mode accent */
  --mint-500: #0FBFA0;   /* mint on light surfaces (decorative) */
  --mint-600: #0E9B83;
  --mint-700: #0A7D6A;   /* mint as TEXT on white (AA) */

  /* ---------- supporting hues (illustration / charts / gradients) ---------- */
  --sky-100:  #E0F0FF;
  --sky-300:  #8FC7FF;
  --sky-500:  #3E9CFF;
  --sky-700:  #1268C3;   /* sky as text on white */

  --coral-100: #FFE8E0;
  --coral-300: #FFB39E;
  --coral-500: #FF7A59;
  --coral-700: #C2410C;  /* coral as text on white */

  --amber-100: #FFF0D4;
  --amber-300: #FFD27D;
  --amber-500: #FFB020;
  --amber-700: #935F00;  /* amber as text on white */

  /* ---------- ink / neutrals (violet-tinted) ---------- */
  --ink-900: #14113D;    /* headings, logo ink, dark sections bg base */
  --ink-800: #232050;
  --ink-700: #3A3760;    /* body text */
  --ink-600: #504D6E;
  --ink-500: #63607F;    /* secondary text */
  --ink-400: #8B89A6;    /* muted text, placeholders */
  --ink-300: #B7B5CC;    /* disabled */
  --ink-200: #D9D8E6;
  --ink-100: #E4E6F1;    /* borders */
  --ink-50:  #F6F7FC;    /* tinted surface */

  /* ---------- semantic: light mode (DEFAULT) ---------- */
  --surface:            #FFFFFF;   /* page background */
  --surface-tint:       #F6F7FC;   /* alternating sections, wells */
  --surface-raised:     #FFFFFF;   /* cards */
  --surface-overlay:    #FFFFFF;   /* popovers, modals */
  --surface-inverse:    #14113D;   /* dark accent sections on light pages */

  --text:               #14113D;   /* headings + emphasis */
  --text-body:          #3A3760;
  --text-secondary:     #63607F;
  --text-muted:         #8B89A6;
  --text-on-accent:     #FFFFFF;
  --text-link:          #5B3DF5;
  --text-link-hover:    #4B2FE0;

  --accent:             #5B3DF5;   /* primary interactive */
  --accent-hover:       #4B2FE0;
  --accent-soft:        #ECE7FF;   /* selected states, soft chips */
  --accent-brand:       #7C5CFF;   /* non-text brand moments */

  --live:               #0FBFA0;   /* live/success on light */
  --live-dot:           #19E3C2;   /* the pulsing live dot itself */
  --positive:           #0A7D6A;   /* success text */
  --positive-soft:      #D9FBF3;
  --negative:           #C2410C;   /* danger/negative text (coral family) */
  --negative-soft:      #FFE8E0;
  --warning:            #935F00;
  --warning-soft:       #FFF0D4;
  --info:               #1268C3;
  --info-soft:          #E0F0FF;

  --border:             #E4E6F1;
  --border-strong:      #CFD3E8;
  --border-focus:       #7C5CFF;

  /* ---------- charts (light) — use in this order ---------- */
  --chart-1: #7C5CFF;   /* violet    — primary series */
  --chart-2: #0FBFA0;   /* mint      — secondary / positive */
  --chart-3: #3E9CFF;   /* sky       */
  --chart-4: #FF7A59;   /* coral     */
  --chart-5: #FFB020;   /* amber     */
  --chart-6: #14113D;   /* ink       — reference/benchmark lines */
  --chart-grid:         #EDEEF6;
  --chart-axis-text:    #8B89A6;
  --chart-area-alpha:   0.12;      /* area fills = series color at 12% */

  /* ---------- gradients ---------- */
  --grad-hero: linear-gradient(100deg, #7C5CFF 0%, #9B82FF 28%, #19E3C2 62%, #3E9CFF 100%);
  --grad-cta:  linear-gradient(135deg, #6D4AFF 0%, #4B2FE0 100%);
  --grad-mesh-a: #7C5CFF;  /* mesh blob colors, see CI manual §3.4 */
  --grad-mesh-b: #19E3C2;
  --grad-mesh-c: #3E9CFF;
  --grad-mesh-d: #FF9E7A;  /* warm kiss — use sparingly, max 20% area */

  /* ---------- typography ---------- */
  --font-display: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --font-numeric: "Inter", system-ui, sans-serif; /* + font-feature-settings: "tnum" 1 */

  /* size / line-height / weight / letter-spacing — see CI manual §4 */
  --type-display-2xl: 300 5rem/1.05 var(--font-display);      /* 80px, ls -0.045em */
  --type-display-xl:  300 4rem/1.06 var(--font-display);      /* 64px, ls -0.04em  */
  --type-display-lg:  400 3rem/1.08 var(--font-display);      /* 48px, ls -0.035em */
  --type-h1:          500 2.5rem/1.15 var(--font-display);    /* 40px, ls -0.03em  */
  --type-h2:          500 2rem/1.19 var(--font-display);      /* 32px, ls -0.025em */
  --type-h3:          600 1.5rem/1.25 var(--font-display);    /* 24px, ls -0.02em  */
  --type-h4:          600 1.25rem/1.3 var(--font-display);    /* 20px, ls -0.015em */
  --type-body-lg:     400 1.125rem/1.56 var(--font-text);     /* 18px */
  --type-body:        400 1rem/1.63 var(--font-text);         /* 16px */
  --type-body-sm:     400 0.875rem/1.5 var(--font-text);      /* 14px */
  --type-caption:     400 0.8125rem/1.38 var(--font-text);    /* 13px */
  --type-eyebrow:     500 0.9375rem/1.33 var(--font-text);    /* 15px, violet, sentence case */

  --ls-display: -0.04em;
  --ls-heading: -0.025em;
  --ls-body: 0;

  /* ---------- radii ---------- */
  --radius-xs:   4px;    /* inputs, small chips, code blocks */
  --radius-sm:   6px;    /* dashboard controls */
  --radius-md:   8px;    /* dashboard cards, dropdowns */
  --radius-lg:   12px;   /* marketing cards */
  --radius-xl:   16px;   /* hero media frames, modals */
  --radius-pill: 999px;  /* buttons, pills, badges */

  /* ---------- shadows (light) ---------- */
  --shadow-xs: 0 1px 2px rgba(20, 17, 61, 0.06);
  --shadow-sm: 0 2px 5px -1px rgba(20, 17, 61, 0.08), 0 1px 1px rgba(20, 17, 61, 0.04);
  --shadow-md: 0 6px 16px -4px rgba(20, 17, 61, 0.10), 0 2px 4px -2px rgba(20, 17, 61, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(20, 17, 61, 0.18);
  --shadow-media: 0 30px 60px -12px rgba(20, 17, 61, 0.22), 0 18px 36px -18px rgba(91, 61, 245, 0.25);

  /* ---------- spacing (4px base) ---------- */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px; --space-20: 80px; --space-24: 96px;
  --space-32: 128px;
  --section-pad: clamp(64px, 9vw, 128px);   /* vertical section padding */
  --container: 1080px;                       /* content max-width */
  --container-wide: 1200px;

  /* ---------- motion ---------- */
  --dur-fast: 150ms;    /* hovers, toggles */
  --dur-base: 250ms;    /* dropdowns, tooltips */
  --dur-slow: 400ms;    /* cards, section reveals */
  --dur-hero: 700ms;    /* hero entrances, chart draw-ins */
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out:  cubic-bezier(0.45, 0, 0.25, 1);
  --ease-spring:  cubic-bezier(0.34, 1.4, 0.44, 1);  /* small elements only */

  color-scheme: light;
}

/* ============================================================
   DARK MODE — [data-theme="dark"] on <html> or any subtree.
   Dashboard: user-switchable, light is default.
   Website: dark used only for accent sections (footer CTA etc.)
   ============================================================ */
[data-theme="dark"] {
  --surface:            #0D0B22;
  --surface-tint:       #131030;
  --surface-raised:     #161334;
  --surface-overlay:    #1E1A40;
  --surface-inverse:    #FFFFFF;

  --text:               #F1F0FA;
  --text-body:          #C9C7DE;
  --text-secondary:     #A5A3C2;
  --text-muted:         #706E92;
  --text-on-accent:     #FFFFFF;
  --text-link:          #9B82FF;
  --text-link-hover:    #B7A3FF;

  --accent:             #7C5CFF;
  --accent-hover:       #9B82FF;
  --accent-soft:        rgba(124, 92, 255, 0.16);
  --accent-brand:       #9B82FF;

  --live:               #19E3C2;
  --live-dot:           #19E3C2;
  --positive:           #2BEECD;
  --positive-soft:      rgba(25, 227, 194, 0.12);
  --negative:           #FF9678;
  --negative-soft:      rgba(255, 122, 89, 0.14);
  --warning:            #FFC24D;
  --warning-soft:       rgba(255, 176, 32, 0.14);
  --info:               #6CB8FF;
  --info-soft:          rgba(62, 156, 255, 0.14);

  --border:             #262250;
  --border-strong:      #363168;
  --border-focus:       #9B82FF;

  --chart-1: #9B82FF;
  --chart-2: #19E3C2;
  --chart-3: #6CB8FF;
  --chart-4: #FF9678;
  --chart-5: #FFC24D;
  --chart-6: #E4E6F1;
  --chart-grid:         #211D48;
  --chart-axis-text:    #706E92;
  --chart-area-alpha:   0.16;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 5px -1px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 16px -4px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
  --shadow-media: 0 30px 60px -12px rgba(0, 0, 0, 0.6);

  color-scheme: dark;
}

/* ============================================================
   BASE COMPONENT RECIPES (reference implementations)
   ============================================================ */

/* Buttons — always pill-shaped */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 0.9375rem/1 var(--font-text);
  border-radius: var(--radius-pill);
  padding: 11px 20px;
  border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-standard),
              color var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard),
              transform var(--dur-fast) var(--ease-standard);
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--accent); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-link); }
.btn-ghost:hover { color: var(--text-link-hover); }

/* Arrow link (Stripe-style "Mehr lesen ›") */
.link-arrow { color: var(--text-link); font: 500 0.9375rem/1.4 var(--font-text); text-decoration: none; }
.link-arrow::after { content: "›"; margin-left: 5px; display: inline-block; transition: transform var(--dur-fast) var(--ease-standard); }
.link-arrow:hover::after { transform: translateX(3px); }

/* Cards */
.card {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-hover { transition: box-shadow var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard); }
.card-hover:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Eyebrow label */
.eyebrow { font: var(--type-eyebrow); color: var(--accent); margin: 0 0 12px; }

/* Live dot — the N3RA signature */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--live-dot);
  box-shadow: 0 0 0 0 rgba(25, 227, 194, 0.45);
  animation: n3ra-pulse 2.4s var(--ease-standard) infinite;
}
@keyframes n3ra-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(25, 227, 194, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(25, 227, 194, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 227, 194, 0); }
}

/* Tabular numbers for all financial figures */
.num { font-family: var(--font-numeric); font-feature-settings: "tnum" 1, "cv05" 1; font-variant-numeric: tabular-nums; }

/* Diagonal section divider (Stripe cut). Give sections position:relative + overflow guard. */
.section-diagonal { position: relative; }
.section-diagonal::before {
  content: ""; position: absolute; inset: -80px 0 auto 0; height: 160px;
  background: inherit; transform: skewY(-4deg); z-index: -1;
}

/* Animated mesh gradient (hero). See CI manual §3.4 for full recipe. */
.mesh {
  position: relative; overflow: hidden; background: #FFFFFF;
}
.mesh::before, .mesh::after {
  content: ""; position: absolute; width: 90vmax; height: 90vmax;
  border-radius: 50%; filter: blur(90px); opacity: 0.55; z-index: 0;
  will-change: transform;
}
.mesh::before {
  background: radial-gradient(closest-side, var(--grad-mesh-a), transparent 70%);
  top: -30vmax; right: -20vmax;
  animation: mesh-drift-a 26s var(--ease-in-out) infinite alternate;
}
.mesh::after {
  background: radial-gradient(closest-side, var(--grad-mesh-b), transparent 70%),
              radial-gradient(closest-side at 30% 70%, var(--grad-mesh-c), transparent 60%);
  bottom: -40vmax; left: -15vmax;
  animation: mesh-drift-b 32s var(--ease-in-out) infinite alternate;
}
@keyframes mesh-drift-a {
  from { transform: translate(0, 0) rotate(0deg) scale(1); }
  to   { transform: translate(-12vmax, 10vmax) rotate(40deg) scale(1.15); }
}
@keyframes mesh-drift-b {
  from { transform: translate(0, 0) rotate(0deg) scale(1); }
  to   { transform: translate(10vmax, -8vmax) rotate(-30deg) scale(1.1); }
}

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