@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/* ── Tokens ── */
:root {
  --bg-deep:    #0a0810;
  --bg:         #0e0b16;
  --bg-surface: #161222;
  --bg-card:    #1c1730;
  --bg-card-hover: #231d3a;
  --brand:      #d8c0ff;
  --brand-light:#f0c7ff;
  --brand-dim:  #9f8bbb;
  --brand-glow: rgba(216, 192, 255, 0.12);
  --accent:     #8676a6;
  --accent-light: #a98ed8;
  --accent-dim: #51495f;
  --cyan:       #8edfff;
  --green:      #a9f0cb;
  --rose:       #ffb8da;
  --yellow:     #ffd080;
  --text:       #f4efff;
  --text-dim:   #aca3bf;
  --text-muted: #6d6580;
  --border:     #51495f;
  --border-light: #8676a6;
  --radius:     8px;
  --radius-lg:  16px;
  --font-display: 'JetBrains Mono', 'Menlo', monospace;
  --font-body:    'IBM Plex Sans', 'Helvetica Neue', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Menlo', monospace;
  --nav-h:      72px;
  --max-w:      1200px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Noise grain overlay ── */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Thread canvas ── */
.thread-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
  contain: strict;
}

/* ── Gradient mesh atmosphere ── */
.atmosphere {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  background:
    radial-gradient(ellipse 50% 40% at 15% 20%, rgba(140, 80, 200, 0.07) 0%, transparent 100%),
    radial-gradient(ellipse 40% 50% at 85% 30%, rgba(80, 60, 160, 0.06) 0%, transparent 100%),
    radial-gradient(ellipse 60% 30% at 50% 80%, rgba(100, 50, 180, 0.04) 0%, transparent 100%),
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(216, 192, 255, 0.03) 0%, transparent 60%);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-dim) var(--bg);
  width: 100%;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
  position: relative;
  overscroll-behavior-x: none;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-light); }

::selection { background: rgba(216, 192, 255, 0.3); color: var(--text); }

/* ── Labyrinth background ── */
.labyrinth-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  opacity: 0.06;
  overflow: hidden;
  contain: paint;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 79px, rgba(216, 192, 255, 0.5) 79px, rgba(216, 192, 255, 0.5) 80px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, rgba(216, 192, 255, 0.5) 79px, rgba(216, 192, 255, 0.5) 80px);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, black 0%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, black 0%, transparent 65%);
}

/* ── Vignette ── */
.vignette {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  contain: paint;
  opacity: 1;
  background:
    radial-gradient(ellipse 76% 64% at 50% 38%, transparent 18%, rgba(10, 8, 16, 0.24) 52%, rgba(10, 8, 16, 0.82) 100%),
    radial-gradient(ellipse 125% 96% at 50% 50%, transparent 34%, rgba(4, 3, 10, 0.56) 100%);
  box-shadow:
    inset 0 0 140px rgba(6, 5, 12, 0.34),
    inset 0 0 260px rgba(6, 5, 12, 0.24),
    inset 0 0 420px rgba(6, 5, 12, 0.18);
}

/* ── Nav ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
  background: rgba(7, 7, 14, 0.8);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo svg { width: 28px; height: 28px; }

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--brand);
  transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--brand); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-cta {
  padding: 0.5rem 1.2rem !important;
  border: 1px solid var(--brand-dim) !important;
  border-radius: var(--radius) !important;
  color: var(--brand) !important;
  font-family: var(--font-mono) !important;
  font-size: 0.78rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transition: all var(--transition) !important;
}

.nav-cta:hover {
  background: var(--brand-glow) !important;
  border-color: var(--brand) !important;
}

.nav-cta::after { display: none !important; }

/* Mobile menu */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-dim);
  margin: 5px 0;
  transition: all var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle { display: block; position: relative; z-index: 200; }
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 150;
    background: #0e0b16;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition), visibility var(--transition);
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }
  .nav-links a { font-size: 1.2rem; }
  .nav-links a::after { display: none; }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 2rem) 1.5rem 4rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  width: 700px;
  height: 700px;
  max-width: 100%;
  max-height: 100%;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.18;
  pointer-events: none;
  animation: glowPulse 8s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.14; transform: translateX(-50%) scale(1); }
  100% { opacity: 0.22; transform: translateX(-50%) scale(1.08); }
}

