/* Kit tokens.

   Two layers:
   1. --zt-*   Zephton brand values. Source of truth: platform/branding/brand-images/theme.css.
               Never add a colour, font or radius here that is not in that file.
   2. --kit-*  What components read. They default to the Zephton house style: ink ground,
               paper type, steel light. A demo gets its own look by setting data-theme on
               <html> and overriding --kit-* in its own theme.css. Components never read --zt-*. */

:root {
  /* ---- brand ---- */
  --zt-ink: #000000;
  --zt-paper: #ffffff;
  --zt-graphite: #161616;
  --zt-steel: #6e6e6a;
  --zt-mist: #e7e7e3;
  --zt-fog: #f4f4f1;
  /* Tints. Added 2026-11-15 at the owner's request: the house is soft, not hard black on hard white.
     Used as the ground of one panel at a time, always with graphite type. */
  --zt-tint-sage: #d6ddcf;
  --zt-tint-sand: #e8dfcd;
  --zt-tint-sky: #cfdbe4;
  --zt-tint-lilac: #dad6e6;
  --zt-tint-blush: #ead8d3;
  --zt-radius-touch: 8px;
  --zt-radius-frame: 0;
  /* Noto Sans Bengali only supplies glyphs Archivo lacks. */
  --zt-font: "Archivo", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  --zt-display-stretch: 115%;
  --zt-display-weight: 600;
  --zt-text-weight: 400;

  /* ---- colour roles: graphite ground, fog type. Never pure black against pure white.
          Greys between the brand values are mixed from them. ---- */
  --kit-bg: var(--zt-graphite);
  --kit-surface: var(--zt-graphite);         /* cards, dialogs, inputs */
  --kit-surface-quiet: color-mix(in srgb, var(--zt-fog) 6%, var(--zt-graphite)); /* panels, media placeholders */
  --kit-surface-raised: color-mix(in srgb, var(--zt-fog) 9%, var(--zt-graphite)); /* a sheet lifted off the ground */
  --kit-surface-strong: var(--zt-fog);       /* the light panel: see .kit-invert */
  --kit-on-strong: var(--zt-graphite);
  --kit-text: var(--zt-fog);
  --kit-text-muted: color-mix(in srgb, var(--zt-fog) 60%, var(--zt-graphite)); /* 6.4:1 on graphite */
  --kit-border: color-mix(in srgb, var(--zt-fog) 14%, var(--zt-graphite));     /* hairlines */
  --kit-border-control: color-mix(in srgb, var(--zt-fog) 42%, var(--zt-graphite)); /* input outlines, 3.6:1 */
  --kit-accent: var(--zt-fog);               /* primary actions, selected state */
  --kit-on-accent: var(--zt-graphite);
  --kit-scrim: color-mix(in srgb, var(--zt-ink) 60%, transparent);
  --kit-glass: color-mix(in srgb, var(--zt-graphite) 72%, transparent);  /* floating panes: menu, search */
  --kit-glass-sheen: rgb(255 255 255 / 0.07);                             /* the lit top edge of a pane */
  --kit-glass-backdrop: color-mix(in srgb, var(--zt-graphite) 55%, transparent); /* behind a modal pane */
  --kit-shadow: 0 1.5rem 4rem rgb(0 0 0 / 0.45), 0 0.25rem 1rem rgb(0 0 0 / 0.25);
  /* The brand has no status colours, so status is carried by icon, weight and words. */
  --kit-danger: var(--kit-text);
  --kit-success: var(--kit-text);

  /* ---- shape ---- */
  --kit-radius-touch: var(--zt-radius-touch);
  --kit-radius-frame: var(--zt-radius-frame);

  /* ---- type: one family, three voices. Wide for display, normal for text, condensed for labels ---- */
  --kit-font: var(--zt-font);
  --kit-font-display: var(--zt-font);
  --kit-display-stretch: var(--zt-display-stretch);
  --kit-display-weight: var(--zt-display-weight);
  --kit-display-tracking: -0.025em;
  --kit-label-stretch: 80%;
  --kit-text-weight: var(--zt-text-weight);
  --kit-font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace; /* code samples only */

  --kit-text-xs: 0.75rem;
  --kit-text-sm: 0.875rem;
  --kit-text-md: 1rem;
  --kit-text-lg: 1.1875rem;
  --kit-text-xl: 1.5rem;
  --kit-text-2xl: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --kit-text-3xl: clamp(2.25rem, 1.2rem + 4.2vw, 4.75rem);
  --kit-text-4xl: clamp(2.75rem, 1rem + 7.5vw, 8.5rem);
  --kit-text-5xl: clamp(3.5rem, 0.5rem + 13vw, 15rem); /* one line per page, at most */

  /* ---- space (4px base) ---- */
  --kit-space-1: 0.25rem;
  --kit-space-2: 0.5rem;
  --kit-space-3: 0.75rem;
  --kit-space-4: 1rem;
  --kit-space-5: 1.5rem;
  --kit-space-6: 2rem;
  --kit-space-7: 3rem;
  --kit-space-8: 4rem;
  --kit-space-9: 6rem;
  --kit-space-10: 10rem;

  /* ---- layout ---- */
  --kit-container: 100rem;
  --kit-gutter: clamp(1.25rem, 4vw, 4rem);
  --kit-measure: 58ch;
  --kit-control-h: 3rem;
  --kit-control-h-sm: 2.5rem;

  /* ---- motion: slow out, never linear. Interface feedback is quick; reveals take their time ---- */
  --kit-dur: 180ms;
  --kit-dur-reveal: 1100ms;
  --kit-stagger: 90ms;      /* the gap between items that arrive one after another, everywhere */
  --kit-ease: cubic-bezier(0.2, 0, 0, 1);
  --kit-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}
