/* Reset and element defaults. Components and pages build on these, never repeat them. */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
}

/* Devanagari needs more line height than Latin to keep matras readable. */
html[lang="hi"] body { line-height: 1.8; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-3); font-weight: 700; text-wrap: balance; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3 { line-height: 1.4; }
h1 { font-size: var(--text-hero); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); }

p { margin: 0 0 var(--space-4); }
a { color: var(--accent-strong); text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }
img, svg { max-width: 100%; }

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

table { border-collapse: collapse; width: 100%; }

details > summary { cursor: pointer; }

/* The hidden attribute must win over any display rule a component sets. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
