:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --panel: #fffefa;
  --ink: #171613;
  --muted: #6f6a60;
  --line: #e7e0d4;
  --soft: #f2eee6;
  --accent: #0f766e;
  --accent-ink: #ffffff;
  --gold: #b7791f;
  --code-bg: #151410;
  --code-ink: #f7f0df;
  --shadow: 0 22px 60px rgba(38, 31, 18, 0.12);
  --sidebar: 286px;
  --toc: 210px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(15, 118, 110, 0.045) 1px, transparent 1px),
    var(--bg);
  background-size: 46px 46px;
  color: var(--ink);
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre,
kbd {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 254, 250, 0.92);
  backdrop-filter: blur(14px);
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #f7f0df;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-trigger {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  cursor: pointer;
  padding: 10px 12px;
  font: inherit;
}

kbd {
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--panel);
  padding: 1px 6px;
  font-size: 11px;
}

.nav {
  margin-top: 24px;
}

.nav p,
.toc p {
  margin: 24px 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav a,
.toc a {
  display: block;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.nav a {
  padding: 9px 10px;
}

.nav a:hover,
.nav a.active {
  background: #e8f3f1;
  color: #0b5e58;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 820px) var(--toc);
  gap: 54px;
  justify-content: center;
  padding: 0 34px 80px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  grid-column: 1 / -1;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(231, 224, 212, 0.7);
  background: rgba(251, 250, 247, 0.86);
  backdrop-filter: blur(12px);
}

.menu-button {
  display: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.button,
.primary,
.secondary,
.copy {
  border-radius: 8px;
  font-family: inherit;
  font-weight: 700;
}

.button,
.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button {
  padding: 8px 12px;
}

.doc {
  min-width: 0;
}

.hero {
  padding: 72px 0 28px;
}

.eyebrow {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.93;
  letter-spacing: 0;
}

.hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.72;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 22px;
}

.article-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 254, 250, 0.72);
  color: var(--muted);
  padding: 5px 10px;
  font-size: 13px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.primary,
.secondary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
}

.secondary {
  border: 1px solid var(--line);
  background: var(--panel);
}

.notice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  color: var(--muted);
}

.notice code,
:not(pre) > code {
  border: 1px solid #ded6c8;
  border-radius: 6px;
  background: #f6f1e8;
  color: #7c4a03;
  padding: 2px 6px;
  font-size: 0.9em;
}

section {
  scroll-margin-top: 86px;
  padding-top: 48px;
}

.visual {
  margin: 24px 0 10px;
}

.visual img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

figcaption {
  margin-top: 9px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.directory {
  padding-top: 34px;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.directory-grid a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.directory-grid a:hover {
  border-color: #9ac7c1;
  transform: translateY(-1px);
}

.directory-grid strong,
.directory-grid span {
  display: block;
}

.directory-grid span {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

h2 {
  margin-bottom: 12px;
  font-size: 32px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

section > p,
li,
details p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.72;
}

ul {
  padding-left: 22px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.steps div,
.cards div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.cards p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #c7dfdb;
  border-radius: 8px;
  background: #e8f3f1;
  padding: 16px 18px;
  color: #0b5e58;
}

.callout strong {
  flex: 0 0 auto;
}

.steps span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #e8f3f1;
  color: var(--accent);
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 15px;
  text-align: left;
}

th {
  color: #4f4638;
  font-size: 13px;
}

td {
  color: var(--muted);
}

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

pre {
  overflow-x: auto;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 18px;
  font-size: 14px;
  line-height: 1.72;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #29261f;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #252219;
  color: #d8c9aa;
  padding: 9px 12px;
  font-size: 13px;
}

.code-header + pre {
  margin-top: 0;
  border-radius: 0 0 8px 8px;
}

.copy {
  border: 1px solid #4a4334;
  background: #332f24;
  color: #f7f0df;
  cursor: pointer;
  padding: 5px 9px;
}

details {
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 54px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.pager a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.pager a:last-child {
  text-align: right;
}

.pager span,
.pager strong {
  display: block;
}

.pager span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 13px;
}

.toc {
  position: sticky;
  top: 88px;
  height: max-content;
  padding-top: 18px;
}

.toc a {
  padding: 6px 0;
}

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

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: start center;
  background: rgba(23, 22, 19, 0.3);
  padding-top: 10vh;
}

.search-modal[hidden] {
  display: none;
}

.search-panel {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.search-box button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  cursor: pointer;
  padding: 7px 10px;
}

.search-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 8px;
}

.search-results a {
  display: block;
  border-radius: 8px;
  padding: 12px;
}

.search-results a:hover {
  background: #e8f3f1;
}

.search-results strong {
  display: block;
}

.search-results span {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1120px) {
  .content {
    grid-template-columns: minmax(0, 820px);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 12;
    width: min(86vw, 320px);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .content {
    padding: 0 20px 60px;
  }

  .topbar {
    justify-content: space-between;
  }

  .menu-button {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    font-size: 20px;
  }

  .top-actions a:not(.button) {
    display: none;
  }

  .hero {
    padding-top: 52px;
  }

  .hero p {
    font-size: 17px;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .directory-grid,
  .pager {
    grid-template-columns: 1fr;
  }

  .pager a:last-child {
    text-align: left;
  }

  .search-box {
    grid-template-columns: 1fr auto;
  }

  .search-box span {
    display: none;
  }
}
