:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;
  --bg: #ffffff;
  --surface: #f7f7f8;
  --ink: #0d0d0d;
  --sub: #57575c;
  --faint: #8a8a90;
  --line: #e5e5e8;
  --accent: #0d0d0d;
  --on-accent: #ffffff;
  --ok: #28a745;
  --focus: #0d0d0d;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181a;
    --surface: #222225;
    --ink: #ececef;
    --sub: #a8a8b0;
    --faint: #787880;
    --line: #323236;
    --accent: #ececef;
    --on-accent: #0d0d0d;
    --ok: #30d158;
    --focus: #ececef;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font: 16px/1.65 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--ink); color: var(--bg); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--line); }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* Header */
header {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  object-fit: cover;
}
.links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  color: var(--sub);
}
.links a { text-decoration: none; white-space: nowrap; }
.links a:hover, .links a[aria-current="page"] { color: var(--ink); }

/* Hero */
.hero {
  padding: clamp(56px, 9vw, 96px) 0 clamp(44px, 7vw, 72px);
}
.eyebrow {
  font: 500 12px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(32px, 5.5vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 650;
  text-wrap: balance;
}
.lead {
  margin-top: 20px;
  font-size: clamp(17px, 2.2vw, 19px);
  line-height: 1.6;
  color: var(--sub);
  max-width: 56ch;
}
.actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 150ms ease;
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn:hover { opacity: 0.82; }

/* Sections */
section {
  padding: 44px 0;
  border-top: 1px solid var(--line);
}
h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin-bottom: 16px;
}
p + p { margin-top: 12px; }

/* Principles / Architecture list */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 8px;
}
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--sub);
}

/* Architecture diagram strip */
.diagram {
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  font: 12.5px/1.75 var(--mono);
  color: var(--sub);
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.diagram strong { color: var(--ink); font-weight: 600; }

/* Spec table */
.specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  table-layout: fixed;
}
.specs tr { border-bottom: 1px solid var(--line); }
.specs tr:last-child { border-bottom: none; }
.specs th {
  text-align: left;
  font-weight: 500;
  color: var(--sub);
  padding: 13px 16px 13px 0;
  width: 28%;
  vertical-align: top;
}
.specs td {
  padding: 13px 0;
  color: var(--ink);
  vertical-align: top;
  overflow-wrap: anywhere;
}
.specs code {
  font: 13px var(--mono);
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
}

/* Prose (Privacy Policy) */
.prose {
  padding: clamp(40px, 6vw, 64px) 0 72px;
  max-width: 68ch;
}
.prose h1 {
  font-size: clamp(28px, 5vw, 38px);
  max-width: none;
  margin-bottom: 10px;
}
.meta {
  font-size: 13.5px;
  color: var(--faint);
  margin-bottom: 32px;
}
.prose h2 {
  margin-top: 34px;
  margin-bottom: 10px;
  font-size: 18px;
}
.prose p, .prose li {
  font-size: 15px;
  line-height: 1.72;
  color: var(--sub);
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { margin: 10px 0 0 20px; display: flex; flex-direction: column; gap: 6px; }
.prose code {
  font: 13px var(--mono);
  color: var(--ink);
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink);
}

/* Footer */
footer {
  padding: 28px 0 44px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
footer .f-links { display: flex; gap: 18px; }
footer a { text-decoration: none; color: var(--sub); }
footer a:hover { color: var(--ink); }

@media (max-width: 44rem) {
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .specs th { width: 38%; padding-right: 12px; }
}
