/* forwardonly.ai — design tokens
 *
 * TWO THEMES, BOTH DARK. There is no light theme and there is not going to be one.
 *
 *   night   the house's bluish dark, carried from the division "division-dark" theme.
 *           This is the default: the one a first visit renders.
 *   fall    the house's warm dark, carried from the division "harvest" theme.
 *
 * `night` sits on bare :root so it needs no attribute and cannot flash. `fall` lives
 * under :root[data-theme="fall"]. prefers-color-scheme decides nothing here; the stored
 * choice is the only switch and no stored choice means night.
 *
 * Every ADAPTED line says what moved and why. Contrast figures were measured, not
 * estimated. A hue used as text carries a text-grade value; a hue used as a fill or a
 * graphic stroke does not have to, and the two are different tokens so they cannot be
 * confused at the point of use.
 */

:root {
  color-scheme: dark;

  /* ---- night: surface ---- */
  --surface-ground: #0a0e1a;
  --surface-panel:  #111827;
  --surface-raised: #1c2535;
  --surface-well:   #070a13;   /* ADAPTED: one step below ground, for code wells */
  --surface-glow:   rgba(99, 102, 241, 0.14);

  /* ---- night: border ---- */
  --border-hairline: #1f2b3f;
  --border-strong:   #314259;
  --border-control:  #94a3b8;  /* a control outline is the affordance: text-grade, 7.51:1 */

  /* ---- night: text ---- */
  --text-primary: #e2e8f0;     /* 15.62:1 on ground */
  --text-dim:     #94a3b8;     /* 7.51:1 on ground, 6.00:1 on raised */

  /* ---- night: accent. Two of them, deliberately. ---- */
  --accent:        #6366f1;    /* fills, strokes, large graphics. 4.31:1 — never body text */
  --accent-text:   #818cf8;    /* ADAPTED: the text-grade member of the same hue, 6.46:1 */
  --accent-strong: #a5b4fc;    /* 9.66:1 — the brightest, for a focus ring and a frontier */
  --accent-wash:   rgba(99, 102, 241, 0.12);

  /* ---- night: the second and third hues, for colour-blocking a long scroll ---- */
  --hue-2:      #22d3ee;       /* cyan   */
  --hue-2-wash: rgba(34, 211, 238, 0.10);
  --hue-3:      #f472b6;       /* rose   */
  --hue-3-wash: rgba(244, 114, 182, 0.10);

  /* ---- night: status. Three states, three hues, three glyphs: never colour alone. ---- */
  --state-built:    #4ade80;
  --state-building: #38bdf8;
  --state-ambition: #a5b4fc;
  --state-alarm:    #f87171;   /* reserved for data-integrity states. Nothing here is one. */

  /* ---- night: focus. Declared, never derived. ---- */
  --focus-outer: #a5b4fc;      /* 9.66:1 on ground, 7.71:1 on raised */
  --focus-inner: #0a0e1a;

  /* =====================================================================
     Everything below is shared by both themes.
     ===================================================================== */

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Cascadia Code", Consolas, "DejaVu Sans Mono", ui-monospace, monospace;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  0.9375rem;
  --text-md:    1.0625rem;
  --text-lg:    1.3125rem;
  --text-xl:    1.75rem;
  --display-sm: clamp(1.75rem, 1.30rem + 2.0vw, 2.75rem);
  --display-md: clamp(2.25rem, 1.45rem + 3.6vw, 4.25rem);
  --display-lg: clamp(2.75rem, 1.25rem + 6.6vw, 6.75rem);
  --display-xl: clamp(2.875rem, 1.30rem + 6.9vw, 7.5rem);

  --leading-tight: 1.02;
  --leading-snug:  1.22;
  --leading-body:  1.55;
  --measure:       62ch;
  --measure-tight: 42ch;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: clamp(3rem, 6vw, 5.5rem);
  --space-3xl: clamp(4.5rem, 9vw, 9rem);

  --radius-sm: 0.25rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-pill: 999px;

  --page: 1240px;
  --page-wide: 1560px;
  --page-narrow: 800px;
  --gutter: clamp(1rem, 4vw, 3rem);

  --motion-fast: 140ms;
  --motion-mid:  280ms;
  --motion-slow: 620ms;
  --ease-move: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
}

:root[data-theme="fall"] {
  color-scheme: dark;

  --surface-ground: #1a1612;
  --surface-panel:  #221e19;
  --surface-raised: #2e2820;
  --surface-well:   #14110e;
  --surface-glow:   rgba(212, 146, 42, 0.14);

  --border-hairline: #3d3228;
  --border-strong:   #5a4838;
  --border-control:  #a79578;

  --text-primary: #e8dcc8;     /* 13.28:1 on ground */
  --text-dim:     #a79578;     /* ADAPTED from harvest #9a8a70, which measures 4.33:1 on
                                  the raised surface. Hue kept, value lifted to 5.01:1. */

  --accent:        #d4922a;    /* 6.81:1 — already text-grade in this theme */
  --accent-text:   #d4922a;
  --accent-strong: #f0c060;    /* 10.63:1 */
  --accent-wash:   rgba(212, 146, 42, 0.12);

  /* ADAPTED: harvest's cyan #5a8ab0 and purple #9870a0 measure 3.95:1 and 3.58:1 on the
     raised surface. Hue and saturation held, lightness raised until each clears. */
  --hue-2:      #6e98b9;       /* harvest cyan, lifted.   4.76:1 on raised */
  --hue-2-wash: rgba(110, 152, 185, 0.14);
  --hue-3:      #aa89b0;       /* harvest purple, lifted. 4.80:1 on raised */
  --hue-3-wash: rgba(170, 137, 176, 0.14);

  --state-built:    #5fa270;   /* ADAPTED from harvest #5a9a6a, 4.35:1 on raised */
  --state-building: #6e98b9;
  --state-ambition: #f0c060;
  --state-alarm:    #c05050;

  --focus-outer: #f0c060;      /* 10.63:1 on ground, 8.62:1 on raised */
  --focus-inner: #1a1612;
}
