
/* tokens/colors.css */
/* ==========================================================================
   Rubrica — Color tokens
   The canonical "Recommendation v2" skin (decided 2026-06-12):
   Ledger constitution + Atelier humanity. Warm paper, house navy, red-pen
   accent. Lifted verbatim from base.html / mockups/11-recommendation-v2.html.

   Semantic rule (binding): green / amber / red mean exactly one thing each,
   across app and PDFs — confirmed / needs-human-eyes / wrong-or-failing.
   Never decorative.
   ========================================================================== */
:root {
  /* ── Surfaces & ink ─────────────────────────────────────────────────── */
  --rb-paper:        #faf8f2;   /* page background (warm off-white) */
  --rb-card:         #fffefa;   /* raised surfaces — the index-card feel */
  --rb-hairline:     #e2ddd0;   /* rules + card borders */
  --rb-ink:          #23303d;   /* body text */
  --rb-soft:         #71798a;   /* secondary text */

  /* ── Brand ──────────────────────────────────────────────────────────── */
  --rb-navy:         #0f2b46;   /* the house navy — brand, primary, titles */
  --rb-navy-mid:     #1a3a5c;   /* navy hover / dark-mode card */
  --rb-redpen:       #b3261e;   /* THE accent: action-hover, active nav, flags */
  --rb-redpen-bg:    #f7e9e7;   /* red-pen wash (flag pills) */

  /* ── Status (semantic — one meaning each) ───────────────────────────── */
  --rb-green:        #2e6147;   /* confirmed / reviewed / pass */
  --rb-green-bg:     #e7eee9;
  --rb-amber:        #96701d;   /* needs human eyes / boundary / pending */
  --rb-amber-bg:     #f6eed6;
  --rb-red:          #b3261e;   /* wrong / failing / flagged (== red-pen) */
  --rb-red-bg:       #f7e9e7;

  /* ── Neutrals (slate) ───────────────────────────────────────────────── */
  --rb-slate:        #71798a;   /* secondary text / secondary button */
  --rb-slate-light:  #94a3b8;   /* labels, dark-mode secondary */

  /* ── Info (sky) — sparingly, for neutral informational accents ──────── */
  --rb-sky:          #0ea5e9;
  --rb-sky-dark:     #0284c7;
  --rb-blue-light:   #e7edf3;   /* pale navy wash — info alerts, navy badges */

  /* ── Semantic aliases (use these in components) ─────────────────────── */
  --rb-bg:           var(--rb-paper);
  --rb-surface:      var(--rb-card);
  --rb-border:       var(--rb-hairline);
  --rb-text:         var(--rb-ink);
  --rb-text-muted:   var(--rb-soft);
  --rb-text-label:   var(--rb-slate-light);
  --rb-primary:      var(--rb-navy);
  --rb-primary-hover:var(--rb-redpen);
  --rb-accent:       var(--rb-redpen);
  --rb-link:         var(--rb-navy);
  --rb-link-hover:   var(--rb-redpen);
  --rb-focus-ring:   rgba(15, 43, 70, .28);
}

/* ── Dark mode parity (data-bs-theme="dark") — mandatory, from base.html ── */
[data-bs-theme="dark"] {
  --rb-bg:           #0c2138;
  --rb-surface:      var(--rb-navy-mid);
  --rb-border:       rgba(255, 255, 255, .12);
  --rb-text:         #e2e8f0;
  --rb-text-muted:   var(--rb-slate-light);
  --rb-text-label:   var(--rb-slate-light);
  --rb-primary:      #60a5fa;
  --rb-link:         #60a5fa;
  --rb-link-hover:   #93bbfd;
  --rb-focus-ring:   rgba(96, 165, 250, .4);
}

/* tokens/typography.css */
/* ==========================================================================
   Rubrica — Typography tokens
   Three families, each with a strict job (from the design system doc):
   · Source Serif 4 — AUTHORITY. Page titles (h1/h2) and score numerals ONLY.
   · Instrument Sans — the working grotesk. All UI, body, labels, buttons.
   · IBM Plex Mono   — anonymous identifiers (the anon_id), code, tabular data.
   "Serif is reserved for where authority belongs." — base.html
   ========================================================================== */
