/* =========================================================
   Lucy Labs — site-tokens.css
   THE single source of site design tokens + core primitives
   for the 2026-07-07 website rebuild.

   Derived from the chat-prototype-v2 brand source
   (Marketing/Website/live/assets/chat-prototype-v2/assets/lucy-tokens.css),
   adopted site-wide per Travis approval 2026-07-07:
   white/cream ground, Quicksand, prototype brand core.

   Rules carried from VISUAL_SYSTEM.md (durable):
   - one ease curve, 150 / 220 / 420 ms durations, reduced-motion mandatory
   - spacing scale --s-1..--s-10 (4..128px), --container 1200px
   - pill radius for buttons and the brand pill
   - exactly one :root block across production CSS (this one)

   Fonts load via <link> in the HTML head (base template).
   NO @import here. Vanilla CSS, no preprocessor, strict CSP-safe.
   Muted inks are literal colors on purpose: the --ll-ink-70/55/35
   alpha-ramp pattern is banned for the site files.
   ========================================================= */

:root {
  /* ---------- Brand ---------- */
  --blue:       #3559F2;   /* Lucy Blue: primary action, links, emphasis */
  --blue-deep:  #2340C7;   /* hover / pressed / deep contrast */
  --blue-soft:  #E8EDFF;   /* tinted light ground for cards, fields, chips */

  /* ---------- Grounds ---------- */
  --bg:         #FFFFFF;   /* primary page ground (white, not cream paper) */
  --bg-cream:   #F6F5F1;   /* warm secondary ground for alternate bands */

  /* ---------- Ink (literal colors, no alpha ramp) ---------- */
  --ink:        #0B0F2A;   /* headlines, body on light, dark bands */
  --ink-muted:  #54576A;   /* secondary text on white  (flattened 70% ink) */
  --ink-soft:   #797B8A;   /* tertiary text, captions  (flattened 55% ink) */
  --ink-faint:  #AAABB4;   /* placeholders, disabled   (flattened 35% ink) */
  --line:       #E2E2E5;   /* soft borders, dividers   (flattened 12% ink) */
  --line-hair:  #F0F1F2;   /* hairline card outlines   (flattened  6% ink) */

  /* ---------- On dark (ink / blue bands), literal ---------- */
  --on-ink:        #FFFFFF;
  --on-ink-muted:  #DDDDE1; /* secondary text on ink */
  --on-ink-soft:   #C2C3CA; /* tertiary text on ink */
  --on-ink-faint:  #9D9FAA; /* faint metadata on ink */
  --line-on-ink:   #2D3148; /* borders on ink ground */

  /* ---------- Accent (decorative / illustration only) ---------- */
  --sand:       #E8D7B8;

  /* ---------- State (prototype values for fills/dots) ---------- */
  --ok:          #1F9D6C;
  --warn:        #E8B53B;
  --danger:      #E24C3B;
  /* text-safe deep companions: use for chip/label TEXT on light grounds */
  --ok-deep:     #1F7A5C;
  --warn-deep:   #8A6516;
  --danger-deep: #B43A2C;

  /* ---------- Typography ---------- */
  --font-sans:  'Quicksand', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:  'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;

  /* Modular scale, rooted on 16px body (prototype scale) */
  /* 2026-07-22 small-print floor (Thomas): the three small tokens are
     raised so no token-fed page text renders below ~14px. Token NAMES
     kept for compatibility; rename at VISUAL_SYSTEM absorption.
     (Mock-UI depictions use literal px and deliberately stay small.) */
  --fs-12:  1rem;       /* was 0.75rem  -> renders 16px (floor round 2) */
  --fs-13:  1.0625rem;  /* was 0.8125rem -> renders 17px */
  --fs-14:  1.125rem;   /* was 0.875rem -> renders 18px */
  --fs-16:  1rem;       /* body */
  --fs-18:  1.125rem;   /* large body */
  --fs-20:  1.25rem;    /* sub-headline / lede */
  --fs-24:  1.5rem;     /* h4 */
  --fs-32:  2rem;       /* h3 */
  --fs-44:  2.75rem;    /* h2 */
  --fs-64:  4rem;       /* h1 */
  --fs-88:  5.5rem;     /* display / hero */

  --lh-tight:   1.05;
  --lh-snug:    1.2;
  --lh-default: 1.45;
  --lh-body:    1.55;

  --tracking-tight:   -0.01em;
  --tracking-eyebrow:  0.12em;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;

  /* ---------- Spacing scale (VISUAL_SYSTEM durable rule) ---------- */
  --s-1:    4px;
  --s-2:    8px;
  --s-3:   12px;
  --s-4:   16px;
  --s-5:   24px;
  --s-6:   32px;
  --s-7:   48px;
  --s-8:   64px;
  --s-9:   96px;
  --s-10: 128px;

  /* ---------- Layout ---------- */
  /* 2026-07-16 visual pass (Thomas direction): wider canvas so the page
     stops reading as a narrow centered column. Round 3 unified every band
     onto ONE width so section edges always align. Register delta vs the
     VISUAL_SYSTEM 1200px lock; needs Travis approval at absorption. */
  --container:      1440px;
  --container-wide: 1440px; /* unified with --container (round 3) */
  --gutter:         24px;   /* mobile; bumps to 48px at 900px */
  --measure-prose:  70ch;   /* 2026-07-16 pass: was 64ch; wider canvas */

  /* ---------- Radii ---------- */
  --r-sm:    8px;
  --r-md:   16px;
  --r-lg:   24px;
  --r-pill: 999px;

  /* ---------- Elevation ---------- */
  --shadow-card:  0 8px 24px -12px rgba(11, 15, 42, 0.18);
  --shadow-lift:  0 18px 40px -18px rgba(11, 15, 42, 0.28);
  --shadow-modal: 0 24px 60px -20px rgba(11, 15, 42, 0.35);
  --shadow-blue:  0 10px 30px -12px rgba(53, 89, 242, 0.45);
  --ring-focus:   0 0 0 2px var(--bg), 0 0 0 4px var(--blue);

  /* ---------- Motion: ONE ease, three durations ---------- */
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --dur-hover:  150ms;
  --dur-ui:     220ms;
  --dur-enter:  420ms;
}

