:root {
  color-scheme: dark;
  --bg: #1e1c5f;
  --surface: #ffffff;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --line: rgba(255, 255, 255, 0.22);
  --soft: rgba(255, 255, 255, 0.1);
  --shadow: 0 24px 70px rgba(30, 28, 95, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0;
}

.brand,
.site-nav,
.hero-actions,
.chat-topbar,
.site-footer {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 700;
}

.brand img {
  display: block;
  width: 148px;
  height: auto;
}

.site-nav {
  gap: 24px;
  color: var(--muted);
  font-size: 15px;
}

.site-nav a:hover {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 2px;
  margin: 4px auto;
  background: var(--surface);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  align-items: center;
  gap: 64px;
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 212px);
  margin: 0 auto;
  padding: 42px 0 72px;
}

.persona-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 520px;
}

.persona-bubble {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 1;
  max-width: 310px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--surface);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 14px 40px rgba(30, 28, 95, 0.18);
  backdrop-filter: blur(12px);
}

.persona-bubble .typing-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
  animation: word-in 0.36s ease forwards;
}

.persona-bubble::after {
  content: "";
  position: absolute;
  right: 218px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 3px 0;
  background: #34327a;
  transform: rotate(45deg);
}

@keyframes word-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.persona-stage svg {
  display: block;
  width: min(100%, 430px);
  height: auto;
  overflow: visible;
  cursor: pointer;
  filter: drop-shadow(0 28px 60px rgba(30, 28, 95, 0.34));
}

.persona-bg {
  fill: var(--bg);
}

.persona-fill {
  fill: var(--surface);
}

#left-eye,
#right-eye,
#right-eye-wink,
#mustache {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, opacity;
}

#right-eye-wink {
  opacity: 0;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--surface);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(44px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro {
  max-width: 610px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.7;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.button.primary {
  border-color: var(--surface);
  background: var(--surface);
  color: var(--bg);
}

.button.primary:hover {
  opacity: 0.9;
}

.button.secondary:hover {
  background: var(--soft);
}

.demo-section {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 72px;
  padding: 26px 0 42px;
}

.chat-preview {
  min-height: 520px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.chat-preview .message {
  opacity: 0;
  transform: translateY(12px);
}

.chat-preview.is-visible .message {
  animation: chat-in 0.5s ease forwards;
}

.chat-preview.is-visible .message:nth-child(2) {
  animation-delay: 0.25s;
}

.chat-preview.is-visible .message:nth-child(3) {
  animation-delay: 0.85s;
}

.chat-preview.is-visible .message:nth-child(4) {
  animation-delay: 1.45s;
}

@keyframes chat-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-copy h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
}

.demo-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.chat-topbar {
  justify-content: space-between;
  padding: 4px 2px 22px;
  color: var(--muted);
  font-size: 14px;
}

.chat-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--surface);
  font-size: 18px;
  font-weight: 700;
}

.chat-brand img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: contain;
}

.message {
  width: fit-content;
  max-width: 86%;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.55;
}

.message.bot {
  background: rgba(255, 255, 255, 0.12);
}

.message.user {
  margin-left: auto;
  background: var(--surface);
  color: var(--bg);
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 52px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.chat-placeholder,
.chat-send {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.chat-placeholder {
  width: 100%;
  padding: 0 14px;
  background: transparent;
  color: var(--surface);
}

.chat-send {
  padding: 0 14px;
  background: var(--surface);
  color: var(--bg);
  font-weight: 700;
  user-select: none;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 72px;
  border: 1px solid var(--line);
  background: var(--line);
}

.features article {
  min-height: 220px;
  padding: 28px;
  background: var(--bg);
}

.features span {
  color: var(--surface);
  font-size: 40px;
  font-weight: 800;
}

.features h2 {
  margin: 52px 0 12px;
  font-size: 22px;
}

.features p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.contact-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  align-items: center;
  gap: 56px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto 72px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.contact-copy h2 {
  max-width: 660px;
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.05;
}

.contact-copy p:not(.eyebrow) {
  max-width: 610px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.contact-panel {
  display: grid;
  gap: 18px;
  align-content: center;
  justify-items: start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.contact-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 28px;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer address {
  font-style: normal;
  text-align: center;
}

.site-footer a {
  justify-self: end;
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 82px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: min(260px, calc(100% - 40px));
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--bg);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 36px;
    padding-top: 28px;
  }

  .persona-stage {
    min-height: 430px;
    padding-top: 72px;
  }

  .persona-bubble {
    top: 0;
    right: 50%;
    width: min(100%, 320px);
    transform: translateX(50%);
  }

  .demo-section {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .chat-preview {
    min-height: auto;
  }

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

  .features article {
    min-height: 190px;
  }

  .contact-section {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: left;
  }

  .site-footer address,
  .site-footer a {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .site-header,
  .hero,
  .demo-section,
  .features,
  .contact-section,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  h1 {
    font-size: 42px;
  }

  .chat-input {
    grid-template-columns: 1fr;
  }
}
