/* Mergify Design Standard v1 — tokens.css
   Single source of design tokens for HTML/WebView apps and web artifacts.
   Dark-first: dark palette is the default; light is an explicit opt-in via
   [data-theme="light"] on <html>. Never hard-code colors/spacing in app CSS —
   reference these variables. Values follow Material 3 roles + M3 Expressive
   shape/type direction, hand-tuned for Jim's dark premium apps (PepVault pilot).
   Source basis: https://m3.material.io (color roles, type scale, shape scale,
   motion tokens) — see ../../RESEARCH.md.
   CHANGE 2026-11-12 (PepVault v1.7 / Fiona design audit): DANGER PAIR FIX.
   The old pair — white text on solid --danger #f87171 — computes 2.77:1, a
   WCAG AA failure in every kit app. Standard now: destructive controls use
   the --danger-dim fill + --danger text pair (6.90:1 on the dark bg), or the
   new solid pair --danger-solid #d13438 + --danger-solid-ink #ffffff
   (4.93:1). Never put white text on a solid --danger fill. Colors only;
   no other token changed. */

:root {
  /* ---- Color (dark-first, M3 roles) ---- */
  --bg:            #0b1017;  /* background */
  --surface:       #111927;  /* surface */
  --surface-1:     #16202f;  /* surface-container-low */
  --surface-2:     #1b2839;  /* surface-container */
  --surface-3:     #22334a;  /* surface-container-high */
  --on-surface:    #e6eef7;  /* on-surface */
  --on-variant:    #9db0c5;  /* on-surface-variant */
  --outline:       #2c3e55;  /* outline-variant */
  --primary:       #2dd4bf;  /* teal accent (fleet accent) */
  --primary-ink:   #062a26;  /* text on primary */
  --primary-dim:   rgba(45, 212, 191, .14);
  --accent-grad:   linear-gradient(135deg, #14b8a6, #2dd4bf 55%, #67e8f9);
  --success:       #34d399;
  --warning:       #fbbf24;
  --danger:        #f87171;  /* danger TEXT/accent only — never a fill under white text (2.77:1, AA fail) */
  --danger-dim:    rgba(248, 113, 113, .13);  /* destructive fill, paired with --danger text (6.90:1) */
  --danger-solid:  #d13438;  /* solid destructive fill, paired with --danger-solid-ink (4.93:1) */
  --danger-solid-ink: #ffffff;
  --scrim:         rgba(3, 7, 12, .62);

  /* ---- Spacing (4pt scale) ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --page-pad: var(--sp-4);
  --tap-min: 44px; /* minimum touch target */

  /* ---- Radius (M3 shape scale, Expressive leans larger) ---- */
  --r-xs: 4px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --r-xl: 20px; --r-2xl: 28px; --r-full: 999px;

  /* ---- Elevation (shadow levels 1–3, dark-tuned) ---- */
  --el-1: 0 1px 2px rgba(0,0,0,.35), 0 1px 6px rgba(0,0,0,.22);
  --el-2: 0 4px 10px rgba(0,0,0,.38), 0 2px 4px rgba(0,0,0,.25);
  --el-3: 0 10px 28px rgba(0,0,0,.5),  0 4px 8px rgba(0,0,0,.3);

  /* ---- Type scale (M3 roles, system font stack — offline safe) ---- */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --fs-display: 28px; --lh-display: 34px;
  --fs-title:   20px; --lh-title:   26px;
  --fs-heading: 16px; --lh-heading: 22px;
  --fs-body:    15px; --lh-body:    21px;
  --fs-label:   13px; --lh-label:   18px;
  --fs-caption: 12px; --lh-caption: 16px;

  /* ---- Motion ----
     Durations follow M3: short 50–200ms (micro), medium 250–400ms (screens),
     long 450–600ms (large surfaces). Product UI in this fleet: stay ≤300ms
     except sheets/hero moments. Animate transform + opacity ONLY. */
  --dur-1: 90ms;   /* press feedback */
  --dur-2: 160ms;  /* chips, toggles, small fades */
  --dur-3: 240ms;  /* screen transitions, list items */
  --dur-4: 320ms;  /* sheets, container transforms */
  --dur-5: 480ms;  /* hero / success moments only */
  /* M3 easings (official web conversions, m3.material.io/styles/motion) */
  --ease-standard:        cubic-bezier(0.2, 0, 0, 1);
  --ease-emphasized:      cubic-bezier(0.2, 0, 0, 1);
  --ease-emph-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
  --ease-emph-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  /* Spring approximations. True M3 Expressive springs are physics
     (spatial default: dampingRatio 0.8 / stiffness 380; fast: 0.6 / 800) —
     CSS cannot run them, so these cubic-beziers approximate the feel:
     a slight overshoot for spatial moves, none for fades/color. */
  --ease-spring:        cubic-bezier(0.34, 1.35, 0.44, 1);  /* spatial, gentle overshoot */
  --ease-spring-snappy: cubic-bezier(0.3, 1.6, 0.5, 1);     /* fast spatial */
  --ease-out:           cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out:        cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h: 64px; /* fixed bottom navigation height */
}

[data-theme="light"] {
  --bg: #f4f7fa; --surface: #ffffff; --surface-1: #eef3f8;
  --surface-2: #e5edf4; --surface-3: #d9e4ef;
  --on-surface: #12202f; --on-variant: #4d627a; --outline: #c3d2e0;
  --primary: #0d9488; --primary-ink: #ffffff;
  --primary-dim: rgba(13, 148, 136, .12);
  --scrim: rgba(18, 32, 47, .45);
  --el-1: 0 1px 2px rgba(18,32,47,.08), 0 1px 6px rgba(18,32,47,.06);
  --el-2: 0 4px 10px rgba(18,32,47,.1), 0 2px 4px rgba(18,32,47,.07);
  --el-3: 0 10px 28px rgba(18,32,47,.16), 0 4px 8px rgba(18,32,47,.09);
}
