/* The website's styles.
 *
 * Colours, fonts and radii are the app's own (web/src/styles/tokens.css),
 * copied rather than imported: the app's sheet sizes a dense tool, and its
 * type scale is far too small for reading pages. Change a colour there and
 * here together, or the screenshots stop matching the page around them.
 */

:root {
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-xl: 14px;

  --label-tracking: 0.06em;
  --wrap: 1160px;
  --wrap-narrow: 820px;
  --gutter: 24px;
  --header-h: 60px;

  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-inset: #eef1f4;
  --bg-hover: #eaeef2;
  --border: #d8dee4;
  --border-strong: #b7bfc8;
  --text: #1f2328;
  --text-muted: #59636e;
  --accent: #0969da;
  --accent-hover: #0860c4;
  --accent-fg: #ffffff;
  --accent-subtle: #ddf4ff;
  --accent-border: #a5d3ff;
  --add-bg: #e6ffec;
  --add-fg: #1a7f37;
  --del-bg: #ffebe9;
  --del-fg: #cf222e;
  --warn: #9a6700;
  --warn-bg: #fff8c5;
  --warn-border: #e9d68a;
  --header-bg: rgba(255, 255, 255, 0.86);
  --shadow-md: 0 4px 12px rgba(16, 22, 26, 0.12);
  --shadow-lg: 0 18px 48px rgba(16, 22, 26, 0.16);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-subtle: #151b23;
    --bg-inset: #1c2129;
    --bg-hover: #21262d;
    --border: #2f3742;
    --border-strong: #4a5460;
    --text: #e6edf3;
    --text-muted: #9198a1;
    --accent: #4493f8;
    --accent-hover: #63a5ff;
    --accent-fg: #0d1117;
    --accent-subtle: #12243b;
    --accent-border: #1f4d80;
    --add-bg: #0f2417;
    --add-fg: #3fb950;
    --del-bg: #2a1416;
    --del-fg: #f85149;
    --warn: #d29922;
    --warn-bg: #2b2413;
    --warn-border: #5c4813;
    --header-bg: rgba(13, 17, 23, 0.86);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  }
}

/* ------------------------------------------------------------------ base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  /* Keeps the footer at the bottom of short pages (404, download, buy)
     instead of halfway up the window. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > main {
  flex: 1 0 auto;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

:not(pre) > code {
  font-size: 0.86em;
  background: var(--bg-inset);
  border-radius: var(--radius-sm);
  padding: 0.12em 0.36em;
  overflow-wrap: anywhere;
}

kbd {
  font-size: 0.82em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.05em 0.4em;
  background: var(--bg-subtle);
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap.narrow {
  max-width: var(--wrap-narrow);
}

.muted {
  color: var(--text-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-weight: 600;
}

.skip:focus {
  top: 10px;
  color: var(--accent-fg);
}

/* The app's section labels: small, uppercase, tracked. */
.label {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: var(--label-tracking);
  text-transform: uppercase;
  color: var(--accent);
}

/* --------------------------------------------------------------- buttons */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms cubic-bezier(0.2, 0, 0.2, 1);
}

.button.primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.button.primary:hover {
  background: var(--accent-hover);
  color: var(--accent-fg);
}

