@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Playfair+Display:ital,wght@0,500;0,600;1,500&display=swap');

/* ---------------------------------------------------------------- tokens */
:root {
  --paper: #f7f6f2;
  --paper-2: #efede6;
  --card: #ffffff;
  --ink: #141414;
  --ink-2: #2f312f;
  --muted: #5d615d;
  --line: #dcdad3;
  --line-strong: #222;
  --red: #c5161d;
  --red-dark: #9e1016;
  --red-soft: #fbeeee;
  --violet: #4f46e5;
  --green: #2f7a55;
  --green-soft: #ecf6f0;
  --amber: #8a5a00;
  --amber-soft: #fff5e0;
  --code-bg: #18181b;
  --code-ink: #ecebe6;
  --mono: "DM Mono", ui-monospace, Consolas, monospace;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --serif: "Playfair Display", Georgia, serif;
  --sidebar: 270px;
  --pad-x: clamp(22px, 6vw, 96px);
}

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
code { font: 0.86em var(--mono); background: var(--paper-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
h1, h2, h3 { margin: 0; color: var(--ink); }
h2 { font: 500 clamp(36px, 4.4vw, 60px)/1.05 var(--serif); letter-spacing: -0.035em; }
h2 em, h1 em { font-style: italic; color: var(--red); }
h3 { font: 600 19px/1.3 var(--sans); }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 3px; }

/* ---------------------------------------------------------------- layout */
.site-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
main { min-width: 0; }

.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 26px 26px;
  border-right: 1px solid var(--line-strong); background: var(--paper); overflow-y: auto; }
.brand { display: block; text-decoration: none; }
.brand img { width: 168px; height: auto; }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 34px; }
.nav-link { display: flex; gap: 12px; align-items: baseline; padding: 7px 0; text-decoration: none; color: var(--ink-2);
  font: 400 13px/1.35 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; transition: color .15s, padding .15s; }
.nav-link span { color: var(--muted); font-size: 11px; min-width: 18px; }
.nav-link:hover, .nav-link.active { color: var(--red); }
.nav-link:hover { padding-left: 4px; }
.nav-link.active span { color: var(--red); }
.side-cta { margin-top: 24px; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font: 11px/1.9 var(--mono); }

.mobile-header { display: none; }
.menu-button { border: 1px solid var(--line); background: transparent; padding: 10px; display: grid; gap: 4px; cursor: pointer; }
.menu-button span:not(.sr-only) { width: 18px; height: 1.5px; background: var(--ink); }

/* ---------------------------------------------------------------- buttons, chips */
.button-row { display: flex; gap: 12px; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; gap: 10px; padding: 13px 18px; border: 1px solid #2a2c2a; background: transparent;
  color: var(--ink); text-decoration: none; font: 500 12px var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  transition: background .15s, color .15s, border-color .15s; cursor: pointer; }