/* The page's own ground, fixed at the root. Covers (the wipe reveal) use it even inside a panel. */
:root { --kit-page: var(--kit-bg); }

/* The contrast panel: the opposite of the page (fog in dark mode, graphite in light mode), or one of
   the tints with a modifier. Everything is derived from the two
   strong-surface tokens, so it works in any theme. Do not nest one inside another. */
.kit-invert {
  --_s: var(--kit-surface-strong);
  --_o: var(--kit-on-strong);
  --kit-bg: var(--_s);
  --kit-surface: var(--_s);
  --kit-surface-quiet: color-mix(in srgb, var(--_o) 6%, var(--_s));
  --kit-surface-raised: color-mix(in srgb, var(--_o) 7%, var(--_s));
  --kit-text: var(--_o);
  --kit-text-muted: color-mix(in srgb, var(--_o) 66%, var(--_s));
  --kit-border: color-mix(in srgb, var(--_o) 14%, var(--_s));
  --kit-border-control: color-mix(in srgb, var(--_o) 55%, var(--_s));
  --kit-accent: var(--_o);
  --kit-on-accent: var(--_s);
  /* Floating panes inside the panel take the panel's own colour. */
  --kit-glass: color-mix(in srgb, var(--_s) 86%, transparent);
  background: var(--kit-bg);
  color: var(--kit-text);
}

/* Tints are light in both modes, so their type is always graphite. */
.kit-invert:is(.kit-invert--sage, .kit-invert--sand, .kit-invert--sky, .kit-invert--lilac, .kit-invert--blush) { --kit-on-strong: var(--zt-graphite); color-scheme: light; }
.kit-invert--sage { --kit-surface-strong: var(--zt-tint-sage); }
.kit-invert--sand { --kit-surface-strong: var(--zt-tint-sand); }
.kit-invert--sky { --kit-surface-strong: var(--zt-tint-sky); }
.kit-invert--lilac { --kit-surface-strong: var(--zt-tint-lilac); }
.kit-invert--blush { --kit-surface-strong: var(--zt-tint-blush); }

/* ---- light mode. The page follows the device; a stored choice (data-mode on <html>, set before
        first paint by the inline script in <head>) overrides it. Demos with data-theme are left alone.
        The two blocks below are identical: CSS cannot share one rule between a media query and an
        attribute, so change both together. ---- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]):not([data-mode="dark"]) {
    --kit-bg: var(--zt-fog);
    --kit-surface: var(--zt-fog);
    --kit-surface-quiet: color-mix(in srgb, var(--zt-graphite) 5%, var(--zt-fog));
    --kit-surface-raised: var(--zt-paper);
    --kit-surface-strong: var(--zt-graphite);
    --kit-on-strong: var(--zt-fog);
    --kit-text: var(--zt-graphite);
    --kit-text-muted: color-mix(in srgb, var(--zt-graphite) 66%, var(--zt-fog));
    --kit-border: color-mix(in srgb, var(--zt-graphite) 12%, var(--zt-fog));
    --kit-border-control: color-mix(in srgb, var(--zt-graphite) 48%, var(--zt-fog));
    --kit-accent: var(--zt-graphite);
    --kit-on-accent: var(--zt-fog);
    --kit-scrim: color-mix(in srgb, var(--zt-graphite) 35%, transparent);
    --kit-glass: color-mix(in srgb, var(--zt-fog) 58%, transparent);
    --kit-glass-sheen: rgb(255 255 255 / 0.75);
    --kit-glass-backdrop: color-mix(in srgb, var(--zt-graphite) 16%, transparent);
    --kit-shadow: 0 1.5rem 4rem rgb(22 22 22 / 0.16), 0 0.25rem 1rem rgb(22 22 22 / 0.08);
    color-scheme: light;
  }
}
:root[data-mode="light"]:not([data-theme]) {
  --kit-bg: var(--zt-fog);
  --kit-surface: var(--zt-fog);
  --kit-surface-quiet: color-mix(in srgb, var(--zt-graphite) 5%, var(--zt-fog));
  --kit-surface-raised: var(--zt-paper);
  --kit-surface-strong: var(--zt-graphite);
  --kit-on-strong: var(--zt-fog);
  --kit-text: var(--zt-graphite);
  --kit-text-muted: color-mix(in srgb, var(--zt-graphite) 66%, var(--zt-fog));
  --kit-border: color-mix(in srgb, var(--zt-graphite) 12%, var(--zt-fog));
  --kit-border-control: color-mix(in srgb, var(--zt-graphite) 48%, var(--zt-fog));
  --kit-accent: var(--zt-graphite);
  --kit-on-accent: var(--zt-fog);
  --kit-scrim: color-mix(in srgb, var(--zt-graphite) 35%, transparent);
  --kit-glass: color-mix(in srgb, var(--zt-fog) 58%, transparent);
  --kit-glass-sheen: rgb(255 255 255 / 0.75);
  --kit-glass-backdrop: color-mix(in srgb, var(--zt-graphite) 16%, transparent);
  --kit-shadow: 0 1.5rem 4rem rgb(22 22 22 / 0.16), 0 0.25rem 1rem rgb(22 22 22 / 0.08);
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root { --kit-dur: 0ms; --kit-dur-reveal: 0ms; }
}