.button.secondary {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.button.large {
  padding: 13px 22px;
  font-size: 17px;
}

.button.small {
  padding: 6px 14px;
  font-size: 14.5px;
}

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

.brand img {
  border-radius: 7px;
}

.site-nav {
  display: flex;
  gap: 2px;
  min-width: 0;
}

.site-nav a {
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 15.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  background: var(--bg-hover);
  color: var(--text);
}

.header-buy {
  margin-left: auto;
}

@media (max-width: 820px) {
  .site-nav .nav-home {
    display: none;
  }
}

@media (max-width: 460px) {
  :root {
    --gutter: 16px;
  }
  .header-row {
    gap: 6px;
  }
  .brand span {
    font-size: 17px;
  }
  .site-nav a {
    padding: 6px 7px;
    font-size: 15px;
  }
}

/* ------------------------------------------------------------------ hero */

.hero {
  padding: 72px 0 56px;
}

.hero h1 {
  max-width: 15em;
  margin: 0;
  font-size: clamp(2.3rem, 5.4vw, 4.1rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.lede {
  max-width: 40em;
  margin: 22px 0 0;
  font-size: clamp(1.1rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.for-whom {
  max-width: 40em;
  margin: 14px 0 0;
  color: var(--text-muted);
}

.release-line,
.requirements-line {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 15px;
}

.release-line + .requirements-line {
  margin-top: 4px;
}

/* A screenshot, in a plain window frame. */
.window {
  margin: 48px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  box-shadow: var(--shadow-lg);
}

.window-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.window-bar span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
}

.window-bar span:nth-child(2) {
  background: #febc2e;
}

.window-bar span:nth-child(3) {
  background: #28c840;
}

.window img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------- sections */

main > section {
  padding: 88px 0;
  border-top: 1px solid var(--border);
}

main > section.hero {
  border-top: 0;
}

section h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.section-lede {
  max-width: 42em;
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* The problem, as a diff: what ordinary tooling does, then what this does. */
.diff {
  margin-top: 36px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.hunk + .hunk {
  border-top: 1px solid var(--border);
}

.diff .line {
  display: grid;
  grid-template-columns: 44px 1fr;
  margin: 0;
  padding: 14px 18px 14px 0;
  line-height: 1.55;
}

.diff .line.del {
  background: var(--del-bg);
}

.diff .line.add {
  background: var(--add-bg);
}

.diff .sign {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
}

.diff .del .sign {
  color: var(--del-fg);
}

.diff .add .sign {
  color: var(--add-fg);
}

/* -------------------------------------------------------------- features */

.showcase {
  margin-top: 56px;
}

.showcase + .showcase {
  margin-top: 104px;
}

.showcase-text {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  column-gap: 56px;
  align-items: end;
}

.showcase-text .label,
.showcase-text h3 {
  grid-column: 1;
}

.showcase-text h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2.7vw, 2.1rem);
  letter-spacing: -0.02em;
}

.showcase-text > div {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.showcase-text > div p {
  margin: 0 0 12px;
}

.showcase-text > div p:last-child {
  margin-bottom: 0;
}

.showcase .window {
  margin-top: 32px;
}

.grid-title {
  margin: 112px 0 24px;
  font-size: clamp(1.4rem, 2.4vw, 1.8rem);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.feature-grid li {
  padding: 24px;
  background: var(--bg);
}

.feature-grid h4 {
  margin: 0 0 6px;
  font-size: 17px;
}

.feature-grid p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15.5px;
}

.more {
  margin: 24px 0 0;
}

/* ---------------------------------------------------------------- agents */

main > section.agents {
  background: var(--bg-subtle);
}

.agents-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  margin-top: 40px;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  position: relative;
  padding-left: 52px;
  counter-increment: step;
}

.steps li + li {
  margin-top: 26px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--accent-border);
  border-radius: 50%;
  background: var(--accent-subtle);
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 700;
}

.steps h3 {
  margin: 0;
  font-size: 18px;
}

.steps p {
  margin: 4px 0 0;
  color: var(--text-muted);
}

.agent-example .label {
  color: var(--text-muted);
}

.agent-example > p:not(.label) {
  margin: 16px 0 0;
}

/* ------------------------------------------------------------ code blocks */

.code-block {
  position: relative;
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.6;
  tab-size: 2;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-muted);
  font: 600 12.5px/1.5 var(--font-ui);
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms;
}

.code-block:hover .copy-button,
.copy-button:focus-visible,
.copy-button.done {
  opacity: 1;
}

@media (hover: none) {
  .copy-button {
    opacity: 1;
  }
}

/* --------------------------------------------------------------- private */

.checks {
  margin: 28px 0 24px;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  padding-left: 32px;
}

.checks li + li {
  margin-top: 12px;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.42em;
  width: 15px;
  height: 8px;
  border-left: 2.5px solid var(--add-fg);
  border-bottom: 2.5px solid var(--add-fg);
  transform: rotate(-45deg);
}

/* --------------------------------------------------------------- pricing */

.pricing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.price-card,
.requirements {
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.price-card {
  background: var(--bg-subtle);
}

.price {
  font-size: clamp(2.6rem, 5vw, 3.4rem);
  letter-spacing: -0.03em;
}

.price-terms {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0;
}

.price-card > p:not(.label) {
  margin: 14px 0 0;
}

.requirements h2 {
  font-size: 1.5rem;
}

.requirements dl {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px 16px;
  margin: 24px 0;
}

.requirements dt {
  color: var(--text-muted);
  font-weight: 600;
}

.requirements dd {
  margin: 0;
}

.requirements > p {
  margin: 0;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------- faq */

.faq h2 {
  margin-bottom: 20px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary h3 {
  margin: 0;
  font-size: 18.5px;
  letter-spacing: 0;
}

.faq-item summary::after {
  content: '+';
  flex: none;
  color: var(--text-muted);
  font: 400 24px/1 var(--font-mono);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 0 20px;
}

.faq-answer p {
  margin: 0 0 10px;
}

/* Visible on purpose: copy the owner still has to write. */
.todo {
  padding: 2px 8px;
  border: 1px dashed var(--warn-border);
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  color: var(--warn);
  font-size: 0.92em;
}

/* ----------------------------------------------------------------- prose */

.prose {
  line-height: 1.65;
}

.prose h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 2.7rem);
  letter-spacing: -0.02em;
}

.prose h2 {
  position: relative;
  margin: 2.4em 0 0.7em;
  padding-top: 0.4em;
  font-size: 1.65rem;
}

.prose h3 {
  position: relative;
  margin: 1.9em 0 0.5em;
  font-size: 1.25rem;
}

.prose h4 {
  position: relative;
  margin: 1.6em 0 0.4em;
  font-size: 1.05rem;
}

.prose .anchor {
  position: absolute;
  left: -0.9em;
  width: 0.9em;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0;
}

.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor {
  opacity: 1;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li + li {
  margin-top: 0.3em;
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 0.2em 1.1em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-muted);
}

.prose hr {
  margin: 2.6em 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}

/* The guide puts a rule before every section; the rule already separates
   them, so the heading's own top margin only doubled the gap. */
.prose hr + h2 {
  margin-top: 1.2em;
}

.prose .code-block {
  margin: 1.1em 0;
}

.table-wrap {
  margin: 1.2em 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.5;
}

.prose th,
.prose td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

.prose td code {
  overflow-wrap: normal;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ docs */

.docs {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding-block: 48px 96px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
  font-size: 14.5px;
}

.docs-sidebar ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-switch {
  margin-bottom: 24px !important;
}

.docs-switch a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}

.docs-switch a:hover {
  background: var(--bg-hover);
}

.docs-switch a[aria-current='page'] {
  background: var(--accent-subtle);
  color: var(--accent);
}

.toc summary {
  margin-bottom: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

.toc a {
  display: block;
  padding: 3px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
}

.toc a:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.toc .sub a {
  padding-left: 22px;
  font-size: 13.5px;
}

.docs-body {
  max-width: 780px;
  min-width: 0;
}

.docs-intro {
  padding: 14px 18px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  background: var(--accent-subtle);
}

/* ------------------------------------------------------------- changelog */

.changelog {
  padding-block: 64px 96px;
}

.changelog h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.7rem);
}

.release {
  margin-top: 48px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.release-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}

.release-head h2 {
  margin: 24px 0 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 1.5rem;
}

.release-title {
  font-family: var(--font-ui);
  font-weight: 500;
}

.release-date {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
}

.empty {
  margin-top: 40px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------- small pages */

.privacy,
.simple-page {
  padding-block: 64px 96px;
}

.simple-page {
  min-height: 52vh;
}

.simple-page h1 {
  margin: 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
}

/* ---------------------------------------------------------------- footer */

.site-footer {
  padding: 36px 0 48px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
}

.footer-brand img {
  border-radius: 5px;
}

.footer-brand .muted {
  font-weight: 400;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer-nav a {
  color: var(--text-muted);
}

.footer-nav a:hover {
  color: var(--text);
}

/* ------------------------------------------------------------ narrow */

@media (max-width: 900px) {
  .showcase-text,
  .agents-grid,
  .pricing-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .showcase-text > div {
    grid-column: 1;
    grid-row: auto;
    margin-top: 16px;
  }
  .agents-grid {
    gap: 40px;
  }
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
  }
  .docs-sidebar {
    position: static;
    max-height: none;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16.5px;
  }
  .hero {
    padding-top: 44px;
  }
  main > section {
    padding: 64px 0;
  }
  .window {
    margin-top: 32px;
    border-radius: 8px;
  }
  .window-bar {
    height: 20px;
    gap: 6px;
    padding: 0 8px;
  }
  .window-bar span {
    width: 8px;
    height: 8px;
  }
  .showcase + .showcase {
    margin-top: 72px;
  }
  .price-card,
  .requirements {
    padding: 24px;
  }
  .requirements dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .requirements dd + dt {
    margin-top: 10px;
  }
  .actions .button {
    flex: 1 1 100%;
  }
  .diff .line {
    grid-template-columns: 32px 1fr;
    padding-right: 14px;
  }
}
