/* Agentu — site design system. One lime accent on ink; light and dark are both first-class.
   Tokens follow docs/directives/2026-10-07 (agentu-memory) and the agentu-ui-redesign-v2 prototype.
   No third-party requests: fonts are self-hosted. */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }

/* ---- Tokens -------------------------------------------------------------- */
/* Dark is the default; light tokens follow; the system preference wins unless the
   footer toggle set html[data-theme]. The same names are used on every surface. */
:root {
  --bg: #0B0B0D;
  --surface: #16161B;
  --surface-2: #1D1D23;
  --surface-3: #24242B;
  --border: #2A2A33;
  --border-strong: #6B6B78;
  --text: #F2F2F5;
  --text-muted: #A1A1AC;
  --accent: #CDF542;
  --accent-text: #CDF542;
  --accent-ink: #0B0B0D;
  --accent-soft: rgba(205, 245, 66, 0.12);
  --danger: #FF6B6B;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --ok: #5AD18A;
  --ok-soft: rgba(90, 209, 138, 0.14);
  --warn: #F5B942;
  --warn-soft: rgba(245, 185, 66, 0.14);
  --shadow: none;
  --radius: 16px;
  --radius-s: 10px;
  --max: 1160px;
  --font-display: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: 180ms ease-out;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #FFFFFF;
    --surface: #F5F5F7;
    --surface-2: #ECECF1;
    --surface-3: #E3E3EA;
    --border: #E3E3EA;
    --border-strong: #7A7A86;
    --text: #0B0B0D;
    --text-muted: #5E5E6A;
    --accent: #CDF542;
    --accent-text: #4A6A00;
    --accent-ink: #0B0B0D;
    --accent-soft: rgba(205, 245, 66, 0.28);
    --danger: #B42318;
    --danger-soft: rgba(180, 35, 24, 0.10);
    --ok: #1F7A45;
    --ok-soft: rgba(31, 122, 69, 0.10);
    --warn: #9A6700;
    --warn-soft: rgba(154, 103, 0, 0.10);
    --shadow: 0 1px 2px rgba(11, 11, 13, 0.06), 0 8px 24px rgba(11, 11, 13, 0.06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #FFFFFF;
  --surface: #F5F5F7;
  --surface-2: #ECECF1;
  --surface-3: #E3E3EA;
  --border: #E3E3EA;
  --border-strong: #7A7A86;
  --text: #0B0B0D;
  --text-muted: #5E5E6A;
  --accent: #CDF542;
  --accent-text: #4A6A00;
  --accent-ink: #0B0B0D;
  --accent-soft: rgba(205, 245, 66, 0.28);
  --danger: #B42318;
  --danger-soft: rgba(180, 35, 24, 0.10);
  --ok: #1F7A45;
  --ok-soft: rgba(31, 122, 69, 0.10);
  --warn: #9A6700;
  --warn-soft: rgba(154, 103, 0, 0.10);
  --shadow: 0 1px 2px rgba(11, 11, 13, 0.06), 0 8px 24px rgba(11, 11, 13, 0.06);
  color-scheme: light;
}

/* ---- Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--border-strong) var(--surface); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent); color: var(--accent-ink); }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
p.lead { font-size: 1.2rem; color: var(--text-muted); max-width: 46rem; }
code, pre, kbd { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.4em; overflow-wrap: anywhere; color: var(--text); }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 14px 16px; overflow-x: auto; margin: 0 0 1em; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; font-size: 0.86rem; }
img, svg { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--radius-s); z-index: 100; font-weight: 600; }
.skip:focus { left: 8px; }

/* ---- Layout -------------------------------------------------------------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
section { padding: 72px 0; }
section.tight { padding: 40px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-3.wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 70%); }
.card.plain { background: transparent; box-shadow: none; }
.eyebrow { font-family: var(--font-display); font-weight: 500; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 12px; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; }

/* ---- Controls: nothing is a raw browser default ------------------------- */
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-family: var(--font-body); padding: 12px 20px; border-radius: var(--radius-s); border: 1px solid var(--accent); cursor: pointer; font-size: 1rem; line-height: 1.2; text-decoration: none; transition: background var(--ease), border-color var(--ease), filter var(--ease); }
.btn:hover { filter: brightness(0.95); text-decoration: none; }
.btn:active { filter: brightness(0.9); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; filter: none; }
.btn.ghost, .btn.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn.ghost:hover, .btn.secondary:hover { background: var(--surface-2); filter: none; }
.btn.btn-sm { padding: 8px 14px; font-size: 0.9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---- Header -------------------------------------------------------------- */
header.site { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.logo .mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 19px; font-weight: 700; }
nav.primary { display: flex; align-items: center; gap: 20px; }
nav.primary a { color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
nav.primary a:hover, nav.primary a[aria-current="page"] { color: var(--text); text-decoration: none; }
nav.primary a.btn { color: var(--accent-ink); }
.nav-toggle { display: none; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--radius-s); padding: 6px 10px; font-size: 1.1rem; cursor: pointer; }
@media (max-width: 1040px) {
  .nav-toggle { display: inline-block; }
  nav.primary { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 12px 20px 18px; gap: 6px; box-shadow: var(--shadow); }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 10px 4px; font-size: 1.05rem; }
  nav.primary a.btn { justify-content: center; margin-top: 6px; }
}

