/* Reset, typography, focus and motion — source of truth: UI.md §3, §11, §12 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font: var(--text-body);
  color: var(--ink);
  background: var(--canvas);
  min-height: 100vh;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--forest-900);
  font-weight: 700;
}

h1 {
  font: var(--text-page);
}
h2 {
  font: var(--text-section);
}
h3 {
  font: var(--text-card);
}
h4 {
  font: var(--text-card);
}

p {
  margin: 0;
}

a {
  color: var(--leaf-700);
  text-underline-offset: 3px;
}

img,
svg {
  max-width: 100%;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Focus — UI.md §14 */
:focus-visible {
  outline: 3px solid rgba(47, 138, 91, 0.38);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Screen-reader helpers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--surface);
  color: var(--forest-900);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-control) 0;
  font: var(--text-label);
}

.skip-link:focus {
  left: 0;
}

/* Type utilities */
.display {
  font: var(--text-display);
}
.page-title {
  font: var(--text-page);
}
.section-title {
  font: var(--text-section);
}
.card-title {
  font: var(--text-card);
}
.supporting {
  font: var(--text-supporting);
  color: var(--ink-secondary);
}
.label {
  font: var(--text-label);
}
.caption {
  font: var(--text-caption);
  color: var(--ink-tertiary);
}
.eyebrow {
  font: var(--text-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--leaf-700);
}
.muted {
  color: var(--ink-secondary);
}
.stack {
  display: flex;
  flex-direction: column;
}
.stack-2 {
  gap: var(--space-2);
}
.stack-3 {
  gap: var(--space-3);
}
.stack-4 {
  gap: var(--space-4);
}
.stack-6 {
  gap: var(--space-6);
}
.section-gap {
  margin-top: var(--space-8);
}
.text-center {
  text-align: center;
}

/* UI.md §11 — motion explains state, it does not decorate */
.button,
.nav-item,
.card,
.bottom-sheet,
.row,
.chip {
  transition: background-color 160ms ease-out, border-color 160ms ease-out,
    color 160ms ease-out, opacity 180ms ease-out, transform 140ms ease-out;
}

.button:active {
  transform: scale(0.985);
}

.rise-in {
  animation: rise-in 280ms ease-out both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
