:root {
  --paper: #F1F2EE;
  --panel: #FAFAF8;
  --lane: #E6E8E2;
  --rule: #CDD1C9;
  --ink: #171A21;
  --muted: #5A606B;
  --cobalt: #2440E6;
  --cobalt-deep: #1A2FB0;
  --sticky: #F6D44C;
  --wait: #8A5200;

  --font: "Archivo", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
}

*, *::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(--font);
  font-size: 17px;
  line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }

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

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

.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 6px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.site-header {
  display: flex; align-items: center; gap: 32px;
  padding-block: 22px;
}
.brand {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; text-decoration: none;
  font-variation-settings: "wdth" 125;
}
.brand span { color: var(--muted); font-weight: 500; }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.lang {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; min-width: 52px;
}
.lang:hover { border-color: var(--ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cobalt); color: #fff; text-decoration: none;
  font-weight: 650; font-size: 16px; line-height: 1;
  padding: 16px 24px; border-radius: 8px;
}
.btn:hover { background: var(--cobalt-deep); }
.btn-small { font-size: 14px; padding: 10px 16px; }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #fff; }
.link { font-weight: 600; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.link:hover { color: var(--cobalt); }

/* Hero */
.hero { padding-top: clamp(40px, 8vw, 104px); }
.hero-title {
  font-size: clamp(2.6rem, 6.4vw, 6rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variation-settings: "wdth" 118;
  max-width: 13.5em;
  text-wrap: balance;
}
.hero-foot {
  display: grid; grid-template-columns: minmax(0, 36rem) auto; justify-content: space-between;
  align-items: end; gap: 28px 48px;
  margin-top: clamp(28px, 4vw, 44px);
}
.hero-sub { font-size: clamp(1.06rem, 1.4vw, 1.25rem); line-height: 1.55; color: var(--muted); }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }

/* Demo stage */
.stage {
  margin-top: clamp(40px, 6vw, 72px);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 16px;
  overflow: hidden;
  scroll-margin-top: 24px;
}
.stage-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid var(--rule);
}
.stage-title { font-size: 1.06rem; font-weight: 650; letter-spacing: -0.01em; }
.switch {
  display: inline-flex; padding: 4px; gap: 4px;
  background: var(--lane); border-radius: 10px;
}
.switch button {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--muted);
  background: transparent; border: 0; border-radius: 7px;
  padding: 8px 16px; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.switch button[data-state="after"][aria-pressed="true"] { background: var(--cobalt); color: #fff; }

.diagram-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.diagram { display: block; width: 100%; min-width: 900px; height: auto; font-family: var(--font); }

.stage-foot {
  display: flex; justify-content: space-between; align-items: end; gap: 20px 40px; flex-wrap: wrap;
  padding: 20px 22px 22px;
  border-top: 1px solid var(--rule);
}
.metrics { display: flex; gap: clamp(20px, 4vw, 56px); flex-wrap: wrap; }
.metrics dt { font-size: 14px; color: var(--muted); }
.metrics dd {
  font-size: clamp(1.6rem, 2.6vw, 2.25rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
  font-variation-settings: "wdth" 112;
  font-variant-numeric: tabular-nums;
  transition: color .3s;
}
.diagram-after .metrics dd { color: var(--cobalt); }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 14px; color: var(--muted); max-width: 30rem; }
.key { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.key-human { background: var(--sticky); box-shadow: 1px 1px 0 rgba(23, 26, 33, .18); transform: rotate(-4deg); }
.key-agent { background: var(--cobalt); margin-left: 8px; }
.legend-note { flex-basis: 100%; }

/* Diagram internals */
.lane-band { fill: transparent; }
.lane-band.alt { fill: var(--lane); opacity: .55; }
.lane-rule { stroke: var(--rule); stroke-width: 1; }
.lane-label { font-size: 13px; font-weight: 600; fill: var(--muted); }
.lane-agent .lane-label { fill: var(--cobalt); }
.lane-agent-band { fill: var(--cobalt); opacity: 0; transition: opacity .5s; }
[data-state="after"] .lane-agent-band { opacity: .06; }
.lane-empty { font-size: 13px; font-style: italic; fill: var(--muted); }

.edge { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; }
.edge.agent { stroke: var(--cobalt); }
.edge.dashed { stroke-dasharray: 4 4; stroke: var(--muted); }
.edge-label { font-size: 12px; font-weight: 700; fill: var(--wait); paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
.edge-label.fast { fill: var(--cobalt); }
.arrow-ink { fill: var(--ink); }
.arrow-cobalt { fill: var(--cobalt); }
.arrow-muted { fill: var(--muted); }

.node-text { font-size: 13px; font-weight: 600; fill: var(--ink); }
.node.agent .node-text { fill: #fff; }
.node.ghost .node-text { fill: var(--muted); font-weight: 500; }
.shape { transition: stroke-width .2s; }
.node.human .shape { fill: var(--sticky); }
.node.human .shadow { fill: rgba(23, 26, 33, .14); }
.node.agent .shape { fill: var(--cobalt); }
.node.system .shape, .node.event .shape { fill: #fff; stroke: var(--ink); stroke-width: 1.25; }
.node.ghost .shape { fill: none; stroke: var(--muted); stroke-dasharray: 4 4; }
.node.is-active .shape { stroke: var(--ink); stroke-width: 2.5; }
.node.agent.is-active .shape { stroke: var(--cobalt-deep); }

.token { fill: var(--ink); stroke: var(--panel); stroke-width: 2.5; }
[data-state="after"] .token { fill: var(--cobalt); }

.only-before, .only-after {
  transform-box: fill-box;
  transition: opacity .45s ease, transform .45s ease;
}
.only-after { opacity: 0; transform: translateY(10px); }
[data-state="after"] .only-after { opacity: 1; transform: none; }
[data-state="after"] .only-before { opacity: 0; transform: translateY(-10px); }

@media (prefers-reduced-motion: reduce) {
  .only-before, .only-after, .lane-agent-band, .switch button { transition: none; }
}

/* Sections */
.section { padding-top: clamp(80px, 11vw, 148px); }
.section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 48px; align-items: end; margin-bottom: clamp(32px, 4vw, 52px); }
.section h2, .contact h2 {
  font-size: clamp(2rem, 3.8vw, 3.4rem);
  line-height: 1.02; font-weight: 780; letter-spacing: -0.03em;
  font-variation-settings: "wdth" 116;
  text-wrap: balance;
}
.lead { color: var(--muted); font-size: 1.12rem; max-width: 34rem; }

/* What we build: rows echo the swimlanes */
.lane-row {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 15rem); gap: 12px 40px;
  padding: 28px 24px;
  border-top: 1px solid var(--rule);
}
.lane-row:nth-child(odd) { background: color-mix(in srgb, var(--lane) 55%, transparent); }
.lane-row:last-child { border-bottom: 1px solid var(--rule); }
.lane-row h3 { font-size: 1.3rem; line-height: 1.2; font-weight: 720; letter-spacing: -0.015em; font-variation-settings: "wdth" 108; }
.lane-row p { max-width: 38rem; }
.connects { font-size: 14px; color: var(--muted); }
.connects span:first-child { display: block; font-weight: 650; color: var(--ink); }

/* Process as a Gantt chart */
.gantt { display: grid; gap: 0; }
.gantt-row {
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); gap: 8px 32px;
  padding-block: 22px; border-top: 1px solid var(--rule);
}
.gantt-row:last-child { border-bottom: 1px solid var(--rule); }
.gantt-name { display: flex; align-items: baseline; gap: 12px; }
.gantt-n { font-weight: 800; color: var(--cobalt); font-variant-numeric: tabular-nums; }
.gantt-name h3 { font-size: 1.3rem; font-weight: 720; font-variation-settings: "wdth" 108; }
.gantt-track {
  display: grid; grid-template-columns: repeat(10, 1fr); align-items: center;
  background-image: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px calc(100% / 10));
  min-height: 36px;
}
.gantt-bar {
  grid-column: var(--from) / var(--to);
  background: var(--cobalt); color: #fff; border-radius: 6px;
  font-size: 13px; font-weight: 650; padding: 7px 10px; white-space: nowrap; overflow: hidden;
}
.gantt-ongoing .gantt-bar { background: linear-gradient(to right, var(--cobalt) 40%, color-mix(in srgb, var(--cobalt) 0%, transparent)); }
.gantt-row > p { grid-column: 2; color: var(--muted); max-width: 40rem; }

/* Why Claude */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 32px 40px; }
.reasons dt { font-weight: 720; font-size: 1.15rem; margin-bottom: 6px; font-variation-settings: "wdth" 108; }
.reasons dd { color: var(--muted); }
.guardrails {
  background: var(--ink); color: var(--paper);
  border-radius: 16px; padding: 28px;
}
.guardrails h3 { font-size: 1.15rem; font-weight: 720; margin-bottom: 16px; font-variation-settings: "wdth" 108; }
.guardrails li { padding: 12px 0 12px 28px; border-top: 1px solid rgba(241, 242, 238, .16); position: relative; }
.guardrails li::before {
  content: ""; position: absolute; left: 0; top: 19px; width: 14px; height: 10px; border-radius: 2px;
  background: var(--sticky); transform: rotate(-4deg);
}