@keyframes glowDrift {
  0% { opacity: 0.08; transform: translate(0, 0); }
  100% { opacity: 0.14; transform: translate(-20px, 15px); }
}

.hero-glow--brand {
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--brand) 0%, rgba(140, 80, 200, 0.6) 50%, transparent 70%);
}

.hero-glow--purple {
  top: 35%;
  right: 5%;
  background: radial-gradient(circle, var(--accent-light) 0%, rgba(80, 50, 160, 0.5) 60%, transparent 70%);
  width: 500px;
  height: 500px;
  animation: glowDrift 10s ease-in-out infinite alternate;
}

/* Thread SVG decoration */
.hero-thread {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  max-width: 100%;
  height: 550px;
  opacity: 0.12;
  pointer-events: none;
}

.overflow-clamp {
  max-width: 100% !important;
  min-width: 0 !important;
}

.overflow-wrap-force {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

.hero-thread path {
  stroke: var(--brand);
  stroke-width: 1.2;
  fill: none;
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: drawThread 4s ease-out 0.5s forwards;
}

.hero-thread path:nth-child(2) {
  stroke: var(--accent-light);
  stroke-width: 0.8;
  opacity: 0.6;
  animation-delay: 1.2s;
}

@keyframes drawThread {
  to { stroke-dashoffset: 0; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 2rem;
  animation: fadeUp 0.8s ease-out both;
}

.hero-badge span { color: var(--brand); }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 1.2rem;
  text-transform: lowercase;
  animation: fadeUp 0.8s ease-out 0.1s both;
}

.hero h1 em {
  font-style: normal;
  color: var(--brand);
  font-weight: 400;
}

.hero-tagline {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-dim);
  font-weight: 300;
  max-width: 500px;
  margin-bottom: 3rem;
  animation: fadeUp 0.8s ease-out 0.2s both;
}

/* Install block */
.install-block {
  position: relative;
  width: 100%;
  max-width: 580px;
  min-width: 0;
  animation: fadeUp 0.8s ease-out 0.35s both;
}

.install-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}

.install-cmd {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-deep);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  overflow: hidden;
  transition: border-color var(--transition);
  min-width: 0;
}

.install-cmd::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, var(--brand-dim), transparent 40%, transparent 60%, var(--accent-dim));
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.install-cmd:hover::before { opacity: 1; }
.install-cmd:hover { border-color: transparent; }

.install-cmd .prompt {
  color: var(--brand-dim);
  margin-right: 0.6rem;
  font-family: var(--font-mono);
  user-select: none;
}

.install-cmd code {
  font-family: var(--font-mono);
  font-size: clamp(0.82rem, 1.8vw, 0.95rem);
  color: var(--text);
  flex: 1;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.install-copy {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.4rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 0.8rem;
}

.install-copy:hover {
  color: var(--brand);
  border-color: var(--brand-dim);
  background: var(--brand-glow);
}

.install-copy svg { width: 14px; height: 14px; }

.install-copy.copied {
  color: #5cb85c;
  border-color: #5cb85c;
}

/* Hero extras */
.hero-extras {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
  min-width: 0;
  animation: fadeUp 0.8s ease-out 0.5s both;
}

.hero-extras a {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.hero-extras a:hover { color: var(--brand); }
.hero-extras a svg { width: 16px; height: 16px; }

/* ── Section shared ── */
section {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem;
}

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--brand-dim);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.8rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 560px;
  font-weight: 300;
  margin-bottom: 3.5rem;
}

/* ── Divider ── */
.divider {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-light) 20%, var(--brand-dim) 50%, var(--border-light) 80%, transparent);
  opacity: 0.5;
}

/* ── Features ── */
.features-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feat {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: baseline;
}

.feat:first-child { border-top: 1px solid var(--border); }

.feat h3 {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.feat p {
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.6;
  font-weight: 300;
  max-width: 600px;
}

@media (max-width: 768px) {
  .feat {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 1.2rem 0;
  }
}

/* ── Language bar ── */
.lang-bar {
  margin-top: 4rem;
}

.lang-bar h3 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1.2rem;
}

