:root {
  --white: #fff;
  --black: #000;
  --green: #00ad6d;
  --tint: #e8f7f0;
  --deep: #062d1f;
  --grey: #5f6562;
  --bar: #d5d9d7;
  --line: #e7eae8;

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  color: var(--black);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

a { color: inherit; }

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.75rem, 6.4vw, 5rem);
  line-height: 1;
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.04;
  max-width: 16ch;
}

.lede {
  margin: 20px 0 0;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: var(--grey);
  text-wrap: balance;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
}

.button:hover { background: #262626; }

.button-small { height: 36px; padding: 0 16px; font-size: 0.875rem; }

.button-light { background: var(--white); color: var(--black); }
.button-light:hover { background: var(--tint); }

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

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 72px;
}

.nav-center, .nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.875rem;
}

.nav-right { justify-content: flex-end; gap: 20px; }

.nav-center a, .nav-signin { text-decoration: none; color: var(--grey); }
.nav-center a:hover, .nav-signin:hover { color: var(--black); }

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

.hero { padding-top: clamp(56px, 10vh, 112px); }

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy h1 { max-width: 12ch; }
.hero-copy .lede { max-width: 32rem; }

.install {
  width: 100%;
  max-width: 680px;
  margin-top: 40px;
  text-align: left;
}

.panel {
  position: relative;
  margin-top: 10px;
  padding: 20px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
}

.panel pre {
  margin: 0;
  white-space: pre-wrap;
  font: 400 0.8125rem/1.7 var(--mono);
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.panel-hint { color: var(--grey); font-size: 0.9375rem; }

.copy {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font: 500 0.9375rem var(--sans);
  cursor: pointer;
}

/* Both labels share one grid cell, so the button keeps the same width when it says "Copied". */
.copy { display: inline-grid; place-items: center; }
.copy span { grid-area: 1 / 1; }
.copy span + span, .copy.is-copied span:first-child { visibility: hidden; }
.copy.is-copied span + span { visibility: visible; }

.copy.is-copied { background: var(--green); }

.agents {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  color: var(--grey);
  font-size: 0.8125rem;
  font-weight: 500;
}

.agents li { display: flex; align-items: center; gap: 8px; }

.agent-icon {
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

/* ---------- Product demo (scripted, plays once on load) ---------- */

.demo {
  position: relative;
  max-width: 760px;
  margin: 64px auto 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--white);
  overflow: hidden;
}

/* Fixed height with messages pinned to the bottom, like a real chat that scrolls as it goes. */
.demo-chat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  height: 560px;
  padding: 28px;
  mask-image: linear-gradient(transparent, #000 72px);
  -webkit-mask-image: linear-gradient(transparent, #000 72px);
}

.msg { margin: 0; font-size: 0.9375rem; line-height: 1.6; }

.msg-user {
  align-self: flex-end;
  max-width: 80%;
  padding: 10px 16px;
  border-radius: 18px 18px 4px 18px;
  background: #f1f3f2;
}

.msg-agent { max-width: 92%; }
.msg-agent p { margin: 0; }
.msg-agent p + p { margin-top: 10px; }

.msg-draft { color: var(--grey); }

.tool {
  display: flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8125rem;
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--green) url(/favicon.svg) center / cover;
}

.tool-name { font-weight: 600; }
.tool-status { color: var(--grey); }

.tool.is-running .tool-status::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 1.5px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 0.8s linear infinite;
}

.tool.is-done .tool-status { color: var(--green); }

@keyframes spin { to { transform: rotate(360deg); } }

/* Steps are hidden until their turn; without JS (or with reduced motion) everything shows. */
.demo.is-playing [data-step]:not(.is-shown) { display: none; }
.demo.is-playing [data-step].is-shown { animation: appear 0.3s ease-out both; }
.word { opacity: 0; transition: opacity 0.12s; }
.word.is-on { opacity: 1; }

@keyframes appear { from { opacity: 0; transform: translateY(6px); } }

.replay {
  position: absolute;
  right: 16px;
  bottom: 16px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--grey);
  font: 500 0.8125rem var(--sans);
  cursor: pointer;
}

