/* =============================================================================
 * burst.tokens.css - design tokens + type scale
 * =============================================================================
 * Replaces the full Tailwind 2.2.19 CDN build (2.93 MB raw / 250 KB gz), of
 * which 2,774 bytes actually matched anything on the homepage (0.09%).
 *
 * DUAL IDENTITY. One stylesheet serves two sites. The <html> tag carries
 * data-site, and only --brand* changes:
 *   data-site="burstlabs"  studio    -> product blue  (Remnara/Provn family)
 *   data-site="burstnodes" analytics -> Flare crimson (Flare-native family)
 *
 * THEMING follows the existing runtime, which toggles `dark-mode` on <body>
 * (see frontend/src/lib/theme.js). The no-JS default is light. Do not switch
 * this to prefers-color-scheme alone or the toggle stops working.
 * ========================================================================== */

/* Variables live in burst.vars.css, which base.html loads first. */

/* =============================================================================
 * Reset. Tailwind's preflight zeroed h1-h6 to 1em and nothing ever restored a
 * scale, so every <h2> and <h3> on the site rendered at 16px, identical to body
 * text. That single bug is most of why the pages read flat. The scale below is
 * the fix; it is why this file exists.
 * ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.018em;
  text-wrap: balance;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem); letter-spacing: -.032em; font-weight: 800; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -.008em; }
h5 { font-size: 1rem;     font-weight: 600; letter-spacing: 0; }
h6 { font-size: .875rem;  font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-3); }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-underline-offset: 2px; }
/* Only bare text links underline on hover. Buttons are frequently marked up as
   anchors carrying utility classes, and underlining those made them read as
   links rather than controls. */
a:not([class]):hover, a.link:hover { text-decoration: underline; }
a[class]:hover { text-decoration: none; }

img, svg, video { max-width: 100%; }
img, video { height: auto; }

hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

code, pre, .mono { font-family: var(--font-mono); }

table { border-collapse: collapse; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }

/* Tap targets: header and footer controls are covered in burst.chrome.css. */
.btn { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --- Compatibility aliases -------------------------------------------------
 * The per-page stylesheets lifted out of the old templates reference the
 * original variable names. Mapping them here means that CSS keeps working
 * unchanged while everything routes through the new tokens, so pages can be
 * migrated off these names one at a time instead of in a single risky sweep. */
:root, body.dark-mode {
  --bg:      var(--ground);
  --bg-2:    var(--surface);
  --card:    var(--surface);
  --text:    var(--ink);
  --sub:     var(--ink-2);
  --border:  var(--line);
  --color-border-strong: var(--line-strong);
  --link:    var(--brand);
  --accent:  var(--brand);
  --flare:   var(--crimson);
  --shadow:  var(--shadow-md);
}