.lang-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.lang-pill {
  padding: 0.45rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: all var(--transition);
}

.lang-pill:hover {
  border-color: var(--brand-dim);
  color: var(--brand);
  background: var(--brand-glow);
}

/* ── Docs page ── */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: calc(var(--nav-h) + 3rem);
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 4rem);
  overflow-y: auto;
  padding-right: 1rem;
}

.docs-sidebar h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 0.8rem;
  margin-top: 1.8rem;
}

.docs-sidebar h4:first-child { margin-top: 0; }

.docs-sidebar ul { list-style: none; }

.docs-sidebar li a {
  display: block;
  padding: 0.35rem 0.8rem;
  margin-left: -0.8rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  border-left: 2px solid transparent;
  transition: all var(--transition);
  border-radius: 0 4px 4px 0;
}

.docs-sidebar li a:hover {
  color: var(--text);
  border-left-color: var(--brand-dim);
  background: var(--brand-glow);
}

.docs-sidebar li a.active {
  color: var(--brand);
  border-left-color: var(--brand);
}

.docs-content {
  padding-bottom: 6rem;
  min-width: 0;
}

.docs-content h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.docs-content .doc-subtitle {
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.docs-content h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.docs-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.docs-content p {
  color: var(--text-dim);
  margin-bottom: 1rem;
  font-weight: 300;
  line-height: 1.7;
}

.docs-content ul,
.docs-content ol {
  margin: 0 0 1.2rem 1.2rem;
  color: var(--text-dim);
}

.docs-content li {
  margin-bottom: 0.45rem;
  line-height: 1.7;
}

.docs-content code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--brand-light);
  border: 1px solid var(--border);
}

.docs-content pre {
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin: 1.2rem 0;
  overflow-x: auto;
}

.docs-content pre code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}

.docs-callout {
  border-left: 3px solid var(--brand-dim);
  background: var(--brand-glow);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0;
}

.docs-callout p { color: var(--text); margin: 0; font-size: 0.9rem; }

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.docs-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}

.docs-card h3 {
  margin-top: 0;
}

.docs-card p:last-child,
.docs-card ul:last-child,
.docs-card pre:last-child {
  margin-bottom: 0;
}

.docs-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 1.5rem;
}

.docs-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-card);
  color: var(--brand-light);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.docs-table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  max-width: 100%;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.docs-table th,
.docs-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
}

.docs-table th {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.02);
}

.docs-table td {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.65;
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-kv {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
}

.docs-kv dt {
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.docs-kv dd {
  color: var(--text-dim);
  margin: 0;
}

/* ── SDK page ── */
.sdk-hero {
  text-align: center;
  padding-top: calc(var(--nav-h) + 4rem);
  padding-bottom: 3rem;
}

.sdk-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.2rem;
  max-width: var(--max-w);
  margin: 0 auto 4rem;
  min-width: 0;
}

.sdk-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--transition);
}

.sdk-card:hover {
  border-color: var(--brand-dim);
  background: var(--bg-card);
  transform: translateY(-2px);
}

.sdk-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sdk-card h3 .sdk-lang {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-light);
  background: rgba(107, 76, 154, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.sdk-card p {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 300;
  margin-bottom: 1.2rem;
}

.sdk-card .sdk-link {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.sdk-card .sdk-link svg { width: 14px; height: 14px; }

.sdk-endpoint {
  max-width: var(--max-w);
  margin: 0 auto 2rem;
}

.sdk-endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}

.sdk-method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.sdk-method--get { color: var(--green); background: rgba(169, 240, 203, 0.1); }
.sdk-method--post { color: var(--cyan); background: rgba(142, 223, 255, 0.1); }

.sdk-path {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
}

.sdk-endpoint p {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 300;
}

/* ── Contact page ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  max-width: var(--max-w);
  margin: 0 auto;
  min-width: 0;
}

.contact-info h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--text-dim);
  font-weight: 300;
  margin-bottom: 2rem;
  line-height: 1.7;
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-channel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
}

.contact-channel:hover {
  border-color: var(--brand-dim);
  background: var(--brand-glow);
}

.contact-channel-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
}

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

.contact-channel h4 { font-size: 0.92rem; font-weight: 600; }
.contact-channel p { font-size: 0.8rem; color: var(--text-dim); margin: 0; }

.contact-form {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
}

.contact-form h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1.2rem; }

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--brand-dim);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-submit {
  width: 100%;
  padding: 0.8rem;
  background: linear-gradient(135deg, var(--brand-dim), var(--brand));
  border: none;
  border-radius: var(--radius);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.form-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Footer ── */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--brand-dim);
}

