@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0f0a1a;
  --bg-soft: #17102b;
  --surface: #1e1533;
  --surface-2: #241a3f;
  --border: #362a56;
  --text: #ece7f7;
  --text-dim: #b7abd6;
  --text-faint: #8a7db0;
  --purple: #a855f7;
  --purple-bright: #c084fc;
  --purple-deep: #7c3aed;
  --purple-glow: rgba(168, 85, 247, 0.35);
  --radius: 14px;
  --maxw: 1080px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body { font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 50% -10%, rgba(124, 58, 237, 0.25), transparent 70%),
    radial-gradient(800px 400px at 90% 10%, rgba(168, 85, 247, 0.12), transparent 60%);
  background-attachment: fixed;
}

/* Neural-network background canvas: fixed, behind all content. */
#neural-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

/* Keep page chrome and content above the canvas. */
header, main, footer { position: relative; z-index: 1; }

a { color: var(--purple-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* Nav */
header {
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(15, 10, 26, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; color: var(--text); }
.brand:hover { text-decoration: none; }
.logo-badge {
  width: 34px; height: 34px; border-radius: 8px;
  object-fit: contain; display: block;
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--purple-bright); }

/* GitHub icon link */
.nav-links a.icon-link { display: inline-flex; align-items: center; }
.nav-links a.icon-link svg { width: 22px; height: 22px; display: block; fill: currentColor; }
.nav-links a.icon-link:hover { color: var(--purple-bright); }

/* Hero */
.hero { text-align: center; padding: 96px 0 64px; }
.hero-logo {
  width: 160px; height: 160px; margin: 0 auto 28px; display: block;
  object-fit: contain;  border-radius: 20px; padding: 10px;
}
.eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--purple-bright); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; margin-bottom: 26px; background: var(--surface);
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px); line-height: 1.08; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, var(--purple-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  max-width: 900px; margin: 0 auto 22px;
}
.hero p.lead { color: var(--text-dim); font-size: clamp(16px, 2.2vw, 20px); max-width: 680px; margin: 0 auto 34px; }
.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  padding: 12px 22px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple-deep), var(--purple)); color: #fff;
  box-shadow: 0 8px 30px var(--purple-glow);
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { text-decoration: none; border-color: var(--purple); }

/* Sections */
section.block { padding: 56px 0; }
.section-title { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--purple-bright); margin-bottom: 12px; }
.section-lead { color: var(--text-dim); max-width: 720px; }

.synopsis {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px; margin-top: 20px;
}
.synopsis p { color: var(--text-dim); margin-bottom: 14px; }
.synopsis strong { color: var(--text); }

/* Grid cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 26px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--purple); transform: translateY(-2px); }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { color: var(--text-faint); font-size: 14px; }

/* Code block */
.code {
  background: #0b0716; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px; color: var(--text); overflow-x: auto; margin-top: 18px;
}
.code .c { color: var(--text-faint); }
.code .p { color: var(--purple-bright); }

/* Workflow */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 24px; }
.step {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.step .cmd { color: var(--purple-bright); font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 600; }
.step .desc { color: var(--text-faint); font-size: 13px; margin-top: 8px; }
.step .num { color: var(--purple-deep); font-weight: 800; font-size: 12px; letter-spacing: .1em; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.chip {
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; color: var(--text-dim);
}
.chip.accent { border-color: var(--purple); color: var(--purple-bright); }

/* Footer */
footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; color: var(--text-faint); font-size: 14px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.foot a { color: var(--text-dim); }

/* ─── Doc pages ─────────────────────────────────────────────── */
.doc { padding: 56px 0 24px; }
.doc-head { margin-bottom: 8px; }
.doc-head .kicker { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--purple-bright); }
.doc h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.02em; margin: 10px 0 16px; }
.doc .subtitle { color: var(--text-dim); font-size: 18px; margin-bottom: 8px; }

.doc-body { padding-bottom: 60px; }
.doc-body h2 {
  font-size: 24px; font-weight: 700; margin: 44px 0 14px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.doc-body h2:first-child { border-top: none; padding-top: 0; margin-top: 12px; }
.doc-body h3 { font-size: 18px; font-weight: 600; margin: 26px 0 10px; color: var(--text); }
.doc-body p { color: var(--text-dim); margin: 12px 0; }
.doc-body ul, .doc-body ol { color: var(--text-dim); margin: 12px 0 12px 22px; }
.doc-body li { margin: 6px 0; }
.doc-body strong { color: var(--text); }
.doc-body a { color: var(--purple-bright); }

.doc-body code {
  background: #0b0716; border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; color: var(--purple-bright);
}
.doc-body pre {
  background: #0b0716; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; margin: 18px 0;
}
.doc-body pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 13.5px; }

.doc-body table {
  width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.doc-body th, .doc-body td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.doc-body th { color: var(--purple-bright); font-weight: 600; background: var(--surface-2); }
.doc-body tr:last-child td { border-bottom: none; }
.doc-body td code { white-space: nowrap; }

.callout {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--purple);
  border-radius: 10px; padding: 16px 20px; margin: 20px 0; color: var(--text-dim);
}
.callout strong { color: var(--text); }

.next-links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.next-links a {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 18px; font-size: 14px; color: var(--text);
}
.next-links a:hover { border-color: var(--purple); text-decoration: none; }

/* ─── Responsive ────────────────────────────────────────────── */

/* Prevent long tokens (URLs, package names) from forcing horizontal scroll. */
.doc-body p, .doc-body li, .synopsis p { overflow-wrap: anywhere; }

/* Tablet and below */
@media (max-width: 860px) {
  .wrap { padding: 0 20px; }

  .nav { height: auto; min-height: 60px; padding: 10px 0; flex-wrap: wrap; gap: 10px 18px; }
  .nav-links { gap: 16px; flex-wrap: wrap; }

  .hero { padding: 64px 0 48px; }
  .hero-logo { width: 120px; height: 120px; margin-bottom: 22px; }

  section.block { padding: 44px 0; }
  .doc { padding: 40px 0 20px; }

  .synopsis { padding: 26px; }

  /* Single-column stacks read better than cramped multi-column on tablets. */
  .grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .flow { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
}

/* Phones */
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }

  /* Brand stays left; links wrap to their own row and can scroll if needed. */
  .nav { flex-direction: column; align-items: flex-start; }
  .nav-links {
    width: 100%;
    gap: 14px 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .nav-links a { white-space: nowrap; }

  .hero { padding: 48px 0 40px; }
  .hero-logo { width: 96px; height: 96px; margin-bottom: 18px; }
  .eyebrow { margin-bottom: 20px; }

  /* Full-width, comfortably tappable CTAs. */
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; width: 100%; padding: 13px 18px; }

  section.block { padding: 36px 0; }
  .synopsis { padding: 20px; }

  .grid, .flow { grid-template-columns: 1fr; }

  .code, .doc-body pre { padding: 14px 16px; font-size: 13px; }

  .doc { padding: 32px 0 16px; }
  .doc-body h2 { margin: 34px 0 12px; font-size: 22px; }

  /* Footer stacks its two halves. */
  .foot { flex-direction: column; gap: 12px; }
  .next-links { flex-direction: column; }
  .next-links a { text-align: center; }

  /* Let wide tables scroll horizontally instead of breaking the layout. */
  .doc-body table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Respect users who prefer less motion: soften transitions site-wide. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