:root {
  /* Families */
  --rb-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif; /* @kind font */
  --rb-sans:  'Instrument Sans', 'Helvetica Neue', 'Segoe UI', system-ui, sans-serif; /* @kind font */
  --rb-mono:  'IBM Plex Mono', 'SF Mono', Consolas, monospace; /* @kind font */

  /* Weights */
  --rb-weight-regular:  400;
  --rb-weight-medium:   500;
  --rb-weight-semibold: 600;
  --rb-weight-bold:     700;

  /* Type scale (rem) — calm, dense-but-legible */
  --rb-text-xs:   0.6875rem;  /* 11px  — uppercase labels, figure captions */
  --rb-text-sm:   0.8125rem;  /* 13px  — table cells, nav links, mono ids */
  --rb-text-base: 0.9375rem;  /* 15px  — body default */
  --rb-text-md:   1rem;       /* 16px  — card titles */
  --rb-text-lg:   1.375rem;   /* 22px  — wordmark, section heads */
  --rb-text-xl:   1.75rem;    /* 28px  — page-plate figures */
  --rb-text-2xl:  2.25rem;    /* 36px  — page title (h1) */

  /* Line heights */
  --rb-leading-tight:  1.2;
  --rb-leading-snug:   1.35;
  --rb-leading-normal: 1.55;  /* body default */

  /* Letter spacing */
  --rb-tracking-tight:  -0.01em;
  --rb-tracking-normal: 0;
  --rb-tracking-wide:   0.09em;  /* uppercase nav links */
  --rb-tracking-wider:  0.14em;  /* uppercase plate eyebrow / labels */

  /* Semantic roles */
  --rb-font-title:    var(--rb-weight-semibold) var(--rb-text-2xl)/var(--rb-leading-tight) var(--rb-serif);
  --rb-font-score:    var(--rb-weight-bold) var(--rb-text-xl)/1 var(--rb-serif);
  --rb-font-body:     var(--rb-weight-regular) var(--rb-text-base)/var(--rb-leading-normal) var(--rb-sans);
  --rb-font-label:    var(--rb-weight-semibold) var(--rb-text-xs)/1 var(--rb-sans);
  --rb-font-id:       var(--rb-weight-regular) var(--rb-text-sm)/1 var(--rb-mono);
}

/* tokens/spacing.css */
/* ==========================================================================
   Rubrica — Spacing & radii tokens
   Built on Bootstrap's 0.25rem scale (the app's base). The rule that matters:
   "grouping over gaps" — related controls share a card, unrelated ones don't
   share a row. Whitespace is spent on grouping, not drama.
   ========================================================================== */
:root {
  /* Spacing scale (0.25rem step) */
  --rb-space-0:   0;
  --rb-space-1:   0.25rem;   /* 4px  */
  --rb-space-2:   0.5rem;    /* 8px  */
  --rb-space-3:   0.75rem;   /* 12px */
  --rb-space-4:   1rem;      /* 16px */
  --rb-space-5:   1.5rem;    /* 24px */
  --rb-space-6:   2rem;      /* 32px */
  --rb-space-7:   2.5rem;    /* 40px */
  --rb-space-8:   3rem;      /* 48px */

  /* Border radii — restrained. Buttons/inputs are nearly square (3px);
     cards get a gentle 10px; pills/chips/badges are fully round. */
  --rb-radius-xs:   2px;
  --rb-radius-sm:   3px;     /* buttons, inputs, tags */
  --rb-radius-md:   6px;     /* small cards, flag cards */
  --rb-radius-lg:   10px;    /* cards (the index-card) */
  --rb-radius-xl:   16px;    /* hero panel */
  --rb-radius-pill: 999px;   /* chips, badges, the Rubi launcher */

  /* Border widths */
  --rb-border-width:       1px;   /* hairline */
  --rb-border-spine:       4px;   /* card left status spine */
  --rb-border-masthead:    3px;   /* double-rule masthead */

  /* Layout */
  --rb-container-max:  1180px;    /* the plate / content max-width */
  --rb-navbar-height:  59px;
}

/* tokens/elevation.css */
/* ==========================================================================
   Rubrica — Elevation, shadows & motion tokens
   The "soft paper shadow" gives raised surfaces an index-card lift without
   drama. Motion is minimal: brief rises and fades, no decorative loops, never
   on the grade path. "Zero whimsy on the grade path."
   ========================================================================== */
:root {
  /* Soft paper shadows (warm-tinted, low-contrast) */
  --rb-shadow-sm: 0 1px 3px rgba(35, 48, 61, .06), 0 1px 2px rgba(35, 48, 61, .04);
  --rb-shadow:    0 1px 3px rgba(35, 48, 61, .06), 0 8px 24px rgba(35, 48, 61, .06);
  --rb-shadow-lg: 0 3px 8px rgba(35, 48, 61, .09), 0 14px 32px rgba(35, 48, 61, .10);
  --rb-shadow-rubi: 0 6px 18px rgba(15, 43, 70, .25);

  /* The masthead double rule (3px double navy) */
  --rb-rule-masthead: 3px double var(--rb-navy);

  /* Backdrop blur (frosted masthead) */
  --rb-frost: saturate(180%) blur(20px); /* @kind other */

  /* Motion — calm. Card hover lifts 2px; entrances rise + fade. */
  --rb-ease:        cubic-bezier(.4, 0, .2, 1); /* @kind other */
  --rb-dur-fast:    .13s; /* @kind other */
  --rb-dur:         .2s; /* @kind other */
  --rb-dur-slow:    .45s; /* @kind other */
  --rb-lift:        translateY(-2px); /* @kind other */
}

/* Card rise-on-enter — gated so print / reduced-motion show content. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rb-rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}
