/* Theme-independent design tokens: layout constants, typography, and alias
   variables that simply defer to the active theme's real tokens (--bg refers
   to --background, etc.) - these never change value across themes, so they
   live here once instead of being repeated in every themes/*.css file.
   Must load before themes/*.css so theme blocks can still reference the
   aliases if needed, though in practice CSS var resolution is lazy (happens
   at used-time, not declared-time) so load order relative to themes doesn't
   actually affect correctness here - this file is just conventionally first. */
:root{
  --max:1280px;
  --container-pad:24px;
  --font:"Geist", ui-sans-serif, system-ui, sans-serif;
  --mono:"Geist Mono", ui-monospace, monospace;
  --display:"Michroma", ui-sans-serif, system-ui, sans-serif;

  /* aliases - resolve against whatever theme is active */
  --bg:var(--background);
  --bg-soft:var(--card);
  --bg-card:var(--card);
  --border-strong:var(--border);
  /* The site's recurring "subtle border" treatment (cards, dividers, popups, etc.) -
     was hand-typed at each usage site until it became the single most-repeated value in
     the whole CSS tree; one token here instead so it only has to change in one place. */
  --border-soft:color-mix(in oklab, var(--border) 30%, transparent);
  --hero-border:color-mix(in oklab, var(--border-soft) 50%, transparent);
  /* Settled at 30%. Tags (.taxo-chip, including the --t2/--t3/--t4 size tiers), the
     taxonomy search input (.taxo-search input), and category pills (.cat-pill) all mix
     their border off this instead of using var(--border)/var(--foreground) directly, so
     it only has to change in one place. */
  --tag-border-opacity:30%;
  --text:var(--foreground);
  --dim:var(--muted-foreground);
  --type-scale:1.1;
  --tag-link-border:color-mix(in oklab,var(--border) 75%,transparent);
  --safe-bottom-inset:env(safe-area-inset-bottom,0px);
  --frame-border:color-mix(in oklab,var(--border-soft) 55%,transparent);
  --category-pill-bg:color-mix(in srgb,var(--foreground) 8%,var(--background));
  --category-pill-hover-bg:color-mix(in srgb,var(--foreground) 14%,var(--background));
  --home-panel-bg:color-mix(in srgb,black 95%,white);
}

:root[data-theme="light"]{--home-panel-bg:var(--code-header-bg);}
@supports (color:color(from white srgb r g b)){
  :root[data-theme="light"]{
    --home-panel-bg:color(from var(--code-header-bg) srgb calc(r * 1.02) calc(g * 1.02) calc(b * 1.02));
  }
}