@media (min-width: 900px) {
  :root { --gutter: 48px; }
}

/* =========================================================
   Base element defaults
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5.5vw, var(--fs-64)); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); }
h2 { font-size: clamp(1.75rem, 4vw, var(--fs-44)); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); }
h3 { font-size: clamp(1.375rem, 3vw, var(--fs-32)); line-height: var(--lh-snug); }
h4 { font-size: var(--fs-24); line-height: var(--lh-snug); }

p {
  margin: 0 0 var(--s-4);
  color: var(--ink-muted);
  text-wrap: pretty;
}

.display {
  font-weight: var(--weight-semibold);
  font-size: clamp(2.75rem, 7vw, var(--fs-88));
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.lede {
  font-size: var(--fs-20);
  line-height: var(--lh-default);
  color: var(--ink);
  font-weight: var(--weight-medium);
}

/* eyebrow: the only ALL-CAPS treatment on the site */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--ink-soft);
}

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
code {
  background: var(--blue-soft);
  color: var(--blue-deep);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color var(--dur-hover) var(--ease), opacity var(--dur-hover) var(--ease);
}
a:hover { color: var(--blue-deep); }

img { max-width: 100%; height: auto; }

/* ---------- Focus visibility (site-wide) ---------- */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}
.btn:focus-visible, .pill:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

/* =========================================================
   Button system (pill radius, one ease)
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--fs-16);
  line-height: 1;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--dur-hover) var(--ease),
    color var(--dur-hover) var(--ease),
    border-color var(--dur-hover) var(--ease),
    transform var(--dur-hover) var(--ease),
    box-shadow var(--dur-hover) var(--ease);
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--blue); color: var(--on-ink); }
.btn-primary:hover { background: var(--blue-deep); color: var(--on-ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--line-hair); color: var(--ink); }

.btn-on-blue { background: var(--bg); color: var(--blue); }
.btn-on-blue:hover { background: var(--bg-cream); color: var(--blue-deep); }

.btn-ghost-on-ink {
  background: transparent;
  color: var(--on-ink);
  border-color: var(--line-on-ink);
}
.btn-ghost-on-ink:hover { background: var(--line-on-ink); color: var(--on-ink); }

.btn-sm { padding: 10px 16px; font-size: var(--fs-14); }
.btn-lg { padding: 18px 28px; font-size: var(--fs-18); }

/* =========================================================
   Card
   ========================================================= */
.card {
  background: var(--bg);
  border: 1px solid var(--line-hair);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-card);
}
.card--flat { box-shadow: none; border-color: var(--line); }
.card--tint { background: var(--blue-soft); border-color: transparent; }

/* =========================================================
   Pill (generic label / chip base)
   ========================================================= */
.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-sans);
  font-size: var(--fs-13);
  font-weight: var(--weight-semibold);
  line-height: 1;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--blue-soft);
  color: var(--blue-deep);
}
.pill--outline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-muted);
}

/* =========================================================
   Reduced motion kill switch (mandatory, canonical pattern)
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
