/* ==========================================================================
   Design-Tokens – die EINZIGE Stelle für Farben, Abstände, Schriften & Co.
   --------------------------------------------------------------------------
   Alle Bereiche benutzen nur diese Variablen, nie feste Werte. Wer die
   Akzentfarbe ändern will, ändert nur --accent – alle abgeleiteten Töne
   (--accent-soft, --accent-strong …) werden per color-mix() berechnet.
   ========================================================================== */

/* --- Schriften (lokal eingebunden, funktionieren also auch offline) ------- */
@font-face {
  font-family: 'Fraunces';
  src: url('../assets/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('../assets/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* --- Farben: hell ------------------------------------------------------ */
  --accent: #688c69;          /* ♥ Merles Lieblingsfarbe: Salbeigrün */
  --bg: #f8f6f0;              /* helles, warmes Creme statt reinem Weiß */
  --surface: #ffffff;         /* Karten, Sheets */
  --surface-2: #eff0e8;       /* leicht abgesetzte Flächen, Eingabefelder */
  --text: #232a24;
  --text-muted: #6d766b;
  --border: #e2e5da;

  --accent-strong: color-mix(in srgb, var(--accent) 78%, black);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, var(--bg));
  --accent-contrast: #ffffff;  /* Textfarbe AUF der Akzentfarbe */

  /* Zweitfarbe für kleine liebevolle Details (Herzen) – sanftes Rosé,
     das sich schön vom Salbeigrün abhebt. */
  --heart: #d98a7a;

  /* Kategorie-Farben (Karte). Gedämpft, damit sie zur Akzentfarbe passen. */
  --cat-essen: #e0905a;
  --cat-reise: #5b8db8;
  --cat-natur: #3f9584;       /* eher Blaugrün, damit es sich vom Salbei abhebt */
  --cat-erlebnis: #9a7cc4;
  --cat-moment: var(--heart);

  --danger: #c4493d;

  /* --- Schatten (warm getönt statt grau) --------------------------------- */
  --shadow-s: 0 1px 2px rgb(40 55 40 / 0.06), 0 2px 6px rgb(40 55 40 / 0.06);
  --shadow-m: 0 4px 12px rgb(40 55 40 / 0.08), 0 12px 32px rgb(40 55 40 / 0.08);
  --shadow-l: 0 12px 48px rgb(40 55 40 / 0.18);

  /* --- Typografie ------------------------------------------------------- */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --text-xs: 0.75rem;
  --text-s: 0.875rem;
  --text-m: 1rem;
  --text-l: 1.25rem;
  --text-xl: 1.75rem;
  --text-xxl: 2.5rem;

  /* --- Abstände (4er-Raster) -------------------------------------------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  /* --- Rundungen ------------------------------------------------------- */
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-pill: 999px;

  /* --- Bewegung ------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);       /* sanftes Abbremsen */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1); /* leichtes Nachfedern */
  --dur-fast: 150ms;
  --dur-m: 280ms;
  --dur-slow: 500ms;

  /* --- Layout ------------------------------------------------------- */
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --content-max: 560px;       /* auf großen Bildschirmen nicht zu breit */
}

/* --- Farben: dunkel (folgt automatisch der Systemeinstellung) ------------ */
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #9dbb98;
    --bg: #151917;
    --surface: #1f2420;
    --surface-2: #282e29;
    --text: #eef1ec;
    --text-muted: #9aa597;
    --border: #343b35;
    --accent-strong: color-mix(in srgb, var(--accent) 85%, white);
    --accent-contrast: #16241a;
    --heart: #e8a091;

    --cat-essen: #e9a172;
    --cat-reise: #78a6cf;
    --cat-natur: #5fb5a3;
    --cat-erlebnis: #b096d6;

    --shadow-s: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow-m: 0 4px 16px rgb(0 0 0 / 0.35);
    --shadow-l: 0 12px 48px rgb(0 0 0 / 0.5);
  }
}

/* Wer Bewegung reduziert haben möchte (Systemeinstellung), bekommt keine
   Animationen – alle Dauer-Variablen werden quasi auf 0 gesetzt. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 1ms;
    --dur-m: 1ms;
    --dur-slow: 1ms;
  }
}
