/* ==========================================================================
   Design tokens — domain / Benaro Finanzen
   Level 1: primitives (raw values, never used directly in components)
   Level 2: semantic   (what the value is FOR — use these in components)
   Level 3: component  (lives in site.css: .zf-btn, .zf-card, …)
   Showcase: design-system.html
   ========================================================================== */

:root {
  /* ---------- 1. Primitives ---------------------------------------------- */

  /* Forest — brand green, dark → light */
  --forest-950: #1F3A2E;
  --forest-900: #2A4A3B;
  --forest-800: #33503F;
  --forest-700: #3F6B4C;
  --forest-500: #5E8C6A;
  --forest-300: #B5C7B9;
  --forest-200: #D5E6DB;
  --forest-100: #E7F0EA;
  --forest-50:  #F0F6F2;

  /* RGB channels for alpha: rgb(var(--forest-950-rgb) / .12) */
  --forest-950-rgb: 31 58 46;
  --forest-500-rgb: 94 140 106;

  /* Sand — warm neutrals */
  --white:    #FFFFFF;
  --sand-50:  #F3F5F1;
  --sand-100: #E4EBE6;
  --sand-200: #DDE3DC;
  --sand-300: #C9D2C9;
  --sand-500: #8A978D;
  --sand-600: #5E6E63;
  --sand-900: #2B2F2C;

  /* Gold — call to action */
  --gold-500: #C49A2C;
  --gold-600: #AD8726;
  --gold-100: #F6EDD4;

  /* Status */
  --red-600: #B23A2B;
  --red-50:  #FDECEC;
  --success-100: #E4F0E8;

  /* ---------- 2. Semantic: colour ---------------------------------------- */

  --color-bg:                   var(--sand-50);
  --color-surface:              var(--white);
  --color-surface-hover:        var(--sand-100);
  --color-surface-inverse:      var(--forest-950);
  --color-surface-inverse-raised: var(--forest-900);

  --color-text:                 var(--sand-900);
  --color-heading:              var(--forest-950);
  --color-text-muted:           var(--sand-600);
  --color-text-inverse:         var(--sand-50);
  --color-text-inverse-muted:   var(--forest-300);

  --color-border:               var(--sand-200);
  --color-border-subtle:        rgb(var(--forest-950-rgb) / .1);
  --color-border-strong:        var(--forest-950);
  --color-border-inverse:       var(--forest-800);

  --color-accent:               var(--forest-500);   /* icons, lines, large text */
  --color-accent-text:          var(--forest-700);   /* small text on light bg (AA 4.5:1) */
  --color-accent-soft:          var(--forest-100);
  --color-accent-soft-2:        var(--forest-200);

  --color-cta:                  var(--gold-500);
  --color-cta-hover:            var(--gold-600);
  --color-cta-text:             var(--forest-950);

  --color-success:              var(--forest-700);
  --color-success-soft:         var(--success-100);
  --color-danger:               var(--red-600);
  --color-danger-soft:          var(--red-50);

  --color-focus:                var(--gold-500);

  /* ---------- 2. Semantic: type ------------------------------------------ */

  --font-sans:  Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;

  --text-xs:   .78rem;
  --text-sm:   .9rem;
  --text-md:   1rem;
  --text-lg:   1.15rem;
  --text-xl:   clamp(1.3rem, 2vw, 1.75rem);
  --text-2xl:  clamp(2.2rem, 4vw, 3.6rem);
  --text-3xl:  clamp(3rem, 6.4vw, 5.8rem);

  --leading-tight: 1.05;
  --leading-snug:  1.3;
  --leading-body:  1.6;

  --tracking-display: -0.045em;
  --tracking-heading: -0.028em;
  --tracking-caps:    .14em;

  /* ---------- 2. Semantic: space, radius, shadow ------------------------- */

  --space-1: 4px;  --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 24px; --space-6: 32px;  --space-7: 48px;  --space-8: 64px;
  --space-9: 88px; --space-10: 120px;

  --radius-sm:   12px;
  --radius-md:   16px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-2xl:  36px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(var(--forest-950-rgb) / .04);
  --shadow-md: 0 18px 40px -18px rgb(var(--forest-950-rgb) / .3);
  --shadow-lg: 0 30px 60px -30px rgb(var(--forest-950-rgb) / .35);

  --container: 1280px;

  /* ---------- 2. Semantic: motion ---------------------------------------- */

  --ease-out:    cubic-bezier(.16, 1, .3, 1);    /* default: quick start, soft landing */
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1); /* small overshoot, for pops */

  --dur-fast:   150ms;
  --dur-base:   300ms;
  --dur-slow:   600ms;
  --dur-reveal: 900ms;

  --reveal-distance: 32px;
  --reveal-stagger:  80ms;
}

