:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --paper-strong: #fffdf7;
  --ink: #17211b;
  --muted: #5c675f;
  --line: rgba(32, 42, 35, 0.16);
  --glass: rgba(255, 255, 255, 0.64);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --green: #2f6b4f;
  --green-dark: #224f3c;
  --clay: #9b5941;
  --indigo: #464a7a;
  --moss: #6a6f3d;
  --code-bg: #16211b;
  --code-ink: #edf4ed;
  --radius: 8px;
  --shadow: 0 12px 28px rgba(27, 34, 29, 0.08);
  --header-height: 74px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 33, 27, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 27, 0.055) 1px, transparent 1px),
    var(--paper);
  background-size: 64px 64px;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: rgba(244, 241, 234, 0.3);
  z-index: -1;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  min-height: 100vh;
}

.section-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.page-shell,
.section-inner,
.docs-layout,
.docs-content,
.docs-tabs,
.code-grid,
.code-panel,
.api-grid,
.stat-card,
.api-card,
.doc-list,
.filter-bar,
.timeline,
.faq-list details {
  max-width: 100%;
  min-width: 0;
}

.glass-panel {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(118%);
  -webkit-backdrop-filter: blur(18px) saturate(118%);
}

.site-header {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 20;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 68px;
  padding: 10px 12px 10px 14px;
  background: rgba(255, 255, 255, 0.76);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  color: var(--paper-strong);
  background: var(--green-dark);
  font-weight: 800;
  text-transform: uppercase;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-size: 1.02rem;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.brand small {
  color: var(--muted);
  font-size: 0.8rem;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.72);
}

.top-nav a,
.repo-link,
.button,
.copy-button,
.filter-button {
  border-radius: 8px;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.top-nav a {
  min-width: 76px;
  padding: 10px 13px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}

.top-nav a:hover,
.top-nav a.active {
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: inset 0 0 0 1px rgba(32, 42, 35, 0.08);
}

.repo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--green-dark);
  font-weight: 700;
}

.hero-section {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  display: grid;
  align-items: center;
  padding: 132px 0 72px;
  isolation: isolate;
}

.hero-media,
.hero-media img,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  opacity: 0.52;
  filter: saturate(0.95) contrast(0.94);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(244, 241, 234, 0.98) 0%, rgba(244, 241, 234, 0.94) 48%, rgba(244, 241, 234, 0.7) 100%),
    linear-gradient(0deg, rgba(244, 241, 234, 0.98) 0%, rgba(244, 241, 234, 0.28) 56%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  overflow-wrap: break-word;
}

p {
  overflow-wrap: normal;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.7rem, 5.2vw, 4.65rem);
  line-height: 1.02;
}

h1 span {
  display: block;
}

.title-mobile {
  display: none;
}

.hero-copy {
  max-width: 680px;
  margin: 22px 0 0;
  color: #28322b;
  font-size: clamp(1.02rem, 1.55vw, 1.28rem);
  line-height: 1.6;
}

.hero-actions,
.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.button:hover,
.repo-link:hover,
.copy-button:hover,
.filter-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: var(--paper-strong);
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.button.secondary {
  color: var(--ink);
  background: var(--glass-strong);
}

.hero-facts {
  max-width: 920px;
  margin-top: 28px;
  color: var(--muted);
}

.hero-facts span {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(12px);
  overflow-wrap: anywhere;
}

.intro-band {
  padding: 18px 0 16px;
}

.three-column,
.two-column,
.code-grid,
.api-grid {
  display: grid;
  gap: 16px;
}

.three-column {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card,
.api-card,
.doc-list,
.code-panel,
.filter-bar,
.timeline,
.faq-list details {
  padding: 22px;
}

.stat-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 36px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--paper-strong);
  background: var(--indigo);
  font-weight: 900;
}

.stat-card h2,
.api-card h3,
.doc-list h3 {
  margin: 18px 0 8px;
  font-size: 1.06rem;
}

.stat-card p,
.api-card p,
.doc-list li,
.section-heading p,
.split-doc p,
.faq-list p,
.site-footer p {
  color: var(--muted);
  line-height: 1.65;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding: 46px 0 72px;
}

.docs-tabs {
  position: sticky;
  top: 96px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: rgba(255, 253, 247, 0.78);
}

.docs-tabs a {
  flex: 1 1 104px;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.25;
  text-align: center;
}

.docs-tabs a:hover,
.docs-tabs a.active {
  color: var(--ink);
  background: var(--paper-strong);
  box-shadow: inset 0 0 0 1px rgba(32, 42, 35, 0.08);
}

.docs-content {
  display: grid;
  gap: 0;
  min-width: 0;
}

