/* AILaw design tokens. Source of truth: plan section 3 ("Design tokens").
   Every value is measured from a Cursor capture (R1 marketplace, R2 detail, R3 directory, R4 members)
   or derived by the rule written next to it. Components may only use these variables. */

@font-face {
  font-family: "Geist";
  src: url("assets/fonts/geist-variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* Alliance No.2 is a licensed font: drop the licensed files into assets/fonts/ with these names. Until then H1s fall back to Geist. */

:root {
  color-scheme: light;
  /* Base colours (R3 measured) */
  --page: #fefefe;               /* owner override 2026-11-28: near-white (Atomic is #fafafa) */
  --raised: #ffffff;             /* kept one step above the page */
  --white-row: #ffffff;          /* R2 screenshot, verify */
  --ink: #141414;

  /* Accent and status */
  --accent: #1680f3;             /* R2 "Sign In To Add" measured; one use only */
  --focus: #3c7cab;              /* R3 source */
  --danger: #cf2d56;             /* R3 source */
  --selection: color-mix(in srgb, #f54e00 24%, transparent);
}

.dark, :root[data-theme="dark"] {
  color-scheme: dark;
  --page: #050505;               /* owner override 2026-11-28: Atomic AGI background (--background-main dark) */
  --raised: #121212;             /* neutral cards to sit on Atomic's near-black (cursor.directory dark was warm #1b1913) */
  --white-row: #121212;
  --ink: #ededed;
  --accent: #4c9bfe;
  --focus: #5da1e5;
  --danger: #e34671;
}

:root, .dark, :root[data-theme="dark"] {
  /* Text: one ink mixed by opacity (R3 method) */
  --text-1: color-mix(in oklab, var(--ink) 94%, transparent);
  --text-2: color-mix(in oklab, var(--ink) 70%, transparent);
  --text-3: color-mix(in oklab, var(--ink) 48%, transparent);
  --text-4: color-mix(in oklab, var(--ink) 36%, transparent);   /* R1 "See All" measured */

  /* Fills */
  --fill-tile: color-mix(in oklab, var(--ink) 6%, transparent);        /* R1 tile measured */
  --fill-tile-hover: color-mix(in oklab, var(--ink) 5%, transparent);  /* R1 live: --cursor-bg-hover #1c1c1c0d (lighter than rest) */
  --fill-field: color-mix(in oklab, var(--ink) 3%, transparent);       /* R1 search hue difference */
  --fill-pill-active: color-mix(in oklab, var(--ink) 8%, transparent); /* R4 measured */
  --fill-hover-quiet: color-mix(in oklab, var(--ink) 4%, transparent);

  /* Decision M1 (2026-11-28): exact alphas copied from cursor.com marketing pages and the Figma detail page */
  --text-60: color-mix(in oklab, var(--ink) 60%, transparent);   /* J/N text-sec; R2 Back 60%, View N more 62% */
  --text-50: color-mix(in oklab, var(--ink) 50%, transparent);   /* N dates and authors */
  --text-40: color-mix(in oklab, var(--ink) 40%, transparent);   /* N read time, J text-tertiary */
  --text-30: color-mix(in oklab, var(--ink) 30%, transparent);   /* R2 section-label count */
  --icon-quiet: color-mix(in oklab, var(--ink) 24%, transparent);/* R2 row leading icon */
  --line-0: color-mix(in oklab, var(--ink) 2.5%, transparent);   /* J/N .card::before hairline */
  --line-10: color-mix(in oklab, var(--ink) 10%, transparent);   /* C/N input border-02 */
  --line-5: color-mix(in oklab, var(--ink) 5%, transparent);     /* J flyout border-01-5 */

  /* Lines */
  --line-1: color-mix(in oklab, var(--ink) 8%, transparent);
  --line-2: color-mix(in oklab, var(--ink) 12%, transparent);
  --line-3: color-mix(in oklab, var(--ink) 20%, transparent);

  /* Primary (black pill) */
  --primary: var(--ink);
  --primary-text: var(--raised);
  --primary-hover: color-mix(in oklab, var(--page) 10%, var(--ink));

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Alliance No.2", "Allianceno 2", "Geist", ui-sans-serif, system-ui, sans-serif;   /* owner override 2026-11-28: H1s in Alliance No.2 (as atomicagi.com, weight 500) */
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radius */
  --r-chip: 4px;
  --r-card: 8px;
  --r-accordion: 12px;
  --r-pill: 999px;

  /* Elevation (floating layers only) */
  --shadow-float: 0 0 4px rgba(0, 0, 0, .072), 0 8px 24px -2px rgba(0, 0, 0, .072);
  --shadow-flyout: 0 0 1rem #00000005, 0 0 .5rem #00000002;                       /* J live */
  --shadow-listbox: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1); /* C live */

  /* Motion */
  --ease: 150ms ease;

  /* Layout */
  --shell: 1300px;
  --gutter: 24px;
  --header-h: 60px;
  --rail: clamp(0px, max((100% - 20px) * .24, 100% - 788px), 295px);   /* R1 live: 295 while the 768 main fits, else 24% of (content - gap): 231 at 1024, 200 at 900 */
  --main: 768px;
}

@media (max-width: 767px) {
  :root { --gutter: 20px; --header-h: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --ease: 0ms linear; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