/* ---------- Legacy aliases (old --zf-* names still used in site.css) ----- */
:root {
  --zf-ink:        var(--color-heading);
  --zf-ink-2:      var(--color-text-muted);
  --zf-mute:       var(--color-text-muted);
  --zf-line:       var(--color-border);
  --zf-bg:         var(--color-bg);
  --zf-card:       var(--color-surface);
  --zf-green:      var(--color-accent);
  --zf-green-deep: var(--color-surface-inverse);
  --zf-mint:       var(--color-accent-soft);
  --zf-gold:       var(--color-cta);
  --zf-radius:     var(--radius-xl);
  --zf-serif:      var(--font-serif);
  --zf-sans:       var(--font-sans);
  --zf-ease:       var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-reveal: 0ms; --reveal-distance: 0px; }
}

/* ==========================================================================
   v2 — "Ruhiges Kassenbuch"
   A calm household ledger: serif headlines like a printed statement,
   monospace figures like a receipt, ruled paper, dotted leaders, a gold
   marker for the one thing that matters. Used by styles/ds.css.
   ========================================================================== */
:root {
  /* Paper */
  --cream-50:  #FAF8F2;
  --cream-100: #F2EEE2;
  --cream-200: #E6E0CF;

  --color-paper:        var(--cream-50);   /* receipts, forms, insets */
  --color-paper-deep:   var(--cream-100);
  --color-rule:         rgb(var(--forest-950-rgb) / .07);  /* ruled-paper lines */
  --color-rule-strong:  rgb(var(--forest-950-rgb) / .14);  /* dividers, leaders */
  --color-rule-inverse: rgb(255 255 255 / .1);
  --color-marker:       rgb(196 154 44 / .34);              /* gold highlighter */
  --color-shot-shadow:  rgb(var(--forest-950-rgb) / .22);

  /* Type families */
  --font-display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Type scale v2 (fluid) */
  --fs-display: clamp(2.9rem, 5.5vw, 5.4rem);
  --fs-h2:      clamp(2.5rem, 5vw, 4.5rem);
  --fs-h3:      clamp(1.8rem, 2.8vw, 2.5rem);   /* serif sub-heads */
  --fs-title:   1.25rem;                         /* sans card titles */
  --fs-lead:    clamp(1.1rem, 1.35vw, 1.25rem);
  --fs-body:    1.0625rem;
  --fs-small:   .9375rem;
  --fs-meta:    .75rem;
  --fs-figure:  clamp(2.4rem, 4.2vw, 3.6rem);    /* big numbers */

  --lh-display: .98;
  --lh-heading: 1.04;
  --lh-body:    1.65;
  --tracking-serif: -0.012em;
  --tracking-meta:  .09em;

  /* Layout */
  --page-max:  1320px;
  --gutter:    clamp(16px, 4vw, 48px);
  --col-gap:   clamp(16px, 2vw, 28px);
  --section-y: clamp(88px, 11vw, 168px);
  --header-h:  76px;

  /* Media slot ratios */
  --ratio-pano:     21 / 9;
  --ratio-wide:     16 / 9;
  --ratio-photo:    4 / 3;
  --ratio-portrait: 4 / 5;
  --ratio-square:   1 / 1;

  /* Layers */
  --z-header: 60;
  --z-overlay: 80;
  --z-progress: 90;
}

/* ---------- v2.1 — pictograms, header & footer ------------------------- */
:root {
  /* Pictogram inks (same recipe as the step illustrations:
     mint ground circle + paper/green/gold fills + ink line) */
  --pi-ground: #DCEADF;
  --pi-ink:    var(--color-heading);
  --pi-paper:  var(--color-paper);
  --pi-green:  var(--color-accent);
  --pi-gold:   var(--color-cta);

  /* Header: a printed label stuck on the page */
  --label-bg:     var(--cream-50);
  --label-ink:    var(--forest-950);
  --label-shadow: 4px 4px 0 var(--forest-950);

  /* Footer: kraft paper with a receipt on top */
  --kraft-100: #EFE8D6;
  --kraft-200: #E5DBC2;
  --kraft-300: #D3C6A4;
  --receipt:   #FFFEF9;
}