.doc-section {
  padding: 34px 0 40px;
  border-top: 1px solid rgba(32, 42, 35, 0.14);
  scroll-margin-top: 112px;
}

.doc-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 22px;
}

.section-heading .eyebrow {
  margin-bottom: 10px;
  padding-left: 12px;
  border-left: 3px solid rgba(34, 79, 60, 0.55);
}

.section-heading h2,
.split-doc h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

.section-heading p,
.split-doc p {
  margin: 14px 0 0;
  font-size: 1rem;
}

.section-heading h2,
.section-heading p {
  max-width: 780px;
}

.code-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

.code-grid .wide {
  grid-column: 1 / -1;
}

.code-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
  border-color: rgba(23, 33, 27, 0.18);
  background: rgba(255, 253, 247, 0.78);
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: #47544c;
  font-size: 0.88rem;
  font-weight: 800;
  background:
    linear-gradient(90deg, rgba(34, 79, 60, 0.08), rgba(255, 253, 247, 0)),
    rgba(255, 253, 247, 0.68);
}

.code-title span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.code-title span::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--green-dark);
  opacity: 0.86;
}

.copy-button,
.filter-button {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.copy-button {
  flex: 0 0 auto;
  min-height: 34px;
  min-width: 58px;
  padding: 0 12px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--green-dark);
  font-size: 0.86rem;
}

pre {
  height: 100%;
  margin: 0;
  padding: 20px 22px;
  overflow-x: hidden;
  background: var(--code-bg);
  color: var(--code-ink);
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.9rem/1.7 "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

code {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  overflow-wrap: anywhere;
}

pre code {
  white-space: inherit;
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 18px;
  padding: 6px;
  background: rgba(255, 253, 247, 0.78);
}

.filter-button {
  min-height: 38px;
  padding: 8px 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.filter-button.active {
  color: var(--paper-strong);
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.api-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.api-card {
  min-height: 154px;
}

.api-card h3 {
  color: var(--green-dark);
}

.api-card[hidden] {
  display: none;
}

.split-doc {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.doc-list ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.doc-list li + li {
  margin-top: 10px;
}

.timeline {
  margin: 0;
  padding: 24px 24px 24px 46px;
  display: grid;
  gap: 14px;
}

.timeline li {
  padding-left: 8px;
}

.timeline li::marker {
  color: var(--green-dark);
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 0;
  overflow: hidden;
}

.faq-list summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 900;
}

.faq-list p,
.faq-list pre {
  margin: 0;
}

.faq-list p {
  padding: 0 20px 16px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 54px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--green-dark);
  font-weight: 800;
}

[data-motion] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.hero-content[data-motion] {
  opacity: 1;
  transform: none;
}

.intro-band [data-motion] {
  opacity: 1;
  transform: none;
}

[data-motion].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .site-header {
    position: absolute;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .top-nav {
    display: none;
  }

  .brand strong {
    white-space: normal;
  }

  .three-column,
  .two-column,
  .code-grid,
  .api-grid,
  .split-doc,
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-tabs {
    position: relative;
    top: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    gap: 6px;
    padding: 8px;
    overflow: visible;
  }

  .docs-tabs a {
    min-width: 0;
    padding: 8px 9px;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .section-heading .eyebrow {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 64px;
  }

  .site-header {
    grid-template-columns: 1fr;
    width: calc(100% - 20px);
    top: 10px;
    min-height: 62px;
    padding: 8px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand strong {
    font-size: 0.88rem;
    line-height: 1.15;
  }

  .brand small {
    font-size: 0.75rem;
  }

  .repo-link {
    display: none;
  }

  .hero-section {
    min-height: auto;
    padding-top: 118px;
    padding-bottom: 46px;
  }

  .hero-overlay {
    background: rgba(244, 241, 234, 0.9);
  }

  .hero-media img {
    opacity: 0.32;
    object-position: center;
  }

  h1 {
    font-size: clamp(2.05rem, 10vw, 2.55rem);
    line-height: 1.02;
  }

  .title-desktop {
    display: none;
  }

  .title-mobile {
    display: block;
  }

  .button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }

  .hero-copy {
    max-width: 330px;
  }

  .hero-facts span {
    width: 100%;
  }

  .docs-layout {
    gap: 22px;
    padding-top: 34px;
  }

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

  .docs-tabs a {
    min-height: 34px;
  }

  .doc-section {
    padding: 28px 0 34px;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-button:first-child {
    grid-column: 1 / -1;
  }

  pre {
    overflow-x: hidden;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .stat-card,
  .api-card,
  .doc-list,
  .filter-bar,
  .timeline,
  .faq-list details {
    padding: 18px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }

  [data-motion] {
    opacity: 1;
    transform: none;
  }
}
