:root {
  --paper: #f3f0e8;
  --paper-deep: #e9e5da;
  --ink: #171916;
  --muted: #62675f;
  --line: #c9c6bc;
  --accent: #177a46;
  --accent-soft: #d8efdf;
  --code: #20231f;
  --code-ink: #e8f7e8;
  --shell: min(1120px, calc(100% - 40px));
  color-scheme: light;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(23, 25, 22, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 25, 22, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button, .button { font: inherit; }

code, pre, .brand, .eyebrow, .protocol, .fact-strip, .flow-number, .compatibility {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.shell { width: var(--shell); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  color: white;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.site-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-header nav, .site-footer nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.9rem;
}

.site-header nav a, .site-footer nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-header nav a:hover, .site-footer nav a:hover,
.site-header nav a:focus-visible, .site-footer nav a:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.hero {
  display: grid;
  min-height: 650px;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(48px, 8vw, 104px);
  align-items: center;
  padding-block: 84px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1, h2, h3, p { text-wrap: pretty; }

h1, h2, h3 {
  margin-top: 0;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h1 {
  max-width: 720px;
  margin-bottom: 28px;
  font-size: clamp(3.25rem, 7vw, 6.7rem);
  font-weight: 760;
}

h1 span { color: var(--muted); font-weight: 520; }

h2 {
  margin-bottom: 24px;
  font-size: clamp(2.25rem, 4.6vw, 4.35rem);
  font-weight: 690;
}

h3 { margin-bottom: 10px; font-size: 1.45rem; }

.lede {
  max-width: 660px;
  margin: 0 0 30px;
  color: #3f443d;
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  border-radius: 5px;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.button:hover, .button:focus-visible { background: var(--paper-deep); }

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

.button.primary:hover, .button.primary:focus-visible {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.compatibility { margin: 18px 0 0; color: var(--muted); font-size: 0.76rem; }

.protocol {
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: rgba(249, 247, 241, 0.82);
  box-shadow: 10px 10px 0 var(--paper-deep);
}

.protocol-bar, .protocol figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.protocol-bar { border-bottom: 1px solid var(--line); }

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

.online i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.protocol-route {
  display: grid;
  grid-template-columns: 1fr auto 1.25fr;
  gap: 16px;
  align-items: center;
  padding: clamp(34px, 6vw, 62px) 24px;
}

.endpoint { min-width: 0; }

.endpoint .type {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.68rem;
}

.endpoint strong {
  display: block;
  overflow: hidden;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator { color: var(--accent); font-size: 1.7rem; }
.protocol-route img { width: 100%; image-rendering: pixelated; }
.protocol figcaption { border-top: 1px solid var(--line); }
.protocol figcaption strong { color: var(--accent); font-size: 1rem; }

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-block: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fact-strip span:nth-child(2) { text-align: center; }
.fact-strip span:last-child { text-align: right; }
.fact-strip b { margin-right: 8px; color: var(--accent); }

.section {
  padding-block: clamp(84px, 12vw, 150px);
  border-bottom: 1px solid var(--line);
}

.section-heading { max-width: 780px; margin-bottom: 54px; }
.flows { border-top: 1px solid var(--ink); }

.flow {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding-block: 32px;
  border-bottom: 1px solid var(--line);
}

.flow-number { color: var(--accent); font-size: 0.8rem; }
.flow p { max-width: 650px; margin: 0; color: var(--muted); }

.flow > code {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.35);
  font-size: 0.72rem;
  white-space: nowrap;
}

.demo {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.65fr);
  gap: clamp(60px, 11vw, 150px);
  align-items: center;
}

.demo-copy p:not(.eyebrow), .docs-preview > div:first-child > p:not(.eyebrow) {
  max-width: 580px;
  color: var(--muted);
}

.text-link { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 650; }
.app-shot { margin: 0; }

.app-shot img {
  width: min(100%, 440px);
  margin-inline: auto;
  border-radius: 7px;
  box-shadow: 0 22px 60px rgba(23, 25, 22, 0.15);
}

.app-shot figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.docs-preview {
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: clamp(48px, 9vw, 110px);
  align-items: center;
}

.terminal {
  overflow: hidden;
  border: 1px solid #0c0e0c;
  border-radius: 6px;
  color: var(--code-ink);
  background: var(--code);
  box-shadow: 8px 8px 0 #d9ddd5;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid #41473f;
  color: #aeb8ac;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
}

.terminal button {
  padding: 2px 7px;
  border: 1px solid #626b60;
  border-radius: 3px;
  color: #dbe6d9;
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
}

.terminal button:hover, .terminal button:focus-visible { border-color: #c5d3c3; }

.terminal pre {
  overflow-x: auto;
  margin: 0;
  padding: 25px;
  font-size: clamp(0.7rem, 1.3vw, 0.84rem);
  line-height: 1.9;
}

.faq {
  display: grid;
  grid-template-columns: 0.75fr 1fr;
  gap: clamp(52px, 10vw, 130px);
}

.faq-list { border-top: 1px solid var(--ink); }
details { border-bottom: 1px solid var(--line); }
summary { padding: 22px 34px 22px 0; font-weight: 650; cursor: pointer; }
details p { margin: -4px 0 24px; color: var(--muted); }

.closing { padding-block: clamp(100px, 15vw, 190px); text-align: center; }
.closing h2 { margin-inline: auto; font-size: clamp(3rem, 7vw, 6.8rem); }

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 30px;
  align-items: center;
  min-height: 110px;
  color: var(--muted);
  font-size: 0.78rem;
}

.site-footer p { margin: 0; text-align: center; }
.site-footer nav { justify-self: end; gap: 16px; }
.footer-brand { color: var(--ink); }

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 730px);
  gap: clamp(44px, 9vw, 120px);
  align-items: start;
  padding-block: 74px 140px;
}

.docs-nav { position: sticky; top: 30px; }

.docs-nav p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-nav a {
  display: block;
  padding: 5px 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.docs-nav a:hover, .docs-nav a:focus-visible { color: var(--ink); text-decoration: underline; }
.document > header { padding-bottom: 50px; border-bottom: 1px solid var(--line); }
.document > header h1 { margin-bottom: 18px; font-size: clamp(3rem, 7vw, 5.5rem); }

.document > header p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}

.document section {
  padding-block: 50px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.document h2 { font-size: clamp(2rem, 4vw, 3.15rem); }
.document h3 { margin-top: 34px; }
.document p, .document li { color: #464b44; }
.document li + li { margin-top: 8px; }

.document pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 5px;
  color: var(--code-ink);
  background: var(--code);
  font-size: 0.8rem;
}

.note {
  margin-block: 24px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  color: #365341;
  background: var(--accent-soft);
}

.privacy-page { max-width: 760px; padding-block: 80px 150px; }
.privacy-page h1 { font-size: clamp(3rem, 7vw, 5.5rem); }
.privacy-page h2 { margin-top: 54px; font-size: 2rem; }

@media (max-width: 820px) {
  :root { --shell: min(100% - 32px, 680px); }
  .hero, .demo, .docs-preview, .faq, .docs-layout { grid-template-columns: 1fr; }
  .hero { gap: 70px; padding-block: 70px 90px; }
  .protocol { max-width: 520px; }
  .demo { gap: 60px; }
  .app-shot img { width: min(100%, 360px); }
  .faq { gap: 10px; }

  .docs-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }

  .docs-nav p { display: none; }
  .docs-nav a { flex: 0 0 auto; }
  .site-footer { grid-template-columns: 1fr; padding-block: 30px; }
  .site-footer p { text-align: left; }
  .site-footer nav { justify-self: start; }
}

@media (max-width: 580px) {
  body { font-size: 16px; }
  .site-header { min-height: 66px; }
  .site-header nav { gap: 16px; }
  .site-header nav a:first-child { display: none; }
  h1 { font-size: clamp(3.05rem, 15vw, 4.8rem); }

  .protocol-route {
    grid-template-columns: 0.7fr auto 1.3fr;
    gap: 10px;
    padding-inline: 16px;
  }

  .protocol-bar { align-items: flex-start; gap: 12px; }
  .flow { grid-template-columns: 38px 1fr; gap: 12px; }
  .flow > code { grid-column: 2; justify-self: start; }
  .fact-strip { grid-template-columns: 1fr; gap: 8px; }
  .fact-strip span:nth-child(2), .fact-strip span:last-child { text-align: left; }
  .terminal { box-shadow: 5px 5px 0 #d9ddd5; }
}

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

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #171916;
    --paper-deep: #252821;
    --ink: #ecebe4;
    --muted: #a8ada4;
    --line: #42463e;
    --accent: #6fd59a;
    --accent-soft: #203a2a;
    --code: #0e100e;
    color-scheme: dark;
  }

  body {
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  }

  .lede, .document p, .document li { color: #c8cbc4; }
  .protocol { background: rgba(31, 34, 29, 0.9); }
  .flow > code { background: rgba(255, 255, 255, 0.03); }
  .terminal { box-shadow: 8px 8px 0 #2a3029; }
  .note { color: #bce4ca; }
}
