/* Reset, typography, focus states, accessibility. */
*, *::before, *::after { box-sizing: border-box; }
/* Hide scrollbars on every viewport (phone + desktop); scrolling still works. */
*, *::before, *::after { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
[lang="en"] body { line-height: 1.7; }
h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }
strong, b { font-weight: 700; }
::selection { background: var(--accent-soft); color: var(--accent-deep); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-xs); }
.skip-link {
  position: absolute; inset-inline-start: -999px; top: 0; z-index: 999;
  background: var(--surface); color: var(--text);
  padding: var(--space-3) var(--space-4);
  border: var(--border-w) solid var(--border-strong);
  border-radius: var(--radius-sm);
}
.skip-link:focus { inset-inline-start: var(--space-4); top: var(--space-4); }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--font-mono); font-weight: 400; letter-spacing: 0.02em; }
[dir="rtl"] .mono, [dir="rtl"] .section-index, [dir="rtl"] .num { direction: ltr; unicode-bidi: isolate; }

/* Only hide reveal items when JS is available to unhide them. */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 620ms var(--ease), transform 620ms var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
