:root {
  --bg: #f5f3ee;
  --bg-alt: #ece8df;
  --surface: #fcfbf8;
  --surface-soft: #f3efe6;
  --surface-strong: #e7f0eb;
  --text: #1e262a;
  --muted: #5d6a71;
  --border: rgba(30, 38, 42, 0.12);
  --border-strong: rgba(30, 38, 42, 0.22);
  --accent: #2e6c62;
  --accent-soft: #d7e5df;
  --shadow: 0 12px 32px rgba(43, 50, 46, 0.06);
  --wrap: min(1100px, calc(100vw - 2rem));
  --radius: 20px;
  --radius-sm: 14px;
  --font-sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  background:
    linear-gradient(180deg, rgba(215, 229, 223, 0.45) 0%, transparent 14%),
    linear-gradient(180deg, #f8f6f1 0%, var(--bg) 100%);
}

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

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

code,
pre {
  font-family: var(--font-mono);
}

.wrap {
  width: var(--wrap);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(245, 243, 238, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(30, 38, 42, 0.08);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-logo {
  width: 2rem;
  height: 2rem;
  display: block;
  flex: 0 0 auto;
}

.site-nav,
.hero-actions,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.site-nav {
  color: var(--muted);
  font-size: 0.95rem;
}

.header-link,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.header-link:hover,
.button:hover,
.card:hover,
.limit-card:hover,
.doc-card:hover,
.mini-card:hover,
.code-card:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 4rem 0 2.8rem;
}

.hero-grid,
.grid-two,
.feature-grid,
.limit-grid,
.docs-grid,
.split {
  display: grid;
  gap: 1rem;
}

.hero-copy,
.summary-panel {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 800;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 5.8vw, 4.9rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 45rem;
  color: var(--muted);
  font-size: clamp(1.03rem, 2vw, 1.2rem);
}

.lead-secondary {
  margin-top: 0.85rem;
}

.hero-actions {
  margin-top: 1.5rem;
}

.button {
  font-weight: 700;
}

.button.primary {
  background: var(--accent);
  color: #f7f4ed;
  border-color: var(--accent);
}

.button.primary:hover {
  background: #275d54;
}

.button.secondary {
  background: rgba(252, 251, 248, 0.7);
}

.summary-panel {
  display: grid;
  gap: 1rem;
}

.mini-card,
.card,
.limit-card,
.code-card,
.doc-card,
.note-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.mini-card,
.card,
.limit-card,
.doc-card,
.note-panel {
  padding: 1.25rem;
}

.mini-card h2,
.card h3,
.limit-card h3 {
  margin-bottom: 0.55rem;
}

.plain-list,
.check-list {
  margin: 0;
  padding-left: 1.15rem;
}

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

.section {
  padding: 3.7rem 0;
}

.section-alt {
  background: linear-gradient(180deg, rgba(236, 232, 223, 0.7) 0%, rgba(245, 243, 238, 0) 100%);
}

.section-heading {
  max-width: 44rem;
  margin-bottom: 1.8rem;
}

.section-heading h2 {
  margin-bottom: 0.2rem;
  font-size: clamp(1.9rem, 3.8vw, 3rem);
  letter-spacing: -0.03em;
}

.section-heading p,
.section-copy,
.mini-card p,
.card p,
.limit-card p,
.doc-card span,
.code-note,
.note-panel p {
  color: var(--muted);
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.grid-two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card.emphasis {
  background: linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
}

.limit-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.limit-card {
  background: var(--surface-soft);
}

.note-panel {
  background: linear-gradient(180deg, rgba(215, 229, 223, 0.65) 0%, rgba(252, 251, 248, 0.96) 100%);
}

.code-card {
  padding: 1rem;
  background: #f0ece3;
}

.code-card pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #faf8f2;
  font-size: 0.9rem;
}

.code-note {
  margin: 0.8rem 0 0;
}

.docs-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.doc-card {
  display: block;
}

.doc-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

@media (min-width: 920px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 1.5rem;
    align-items: start;
  }

  .split {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    align-items: start;
  }
}

@media (max-width: 899px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 0.8rem 0 1rem;
  }

  .site-nav {
    order: 3;
    width: 100%;
  }
}

@media (max-width: 759px) {
  :root {
    --wrap: calc(100vw - 1.25rem);
  }

  .hero {
    padding-top: 2.8rem;
  }

  h1 {
    max-width: 100%;
  }

  .button,
  .header-link {
    width: 100%;
  }

  .hero-actions,
  .footer-links {
    flex-direction: column;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.menu-toggle {
  display: none;
  min-height: 2.6rem;
  padding: 0 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.8);
  color: var(--text);
  font: inherit;
}

.search-inline input,
.sidebar-search input {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(252, 251, 248, 0.92);
  color: var(--text);
  font: inherit;
}

.search-inline {
  width: min(240px, 100%);
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(200px, 240px);
  gap: 1.25rem;
  align-items: start;
  padding: 1.35rem 0 3rem;
}

.docs-sidebar,
.docs-toc {
  position: sticky;
  top: 5.4rem;
  max-height: calc(100vh - 6.4rem);
}

.sidebar-panel,
.toc-panel {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(252, 251, 248, 0.88);
  box-shadow: var(--shadow);
}

.sidebar-panel,
.toc-panel {
  max-height: calc(100vh - 6.4rem);
  overflow: auto;
}

.sidebar-search {
  position: relative;
  margin-bottom: 1rem;
}

.sidebar-label,
.toc-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: min(28rem, 60vh);
  overflow: auto;
  padding: 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 18px 32px rgba(30, 38, 42, 0.14);
}

