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

@font-face {
  font-family: "JetBrains Mono";
  src: local("JetBrains Mono"), local("JetBrainsMono-Regular");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #1a1a1a;
  --muted: #4a4a4a;
  --action: #0066ff;
  --line: #4a4a4a;
  --type: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --metadata: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --measure: 42.5rem;
  --body-size: 1.25rem;
  --rhythm: 0.5rem;
  --gutter: 2rem;
  --section-gap: clamp(4rem, 8vw, 8rem);
  --radius: 0.5rem;
  --focus: 2px solid var(--ink);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }
body {
  margin: 0;
  padding: 4rem var(--gutter);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--type);
  font-size: var(--body-size);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
body > header, main, body > footer { max-width: var(--measure); margin-inline: auto; }
body > header { margin-bottom: 4rem; }
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  border-radius: 2px;
}
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, summary:focus-visible { outline: var(--focus); outline-offset: 4px; }
body > a:first-of-type {
  position: absolute;
  top: 1rem;
  left: var(--gutter);
  padding: 0.5rem 1rem;
  min-height: 44px;
  background: var(--paper);
  transform: translateY(-12rem);
}
body > a:first-of-type:focus { transform: translateY(0); }
body > header > a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
}
body > header nav { margin-top: 1.5rem; }
details { border-block: 1px solid var(--line); }
summary {
  cursor: pointer;
  min-height: 52px;
  padding-block: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
}
details > a {
  display: block;
  padding: 1rem 0;
  min-height: 56px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  font-size: 1rem;
}
details b { display: block; font-family: var(--metadata); font-size: 1rem; font-weight: 500; }
details a span { display: block; color: var(--muted); }
details a[aria-current] { border-inline-start: 2px solid var(--ink); padding-left: 1rem; }
details a:hover b, details a:focus-visible b { text-decoration: underline; text-underline-offset: 0.25em; }
main > nav[aria-label="Breadcrumb"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  font-size: 1rem;
  color: var(--muted);
}
main > nav[aria-label="Breadcrumb"] a { display: flex; align-items: center; min-height: 44px; min-width: 44px; }
article > header > p:first-child {
  font-family: var(--metadata);
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 0.015em;
  margin-block: 0 1rem;
}
h1, h2, h3 { font-weight: 700; letter-spacing: -0.035em; overflow-wrap: normal; }
h1 { margin: 0 0 1.5rem; font-size: 2.25rem; line-height: 1.12; text-wrap: balance; }
body:has([data-primary]) h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { margin: 0 0 1.5rem; font-size: 1.5rem; line-height: 1.25; }
h3 { margin: 2.5rem 0 0.75rem; font-size: 1.25rem; line-height: 1.4; letter-spacing: -0.015em; }
p { margin: 0 0 1.25rem; }
article > header > p:last-of-type { color: var(--muted); font-size: 1.25rem; line-height: 1.6; }
article > section { margin-top: var(--section-gap); }
section > :last-child { margin-bottom: 0; }
[data-primary] {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
  min-height: 52px;
  margin-top: 1rem;
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  background: var(--action);
  color: var(--paper);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
}
[data-primary]:hover { text-decoration: underline; }
[data-primary]:focus-visible { outline-color: var(--action); }
figure { margin: 2.5rem 0 0; }
img { display: block; width: 100%; height: auto; aspect-ratio: 7 / 3; color: var(--muted); font-size: 1rem; }
figcaption { margin-top: 1rem; color: var(--muted); font-size: 1rem; }
[data-evidence] { border-top: 1px solid var(--line); padding-top: 2rem; }
[data-evidence] > div + div { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1rem; }
[data-evidence] h3 { margin-top: 0; }
[data-evidence] h3 a { display: flex; align-items: center; min-height: 44px; padding-block: 0.5rem; font-size: inherit; font-weight: 700; }
[data-evidence] p { color: var(--muted); }
main > nav[aria-label="Continue the reading"] { margin-top: 4rem; border-top: 1px solid var(--line); }
main > nav[aria-label="Continue the reading"] a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
  padding-block: 1rem;
  font-size: 1rem;
  font-weight: 500;
}
body > footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; }
footer a { display: inline-flex; align-items: center; min-height: 44px; padding-block: 0.5rem; }
progress {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  border: 0;
  appearance: none;
  accent-color: var(--ink);
  background: var(--paper);
  pointer-events: none;
}
progress[hidden] { display: none; }
progress::-webkit-progress-bar { background: var(--paper); }
progress::-webkit-progress-value { background: var(--ink); }
progress::-moz-progress-bar { background: var(--ink); }

@media (max-width: 480px) {
  :root { --gutter: 1.5rem; --body-size: 1.125rem; }
  body { padding-block: 2rem; }
  body > header { margin-bottom: 3rem; }
  h1 { font-size: 2.25rem; }
  article > header > p:last-of-type { font-size: 1.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
