/*
 * Cucumbs shared design tokens — v0.2.0 (Phase 1, local)
 *
 * One token layer for all five PoC sites: the central Cucumbs site and the
 * config-driven Lyra environment template. This is the Cucumbs design
 * language, not EIS branding. Sites import this file first, then their own
 * layout CSS. Change values here, not in a site.
 *
 * Environment accents are identity only. They do not encode, imply, or
 * anticipate any function for lyra-a … lyra-d (functions are under definition).
 */

:root {
  /* ---- Neutrals ---- */
  --cu-color-paper: #f6f7f4;          /* page background, faintly warm */
  --cu-color-surface: #ffffff;        /* panels, cards */
  --cu-color-surface-sunken: #eceee8; /* wells, table stripes */
  --cu-color-ink: #182019;            /* primary text  (15.5:1 on paper) */
  --cu-color-ink-muted: #4a554c;      /* secondary text (7.3:1 on paper) */
  --cu-color-line: #c9cfc6;           /* hairlines, borders */
  --cu-color-line-strong: #8d978b;    /* emphasised borders, focus off-state */

  /* ---- Cucumbs core hue (vine green) ---- */
  --cu-color-vine-900: #0f3b2e;
  --cu-color-vine-700: #1d5e48;       /* links, primary actions (7.1:1 on paper) */
  --cu-color-vine-500: #2f8466;
  --cu-color-vine-100: #dcebe3;
  --cu-color-focus: #1d5e48;

  /* ---- Status (shared data model) ----
   * Colour is never the only signal: pair with the label text and the
   * line pattern (--cu-dash-*). Each colour meets 4.5:1 on paper and on its own -bg tint.
   */
  --cu-status-confirmed: #1b6f45;
  --cu-status-confirmed-bg: #dff0e6;
  --cu-status-recovered: #8a5300;
  --cu-status-recovered-bg: #f6ead6;
  --cu-status-proposed: #6b3fb5;
  --cu-status-proposed-bg: #ece4f8;
  --cu-status-unresolved: #5f6670;
  --cu-status-unresolved-bg: #eceef1;
  --cu-status-implemented: #1d5fbf;
  --cu-status-implemented-bg: #e0ebfa;
  --cu-status-planned: #0b6e86;
  --cu-status-planned-bg: #dcf0f4;

  /* Line patterns for status (SVG stroke-dasharray values) */
  --cu-dash-confirmed: none;
  --cu-dash-recovered: none;
  --cu-dash-proposed: 7 4;
  --cu-dash-unresolved: 2 4;
  --cu-dash-implemented: none;
  --cu-dash-planned: 9 3 2 3;
  --cu-stroke-confirmed: 2px;
  --cu-stroke-recovered: 1.5px;
  --cu-stroke-proposed: 1.5px;
  --cu-stroke-unresolved: 1.5px;
  --cu-stroke-implemented: 2.5px;
  --cu-stroke-planned: 1.5px;

  /* Simulation / placeholder labelling (used by visible banners) */
  --cu-color-simulation: #8a5300;
  --cu-color-simulation-bg: #fbf1df;

  /* ---- Environment accents (identity only) ---- */
  --cu-accent-cucumbs: var(--cu-color-vine-700);
  --cu-accent-lyra-a: #2f5f9e;
  --cu-accent-lyra-b: #9c4a2f;
  --cu-accent-lyra-c: #2b7a62;
  --cu-accent-lyra-d: #7d4596;
  --cu-accent-companion: #5d6420;
  --env-accent: var(--cu-accent-cucumbs);

  /* ---- Typography ---- */
  --cu-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cu-font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --cu-text-xs: 0.78rem;
  --cu-text-sm: 0.9rem;
  --cu-text-md: 1rem;
  --cu-text-lg: 1.2rem;
  --cu-text-xl: 1.55rem;
  --cu-text-2xl: 2.1rem;
  --cu-text-3xl: 2.9rem;
  --cu-leading-tight: 1.15;
  --cu-leading-body: 1.6;
  --cu-weight-regular: 400;
  --cu-weight-medium: 560;
  --cu-weight-bold: 680;
  --cu-measure: 68ch;

  /* ---- Space, shape, depth ---- */
  --cu-space-1: 0.25rem;
  --cu-space-2: 0.5rem;
  --cu-space-3: 0.75rem;
  --cu-space-4: 1rem;
  --cu-space-5: 1.5rem;
  --cu-space-6: 2rem;
  --cu-space-7: 3rem;
  --cu-space-8: 4.5rem;
  --cu-radius-sm: 3px;
  --cu-radius-md: 6px;
  --cu-radius-lg: 10px;
  --cu-shadow-panel: 0 1px 2px rgb(24 32 25 / 0.06), 0 4px 16px rgb(24 32 25 / 0.06);
  --cu-content-max: 1200px;

  /* ---- Breakpoints (reference; CSS media queries cannot read vars) ----
   * --cu-bp-sm: 640px; --cu-bp-md: 920px; --cu-bp-lg: 1200px */

  /* ---- Motion: minimal by default ---- */
  --cu-duration-fast: 120ms;
  --cu-duration-base: 200ms;
  --cu-ease: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
  :root { --cu-duration-fast: 0ms; --cu-duration-base: 0ms; }
}

/* Environment scoping: set data-environment on <html> or a container. */
[data-environment="cucumbs"]   { --env-accent: var(--cu-accent-cucumbs); }
[data-environment="lyra-a"]    { --env-accent: var(--cu-accent-lyra-a); }
[data-environment="lyra-b"]    { --env-accent: var(--cu-accent-lyra-b); }
[data-environment="lyra-c"]    { --env-accent: var(--cu-accent-lyra-c); }
[data-environment="lyra-d"]    { --env-accent: var(--cu-accent-lyra-d); }
[data-environment="companion"] { --env-accent: var(--cu-accent-companion); }

/* ---- Small shared primitives every site may use ---- */
.cu-status {
  display: inline-flex; align-items: center; gap: 0.35em;
  padding: 0.1em 0.55em; border-radius: 999px; border: 1px solid currentColor;
  font: var(--cu-weight-medium) var(--cu-text-xs)/1.5 var(--cu-font-sans);
  letter-spacing: 0.02em; text-transform: lowercase; white-space: nowrap;
}
.cu-status::before { content: ""; width: 0.55em; height: 0.55em; border-radius: 50%; background: currentColor; }
.cu-status--confirmed   { color: var(--cu-status-confirmed);   background: var(--cu-status-confirmed-bg); }
.cu-status--recovered   { color: var(--cu-status-recovered);   background: var(--cu-status-recovered-bg); }
.cu-status--proposed    { color: var(--cu-status-proposed);    background: var(--cu-status-proposed-bg); border-style: dashed; }
.cu-status--unresolved  { color: var(--cu-status-unresolved);  background: var(--cu-status-unresolved-bg); border-style: dotted; }
.cu-status--implemented { color: var(--cu-status-implemented); background: var(--cu-status-implemented-bg); }
.cu-status--planned     { color: var(--cu-status-planned);     background: var(--cu-status-planned-bg); border-style: dashed; }

.cu-notice {
  border-left: 4px solid var(--cu-color-simulation);
  background: var(--cu-color-simulation-bg);
  color: var(--cu-color-ink);
  padding: var(--cu-space-3) var(--cu-space-4);
  font-size: var(--cu-text-sm);
}

.cu-focus-ring:focus-visible,
:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid var(--cu-color-focus);
  outline-offset: 2px;
}
