:root {
  --bg: #fbfbfd;
  --bg-alt: #f2f2f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --accent: #4f5ff0;
  --accent-text: #3a48d6;
  --accent-soft: #eceefe;
  --code-bg: #f4f4f7;
  --warn: #c2410c;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111113;
    --bg-alt: #19191c;
    --card: #1c1c1f;
    --text: #f5f5f7;
    --muted: #a1a1a6;
    --line: #2c2c31;
    --accent: #6b79ff;
    --accent-text: #9aa4ff;
    --accent-soft: #23264a;
    --code-bg: #1f1f23;
    --warn: #fb923c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
kbd {
  font: 600 0.82em/1 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 3px 7px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 6px; background: var(--card); white-space: nowrap;
}
code { font-family: var(--mono); font-size: 0.88em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; z-index: 100; background: var(--card); padding: 8px 12px; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.top-inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; white-space: nowrap; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.top nav { margin-left: auto; display: flex; gap: 22px; font-size: 15px; }
.top nav a { color: var(--muted); white-space: nowrap; }
.top nav .short { display: none; }
.top nav a:hover, .top nav a[aria-current] { color: var(--text); text-decoration: none; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 980px; font-weight: 600; font-size: 16px;
  border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--text); background: var(--card); }
.btn-ghost:hover { border-color: var(--muted); }

/* Code blocks with copy */
.cmd {
  position: relative; display: flex; align-items: center;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px;
  margin: 0 0 12px;
}
.cmd pre {
  margin: 0; padding: 12px 16px; overflow-x: auto; flex: 1;
  font: 14.5px/1.6 var(--mono); white-space: pre;
}
.cmd pre .c { color: var(--muted); }
.cmd pre .p { color: var(--muted); user-select: none; }
.copy {
  flex: none; align-self: flex-start; margin: 6px 6px 6px 0;
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 13px -apple-system, BlinkMacSystemFont, sans-serif; color: var(--muted);
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 6px 9px; cursor: pointer;
}
.copy:hover { background: var(--card); border-color: var(--line); color: var(--text); }
.copy svg { width: 15px; height: 15px; }
.copy.done { color: #16a34a; }

/* Home: hero */
.hero { text-align: center; padding-block: 72px 40px; }
.hero .icon { width: 128px; height: 128px; filter: drop-shadow(0 10px 24px rgb(79 95 240 / 0.25)); }
.hero h1 { font-size: clamp(40px, 7vw, 64px); margin: 16px 0 8px; font-weight: 700; }
.hero .tagline { font-size: clamp(20px, 3vw, 26px); color: var(--muted); margin: 0 0 12px; font-weight: 500; }
.hero .lede { max-width: 620px; margin: 0 auto 28px; color: var(--muted); }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.hero .cmd { max-width: 520px; margin: 0 auto; text-align: left; }
.hero .req { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* Home: demo */
.demo-section { padding-block: 24px 64px; }
.demo-frame { max-width: 860px; margin: 0 auto; }
.demo-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 14px; }

/* Demo colors: a dark Mac by default, a light one in light mode. */
.stage {
  --d-desk: linear-gradient(135deg, #3b3f7a, #1e2140 55%, #2a1f3d);
  --d-win: #1e1e20; --d-side: #262628; --d-text: #e8e8ea; --d-side-text: #c9c9cd;
  --d-strong: #fff; --d-dim: #8b8b90; --d-line: rgb(255 255 255 / 0.1);
  --d-hover: rgb(255 255 255 / 0.1); --d-stripe: rgb(255 255 255 / 0.025);
  --d-sel: #3a62d6; --d-hl: #3a6ff0; --d-menu: rgb(44 44 48 / 0.92);
  --d-edge: rgb(255 255 255 / 0.12); --d-drop: rgb(0 0 0 / 0.5);
}
@media (prefers-color-scheme: light) {
  .stage {
    --d-desk: linear-gradient(135deg, #b9c1ff, #dfe3ff 55%, #eddcff);
    --d-win: #ffffff; --d-side: #ececf0; --d-text: #1d1d1f; --d-side-text: #3a3a3e;
    --d-strong: #000; --d-dim: #86868b; --d-line: rgb(0 0 0 / 0.09);
    --d-hover: rgb(0 0 0 / 0.07); --d-stripe: rgb(0 0 0 / 0.025);
    --d-sel: #2f6df6; --d-hl: #2f6df6; --d-menu: rgb(246 246 248 / 0.9);
    --d-edge: rgb(0 0 0 / 0.1); --d-drop: rgb(0 0 0 / 0.18);
  }
}
.stage {
  position: relative; aspect-ratio: 16 / 9.4; overflow: hidden;
  border-radius: 14px; background: var(--d-desk);
  box-shadow: var(--shadow); user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  container-type: inline-size;
}
.cam {
  position: absolute; inset: 0; transform-origin: 0 0;
  transition: transform 1.1s cubic-bezier(0.45, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) { .cam { transition: none; } }
.finder {
  position: absolute; left: 5%; top: 7%; width: 90%; height: 86%;
  background: var(--d-win); border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--d-edge), 0 20px 50px var(--d-drop);
  color: var(--d-text); display: grid; grid-template-columns: 22% 1fr; font-size: 1.6cqi;
}
.f-side { background: var(--d-side); padding: 2.4cqi 1.6cqi; color: var(--d-side-text); }
.f-lights { display: flex; gap: 0.9cqi; margin-bottom: 3cqi; }
.f-lights i { width: 1.4cqi; height: 1.4cqi; border-radius: 50%; background: #ff5f57; }
.f-lights i:nth-child(2) { background: #febc2e; }
.f-lights i:nth-child(3) { background: #28c840; }
.f-side b { display: block; font-size: 1.25cqi; color: var(--d-dim); font-weight: 600; margin: 1.4cqi 0 0.6cqi; }
.f-side span { display: block; padding: 0.45cqi 0.8cqi; border-radius: 0.6cqi; }
.f-side span.on { background: var(--d-hover); color: var(--d-strong); }
.f-main { display: flex; flex-direction: column; }
.f-bar { height: 6.4cqi; display: flex; align-items: center; padding: 0 2cqi; font-weight: 600; font-size: 1.9cqi; border-bottom: 1px solid var(--d-line); }
.f-head, .f-row { display: grid; grid-template-columns: 1fr 26% 14%; padding: 0 2cqi; align-items: center; }
.f-head { height: 3.6cqi; color: var(--d-dim); font-size: 1.3cqi; font-weight: 600; border-bottom: 1px solid var(--d-line); }
.f-row { height: 3.9cqi; margin: 0 0.8cqi; padding: 0 1.2cqi; border-radius: 0.7cqi; }
.f-row:nth-child(odd) { background: var(--d-stripe); }
.f-row .n { display: flex; align-items: center; gap: 1cqi; }
.f-row .doc { width: 1.5cqi; height: 1.9cqi; border-radius: 0.25cqi; background: #e9e9ef; box-shadow: 0 0 0 1px var(--d-line); position: relative; }
.f-row .doc::after { content: ""; position: absolute; inset: 30% 22%; border-radius: 0.2cqi; background: #5b6cf0; }
.f-row .doc.gray::after { background: #9a9aa2; }
.f-row .m { color: var(--d-dim); }
.f-row.sel { background: var(--d-sel) !important; color: #fff; }
.f-row.sel .m { color: #dfe6ff; }

.menu {
  position: absolute; z-index: 3; min-width: 31cqi;
  background: var(--d-menu); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 1.1cqi; padding: 0.7cqi;
  box-shadow: 0 0 0 1px var(--d-edge), 0 12px 32px var(--d-drop);
  color: var(--d-text); font-size: 1.75cqi;
  opacity: 0; transform: scale(0.97); transform-origin: top left; pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.menu.open { opacity: 1; transform: none; }
.menu .h { color: var(--d-dim); font-size: 1.35cqi; font-weight: 600; padding: 0.6cqi 1.3cqi 0.5cqi; }
.menu .it { display: flex; align-items: center; gap: 1.1cqi; padding: 0.75cqi 1.3cqi; border-radius: 0.7cqi; }
.menu .k { margin-left: auto; color: var(--d-dim); padding-left: 3cqi; }
.menu .it.hl { background: var(--d-hl); color: #fff; }
.menu .it.hl .k { color: #fff; }
.menu .ic { width: 2.2cqi; height: 2.2cqi; border-radius: 0.55cqi; display: grid; place-items: center; font-size: 1.2cqi; font-weight: 800; color: #fff; }
.menu .sep { height: 1px; background: var(--d-line); margin: 0.6cqi 1.3cqi; }
.menu .plain { display: flex; padding: 0.75cqi 1.3cqi; }

.cursor {
  position: absolute; z-index: 5; left: 0; top: 0; width: 2.6cqi; height: auto;
  transition: transform 0.9s cubic-bezier(0.45, 0, 0.2, 1);
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.5));
}
.cursor.click { animation: press 0.18s ease 2; }
@keyframes press { 50% { scale: 0.85; } }
.toast {
  position: absolute; z-index: 4; left: 50%; bottom: 12%; translate: -50% 0;
  background: var(--d-menu); color: var(--d-strong); border-radius: 980px; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 1cqi 2.2cqi; font-size: 1.7cqi; box-shadow: 0 0 0 1px var(--d-edge), 0 10px 30px var(--d-drop);
  opacity: 0; transition: opacity 0.25s ease;
}
.toast.show { opacity: 1; }

/* Home: features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; padding: 8px 0 64px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin: 10px 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.card .glyph { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.card .glyph svg { width: 22px; height: 22px; }

.band { background: var(--bg-alt); border-block: 1px solid var(--line); padding: 64px 0; }
.band h2 { text-align: center; font-size: 34px; margin: 0 0 32px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 12px;
}
.steps h3 { margin: 0 0 6px; font-size: 19px; }
.steps p { color: var(--muted); margin: 0; }
.center { text-align: center; margin-top: 36px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

/* Docs */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }
.toc { position: sticky; top: 80px; align-self: start; font-size: 15px; max-height: calc(100vh - 100px); overflow-y: auto; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--muted); }
.toc a:hover { color: var(--text); text-decoration: none; background: var(--bg-alt); }
.toc a.active { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.toc ol ol a { padding-left: 22px; font-size: 14px; }
.doc h1 { font-size: 40px; margin: 0 0 8px; }
.doc .intro { color: var(--muted); font-size: 19px; margin-bottom: 32px; }
.doc section { padding-top: 8px; margin-bottom: 40px; }
.doc h2 { font-size: 28px; margin: 0 0 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.doc section:first-of-type h2 { border-top: 0; padding-top: 0; }
.doc h3 { font-size: 20px; margin: 28px 0 10px; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 6px; }
.note {
  display: flex; gap: 12px; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin: 16px 0; font-size: 16px;
}
.note.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.note strong { white-space: nowrap; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: center; margin: 0 0 16px; }
.opts { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 0 0 24px; }
.opts th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.opts td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.opts td:first-child { white-space: nowrap; }
.opts code { background: none; padding: 0; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
  .toc ol ol { display: none; }
  .top nav { gap: 14px; }
  .opts td:first-child { white-space: normal; }
}

/* Phones */
@media (max-width: 600px) {
  body { font-size: 16px; }
  html { scroll-padding-top: 64px; }
  .wrap { padding-inline: 20px; }

  .top-inner { padding: 0 16px; height: 52px; gap: 12px; }
  .brand { gap: 8px; font-size: 16px; }
  .brand img { width: 24px; height: 24px; }
  .top nav { gap: 16px; font-size: 14px; }
  .top nav .long { display: none; }
  .top nav .short { display: inline; }

  .hero { padding-block: 40px 32px; }
  .hero .icon { width: 96px; height: 96px; }
  .hero h1 { margin: 12px 0 6px; }
  .hero .tagline { margin-bottom: 14px; }
  .hero .lede { margin-bottom: 24px; }
  .hero .actions { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 20px; }
  .hero .actions .btn { justify-content: center; }
  .hero .req { font-size: 13px; margin-top: 14px; }
  .cmd pre { font-size: 13px; padding: 10px 12px; }
  .cmd .copy span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cmd .copy { padding: 6px 8px; }

  .demo-section { padding-block: 8px 40px; }
  .stage { border-radius: 10px; }
  .toast { font-size: 12px; padding: 6px 14px; bottom: 8%; white-space: nowrap; }
  .demo-caption { align-items: flex-start; font-size: 13px; }
  .demo-caption .copy { margin: -4px -9px 0 0; }

  .features { gap: 12px; padding: 0 0 40px; }
  .card { padding: 20px; }
  .card h3 { font-size: 18px; margin-top: 12px; }
  .card p { font-size: 15px; }

  .band { padding: 44px 0; }
  .band h2 { font-size: 28px; margin-bottom: 24px; }
  .steps { gap: 28px; }
  .steps h3 { font-size: 18px; }
  .center { margin-top: 32px; }

  footer { padding: 24px 0 36px; }
  footer .wrap { flex-direction: column; gap: 12px; }
  footer nav { gap: 8px 18px; }

  .docs { padding: 20px 20px 48px; }
  .doc h1 { font-size: 32px; }
  .doc .intro { font-size: 17px; margin-bottom: 24px; }
  .doc h2 { font-size: 24px; }
  .doc h3 { font-size: 18px; margin-top: 24px; }
  .note { padding: 12px 14px; font-size: 15px; }
  .opts { font-size: 14.5px; }
  .doc p code, .doc li code { overflow-wrap: anywhere; }
}
