@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/source-serif-4.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/source-sans-3.woff2") format("woff2");
}

:root {
  --bg: #161412;
  --text: #EDE8DF;
  --muted: #8A8377;
  --hairline: #2A2622;
  --accent: #6ad4ff;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-7: 64px;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;

  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
  animation: grain 2s steps(1, end) infinite;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: filter 150ms ease;
}

a:hover {
  filter: brightness(1.15);
}

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

.site-header,
main,
.site-footer {
  max-width: 640px;
  margin-inline: auto;
  padding-inline: var(--space-3);
}

.site-header {
  padding-top: var(--space-7);
  padding-bottom: 3em;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.unit + .unit {
  margin-top: 2em;
}

.unit__question {
  font-family: var(--font-display);
  font-size: 1.3125rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5em;
}

.unit__answer {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 0.75em;
  text-align: justify;
  text-justify: inter-word;
}

.meta {
  margin-top: 3em;
}

.meta__item {
  margin-bottom: var(--space-3);
}

.meta__item:last-child {
  margin-bottom: 0;
}

.meta__question {
  font-weight: 500;
  color: var(--text);
}

.meta__answer {
  color: var(--muted);
  margin-top: 0.25em;
  text-align: justify;
  text-justify: inter-word;
}

.site-footer {
  padding-top: 3em;
  padding-bottom: var(--space-7);
}

.site-footer p {
  font-size: var(--text-sm);
  color: var(--muted);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes grain {
  0%,
  100% {
    background-position: 0 0;
  }
  25% {
    background-position: -2px 2px;
  }
  50% {
    background-position: 2px -1px;
  }
  75% {
    background-position: -1px -2px;
  }
}

.site-header,
.unit,
.meta,
.site-footer {
  animation: fade-up 300ms ease-out both;
}

.unit:nth-child(1) {
  animation-delay: 60ms;
}

.unit:nth-child(2) {
  animation-delay: 120ms;
}

.meta {
  animation-delay: 180ms;
}

.site-footer {
  animation-delay: 240ms;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
