:root {
  --bg: #0b0f19;
  --bg-soft: #111827;
  --bg-card: #151d2f;
  --bg-card-hover: #1a2438;
  --text: #e8edf7;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-2: #6366f1;
  --accent-glow: rgba(59, 130, 246, 0.35);
  --success: #22c55e;
  --border: rgba(148, 163, 184, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --max-width: 1140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.section {
  padding: 88px 0;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 700;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 720px;
  margin: 0 0 40px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(11, 15, 25, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.05rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  align-items: baseline;
  gap: 0;
  letter-spacing: -0.02em;
}

.logo-dot {
  color: #93c5fd;
  font-weight: 700;
}

.logo-ai {
  font-size: 0.82rem;
  font-weight: 700;
  color: #93c5fd;
  padding: 2px 7px 2px 2px;
  margin-left: 1px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Hero */
.hero {
  padding: 72px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% auto auto 50%;
  width: 700px;
  height: 700px;
  transform: translateX(-30%);
  background: radial-gradient(circle, rgba(56, 189, 248, 0.14), transparent 65%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  grid-template-areas:
    "main carousel"
    "stats carousel";
  gap: 32px 48px;
  align-items: start;
}

.hero-main {
  grid-area: main;
  min-width: 0;
}

.hero-stats {
  grid-area: stats;
}

.hero-grid .chat-carousel {
  grid-area: carousel;
  align-self: center;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  line-height: 1.08;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}

.hero-lead {
  color: var(--text-muted);
  font-size: 1.12rem;
  margin-bottom: 16px;
  max-width: 560px;
}

.hero-lead-second {
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 36px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.stat-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Chat mockup */
.chat-mockup {
  background: linear-gradient(180deg, #121a2b, #0f1524);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-badge {
  font-size: 0.75rem;
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
}

.chat-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 340px;
}

.chat-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.doc-chip {
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.bubble {
  max-width: 92%;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble-user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
}

.bubble-bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.bubble-bot strong {
  color: #93c5fd;
}

.source-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.8rem;
  color: #93c5fd;
}

.chat-input {
  margin: 0 18px 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.02);
}

/* Hero chat carousel */
.chat-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chat-carousel-viewport {
  overflow: hidden;
  overflow-x: clip;
  border-radius: 20px;
  width: 100%;
  max-width: 100%;
  position: relative;
  isolation: isolate;
}

.chat-carousel-track {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  transition: transform 0.45s ease;
  will-change: transform;
}

.chat-carousel .chat-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
  transition: background 0.2s, border-color 0.2s;
}

.carousel-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.carousel-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: background 0.2s, transform 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-size: 1.2rem;
  margin-bottom: 14px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.step {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

/* Compare */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-card {
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--border);
}

.compare-card.bad {
  background: rgba(239, 68, 68, 0.06);
}

.compare-card.good {
  background: rgba(34, 197, 94, 0.06);
}

.compare-card h3 {
  margin-top: 0;
}

.compare-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.compare-card li {
  margin-bottom: 8px;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-question span:last-child {
  transform: rotate(45deg);
}

/* Form */
.contact-section {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.06), transparent);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.form-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.form-status {
  margin-top: 14px;
  font-size: 0.92rem;
  min-height: 1.4em;
}

.form-status.success {
  color: var(--success);
}

.form-status.error {
  color: #f87171;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checkbox-row input {
  margin-top: 4px;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

/* Rag diagram */
.rag-diagram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.rag-node {
  text-align: center;
  padding: 20px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.rag-node strong {
  display: block;
  margin-bottom: 6px;
}

.rag-arrow {
  display: none;
}

/* Case study */
.case-section {
  border-top: 1px solid var(--border);
}

.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.case-content h3 {
  font-size: 1.4rem;
  margin: 0 0 12px;
}

.case-content p {
  color: var(--text-muted);
  margin: 0 0 16px;
}

.case-list {
  margin: 0 0 24px;
  padding-left: 18px;
  color: var(--text-muted);
}

.case-list li {
  margin-bottom: 8px;
}

.case-mockup {
  box-shadow: 0 20px 50px rgba(59, 130, 246, 0.12);
}

@media (max-width: 960px) {
  .hero {
    padding: 24px 0 40px;
  }

  .hero::before {
    width: 320px;
    height: 320px;
    inset: -10% -10% auto auto;
    transform: none;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .hero-main {
    display: contents;
  }

  .hero-grid h1 {
    order: 1;
    font-size: clamp(1.45rem, 6.2vw, 1.85rem);
    line-height: 1.15;
    margin-bottom: 12px;
  }

  .hero-grid .hero-lead:first-of-type {
    order: 2;
    font-size: 0.98rem;
    margin-bottom: 12px;
  }

  .hero-grid .chat-carousel {
    order: 3;
    width: 100%;
    max-width: 100%;
  }

  .hero-grid .hero-lead-second {
    order: 4;
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 16px;
  }

  .hero-grid .hero-actions {
    order: 5;
    margin-bottom: 0;
  }

  .hero-grid .hero-stats {
    order: 6;
  }

  .hero-lead {
    max-width: none;
  }

  .hero-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    padding: 11px 16px;
    font-size: 0.9rem;
  }

  .chat-body {
    min-height: 0;
    padding: 12px;
    gap: 10px;
  }

  .chat-header {
    padding: 10px 12px;
    gap: 8px;
  }

  .chat-title {
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chat-input {
    margin: 0 12px 12px;
    font-size: 0.8rem;
    padding: 10px 12px;
  }

  .bubble {
    font-size: 0.82rem;
    padding: 10px 11px;
    max-width: 95%;
  }

  .source-link {
    font-size: 0.75rem;
  }

  .doc-chip {
    font-size: 0.68rem;
    padding: 4px 7px;
  }

  .chat-mockup {
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  }

  .contact-grid,
  .compare-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }

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

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-card {
    padding: 10px 12px;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .stat-label {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  .rag-diagram {
    grid-template-columns: 1fr;
  }

  .header-inner {
    position: relative;
    min-height: 64px;
  }

  .nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    z-index: 101;
  }

  .nav.open {
    display: flex;
  }

  .nav .btn {
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 24px, var(--max-width));
  }

  .section {
    padding: 56px 0;
  }

  .hero {
    padding: 24px 0 40px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    flex: none;
  }

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

  .stats-row {
    grid-template-columns: 1fr 1fr;
  }

  .carousel-controls {
    gap: 12px;
    margin-top: 12px;
  }

  .logo-text {
    font-size: 0.95rem;
  }

  .logo-icon {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 380px) {
  .stats-row {
    grid-template-columns: 1fr;
  }

  .chat-badge {
    display: none;
  }
}