/* Vision */
.horizon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.horizon li { padding-top: 18px; border-top: 3px solid var(--ink); }
.horizon .h-next { border-top-color: var(--cobalt); }
.horizon .h-later { border-top: 3px dashed var(--muted); }
.horizon h3 { font-size: 1.15rem; font-weight: 720; margin-bottom: 8px; font-variation-settings: "wdth" 108; }
.horizon p { color: var(--muted); max-width: 26rem; }

/* Contact */
.contact { margin-top: clamp(80px, 11vw, 148px); background: var(--cobalt); color: #fff; padding-block: clamp(64px, 9vw, 120px); }
.contact h2 { font-size: clamp(2.2rem, 5vw, 4.6rem); max-width: 16em; }
.contact-foot { display: flex; justify-content: space-between; align-items: end; gap: 24px 48px; flex-wrap: wrap; margin-top: 36px; }
.contact-foot p { max-width: 34rem; font-size: 1.12rem; color: rgba(255, 255, 255, .86); }

.site-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 28px; font-size: 14px; color: var(--muted); }

/* Chinese typography */
:lang(zh) body, html:lang(zh) { letter-spacing: 0.01em; }
html:lang(zh) .hero-title { line-height: 1.12; letter-spacing: 0; max-width: 12em; }
html:lang(zh) .section h2, html:lang(zh) .contact h2 { line-height: 1.18; letter-spacing: 0; }
html:lang(zh) .brand { letter-spacing: -0.03em; }

html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3 { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }

.scroll-hint { display: none; font-size: 14px; color: var(--muted); padding: 10px 16px 0; }

/* Responsive */
@media (max-width: 960px) {
  .nav { display: none; }
  .header-actions { margin-left: auto; }
  .hero-foot, .section-head, .split { grid-template-columns: minmax(0, 1fr); }
  .lane-row { grid-template-columns: minmax(0, 1fr); }
  .horizon { grid-template-columns: minmax(0, 1fr); }
  .scroll-hint { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-actions .btn-small { display: none; }
  .reasons { grid-template-columns: minmax(0, 1fr); }
  .gantt-row { grid-template-columns: minmax(0, 1fr); }
  .gantt-row > p { grid-column: 1; }
  .lane-row { padding-inline: 16px; }
  .stage-bar, .stage-foot { padding-inline: 16px; }
  .guardrails { padding: 22px; }
  html:lang(zh) .hero-title { font-size: 2.3rem; }
}
