/* ctrlhr-ui/tokens.css: the ONLY place raw values may appear */
:root {
  /* Brand (locked) */
  --brand-navy: #24205B;
  --brand-navy-deep: #07052B;
  --brand-magenta: #8A1D5C;
  --brand-pink: #BB2177;
  --brand-purple: #605BA0;

  /* Semantic (light) */
  --surface-page: #F6F6FB;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-sunken: #EFEFF7;
  --text-primary: #171717;
  --text-secondary: #4B4B63;
  /* --text-muted was #8888A3 until 2026-09-25: 3.44:1 on --surface and
     3.01:1 on --surface-sunken, under AA. #6A6A86 keeps the hue and reads
     5.23:1 on --surface, 4.85:1 on --surface-page, 4.57:1 on
     --surface-sunken. The app-shell table header reads it too. */
  --text-muted: #6A6A86;
  --text-on-brand: #FFFFFF;
  --heading: var(--brand-navy);
  --accent: var(--brand-magenta);
  --accent-soft: rgba(138, 29, 92, 0.10);
  --border-subtle: rgba(36, 32, 91, 0.10);
  --focus-ring: rgba(96, 91, 160, 0.55);

  /* Status.
     --success and --warning were darkened on 2026-07-29. Each status color is
     paired with a ~12% tint of itself as a chip background, and measured on
     that tint the originals failed AA:

       --warning #B7791F on its tint  3.11:1
       --success #1D8A5C on its tint  3.73:1

     --success also carried white text at only 4.34:1 wherever it was used as a
     fill, so the same change fixes both roles.

     New values, measured: warning 5.06:1 on tint / 5.91:1 on white;
     success 5.10:1 on tint / 5.92:1 on white. --danger (4.55:1 on tint) and
     --info (4.94:1) already passed and are unchanged.

     The -soft tints are literal rgba of the same color, so they move together;
     leaving them on the old RGB would drift the pair apart. */
  --success: #17724C;
  --success-soft: rgba(23, 114, 76, 0.12);
  --warning: #8A5A12;
  --warning-soft: rgba(138, 90, 18, 0.14);
  --danger: #C0392B;
  --danger-soft: rgba(192, 57, 43, 0.12);
  --info: var(--brand-purple);
  --info-soft: rgba(96, 91, 160, 0.12);

  /* Spacing (4px scale) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 30px;
  --radius-pill: 50px;

  /* Shadows (navy-tinted, borderless-card system) */
  --shadow-1: 0 3px 20px rgba(36, 32, 91, 0.06);
  --shadow-2: 0 8px 30px rgba(36, 32, 91, 0.10);
  --shadow-3: 0 14px 44px rgba(36, 32, 91, 0.14);
  --shadow-4: 0 18px 54px rgba(36, 32, 91, 0.18);

  /* Controls and hairline tiles: the fill of a white input, outline button
     or tile, the lift of a solid button, and the hover rise of a tile, when
     they sit on the page. surfaces.css turns all three off inside a
     surface, so none adds a second white, a second elevation or a jump
     without a lift to a card. */
  --control-fill: var(--surface);
  --control-lift: var(--shadow-2);
  --control-rise: -2px;

  /* Live indicator: the attendance check-in dot and its pulse ring */
  --live: #1DD75B;
  --live-ring: rgba(29, 215, 91, 0.45);
  --live-ring-clear: rgba(29, 215, 91, 0);

  /* Typography */
  --font-display: 'Ara Hamah Sahet AlAssi', 'Inter', sans-serif;
  --font-data: 'Inter', -apple-system, sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 19px;
  --text-xl: 24px;
  --text-2xl: 32px;

  /* Motion */
  --duration-fast: 150ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* Legacy aliases (Plan 04 Task 1).
   Older layers keep their own variable names, but each name is an alias
   onto a token above, so no other file defines a shadow or surface value:

     brand.css       --ctrlhr-shadow-sm  var(--shadow-1)
                     --ctrlhr-shadow     var(--shadow-2)
                     --ctrlhr-shadow-lg  var(--shadow-3)
     components.css  --sh-xs, --sh-sm    var(--shadow-1)
                     --sh-md             var(--shadow-2)
                     --sh-lg             var(--shadow-3)
                     --sh-xl             var(--shadow-4)
                     --r-sm              var(--radius-sm)
                     --r                 var(--radius-md)
                     --r-md, --r-lg      var(--radius-lg)
                     --r-pill            var(--radius-pill)

   Every other stylesheet uses var(--shadow-N) and var(--surface) directly,
   and every page that links a ctrlHR stylesheet links this file too.
   ctrlhr/tests/test_design_tokens.py enforces all three rules. */

[data-theme="dark"] {
  --surface-page: #0D0C1F;
  --surface: #16152E;
  --surface-raised: #1D1C3A;
  --surface-sunken: #0A0918;
  --text-primary: #EDEDF5;
  --text-secondary: #B9B8CE;
  /* --text-muted was #7A7997 until 2026-09-30: 4.24:1 on --surface and
     3.92:1 on --surface-raised, under AA. #8C8BA9 reads 5.40:1 on
     --surface and 4.99:1 on --surface-raised. */
  --text-muted: #8C8BA9;
  --heading: #C9C6F2;
  --accent: var(--brand-pink);
  --accent-soft: rgba(187, 33, 119, 0.16);
  --border-subtle: rgba(201, 198, 242, 0.10);
  --focus-ring: rgba(151, 146, 224, 0.6);
  /* Status colors need lighter variants on a dark surface: the light-theme
     values sit around 3.5:1 against --surface-raised and fail AA. */
  --danger: #FF7B6B;
  --success: #4ADE9B;
  --warning: #E9B949;
  --shadow-1: 0 3px 20px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 8px 30px rgba(0, 0, 0, 0.42);
  --shadow-3: 0 14px 44px rgba(0, 0, 0, 0.5);
  --shadow-4: 0 18px 54px rgba(0, 0, 0, 0.58);
}
