:root {
  --bg: #f7fafa;
  --bg-alt: #eef5f6;
  --surface: #ffffff;
  --ink: #202426;
  --ink-soft: #5b6b70;
  --accent: #00a8bf;
  --accent-strong: #007a8b;
  --accent-soft: #d7f4f7;
  --line: #dce8ea;
  --code-bg: #1f2527;
  --code-ink: #e8f7f8;
  --max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #222727;
    --bg-alt: #282f30;
    --surface: #2d3435;
    --ink: #eef7f8;
    --ink-soft: #a6b8bc;
    --accent: #88ffff;
    --accent-strong: #88ffff;
    --accent-soft: #123f45;
    --line: #3b4648;
    --code-bg: #181d1f;
    --code-ink: #e8f7f8;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  margin: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  margin: 0 auto;
  max-width: var(--max);
  padding: 0 24px;
}

.site-nav {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: var(--max);
  padding: 20px 24px;
}

.brand {
  align-items: center;
  color: var(--ink);
  display: inline-flex;
  gap: 14px;
  font-weight: 700;
}

.brand img {
  background: #232325;
  border-radius: 8px;
  display: block;
  height: 32px;
  padding: 6px 8px;
  width: auto;
}

.brand span {
  white-space: nowrap;
}

.links {
  align-items: center;
  display: flex;
  gap: 22px;
  font-size: 0.95rem;
  font-weight: 600;
}

.links a {
  color: var(--ink-soft);
}

.links a:hover,
.links a.active {
  color: var(--accent-strong);
  text-decoration: none;
}

.hero {
  padding: 54px 0 72px;
  text-align: center;
}

.mark {
  align-items: center;
  background: #232325;
  border: 1px solid #3b4143;
  border-radius: 8px;
  display: inline-flex;
  justify-content: center;
  margin-bottom: 24px;
  padding: 16px 20px;
}

.mark img {
  display: block;
  height: 48px;
  width: auto;
}

h1,
h2,
h3 {
  line-height: 1.12;
  margin: 0;
}

h1 {
  font-size: 4rem;
  font-weight: 800;
}

.tagline {
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 650;
  margin: 12px auto 18px;
  max-width: 720px;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.08rem;
  margin: 0 auto 32px;
  max-width: 760px;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.btn {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 1rem;
  font-weight: 700;
  min-height: 46px;
  padding: 11px 21px;
}

.btn:hover {
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #102b2f;
}

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
}

section {
  padding: 56px 0;
}

section.alt {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

h2 {
  font-size: 2.15rem;
  font-weight: 780;
  text-align: center;
}

.section-sub {
  color: var(--ink-soft);
  margin: 10px auto 38px;
  max-width: 680px;
  text-align: center;
}

.flow {
  align-items: stretch;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  max-width: 920px;
}

.node,
.feature,
.doc-callout {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.node {
  min-height: 126px;
  padding: 19px 18px;
}

.node .k {
  color: var(--ink);
  font-weight: 760;
  margin-bottom: 6px;
}

.node .d {
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.features {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

.feature {
  padding: 24px;
}

.feature h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.feature p {
  color: var(--ink-soft);
  margin: 0;
}

.code-card {
  margin: 0 auto;
  max-width: 820px;
}

pre {
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--code-ink);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0;
  overflow-x: auto;
  padding: 22px 24px;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

pre .c {
  color: #98adb0;
}

pre .p {
  color: #88ffff;
}

.diagram-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 24px 0 30px;
  overflow-x: auto;
  padding: 18px;
}

.diagram-card .mermaid {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-width: 760px;
  padding: 0;
  text-align: center;
}

.diagram-card svg {
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}

.read-more {
  margin-top: 28px;
  text-align: center;
}

.read-more a {
  font-weight: 700;
}

.doc-shell {
  display: grid;
  gap: 38px;
  grid-template-columns: 220px minmax(0, 1fr);
  padding: 44px 24px 72px;
}

.toc {
  align-self: start;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 6px 18px 6px 0;
  position: sticky;
  top: 20px;
}

.toc a {
  color: var(--ink-soft);
  font-size: 0.94rem;
  font-weight: 650;
}

.toc a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.doc-content {
  max-width: 820px;
  min-width: 0;
}

.doc-content h1 {
  font-size: 3rem;
  margin-bottom: 12px;
}

.doc-content h2 {
  font-size: 1.75rem;
  margin-top: 46px;
  text-align: left;
}

.doc-content h3 {
  font-size: 1.12rem;
  margin-top: 28px;
}

.doc-content p,
.doc-content li {
  color: var(--ink-soft);
}

.doc-content ul {
  padding-left: 22px;
}

.doc-callout {
  color: var(--ink-soft);
  margin: 24px 0;
  padding: 18px 20px;
}

.threat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0 4px;
}

.threat-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 18px 16px;
}

.threat-grid h4 {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
  margin: 0 0 10px;
}

.threat-grid ul {
  margin: 0;
  padding-left: 18px;
}

.threat-grid li {
  margin: 7px 0;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  padding: 44px 0 52px;
  text-align: center;
}

.made-by {
  align-items: center;
  display: inline-flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

.made-by img {
  background: #232325;
  border-radius: 8px;
  height: 28px;
  padding: 5px 7px;
  width: auto;
}

.small {
  font-size: 0.88rem;
}

@media (max-width: 780px) {
  .site-nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .links {
    flex-wrap: wrap;
    gap: 14px;
  }

  h1 {
    font-size: 3rem;
  }

  .tagline {
    font-size: 1.25rem;
  }

  .flow,
  .features,
  .threat-grid,
  .doc-shell {
    grid-template-columns: 1fr;
  }

  .toc {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0 20px;
    position: static;
  }
}

@media (max-width: 460px) {
  .wrap,
  .site-nav,
  .doc-shell {
    padding-left: 18px;
    padding-right: 18px;
  }

  h1 {
    font-size: 2.45rem;
  }

  .mark img {
    height: 38px;
  }

  .brand span {
    white-space: normal;
  }
}
