/* Reset + base typography. Reads tokens only. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

p,
ul,
ol,
table,
pre,
figure {
  margin: 0 0 var(--space-3);
}

a {
  color: var(--color-accent);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
}

kbd {
  font-size: 0.82em;
  padding: 1px 6px;
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--color-surface-2);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* Component display rules must never override the hidden attribute */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  /* explicit offsets: without them the box keeps its static position and can
     widen the page when it sits inside horizontally scrolled content */
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--color-text-muted);
}

.spacer {
  flex: 1;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
