/* Reset, typography and the handful of utilities worth sharing. */

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

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

body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: 1.55;
  font-feature-settings:
    "cv05" 1,
    "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
}

h2 {
  font-size: var(--t-h2);
}

h3 {
  font-size: var(--t-h3);
}

h4 {
  font-size: var(--t-body);
  letter-spacing: -0.01em;
}

p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

li {
  list-style: none;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

img,
svg {
  max-width: 100%;
  display: block;
}

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

/* Scrollbars that belong to the palette rather than to the operating system. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--r-full);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--fg-3);
  background-clip: content-box;
}

/* ── utilities ─────────────────────────────────────────────────────── */
.num {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: -0.01em;
}

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

.dim {
  color: var(--fg-3);
}

.small {
  font-size: var(--t-small);
}

.micro {
  font-size: var(--t-micro);
}

.eyebrow {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-3);
}

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

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

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

.row-nowrap {
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: nowrap;
  min-width: 0;
}

.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.grow {
  flex: 1;
  min-width: 0;
}

.grid {
  display: grid;
  gap: var(--s4);
}

.g-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.g-3 {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.g-4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

[hidden] {
  display: none !important;
}

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