:root {
  color-scheme: light dark;
  --bg: #f7f8fb;
  --bg-alt: #eef1f6;
  --fg: #0f172a;
  --muted: #5b6475;
  --card: #ffffff;
  --border: #e2e6ee;
  --accent: #0284c7;
  --accent-2: #38bdf8;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.14);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.55;
}
:root[data-theme="light"] {
  color-scheme: light;
}
/* Dark palette: chosen with the switch, or from the system when nothing is chosen.
   Keep both blocks identical. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --bg-alt: #0f172a;
  --fg: #e5e7eb;
  --muted: #9aa3b5;
  --card: #111a2e;
  --border: #1f2a40;
  --accent: #38bdf8;
  --accent-2: #7dd3fc;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1120;
    --bg-alt: #0f172a;
    --fg: #e5e7eb;
    --muted: #9aa3b5;
    --card: #111a2e;
    --border: #1f2a40;
    --accent: #38bdf8;
    --accent-2: #7dd3fc;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}
pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  overflow-x: auto;
  margin: 0.5rem 0;
}
h1,
h2,
h3 {
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  background: var(--card);
  padding: 0.5rem;
  z-index: 100;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.7rem clamp(1rem, 4vw, 3rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: var(--fg);
}
.brand img {
  border-radius: 7px;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  font-size: 0.95rem;
}
.nav-links a {
  color: var(--fg);
  opacity: 0.85;
}
.nav-links a:hover {
  opacity: 1;
  text-decoration: none;
  color: var(--accent);
}
.nav-github {
  display: inline-flex;
}
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* The icon shows the mode the switch leads to. */
.theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: inline;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: none;
  }
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5.5rem) clamp(1rem, 4vw, 3rem) 3rem;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 70%;
  background: radial-gradient(
    60% 60% at 30% 30%,
    color-mix(in srgb, var(--accent-2) 22%, transparent),
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
}
.eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin: 0 0 1rem;
}
.lead {
  font-size: 1.12rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 36rem;
}
.cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.18);
}
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.button.ghost {
  background: transparent;
}
.button.small {
  padding: 0.45rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 8px;
}
.fineprint {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.9rem 0 0;
}

/* App mock */
.hero-visual {
  min-width: 0;
}
.window {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  font-size: 11px;
  transform: perspective(1600px) rotateY(-4deg) rotateX(1deg);
}
.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.titlebar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e5e7eb;
}
.titlebar span:nth-child(1) {
  background: #ff5f57;
}
.titlebar span:nth-child(2) {
  background: #febc2e;
}
.titlebar span:nth-child(3) {
  background: #28c840;
}
.titlebar em {
  margin-left: auto;
  margin-right: auto;
  font-style: normal;
  color: var(--muted);
  font-size: 11px;
}
.app-mock {
  display: grid;
  grid-template-columns: 170px 1fr;
  min-height: 360px;
}
.app-mock aside {
  border-right: 1px solid var(--border);
  padding: 8px;
  background: var(--bg);
}
.app-mock main {
  padding: 10px 12px;
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.dot.ok {
  background: var(--ok);
}
.dot.off {
  background: var(--muted);
}
.mock-runtime {
  font-size: 9.5px;
  color: var(--muted);
  padding: 2px 2px 7px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.mock-group {
  font-size: 8.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 8px 3px 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 7px;
  margin-bottom: 5px;
}
.mock-card.selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}
.mock-card.stopped {
  opacity: 0.6;
}
.mock-card-title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-card-meta {
  color: var(--muted);
  font-size: 9.5px;
  margin: 1px 0 4px 12px;
}
.mock-chips {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex-wrap: wrap;
}
.chip {
  font-size: 8.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  color: #fff;
  background: var(--muted);
  font-style: normal;
}
.chip.claude {
  background: #d97757;
}
.chip.codex {
  background: #10a37f;
}
.chip.shell {
  background: #64748b;
}
.chip.warn {
  background: var(--warn);
}
.chip.okc {
  background: var(--ok);
}
.badge {
  font-size: 8.5px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-weight: 600;
}
.badge.err {
  color: var(--err);
}
.mock-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.mock-h2 {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-head > div:first-child {
  min-width: 0;
}
.mock-meta {
  color: var(--muted);
  font-size: 9.5px;
  margin-top: 2px;
}
.mock-actions {
  display: flex;
  gap: 4px;
  flex: none;
}
.mock-actions b {
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 9.5px;
}
.mock-actions b.danger {
  color: var(--err);
  border-color: var(--err);
}
.mock-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 9px 0 8px;
}
.mock-tabs b {
  font-weight: 500;
  color: var(--muted);
  padding: 3px 8px;
  border-bottom: 2px solid transparent;
  font-size: 10px;
}
.mock-tabs b.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.mock-block {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
  margin-bottom: 7px;
  background: var(--card);
}
.mock-block-title {
  font-weight: 700;
  font-size: 10.5px;
  margin-bottom: 5px;
}
.mock-block-title span {
  font-weight: 400;
  color: var(--muted);
}
.mock-inflight {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 4px 7px;
  background: var(--bg);
  margin-bottom: 5px;
}
.mock-inflight code,
.mock-event code,
.mock-procs code,
.mock-change code {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
  flex: none;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.7);
  }
}
.mock-event {
  display: grid;
  grid-template-columns: 12px 42px 1fr auto;
  gap: 6px;
  align-items: baseline;
  padding: 2.5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 10px;
}
.mock-event:last-child {
  border-bottom: none;
}
.mock-event i {
  font-style: normal;
  color: var(--muted);
  text-align: center;
}
.mock-event i.ok {
  color: var(--ok);
}
.mock-event i.acc {
  color: var(--accent);
}
.mock-event b {
  font-weight: 600;
}
.mock-event code.text {
  font-family: inherit;
}
.mock-event span {
  color: var(--muted);
  font-size: 9px;
}
.mock-procs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.mock-procs code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}
.mock-change {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 2px 0;
  font-size: 10px;
}

