*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
}

h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-page-title);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h2 {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

h3 {
  font-size: var(--font-size-card-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; }

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

::selection {
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
}

*::-webkit-scrollbar { width: 5px; height: 5px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-xs);
}
*::-webkit-scrollbar-thumb:hover { background: var(--color-text-subtle); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app-main,
.page-content {
  min-width: 0;
}

.type-page-title {
  font-size: var(--font-size-page-title);
  font-weight: var(--font-weight-page-title);
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.type-page-subtitle {
  font-size: var(--font-size-page-subtitle);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-subtle);
}

.type-section-title {
  font-size: var(--font-size-section-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-muted);
}

.type-card-title {
  font-size: var(--font-size-card-title);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.type-body {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-text);
}

.type-small {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-muted);
}

.type-caption {
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-regular);
  color: var(--color-text-subtle);
}

.type-label {
  font-size: var(--font-size-label);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-subtle);
  letter-spacing: var(--letter-spacing-label);
  text-transform: uppercase;
}

.type-metric {
  font-size: var(--font-size-metric);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.type-mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-small);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
