/* ===== Variables ===== */
:root {
  --bg-primary: #0F1117;
  --bg-secondary: #151924;
  --bg-card: #1B2030;
  --border: #2A3142;
  --text-primary: #F4F7FB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --primary: #4F8CFF;
  --primary-hover: #3B7AEF;
  --success: #22C55E;
  --danger: #EF4444;
  --warning: #F59E0B;
  --info: #38BDF8;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --header-height: 64px;
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul { list-style: none; }

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

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(79, 140, 255, 0.12);
  color: var(--primary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--primary);
  color: #fff;
}

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

.btn--ghost {
  color: var(--text-secondary);
}

.btn--ghost:hover {
  color: var(--text-primary);
}

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

.btn--outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--lg {
  padding: 12px 24px;
  font-size: 15px;
  border-radius: var(--radius-md);
}

.btn--sm {
  padding: 7px 14px;
  font-size: 13px;
}

.btn--block {
  width: 100%;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.header--scrolled {
  border-bottom-color: var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
}

.logo--sm {
  font-size: 16px;
}

.logo__icon {
  display: flex;
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav__link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.nav__link:hover {
  color: var(--text-primary);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

.burger--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger--open span:nth-child(2) {
  opacity: 0;
}

.burger--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Hero ===== */
.hero {
  padding: calc(var(--header-height) + 64px) 0 80px;
  position: relative;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.badge__dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero__title {
  font-size: clamp(32px, 4.5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 480px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.hero__stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat__value {
  display: block;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.stat__label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat__divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ===== App Preview ===== */
.hero__preview {
  position: relative;
}

.hero__glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(ellipse at center, rgba(79, 140, 255, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.app-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.app-window__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.app-window__dots {
  display: flex;
  gap: 6px;
}

.app-window__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}

.app-window__dots span:first-child { background: #EF4444; }
.app-window__dots span:nth-child(2) { background: #F59E0B; }
.app-window__dots span:last-child { background: #22C55E; }

.app-window__title {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.app-window__body {
  display: grid;
  grid-template-columns: 160px 1fr;
  min-height: 320px;
}

.app-sidebar {
  padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: var(--bg-primary);
}

.app-sidebar__section {
  margin-bottom: 20px;
}

.app-sidebar__label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 8px;
}

.app-sidebar__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: default;
}

.app-sidebar__item--active {
  background: rgba(79, 140, 255, 0.12);
  color: var(--primary);
}

.app-chat {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.message {
  display: flex;
  gap: 10px;
  animation: fadeInUp 0.5s ease both;
}

.message:nth-child(2) { animation-delay: 0.3s; }
.message:nth-child(3) { animation-delay: 0.6s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message__avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message__avatar--user {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.message__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.message__author {
  font-size: 13px;
  font-weight: 600;
}

.message__time {
  font-size: 11px;
  color: var(--text-muted);
}

.message__text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.message__text--muted {
  font-style: italic;
  color: var(--text-muted);
}

.message__content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.message__bubble {
  min-width: 0;
}

.message__buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.msg-btn {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: var(--bg-card);
  text-align: center;
  transition: all var(--transition);
}

.msg-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.message__code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 4px;
}

.code-line {
  display: block;
  line-height: 1.7;
}

.code-key { color: var(--info); }
.code-str { color: var(--success); }
.code-num { color: var(--warning); }

/* ===== Logos ===== */
.logos {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.logos__text {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.logos__grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
}

.logo-item {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  transition: color var(--transition);
}

.logo-item:hover {
  color: var(--text-secondary);
}

/* ===== Sections ===== */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 56px;
}

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.features {
  padding: 100px 0;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition);
}

.feature-card:hover {
  border-color: rgba(79, 140, 255, 0.3);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-card__icon--blue { background: rgba(79, 140, 255, 0.12); color: var(--primary); }
.feature-card__icon--green { background: rgba(34, 197, 94, 0.12); color: var(--success); }
.feature-card__icon--amber { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.feature-card__icon--cyan { background: rgba(56, 189, 248, 0.12); color: var(--info); }
.feature-card__icon--purple { background: rgba(168, 85, 247, 0.12); color: #A855F7; }
.feature-card__icon--red { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

.feature-card__title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== How it works ===== */
.how-it-works {
  padding: 100px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0;
  align-items: start;
}

.step {
  text-align: center;
  padding: 0 16px;
}

.step__number {
  font-size: 48px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--border);
  margin-bottom: 16px;
  line-height: 1;
}

.step__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step__desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step__connector {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--primary), var(--border));
  margin-top: 36px;
}

/* ===== API Section ===== */
.api-section {
  padding: 100px 0;
}

.api-section__inner {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: center;
}

.api-list {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.api-list svg {
  color: var(--success);
  flex-shrink: 0;
}

.code-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.code-block__tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.code-tab:hover {
  color: var(--text-secondary);
}

.code-tab--active {
  background: var(--bg-card);
  color: var(--text-primary);
}

.code-block__copy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.code-block__copy:hover {
  color: var(--text-primary);
}

.code-block__copy--copied {
  color: var(--success);
}

.code-block__body {
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.code-block__body .kw { color: #C792EA; }
.code-block__body .fn { color: var(--primary); }
.code-block__body .str { color: var(--success); }
.code-block__body .cm { color: var(--text-muted); }
.code-block__body .var { color: var(--info); }

/* ===== Pricing ===== */
.pricing {
  padding: 100px 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.pricing__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
}

.pricing-card--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.pricing-card__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 100px;
}

.pricing-card__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.pricing-card__price {
  margin-bottom: 8px;
}

.pricing-card__amount {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pricing-card__period {
  font-size: 14px;
  color: var(--text-muted);
}

.pricing-card__desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pricing-card__features {
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pricing-card__features li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.pricing-card__features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-size: 13px;
}

/* ===== CTA ===== */
.cta {
  padding: 100px 0;
}

.cta__inner {
  text-align: center;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.1) 0%, rgba(56, 189, 248, 0.05) 100%);
  border: 1px solid rgba(79, 140, 255, 0.2);
  border-radius: var(--radius-xl);
  padding: 64px 32px;
}

.cta__title {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.cta__desc {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 64px 0 0;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 2fr;
  gap: 64px;
  padding-bottom: 48px;
}

.footer__tagline {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
}

.footer__links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer__col h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer__col a {
  display: block;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
  transition: color var(--transition);
}

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

.footer__bottom {
  padding: 20px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero__preview {
    max-width: 560px;
    margin: 0 auto;
  }

  .features__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .api-section__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .step__connector {
    display: none;
  }

  .pricing__grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 0;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
  }

  .nav--open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav__link {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
  }

  .nav__link:last-child {
    border-bottom: none;
  }

  .header__actions {
    display: none;
  }

  .burger {
    display: flex;
  }

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

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer__links {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-window__body {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: 16px;
  }

  .stat__divider {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

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