.button:hover { background: var(--ink); color: var(--paper); }
.button-primary { background: var(--red); border-color: var(--red); color: #fff; }
.button-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.button-small { padding: 9px 12px; font-size: 11px; width: 100%; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { padding: 6px 11px; border: 1px solid #c9c8c1; border-radius: 999px; background: rgba(255,255,255,.6); color: #464a46; font: 12px var(--mono); }
.eyebrow { margin: 0 0 16px; color: var(--red); font: 500 12px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.tag { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); font: 10.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.tag-done { color: var(--green); background: var(--green-soft); border-color: #b9dbc8; }
.tag-next { color: var(--violet); background: #efeefe; border-color: #cfccf8; }
.tag-later { color: var(--muted); background: var(--paper-2); }

/* ---------------------------------------------------------------- hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr); gap: clamp(32px, 5vw, 72px); align-items: center;
  min-height: 100vh; padding: 70px var(--pad-x); }
.hero h1 { font: 500 clamp(50px, 5.6vw, 92px)/0.98 var(--serif); letter-spacing: -0.045em; margin-bottom: 26px; }
.lede { max-width: 640px; margin-bottom: 30px; color: var(--ink-2); font-size: clamp(18px, 1.4vw, 22px); line-height: 1.6; }
.hero .chips { margin-top: 28px; }
.install-line { display: flex; align-items: center; gap: 12px; max-width: 520px; margin-top: 22px; padding: 12px 14px;
  background: var(--code-bg); color: var(--code-ink); font: 14px var(--mono); }
.install-line span { color: #8b8f8b; }
.install-line code { flex: 1; background: none; border: 0; color: inherit; padding: 0; font-size: 14px; }

/* measured results under the hero */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; max-width: 560px; margin: 30px 0 0; border-top: 1px solid var(--line-strong); }
.stats div { padding: 14px 18px 14px 0; border-bottom: 1px solid var(--line); }
.stats div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.stats dt { font: 500 clamp(30px, 2.8vw, 40px)/1 var(--serif); letter-spacing: -0.03em; color: var(--red); white-space: nowrap; }
.stats dd { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.stats-note { margin-top: 12px; color: var(--muted); font: 12px var(--mono); }
.stats-note a { color: var(--ink); }

/* chat mock */
.mock { margin: 0; background: var(--card); border: 1px solid var(--line); box-shadow: 14px 14px 0 var(--paper-2); }
.mock-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font: 11px var(--mono); color: var(--muted); letter-spacing: .06em; }
.mock-bar i { width: 8px; height: 8px; border-radius: 50%; background: #d4d3cd; }
.mock-bar i:first-child { background: #e2766f; }
.mock-bar b { margin-left: 8px; font-weight: 500; }
.mock-body { padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 88%; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.bubble-ai { background: var(--paper); border: 1px solid var(--line); }
.bubble-ai mark { background: #e8e6ff; color: inherit; padding: 1px 2px; }
.save-chip { align-self: flex-start; margin-top: -6px; padding: 6px 11px; border-radius: 999px; background: var(--violet); color: #fff; font: 600 12px var(--sans); }
.pill { align-self: flex-end; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5); color: #fff; font: 600 12px var(--sans); box-shadow: 0 4px 14px rgba(79,70,229,.35); }
.pill span { padding: 6px 10px; border-radius: 999px; }
.pill span:first-child { opacity: .7; padding-right: 4px; letter-spacing: -2px; }
.pill .sep { width: 1px; height: 14px; padding: 0; background: rgba(255,255,255,.4); }
.composer { border: 1px solid #c9c8c1; padding: 14px 16px; background: #fcfcfa; font: 13.5px/1.6 var(--mono); color: var(--ink-2); }
.composer .capsule { display: block; color: #3d3b8f; }
.composer .typed { display: block; margin-top: 10px; color: var(--ink); font-family: var(--sans); font-size: 14px; }
.mock-caption { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--muted); font: 11.5px var(--mono); }

/* ---------------------------------------------------------------- sections */
.section { padding: clamp(64px, 8vw, 104px) var(--pad-x); border-top: 1px solid var(--line-strong); scroll-margin-top: 0; }
.section-alt { background: rgba(255,255,255,.45); }
.section-head { max-width: 780px; margin-bottom: 40px; }
.section-head h2 { margin-bottom: 18px; }
.section-head p:not(.eyebrow) { color: var(--muted); font-size: 18px; line-height: 1.65; }
.subhead { margin: 54px 0 18px; font: 600 13px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }

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

.card { min-width: 0; padding: 24px 22px; background: var(--card); border: 1px solid var(--line); }
.card h3 { margin-bottom: 8px; }
.card p, .card li { color: var(--muted); font-size: 15px; line-height: 1.6; }
.card ul { margin: 10px 0 0; padding-left: 18px; }
.card li + li { margin-top: 4px; }
.card .num { display: block; margin-bottom: 16px; color: var(--red); font: 12px var(--mono); }
.card-accent { border-top: 3px solid var(--red); }
.card-quiet { background: transparent; }

/* numbered flow */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.flow li { list-style: none; padding: 22px 18px 24px 0; }
.flow li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.flow ol, .flow { margin: 0; padding: 0; }
.flow li > b { display: block; margin: 10px 0 6px; font: 600 16px var(--sans); }
.flow span { color: var(--red); font: 12px var(--mono); }
.flow p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* architecture diagram */
.diagram { display: grid; gap: 0; padding: 26px; background: var(--card); border: 1px solid var(--line); }
.diagram-row { display: grid; gap: 12px; }
.diagram-row.two { grid-template-columns: 1fr 1fr; }
.diagram-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.node-daemon { border-left-color: var(--red); background: var(--red-soft); }
.node { padding: 14px 16px; border: 1px solid var(--line); background: var(--paper); }
.node b { display: block; font: 600 15px var(--sans); }
.node small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.node .via { display: block; margin-bottom: 6px; color: var(--red); font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.node-core { border-left: 3px solid var(--violet); }
.node-vault { border-left: 3px solid var(--green); background: var(--green-soft); }
.arrow { height: 34px; display: grid; place-items: center; color: var(--red); font: 16px var(--mono); }
.spaced { margin-top: 28px; }
.subhead.first { margin-top: 0; }

/* code */
.code-card { min-width: 0; background: var(--code-bg); color: var(--code-ink); border-left: 3px solid var(--red); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #34343a;
  color: #a9aaa4; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.copy-button { border: 1px solid #55565c; background: transparent; color: #f2f1ec; padding: 5px 10px; font: 11px var(--mono); cursor: pointer; }
.copy-button:hover { background: #2e2e33; }
.code-card pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font: 13px/1.85 var(--mono); }
.code-card .c { color: #8c8f8a; }
.code-card .s { color: #e4c96f; }
.code-card .k { color: #9fc5ff; }
.code-note { padding: 0 18px 16px; color: #a9aaa4; font-size: 13px; line-height: 1.5; }
.code-note code { background: #2a2a2f; border-color: #3a3a40; color: #ecebe6; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; counter-reset: step; }
.step { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.step h3 { display: flex; gap: 10px; align-items: baseline; }
.step h3::before { counter-increment: step; content: "0" counter(step); color: var(--red); font: 13px var(--mono); }
.step > p { color: var(--muted); font-size: 15px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font: 500 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; font-weight: 600; }
td code { white-space: nowrap; }

/* callouts */
.note { margin-top: 22px; padding: 16px 18px; border-left: 3px solid var(--red); background: var(--red-soft); color: var(--ink-2); font-size: 15px; line-height: 1.65; }
.note-green { border-left-color: var(--green); background: var(--green-soft); }
.note-amber { border-left-color: var(--amber); background: var(--amber-soft); }
.note b { color: var(--ink); }

/* capsule sample */
.capsule-sample { margin: 0; padding: 18px 20px; border: 1px dashed #b9b6f4; background: #f7f7ff; color: #2d2b7a; font: 14px/1.85 var(--mono); white-space: pre-wrap; }

/* proof: headline numbers */
.proof-stats .big { margin: 0 0 8px; font: 500 clamp(40px, 3.6vw, 54px)/1 var(--serif); letter-spacing: -0.04em; color: var(--ink); }

/* proof: bar charts (single series; Memty in the accent, baselines neutral) */
.chart { margin: 0; padding: 22px 22px 24px; background: var(--card); border: 1px solid var(--line); }
.chart figcaption { margin-bottom: 18px; }
.chart figcaption b { display: block; font: 600 16px var(--sans); }
.chart figcaption span { display: block; margin-top: 4px; color: var(--muted); font: 12px var(--mono); }
.bars { display: grid; gap: 12px; }
.bar-row { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr) 62px; align-items: center; gap: 12px;
  padding: 4px 0; border-radius: 4px; outline: none; }
.bar-label { color: var(--ink-2); font-size: 14px; line-height: 1.3; }
.bar-track { height: 14px; background: var(--paper-2); border-radius: 0 4px 4px 0; }
.bar { display: block; height: 100%; width: var(--w); background: #a3a6a0; border-radius: 0 4px 4px 0; }
.bar-value { color: var(--ink); font: 500 14px var(--mono); text-align: right; }
.bar-row.is-memty .bar { background: var(--red); }
.bar-row.is-memty .bar-label { color: var(--ink); font-weight: 600; }
.bar-row:hover, .bar-row:focus-visible { background: var(--paper); }
.bar-row[data-tip]:hover::after, .bar-row[data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 2; padding: 6px 10px;
  background: var(--ink); color: var(--paper); font: 12px var(--mono); white-space: nowrap; pointer-events: none; }
.num-table td:nth-child(n+3), .num-table th:nth-child(n+3) { text-align: right; font-variant-numeric: tabular-nums; }
.num-table tr.is-memty td { background: var(--red-soft); }
.num-table tr.is-memty td:nth-child(2) { font-weight: 600; }

/* privacy levels */
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.level { padding: 20px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--line); }
.level h3 { font: 600 13px var(--mono); letter-spacing: .08em; }
.level p { margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.level .shows { display: block; margin-top: 12px; font: 12.5px var(--mono); color: var(--ink-2); }
.level-public { border-top-color: var(--green); }
.level-internal { border-top-color: #6b879c; }
.level-private { border-top-color: var(--violet); }
.level-secret { border-top-color: var(--red); }

/* checklist */
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
.checks.cross li::before { content: "!"; color: var(--amber); left: 4px; }

/* timeline */
.timeline { display: grid; gap: 0; border-top: 1px solid var(--line-strong); }
.milestone { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.milestone-meta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.milestone-meta small { color: var(--muted); font: 12px var(--mono); }
.milestone h3 { font: 500 26px/1.2 var(--serif); margin-bottom: 8px; }
.milestone p { color: var(--muted); font-size: 15.5px; }
.milestone ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.milestone li + li { margin-top: 3px; }

/* faq */
.faq { border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative; font: 600 17px var(--sans); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 16px; color: var(--red); font: 22px var(--mono); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 22px; color: var(--muted); font-size: 16px; line-height: 1.7; max-width: 860px; }
.faq details > div p + p { margin-top: 10px; }

/* closing + footer */
.closing { padding: clamp(70px, 9vw, 120px) var(--pad-x); border-top: 1px solid var(--line-strong); }
.closing h2 { font-size: clamp(42px, 5vw, 72px); margin-bottom: 18px; }
.closing p { max-width: 620px; margin-bottom: 30px; color: var(--muted); font-size: 18px; }
.site-footer { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; padding: 22px var(--pad-x); border-top: 1px solid var(--line);
  color: var(--muted); font: 12px var(--mono); }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--red); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .grid-4, .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow li, .flow li + li { padding: 20px 16px 20px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .flow li:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
}
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 60px; }
  .grid-3, .steps { grid-template-columns: 1fr 1fr; }
  .diagram-row.three { grid-template-columns: 1fr; }
  .diagram-row.three .arrow + .arrow { display: none; }
}
@media (max-width: 900px) {
  .site-shell { display: block; }
  .mobile-header { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; background: var(--paper); border-bottom: 1px solid var(--line-strong); }
  .mobile-header .brand img { width: 120px; }
  .sidebar { position: fixed; z-index: 15; top: 64px; left: 0; width: 280px; height: calc(100vh - 64px); transform: translateX(-105%);
    transition: transform .22s ease; box-shadow: 10px 0 30px rgba(0,0,0,.08); }
  .sidebar.open { transform: none; }
  .sidebar .brand { display: none; }
  .side-nav { margin-top: 6px; }
  .milestone { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .grid-2, .grid-3, .grid-4, .steps, .levels, .flow, .diagram-row.two { grid-template-columns: 1fr; }
  .stats div { padding-right: 12px; }
  .stats div:nth-child(even) { padding-left: 12px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .bar-label { grid-column: 1 / -1; }
  .bar-row[data-tip]:hover::after { white-space: normal; left: 0; }
  .flow li:nth-child(even) { padding-left: 0; border-left: 0; }
  .hero h1 { font-size: 46px; }
  .button { width: 100%; justify-content: center; }
  .mock { box-shadow: 8px 8px 0 var(--paper-2); }
  .install-line { font-size: 12px; }
  .install-line code { font-size: 12px; }
  td:first-child { white-space: normal; }
  .site-footer nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
