/* PulseCap Ember — design tokens
   Dark default via :root + [data-theme="dark"].
   Light via [data-theme="light"].
   Compatibility aliases keep existing --c* / --txt* / --bg* consumers working. */

:root,
[data-theme="dark"] {
  color-scheme: dark;

  /* ── Ember core ─────────────────────────────────────── */
  --bg: #0A0A0B;
  --bg-elev: #141416;
  --bg-elev-2: #1C1C1F;

  --accent: #FF7A1A;
  --accent-press: #E86A0E;
  --accent-rgb: 255, 122, 26;
  --accent-text: var(--accent);
  /* Readable on bright --accent / --grad fills (~7:1 on #FF7A1A) */
  --on-accent: #1C1C1E;

  --success: #30D158;
  --success-text: var(--success);
  --caution: #FFD60A;
  --danger: #FF453A;

  --text: #F5F5F7;
  --text-2: #A1A1A6;
  --text-3: #8E8E93;

  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  /* ── Compatibility: brand / semantic ────────────────── */
  --c1: var(--accent-text);
  --c1-rgb: var(--accent-rgb);
  --c2: #FF9F0A;
  --c2-rgb: 255, 159, 10;
  --c3: var(--success);
  --c3-rgb: 48, 209, 88;
  --c4: var(--danger);
  --c4-rgb: 255, 69, 58;
  --c5: var(--caution);
  --c5-rgb: 255, 214, 10;

  --txt: var(--text);
  --txt2: var(--text-2);
  --txt3: var(--text-3);

  --bg2: var(--bg-elev);
  --bg3: var(--bg-elev-2);
  --bg4: #242428;

  --border: var(--line);
  --border2: var(--line-2);

  --grad: linear-gradient(128deg, #FF7A1A 0%, #E86A0E 55%, #FF9F0A 100%);

  /* ── Typography ─────────────────────────────────────── */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
  --font-display: var(--font);

  /* ── Safe area / chrome ─────────────────────────────── */
  --safe: env(safe-area-inset-bottom, 0px);
  --top-safe: env(safe-area-inset-top, 0px);
  --nav-h: 64px;

  /* ── Spacing (4 / 8 / 12 / 16 / 20 / 24 / 32) ────────── */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;

  --space-1: var(--s1);
  --space-2: var(--s2);
  --space-3: var(--s3);
  --space-4: var(--s4);
  --space-5: var(--s5);
  --space-6: var(--s6);
  --space-8: var(--s8);

  /* ── Radius ─────────────────────────────────────────── */
  --r-card: 16px;

  /* ── Motion ─────────────────────────────────────────── */
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --ease: var(--ease-ios);
  --dur-fast: 120ms;
  --dur-med: 250ms;

  /* ── Elevation ──────────────────────────────────────── */
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.24), 0 1px 3px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] {
  color-scheme: light;

  --bg: #F5F5F7;
  --bg-elev: #FFFFFF;
  --bg-elev-2: #EBEBED;

  --accent: #FF7A1A;
  --accent-press: #E86A0E;
  --accent-rgb: 255, 122, 26;
  /* Readable orange on light surfaces (~#C25100 family); fills keep --accent */
  --accent-text: #B44A00;
  --on-accent: #1C1C1E;

  --success: #248A3D;
  --success-text: #1B6E30;
  --caution: #A88700;
  --danger: #D70015;

  --text: #1C1C1E;
  --text-2: #6E6E73;
  --text-3: #5C5C60;

  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.14);

  --c1: var(--accent-text);
  --c1-rgb: var(--accent-rgb);
  --c2: #9F3F00;
  --c2-rgb: 159, 63, 0;
  --c3: var(--success);
  --c3-rgb: 36, 138, 61;
  --c4: var(--danger);
  --c4-rgb: 215, 0, 21;
  --c5: #7A6200;
  --c5-rgb: 122, 98, 0;

  --txt: var(--text);
  --txt2: var(--text-2);
  --txt3: var(--text-3);

  --bg2: var(--bg-elev);
  --bg3: var(--bg-elev-2);
  --bg4: #E1E1E6;

  --border: var(--line);
  --border2: var(--line-2);

  --grad: linear-gradient(128deg, #FF7A1A 0%, #E86A0E 55%, #FF9F0A 100%);

  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}


/* C-29 palette — raw hex allowed only in tokens.* (brand lock) */
:root {
  --pc-000000: #000000;
  --pc-00aaff: #00aaff;
  --pc-030508: #030508;
  --pc-059669: #059669;
  --pc-07131f: #07131f;
  --pc-0a0a0a: #0a0a0a;
  --pc-0a0a0c: #0a0a0c;
  --pc-0a0a0f: #0a0a0f;
  --pc-0a0e17: #0a0e17;
  --pc-0e0e0e: #0e0e0e;
  --pc-10b981: #10b981;
  --pc-111827: #111827;
  --pc-121212: #121212;
  --pc-131722: #131722;
  --pc-141412: #141412;
  --pc-141416: #141416;
  --pc-1a1a18: #1a1a18;
  --pc-1c1c1e: #1c1c1e;
  --pc-1e1e22: #1e1e22;
  --pc-242422: #242422;
  --pc-2563eb: #2563eb;
  --pc-34c759: #34c759;
  --pc-34d399: #34d399;
  --pc-35353a: #35353a;
  --pc-3b82f6: #3b82f6;
  --pc-4b5563: #4b5563;
  --pc-5a5a60: #5a5a60;
  --pc-5b8dee: #5b8dee;
  --pc-60a5fa: #60a5fa;
  --pc-6b7280: #6b7280;
  --pc-8a9098: #8a9098;
  --pc-9ca3af: #9ca3af;
  --pc-bf5af2: #bf5af2;
  --pc-c0c4c8: #c0c4c8;
  --pc-c41e3a: #c41e3a;
  --pc-c9a227: #c9a227;
  --pc-d8d0c4: #d8d0c4;
  --pc-e4ddd2: #e4ddd2;
  --pc-e8a020: #e8a020;
  --pc-f0ebe3: #f0ebe3;
  --pc-f0ede6: #f0ede6;
  --pc-f3f4f6: #f3f4f6;
  --pc-f4f0e8: #f4f0e8;
  --pc-f59e0b: #f59e0b;
  --pc-f5c842: #f5c842;
  --pc-f5f5f7: #f5f5f7;
  --pc-f7f7f9: #f7f7f9;
  --pc-f87171: #f87171;
  --pc-faf8f4: #faf8f4;
  --pc-fbbf24: #fbbf24;
  --pc-ff4444: #ff4444;
  --pc-ff453a: #ff453a;
  --pc-ff6b35: #ff6b35;
  --pc-ff7a1a: #ff7a1a;
  --pc-ff9f0a: #ff9f0a;
  --pc-ffd60a: #ffd60a;
  --pc-ffd700: #ffd700;
  --pc-ffffff: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    --dur-fast: 0ms;
    --dur-med: 0ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
