/* Double Agent: shared tokens and chrome. Palette: brand/palette.md. Type: brand/typography.md. */
:root {
  --paper: #FAFAFA; --surface: #FFFFFF; --ink: #171717; --muted: #666666; --faint: #8F8F8F;
  --line: #EBEBEB; --line-strong: #D4D4D4; --hover: #F2F2F2;
  --agent: #8A6A1E; --gold: #C9A24A; --human: #2E7253; --bot: #5B626C; --bot-fill: #D2D4D7; --blown: #B3202F;
  --on-ink: #FFFFFF;
  --spot: rgba(0, 0, 0, 0.07);
  --globe-tint: rgba(0, 0, 0, 0.018); --globe-rim: rgba(0, 0, 0, 0.04); --globe-city: #5B82B0;
  --sans: "Geist", "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
  --display: var(--sans);
  --mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;
  --type: "Courier Prime", "Courier New", Courier, monospace; /* stamps only */
  --gutter: clamp(16px, 3vw, 24px);
  --max: 1200px;
  --r-sm: 6px; --r-md: 12px; --r-pill: 999px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #000000; --surface: #0A0A0A; --ink: #EDEDED; --muted: #A1A1A1; --faint: #7C7C7C;
    --line: #1F1F1F; --line-strong: #2E2E2E; --hover: #1A1A1A;
    --agent: #C9A24A; --human: #4FAE84; --bot: #8D949E; --bot-fill: #4A5059; --blown: #EF4A5C; --on-ink: #0A0A0A;
    --spot: rgba(255, 255, 255, 0.09);
    --globe-tint: rgba(255, 255, 255, 0.025); --globe-rim: rgba(255, 255, 255, 0.055); --globe-city: #86A9D4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #000000; --surface: #0A0A0A; --ink: #EDEDED; --muted: #A1A1A1; --faint: #7C7C7C;
  --line: #1F1F1F; --line-strong: #2E2E2E; --hover: #1A1A1A;
  --agent: #C9A24A; --human: #4FAE84; --bot: #8D949E; --bot-fill: #4A5059; --blown: #EF4A5C; --on-ink: #0A0A0A;
  --spot: rgba(255, 255, 255, 0.09);
  --globe-tint: rgba(255, 255, 255, 0.025); --globe-rim: rgba(255, 255, 255, 0.055); --globe-city: #86A9D4;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.5 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01";
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.035em; }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--gold) 40%, transparent); }
code, pre { font-family: var(--mono); font-size: 0.875em; font-variant-ligatures: none; }
:not(pre) > code { background: var(--hover); border: 1px solid var(--line); padding: 0.05em 0.35em; border-radius: 5px; overflow-wrap: anywhere; font-size: 0.85em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* Header */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(12px); -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 8px; height: 64px; }
.logo { display: inline-flex; align-items: center; color: var(--ink); padding: 6px 4px; margin-left: -4px; }
.logo-svg { height: 17px; width: auto; display: block; }
.crumb { color: var(--line-strong); font-size: 1.25rem; font-weight: 300; margin: 0 2px 0 6px; }
.crumb-link { font-weight: 600; font-size: 1rem; text-decoration: none; letter-spacing: -0.02em; }
.site-nav { display: flex; gap: 2px; align-items: center; margin-left: 20px; font-size: 0.875rem; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: var(--r-pill); transition: color .15s, background-color .15s; }
.site-nav a:hover { color: var(--ink); background: var(--hover); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.theme-toggle {
  display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0;
  color: var(--muted); background: none; border: 1px solid transparent; border-radius: var(--r-pill); cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); background: var(--hover); }
.theme-toggle svg { width: 16px; height: 16px; display: none; }
.theme-toggle[data-mode="auto"] .i-auto, .theme-toggle[data-mode="light"] .i-light, .theme-toggle[data-mode="dark"] .i-dark { display: block; }

/* Buttons */
.btn {
  font: 500 0.875rem/1 var(--sans); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-pill); white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn-ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-ink:hover { background: color-mix(in srgb, var(--ink) 84%, var(--paper)); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 0.8125rem; border-radius: var(--r-sm); }
