/* Reset, typeface, element typography, prose and focus. Tokens come from tokens.css. */
@font-face {
  font-family: Manrope;
  src:
    url('/fonts/manrope-latin.woff2') format('woff2'),
    url('/fonts/manrope-variable.ttf') format('truetype');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  /* Manrope's common ligatures turn "(c)" into "©"; legal and technical text must render as typed. */
  font-variant-ligatures: no-common-ligatures;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}
h1,
h2,
h3,
h4 {
  color: var(--text);
  text-wrap: balance;
}
p,
li {
  text-wrap: pretty;
}
ul[role='list'],
ol[role='list'] {
  margin: 0;
  padding: 0;
  list-style: none;
}
a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}
a:hover {
  text-decoration: underline;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
}
code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}
table {
  border-collapse: collapse;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
::selection {
  background: var(--surface-selected);
  color: var(--text);
}

/* Type scale (DESIGN.md). Use these classes or the matching tokens; no other sizes. */
.t-display-1 {
  font-size: var(--text-display-1);
  line-height: 1.02;
  font-weight: var(--weight-display);
  letter-spacing: -0.035em;
}
.t-display-2 {
  font-size: var(--text-display-2);
  line-height: 1.08;
  font-weight: var(--weight-display);
  letter-spacing: -0.03em;
}
.t-title-1 {
  font-size: var(--text-title-1);
  line-height: 1.15;
  font-weight: var(--weight-title);
  letter-spacing: -0.02em;
}
.t-title-2 {
  font-size: var(--text-title-2);
  line-height: 1.25;
  font-weight: var(--weight-title);
  letter-spacing: -0.015em;
}
.t-title-3 {
  font-size: var(--text-title-3);
  line-height: 1.35;
  font-weight: var(--weight-strong);
  letter-spacing: -0.01em;
}
.t-body-lg {
  font-size: var(--text-body-lg);
  line-height: 1.6;
}
.t-body {
  font-size: var(--text-body);
  line-height: 1.6;
}
.t-body-sm {
  font-size: var(--text-body-sm);
  line-height: 1.5;
  font-weight: var(--weight-ui);
}
.t-caption {
  font-size: var(--text-caption);
  line-height: 1.45;
  font-weight: var(--weight-ui);
}
.t-micro {
  font-size: var(--text-micro);
  line-height: 1.35;
  font-weight: var(--weight-strong);
  letter-spacing: 0.01em;
}
.t-overline {
  font-size: var(--text-micro);
  line-height: 1.2;
  font-weight: var(--weight-title);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.t-muted {
  color: var(--text-muted);
}
.t-mono {
  font-family: var(--font-mono);
  font-size: var(--text-code);
}
.tabular {
  font-variant-numeric: tabular-nums;
}

/* Long-form reading: articles, legal pages, guides. Links are always underlined here. */
.prose {
  max-width: var(--reading);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--text);
}
.prose > * + * {
  margin-top: var(--space-4);
}
.prose h2 {
  margin-top: var(--space-12);
  font-size: var(--text-title-2);
  line-height: 1.25;
  font-weight: var(--weight-title);
  letter-spacing: -0.015em;
  scroll-margin-top: calc(var(--topbar) + var(--space-6));
}
.prose h3 {
  margin-top: var(--space-8);
  font-size: var(--text-title-3);
  line-height: 1.35;
  font-weight: var(--weight-strong);
}
.prose h2 + *,
.prose h3 + * {
  margin-top: var(--space-3);
}
.prose a {
  text-decoration: underline;
}
.prose ul,
.prose ol {
  padding-left: var(--space-6);
}
.prose li + li {
  margin-top: var(--space-2);
}
.prose strong {
  font-weight: var(--weight-strong);
}
.prose :not(pre) > code {
  padding: 0.12em 0.36em;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  font-size: var(--text-code-inline);
}
.prose table {
  width: 100%;
  font-size: var(--text-body-sm);
  line-height: 1.5;
}
.prose th,
.prose td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.prose th {
  font-weight: var(--weight-strong);
}

.visually-hidden {
  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: var(--space-4);
  top: -100px;
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--action);
  color: var(--on-action);
  font-weight: var(--weight-strong);
}
.skip-link:focus {
  top: var(--space-4);
}

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