/* Base layer: reset, typography, layout primitives, accessibility defaults. */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-weight: 650;
  line-height: 1.25;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-lg);
}

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

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-hover);
}

small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

code,
kbd,
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

ul,
ol {
  margin: 0;
  padding-left: var(--space-5);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

::selection {
  background: var(--brand-soft);
}

.skip-link {
  left: var(--space-3);
  padding: var(--space-2) var(--space-4);
  position: absolute;
  top: var(--space-3);
  transform: translateY(-200%);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: var(--z-toast);
}

.skip-link:focus {
  transform: none;
}

.boot,
.noscript {
  margin: 0 auto;
  max-width: 34rem;
  padding: var(--space-7) var(--space-4);
  text-align: center;
}

.noscript {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: var(--space-7);
}

/* --- layout helpers --- */

.page {
  margin: 0 auto;
  max-width: 78rem;
  padding: var(--space-5) var(--space-4) var(--space-7);
}

.page--narrow {
  max-width: 42rem;
}

.stack {
  display: grid;
  gap: var(--space-4);
}

.stack-tight {
  display: grid;
  gap: var(--space-2);
}

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

.row--between {
  justify-content: space-between;
}

.row--end {
  justify-content: flex-end;
}

.grid-cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.grid-2 {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.spacer {
  flex: 1 1 auto;
}

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

.faint {
  color: var(--text-faint);
}

.strong {
  font-weight: 650;
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.sr-only {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

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