.btn-small { height: 30px; padding: 0 12px; font-size: 0.8125rem; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 1rem; }
.btn .ico { width: 14px; height: 14px; flex: none; }

/* Footer */
.site-foot { border-top: 1px solid var(--line); margin-top: 0; background: var(--paper); }
.foot-grid { display: grid; grid-template-columns: 1.1fr repeat(6, 1fr); gap: 32px 24px; padding-block: 48px 40px; }
.foot-brand { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.foot-brand .mask-svg { width: 44px; height: auto; color: var(--ink); }
.foot-brand .sign { font-size: 0.875rem; color: var(--muted); margin: 0; }
.foot-col h2 { font: 500 0.875rem/1.4 var(--sans); letter-spacing: 0; margin: 0 0 12px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.875rem; }
.foot-col a { color: var(--muted); text-decoration: none; }
.foot-col a:hover { color: var(--ink); }
.foot-base { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 18px 28px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }
.foot-base .files { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--mono); font-size: 0.75rem; }
.foot-base .files a { text-decoration: none; }
.foot-base .files a:hover { color: var(--ink); }
.foot-base .theme-toggle { margin-left: auto; border-color: var(--line); }

/* Genre devices: used sparingly */
.stamp {
  display: inline-block; font: 700 0.75rem/1 var(--type); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blown); border: 2px solid currentColor; border-radius: 3px; padding: 6px 9px 5px; transform: rotate(-4deg);
}
.label { font: 500 0.8125rem/1.3 var(--sans); color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); font: 500 0.75rem/1 var(--sans); color: var(--muted); background: var(--surface); white-space: nowrap; }
.redact { display: inline-block; height: 0.9em; vertical-align: -0.08em; background: var(--ink); border-radius: 2px; }

/* Reticle: a small crosshair where frame lines cross */
.reticle { position: absolute; width: 21px; height: 21px; pointer-events: none; z-index: 1; color: var(--line-strong); }
.reticle::before, .reticle::after { content: ""; position: absolute; background: currentColor; }
.reticle::before { left: 10px; top: 0; width: 1px; height: 21px; }
.reticle::after { top: 10px; left: 0; height: 1px; width: 21px; }
.reticle.tl { top: -11px; left: -11px; }
.reticle.tr { top: -11px; right: -11px; }
.reticle.bl { bottom: -11px; left: -11px; }
.reticle.br { bottom: -11px; right: -11px; }

