/* Keyzen product site — one stylesheet, light + dark, no runtime CSS. */

:root {
  /* Flat palette taken from the app icon: icon blue on cool keycap greys. */
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #e8e7ec;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #d8d8dd;
  --accent: #2b76d6;
  --accent-strong: #1f62b8;
  --accent-soft: #e1ecfa;
  --on-accent: #ffffff;
  --yes: #2f8f5b;
  --no: #b8b8bd;
  --partial: #c07f12;
  --radius: 8px;
  --radius-lg: 12px;
  --wrap: 1120px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", Inter, system-ui, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Songti SC", "Songti TC", "Hiragino Mincho ProN", "AppleMyungjo", Georgia, serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, sans-serif;
  --shadow: 0 0 0 1px var(--line);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --surface: #232325;
    --surface-2: #2c2c2e;
    --text: #ececef;
    --muted: #98989f;
    --line: #3a3a3d;
    --accent: #3d8be9;
    --accent-strong: #6aa7f0;
    --accent-soft: #1d2a3b;
    --on-accent: #ffffff;
    --yes: #5cc28a;
    --no: #55555a;
    --partial: #e0a43a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 600; }
h1 { font-size: clamp(2.25rem, 5.5vw, 3.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.125rem; letter-spacing: 0; }
::selection { background: var(--accent-soft); color: var(--text); }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.15em; }
li { margin-bottom: 0.35em; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface-2);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  /* Inline-block keeps the chip's box on the text baseline, so its padding
     can never overlap the line below; clone keeps it tidy across wraps. */
  display: inline-block;
  vertical-align: baseline;
  line-height: 1.35;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

kbd {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--surface);
  white-space: nowrap;
}

.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }
.center { text-align: center; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--surface); padding: 10px 14px; border-radius: 4px; box-shadow: var(--shadow); }
.skip.is-visible { left: 16px; }

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  transition: background 120ms ease;
}
.button:hover { background: var(--accent-strong); text-decoration: none; }
.button-small { padding: 7px 15px; font-size: 0.875rem; }
.button-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.button-ghost:hover { background: var(--surface-2); }
@media (prefers-reduced-motion: reduce) { .button, .button:hover { transition: none; transform: none; } }
button.button { font-family: inherit; cursor: pointer; }

/* Download check */
.download-check {
  width: min(420px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.download-check::backdrop { background: rgb(0 0 0 / 0.4); }
.download-check h2 { margin: 0 0 10px; font-size: 1.25rem; }
.download-check-body { margin: 0 0 24px; color: var(--muted); line-height: 1.55; }
.download-check-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
}
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; }
.nav { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav li { margin: 0; }
.nav a { display: inline-block; padding: 6px 12px; border-radius: 6px; color: var(--muted); font-size: 0.9375rem; font-weight: 500; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.header-inner nav { margin-left: auto; }
.header-cta { margin-left: 4px; }

.lang { position: relative; }
.lang summary {
  display: grid; place-items: center; width: 34px; height: 34px;
  border-radius: 6px; color: var(--muted); cursor: pointer; list-style: none;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { background: var(--surface-2); color: var(--text); }
.lang summary svg { width: 18px; height: 18px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  min-width: 160px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.lang-menu li { margin: 0; }
.lang-menu a { display: block; padding: 7px 12px; border-radius: 4px; color: var(--text); font-size: 0.9063rem; }
.lang-menu a:hover { background: var(--surface-2); text-decoration: none; }
.lang-menu a[aria-current] { color: var(--accent); font-weight: 600; }

@media (max-width: 720px) {
  /* The hero's own download button is right below; keep the header one row. */
  .header-cta { display: none; }
  .nav { overflow-x: auto; }
  .nav a { padding: 5px 10px; white-space: nowrap; }
}

/* Sections */
main { display: block; }
.section { padding: 80px 0; }
.section-tight { padding: 48px 0; }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.eyebrow { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 500; color: var(--accent); margin-bottom: 12px; }
.lede { color: var(--muted); font-size: clamp(1.0625rem, 2vw, 1.1875rem); }

/* Hero */
.hero { padding: 80px 0 64px; position: relative; overflow: hidden; }
.hero-inner { max-width: 780px; }
.hero h1 { margin-bottom: 20px; }
.hero .lede { max-width: 58ch; margin-bottom: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 12px; font-size: 0.8125rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 24px 0 0; }
.chip { font-size: 0.8125rem; padding: 3px 10px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.chip strong { color: var(--text); font-weight: 650; }

/* Grids and cards */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card ul { margin: 12px 0 0; color: var(--muted); font-size: 0.9375rem; }
.card .tag { display: inline-block; font-family: var(--mono); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 10px; margin-bottom: 12px; align-self: flex-start; }

.feature { display: flex; flex-direction: column; }
.feature .summary { color: var(--muted); font-size: 0.9375rem; }

.link-card { display: block; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.link-card:hover { border-color: var(--accent); text-decoration: none; }
.link-card strong { display: block; margin-bottom: 6px; }
.link-card span { color: var(--muted); font-size: 0.9375rem; }

/* Steps / help */
.topic { scroll-margin-top: 88px; }
.topic + .topic { margin-top: 40px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 14px; }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 4px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2); color: var(--accent);
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 600;
}
.tip { border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 16px; font-size: 0.9375rem; color: var(--muted); margin: 16px 0 0; }
.toc { position: sticky; top: 88px; align-self: start; padding: 16px; }
.toc-heading { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 500; margin: 0 0 8px; padding: 0 10px; }
.toc ul { list-style: none; padding: 0; margin: 0; font-size: 0.9375rem; }
.toc a { display: block; padding: 6px 10px; border-radius: 4px; color: var(--muted); }
.toc a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.split { display: grid; gap: 40px; grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } .toc { position: static; display: none; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
th { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; background: var(--surface-2); white-space: nowrap; }
tr:last-child td, tr:last-child th { border-bottom: none; }
td.mark, th.mark { text-align: center; width: 76px; }
th.is-keyzen, td.is-keyzen { background: var(--accent-soft); }
.col-keyzen { color: var(--accent); }
.mark-yes { color: var(--yes); font-weight: 700; }
.mark-no { color: var(--no); }
.mark-partial { color: var(--partial); font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* FAQ */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 20px; }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-family: var(--mono); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* Callout */
.callout { border-radius: var(--radius); padding: 40px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.callout h2 { margin-bottom: 10px; }
.callout p { max-width: 56ch; margin-left: auto; margin-right: auto; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 32px; margin-top: 24px; font-size: 0.9375rem; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr; }
.footer-brand p { margin: 12px 0 0; max-width: 30ch; }
.footer-heading { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.footer-bottom p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* Article body (MDX) */
.prose { font-size: 1.0625rem; line-height: 1.75; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: 1.5rem; margin-top: 2em; margin-bottom: 0.6em; scroll-margin-top: 88px; }
.prose h3 { font-size: 1.1875rem; margin-top: 1.6em; margin-bottom: 0.5em; scroll-margin-top: 88px; }
.prose p, .prose ul, .prose ol { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose strong { font-weight: 650; }
.prose blockquote {
  margin: 1.5em 0; padding: 4px 0 4px 18px;
  font-family: var(--serif); font-style: italic;
  border-left: 2px solid var(--accent); color: var(--muted);
}
.prose blockquote p { margin: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose pre {
  padding: 16px 18px; border-radius: var(--radius); overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 0.875rem; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { margin: 1.5em 0; display: block; overflow-x: auto; }
.prose .table-wrap { margin: 1.5em 0; }
