/* ===== 1. TOKENS ===== */
:root {
  --bg: #070b16;
  --panel: #0e1630;
  --panel2: #121d3f;
  --ink: #e6edff;
  --muted: #9aa9cc;
  --line: #1f2d57;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --lime: #a3e635;
  --glow: 0 0 24px rgba(34, 211, 238, 0.25);
}
/* ===== 2. BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  font:
    17px/1.7 "Inter",
    system-ui,
    sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}
h1,
h2,
h3 {
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(2.3rem, 6vw, 4rem);
}
h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}
h3 {
  font-size: 1.15rem;
}
.sub {
  margin-top: 36px;
  color: var(--cyan);
}
p {
  margin: 0 0 1em;
  max-width: 68ch;
}
a {
  color: var(--cyan);
}
:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}
section {
  padding: 70px 0;
  border-top: 1px solid var(--line);
}
.code-tag {
  font-family: "JetBrains Mono", monospace;
  color: var(--lime);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.glow {
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* ===== 3. NAV ===== */
nav.top {
  background: rgba(7, 11, 22, 0.9);
  padding: 14px 0;
}
nav.top .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
}
.brand span {
  color: var(--lime);
}
nav.top ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
nav.top a {
  color: var(--ink);
  text-decoration: none;
}
nav.top a:hover {
  color: var(--cyan);
}
/* ===== 4. HERO ===== */
.hero {
  padding: 70px 0 80px;
  text-align: center;
}
.hero p {
  margin-left: auto;
  margin-right: auto;
}
.lead {
  font-size: 1.2rem;
  color: var(--muted);
}
.btn {
  display: inline-block;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  color: #050914;
  font-weight: 700;
  padding: 13px 24px;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: var(--glow);
}
.btn:hover {
  filter: brightness(1.12);
}
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--cyan);
  box-shadow: none;
  margin-left: 10px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 44px;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}
