/* ============================================
   Reset + Typography baseline
   ============================================ */

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--surface-50);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  font-weight: 600;
  color: inherit;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--chapter-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

img, svg { max-width: 100%; display: block; }

[hidden] { display: none !important; }

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--surface-0);
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border-mid);
}

/* RTL safety — keep LTR brand names readable */
[dir="ltr"] { direction: ltr; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
