:root {
  --bg: #fafafa;
  --card: #ffffff;
  --well: #f4f4f5;
  --bar: #e4e4e7;
  --line: #e8e8eb;
  --line-2: #dcdce0;
  --ink: #18181a;
  --text: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --blue: #1F4BFF;
  --blue-2: #4D7CFF;
  --blue-soft: #e8eeff;

  --ease: cubic-bezier(0.2, 0, 0, 1);
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 1px 2px rgba(24, 24, 26, .06), 0 1px 1px rgba(24, 24, 26, .03);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.6 var(--sans); letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
section[id] { scroll-margin-top: 24px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 16px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; cursor: pointer;
  transition: scale 320ms var(--ease), background-color 200ms, border-color 200ms;
}
.btn:active { scale: 0.97; transition-duration: 120ms; }
.btn--white { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); color: var(--ink); }
.btn--white:hover { border-color: var(--line-2); }
.btn--dark { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.btn--dark:hover { background: #2a2a2e; }
.btn--sm { height: 38px; padding: 0 14px; font-size: 15px; }
.btn svg, .icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Nav */
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 88px; }
.brand img { width: 128px; height: auto; }
.nav__links { display: flex; align-items: center; gap: 24px; font-size: 16px; color: var(--muted); }
.nav__links > a:not(.btn):hover { color: var(--ink); }
.nav__links .btn { margin-left: 4px; }

/* Hero */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 88px; }
.hero__title {
  font-size: clamp(42px, 9.4vw, 96px); font-weight: 600; letter-spacing: -0.055em; line-height: 1.02;
}
.hero__title .line { display: block; white-space: nowrap; }
.select {
  position: relative; display: inline-flex; vertical-align: baseline;
  margin: 0 0 0 0.12em; padding: 0.02em 0.14em 0.08em;
  border: 2px solid var(--blue); border-radius: 4px; background: transparent;
  color: var(--blue); font: inherit; letter-spacing: inherit; line-height: 1;
  transform: rotate(-3deg); cursor: pointer; transition: transform 320ms var(--ease);
}
.select:hover { transform: rotate(-1.5deg); }
.select:active { transform: rotate(-3deg) scale(0.97); transition-duration: 120ms; }
.handle { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--blue); border-radius: 2px; }
.handle--tl { top: -7px; left: -7px; }
.handle--br { bottom: -7px; right: -7px; }

.note {
  display: flex; align-items: flex-end; gap: 6px; align-self: center;
  margin: 10px 0 0 min(34vw, 340px);
  font: 15px/1 var(--mono); color: var(--muted); transform: rotate(-3deg);
}
.note svg { width: 26px; height: 26px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.hero__lead { max-width: 620px; margin-top: 28px; font-size: 20px; line-height: 1.75; color: var(--text); }
code, .mono { font-family: var(--mono); }
.hero__lead code { font-size: 0.86em; padding: 3px 6px; border-radius: 6px; background: #efeff1; color: var(--ink); letter-spacing: 0; }

.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 36px; }
.handle-pill {
  display: flex; align-items: center; height: 48px; padding: 0 5px 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  font-family: var(--mono); font-size: 16px; transition: border-color 200ms;
}
.handle-pill:focus-within { border-color: var(--blue); }
.handle-pill__at { color: var(--faint); margin-right: 4px; }
.handle-pill input {
  width: 150px; border: 0; outline: 0; background: transparent; padding: 0;
  font: inherit; color: var(--ink); letter-spacing: 0;
}
.handle-pill input::placeholder { color: var(--faint); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; margin-left: 6px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--blue); cursor: pointer;
  box-shadow: var(--shadow); transition: scale 320ms var(--ease), background-color 200ms;
}
.icon-btn:hover { background: var(--blue-soft); }
.icon-btn:active { scale: 0.94; transition-duration: 120ms; }
.hero__cta .btn { height: 48px; border-radius: 12px; }

