:root {
  --paper: #F2F5FA;
  --surface: #FFFFFF;
  --tint: #E6ECF8;
  --ink: #15203B;
  --muted: #56627A;
  --line: #D6DEEC;
  --cobalt: #2647E8;
  --cobalt-deep: #1A33B5;
  --sun: #FFC94D;
  --sun-soft: #FFF1C9;
  --green: #1F8A5B;

  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
  --step-4: clamp(2.5rem, 1.6rem + 3.6vw, 4.1rem);

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0;
}
h1 { font-size: var(--step-4); font-weight: 750; letter-spacing: -0.03em; line-height: 1.02; }
h2 { font-size: var(--step-3); letter-spacing: -0.02em; }
h3 { font-size: var(--step-1); }
p { margin: 0; }

a { color: var(--cobalt); }
a:hover { color: var(--cobalt-deep); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }

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

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 1rem; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(242, 245, 250, .9); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 750; font-size: 1.3rem; letter-spacing: -0.03em; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 1.85rem; height: 1.85rem; flex: none; }
.brand-thin { font-weight: 500; color: var(--muted); }
.nav { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 1.8rem); }
.nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .98rem; }
.nav a:not(.btn):hover { color: var(--cobalt); }
@media (max-width: 760px) {
  .nav a:not(.btn) { display: none; }
  .nav a[href="/blog/"], .nav a[href$="/blog/"] { display: inline; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3rem; padding: .7rem 1.35rem;
  border-radius: 999px; border: 2px solid var(--cobalt);
  background: var(--cobalt); color: #fff;
  font: 600 1rem/1.2 var(--body); text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); color: #fff; }
.btn-small { min-height: 2.5rem; padding: .45rem 1.05rem; font-size: .95rem; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.btn-sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #FFD873; border-color: #FFD873; color: var(--ink); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.08); color: #fff; border-color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.link { font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Hero */
.hero { padding: clamp(2.5rem, 7vw, 6rem) 0 clamp(3.5rem, 8vw, 6.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero-copy h1 { max-width: 13ch; }
.lede { margin: 1.5rem 0 2rem; font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 34rem; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

/* Agent card: the one moving thing on the page */
.agent {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  padding: 1.35rem 1.35rem 1.15rem;
  box-shadow: 0 1px 0 rgba(21, 32, 59, .04), 0 24px 48px -28px rgba(38, 71, 232, .45);
}
.agent-head { display: flex; align-items: center; gap: .8rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.agent-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--cobalt); box-shadow: 0 0 0 5px rgba(38, 71, 232, .14); flex: none; }
.agent-name { font-weight: 600; line-height: 1.3; }
.agent-sub { font-size: var(--step--1); color: var(--muted); }
.agent-status { margin-left: auto; font-size: var(--step--1); font-weight: 600; padding: .25rem .7rem; border-radius: 999px; background: var(--tint); color: var(--cobalt-deep); white-space: nowrap; }
.agent-status.is-waiting { background: var(--sun-soft); color: #7A5600; }

.agent-steps { list-style: none; margin: 0; padding: .4rem 0 0; counter-reset: s; }
.agent-steps li {
  position: relative; padding: .75rem 0 .75rem 2.4rem;
  font-size: .97rem; line-height: 1.45; color: var(--muted);
  transition: opacity .35s ease, transform .35s ease;
}
.agent-steps li + li { border-top: 1px dashed var(--line); }
.agent-steps strong { display: block; color: var(--ink); font-weight: 600; }
.agent-steps li::before {
  content: ""; position: absolute; left: 0; top: .85rem;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.3l2.6 2.5L12 5.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat;
}
.agent-steps li.agent-ask::before { background: var(--sun) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='1.6' fill='%2315203B'/%3E%3Ccircle cx='3.6' cy='8' r='1.6' fill='%2315203B'/%3E%3Ccircle cx='12.4' cy='8' r='1.6' fill='%2315203B'/%3E%3C/svg%3E") center/70% no-repeat; }
.agent-foot { margin-top: .5rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: var(--step--1); color: var(--muted); }

/* Animated state, only when JS runs and motion is welcome */
.js .agent:not(.is-finished) li { opacity: .28; }
.js .agent:not(.is-finished) li::before { background: var(--tint); }
.js .agent:not(.is-finished) li.is-active { opacity: 1; }
.js .agent:not(.is-finished) li.is-active::before { background: var(--surface); border: 2px solid var(--cobalt); border-right-color: transparent; animation: spin .8s linear infinite; }
.js .agent:not(.is-finished) li.is-done { opacity: 1; }
.js .agent:not(.is-finished) li.is-done::before { background-color: var(--green); animation: none; border: 0; }
.js .agent:not(.is-finished) li.agent-ask.is-done::before { background-color: var(--sun); }
.js .agent:not(.is-finished) .agent-foot { opacity: 0; transition: opacity .4s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
.section-tint { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 40rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head p { margin-top: .9rem; color: var(--muted); font-size: var(--step-1); line-height: 1.5; }
.section-head-row { max-width: none; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

/* Services */
.services { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 1.25rem; overflow: hidden; }
.service { background: var(--paper); padding: clamp(1.4rem, 3vw, 2rem); }
.service h3 { margin-bottom: .6rem; }
.service p { color: var(--muted); max-width: 32rem; }
.service-lead { grid-column: 1 / -1; background: var(--cobalt); color: #fff; display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 1.5rem 2.5rem; align-items: center; }
.service-lead h3 { font-size: var(--step-2); margin: 0; }
.service-lead p { color: rgba(255,255,255,.86); max-width: none; }
.service-lead .link { color: var(--sun); white-space: nowrap; }
.service-lead .link:hover { color: #fff; }
@media (max-width: 900px) { .service-lead { grid-template-columns: 1fr; gap: .8rem; } }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* Use cases */
.cases { border-top: 2px solid var(--ink); }
.case { display: grid; grid-template-columns: 1fr 1.25fr 1.6fr; gap: 1rem 2.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); align-items: start; }
.case h3 { font-size: 1.15rem; }
.case p { color: var(--muted); }
.case p:last-child { color: var(--ink); }
.case-labels { padding: .7rem 0; font-size: var(--step--1); font-weight: 600; color: var(--muted); }
.cases-more { margin-top: 1.5rem; color: var(--muted); }
@media (max-width: 760px) {
  .case { grid-template-columns: 1fr; gap: .35rem; }
  .case-labels { display: none; }
  .case p:first-of-type::before { content: "The busywork: "; font-weight: 600; color: var(--ink); }
  .case p:last-child::before { content: "The agent: "; font-weight: 600; color: var(--cobalt); }
}

/* Process */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 3.6rem; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 750; font-size: 1.15rem;
  background: var(--surface); border: 2px solid var(--cobalt); color: var(--cobalt);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 1.3rem; left: 3.2rem; right: -.9rem; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px); }
.steps h3 { margin-bottom: .2rem; }
.step-time { font-size: var(--step--1); font-weight: 600; color: var(--cobalt); margin-bottom: .6rem; }
.steps p:last-child { color: var(--muted); }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; gap: 2.2rem 1.5rem; }
  .steps li::after { display: none; }
}
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* Principles */
.section-ink { background: var(--ink); color: #fff; }
.principles { display: grid; grid-template-columns: .8fr 2fr; gap: 2rem 4rem; }
.principles ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 3rem; }
.principles h3 { color: var(--sun); margin-bottom: .45rem; font-size: 1.2rem; }
.principles p { color: rgba(255,255,255,.78); }
@media (max-width: 900px) { .principles { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .principles ul { grid-template-columns: 1fr; } }

/* Posts */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.post-list a { display: flex; flex-direction: column; gap: .55rem; height: 100%; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; text-decoration: none; color: var(--ink); transition: border-color .15s ease; }
.post-list a:hover { border-color: var(--cobalt); color: var(--ink); }
.post-list time { font-size: var(--step--1); color: var(--muted); }
.post-list h3 { font-size: 1.2rem; }
.post-list p { color: var(--muted); font-size: .97rem; }
@media (max-width: 900px) { .post-list { grid-template-columns: 1fr; } }

/* CTA */
.cta { background: var(--cobalt); color: #fff; }
.cta-inner { max-width: 46rem; }
.cta h2 { font-size: var(--step-4); letter-spacing: -0.03em; line-height: 1.04; }
.cta p { margin: 1.2rem 0 2rem; font-size: var(--step-1); color: rgba(255,255,255,.86); line-height: 1.5; }

/* Footer */
.footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 3rem 0 1.5rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2rem; }
.brand-footer { color: #fff; }
.brand-footer:hover { color: #fff; }
.brand-footer .brand-thin { color: rgba(255,255,255,.6); }
.footer-note { margin-top: .7rem; max-width: 22rem; font-size: .95rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; align-items: center; }
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { color: var(--sun); }
.footer-base { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); font-size: var(--step--1); }

/* Blog index + article */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.page-head p { margin-top: 1rem; color: var(--muted); font-size: var(--step-1); max-width: 38rem; }
.blog-list { padding-bottom: clamp(3.5rem, 8vw, 6rem); }

.article { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 8vw, 6rem); }
.article-inner { max-width: 44rem; }
.back { display: inline-block; margin-bottom: 1.6rem; font-weight: 600; text-decoration: none; }
.article-meta { margin-top: 1rem; color: var(--muted); font-size: .97rem; }
.article h1 { font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.025em; }
.article .lede { margin: 1.2rem 0 0; }
.prose { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line); font-size: 1.1rem; line-height: 1.7; }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: .45rem; }
.prose blockquote { margin-left: 0; padding: 1rem 1.25rem; background: var(--sun-soft); border-left: 4px solid var(--sun); border-radius: 0 .75rem .75rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 1rem; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; }
.prose code { font-size: .92em; background: var(--tint); padding: .1em .35em; border-radius: 4px; }
.article-cta { margin-top: 3rem; padding: 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; }
.article-cta h2 { font-size: var(--step-1); margin-bottom: .5rem; }
.article-cta p { color: var(--muted); margin-bottom: 1.1rem; }
