/* ---------------------------------------------------------------
   Design tokens
   Neutral zinc base, single locked accent (cobalt blue).
   Light by default; dark via prefers-color-scheme or [data-theme="dark"].
   ----------------------------------------------------------------*/

:root {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-sunken: #f4f4f5;
  --text: #18181b;
  --text-muted: #52525b;
  --text-faint: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-wash: rgba(37, 99, 235, 0.08);

  --danger: #dc2626;
  --success: #16a34a;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(24, 24, 27, 0.16);

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --container: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-elevated: #18181b;
    --bg-sunken: #131316;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-faint: #71717a;
    --border: #27272a;
    --border-strong: #3f3f46;

    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-contrast: #09090b;
    --accent-wash: rgba(59, 130, 246, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme="dark"] {
  --bg: #09090b;
  --bg-elevated: #18181b;
  --bg-sunken: #131316;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  --text-faint: #71717a;
  --border: #27272a;
  --border-strong: #3f3f46;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-contrast: #09090b;
  --accent-wash: rgba(59, 130, 246, 0.12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-sunken: #f4f4f5;
  --text: #18181b;
  --text-muted: #52525b;
  --text-faint: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-contrast: #ffffff;
  --accent-wash: rgba(37, 99, 235, 0.08);

  --shadow-sm: 0 1px 2px rgba(24, 24, 27, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(24, 24, 27, 0.16);
}

/* ---------------------------------------------------------------
   Fonts (self-hosted, latin subset only)
   ----------------------------------------------------------------*/

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/space-grotesk-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122;
}

/* ---------------------------------------------------------------
   Reset & base
   ----------------------------------------------------------------*/

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section {
  padding: 5rem 0;
}

@media (max-width: 640px) {
  section {
    padding: 3.5rem 0;
  }
}

/* ---------------------------------------------------------------
   Nav
   ----------------------------------------------------------------*/

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

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

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
}

/* ---------------------------------------------------------------
   Buttons & tags
   ----------------------------------------------------------------*/

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

/* ---------------------------------------------------------------
   Hero
   ----------------------------------------------------------------*/

.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero-inner {
  max-width: 760px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.15rem);
  margin-bottom: 1.1rem;
}

.hero .lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 auto 2rem;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-diagram {
  margin-top: 3.5rem;
}

@media (max-width: 640px) {
  /* The node-and-label diagram is illegible at narrow widths; the pipeline
     section below covers the same flow with real text, so hide rather than
     show unreadable content. */
  .hero-diagram {
    display: none;
  }
}

/* ---------------------------------------------------------------
   Section headers
   ----------------------------------------------------------------*/

.section-head {
  max-width: 640px;
  margin: 0 0 3rem;
}

.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

.section-head h2 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  margin-bottom: 0.85rem;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.02rem;
}

/* ---------------------------------------------------------------
   Bento (architecture)
   ----------------------------------------------------------------*/

.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
}

.bento-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bento-card .card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bento-card .card-icon svg {
  width: 18px;
  height: 18px;
}

.bento-card h3 {
  font-size: 1.02rem;
}

.bento-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.bento-card.span-3 { grid-column: span 3; }
.bento-card.span-2 { grid-column: span 2; }
.bento-card.span-4 { grid-column: span 4; }
.bento-card.span-6 { grid-column: span 6; }

@media (max-width: 900px) {
  .bento {
    grid-template-columns: 1fr;
  }
  .bento-card.span-2,
  .bento-card.span-3,
  .bento-card.span-4,
  .bento-card.span-6 {
    grid-column: span 1;
  }
}

/* ---------------------------------------------------------------
   Agent pipeline (timeline)
   ----------------------------------------------------------------*/

.pipeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.pipeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}

.pipeline-step {
  position: relative;
  display: flex;
  gap: 1.25rem;
  padding-bottom: 2.1rem;
}

.pipeline-step:last-child {
  padding-bottom: 0;
}

.pipeline-node {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.pipeline-step.is-gate .pipeline-node {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
}

.pipeline-body h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pipeline-body p {
  color: var(--text-muted);
  font-size: 0.92rem;
  max-width: 52ch;
}

.gate-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-pill);
  padding: 0.12rem 0.55rem;
}

/* ---------------------------------------------------------------
   Security checklist
   ----------------------------------------------------------------*/

.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.checklist li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}

.checklist .check-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

.checklist .check-icon svg {
  width: 12px;
  height: 12px;
}

.checklist strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.checklist span {
  color: var(--text-muted);
  font-size: 0.88rem;
}

@media (max-width: 800px) {
  .security-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ---------------------------------------------------------------
   Showcase (screenshots)
   ----------------------------------------------------------------*/

.showcase {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.showcase-figure {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.showcase-figure .figure-frame {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-sunken);
}

.showcase-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
}

.showcase-figure figcaption {
  padding: 0.9rem 1.1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 800px) {
  .showcase {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }
}

/* ---------------------------------------------------------------
   Code block / getting started
   ----------------------------------------------------------------*/

.code-block {
  background: #0f0f11;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.65rem;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

.code-block code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: #e4e4e7;
  white-space: pre;
}

.code-block .cmt {
  color: #71717a;
}

.code-block .acc {
  color: #60a5fa;
}

.getting-started-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.getting-started-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.getting-started-links a:hover {
  color: var(--accent-hover);
}

/* ---------------------------------------------------------------
   Footer
   ----------------------------------------------------------------*/

.footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer p {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

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