:root {
  color-scheme: light dark;
  --background: #f8faf9;
  --surface: #ffffff;
  --text: #17211f;
  --muted: #52615d;
  --line: #d8e1de;
  --accent: #006c5b;
  --accent-strong: #005247;
  --accent-soft: #e3f2ed;
  --focus: #b04a00;
  --code: #f0f4f3;
  --max-width: 74rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101614;
    --surface: #18201e;
    --text: #edf4f1;
    --muted: #b8c6c1;
    --line: #34433f;
    --accent: #6bd9c2;
    --accent-strong: #9be9d9;
    --accent-soft: #173e35;
    --focus: #ffb36f;
    --code: #202a27;
  }
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-strong);
}

a:focus-visible {
  border-radius: 0.2rem;
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.18rem;
}

.shell {
  width: min(calc(100% - 2rem), var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  transform: translateY(-180%);
  border-radius: 0.35rem;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 0 0 0.15rem var(--focus);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 2.2rem;
  height: 2.2rem;
  display: inline-grid;
  place-items: center;
  border-radius: 0.55rem;
  background: var(--accent);
  color: var(--surface);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem 1rem;
  font-size: 0.94rem;
}

.primary-nav a {
  padding-block: 0.35rem;
  color: var(--muted);
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  color: var(--accent-strong);
}

.primary-nav a[aria-current="page"] {
  box-shadow: inset 0 -0.14rem var(--accent);
}

.content {
  width: min(calc(100% - 2rem), 54rem);
  flex: 1;
  padding-block: clamp(2.25rem, 6vw, 5rem);
}

h1,
h2,
h3 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0 0 1.6rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.035em;
}

h2 {
  margin: 3rem 0 1rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.2rem;
}

p,
ul,
ol,
blockquote,
table {
  margin-block: 0 1.1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.4rem;
}

blockquote {
  margin-inline: 0;
  padding: 0.85rem 1rem;
  border-left: 0.25rem solid var(--accent);
  background: var(--accent-soft);
}

blockquote > :last-child {
  margin-bottom: 0;
}

hr {
  margin-block: 2.5rem;
  border: 0;
  border-top: 1px solid var(--line);
}

code {
  padding: 0.12rem 0.3rem;
  border-radius: 0.25rem;
  background: var(--code);
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

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

th,
td {
  padding: 0.65rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.headerlink {
  margin-left: 0.4rem;
  color: var(--muted);
  font-size: 0.72em;
  opacity: 0;
  text-decoration: none;
}

h2:hover .headerlink,
h3:hover .headerlink,
.headerlink:focus {
  opacity: 1;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner nav {
  display: flex;
  gap: 1rem;
}

.error-page {
  min-height: 48vh;
  display: grid;
  align-content: center;
  justify-items: start;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  padding: 0.65rem 0.9rem;
  border-radius: 0.4rem;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-strong);
  color: var(--surface);
}

@media (max-width: 52rem) {
  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-block: 1rem;
  }

  .primary-nav {
    justify-content: flex-start;
  }
}

@media print {
  :root {
    --background: #ffffff;
    --surface: #ffffff;
    --text: #000000;
    --muted: #333333;
    --line: #bbbbbb;
    --accent: #000000;
    --accent-strong: #000000;
    --accent-soft: #f2f2f2;
  }

  .site-header,
  .site-footer,
  .skip-link,
  .headerlink {
    display: none;
  }

  .content {
    width: 100%;
    padding: 0;
  }

  a {
    color: inherit;
  }
}