.search-result {
  display: block;
  padding: 0.75rem;
  border-radius: 14px;
}

.search-result:hover {
  background: var(--surface-soft);
}

.search-result strong,
.search-result span,
.search-result p {
  display: block;
}

.search-result span,
.search-result p,
.search-empty,
.toc-empty {
  color: var(--muted);
}

.search-result span {
  margin-top: 0.15rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.search-result p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}

.nav-group {
  border-top: 1px solid rgba(30, 38, 42, 0.08);
}

.nav-group:first-of-type {
  border-top: 0;
}

.nav-group summary {
  padding: 0.9rem 0;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-links {
  display: grid;
  gap: 0.2rem;
  padding: 0 0 0.9rem;
}

.nav-link,
.toc-link {
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  color: var(--muted);
}

.nav-link:hover,
.toc-link:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-link.is-active,
.nav-link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.toc-links {
  display: grid;
  gap: 0.15rem;
}

.toc-link-sub {
  padding-left: 1.15rem;
  font-size: 0.94rem;
}

.docs-main {
  min-width: 0;
}

.docs-article {
  padding: clamp(1.2rem, 2.4vw, 2rem);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(252, 251, 248, 0.92);
  box-shadow: var(--shadow);
}

.docs-article h1 {
  max-width: none;
  margin-bottom: 1.2rem;
  font-size: clamp(2.2rem, 4vw, 3.3rem);
}

.docs-article h2,
.docs-article h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 6.2rem;
}

.docs-article h2 {
  font-size: clamp(1.55rem, 2.2vw, 2.1rem);
}

.docs-article h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
}

.docs-article p,
.docs-article li,
.docs-article td,
.docs-article th,
.docs-article blockquote {
  max-width: 74ch;
}

.docs-article ul,
.docs-article ol {
  padding-left: 1.3rem;
}

.docs-article li + li {
  margin-top: 0.35rem;
}

.docs-article pre {
  overflow: auto;
  padding: 1rem;
  border-radius: 16px;
  background: #f0ece3;
  border: 1px solid var(--border);
}

.code-block-shell {
  position: relative;
}

.code-block-shell pre {
  margin: 0;
  padding-top: 3rem;
}

.copy-button {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(252, 251, 248, 0.92);
  color: var(--muted);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.copy-button:hover {
  background: var(--surface);
  color: var(--text);
  transform: translateY(-1px);
}

.copy-button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.copy-button.is-copied {
  background: var(--accent-soft);
  border-color: rgba(46, 108, 98, 0.3);
  color: var(--accent);
}

.copy-button.is-copy-error {
  background: #f6dfd8;
  border-color: rgba(146, 61, 31, 0.25);
  color: #923d1f;
}

.docs-article code {
  padding: 0.08rem 0.28rem;
  border-radius: 7px;
  background: rgba(46, 108, 98, 0.1);
}

.docs-article pre code {
  padding: 0;
  background: transparent;
}

.docs-article blockquote {
  margin: 1.2rem 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--accent-soft);
  color: var(--muted);
}

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

.table-wrap {
  width: 100%;
  overflow: auto;
}

.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1rem 0;
  background: #fffdf9;
}

.docs-article th,
.docs-article td {
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(30, 38, 42, 0.09);
  text-align: left;
  vertical-align: top;
}

.docs-article th {
  background: var(--surface-soft);
}

.hero-docs {
  padding: 1rem 0 2rem;
}

.docs-band {
  padding: 0 0 2.2rem;
}

.docs-band-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
}

.docs-band-copy,
.docs-band-action {
  min-width: 0;
}

.docs-band-action {
  position: relative;
}

.documentation-section {
  position: relative;
}

.documentation-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(46, 108, 98, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(236, 232, 223, 0.82) 0%, rgba(245, 243, 238, 0) 100%);
  pointer-events: none;
}

.documentation-intro {
  position: relative;
  display: grid;
  gap: 1rem;
  align-items: start;
}

.documentation-search {
  position: relative;
  min-width: 0;
}

.documentation-search-label {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 800;
}

.documentation-search input {
  width: 100%;
  min-height: 3rem;
  padding: 0.82rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(252, 251, 248, 0.96);
  font: inherit;
}

.documentation-search-note {
  color: var(--muted);
}

.search-results-home {
  position: static;
  margin-top: 0.8rem;
  max-height: 24rem;
}

.docs-grid-home {
  position: relative;
}

.landing-shell .docs-main {
  padding-top: 0.2rem;
}

@media (max-width: 1199px) {
  .docs-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }

  .documentation-intro {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 920px) {
  .docs-band-grid,
  .documentation-intro {
    grid-template-columns: minmax(0, 0.9fr) minmax(300px, 0.75fr);
  }
}

@media (max-width: 919px) {
  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-sidebar {
    position: fixed;
    inset: 5rem auto 1rem 0.75rem;
    z-index: 25;
    width: min(330px, calc(100vw - 1.5rem));
    transform: translateX(-115%);
    transition: transform 180ms ease;
  }

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

  .search-inline {
    display: none;
  }
}
