/* ============================================================
   pulse — design tokens
   One accent (warm coral), one radius language, tinted neutrals.
   Dark is the default surface; light + auto are opt-in.
   ============================================================ */

:root {
  /* Type ------------------------------------------------------ */
  --font-ui: "General Sans", ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "Cascadia Code",
    monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.375rem;
  --text-xl: 1.875rem;
  /* The clock is the centerpiece: thin, tabular, room-scaled. */
  --text-clock: clamp(4.25rem, 17vw, 11rem);

  --tracking-tight: -0.04em;
  --tracking-snug: -0.015em;
  --tracking-wide: 0.18em;

  /* Spacing (4px base) --------------------------------------- */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 2.5rem;
  --s8: 3rem;
  --s10: 4rem;
  --s12: 6rem;

  /* Radii (locked language) ---------------------------------- */
  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-full: 999px;

  /* Z-index (semantic scale, never 9999) --------------------- */
  --z-ambient: 0;
  --z-base: 1;
  --z-raised: 10;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 800;
  --z-modal: 900;
  --z-toast: 1000;
  --z-tooltip: 1100;

  /* Motion --------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.32, 1.4, 0.4, 1);
  --dur-1: 120ms;
  --dur-2: 220ms;
  --dur-3: 420ms;
  --dur-slow: 820ms;

  /* The single accent, used identically everywhere ----------- */
  --accent: #ff6b61;
  --accent-bright: #ff8579;
  --accent-deep: #e0544b;
  --accent-ink: #1a0f0e; /* text that sits on top of --accent */
  --accent-soft: rgba(255, 107, 97, 0.14);
  --accent-glow: rgba(255, 107, 97, 0.26);
  --accent-glow-0: rgba(255, 107, 97, 0); /* accent at 0 alpha, for ring fades */
  --danger: var(--accent); /* destructive text/buttons; pinned in light below */
}

/* ---- Dark (default) ---------------------------------------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f14;
  --bg-1: #14151c;
  --bg-2: #191b24;
  --bg-3: #22242f;
  --bg-inset: #0a0b0f;

  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.16);

  --ink: #f4f1ec;      /* primary text  ~15:1 on --bg */
  --ink-1: #c2c3cf;    /* secondary     ~9:1 */
  --ink-2: #8d8f9d;    /* labels (large/▲3:1) */
  --ink-3: #5b5d6c;    /* faint, decorative only */

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.34);
  --shadow-2: 0 8px 24px rgba(0, 0, 0, 0.46), 0 24px 60px rgba(0, 0, 0, 0.42);
  --shadow-pop: 0 2px 8px rgba(0, 0, 0, 0.5), 0 18px 50px rgba(0, 0, 0, 0.55);

  --field: #16171f;
  --field-focus: #1b1d27;
}

/* ---- Light ------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f4;       /* cool paper, never cream, never pure white */
  --bg-1: #f6f7f9;
  --bg-2: #ffffff;
  --bg-3: #eceef3;
  --bg-inset: #e6e8ee;

  --line: rgba(18, 20, 28, 0.08);
  --line-2: rgba(18, 20, 28, 0.12);
  --line-strong: rgba(18, 20, 28, 0.18);

  --ink: #16181f;      /* ~16:1 on --bg */
  --ink-1: #41454f;    /* ~8.5:1 */
  --ink-2: #646874;    /* labels ▲4.5:1 */
  --ink-3: #9aa0ad;

  --accent-ink: #fff6f5;
  --accent-soft: rgba(224, 84, 75, 0.12);
  --accent-glow: rgba(224, 84, 75, 0.2);

  --shadow-1: 0 1px 2px rgba(20, 22, 34, 0.08), 0 4px 14px rgba(20, 22, 34, 0.08);
  --shadow-2: 0 10px 30px rgba(20, 22, 34, 0.12), 0 30px 70px rgba(20, 22, 34, 0.1);
  --shadow-pop: 0 2px 10px rgba(20, 22, 34, 0.12), 0 20px 50px rgba(20, 22, 34, 0.16);

  --field: #ffffff;
  --field-focus: #ffffff;
}

/* Light mode leans on the deeper coral so accent text keeps contrast. */
:root[data-theme="light"] {
  --accent: #e0544b;
  --accent-bright: #ff6b61;
  --accent-deep: #c2433b;
  /* Pinned deeper red so destructive text passes AA on the light surface. */
  --danger: #b23a32;
}
