/* ============================================================
   Earshot design tokens — single source of truth.
   Dark theme only (spec v2.0 §2.5). No component file may
   hardcode a color, spacing, radius, shadow, or duration
   that exists here.
   Phase 2: the flip lands — electric blue/cyan is primary,
   violet is the restrained secondary (Phase 0 spec §1).
   ============================================================ */
:root {
  /* ---- Surfaces: deep charcoal, blue-neutral (flips #14121a) */
  --bg-0:        #080a0e;  /* page backdrop / sheet scrim base      */
  --bg:          #0d1015;  /* app background                        */
  --bg-glow:     #18222f;  /* body radial glow stop                 */
  --surface-1:   #151a23;  /* cards (was --card #1e1b28)            */
  --surface-2:   #1d2531;  /* raised/inset (was --card-2 #262233)   */
  --surface-3:   #283242;  /* hover, chips on surface-2             */
  --scrim:       rgba(4, 6, 10, 0.72); /* sheet backdrop          */

  /* ---- Primary accent: electric blue/cyan (flips #b18cff)   */
  --accent:        #35b6f6;
  --accent-bright: #6fd3ff;  /* glows, live highlights              */
  --accent-ink:    #052a3d;  /* text ON accent buttons              */
  --accent-soft:   rgba(53, 182, 246, 0.14); /* active pill fills   */

  /* ---- Secondary accent: restrained violet (demoted)        */
  --accent-2:       #9385f2;
  --accent-2-soft:  rgba(147, 133, 242, 0.13);

  /* ---- Text                                                  */
  --text-1: #f2f5f9;  /* soft white primary                      */
  --text-2: #9aa7b8;  /* muted gray secondary                    */
  --text-3: #647284;  /* faint: timestamps, placeholders, legal  */

  /* ---- Semantic                                              */
  --danger:   #ff7a7a;  /* errors, destructive                   */
  --positive: #2ea88a;  /* Confirm "yes" active                  */
  --negative: #b0403c;  /* Confirm "no" active                   */
  --warning:  #ffb454;  /* unconfirmed state, cooldown notices   */
  --live:     #ff5252;  /* live dot/badge                        */

  /* ---- Lines                                                 */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* ---- Typography                                            */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --fs-display: 1.375rem;  /* 22px — hub current place, sheets      */
  --fs-title:   1.125rem;  /* 18px — view titles, step titles       */
  --fs-body:    1rem;      /* 16px — Earshot text, inputs (≥16px
                              also prevents iOS focus zoom)         */
  --fs-body-sm: 0.9375rem; /* 15px — echo text, sheet inputs        */
  --fs-meta:    0.8125rem; /* 13px — meta lines, pills, buttons     */
  --fs-caption: 0.75rem;   /* 12px — chips, counts, footnotes       */
  --fs-micro:   0.6875rem; /* 11px — badges, tab labels             */
  --fw-regular: 400;
  --fw-medium:  600;
  --fw-bold:    700;
  --fw-black:   800;
  --lh-body: 1.5;
  --lh-tight: 1.35;

  /* ---- Spacing: 4-pt 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;

  /* ---- Radii                                                 */
  --r-sm: 8px;     /* inputs, small tiles                         */
  --r-md: 12px;    /* inset panels, image cards                   */
  --r-lg: 16px;    /* Earshot cards                               */
  --r-xl: 20px;    /* sheet top corners                           */
  --r-full: 999px; /* pills, primary buttons                      */

  /* ---- Shadows & glow                                        */
  --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-pop:   0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-sheet: 0 -12px 32px rgba(0, 0, 0, 0.50);
  --glow-accent:  0 0 24px rgba(53, 182, 246, 0.35); /* brand mark */

  /* ---- Motion: subtle only (spec §2.5)                       */
  --t-fast: 120ms ease-out;  /* pill toggles, fades                 */
  --t-med:  220ms ease-out;  /* sheet rise (matches sheet-up .22s)  */
  --t-slow: 300ms ease;      /* card removal fade                   */

  /* ---- Layers                                                */
  --z-base: 0;
  --z-sticky: 30;   /* topbar                                        */
  --z-tabbar: 40;   /* bottom navigation                             */
  --z-sheet: 50;    /* bottom sheets                                 */
  --z-composer: 60; /* composer sheet sits above the tab bar         */
  --z-toast: 80;
  --z-gate: 90;     /* age affirmation gate (P4)                     */

  /* ---- Safe areas & app chrome (require viewport-fit=cover)  */
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
  --tabbar-h: 60px;
  --view-pad-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--sp-4));

  /* ---- Layout                                                */
  --content-max: 720px; /* desktop feed target 680–760px (spec §4) */
  --rail-w: 300px;      /* desktop secondary panel (≥1100px)        */
  --sheet-max: 560px;   /* centered sheet width on tablet/desktop   */
}

/* Legacy aliases — kept for one release so component rules written
   against the Phase B names keep resolving after the flip. */
:root {
  --card: var(--surface-1);
  --card-2: var(--surface-2);
  --text: var(--text-1);
  --muted: var(--text-2);
}
