:root {
  color-scheme: light;
  --ink: #16231f;
  --muted: #63706b;
  --line: #dbe5e0;
  --paper: #fbf8f1;
  --surface: #ffffff;
  --green: #1f9d63;
  --green-dark: #0d6b45;
  --mint: #dff5eb;
  --sky: #e7f2fb;
  --amber: #f0b84d;
  --shadow: 0 24px 70px rgb(22 35 31 / 14%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  background: rgb(251 248 241 / 86%);
  border-bottom: 1px solid rgb(219 229 224 / 70%);
  backdrop-filter: blur(18px);
}

.brand,
.header-link,
.secondary-link {
  color: inherit;
  text-decoration: none;
}

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

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.header-link,
.secondary-link {
  color: var(--green-dark);
  font-weight: 700;
}

.hero {
  display: grid;
  min-height: 88vh;
  padding: 132px clamp(20px, 5vw, 72px) 56px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  align-items: center;
  gap: clamp(32px, 6vw, 88px);
}

.hero-copy {
  max-width: 660px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 6.8vw, 6.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-text {
  max-width: 540px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1.06rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.primary-button,
.ghost-button {
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  cursor: pointer;
  font-weight: 850;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

.primary-button {
  background: var(--green);
  color: white;
  box-shadow: 0 14px 28px rgb(31 157 99 / 24%);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.ghost-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.phone-stage {
  display: grid;
  min-width: 0;
  place-items: center;
}

.phone {
  width: min(100%, 410px);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 12px solid #14221d;
  border-radius: 42px;
  background: #efe7d4;
  box-shadow: var(--shadow);
}

.phone-top {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 74px;
  padding: 14px 18px;
  background: #075e54;
  color: white;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #d8f3e5;
  color: #075e54;
  font-weight: 900;
}

.chat-title {
  font-weight: 800;
}

.chat-presence {
  color: rgb(255 255 255 / 75%);
  font-size: 0.78rem;
}

.chat-area {
  display: flex;
  min-height: calc(100% - 74px);
  padding: 22px 16px;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background:
    linear-gradient(rgb(255 255 255 / 62%), rgb(255 255 255 / 62%)),
    repeating-linear-gradient(45deg, #efe4cf 0, #efe4cf 12px, #eadfc8 12px, #eadfc8 24px);
}

.bubble {
  width: fit-content;
  max-width: 84%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.35;
  box-shadow: 0 2px 6px rgb(25 35 32 / 8%);
}

.bubble-out {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: #d9fdd3;
}

.bubble-in {
  border-bottom-left-radius: 5px;
  background: white;
}

.bubble.small {
  font-size: 0.86rem;
}

.file-result {
  display: flex;
  align-items: center;
  gap: 11px;
  width: min(92%, 310px);
  padding: 11px;
  border-radius: 13px;
  background: white;
  box-shadow: 0 6px 18px rgb(25 35 32 / 10%);
}

.file-icon {
  width: 38px;
  height: 44px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 14px, #c7dcff 14px),
    linear-gradient(#2869cf, #1b4d99);
}

.file-name {
  font-size: 0.88rem;
  font-weight: 800;
}

.file-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.typing {
  display: flex;
  width: 58px;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  background: white;
}

.typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7b8983;
  animation: typing 1.1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 120ms;
}

.typing span:nth-child(3) {
  animation-delay: 240ms;
}

.onboarding-band {
  padding: 32px clamp(20px, 5vw, 72px) 72px;
  background: linear-gradient(180deg, var(--paper), #eaf4ef);
}

.setup-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.setup-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.setup-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.steps {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  gap: 12px;
  list-style: none;
}

.step {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 74%);
}

.step.is-active {
  border-color: rgb(31 157 99 / 42%);
  background: var(--mint);
}

.step.is-done {
  border-color: rgb(31 157 99 / 26%);
  background: white;
}

.step-index {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-weight: 900;
}

.step small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.setup-card {
  min-width: 0;
  min-height: 430px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgb(22 35 31 / 10%);
}

.setup-status {
  display: flex;
  align-items: center;
  min-height: 32px;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgb(240 184 77 / 16%);
}

.status-dot.is-live {
  background: var(--green);
  box-shadow: 0 0 0 6px rgb(31 157 99 / 16%);
}

.status-dot.is-error {
  background: #d94b4b;
  box-shadow: 0 0 0 6px rgb(217 75 75 / 14%);
}

.qr-frame {
  display: grid;
  min-height: 256px;
  margin: 22px 0;
  place-items: center;
  border: 1px dashed #bfd0c8;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(223 245 235 / 55%), transparent),
    var(--surface);
}

.qr-frame img {
  display: block;
  width: min(256px, 78vw);
  height: min(256px, 78vw);
  border-radius: 12px;
}

.qr-placeholder {
  display: grid;
  place-items: center;
  gap: 16px;
  color: var(--muted);
  font-weight: 750;
  text-align: center;
}

.ready-panel {
  display: grid;
  max-width: 420px;
  place-items: center;
  gap: 10px;
  color: var(--ink);
}

.ready-panel[hidden] {
  display: none;
}

.ready-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green-dark);
  font-size: 1.45rem;
  font-weight: 950;
}

.ready-panel strong {
  font-size: 1.08rem;
}

.ready-panel span {
  max-width: 32ch;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.ready-panel code {
  display: block;
  max-width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6faf8;
  color: var(--green-dark);
  font-family: inherit;
  font-weight: 850;
}

.loader {
  display: inline-block;
  width: 42px;
  height: 42px;
  border: 4px solid rgb(31 157 99 / 18%);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.setup-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.setup-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

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

@keyframes typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
    padding-top: 112px;
    grid-template-columns: 1fr;
  }

  .phone {
    width: min(100%, 340px);
  }

  .setup-copy {
    display: block;
  }

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

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .step {
    min-width: 180px;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 64px;
    padding-inline: 16px;
  }

  .hero {
    padding: 96px 16px 24px;
    justify-items: stretch;
  }

  .hero-copy,
  .phone-stage,
  .setup-shell {
    width: 100%;
    max-width: 358px;
    margin-inline: 0;
  }

  h1 {
    font-size: clamp(2.2rem, 10vw, 2.75rem);
    line-height: 0.98;
  }

  .hero-actions,
  .setup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .secondary-link {
    width: 100%;
    text-align: center;
  }

  .secondary-link {
    padding: 10px 0;
  }

  .phone {
    width: min(100%, 276px);
    height: 280px;
    aspect-ratio: auto;
    border-width: 9px;
    border-radius: 34px;
  }

  .phone-stage {
    overflow: visible;
    place-items: start center;
  }

  .chat-area {
    padding: 14px;
    gap: 8px;
  }

  .file-result {
    display: none;
  }

  .onboarding-band {
    padding: 28px 16px 52px;
  }

  .setup-card {
    min-height: 380px;
    border-radius: 18px;
  }

  .qr-frame {
    min-height: 230px;
  }
}