/* Marketing rows: one framed column split by hairlines, reticles where lines cross */
.frame { border-inline: 1px solid var(--line); padding-inline: 0; }
.row { position: relative; border-bottom: 1px solid var(--line); padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
/* Integrations */
.tools { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0; }
.tools a {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 76px; padding: 0 10px;
  color: var(--muted); text-decoration: none; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.025em; white-space: nowrap;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: color .15s, background-color .15s;
}
.tools a:nth-child(7n) { border-right: 0; }
.tools a:nth-last-child(-n+7) { border-bottom: 0; }
.tools a:hover { color: var(--ink); background: var(--surface); }
.tools svg { width: 20px; height: 20px; flex: none; }
.win { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.win-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 44px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); background: var(--paper); font-size: 0.8125rem; color: var(--muted); }
.url { font: 400 0.8125rem var(--mono); color: var(--muted); padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
/* Closing */
.closing { display: grid; justify-items: center; text-align: center; gap: 28px; padding-block: clamp(72px, 10vw, 128px); border-bottom: 0; }
.closing h2 { font-size: clamp(2.25rem, 5.4vw, 4rem); letter-spacing: -0.06em; }
.closing .cta { justify-content: center; }
.tools-inline { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.tools-inline a { border: 0 !important; justify-content: flex-start; padding-left: 20px; height: 64px; box-shadow: 1px 1px 0 var(--line); }
.row-h { font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -0.05em; margin-bottom: 28px; }

.benefits { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.benefits li { display: flex; flex-direction: column; gap: 8px; padding: 24px 22px 20px; border-right: 1px solid var(--line); }
.benefits li:last-child { border-right: 0; }
.benefits h3 { font-size: 1.0625rem; letter-spacing: -0.025em; }
.benefits p { color: var(--muted); font-size: 0.9375rem; margin: 0 0 8px; }
.benefits a { margin-top: auto; font-size: 0.8125rem; color: var(--muted); }
.benefits a:hover { color: var(--ink); }

.site-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.site-cards a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px 20px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
.site-cards a:hover { border-color: var(--line-strong); }
.sc-name { font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.025em; }
.sc-card { color: var(--muted); font-size: 0.9375rem; margin-bottom: 10px; }
.site-cards code { margin-top: auto; align-self: flex-start; font-size: 0.75rem; }

/* /for/<site> pages */
.for-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-block: clamp(56px, 8vw, 104px); }
.for-hero h1 { font-size: clamp(2.5rem, 5.6vw, 4.5rem); letter-spacing: -0.06em; line-height: 0.98; margin: 14px 0 20px; max-width: 13ch; }
.for-hero .lede { font-size: clamp(1.0625rem, 1.5vw, 1.25rem); color: var(--muted); max-width: 32rem; margin-bottom: 32px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { color: var(--line-strong); margin: 0 4px; }
.policy table { font-size: 0.9375rem; }
.policy td { padding: 12px 16px; }
.policy td:first-child { width: 45%; }
.policy .win-bar code { font-size: 0.75rem; }
.policy-note { margin: 0; padding: 12px 16px 14px; border-top: 1px solid var(--line); font-size: 0.8125rem; color: var(--muted); }

@media (max-width: 1000px) {
  .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tools a:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .tools a:nth-child(4n) { border-right: 0; }
  .tools a:nth-last-child(-n+2) { border-bottom: 0; }
  .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .benefits li:nth-child(2n) { border-right: 0; }
  .benefits li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .site-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .for-hero { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .frame { border-inline: 0; }
  .row { padding-inline: var(--gutter); }
  .reticle { display: none; }
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools a:nth-child(n) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); justify-content: flex-start; padding-left: 16px; height: 60px; }
  .tools a:nth-child(2n) { border-right: 0; }
  .benefits { grid-template-columns: 1fr; }
  .benefits li { border-right: 0; border-bottom: 1px solid var(--line); }
  .benefits li:last-child { border-bottom: 0; }
  .site-cards { grid-template-columns: 1fr; }
}

/* Code blocks (enhanced by /js/site.js) */
pre {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 44px 16px 14px; overflow-x: auto; line-height: 1.65; margin: 0 0 1.5em; font-size: 0.8125rem;
}
pre::before {
  content: attr(data-lang); position: absolute; top: 0; left: 0; right: 0; height: 32px; padding: 0 16px;
  display: flex; align-items: center; border-bottom: 1px solid var(--line); background: var(--paper);
  font: 400 0.75rem var(--sans); color: var(--muted);
}
pre[data-lang="text"]::before { content: "Prompt"; }
pre[data-lang="sh"]::before, pre[data-lang="bash"]::before { content: "Terminal"; }
pre .copy {
  position: absolute; top: 4px; right: 6px; font: 500 0.75rem var(--sans); background: none; color: var(--muted);
  border: 0; border-radius: var(--r-sm); padding: 4px 8px; cursor: pointer;
}
pre .copy:hover { color: var(--ink); background: var(--hover); }
.tok-c { color: var(--faint); }
.tok-s { color: var(--human); }
.tok-k { color: var(--agent); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.75em; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font: 500 0.8125rem var(--sans); color: var(--muted); background: var(--paper); }

/* One colour per class, everywhere */
.c-human { --c: var(--human); --f: var(--human); }
.c-bot { --c: var(--bot); --f: var(--bot-fill); }
.c-agent { --c: var(--agent); --f: var(--gold); }
.dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--f); }

@media (max-width: 900px) {
  .foot-grid { grid-template-columns: repeat(3, 1fr); }
  .foot-brand { grid-column: 1 / -1; flex-direction: row; align-items: center; }
}
@media (max-width: 640px) {
  .site-head .wrap { height: 56px; }
  .logo-svg { height: 13px; }
  .site-nav { margin-left: 8px; }
  .site-nav a:not(.keep) { display: none; }
  .head-actions .theme-toggle { display: none; }
  .foot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

@media (max-width: 560px) { .head-login { display: none; } }
