/* ═══════════════════════════════════════════════════════════════════
   GLM-5 Landing Page — Premium SaaS Design
   Inspired by Linear, Vercel, Stripe
   ═══════════════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-0: #09090b;
  --bg-1: #0f0f12;
  --bg-2: #16161a;
  --bg-card: #111114;
  --bg-card-hover: #19191e;
  --bg-elevated: #1c1c21;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(255, 255, 255, 0.18);

  --text-0: #fafafa;
  --text-1: #a1a1aa;
  --text-2: #71717a;
  --text-3: #3f3f46;

  --accent: #a78bfa;
  --accent-soft: rgba(167, 139, 250, 0.1);
  --accent-muted: rgba(167, 139, 250, 0.06);
  --accent-border: rgba(167, 139, 250, 0.2);
  --accent-fill: rgba(167, 139, 250, 0.85);

  --green: #4ade80;
  --green-soft: rgba(74, 222, 128, 0.12);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 15px;
}

.btn-primary {
  background: var(--text-0);
  color: var(--bg-0);
}

.btn-primary:hover {
  background: #e4e4e7;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 16px rgba(0, 0, 0, 0.4);
}

.btn-secondary {
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  color: var(--text-0);
}

/* ── Animations ────────────────────────────────────────────────── */
[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Section shared ────────────────────────────────────────────── */
.section-header {
  margin-bottom: 56px;
}

.section-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-0);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV
   ═══════════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: all 0.3s ease;
}

.nav.is-scrolled {
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text-0);
}

.logo svg {
  color: var(--text-2);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-0);
}

/* ═══════════════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 180px 0 100px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 30%, black 20%, transparent 70%);
}

.hero-radial {
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 600px;
  background: radial-gradient(ellipse, rgba(167, 139, 250, 0.06) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  margin-bottom: 32px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-0);
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-1);
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 64px;
}

/* Metrics */
.hero-metrics {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 20px 36px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 28px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
  color: var(--text-0);
  letter-spacing: -0.02em;
}

.metric-label {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}

.metric-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ═══════════════════════════════════════════════════════════════════
   LOGO BAR
   ═══════════════════════════════════════════════════════════════════ */
.logo-bar {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.logo-bar .container {
  display: flex;
  align-items: center;
  gap: 32px;
}

.logo-bar-label {
  font-size: 13px;
  color: var(--text-3);
  white-space: nowrap;
}

.logo-bar-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.logo-bar-list span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  transition: all 0.2s;
}

.logo-bar-list span:hover {
  border-color: var(--border-hover);
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════════════════
   FEATURES — BENTO GRID
   ═══════════════════════════════════════════════════════════════════ */
.features {
  padding: 100px 0;
}

.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bento-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.bento-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.bento-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-0);
}

.bento-card p {
  font-size: 14px;
  color: var(--text-1);
  line-height: 1.6;
}

.bento-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 16px;
}

/* Large card */
.bento-card--lg {
  grid-column: span 1;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bento-card--lg .bento-card-content {
  margin-bottom: 24px;
}

/* Reasoning demo */
.reasoning-demo {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.reason-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid var(--border);
}

.reason-num {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
}

.reason-text {
  font-size: 13px;
  color: var(--text-1);
}

.reason-connector {
  width: 1px;
  height: 12px;
  background: var(--border);
  margin-left: 22px;
}

/* Code preview */
.code-preview {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.7;
  overflow-x: auto;
}

.code-preview code {
  display: block;
  white-space: pre;
}

.ck {
  color: #c084fc;
}

.cf {
  color: #60a5fa;
}

.cn {
  color: #e2e8f0;
}

.cv {
  color: #fbbf24;
}

.cs {
  color: #a7f3d0;
}

/* Modal chips */
.modal-icons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-0);
}

.modal-chip svg {
  color: var(--text-2);
}

/* ═══════════════════════════════════════════════════════════════════
   ARCHITECTURE
   ═══════════════════════════════════════════════════════════════════ */
.architecture {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.arch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.arch-row {
  width: 100%;
  display: flex;
  justify-content: center;
}

.arch-arrow {
  color: var(--text-3);
  line-height: 0;
}

.arch-node {
  padding: 10px 28px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-1);
}

.arch-node--input {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-muted);
}

.arch-node--router {
  border-color: rgba(96, 165, 250, 0.2);
  color: #93bbfc;
  background: rgba(96, 165, 250, 0.06);
}

.arch-node--merge {
  border-color: rgba(52, 211, 153, 0.2);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.06);
}

.arch-node--output {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-muted);
}

.arch-experts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  padding: 12px 0;
}

.arch-expert {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--font-mono);
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-0);
  color: var(--text-3);
  transition: all 0.3s ease;
}

.arch-expert.is-active {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--accent);
}

.arch-caption {
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  padding: 4px 0 8px;
}

/* Details table */
.arch-details {
  display: flex;
  flex-direction: column;
}

.arch-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.arch-detail-item:first-child {
  padding-top: 0;
}

.arch-detail-item:last-child {
  border-bottom: none;
}

.arch-detail-key {
  font-size: 14px;
  color: var(--text-2);
}

.arch-detail-val {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   PERFORMANCE
   ═══════════════════════════════════════════════════════════════════ */
.performance {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.perf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.perf-card {
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.perf-card:hover {
  border-color: var(--border-hover);
}

.perf-score {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 500;
  color: var(--text-0);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.perf-score::after {
  content: '%';
  font-size: 18px;
  color: var(--text-2);
  margin-left: 2px;
}

.perf-score--elo::after {
  content: '';
}

.perf-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-0);
  border-radius: 100px;
  margin-bottom: 16px;
  overflow: hidden;
}

.perf-fill {
  height: 100%;
  background: var(--accent-fill);
  border-radius: 100px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.perf-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  margin-bottom: 2px;
}

.perf-category {
  font-size: 13px;
  color: var(--text-2);
}

.perf-footnote {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 32px;
}

.perf-footnote a {
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.perf-footnote a:hover {
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════════════════
   DEPLOY / CTA
   ═══════════════════════════════════════════════════════════════════ */
.deploy {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

.deploy-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 48px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.deploy-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.deploy-desc {
  font-size: 15px;
  color: var(--text-1);
  line-height: 1.6;
  margin-bottom: 28px;
}

.deploy-actions {
  display: flex;
  gap: 12px;
}

/* Code window */
.code-window {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.code-dots {
  display: flex;
  gap: 6px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.code-window pre {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-1);
  overflow-x: auto;
}

/* ═══════════════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
}

.footer-left svg {
  color: var(--text-3);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-1);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }

  .bento-card--lg {
    grid-column: span 2;
    grid-row: span 1;
  }

  .bento-card--lg .bento-card-content {
    margin-bottom: 16px;
  }

  .arch-grid {
    grid-template-columns: 1fr;
  }

  .deploy-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 140px 0 80px;
  }

  .hero-metrics {
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px;
  }

  .metric-divider {
    display: none;
  }

  .metric {
    padding: 0 16px;
  }

  .bento {
    grid-template-columns: 1fr;
  }

  .bento-card--lg {
    grid-column: span 1;
  }

  .perf-grid {
    grid-template-columns: 1fr;
  }

  .deploy-card {
    padding: 28px;
  }

  .logo-bar .container {
    flex-direction: column;
    gap: 16px;
  }

  .logo-bar-list {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .deploy-actions {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
  }
}