.stat b {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
  color: var(--cyan);
}
/* ===== 5. CARDS ===== */
.grid,
.two {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}
.grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.two {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: var(--glow);
}
.card p {
  margin: 0;
  font-size: 0.97rem;
  color: var(--muted);
}
.card b {
  color: var(--ink);
}
.card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
.card li {
  margin-bottom: 0.5em;
}
.tag {
  display: inline-block;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  color: var(--violet);
  background: rgba(139, 92, 246, 0.15);
  padding: 2px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.callout {
  background: var(--panel2);
  border-left: 4px solid var(--lime);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  margin: 24px 0;
  max-width: 72ch;
}
.callout p {
  margin: 0;
}
/* ===== 6. PIPELINE ===== */
ol.pipe {
  list-style: none;
  counter-reset: p;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  padding: 0;
  margin: 26px 0;
}
ol.pipe li {
  counter-increment: p;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 3px solid var(--cyan);
  border-radius: 12px;
  padding: 16px;
}
ol.pipe li::before {
  content: "0" counter(p);
  font-family: "JetBrains Mono", monospace;
  color: var(--lime);
  font-size: 0.85rem;
}
ol.pipe b {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  color: var(--cyan);
}
ol.pipe span {
  font-size: 0.93rem;
  color: var(--muted);
}
/* ===== 7. TABLE, CODE, DL, FAQ ===== */
.scroll {
  overflow-x: auto;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  font-size: 0.95rem;
}
th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--lime);
  background: var(--panel2);
}
td:first-child {
  color: var(--cyan);
  font-weight: 600;
}
td {
  color: var(--muted);
}
tr:last-child td {
  border-bottom: 0;
}
tr:hover td {
  background: rgba(34, 211, 238, 0.05);
}
pre.code {
  background: #03060f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  color: var(--lime);
  margin: 18px 0;
}
dl {
  display: grid;
  grid-template-columns: minmax(130px, 210px) 1fr;
  gap: 12px 22px;
  margin: 20px 0 0;
}
dt {
  font-family: "JetBrains Mono", monospace;
  color: var(--cyan);
  font-size: 0.92rem;
}
dd {
  margin: 0;
  color: var(--muted);
}
@media (max-width: 560px) {
  dl {
    grid-template-columns: 1fr;
  }
  dd {
    margin-bottom: 8px;
  }
  .btn.ghost {
    margin: 10px 0 0;
  }
}
details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
details[open] {
  border-color: var(--violet);
}
summary {
  cursor: pointer;
  font-weight: 600;
}
details p {
  margin: 10px 0 0;
  color: var(--muted);
}
/* ===== 8. FOOTER ===== */
footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 44px;
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.82rem;
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ===== 9. AI ASSISTANT DEMO ANIMATION (hero) ===== */
.tool-demo {
  position: relative;
  width: min(420px, 92%);
  margin: 0 auto 30px;
  text-align: left;
}
.td-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  padding: 10px 14px;
}
.td-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet);
}
.td-bar i:nth-child(2) {
  background: var(--cyan);
}
.td-bar i:nth-child(3) {
  background: var(--lime);
}
.td-bar span {
  margin-left: 8px;
  font:
    700 0.75rem "JetBrains Mono",
    ui-monospace,
    monospace;
  color: var(--muted);
}
.td-body {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  padding: 18px 16px;
  display: grid;
  gap: 12px;
  min-height: 150px;
  box-shadow: var(--glow);
}
.td-msg {
  max-width: 86%;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.td-msg.user {
  justify-self: end;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  color: #050914;
  font-weight: 600;
  animation: tdUser 9s ease-in-out infinite;
}
.td-msg.bot {
  justify-self: start;
  background: var(--panel2);
  border: 1px solid var(--line);
  min-width: 210px;
  position: relative;
  min-height: 74px;
}
.td-dots {
  position: absolute;
  left: 14px;
  top: 14px;
  display: flex;
  gap: 5px;
  animation: tdDots 9s ease-in-out infinite;
}
.td-dots b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: tdBounce 0.9s ease-in-out infinite;
}
.td-dots b:nth-child(2) {
  animation-delay: 0.15s;
}
.td-dots b:nth-child(3) {
  animation-delay: 0.3s;
}
.td-lines {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}
.td-lines u {
  display: block;
  height: 9px;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform-origin: left;
  transform: scaleX(0);
  animation: tdLine 9s ease-in-out infinite;
}
.td-lines u:nth-child(1) {
  width: 100%;
}
.td-lines u:nth-child(2) {
  width: 82%;
  animation-delay: 0.25s;
}
.td-lines u:nth-child(3) {
  width: 58%;
  animation-delay: 0.5s;
}
.td-chip {
  position: absolute;
  font:
    700 0.72rem "JetBrains Mono",
    ui-monospace,
    monospace;
  color: var(--cyan);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  animation: tdFloat 4s ease-in-out infinite;
}
.t1 {
  top: -14px;
  left: -22px;
}
.t2 {
  top: 34px;
  right: -26px;
  color: var(--violet);
  animation-delay: -1s;
}
.t3 {
  bottom: 30px;
  left: -30px;
  color: var(--lime);
  animation-delay: -2s;
}
.t4 {
  bottom: -14px;
  right: -14px;
  animation-delay: -3s;
}
@keyframes tdUser {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  6%,
  92% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}
@keyframes tdDots {
  0%,
  10% {
    opacity: 0;
  }
  14%,
  34% {
    opacity: 1;
  }
  38%,
  100% {
    opacity: 0;
  }
}
@keyframes tdLine {
  0%,
  38% {
    transform: scaleX(0);
  }
  50%,
  90% {
    transform: scaleX(1);
  }
  98%,
  100% {
    transform: scaleX(0);
  }
}
@keyframes tdBounce {
  50% {
    transform: translateY(-5px);
    opacity: 0.5;
  }
}
@keyframes tdFloat {
  50% {
    transform: translateY(-8px);
  }
}
@media (max-width: 480px) {
  .t1 {
    left: -6px;
  }
  .t2 {
    right: -6px;
  }
  .t3 {
    left: -6px;
  }
  .t4 {
    right: -4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .td-msg.user,
  .td-dots,
  .td-dots b,
  .td-lines u,
  .td-chip {
    animation: none !important;
  }
  .td-lines u {
    transform: none;
  }
  .td-dots {
    display: none;
  }
}
