/* Lamplight tokens.
   A graphite house lit by one lamp: the wing you are standing in sets --accent, and
   everything else is neutral ground, hairlines and mono measurements.

   Every colour is defined once with light-dark(light, dark). The theme follows the
   system unless data-theme on the root element forces a side. */

:root {
  color-scheme: light dark;

  /* ground */
  --canvas: light-dark(#EEECF1, #111015);
  --panel:  light-dark(#F8F7FA, #18171D);
  --raised: light-dark(#FFFFFF, #201F27);
  --hover:  light-dark(#E5E2EA, #292832);
  --inset:  light-dark(#F2F0F5, #0C0B0F);

  /* hairlines */
  --line:         light-dark(rgba(29, 26, 36, .10), rgba(236, 232, 244, .08));
  --line-strong:  light-dark(rgba(29, 26, 36, .18), rgba(236, 232, 244, .15));
  --line-control: light-dark(rgba(29, 26, 36, .36), rgba(236, 232, 244, .26));

  /* text */
  --text:  light-dark(#1D1A24, #ECE9F2);
  --body:  light-dark(#37333F, #CFCBD8);
  --muted: light-dark(#5C5768, #A39EB0);
  --faint: light-dark(#6B6677, #8A8597);

  /* status: always paired with a shape and a word */
  --ok:     light-dark(#1F7A4C, #6CCB95);
  --warn:   light-dark(#8A5A0A, #E8B04E);
  --danger: light-dark(#B3322F, #EE7B73);
  --info:   light-dark(#3E4E92, #8FA6EA);

  /* lamps: one per wing */
  --w-house:    light-dark(#6F4EA6, #C9A8EC);
  --w-atelier:  light-dark(#8A5E1E, #DDB15A);
  --w-forge:    light-dark(#B8461A, #F0875A);
  --w-yard:     light-dark(#2F6EA8, #8DB4E6);
  --w-workshop: light-dark(#47700F, #B4D465);
  --w-estate:   light-dark(#5C5768, #B9B4C6);   /* estate-level pages: settings, observability */

  --accent: var(--w-house);
  --accent-dim:  color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 36%, transparent);
  --on-accent: light-dark(#FFFFFF, #111015);

  /* depth: hairline plus surface step; shadow only on things that float */
  --highlight: inset 0 1px 0 light-dark(rgba(255, 255, 255, .7), rgba(255, 255, 255, .035));
  --float: 0 2px 6px light-dark(rgba(40, 30, 60, .08), rgba(6, 5, 10, .42)),
           0 18px 44px -10px light-dark(rgba(40, 30, 60, .22), rgba(14, 9, 24, .66));
  --scrim: light-dark(rgba(29, 26, 36, .36), rgba(8, 7, 12, .62));
  --grain: .04;

  /* type: four roles */
  --font-display: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --font-ui:      "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-voice:   "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* type: fixed scale for chrome (rem, 16px root) */
  --fs-label:    .65625rem;  /* 10.5  mono caps */
  --fs-evidence: .71875rem;  /* 11.5  mono */
  --fs-small:    .78125rem;  /* 12.5 */
  --fs-control:  .84375rem;  /* 13.5 */
  --fs-ui:       .875rem;    /* 14    shell text */
  --fs-body:     .9375rem;   /* 15    prose */
  --fs-section:  1.0625rem;  /* 17 */
  --fs-stat:     1.625rem;   /* 26 */
  --fs-title:    1.75rem;    /* 28 */
  --measure: 68ch;

  /* space: 4px base */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* control sizes */
  --h-sm: 30px; --h-control: 36px; --h-input: 38px; --h-row: 48px; --h-touch: 44px;

  /* shell measures */
  --rail-w: 56px; --rooms-w: 228px; --top-h: 48px; --assist-w: 324px; --dock-h: 58px;

  /* corners say what a thing is */
  --r-xs: 4px;     /* badge */
  --r-sm: 6px;     /* control */
  --r-md: 10px;    /* panel, card */
  --r-lg: 14px;    /* media, sheet */
  --r-pill: 999px; /* chip, composer */

  /* motion: nothing bounces */
  --d-fast: 120ms; --d-base: 180ms; --d-slow: 280ms; --d-lamp: 300ms;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* layers */
  --z-main: 1; --z-dock: 3; --z-assist: 5; --z-side: 6; --z-scrim: 7; --z-sheet: 8; --z-toast: 9;
}

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

/* The lamp. Set data-wing on the app root (or on any subtree that belongs to a wing). */
[data-wing="house"]    { --accent: var(--w-house); }
[data-wing="atelier"]  { --accent: var(--w-atelier); }
[data-wing="forge"]    { --accent: var(--w-forge); }
[data-wing="yard"]     { --accent: var(--w-yard); }
[data-wing="workshop"] { --accent: var(--w-workshop); }
[data-wing="estate"]   { --accent: var(--w-estate); }
[data-wing] {
  --accent-dim:  color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 36%, transparent);
}

/* Breakpoints are container widths of the app root, not tokens (CSS cannot read a
   variable in a query): 1100px the assistant overlays, 760px the phone layout. */