.replay:hover { color: var(--black); }

/* ---------- Sections ---------- */

.section { padding-top: clamp(96px, 13vh, 144px); }

/* Pain */
.pain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 48px 64px;
  align-items: start;
}

.pain h2 { position: sticky; top: 112px; font-size: clamp(2.5rem, 6vw, 4.5rem); }

.moments { display: grid; gap: 16px; }

.moment {
  width: calc(100% - 48px);
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

/* A gentle, even stagger: every other message steps right. */
.moment:nth-child(even) { margin-left: 48px; }

.moment header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}

.moment header b { font-weight: 600; }

.meta { color: var(--grey); }

.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f3f2;
  font-size: 0.75rem;
  font-weight: 600;
}

.moment-sent {
  display: grid;
  gap: 7px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f6f7f6;
}

.moment-sent span {
  height: 7px;
  border-radius: 4px;
  background: var(--bar);
}

.moment-reply {
  margin: 14px 0 0;
  font-size: 1.1875rem;
  line-height: 1.4;
  letter-spacing: -0.02em;
  font-weight: 500;
}

.moment-late {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.clock {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
}

.moment-late .moment-reply { margin-top: 10px; color: rgba(255, 255, 255, 0.8); }

.punchline {
  margin: clamp(80px, 11vh, 128px) 0 0;
  max-width: 20ch;
  font-size: clamp(2rem, 5vw, 3.75rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

/* Steps: a real sequence, so numbered. */
.steps {
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  counter-increment: step;
}

.steps li:last-child { border-bottom: 1px solid var(--line); }

.steps li::before {
  content: counter(step);
  flex: none;
  width: 1.4em;
  color: var(--green);
  font-weight: 600;
}

/* Pricing */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.plan h3 { margin: 0; font-size: 1.125rem; font-weight: 600; }

.plan-price { margin: 8px 0 0; color: var(--grey); }

.plan-price span {
  margin-right: 6px;
  color: var(--black);
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.plan ul { flex: 1; margin: 24px 0 32px; padding: 0; list-style: none; }
.plan li { padding: 8px 0; border-top: 1px solid var(--line); }

.plan .button { align-self: flex-start; }

/* The API plan is the bold one: black, like the logo. */
.plan-api { background: var(--black); border-color: var(--black); color: var(--white); }
.plan-api h3, .plan-api .plan-price span { color: var(--white); }
.plan-api .plan-price { color: rgba(255, 255, 255, 0.6); }
.plan-api li { border-color: rgba(255, 255, 255, 0.14); }

.plan-actions { display: flex; align-items: center; gap: 20px; }
.plan-link { color: rgba(255, 255, 255, 0.75); font-size: 0.9375rem; }
.plan-link:hover { color: var(--white); }

/* Closing band */
.cta {
  position: relative;
  margin-top: clamp(112px, 16vh, 176px);
  padding: 112px 0 72px;
  background: var(--deep);
  color: var(--white);
  overflow: hidden;
}

.cta-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.cta h2 { color: var(--white); }


/* Footer */
.footer {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 48px;
  font-size: 0.875rem;
  color: var(--grey);
}

.footer nav { display: flex; gap: 24px; flex: 1; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--black); }

/* ---------- Small screens ---------- */

@media (max-width: 860px) {
  .nav-center { display: none; }
  .nav { grid-template-columns: auto 1fr; }
  .pain, .plans { grid-template-columns: 1fr; }
  .pain h2 { position: static; }
  .moment { width: calc(100% - 24px); }
  .moment:nth-child(even) { margin-left: 24px; }
  .punchline { margin-top: 64px; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .footer { flex-wrap: wrap; gap: 20px; }
  .footer nav { order: 3; flex-basis: 100%; }
}

@media (max-width: 560px) {
  .wrap { padding-left: 20px; padding-right: 20px; }
  .nav-signin { display: none; }
  .panel { padding: 16px; }
  .demo-chat { height: 600px; padding: 20px; }
  .msg-user { max-width: 90%; }
}
