/* Global stylesheet "Base" (create second). Element defaults only; nothing here belongs to a single class.
   The Etch reset (@layer etch-reset) already zeroes margins, sets border-box, makes media block. */

html {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 100%;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-5);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Studio's reset sets body { font-family: system-ui }, so the family is set on body, not only on html. */
body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

/* Optical sizing follows the font size (browser default, stated so it is not lost to a reset).
   The display classes pin "opsz" 96 to match the canvas, which overrides this where set. */
h1, h2, h3 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  text-wrap: balance;
}
p, li { text-wrap: pretty; }

a { color: inherit; }
a:hover { color: var(--color-emerald); }

/* One focus style everywhere; dark surfaces swap the colour with data-surface="ink". */
:focus-visible {
  outline: 3px solid var(--color-emerald);
  outline-offset: 3px;
}
[data-surface="ink"] :focus-visible { outline-color: var(--color-mint); }
