:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --bg-alt: #f1eee7;
  --text: #1d1b18;
  --muted: #5f5a52;
  --border: #e4e0d8;
  --accent: #3b5bdb;
  --accent-soft: #e7ecff;
  --green: #2b8a3e;
  --amber: #c47f00;
  --red: #c92a2a;
  --shadow: 0 1px 2px rgba(20, 18, 14, .04), 0 8px 24px rgba(20, 18, 14, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #21211e;
    --surface-2: #2a2a26;
    --bg-alt: #1a1a18;
    --text: #f1efe9;
    --muted: #a8a399;
    --border: #33322e;
    --accent: #8ea2ff;
    --accent-soft: #232a45;
    --green: #69db7c;
    --amber: #ffc94d;
    --red: #ff8787;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #141413;
  --surface: #21211e;
  --surface-2: #2a2a26;
  --bg-alt: #1a1a18;
  --text: #f1efe9;
  --muted: #a8a399;
  --border: #33322e;
  --accent: #8ea2ff;
  --accent-soft: #232a45;
  --green: #69db7c;
  --amber: #ffc94d;
  --red: #ff8787;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .1em .4em;
  white-space: nowrap;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section { padding: 72px 0; border-top: 1px solid var(--border); }
/* Every other section is tinted, so each one reads as its own block. */
section.alt { background: var(--bg-alt); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 640px; margin: 14px 0 0; }

/* Nav */
nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-weight: 800; }
nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; }
nav ul a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
nav ul a:hover { color: var(--text); }
.theme { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
@media (max-width: 720px) { nav ul { display: none; } }

/* Hero */
.hero { padding: 72px 0 56px; border-top: 0; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; max-width: 780px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.video { margin-top: 44px; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); aspect-ratio: 16 / 9; position: relative; }
.video video, .video iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; }
.video .placeholder { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; background: repeating-linear-gradient(135deg, var(--surface) 0 18px, var(--surface-2) 18px 36px); }
.video.missing video { display: none; }
.video.missing .placeholder { display: grid; }
.play { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-size: 1.5rem; margin: 0 auto 14px; }
.placeholder p { margin: 4px 0; color: var(--muted); }
.placeholder strong { color: var(--text); font-size: 1.1rem; }
.video.loop video { pointer-events: none; }

/* Walkthrough: one player, a chapter per act */
.player { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; margin-top: 36px; align-items: start; }
@media (max-width: 860px) { .player { grid-template-columns: 1fr; } }
.player .video { margin-top: 0; }
.now { margin: 14px 2px 0; }
.now h3 { font-size: 1.15rem; }
.now p { margin: 4px 0 0; color: var(--muted); font-size: .95rem; }
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chapters button {
  width: 100%; text-align: left; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  color: var(--text); font: inherit; cursor: pointer;
}
.chapters button:hover { border-color: var(--accent); }
.chapters button[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); }
.chapters .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: .85rem; }
.chapters button[aria-current="true"] .num { background: var(--accent); color: var(--bg); }
.chapters strong { display: block; font-size: .95rem; }
.chapters small { display: block; color: var(--muted); font-size: .84rem; line-height: 1.4; margin-top: 2px; }
.chapters .len { color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; padding-top: 4px; }

/* How it works: numbered stages, 1 → 2 → 3 → 4 → 5, each explained below
   its number. On phones they run down the page. */
.stepper { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 20px; }
.stage { position: relative; }
.stage .dot {
  position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--bg);
  font-weight: 800; font-size: 1.05rem; box-shadow: 0 0 0 6px var(--bg);
}
/* The arrow from each stage's number to the next one's. */
.stage:not(:last-child)::after {
  content: ""; position: absolute; top: 21px; left: 56px; right: -8px; height: 2px;
  background: var(--accent); opacity: .45;
}
.stage:not(:last-child)::before {
  content: ""; position: absolute; top: 16px; right: -10px; width: 0; height: 0;
  border-left: 9px solid var(--accent); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  opacity: .7;
}
.stage h3 { font-size: 1.05rem; margin-top: 18px; }
.stage p { margin: 8px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.where { display: inline-block; margin-top: 12px; font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }
@media (max-width: 860px) {
  .stepper { grid-template-columns: 1fr; gap: 0; }
  .stage { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 18px; padding-bottom: 30px; }
  .stage .dot { grid-row: 1 / span 3; }
  .stage h3 { margin-top: 10px; }
  .stage:not(:last-child)::after { top: 52px; bottom: 6px; left: 21px; right: auto; width: 2px; height: auto; }
  .stage:not(:last-child)::before { top: auto; bottom: 0; left: 16px; right: auto; border-top: 9px solid var(--accent); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 0; }
}

/* Mock cards */
.mocks { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
@media (max-width: 820px) { .mocks { grid-template-columns: 1fr; } }
.channel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.channel header { padding: 10px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: .92rem; }
.channel header span { color: var(--muted); font-weight: 500; }
.msg { display: flex; gap: 12px; padding: 14px 16px; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; color: #fff; font-size: .9rem; }
.who { font-weight: 700; font-size: .92rem; }
.who small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.body { font-size: .93rem; min-width: 0; }
.body p { margin: 2px 0; }
.card { margin-top: 6px; border-left: 4px solid var(--red); padding: 4px 0 4px 12px; }
.card.high { border-color: var(--amber); }
.meta { color: var(--muted); font-size: .82rem; }
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); margin-right: 4px; }
.buttons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.buttons span { border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.buttons span.go { background: var(--green); border-color: var(--green); color: var(--bg); }
.private { color: var(--muted); font-size: .78rem; margin-bottom: 4px; }

/* Features */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px; }
.feature h3 { font-size: 1.08rem; }
.bar { width: 28px; height: 4px; background: var(--accent); border-radius: 2px; margin-bottom: 14px; }
.feature p { color: var(--muted); margin: 8px 0 0; font-size: .95rem; }
.feature ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .92rem; }
.feature li { margin: 3px 0; }