/* Strip */
.strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.strip-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.8rem clamp(1rem, 4vw, 3rem);
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}
.strip-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}
.sep {
  width: 1px;
  height: 1rem;
  background: var(--border);
}

/* Sections */
.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}
.section .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem);
}
.section.alt {
  background: var(--bg-alt);
}
.section-head {
  max-width: 42rem;
  margin-bottom: 2rem;
}
.section-head h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.6rem;
}
.section-head p {
  color: var(--muted);
  margin: 0;
  font-size: 1.05rem;
}
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.features article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem 1.4rem 1.3rem;
}
.icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
}
.icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.features h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.features p {
  margin: 0;
  color: var(--muted);
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  counter-reset: step;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
  position: relative;
}
.steps b {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.steps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

/* Platforms */
.platforms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.platforms article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.platform-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.platform-head svg {
  width: 26px;
  height: 26px;
  color: var(--fg);
}
.platform-head h3 {
  margin: 0;
  font-size: 1.15rem;
}
.platforms p {
  margin: 0;
  color: var(--muted);
}
.platform-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}
details {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.3rem;
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}
details p {
  font-size: 0.92rem;
  margin-top: 0.5rem;
}

/* FAQ */
.faq {
  max-width: 52rem;
}
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 0.6rem;
}
.faq summary {
  font-size: 1rem;
}
.faq p {
  color: var(--muted);
  margin: 0.6rem 0 0;
}

/* Legal pages */
.legal {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
}
.legal article + article {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.legal article {
  scroll-margin-top: 4rem;
}
.legal h2 {
  font-size: 1.1rem;
  margin: 1.8rem 0 0.4rem;
}
.legal p {
  margin: 0 0 0.8rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1rem, 4vw, 3rem) 3rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: flex-start;
}
.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
}
.footer-links a + a::before {
  content: "|";
  color: var(--muted);
  opacity: 0.6;
  margin: 0 0.7rem;
}
.footer p {
  margin: 0;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .window {
    transform: none;
  }
  .nav-links a:not(.nav-github) {
    display: none;
  }
}
@media (max-width: 520px) {
  .app-mock {
    grid-template-columns: 1fr;
  }
  .app-mock aside {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pulse {
    animation: none;
  }
  html {
    scroll-behavior: auto;
  }
}
