/* Reset, typography, layout primitives. */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
  transition: background-color var(--dur-med) var(--ease-out),
    color var(--dur-med) var(--ease-out);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
}

/* Large type: tighter leading, negative tracking */
.display {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}

.headline {
  font-size: clamp(1.25rem, 3.5vw, 1.625rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.body-text {
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--text);
}

.muted {
  color: var(--text-2);
}

.small {
  font-size: 0.875rem;
  line-height: 1.45;
}

p {
  margin: 0 0 var(--space-3);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

/* Visible focus everywhere. Never remove it without a replacement. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Layout primitives */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.stack > * + * {
  margin-top: var(--space-4);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.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;
}

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

@media (prefers-contrast: more) {
  :root {
    --border: #8a8a90;
    --text-2: #3a3a3e;
  }
  [data-theme="dark"] {
    --border: #8f8f96;
    --text-2: #d0d0d6;
  }
}