/* Demo window */
.window {
  position: relative; width: 100%; max-width: 780px; margin-top: 64px;
  background: var(--well); border-radius: 24px; padding: 24px 28px 36px;
}
.window__dots { display: flex; gap: 8px; }
.window__dots i { width: 11px; height: 11px; border-radius: 50%; background: #e2e2e5; }
.screens { display: grid; max-width: 440px; margin: 14px auto 0; text-align: left; }
.screen { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; visibility: hidden; }
.screen.is-active { visibility: visible; }
.screen .demo-btn { align-self: center; margin-top: 18px; }
.s-row { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.s-col { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bar { display: block; height: 10px; border-radius: 99px; background: var(--bar); }
.bar--w { background: rgba(255, 255, 255, .7); }
.w90 { width: 90%; } .w70 { width: 70%; } .w60 { width: 60%; } .w45 { width: 45%; }
.mini-ring { width: 48px; height: 48px; transform: rotate(-90deg); flex: none; }
.mini-ring circle, .ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.mini-ring circle:first-child, .ring circle:first-child { stroke: var(--bar); }
.mini-ring circle:last-child { stroke: var(--blue); stroke-dasharray: 119.4; stroke-dashoffset: 36; }
.bubble { display: flex; flex-direction: column; gap: 8px; width: 68%; padding: 14px; border-radius: 14px 14px 14px 4px; background: var(--card); box-shadow: var(--shadow); }
.bubble--me { align-self: flex-end; width: 52%; background: var(--blue); border-radius: 14px 14px 4px 14px; }
.avatars { display: flex; }
.avatars i { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--well); margin-right: -8px; background: #dbe4ff; }
.avatars i:nth-child(2) { background: #ffd9e4; } .avatars i:nth-child(3) { background: #ffe9b8; }
.avatars i:nth-child(4) { background: #cff5e1; } .avatars i:nth-child(5) { background: #e6ddff; } .avatars i:nth-child(6) { background: #dbe4ff; }
.count { margin-left: 14px; font: 14px var(--mono); color: var(--muted); letter-spacing: 0; }
.price { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.price small { font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }

/* Morph */
.morph { position: relative; display: inline-block; white-space: pre; vertical-align: bottom; }
.morph__ch { display: inline-block; white-space: pre; }
.morph__out { position: absolute; top: 0; white-space: pre; pointer-events: none; }

/* Sections */
.section { padding-top: 136px; }
.h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 24px; }

/* Cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.card, .panel, .code {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
}
.card { display: flex; flex-direction: column; padding: 22px 10px 10px; }
.card > p { padding: 0 12px; margin: 14px 0 20px; color: var(--text); font-size: 17px; line-height: 1.65; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 12px; }
.card__title { display: inline-flex; align-items: center; gap: 12px; font: 500 19px/1 var(--mono); letter-spacing: -0.01em; }
.card__title svg { width: 20px; height: 20px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card__title img { width: 20px; height: 20px; }
.card__meta { font-size: 14.5px; color: var(--muted); text-align: right; }
.demo {
  position: relative; margin-top: auto; height: 220px; border-radius: 16px; background: var(--well);
  display: grid; place-items: center; overflow: hidden;
}
.replay {
  position: absolute; top: 12px; right: 12px; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--card);
  box-shadow: var(--shadow); cursor: pointer; color: var(--muted);
  transition: scale 320ms var(--ease), color 200ms;
}
.replay:hover { color: var(--ink); }
.replay:active { scale: 0.94; transition-duration: 120ms; }
.replay svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.d-app { display: flex; align-items: center; gap: 20px; }
.ring { width: 96px; height: 96px; transform: rotate(-90deg); }
.ring circle { stroke-width: 8; }
.ring circle:last-child { stroke: var(--blue); stroke-dasharray: 201; stroke-dashoffset: 201; }
.d-app__txt { display: flex; flex-direction: column; }
.d-app__txt strong { font-size: 30px; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.d-app__txt span { font: 13.5px var(--mono); color: var(--muted); letter-spacing: 0; }
.d-chat { display: flex; flex-direction: column; gap: 10px; width: 72%; }
.d-group { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.avatars--lg i { width: 44px; height: 44px; border-width: 3px; margin-right: -12px; }
.d-group .count { margin: 0; font-size: 14.5px; }
.d-pay { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 60%; }
.d-pay .bar { align-self: stretch; }
.d-pay .bar.w45 { width: 60%; }
.d-pay .btn { margin-top: 14px; }

/* Code */
.code { overflow: hidden; }
.code__head { display: flex; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 16px; cursor: pointer; white-space: nowrap;
  transition: background-color 200ms, color 200ms, scale 320ms var(--ease);
}
.tab:hover { color: var(--ink); }
.tab:active { scale: 0.97; transition-duration: 120ms; }
.tab.is-active { background: var(--well); color: var(--ink); }
.tab svg { width: 17px; height: 17px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.code__body {
  margin: 0; padding: 28px 28px 32px; overflow-x: auto;
  font: 15.5px/2 var(--mono); letter-spacing: 0; color: var(--ink); tab-size: 2;
}
.ln { display: inline-block; width: 2.4em; padding-right: 1em; text-align: right; color: var(--faint); user-select: none; }
.k { color: #a626a4; } .f { color: #2f55d4; } .v { color: #2f55d4; } .p { color: #b45309; } .s { color: #3a7d44; } .c { color: #8e8e96; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.steps li { display: grid; grid-template-columns: 48px 1fr auto; gap: 16px; align-items: baseline; padding: 24px 28px; }
.steps li + li { border-top: 1px solid var(--line); }
.steps__n { font: 15px var(--mono); color: var(--blue); letter-spacing: 0; }
.steps strong { font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.steps p { color: var(--text); margin-top: 2px; }
.steps__meta { font-size: 14.5px; color: var(--muted); }

/* Form */
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.form__body { display: grid; gap: 20px; padding: 28px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > span:first-child, .field legend { font-size: 14.5px; font-weight: 500; color: var(--text); padding: 0; }
.field legend { margin-bottom: 10px; }
.field em { font-style: normal; color: var(--faint); font-weight: 400; margin-left: 4px; }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px;
  background: var(--well); color: var(--ink); font: 16px var(--sans); letter-spacing: -0.01em;
  -webkit-appearance: none; appearance: none; transition: border-color 200ms, background-color 200ms, box-shadow 200ms;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field select:invalid { color: var(--faint); }
.field ::placeholder { color: var(--faint); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; background-color: var(--card); border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31, 75, 255, .12); }
.input-at { position: relative; display: block; }
.input-at em { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); margin: 0; color: var(--faint); font: 16px var(--mono); pointer-events: none; }
.input-at input { padding-left: 32px; font-family: var(--mono); font-size: 15.5px; letter-spacing: 0; }
.field.is-invalid input, .field.is-invalid select { border-color: #e5484d; background-color: #fff5f5; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow);
  font: 14.5px var(--mono); letter-spacing: 0; color: var(--text); user-select: none;
  transition: background-color 200ms, color 200ms, border-color 200ms, scale 320ms var(--ease);
}
.chip:active span { scale: 0.97; transition-duration: 120ms; }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.form__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; }
.form__status { font-size: 15px; color: var(--muted); }
.form__status.is-error { color: #d1343a; }
.form__done { display: grid; justify-items: center; gap: 10px; padding: 64px 28px; text-align: center; }
.form__done strong { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.form__done p { color: var(--text); max-width: 26em; }

/* FAQ */
.faq details + details { border-top: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 28px; cursor: pointer; list-style: none; font-weight: 500; font-size: 17.5px; letter-spacing: -0.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary i { position: relative; flex: none; width: 14px; height: 14px; }
.faq summary i::before, .faq summary i::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 2px; border-radius: 2px; background: var(--muted); transition: transform 320ms var(--ease); }
.faq summary i::after { transform: rotate(90deg); }
.faq details[open] summary i::after { transform: rotate(0deg); }
.faq details p { padding: 0 28px 24px; color: var(--text); max-width: 44em; }

/* Footer */
.footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 120px; padding-bottom: 48px; font-size: 14.5px; color: var(--muted); }
.footer img { width: 104px; height: auto; }

/* Hidden until main.js rises it */
.js .reveal, .js .nav__inner, .js .hero > * { opacity: 0; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .nav__inner { height: 72px; }
  .nav__links > a:not(.btn) { display: none; }
  .hero { padding-top: 56px; }
  .select { border-width: 1.5px; }
  .handle { width: 9px; height: 9px; }
  .handle--tl { top: -6px; left: -6px; } .handle--br { bottom: -6px; right: -6px; }
  .note { margin-left: 30vw; font-size: 13.5px; }
  .hero__lead { font-size: 17.5px; }
  .hero__cta { width: 100%; }
  .handle-pill { flex: 1 1 100%; }
  .handle-pill input { flex: 1; width: auto; }
  .hero__cta .btn { flex: 1 1 100%; }
  .window { margin-top: 48px; padding: 18px 18px 28px; border-radius: 20px; }
  .section { padding-top: 96px; }
  .cards { grid-template-columns: 1fr; }
  .card__meta { display: none; }
  .demo { height: 190px; }
  .code__body { font-size: 13px; padding: 20px 16px 24px; }
  .steps li { grid-template-columns: 36px 1fr; padding: 20px; }
  .steps__meta { display: none; }
  .panel__head { padding: 18px 20px; }
  .form__body { padding: 20px; }
  .grid2 { grid-template-columns: 1fr; }
  .form__foot { flex-direction: column-reverse; align-items: stretch; }
  .form__foot .btn { width: 100%; }
  .faq summary { padding: 20px; }
  .faq details p { padding: 0 20px 20px; }
  .footer { padding-top: 88px; }
}

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