/* Commands teaser and guide */
.cmds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 36px; }
@media (max-width: 820px) { .cmds { grid-template-columns: 1fr; } }
.cmd-group { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 8px 20px 12px; }
.cmd-group h3 { font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 12px 0 6px; }
.cmd { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.cmd code { white-space: normal; word-break: break-word; }
.cmd span { color: var(--muted); }
@media (max-width: 480px) { .cmd { grid-template-columns: 1fr; gap: 2px; } }

/* Principles */
.principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 36px; }
@media (max-width: 900px) { .principles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .principles { grid-template-columns: 1fr; } }
.principle h3 { font-size: 1.05rem; }
.principle p { color: var(--muted); margin: 8px 0 0; font-size: .95rem; }

footer { border-top: 1px solid var(--border); padding: 36px 0 48px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

.more { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
nav ul a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* The commands guide */
.guide-head { padding: 56px 0 8px; }
.guide-head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
.search { margin-top: 24px; width: 100%; max-width: 480px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.toc a { display: inline-block; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; background: var(--surface); }
.toc a:hover { color: var(--text); border-color: var(--accent); }
.guide section { padding: 48px 0; }
.entries { display: grid; gap: 14px; margin-top: 24px; }
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; }
.entry h3 { font-size: 1rem; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.entry h3 code { font-size: .95rem; white-space: normal; }
.entry .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.entry .where { margin-top: 0; }
.entry p { margin: 10px 0 0; color: var(--muted); font-size: .95rem; }
.entry ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .93rem; }
.entry li { margin: 4px 0; }
.entry li code, .entry p code { white-space: normal; }
.example { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; color: var(--muted); }
.example b { color: var(--text); font-weight: 600; }
.empty { display: none; color: var(--muted); margin-top: 28px; }
.ownership { width: 100%; border-collapse: collapse; margin-top: 24px; font-size: .95rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.ownership th, .ownership td { text-align: left; padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.ownership th { background: var(--surface-2); font-size: .85rem; color: var(--muted); border-top: 0; }
@media (max-width: 560px) { .ownership th, .ownership td { padding: 10px; } }

/* Setup page */
.setup-steps { margin-top: 36px; max-width: 760px; }
.setup-steps .stepper { grid-template-columns: 1fr; gap: 0; margin-top: 0; }
.setup-steps .stage { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 20px; padding-bottom: 40px; }
.setup-steps .stage .dot { grid-row: 1 / span 20; }
.setup-steps .stage h3 { margin-top: 10px; font-size: 1.2rem; }
.setup-steps .stage > div { min-width: 0; }
.setup-steps .stage:not(:last-child)::after { top: 52px; bottom: 6px; left: 21px; right: auto; width: 2px; height: auto; }
.setup-steps .stage:not(:last-child)::before { top: auto; bottom: 0; left: 16px; right: auto; border-top: 9px solid var(--accent); border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 0; }
.setup-steps ul { color: var(--muted); padding-left: 18px; margin: 10px 0 0; }
.setup-steps li { margin: 4px 0; }

pre.term {
  margin: 14px 0 0; padding: 14px 16px; border-radius: 12px; overflow-x: auto;
  background: #16161a; color: #e9e7e1; border: 1px solid var(--border);
  font: 500 .88rem/1.6 "JetBrains Mono", ui-monospace, Menlo, monospace;
}
pre.term .c { color: #8b877e; }
/* Code in a terminal block takes the block's colours, not inline code's. */
pre.term code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; white-space: pre; }
.copyable { position: relative; }
.copy {
  position: absolute; top: 8px; right: 8px; font: 600 .78rem Inter, sans-serif; cursor: pointer;
  color: #e9e7e1; background: #2a2a30; border: 1px solid #3a3a42; border-radius: 6px; padding: 4px 10px;
}
.copy:hover { background: #34343c; }
pre.prompt { white-space: pre-wrap; padding-top: 40px; max-height: 260px; }

.tabs { margin-top: 16px; }
.tablist { display: flex; flex-wrap: wrap; gap: 6px; }
.tablist button {
  font: 600 .9rem Inter, sans-serif; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.tablist button[aria-selected="true"] { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.tablist .tag { font-size: .72rem; font-weight: 700; color: var(--accent); margin-left: 6px; }
.panel { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.panel p { margin: 0 0 6px; color: var(--muted); }
.panel p:first-child { color: var(--text); }

.setup-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .setup-layout { grid-template-columns: 1fr; } }
.aside { position: sticky; top: 84px; display: grid; gap: 16px; margin-top: 36px; }
@media (max-width: 900px) { .aside { position: static; margin-top: 0; } }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; }
.box h3 { font-size: 1rem; }
.box p, .box ul { margin: 8px 0 0; color: var(--muted); font-size: .93rem; }
.box ul { padding-left: 18px; }
.box li { margin: 3px 0; }
.box.safe { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.box.safe h3 { color: var(--green); }

.checklist { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; counter-reset: setup; }
@media (max-width: 760px) { .checklist { grid-template-columns: 1fr; } }
.checklist li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font-size: .93rem; counter-increment: setup; }
.checklist li::before { content: counter(setup); font-weight: 700; color: var(--accent); margin-right: 8px; }
.checklist .you { display: inline-block; margin-left: 6px; font-size: .72rem; font-weight: 700; color: var(--amber); }

/* Header: the Set up button sits on the right, beside the theme toggle. */
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-cta { padding: 7px 14px; font-size: .92rem; }
.nav-cta[aria-current="page"] { opacity: .75; }

/* The Set it up section, near the bottom of the home and commands pages. */
.setup-cta { background: var(--accent-soft); }
.mini-steps { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .mini-steps { grid-template-columns: 1fr; } }
.mini-steps li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.mini-steps .dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--bg); font-weight: 800; }
.mini-steps h3 { font-size: 1rem; margin-top: 6px; }
.mini-steps p { margin: 6px 0 0; color: var(--muted); font-size: .93rem; }
.mini-steps code { white-space: normal; }

/* The notifications page: each flow as labelled rows. */
.kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; max-width: 760px; }
@media (max-width: 640px) { .kinds { grid-template-columns: 1fr; } }
.flow { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 16px; margin: 14px 0 0; font-size: .93rem; }
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; gap: 2px; } .flow dd { margin-bottom: 8px; } }
.flow dt { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.flow dd { margin: 0; line-height: 1.6; }
.btns { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 4px; vertical-align: middle; }
.btns span { border: 1px solid var(--border); border-radius: 6px; padding: 1px 9px; font-size: .8rem; font-weight: 600; background: var(--surface); }
.btns span.go { background: var(--green); border-color: var(--green); color: var(--bg); }
.note { color: var(--muted); border-left: 3px solid var(--accent); padding-left: 8px; display: inline-block; }
.if-note { font-size: .78rem; font-weight: 600; color: var(--accent); }
.legend { margin-top: 24px; color: var(--muted); font-size: .9rem; }
.rules-head { font-size: 1rem; margin-top: 28px; }
.rules { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: .95rem; max-width: 760px; }
.rules li { margin: 4px 0; }

.schema { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 28px 0 16px; }
@media (max-width: 760px) { .schema { grid-template-columns: 1fr; } }
.schema h3 { font-size: 1rem; margin-bottom: 8px; }
.schema pre { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font-size: .85rem; line-height: 1.5; }
.schema pre code { background: none; padding: 0; }

.tools { list-style: none; padding: 0; columns: 2; column-gap: 28px; }
@media (max-width: 760px) { .tools { columns: 1; } }
.tools li { break-inside: avoid; margin: 6px 0; }
.tool { padding: 36px 0 8px; border-top: 1px solid var(--border); }
.tool h3 { font-size: 1rem; margin: 22px 0 8px; }
.tool h3 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.tool .none { color: var(--muted); }
.tablewrap { overflow-x: auto; }
.tool table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tool th, .tool td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.tool th { color: var(--muted); font-weight: 600; }
.tool td:nth-child(4) { color: var(--muted); }

/* Landing: the proactive agent glimpse is one private suggestion with the three layers beside it. */
.mocks.single { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
.mocks.single .layers { grid-template-columns: 1fr; margin-top: 0; gap: 12px; }
.mocks.single .layers .feature { padding: 16px 18px; }
.mocks.single .layers .where { margin-top: 6px; }
@media (max-width: 820px) { .mocks.single { grid-template-columns: 1fr; } }
