:root {
  color-scheme: light;
  --bg: #f3efe6;
  --bg-2: #e8e2d6;
  --surface: #fffdf8;
  --ink: #1a1814;
  --muted: #4f4a42;
  --line: #d9d1c3;
  --accent: #0c5c56;
  --accent-deep: #084843;
  --on-accent: #f4fffd;
  --brass: #8d4b28;
  --shadow: 0 16px 40px rgba(26, 24, 20, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --max: 72rem;
  --measure: 40rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121411;
  --bg-2: #1c1f1b;
  --surface: #191c18;
  --ink: #f3efe6;
  --muted: #c2bbb0;
  --line: #34382f;
  --accent: #8fd9d1;
  --accent-deep: #c9f3ee;
  --on-accent: #062421;
  --brass: #e0a07a;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121411;
    --bg-2: #1c1f1b;
    --surface: #191c18;
    --ink: #f3efe6;
    --muted: #c2bbb0;
    --line: #34382f;
    --accent: #8fd9d1;
    --accent-deep: #c9f3ee;
    --on-accent: #062421;
    --brass: #e0a07a;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  }
}

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

html {
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}

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

a {
  color: var(--accent-deep);
}

a:hover {
  text-decoration: none;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--surface);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  z-index: 5;
}

.skip:focus {
  top: 0.6rem;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 4;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
  flex-wrap: wrap;
  padding: 0.4rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 2rem;
  height: 2rem;
  display: block;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-left: auto;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.hero {
  padding: 4.5rem 0 3rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--brass);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 650;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.4rem);
  max-width: 16ch;
}

h2 {
  margin: 0 0 0.8rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
}

.lede {
  max-width: 42rem;
  font-size: 1.2rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0.6rem;
}

.button,
.button-quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 650;
}

.button {
  background: var(--accent);
  color: var(--on-accent);
}

.button:hover {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.button-quiet {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.note,
.fine {
  color: var(--muted);
  font-size: 0.95rem;
}

.band {
  padding: 1rem 0 3.5rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
}

.card p:last-child,
.prose p:last-child {
  margin-bottom: 0;
}

.kicker {
  margin: 0 0 0.35rem;
  color: var(--brass);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.prose {
  max-width: var(--measure);
}

.prose p,
.prose li {
  color: var(--ink);
}

.prose .muted,
.muted {
  color: var(--muted);
}

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0;
  margin: 0 0 2rem;
  list-style: none;
}

.page-hero {
  padding: 2.5rem 0 0.5rem;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 18ch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  overflow: hidden;
  display: block;
}

thead,
tbody,
tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

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

th:first-child,
td:first-child {
  width: 38%;
}

th {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-2);
}

tr:last-child td {
  border-bottom: 0;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.88em;
}

code {
  background: var(--bg-2);
  padding: 0.05rem 0.3rem;
  border-radius: 0.3rem;
}

.steps {
  padding-left: 1.2rem;
}

.steps li + li,
.plain-list li + li {
  margin-top: 0.45rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
}

.footer-links a {
  color: var(--muted);
}

.callout {
  border-left: 3px solid var(--brass);
  padding: 0.2rem 0 0.2rem 1rem;
  margin: 1.2rem 0;
}

@media (max-width: 760px) {
  .grid,
  .split {
    grid-template-columns: 1fr;
  }

  .nav {
    margin-left: 0;
    width: 100%;
  }

  .hero {
    padding-top: 2.5rem;
  }
}

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