:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --chrome: #f4f4f5;
  --text: #18181b;
  --muted: #52525b;
  --line: #e4e4e7;
  --dot: #d4d4d8;
  --accent: #6366f1;
  --accent-text: #4f46e5;
  --pill: #ececef;
  --code-bg: #f4f4f5;
  --shadow: 0 1px 2px rgb(0 0 0 / 5%), 0 16px 40px rgb(0 0 0 / 8%);
  --decide: #c7d2fe;
  --decide-text: #3730a3;
  --build: #3f3f46;
  --rework: #e4e4e7;
  --rework-text: #52525b;
  --align: #4f46e5;
  --guess: #db2777;
  --soft-accent: #eef2ff;
  --soft-warm: #fff7e6;
  --warm: #c2410c;
  --soft-green: #ecfdf3;
  --green: #15803d;
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --surface: #18181b;
    --chrome: #1f1f23;
    --text: #f4f4f5;
    --muted: #a1a1aa;
    --line: #2e2e33;
    --dot: #3f3f46;
    --accent: #818cf8;
    --accent-text: #a5b4fc;
    --pill: #232327;
    --code-bg: #1f1f23;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 40%);
    --decide: #312e81;
    --decide-text: #c7d2fe;
    --build: #52525b;
    --rework: #2a2a2f;
    --rework-text: #a1a1aa;
    --align: #6366f1;
    --soft-accent: #1e1b4b;
    --soft-warm: #2b2111;
    --warm: #fdba74;
    --soft-green: #0f2a1c;
    --green: #86efac;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent-text); text-underline-offset: 2px; }

/* Type: every section opens with a pill, a two-tone heading and a lede */
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; }
h1, h2 { font-weight: 700; line-height: 1.08; max-width: 22ch; }
h1 { font-size: clamp(2.4rem, 7vw, 4rem); }
h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h1 em, h2 em { display: block; font-style: normal; color: var(--accent-text); }
h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 0.4em; }
p { margin: 0 0 1em; }

.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--pill); color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 0.9rem; font-weight: 600; margin-bottom: 20px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 60ch; margin: 24px 0 0; }
.detail { margin-top: 32px; max-width: 68ch; color: var(--muted); }
.detail > :last-child { margin-bottom: 0; }

code { font: 0.9em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  overflow-x: auto;
  margin: 0 0 1.2em;
  color: var(--text);
}

.wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* Header */
.top { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.1rem; }
.mark { width: 42px; height: 16px; }
.top nav { display: flex; align-items: center; gap: 20px; }
.nav-link { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav-link:hover { color: var(--text); }

/* Sections */
main > section { padding-top: 120px; }
main > section:last-of-type { padding-bottom: 120px; }
main > .hero { padding-top: 72px; }
.body { margin: 48px 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; }
.button {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.button:hover { border-color: var(--muted); }
.button.primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.button.primary:hover { opacity: 0.88; }
.button.small { padding: 7px 16px; font-size: 0.95rem; }

/* Screenshots, in one window frame */
.window { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: var(--chrome); border-bottom: 1px solid var(--line); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--dot); }
.window-bar span { margin-left: 10px; padding: 2px 12px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.window img { display: block; width: 100%; height: auto; }

/* Why now */
.effort { max-width: 760px; }
.effort figcaption { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }
.effort-label { font-weight: 650; margin: 0 0 8px; }
.effort-bar { display: flex; gap: 6px; margin-bottom: 24px; }
.effort-bar:last-child { margin-bottom: 0; }
.effort-bar span { flex: 0 1 calc(var(--w) * 1%); padding: 12px; border-radius: 10px; font-size: 0.9rem; font-weight: 600; line-height: 1.25; display: flex; align-items: center; min-height: 56px; }
.effort-bar .decide { background: var(--decide); color: var(--decide-text); }
.effort-bar .build { background: var(--build); color: #fff; }
.effort-bar .rework { background: var(--rework); color: var(--rework-text); }
.effort-bar .align { background: var(--align); color: #fff; }
.effort-bar .guess { background: var(--guess); color: #fff; }

/* Cards and steps */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card, .steps li, .node { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card { padding: 24px; }
.card p { color: var(--muted); margin: 0; }
.icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; margin-bottom: 18px; }
.icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-structure { background: var(--soft-accent); color: var(--accent-text); }
.i-chat { background: var(--soft-warm); color: var(--warm); }
.i-sync { background: var(--soft-green); color: var(--green); }

.steps { padding: 0; list-style: none; counter-reset: n; display: grid; gap: 12px; max-width: 760px; }
.steps li { counter-increment: n; position: relative; padding: 18px 20px 18px 64px; color: var(--muted); }
.steps li::before {
  content: counter(n);
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}
.steps strong { color: var(--text); }

/* Product */
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 24px; }
.chain span { padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.chain b { color: var(--accent); font-weight: 400; }

/* Solo or with a team */
.hub { display: flex; flex-direction: column; align-items: center; max-width: 520px; margin-inline: auto; }
.node { width: 100%; padding: 20px 24px; display: flex; flex-direction: column; gap: 4px; }
.node strong { font-size: 1.15rem; }
.node > span:last-child { color: var(--muted); }
.tag { align-self: flex-start; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--soft-accent); color: var(--accent-text); margin-bottom: 6px; }
.agent .tag { background: var(--soft-green); color: var(--green); }
.link { width: 2px; height: 48px; background: var(--accent); position: relative; }
.link::before, .link::after { content: ""; position: absolute; left: 50%; border: 6px solid transparent; transform: translateX(-50%); }
.link::before { top: -6px; border-bottom-color: var(--accent); border-top: 0; }
.link::after { bottom: -6px; border-top-color: var(--accent); border-bottom: 0; }
.core { width: 168px; height: 168px; border-radius: 50%; background: #18181b; color: #fafafa; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 0 0 1px var(--line), 0 16px 48px color-mix(in srgb, var(--accent) 30%, transparent); margin: 6px 0; }
.core code { font-size: 1.25rem; background: none; padding: 0; }
.core span { color: #a1a1aa; font-size: 0.9rem; }

.more { font-weight: 600; }
.more::after { content: " →"; }

/* Footer */
.bottom { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; }
.bottom-row { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-top: 24px; padding-bottom: 32px; }

/* 404 */
.notfound { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  main > section { padding-top: 80px; }
  main > section:last-of-type { padding-bottom: 80px; }
  main > .hero { padding-top: 40px; }
  .body { margin-top: 36px; }
  .lede { font-size: 1.1rem; }
  .nav-link { display: none; }
  .actions .button { flex: 1 1 auto; text-align: center; }
  .window-bar { padding: 8px 10px; gap: 5px; }
  .window-bar i { width: 9px; height: 9px; }
  .window-bar span { font-size: 0.75rem; margin-left: 6px; }
  .effort-bar { gap: 4px; }
  .effort-bar span { padding: 10px 8px; font-size: 0.8rem; }
  pre { padding: 14px; font-size: 12px; }
}
