:root {
  --ink: #121212;
  --paper: #ffffff;
  --muted: #6a6a6a;
  --line: #ececec;
  --soft: #f6f6f6;
  --ok: #2d6a4f;
  --radius: 14px;
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Zilla Slab", "Iowan Old Style", "Palatino Linotype", serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, monospace;
  --max: 1080px;
  --content: 720px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  opacity: 0.72;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 15px;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

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

.nav a {
  text-decoration: none;
}

.nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  text-decoration: none !important;
  font-weight: 600;
}

.nav-cta:hover {
  opacity: 0.88;
}

main {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.site-footer {
  width: min(var(--max), calc(100% - 48px));
  margin: 72px auto 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.site-footer a {
  text-decoration: none;
}

/* Home — locked to one viewport, no scroll */

.page-home {
  height: 100dvh;
  overflow: hidden;
}

.home-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.page-home .site-header {
  position: relative;
  flex-shrink: 0;
}

.home {
  flex: 1;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
  display: grid;
  align-content: center;
  gap: 20px;
  padding: 12px 0;
  min-height: 0;
  overflow: hidden;
}

.home-logo {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 14px 32px rgba(18, 18, 18, 0.12);
}

.home-brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 9vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.home-lead {
  margin: 0;
  max-width: 28ch;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 1.5px solid transparent;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 650;
  text-decoration: none !important;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.btn-ghost:hover {
  opacity: 0.75;
}

.home-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-home .home-footer {
  flex-shrink: 0;
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto 20px;
  padding-top: 16px;
}

@media (max-width: 640px) {
  .page-home .home {
    width: calc(100% - 36px);
    gap: 16px;
  }

  .page-home .btn {
    min-height: 48px;
  }

  .page-home .home-footer {
    width: calc(100% - 36px);
    margin-bottom: 14px;
  }
}

/* Docs / Privacy content */

.page-hero {
  padding: 56px 0 28px;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.page-hero p {
  margin: 0;
  max-width: 42ch;
  color: var(--muted);
}

.doc {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  padding-bottom: 80px;
  align-items: start;
}

.doc-nav {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.doc-nav a {
  text-decoration: none;
}

.doc-nav a:hover,
.doc-nav a.is-active {
  color: var(--ink);
}

.doc-body {
  max-width: var(--content);
}

.doc-body h2 {
  margin: 48px 0 14px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.doc-body h2:first-child {
  margin-top: 8px;
}

.doc-body h3 {
  margin: 28px 0 10px;
  font-size: 1.05rem;
}

.doc-body p,
.doc-body li {
  color: color-mix(in srgb, var(--ink) 82%, var(--muted));
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.2em;
}

.doc-body li + li {
  margin-top: 6px;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: var(--soft);
  font-weight: 650;
}

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

code.inline {
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: var(--soft);
  font-size: 0.9em;
}

.panel {
  margin: 16px 0 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--ink);
  color: #f2f2f2;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-family: var(--mono);
}

.panel pre {
  margin: 0;
  padding: 16px 18px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.copy-btn {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.copy-btn.is-copied {
  background: var(--ok);
}

.prompt-box {
  margin: 16px 0 8px;
}

.legal {
  max-width: var(--content);
  padding-bottom: 80px;
}

.legal h2 {
  margin: 40px 0 12px;
  font-size: 1.25rem;
}

.legal p,
.legal li {
  color: color-mix(in srgb, var(--ink) 84%, var(--muted));
}

.legal .meta {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 860px) {
  .doc {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .doc-nav {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 14px 18px;
  }

  body:not(.page-home) main,
  body:not(.page-home) .site-footer {
    width: calc(100% - 36px);
  }

  .nav {
    gap: 14px;
  }

  .nav .hide-sm {
    display: none;
  }
}
