:root {
  color-scheme: light;
  --base: #f7f5f0;
  --mantle: #fffefa;
  --surface: #f0ede6;
  --surface-high: #e7e3da;
  --overlay: #dcd9d0;
  --text: #17201d;
  --subtext: #4f5b56;
  --muted: #66706c;
  --accent: #d9533f;
  --accent-dark: #a83628;
  --accent-soft: #f7ded7;
  --blue: #2c6d9c;
  --green: #247c5c;
  --peach: #bd7a20;
  --red: #b93b2d;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --shell: 1180px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(23, 32, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 32, 29, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black 0, transparent 760px);
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

.shell {
  width: min(calc(100% - 48px), var(--shell));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(220, 217, 208, 0.9);
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 48px), var(--shell));
  min-height: 72px;
  margin-inline: auto;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-sans);
}

.brand-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(70, 16, 8, 0.18);
  color: #ffffff;
  font-family: Georgia, "Noto Serif CJK SC", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.brand-name {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.brand-tag {
  padding-left: 10px;
  border-left: 1px solid var(--overlay);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(460px, 1.08fr);
  align-items: center;
  gap: clamp(48px, 7vw, 96px);
  min-height: calc(100vh - 73px);
  padding-block: 84px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.docs-hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  font-weight: 680;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.hero-lede {
  max-width: 620px;
  margin: 30px 0 0;
  color: var(--subtext);
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.55;
}

.hero-actions,
.docs-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 16px;
  font-weight: 700;
  transition: transform 150ms ease, background 150ms ease, border-color 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.text-link:focus-visible,
.copy-button:focus-visible,
.run-button:focus-visible,
.operation-button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(217, 83, 63, 0.24);
  outline-offset: 2px;
}

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

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  border-color: var(--overlay);
  background: var(--mantle);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--accent);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 54px 0 0;
  border-top: 1px solid var(--overlay);
}

.hero-facts div {
  padding: 18px 18px 0 0;
}

.hero-facts dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-facts dd {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.workbench {
  position: relative;
  padding: 26px;
  border: 1px solid var(--overlay);
  border-radius: var(--radius);
  background: var(--mantle);
  box-shadow: 20px 24px 0 rgba(23, 32, 29, 0.07);
}

.workbench::before {
  position: absolute;
  z-index: -1;
  inset: 18px -18px -18px 18px;
  border: 1px solid rgba(217, 83, 63, 0.2);
  border-radius: inherit;
  content: "";
}

.workbench-topbar,
.response-meta,
.request-label-row,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.workbench-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.workbench h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--overlay);
  border-radius: 99px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.live-indicator span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.live-indicator.is-online span:first-child {
  background: var(--green);
}

.live-indicator.is-offline span:first-child {
  background: var(--red);
}

.operation-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 24px;
  padding: 5px;
  border: 1px solid var(--overlay);
  border-radius: 10px;
  background: var(--base);
}