/* ---- Hero ---------------------------------------------------------------- */
.hero { padding: 88px 0 56px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -20% auto -20%; height: 120%; background: radial-gradient(60% 50% at 70% 20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; }
.hero h1 { max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero .lead { font-size: 1.25rem; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.badge { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; background: var(--surface); }
.badge b { color: var(--accent-text); font-weight: 600; }

/* ---- Steps and the connect-first flow ----------------------------------- */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 58px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 700; display: grid; place-items: center; font-size: 1.1rem; }
.card.step { padding-left: 76px; }
.card.step::before { left: 22px; top: 22px; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: flow; list-style: none; margin: 0; padding: 0; }
.flow .stage { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 20px 20px; box-shadow: var(--shadow); }
.flow .stage .n { counter-increment: flow; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--font-display); font-weight: 700; margin-bottom: 12px; }
.flow .stage .n::before { content: counter(flow); }
.flow .stage h3 { font-size: 1.05rem; margin-bottom: 6px; }
.flow .stage p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.flow .stage p + p { margin-top: 8px; }
.apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.apps li { font-size: 0.85rem; font-weight: 500; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; }

/* ---- Tables, lists, pills ----------------------------------------------- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { padding: 12px 14px; text-align: left; border-top: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); border-top: 0; }
.tablewrap { overflow-x: auto; border-radius: var(--radius); }
ul.checks { list-style: none; padding: 0; margin: 0 0 1em; }
ul.checks li { padding: 6px 0 6px 28px; position: relative; }
ul.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-text); font-weight: 700; }
ul.plain, ol.plain { padding-left: 1.2em; }
ul.plain li, ol.plain li { margin: 6px 0; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--bg); }
.pill.live { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-soft); }
.pill.soon { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: var(--warn-soft); }
.pill.free { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.pill.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: var(--danger-soft); }

/* ---- Tabs ---------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font: 500 0.95rem var(--font-body); padding: 10px 12px; cursor: pointer; margin-bottom: -1px; border-radius: 4px 4px 0 0; transition: color var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel[hidden] { display: none; }
.copywrap { position: relative; }
.copywrap .copy { position: absolute; top: 8px; right: 8px; }
.btn.copy { padding: 5px 10px; font-size: 0.8rem; background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn.copy:hover { border-color: var(--accent); filter: none; }

/* ---- Forms --------------------------------------------------------------- */
label { display: block; font-weight: 500; margin-bottom: 6px; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="number"], input[type="password"], select, textarea { width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 11px 13px; font: inherit; appearance: none; -webkit-appearance: none; transition: border-color var(--ease); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }
select { padding-right: 36px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236B6B78' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--border-strong); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0 8px 0 0; vertical-align: -3px; }
.field { margin-bottom: 18px; }
.help { color: var(--text-muted); font-size: 0.88rem; margin-top: 6px; }
.notice { border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--surface); border-radius: var(--radius-s); padding: 14px 16px; margin: 0 0 18px; }
.notice.warn { border-left-color: var(--warn); }
.notice.bad { border-left-color: var(--danger); }
.notice.ok { border-left-color: var(--ok); }
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.keybox { font-family: var(--font-mono); font-size: 1.05rem; word-break: break-all; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: var(--radius-s); padding: 16px 18px; margin: 0 0 12px; }

/* ---- Theme toggle (footer) ---------------------------------------------- */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 2px; }
.theme-toggle button { font: 500 0.8rem var(--font-body); color: var(--text-muted); padding: 5px 10px; border-radius: 7px; transition: background var(--ease), color var(--ease); }
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.theme-toggle button:focus-visible { outline-offset: 0; }

/* ---- Footer -------------------------------------------------------------- */
footer.site { border-top: 1px solid var(--border); padding: 44px 0 40px; color: var(--text-muted); font-size: 0.92rem; margin-top: 40px; background: var(--surface); }
footer.site .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 24px; }
footer.site h4 { color: var(--text); font-size: 0.9rem; margin-bottom: 10px; }
footer.site .cols a { color: var(--text-muted); display: block; padding: 3px 0; }
footer.site .cols a:hover { color: var(--text); }
footer.site .cols a.logo { display: inline-flex; color: var(--text); padding: 0; }
footer.site .legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; color: var(--text-muted); font-size: 0.85rem; }
footer.site .legal .theme { display: inline-flex; align-items: center; gap: 10px; }
@media (max-width: 760px) { footer.site .cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { footer.site .cols { grid-template-columns: 1fr; } }

/* ---- Prose pages --------------------------------------------------------- */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.6em; }
.prose li { margin: 6px 0; }
.toc { border: 1px solid var(--border); border-radius: var(--radius-s); padding: 14px 18px; background: var(--surface); margin-bottom: 28px; }
.toc a { display: block; padding: 3px 0; color: var(--text-muted); }

/* ---- Motion -------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
