/* =====================================================================
   Sensory Revolution — Design tokens  (v1, 2026-11)
   Shared by the public site (app.css) and the backoffice (admin.css).

   Three tiers:
     1. Primitives   --{family}-{step}        raw values, never used by components directly
     2. Semantic     --color-*, --text-*, …    meaning ("text", "accent", "surface")
     3. Component    declared next to the component (e.g. --btn-h)

   Rules
   - Components use semantic tokens only. Need a new value? Add a token here first.
   - Motion: UI ≤ 300 ms, ease-out to enter/exit, ease-in-out to move on screen,
     never ease-in. Marketing reveals may run longer (--dur-reveal).
   - Docs: docs/DESIGN-SYSTEM.md · live reference: /admin/design
   ===================================================================== */

:root {
  /* ── 1. Primitives ─────────────────────────────────────────────── */
  /* Brand orange (coral). 500 = accent for icons/large shapes; 700 = text/buttons (AA on white) */
  --orange-50:  #fff4ee;
  --orange-100: #ffe6d9;
  --orange-300: #ffb08c;
  --orange-400: #ff9966;
  --orange-500: #ff7a45;
  --orange-600: #ea5f2e;
  --orange-700: #c64a1d;
  --orange-800: #a73a16;

  /* Ink — neutral greys (Apple-like: warm-neutral, no blue cast) */
  --black:   #000000;
  --ink-950: #1d1d1f;   /* text */
  --ink-900: #2a2a2d;   /* raised surface on black */
  --ink-800: #3a3a3c;
  --ink-700: #424245;   /* secondary text (≈10:1 on white) */
  --ink-500: #6e6e73;   /* muted text (≈5:1 on white, AA) */
  --ink-400: #86868b;   /* placeholders, disabled */
  --ink-300: #d2d2d7;   /* field borders */
  --ink-200: #e8e8ed;
  --ink-100: #f0f0f3;
  --ink-50:  #f5f5f7;   /* paper */
  --white:   #ffffff;

  /* Secondary green */
  --green-50:  #eafff8;
  --green-500: #14b88a;
  --green-700: #08745a;

  /* Status */
  --red-600:   #d92d20;
  --red-50:    #fef3f2;
  --amber-600: #b54708;
  --amber-50:  #fffaeb;
  --blue-600:  #2563eb;
  --blue-50:   #eff4ff;

  /* ── 2. Semantic: color ────────────────────────────────────────── */
  --color-bg:            var(--ink-50);
  --color-surface:       var(--white);
  --color-surface-sunken:var(--ink-100);
  --color-surface-inverse:var(--black);
  --color-text:          var(--ink-950);
  --color-text-secondary:var(--ink-700);
  --color-text-muted:    var(--ink-500);
  --color-text-inverse:  var(--white);
  --color-border:        color-mix(in srgb, var(--ink-950) 10%, transparent);
  --color-border-strong: var(--ink-300);
  --color-accent:        var(--orange-500);   /* action fill — use with --color-on-accent text */
  --color-accent-hover:  var(--orange-600);
  --color-on-accent:     var(--ink-950);      /* ink on coral ≈ 7:1 (AA) */
  --color-accent-text:   var(--ink-950);      /* links/emphasis stay ink (Apple-like); coral is for fills and dots only */
  --color-accent-bright: var(--orange-500);   /* decorative: dots, bullets, charts */
  --color-accent-soft:   color-mix(in srgb, var(--orange-500) 10%, transparent);
  --color-success:       var(--green-700);
  --color-success-soft:  var(--green-50);
  --color-danger:        var(--red-600);
  --color-danger-soft:   var(--red-50);
  --color-warning:       var(--amber-600);
  --color-warning-soft:  var(--amber-50);
  --color-focus:         var(--orange-600);
  --color-material:      color-mix(in srgb, var(--ink-50) 72%, transparent);   /* translucent chrome */
  --color-scrim:         color-mix(in srgb, var(--ink-950) 45%, transparent);

  /* ── Typography ────────────────────────────────────────────────── */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Static scale (UI). rem so it follows the user's font size. */
  --text-2xs: 0.75rem;     /* 12 */
  --text-xs:  0.8125rem;   /* 13 */
  --text-sm:  0.875rem;    /* 14 */
  --text-md:  0.9375rem;   /* 15 */
  --text-base:1rem;        /* 16 */
  --text-lg:  1.0625rem;   /* 17 — body copy on the site */
  --text-xl:  1.1875rem;   /* 19 */
  --text-2xl: 1.375rem;    /* 22 */
  --text-3xl: 1.625rem;    /* 26 */
  --text-4xl: 2.125rem;    /* 34 */
  --text-5xl: 2.75rem;     /* 44 */
  /* Fluid display scale (marketing headings) */
  --text-h3:      clamp(1.25rem, 1.6vw, 1.5rem);
  --text-h2:      clamp(1.8rem, 3.4vw, 2.75rem);
  --text-h1:      clamp(2.25rem, 5vw, 3.75rem);
  --text-display: clamp(2.4rem, 5.4vw, 4.4rem);

  --weight-regular: 400;
  --weight-medium:  500;
  --weight-semibold:600;
  --weight-bold:    700;
  --weight-heavy:   800;

  --leading-tight:  1.05;   /* display */
  --leading-snug:   1.2;    /* headings */
  --leading-normal: 1.5;    /* UI */
  --leading-relaxed:1.6;    /* long-form body */

  /* Tracking is size-specific: negative as type grows, slightly open when small */
  --tracking-display: -0.04em;
  --tracking-heading: -0.025em;
  --tracking-tight:   -0.012em;
  --tracking-normal:  0;
  --tracking-small:   0.01em;

  /* ── Spacing (4 px base) ───────────────────────────────────────── */
  --space-0-5: 0.125rem;  /* 2 */
  --space-1:   0.25rem;   /* 4 */
  --space-2:   0.5rem;    /* 8 */
  --space-3:   0.75rem;   /* 12 */
  --space-4:   1rem;      /* 16 */
  --space-5:   1.25rem;   /* 20 */
  --space-6:   1.5rem;    /* 24 */
  --space-8:   2rem;      /* 32 */
  --space-10:  2.5rem;    /* 40 */
  --space-12:  3rem;      /* 48 */
  --space-16:  4rem;      /* 64 */
  --space-section: clamp(3.5rem, 8vw, 6.5rem);
  --gutter:    clamp(1rem, 3vw, 1.375rem);
  --container: 1180px;

  /* ── Radius ────────────────────────────────────────────────────── */
  --radius-xs:   6px;
  --radius-sm:   12px;
  --radius-md:   16px;
  --radius-lg:   22px;
  --radius-xl:   28px;
  --radius-2xl:  32px;
  --radius-pill: 999px;

  /* ── Elevation (only for things that really float) ─────────────── */
  --shadow-1: 0 1px 2px color-mix(in srgb, var(--ink-950) 6%, transparent);
  --shadow-2: 0 8px 24px -8px color-mix(in srgb, var(--ink-950) 14%, transparent);
  --shadow-3: 0 18px 40px -12px color-mix(in srgb, var(--ink-950) 22%, transparent);
  --shadow-4: 0 28px 64px -16px color-mix(in srgb, var(--ink-950) 32%, transparent);

  /* ── Motion ────────────────────────────────────────────────────── */
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);     /* enter / exit, default */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);    /* move on screen */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);     /* sheets, drawers */
  --ease-hover:  ease;                               /* color / background only */
  /* Spring-like settle for rare, momentum-y moments (≈ bounce 0.2) */
  --ease-spring: linear(0, 0.157 4.4%, 0.533 11.4%, 0.875 19.7%, 1.032 26.6%, 1.081 32.6%, 1.068 40.5%, 1.009 55.6%, 0.995 66.3%, 1);

  --dur-instant: 100ms;   /* color swaps */
  --dur-press:   160ms;   /* :active feedback */
  --dur-fast:    200ms;   /* tooltips, small popovers, fades */
  --dur-base:    250ms;   /* dropdowns, cards, sheets */
  --dur-slow:    400ms;   /* modals, drawers, page transitions */
  --dur-reveal:  600ms;   /* marketing scroll reveals only */
  --stagger:     60ms;

  --press-scale: 0.97;
  --lift:        -4px;    /* card hover lift (fine pointers only) */
  --reveal-y:    20px;

  /* ── Layers ────────────────────────────────────────────────────── */
  --z-header: 50;
  --z-sticky: 60;
  --z-overlay: 80;
  --z-toast: 90;
}

/* Reduced motion: fewer, gentler — keep opacity, drop movement. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-reveal: 200ms;
    --reveal-y: 0px;
    --lift: 0px;
    --press-scale: 1;
    --stagger: 0ms;
  }
}