.footer-right {
  display: flex;
  gap: 1.5rem;
}

.footer-right a {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-right a:hover { color: var(--text-dim); }

/* ── Terminal demo ── */
.term-window {
  width: 100%;
  max-width: 680px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-deep);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(216,192,255,0.04);
}

.term-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.7rem 1rem;
  background: rgba(22,18,34,0.6);
  border-bottom: 1px solid var(--border);
}

.term-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.term-dot--red { background: #ff5f57; }
.term-dot--yellow { background: #febc2e; }
.term-dot--green { background: #28c840; }

.term-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 36px;
}

.term-body {
  padding: 1.2rem 1.4rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  min-height: 320px;
  max-width: 100%;
}

.term-line {
  opacity: 0;
  transform: translateY(4px);
  white-space: pre;
}

.term-window.visible .term-line {
  animation: termReveal 0.3s ease-out forwards;
}

.term-line--1  { animation-delay: 0.3s !important; }
.term-line--2  { animation-delay: 0.6s !important; }
.term-line--3  { animation-delay: 0.9s !important; }
.term-line--4  { animation-delay: 1.0s !important; }
.term-line--5  { animation-delay: 1.1s !important; }
.term-line--6  { animation-delay: 1.2s !important; }
.term-line--7  { animation-delay: 1.3s !important; }
.term-line--8  { animation-delay: 1.5s !important; }
.term-line--9  { animation-delay: 1.8s !important; }
.term-line--10 { animation-delay: 2.4s !important; }
.term-line--11 { animation-delay: 2.8s !important; }
.term-line--12 { animation-delay: 3.4s !important; }
.term-line--13 { animation-delay: 3.6s !important; }
.term-line--14 { animation-delay: 3.9s !important; }
.term-line--15 { animation-delay: 4.5s !important; }
.term-line--16 { animation-delay: 4.9s !important; }
.term-line--17 { animation-delay: 5.2s !important; }
.term-line--18 { animation-delay: 5.6s !important; }

@keyframes termReveal {
  to { opacity: 1; transform: translateY(0); }
}

.term-prompt {
  color: var(--brand);
  margin-right: 0.5rem;
  user-select: none;
}

.term-typed {
  color: var(--text);
}

.term-line--dim {
  color: var(--text-muted);
  min-height: 1.7em;
}

.term-line--brand { color: var(--brand-dim); }
.term-line--cyan { color: var(--cyan); }
.term-line--green { color: var(--green); }

.term-line--pulse {
  animation-delay: 5.6s !important;
}

.term-window.visible .term-line--pulse {
  animation: termReveal 0.3s ease-out 5.6s forwards, termPulse 2s ease-in-out 6.2s infinite;
}

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

/* ── How it works ── */
.steps-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-top: 3rem;
}

.step {
  flex: 0 1 260px;
  text-align: center;
  padding: 0 1rem;
}

.step-num {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--brand-dim);
  width: 24px;
  height: 24px;
  border: 1px solid var(--brand-dim);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  color: var(--brand);
}

.step-icon svg { width: 100%; height: 100%; }

.step h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.step p {
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.6;
}

.step-arrow {
  flex-shrink: 0;
  width: 40px;
  color: var(--border-light);
  margin-top: 3.5rem;
}

.step-arrow svg { width: 100%; height: auto; }

@media (max-width: 768px) {
  .steps-row {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
  .step-arrow {
    transform: rotate(90deg);
    margin-top: 0;
  }
}

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
  }
  .contact-grid { grid-template-columns: 1fr; }
  .sdk-cards { grid-template-columns: 1fr; }
  .hero-extras { flex-direction: column; gap: 1rem; }
}