.operation-button {
  min-height: 43px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.operation-button.is-selected {
  background: var(--surface-high);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.request-label-row > span,
.response-meta > span:first-child {
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.field small {
  margin-left: 6px;
  color: var(--accent-dark);
  font: inherit;
  font-weight: 500;
}

.field input,
.field-value {
  min-width: 0;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--overlay);
  border-radius: 8px;
  background: var(--base);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
}

.field input:hover {
  border-color: #9ca0b0;
}

.field input:focus {
  border-color: var(--blue);
}

.field-value {
  display: flex;
  align-items: center;
  background: var(--surface);
  color: var(--muted);
}

.request-block,
.response-block {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--overlay);
  border-radius: 9px;
  background: var(--base);
}

.copy-button {
  padding: 3px 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.request-url {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  margin-top: 11px;
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.method {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 800;
}

.response-status {
  padding: 3px 8px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.response-status.is-idle {
  background: var(--surface-high);
  color: var(--muted);
}

.response-status.is-success {
  background: rgba(64, 160, 43, 0.1);
  color: var(--green);
}

.response-status.is-error {
  background: rgba(210, 15, 57, 0.09);
  color: var(--red);
}

.response-content {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: end;
  gap: 22px;
  margin-top: 14px;
}

.response-caption {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

#counter-value {
  display: block;
  margin-top: 1px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 46px;
  font-weight: 650;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.response-content pre {
  min-width: 0;
  margin: 0;
  padding: 11px 12px;
  border-left: 2px solid var(--overlay);
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.run-button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding: 0 17px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

.run-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.run-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.workbench-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.how-it-works {
  padding-block: 110px;
  border-top: 1px solid var(--overlay);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: 20px 72px;
  align-items: end;
}

.section-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.section-heading h2,
.docs-section h2 {
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.section-heading > p:last-child {
  margin: 0;
  color: var(--subtext);
  font-size: 18px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 58px 0 0;
  padding: 0;
  border-top: 1px solid var(--overlay);
  list-style: none;
}

.steps li {
  min-width: 0;
  padding: 28px 30px 0 0;
}

.steps li + li {
  padding-left: 30px;
  border-left: 1px solid var(--overlay);
}

.step-number {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}

.steps h3 {
  margin: 22px 0 8px;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.steps p {
  min-height: 86px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.steps code {
  font-family: var(--font-mono);
  font-size: 14px;
}

.steps code {
  display: block;
  margin-top: 20px;
  color: var(--blue);
  overflow-wrap: anywhere;
}

.text-link {
  padding: 10px 6px;
  color: var(--blue);
  font-size: 16px;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--overlay);
}

.footer-inner {
  min-height: 92px;
  color: var(--muted);
  font-size: 14px;
}

.footer-repo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.footer-brand-mark {
  display: inline-grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 5px;
  background: var(--accent);
  color: #ffffff;
  font-family: Georgia, "Noto Serif CJK SC", serif;
  font-weight: 700;
  line-height: 1;
}

.footer-repo-link:hover {
  color: var(--accent-dark);
}

.footer-repo-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(217, 83, 63, 0.24);
  outline-offset: 4px;
}

/* Documentation */

.docs-main {
  padding-block: 92px 120px;
}

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.55fr);
  gap: 60px;
  align-items: end;
  padding-bottom: 78px;
  border-bottom: 1px solid var(--overlay);
}

.docs-hero h1 {
  max-width: 800px;
  font-size: clamp(3.4rem, 7vw, 6.4rem);
}

.docs-intro {
  margin: 0;
  color: var(--subtext);
  font-size: 20px;
}

.docs-actions {
  margin-top: 25px;
}

.docs-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  gap: 70px;
  padding-top: 76px;
}

.docs-section h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
}

.docs-section-heading p {
  margin: 18px 0 0;
  color: var(--muted);
}

.docs-stack {
  display: grid;
  gap: 18px;
}

.docs-card {
  padding: 24px;
  border: 1px solid var(--overlay);
  border-radius: 10px;
  background: var(--mantle);
}

.docs-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.docs-card h3 {
  margin: 0;
  font-size: 20px;
}

.docs-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.docs-card > code {
  display: block;
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  background: var(--base);
  color: var(--subtext);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--overlay);
  border-radius: 99px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* 404 */

.not-found-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
}

.not-found {
  position: relative;
  display: grid;
  width: min(calc(100% - 48px), 920px);
  min-height: 600px;
  align-content: space-between;
  padding: 48px;
  border: 1px solid var(--overlay);
  border-radius: var(--radius);
  background: var(--mantle);
  overflow: hidden;
}

.not-found > div {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 6rem);
  letter-spacing: -0.06em;
  line-height: 0.98;
}

.not-found p:not(.eyebrow) {
  margin: 24px 0 0;
  color: var(--subtext);
  font-size: 19px;
}

.not-found .button {
  margin-top: 26px;
}

.not-found aside {
  position: absolute;
  right: -20px;
  bottom: -80px;
  color: rgba(217, 83, 63, 0.06);
  font-family: Georgia, serif;
  font-size: 250px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-block: 76px 100px;
  }

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

  .workbench {
    max-width: 720px;
  }

  .docs-hero,
  .docs-section {
    grid-template-columns: 1fr;
  }

  .docs-section,
  .docs-hero {
    gap: 42px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .shell,
  .header-inner {
    width: min(calc(100% - 32px), var(--shell));
  }

  .header-inner {
    min-height: 66px;
  }

  .brand > span:last-child {
    display: none;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    padding: 8px 9px;
    font-size: 14px;
  }

  .site-nav a:last-child {
    display: none;
  }

  .hero {
    gap: 58px;
    padding-block: 60px 82px;
  }

  .hero h1,
  .docs-hero h1 {
    font-size: clamp(3rem, 15vw, 4.6rem);
  }

  .hero-lede {
    margin-top: 24px;
    font-size: 18px;
  }

  .hero-facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .hero-facts div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 14px;
    border-bottom: 1px solid rgba(220, 217, 208, 0.75);
  }

  .workbench {
    padding: 20px;
    box-shadow: 10px 12px 0 rgba(23, 32, 29, 0.07);
  }

  .workbench::before {
    inset: 10px -10px -10px 10px;
  }

  .field-grid,
  .response-content,
  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-heading .eyebrow {
    grid-column: auto;
  }

  .response-content {
    align-items: start;
  }

  .response-content pre {
    border-top: 1px solid var(--overlay);
    border-left: 0;
  }

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

  .steps li,
  .steps li + li {
    padding: 28px 0;
    border-bottom: 1px solid var(--overlay);
    border-left: 0;
  }

  .steps p {
    min-height: auto;
  }

  .how-it-works {
    padding-block: 82px;
  }

  .docs-main {
    padding-block: 64px 88px;
  }

  .docs-hero {
    padding-bottom: 58px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .header-inner {
    gap: 12px;
  }

  .brand-name {
    display: none;
  }

  .site-nav a {
    padding-inline: 7px;
    font-size: 13px;
  }
}

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

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