:root {
  color-scheme: light;
  --bg: #f4f1eb;
  --ink: #050505;
  --soft-ink: #343434;
  --muted: #73716c;
  --panel: #fffdf8;
  --line: rgba(5, 5, 5, 0.12);
  --black: #050505;
  --white: #ffffff;
  --ok: #147a45;
  --warn: #9b6a15;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.95), rgba(244, 241, 235, 0.88) 34%, transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 14px 2px no-repeat,
    linear-gradient(90deg, var(--ink), var(--ink)) center / 2px 14px no-repeat;
}

.topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.maker-link {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.maker-link:hover {
  color: var(--ink);
}

.stage {
  min-height: calc(100vh - 106px);
}

.verify-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.72fr);
  gap: 44px;
  align-items: center;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(3.25rem, 8vw, 7.6rem);
  line-height: 0.91;
  letter-spacing: 0;
  max-width: 780px;
}

.lede {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--soft-ink);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.verify-panel,
.chat-surface {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 24px 80px rgba(20, 19, 16, 0.12);
  backdrop-filter: blur(18px);
}

.verify-panel {
  padding: 18px;
}

.step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px 16px;
  font-size: 1.02rem;
  font-weight: 800;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.qr-card {
  display: grid;
  gap: 14px;
  justify-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
}

.qr-card[hidden],
[hidden] {
  display: none !important;
}

.qr-code {
  width: min(260px, 100%);
  aspect-ratio: 1;
}

.qr-code svg {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-card a {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  background: var(--black);
  color: var(--white);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button.secondary {
  background: #ebe7de;
  color: var(--ink);
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.hidden-form {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

textarea {
  min-height: 58px;
  max-height: 160px;
  resize: vertical;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  color: var(--soft-ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.pill.ok {
  background: #e7f7ee;
  color: var(--ok);
}

.pill.warn {
  background: #fff4dc;
  color: var(--warn);
}

.pill.bad {
  background: #fde8e6;
  color: var(--bad);
}

.chat-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding-top: 42px;
}

.chat-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.chat-head h1 {
  margin-bottom: 0;
  font-size: clamp(2.7rem, 6vw, 5.4rem);
}

.chat-surface {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) auto;
  min-height: 520px;
  padding: 18px;
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: var(--soft-ink);
  background: transparent;
  border: 0;
}

.message {
  display: grid;
  gap: 6px;
  max-width: min(76%, 760px);
}

.message.user {
  align-self: end;
}

.message.assistant {
  align-self: start;
}

.message-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.message.user .message-label {
  text-align: right;
}

.message-body {
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--soft-ink);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message.user .message-body {
  border-color: var(--black);
  background: var(--black);
  color: var(--white);
}

.message.pending .message-body {
  color: var(--muted);
}

.message.error .message-body {
  border-color: rgba(180, 35, 24, 0.25);
  background: #fde8e6;
  color: var(--bad);
}

.message-body > :first-child {
  margin-top: 0;
}

.message-body > :last-child {
  margin-bottom: 0;
}

.message-body p,
.message-body ul,
.message-body pre,
.message-body blockquote {
  margin: 0 0 0.85rem;
}

.message-body h1,
.message-body h2,
.message-body h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  line-height: 1.25;
}

.message-body ul {
  padding-left: 1.25rem;
}

.message-body li + li {
  margin-top: 0.35rem;
}

.message-body code {
  border-radius: 6px;
  padding: 0.12rem 0.32rem;
  background: rgba(5, 5, 5, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.message-body pre {
  overflow-x: auto;
  border-radius: 12px;
  padding: 12px;
  background: #111;
  color: #f7f7f7;
}

.message-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.message-body blockquote {
  padding-left: 0.9rem;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.message-body a {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--white);
}

.composer textarea {
  border: 0;
  padding: 13px 12px;
}

.composer textarea:focus {
  outline: none;
}

.demo-popup {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(5, 5, 5, 0.32), rgba(5, 5, 5, 0.58)),
    rgba(5, 5, 5, 0.36);
  backdrop-filter: blur(10px);
}

.demo-popup__panel {
  position: relative;
  isolation: isolate;
  width: min(460px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  padding: 42px 34px 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 253, 248, 0.88) 54%, rgba(231, 247, 238, 0.74)),
    var(--panel);
  box-shadow:
    0 34px 100px rgba(5, 5, 5, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
}

.demo-popup__panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--black), var(--ok), #f2b84b);
  z-index: -1;
}

.demo-popup__badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin-bottom: 18px;
  border: 1px solid rgba(20, 122, 69, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(231, 247, 238, 0.86);
  color: var(--ok);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.demo-popup__panel h2 {
  max-width: 360px;
  margin: 0 auto 12px;
  color: var(--ink);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.demo-popup__panel p {
  max-width: 330px;
  margin: 0 auto 26px;
  color: var(--soft-ink);
  font-size: 1.02rem;
  line-height: 1.5;
}

.demo-popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.08);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
}

.demo-popup__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 999px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--black), #252525);
  color: var(--white);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(5, 5, 5, 0.2);
}

.demo-popup__link:hover {
  transform: translateY(-1px);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-meta {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
  }

  .verify-stage {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 26px;
    padding: 28px 0;
  }

  h1 {
    font-size: clamp(3.1rem, 15vw, 5.2rem);
  }

  .chat-head {
    align-items: start;
    flex-direction: column;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .composer button {
    width: 100%;
  }
}
