/* Colour.
   Dark is the default and is declared on :root, so a component opened on its own is already
   correct. Light is a class on an ancestor — .theme-light on <html> in the product — which is
   why a page exists once in the markup instead of twice.

   The palette is deliberately small: one canvas, one surface, one translucent raise, three
   inks, two hairlines, three brand values. There is no colour for "warning", "danger" or
   "info": the interface never needs to shout, and a fourth accent would break the rule that
   caps the brand at two elements per section. */

:root {
  /* Ground */
  --canvas: oklch(0.19 0.01 60);
  --surface: oklch(0.215 0.01 60);
  /* Hover fills and chips. Translucent on purpose, so one value works on either theme. */
  --surface-raised: oklch(0.95 0.0015 60 / 0.075);

  /* Ink, three steps. --ink for headings and card titles, --ink-subtle one step down for
     serif paragraphs and footer links, --ink-muted for all running copy and every mono label. */
  --ink: oklch(0.95 0.003 60);
  --ink-subtle: oklch(0.798 0.003 60);
  --ink-muted: oklch(0.684 0.003 60);

  /* Edges. The system draws divisions, never elevation. */
  --hairline: oklch(0.95 0.0015 60 / 0.075);
  --hairline-strong: oklch(0.95 0.0014 60 / 0.135);

  /* Brand. --brand is the accent that reads on the canvas; --brand-solid is the only filled
     action and is identical in both themes; --brand-border is the edge on anything filled. */
  --brand: #3ecf8e;
  --brand-solid: #1d744d;
  --brand-border: rgba(62, 207, 142, 0.3);
  /* The label on a filled button: near-white ink on dark, pure white on light, so the filled
     button reads the same in both. */
  --accent-foreground: oklch(0.95 0.003 60);
  /* The hero's beam colour. A theme token rather than a variable on .yd-hero-glow: the light
     value is a different colour, not a different opacity, and only the theme knows which. */
  --beam: rgba(62, 207, 142, 0.62);

  color-scheme: dark;
}

/* Illustration tokens, derived so the artwork follows the theme by itself. Keep them as
   color-mix expressions: a flattened hex is a value that has stopped tracking light mode. */
:root {
  --paper: color-mix(in oklab, var(--surface) 80%, var(--ink));
  --edge: color-mix(in srgb, var(--ink) 30%, transparent);
  --cable: var(--ink-muted);
  --cable-back: color-mix(in oklab, var(--ink-muted) 46%, var(--canvas));
  --shell: color-mix(in oklab, var(--surface) 78%, var(--ink));
  --screen: color-mix(in oklab, var(--canvas) 86%, var(--ink));
  --desk: color-mix(in oklab, var(--canvas) 92%, var(--surface));
}

.theme-light {
  --canvas: oklch(0.97 0.006 159);
  --surface: oklch(0.995 0.004 159);
  --surface-raised: oklch(0.15 0.008 159 / 0.05);
  --ink: #141815;
  --ink-subtle: #414843;
  --ink-muted: #5f6762;
  --hairline: oklch(0.15 0.008 159 / 0.1);
  --hairline-strong: oklch(0.15 0.008 159 / 0.18);
  --brand: #1f7c52;
  --brand-solid: #1d744d;
  --brand-border: rgba(31, 124, 82, 0.3);
  --accent-foreground: #ffffff;
  --beam: rgba(31, 124, 82, 0.4);
  /* The two cables are the only illustration tokens the light theme overrides outright: the
     derived mixes go the wrong way on paper. */
  --cable: #3f4844;
  --cable-back: #98a09b;
  color-scheme: light;
}
