/* ==========================================================================
   Landing page (/index.html)
   ========================================================================== */

.home-page {
  background: #fff;
}

.home-main {
  overflow-x: hidden;
}

/* Hero --------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(ellipse 62% 48% at 50% -8%, rgba(37, 99, 235, 0.09), transparent 68%),
    radial-gradient(ellipse 34% 30% at 84% 8%, rgba(14, 165, 233, 0.07), transparent 70%),
    #fff;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: var(--shadow-xs);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.hero-title {
  max-width: 900px;
  margin: 0 0 22px;
  color: var(--ink);
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.hero-title .grad {
  background: linear-gradient(100deg, #1d4ed8 0%, #2563eb 42%, #0ea5e9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 620px;
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.hero-actions .btn svg {
  width: 16px;
  height: 16px;
}

.hero-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-top: 28px;
  padding: 7px 8px 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.hero-endpoint .label {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.hero-endpoint code {
  overflow: hidden;
  max-width: 52vw;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-mute);
  color: var(--ink-3);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.copy-btn:hover {
  background: #e2e8f0;
  color: var(--ink);
}

.copy-btn[data-copied="true"] {
  background: #ecfdf5;
  color: var(--ok);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  width: min(760px, 100%);
  margin: 56px 0 0;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  background: var(--line-soft);
  overflow: hidden;
}

.stat {
  padding: 22px 12px;
  background: #fff;
}

.stat-value {
  display: block;
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.stat-label {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

/* Sections ----------------------------------------------------------------- */

.section {
  padding: 88px 0;
}

.section-tight {
  padding: 56px 0 24px;
}

.section-soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-head {
  max-width: 680px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

/* Ecosystem: model providers + agents -------------------------------------- */

.ecosystem {
  padding: 56px 0 64px;
  border-bottom: 1px solid var(--line-soft);
}

.eco-head {
  margin-bottom: 30px;
}

.eco-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eco-group {
  margin-top: 26px;
}

.eco-group + .eco-group {
  margin-top: 24px;
  padding-top: 26px;
  border-top: 1px dashed var(--line);
}

.eco-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eco-label::before,
.eco-label::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--line);
}

.eco-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eco-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease,
    color 0.15s ease;
}

.eco-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-xs);
  color: var(--ink);
  transform: translateY(-1px);
}

.eco-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-soft);
  flex: none;
}

.eco-logo img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.eco-name {
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .eco-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .eco-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .eco-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .ecosystem {
    padding: 44px 0 48px;
  }

  .eco-item {
    gap: 6px;
    padding: 6px 8px;
    font-size: 12.5px;
  }

  .eco-logo {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  .eco-logo img {
    width: 16px;
    height: 16px;
  }

  .eco-label::before,
  .eco-label::after {
    width: 18px;
  }
}

/* Routing ------------------------------------------------------------------ */

.routing-card {
  padding: 40px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.flow-node {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.flow-node.is-router {
  border-color: transparent;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px -6px rgba(15, 23, 42, 0.5);
}

.flow-node.is-response {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.flow-arrow {
  color: #cbd5e1;
  font-size: 15px;
}

.channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.channel {
  flex: 1 1 170px;
  max-width: 210px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.channel-name {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
}

.channel-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.channel-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-mute);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.channel.is-active {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.14);
}

.channel.is-active .channel-tag {
  background: #dbeafe;
  color: var(--accent-strong);
}

.channel.is-failed {
  opacity: 0.55;
}

.channel.is-failed .channel-tag {
  background: #fef2f2;
  color: #b91c1c;
}

.routing-note {
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.routing-note b {
  color: var(--ink);
  font-weight: 600;
}

/* Features ----------------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature {
  padding: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.feature:hover {
  border-color: #dbe1e8;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink);
}

.feature-icon svg {
  width: 18px;
  height: 18px;
}

.feature h3 {
  margin: 0 0 8px;
  font-size: 16.5px;
  font-weight: 650;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* Code window -------------------------------------------------------------- */

.code-window {
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid #1f2937;
  border-radius: 16px;
  background: #0b0f17;
  box-shadow: 0 24px 48px -24px rgba(2, 6, 23, 0.55);
  overflow: hidden;
}

.code-window-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid #1f2937;
  background: #0e1420;
}

.code-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.code-dot-r {
  background: #ef4444;
}

.code-dot-y {
  background: #f59e0b;
}

.code-dot-g {
  background: #10b981;
}

.code-file {
  margin-left: 8px;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 12px;
}

.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  margin-left: auto;
  padding: 0 10px;
  border: 1px solid #334155;
  border-radius: 7px;
  background: transparent;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.code-copy:hover {
  border-color: #475569;
  background: #1e293b;
  color: #fff;
}

.code-copy[data-copied="true"] {
  border-color: #065f46;
  color: #6ee7b7;
}

.code-body {
  margin: 0;
  padding: 22px;
  overflow-x: auto;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  tab-size: 2;
}

.code-body .tok-kw {
  color: #c084fc;
}

.code-body .tok-str {
  color: #86efac;
}

.code-body .tok-num {
  color: #fdba74;
}

.code-body .tok-com {
  color: #64748b;
}

/* Steps -------------------------------------------------------------------- */

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.step {
  padding: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.step h3 {
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 650;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* CTA ---------------------------------------------------------------------- */

.cta-panel {
  position: relative;
  padding: 64px 40px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 60% 90% at 50% 0%, rgba(37, 99, 235, 0.08), transparent 70%),
    var(--bg-soft);
  text-align: center;
  overflow: hidden;
}

.cta-panel h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cta-panel p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 900px) {
  .hero {
    padding: 64px 0 48px;
  }

  .section {
    padding: 64px 0;
  }

  .feature-grid,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .routing-card {
    padding: 26px 18px;
  }
}

@media (max-width: 720px) {
  .stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow {
    flex-direction: column;
    gap: 8px;
  }

  .flow-arrow {
    display: none;
  }

  .hero-endpoint {
    width: 100%;
    justify-content: space-between;
  }

  .hero-endpoint code {
    max-width: 60vw;
    font-size: 12px;
  }

  .cta-panel {
    padding: 44px 22px;
  }
}

@media (max-width: 420px) {
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

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