/* Ownshop's design tokens: the one place the brand's colour, type, shape and
 * motion are decided.
 *
 * Read by the builder (web-app, through Tailwind's @theme) and, from the
 * landing-page pass on, by the landing page and the legal pages -- so a creator
 * going from ownshop.app to sign-up to the builder never feels they arrived
 * somewhere else. Before this, the landing page and /start were green and set
 * in Lexend while the builder was indigo in the system face.
 *
 * Plain CSS custom properties, no build step required, so a static page can
 * link this file as it is.
 *
 * Dark is the default and the brand. Light is defined from the start so it is
 * a switch rather than a rewrite: [data-theme="light"] on <html>.
 */
:root {
  color-scheme: dark;

  /* --- colour: ground and surfaces ----------------------------------------
     Three steps up from the page, each a little lighter, so a card on a panel
     on the page reads without needing a border to say so. */
  --os-bg: #0a0a0b;
  --os-surface-1: #121214;
  --os-surface-2: #18181b;
  --os-surface-3: #212125;
  --os-border: #27272b;
  --os-border-strong: #3a3a40;

  --os-fg: #f4f4f5;
  --os-fg-muted: #a1a1aa;
  --os-fg-subtle: #71717a;

  /* --- colour: brand ------------------------------------------------------
     The landing page's green. A filled control is green with near-black text
     on it -- about 12:1 -- rather than white on green, which fails AA. Green
     as TEXT on the page uses --os-brand-text, a touch lighter. */
  --os-brand: #22e04e;
  --os-brand-hover: #3ee865;
  --os-brand-text: #72f593;
  --os-brand-ink: #04140a;
  --os-brand-subtle: rgb(34 224 78 / 0.12);
  --os-brand-glow: rgb(34 224 78 / 0.18);

  /* --- colour: meaning ---------------------------------------------------- */
  --os-success: #22c55e;
  --os-warning: #f5b544;
  --os-danger: #f2555a;
  --os-info: #60a5fa;
  --os-success-subtle: rgb(34 197 94 / 0.12);
  --os-warning-subtle: rgb(245 181 68 / 0.12);
  --os-danger-subtle: rgb(242 85 90 / 0.12);
  --os-info-subtle: rgb(96 165 250 / 0.12);
  /* Status as TEXT, for a badge or a line on a subtle tint: each clears 4.5:1
     on its own subtle background and on every surface. */
  --os-success-text: #4ade80;
  --os-warning-text: #fbbf24;
  --os-danger-text: #ff8a8e;
  --os-info-text: #93c5fd;
  /* A filled destructive button, with white text on it. Not --os-danger:
     white on that is 3.4:1, which fails AA on the button that deletes an app. */
  --os-danger-solid: #c7383d;
  --os-danger-solid-hover: #b03136;

  --os-focus: #72f593;

  /* --- type ---------------------------------------------------------------
     Lexend is the brand's display face (the landing page's). Inter carries the
     interface: Lexend is wide, and at 13px in a dense panel it costs a third
     more width than Inter for the same words. */
  --os-font-display: "Lexend Variable", "Lexend", ui-sans-serif, system-ui, sans-serif;
  --os-font-sans: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --os-font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;

  /* --- shape -------------------------------------------------------------- */
  --os-radius-sm: 6px;
  --os-radius: 10px;
  --os-radius-lg: 16px;
  --os-radius-xl: 22px;

  --os-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --os-shadow: 0 4px 16px -4px rgb(0 0 0 / 0.5), 0 1px 3px rgb(0 0 0 / 0.3);
  --os-shadow-lg: 0 24px 48px -12px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.3);

  /* --- motion ------------------------------------------------------------- */
  --os-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --os-duration: 180ms;
}

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

  --os-bg: #fafafa;
  --os-surface-1: #ffffff;
  --os-surface-2: #f4f4f5;
  --os-surface-3: #ececee;
  --os-border: #e4e4e7;
  --os-border-strong: #d4d4d8;

  --os-fg: #09090b;
  --os-fg-muted: #52525b;
  --os-fg-subtle: #71717a;

  /* Green text on white needs to be much darker to read. */
  --os-brand: #16c43f;
  --os-brand-hover: #12b038;
  --os-brand-text: #0f7a2a;
  --os-brand-ink: #03130a;
  --os-brand-subtle: rgb(22 196 63 / 0.1);
  --os-brand-glow: rgb(22 196 63 / 0.14);

  --os-success: #16a34a;
  --os-warning: #b7791f;
  --os-danger: #dc2626;
  --os-info: #2563eb;
  --os-success-text: #166534;
  --os-warning-text: #92400e;
  --os-danger-text: #b91c1c;
  --os-info-text: #1d4ed8;
  --os-danger-solid: #dc2626;
  --os-danger-solid-hover: #b91c1c;

  --os-focus: #0f7a2a;

  --os-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);
  --os-shadow: 0 4px 16px -4px rgb(0 0 0 / 0.1), 0 1px 3px rgb(0 0 0 / 0.06);
  --os-shadow-lg: 0 24px 48px -12px rgb(0 0 0 / 0.18), 0 2px 6px rgb(0 0 0 / 0.06);
}

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