/* Raidu - base element defaults + link styling.
   Kept minimal so it never fights product layout. */

:root {
  color-scheme: light;
}

/* Components that pair an explicit height with padding in the same style
   rely on border-box; without this reset that padding adds on top of the
   height instead of living inside it. Consumers happened to supply their
   own reset (Tailwind preflight, docs/src/index.css) so this went unnoticed,
   but the library should not depend on the host for correct sizing. */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Headings set their own leading.
 *
 * Nothing declared one, so every heading inherited the body's --leading-normal
 * (1.55) - a 28px page title sat on a 42px line, which is body rhythm applied
 * to display type. It reads as loose rather than generous, and it costs about
 * a third of a line on every heading in the app.
 *
 * Tight leading and a touch of negative tracking are what the type scale was
 * designed for: --tracking-tight is documented as the display setting and had
 * no global consumer either. Margins are deliberately not set here, so nothing
 * that already spaces its own headings shifts. */
:where(h1, h2, h3, h4, h5, h6) {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

/* Only the largest sizes want the tightest setting; a 15px h4 at 1.12 is
   cramped, not crisp. */
:where(h4, h5, h6) {
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-normal);
}

body {
  font-family: var(--font-sans);
  /* 14px, not 16. This system dresses console UI, where 14 is the working base
     and 16 is already a heading step. Text that wants the document scale asks
     for --text-base explicitly rather than relying on what body happens to be. */
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--text);
  background: var(--bg);
  /* Deliberately no -webkit-font-smoothing / text-rendering override here.
     Forcing `antialiased` trades macOS subpixel rendering for grayscale, which
     thins every glyph and reads noticeably softer, and optimizeLegibility costs
     layout time for kerning most UI copy never needs. Don't reintroduce them. */
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}
a:hover { color: var(--link-hover); }

::selection {
  background: var(--violet-200);
  color: var(--ink-900);
}

/* Machine-truth text (hashes, IDs, timings, costs): Switzer with tabular
   figures and a slashed zero, so digits line up and 0 never reads as O.
   Components set var(--font-mono) inline, so the attribute selector catches
   them without each component carrying the feature settings. */
.raidu-mono,
.font-mono,
[style*="--font-mono"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums slashed-zero;
  letter-spacing: 0;
}

/* Keyboard focus ring for interactive components used outside .dash-surface.
   Inside .dash-surface the per-surface rules in dashboard.css take over.
   Apply this class to any element that has tabIndex and onKeyDown but is not
   a native <button> or <a> (which already show focus from the browser or
   dashboard.css). The 3px --focus-ring matches the dashboard.css ring exactly
   so the two contexts look the same. */
.rds-focusable:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