@media (max-width: 480px) {
  .install-cmd { flex-wrap: wrap; gap: 0.6rem; }
  .install-cmd code { font-size: 0.75rem; }
  .install-copy { margin-left: 0; width: 100%; justify-content: center; }
}

/* ── Mobile refinements ── */

/* Global overflow prevention */
html, body {
  overflow-x: hidden;
  overflow-x: clip;
  max-width: 100%;
  overscroll-behavior-x: none;
}

@media (max-width: 768px) {
  html, body {
    touch-action: pan-y pinch-zoom;
  }

  /* Terminal demo — prevent overflow */
  .term-body {
    font-size: 0.65rem;
    padding: 0.8rem 1rem 1rem;
    min-height: 260px;
    overflow-x: auto;
  }
  .term-window {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: var(--radius);
  }
  .term-title { display: none; }

  /* Steps — tighten spacing */
  .steps-row { gap: 0.5rem; margin-top: 2rem; }
  .step { flex: none; width: 100%; max-width: 320px; }
  .step-arrow { width: 24px; margin: -0.5rem 0; }

  /* Hero — tighten padding */
  .hero { padding-top: calc(var(--nav-h) + 1rem); padding-bottom: 2rem; min-height: auto; }
  .hero-badge { margin-bottom: 1.2rem; font-size: 0.72rem; }
  .hero-tagline { margin-bottom: 2rem; }
  .hero-glow { width: 300px; height: 300px; }
  .hero-thread { width: 400px; height: 250px; }

  /* Section spacing */
  section { padding: 3.5rem 1rem; }
  .section-title { font-size: clamp(1.3rem, 5vw, 1.8rem); }
  .section-desc { font-size: 0.92rem; margin-bottom: 2rem; }

  /* Footer wrap */
  .footer { padding: 2rem 1rem; }
  .footer-inner { flex-direction: column; text-align: center; gap: 1.5rem; }
  .footer-right { flex-wrap: wrap; justify-content: center; gap: 0.6rem 0.8rem; }
  .footer-right a { font-size: 0.75rem; }

  /* Nav logo size */
  .nav-logo { font-size: 1.3rem; }
  .nav-logo svg { width: 22px; height: 22px; }

  /* Feat rows on homepage */
  .feat { padding: 1rem 0; }

  /* ── Docs page mobile ── */
  .docs-layout {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
  }

  .docs-content {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Tables — scroll container instead of page overflow */
  .docs-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .docs-table { min-width: 480px; }

  /* Code blocks — scroll not overflow */
  .docs-content pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pinch-zoom;
    font-size: 0.78rem;
  }

  .docs-content pre code {
    font-size: 0.78rem;
    word-break: normal;
  }

  /* Inline code wrap */
  .docs-content code:not(pre code) {
    word-break: break-word;
  }

  /* Paragraphs and text overflow */
  .docs-content p,
  .docs-content li,
  .docs-content dd {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  /* Cards grid */
  .docs-card-grid {
    grid-template-columns: 1fr;
  }

  /* KV layout */
  .docs-kv {
    grid-template-columns: 1fr;
  }

  /* Chip list */
  .docs-chip {
    font-size: 0.65rem;
  }

  /* Callout */
  .docs-callout {
    margin-left: 0;
    margin-right: 0;
  }

  /* SDK cards */
  .sdk-endpoint-header {
    flex-wrap: wrap;
  }

  /* Contact grid */
  .contact-form {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  /* Terminal even smaller */
  .term-body { font-size: 0.58rem; }

  /* Install block overflow */
  .install-block { max-width: 100%; }
  .install-cmd code {
    word-break: break-all;
    white-space: normal;
  }

  /* Docs — tighter */
  .docs-content pre {
    max-width: 100%;
    padding: 0.8rem 1rem;
    font-size: 0.72rem;
  }
  .docs-content pre code { font-size: 0.72rem; }
  .docs-table { min-width: 400px; font-size: 0.82rem; }
  .docs-table th, .docs-table td { padding: 0.6rem 0.7rem; }
  .hero-thread { width: 320px; height: 220px; }
  .nav { padding-left: 1rem; padding-right: 1rem; }
}
