/* keyward site — palette C from the keyward design system (dark primary, light via prefers-color-scheme) */
:root {
  --bg: #171412;
  --surface: #1e1a17;
  --surface-raised: #272220;
  --surface-sunken: #110f0d;
  --border: #332d29;
  --border-strong: #443c37;
  --text: #efe9e3;
  --text-muted: #a39b93;
  --text-on-accent: #0b1b26;
  --accent: #7cc4f2;
  --accent-hover: #9ad2f6;
  --accent-soft: #1a3142;
  --ok: #4fd18f;
  --ok-soft: #12301f;
  --warn: #f2b34d;
  --warn-soft: #3a2c12;
  --danger: #f07070;
  --danger-soft: #3d1d1b;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --measure: 68ch;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f4f2;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-sunken: #ebe9e6;
    --border: #dcd9d4;
    --border-strong: #c3bfb8;
    --text: #1c1917;
    --text-muted: #5f5a54;
    --text-on-accent: #ffffff;
    --accent: #1f6fb5;
    --accent-hover: #195c97;
    --accent-soft: #dbeaf8;
    --ok: #1b8a57;
    --ok-soft: #dff3e8;
    --warn: #8f5a00;
    --warn-soft: #fff1d6;
    --danger: #c23b3b;
    --danger-soft: #fbe3e3;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--text-on-accent); padding: 8px 12px; border-radius: var(--radius-md); z-index: 10; }
.skip:focus { left: 16px; }

h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: 26px; font-weight: 600; }
h3 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
code, pre, kbd { font-family: var(--mono); font-size: 13px; }
code { background: var(--surface-sunken); padding: 2px 6px; border-radius: 4px; }
pre {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  line-height: 1.6;
  margin: 0 0 16px;
}
pre code { background: none; padding: 0; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; line-height: 18px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* header */
.site-header { position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); z-index: 5; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 17px; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 24px; height: 24px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--text-muted); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 15px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; background: var(--surface-raised); }
.nav .pill { margin-left: 4px; }
@media (max-width: 520px) { .nav a { padding: 8px 7px; font-size: 14px; } .nav .pill { display: none; } }

/* sections */
section { padding: 56px 0; }
@media (min-width: 720px) { section { padding: 80px 0; } }
section + section { border-top: 1px solid var(--border); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; }
.lead { font-size: 19px; line-height: 1.5; color: var(--text-muted); max-width: var(--measure); }
.section-head { margin-bottom: 32px; max-width: var(--measure); }
.section-head p { color: var(--text-muted); margin-top: 12px; }

/* hero */
.hero { padding: 72px 0 56px; }
@media (min-width: 720px) { .hero { padding: 112px 0 80px; } }
.hero h1 { max-width: 20ch; }
.hero .lead { margin-top: 20px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero .note { margin-top: 20px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: var(--radius-md); font-weight: 600; font-size: 15px; border: 1px solid transparent; cursor: pointer; transition: background 100ms ease-out, color 100ms ease-out; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-on-accent); }
.btn-secondary { background: var(--surface-raised); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-quiet { color: var(--text); background: transparent; }
.btn-danger { background: var(--danger); color: #1a0606; }
.btn-danger:hover { color: #1a0606; }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; line-height: 14px; white-space: nowrap; vertical-align: middle; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.pill-neutral { background: var(--surface-raised); color: var(--text-muted); border: 1px solid var(--border); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-neutral::before { display: none; }

/* cards */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--surface-raised); border-radius: var(--radius-lg); padding: 24px; }
@media (prefers-color-scheme: light) { .card { border: 1px solid var(--border); } }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--text-muted); }
.card .pill { margin-bottom: 12px; }
.card .glyph { width: 28px; height: 28px; color: var(--accent); margin-bottom: 14px; }

/* loop figure */
.loop { display: block; width: 100%; max-width: 720px; height: auto; margin: 0 auto; }
.loop text { font-family: var(--sans); fill: var(--text); font-size: 15px; font-weight: 600; }
.loop .sub { fill: var(--text-muted); font-size: 12px; font-weight: 400; }
.loop .node { fill: var(--surface-raised); stroke: var(--border); }
.loop .arc { fill: none; stroke: var(--accent); stroke-width: 2; }
.loop .arrow { fill: var(--accent); }
.loop .num { fill: var(--accent); font-size: 11px; letter-spacing: 0.08em; }
figcaption { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 12px; }

/* mock app frames */
.mock { background: var(--surface-raised); border-radius: var(--radius-lg); padding: 24px; font-size: 15px; line-height: 22px; }
@media (prefers-color-scheme: light) { .mock { border: 1px solid var(--border); } }
.mock .bar { display: flex; justify-content: space-between; align-items: center; color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.mock .bar strong { color: var(--accent); font-weight: 600; font-size: 15px; }
.mock .what { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.mock .where { font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -0.015em; margin-bottom: 4px; }
.mock .who { color: var(--text-muted); }
.mock .reason { margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.mock .buttons { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.mock .buttons .btn { flex: 1 1 140px; }
.mock .touch { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.mock .touch .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mock pre { margin: 0; background: var(--surface-sunken); }
.mock .danger-line { color: var(--danger); }
.mock .ok-line { color: var(--ok); }
.mock .warn-line { color: var(--warn); }
.mock .dim { color: var(--text-muted); }

/* lists */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; }
.checks li .pill { flex: none; margin-top: 3px; min-width: 112px; justify-content: center; }
.prose { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 6px; }
.prose h2 { margin: 48px 0 16px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 10px; }

/* steps */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 14px; }
.steps li::before { counter-increment: step; content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.steps li h3 { margin-bottom: 4px; }
.steps li p { color: var(--text-muted); }

/* faq */
details { border-top: 1px solid var(--border); padding: 4px 0; }
details:last-of-type { border-bottom: 1px solid var(--border); }
summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--text-muted); font-weight: 400; font-size: 20px; flex: none; }
details[open] summary::after { content: "–"; }
details .answer { color: var(--text-muted); padding: 0 0 18px; max-width: var(--measure); }

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); background: var(--surface-raised); }
@media (prefers-color-scheme: light) { .table-wrap { border: 1px solid var(--border); } }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 20px; min-width: 760px; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-top: 1px solid var(--border); }
thead th { border-top: 0; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 600; background: var(--surface); }
td:first-child { font-weight: 600; min-width: 170px; }
td.status { white-space: nowrap; }

