/* Base styles: font, reset, typography and layout primitives. All values come from tokens.css. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
}

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

html {
  background: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  color: var(--color-heading);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-4xl);
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--text-3xl);
  letter-spacing: -0.025em;
}

h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-snug);
  letter-spacing: -0.01em;
}

h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

p,
ul,
ol,
dl,
pre,
blockquote,
figure {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

strong {
  color: var(--color-heading);
  font-weight: var(--weight-semibold);
}

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

:not(pre) > code {
  padding: 0.12em 0.38em;
  border-radius: var(--radius-sm);
  background: var(--color-inline-code-bg);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

pre {
  overflow-x: auto;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--color-code-border);
  border-radius: var(--radius-md);
  background: var(--color-code-bg);
  color: var(--color-code-text);
  font-size: var(--text-sm);
  line-height: 1.65;
  tab-size: 2;
}

pre code {
  font-size: inherit;
}

hr {
  margin: var(--space-12) 0;
  border: 0;
  border-top: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

th,
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--color-bg-subtle);
  color: var(--color-heading);
  font-weight: var(--weight-semibold);
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--space-8);
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--weight-semibold);
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--color-on-primary);
}

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