/* command reference */
.cmd { display: grid; grid-template-columns: 1fr; gap: 6px 24px; padding: 12px 0; border-top: 1px solid var(--border); }
.cmd:last-child { border-bottom: 1px solid var(--border); }
@media (min-width: 720px) { .cmd { grid-template-columns: 360px 1fr; } }
.cmd code { background: none; padding: 0; font-size: 14px; color: var(--text); white-space: pre-wrap; }
.cmd span { color: var(--text-muted); font-size: 14px; }

/* callouts */
.callout { border-radius: var(--radius-md); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; }
.callout-warn { background: var(--warn-soft); color: var(--text); }
.callout-warn strong { color: var(--warn); }
.callout-info { background: var(--accent-soft); color: var(--text); }
.callout-info strong { color: var(--accent); }

/* footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0; color: var(--text-muted); font-size: 13px; line-height: 18px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; align-items: flex-start; }
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* status strip */
.status-strip { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 13px; color: var(--text-muted); }

.center { text-align: center; }
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.error-page .code { font-family: var(--mono); font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* ---- landing page ---- */
.hero-land { padding: 96px 0 72px; text-align: center; }
@media (min-width: 720px) { .hero-land { padding: 140px 0 96px; } }
.hero-land h1 { margin: 0 auto; max-width: 16ch; font-size: clamp(36px, 6.4vw, 64px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 600; }
.hero-land .lead { margin: 24px auto 0; max-width: 46ch; font-size: clamp(17px, 2vw, 20px); }
.hero-land .actions { justify-content: center; margin-top: 36px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-land .eyebrow { margin-bottom: 20px; }

.loop-section { padding: 24px 0 72px; border-top: 0; }
@media (min-width: 720px) { .loop-section { padding: 24px 0 112px; } }
.loop-section figure { margin: 0; }
.loop .flow { stroke: var(--accent); stroke-width: 2; fill: none; stroke-dasharray: 6 10; opacity: 0.9; }
@media (prefers-reduced-motion: no-preference) {
  .loop .flow { animation: flow 2.4s linear infinite; }
  .loop .pulse { animation: pulse 2.4s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
}
@keyframes flow { to { stroke-dashoffset: -32; } }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.feature { padding: 72px 0; border-top: 1px solid var(--border); }
@media (min-width: 720px) { .feature { padding: 112px 0; } }
.feature .wrap { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 860px) {
  .feature .wrap { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature.flip .copy { order: 2; }
}
.feature .copy h2 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -0.02em; line-height: 1.15; max-width: 18ch; }
.feature .copy p { color: var(--text-muted); font-size: 17px; margin-top: 18px; max-width: 44ch; }
.feature .copy a.more { display: inline-block; margin-top: 12px; font-weight: 600; }
.feature .visual { min-width: 0; }

/* vault graphic */
.vault-art { display: block; width: 100%; height: auto; max-width: 480px; margin: 0 auto; }
.vault-art .plate { fill: var(--surface-raised); }
.vault-art .plate-edge { fill: none; stroke: var(--border); }
.vault-art .ring { fill: none; stroke: var(--accent); stroke-width: 3; }
.vault-art .ring-soft { fill: none; stroke: var(--accent-soft); stroke-width: 10; }
.vault-art .key { fill: var(--accent); }
.vault-art .yk { fill: var(--surface-sunken); stroke: var(--border-strong); }
.vault-art .yk-dot { fill: var(--ok); }
.vault-art .glow { fill: var(--accent); opacity: 0.12; }
.vault-art text { font-family: var(--mono); font-size: 11px; fill: var(--text-muted); }
.vault-art .lbl { font-family: var(--sans); font-size: 12px; font-weight: 600; fill: var(--text); letter-spacing: 0.02em; }

/* servers alert mock */
.mock-servers { padding: 0; overflow: hidden; }
.mock-servers .bar { padding: 16px 20px 0; margin-bottom: 12px; }
.mock-servers .banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 20px 12px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--danger-soft); color: var(--text); font-size: 14px; }
.mock-servers .banner strong { color: var(--danger); font-weight: 600; }
.mock-servers .banner .btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.mock-servers .row { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--border); }
.mock-servers .row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); justify-self: center; }
.mock-servers .row .dot.alert { background: var(--danger); }
.mock-servers .row .dot.stale { background: var(--warn); }
.mock-servers .row .name { font-weight: 600; }
.mock-servers .row .sub { color: var(--text-muted); font-size: 13px; }
.mock-servers .row .right { color: var(--text-muted); font-size: 13px; }

.status-line { padding: 48px 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-muted); font-size: 15px; }
.status-line .pill { margin-right: 8px; vertical-align: 1px; }
