:root {
  --bg: #060914;
  --bg-2: #0c1223;
  --panel: #0f182d;
  --panel-2: #14203a;
  --ink: #edf4ff;
  --muted: #9fb2d4;
  --line: rgba(159, 178, 212, 0.22);
  --accent: #4fc3f7;
  --accent-2: #7c3aed;
  --brand-grad: linear-gradient(135deg, #4fc3f7 0%, #6366f1 55%, #818cf8 100%);
  --shadow: 0 20px 45px rgba(7, 11, 24, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 820px at 8% -20%, #1f2f63 0%, rgba(31, 47, 99, 0) 60%),
    radial-gradient(900px 600px at 90% 0%, #23285e 0%, rgba(35, 40, 94, 0) 60%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

.mesh-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(to right, rgba(79, 195, 247, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 195, 247, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  background: rgba(6, 9, 20, 0.72);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.brand span {
  letter-spacing: 0.02em;
  font-size: 1.02rem;
}

.nav {
  display: flex;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover {
  color: #d4e6ff;
}

.section {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: 1.2fr 0.8fr;
  padding: clamp(4rem, 7vw, 7rem) 0 2rem;
}

.eyebrow {
  margin: 0;
  font-family: "JetBrains Mono", monospace;
  color: var(--accent);
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

h1 {
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 1.05;
  margin: 0.8rem 0 1rem;
  max-width: 16ch;
}

.lead {
  font-size: clamp(1.03rem, 2.2vw, 1.3rem);
  max-width: 58ch;
  color: var(--muted);
}

.hero-panel {
  background: linear-gradient(160deg, rgba(20, 32, 58, 0.95) 0%, rgba(12, 18, 35, 0.92) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.hero-panel ul {
  margin: 0;
  padding-left: 1.2rem;
}

.hero-panel li {
  color: #c7d8f4;
  margin-top: 0.45rem;
}

.mini-flow {
  margin-top: 1rem;
  border: 1px solid rgba(79, 195, 247, 0.25);
  border-radius: 14px;
  padding: 0.75rem;
  background: rgba(7, 12, 26, 0.75);
}

.mini-flow__graph {
  position: relative;
  min-height: 180px;
  border-radius: 10px;
  border: 1px dashed rgba(159, 178, 212, 0.25);
  background: linear-gradient(180deg, rgba(19, 30, 56, 0.75), rgba(9, 14, 28, 0.82));
  overflow: hidden;
}

.mini-edges {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.mini-edge {
  fill: none;
  stroke: rgba(79, 195, 247, 0.9);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 6 8;
  animation: edgeDash 1.8s linear infinite;
}

.mini-edge:nth-child(2) { animation-delay: 0.25s; }
.mini-edge:nth-child(3) { animation-delay: 0.5s; }
.mini-edge:nth-child(4) { animation-delay: 0.75s; }

.rf-node {
  position: absolute;
  min-width: 98px;
  padding: 0.42rem 0.52rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(23, 38, 68, 0.95), rgba(16, 27, 50, 0.95));
  border: 1px solid rgba(159, 178, 212, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  animation: nodeFloat 2.6s ease-in-out infinite;
}

.rf-node strong {
  display: block;
  font-size: 0.63rem;
  line-height: 1.2;
  color: #ebf3ff;
  letter-spacing: 0.01em;
}

.rf-node small {
  display: block;
  margin-top: 0.2rem;
  color: #9ec3f5;
  font-size: 0.58rem;
  font-family: "JetBrains Mono", monospace;
}

.rf-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4fc3f7;
}

.rf-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4fc3f7;
  border: 1px solid rgba(7, 12, 26, 0.8);
}

.rf-handle--out {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.rf-handle--in {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.rf-node--dotnet { left: 10px; top: 6px; animation-delay: 0s; border-left: 4px solid #512bd4; }
.rf-node--node { left: 10px; top: 56px; animation-delay: 0.25s; border-left: 4px solid #3c873a; }
.rf-node--go { left: 10px; top: 108px; animation-delay: 0.5s; border-left: 4px solid #00acd7; }
.rf-node--python { left: 126px; top: 124px; animation-delay: 0.75s; border-left: 4px solid #3776ab; }

.rf-node--ai {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  min-width: 116px;
  border: 1px solid rgba(129, 140, 248, 0.6);
  border-left: 4px solid #818cf8;
  background: linear-gradient(180deg, rgba(51, 58, 120, 0.92), rgba(33, 38, 84, 0.95));
  box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.45), 0 8px 20px rgba(0, 0, 0, 0.3);
  animation: aiGlow 2s ease-out infinite;
}

.mini-flow__code {
  margin-top: 0.55rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  border: 1px solid rgba(159, 178, 212, 0.22);
  border-radius: 9px;
  padding: 0.5rem 0.58rem;
  background: rgba(11, 17, 32, 0.86);
}

.mini-flow__code p {
  margin: 0.2rem 0;
  color: #d2e1fb;
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid rgba(79, 195, 247, 0.85);
  animation: lineType 3.2s steps(32, end) infinite;
}

.mini-flow__code p:nth-child(2) { animation-delay: 0.5s; }
.mini-flow__code p:nth-child(3) { animation-delay: 0.9s; }
.mini-flow__code p:nth-child(4) { animation-delay: 1.3s; }

.mini-flow__code .mini-ok {
  color: #62e6a4;
}

.mini-flow__install {
  margin-top: 0.7rem;
  width: 100%;
  justify-content: center;
  display: inline-flex;
  font-size: 0.85rem;
  padding: 0.62rem 0.95rem;
}

@keyframes nodeFloat {
  0%,
  100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes edgeDash {
  to { stroke-dashoffset: -28; }
}

@keyframes aiGlow {
  0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.4); }
  70% { box-shadow: 0 0 0 14px rgba(129, 140, 248, 0); }
  100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
}

@keyframes lineType {
  0% { width: 0; opacity: 0.7; }
  40% { width: 100%; opacity: 1; }
  80% { width: 100%; opacity: 1; }
  100% { width: 0; opacity: 0.7; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.btn {
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  background: var(--brand-grad);
  color: #ecf6ff;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-ghost {
  background: rgba(6, 9, 20, 0.2);
  border-color: rgba(79, 195, 247, 0.4);
  color: #cae8ff;
  box-shadow: none;
}

.btn-ghost:hover {
  background: rgba(79, 195, 247, 0.12);
}

.cards {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(175deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 0.55rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

.stacks {
  margin-top: 4rem;
}

.stacks h2 {
  margin-bottom: 0.35rem;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.stack-grid span {
  background: rgba(20, 32, 58, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #dbe8fc;
  font-size: 0.92rem;
}

.stack-grid i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--c);
}

.protocols {
  margin-top: 1rem;
  color: var(--muted);
}

.use-cases {
  margin-top: 4rem;
}

.use-cases h2,
.faq h2 {
  font-size: clamp(1.7rem, 4vw, 2.8rem);
  margin: 0 0 1rem;
}

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

.use {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: #eff4ff;
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid var(--line);
}

.use h3 {
  margin-top: 0;
  margin: 0.5rem 0;
}

.use p {
  margin: 0;
  color: #c2d1ef;
}

.language-strip {
  margin-top: 4rem;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 18px;
  padding: 1rem 1.2rem;
  background: linear-gradient(90deg, rgba(79, 195, 247, 0.12), rgba(124, 58, 237, 0.14));
}

.language-strip h2 {
  margin: 0;
}

.language-strip p {
  margin-bottom: 0;
  color: #d4e5ff;
}

.faq {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

details {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin-top: 0.85rem;
}

summary {
  font-weight: 700;
  cursor: pointer;
}

details p {
  color: #ccdcf8;
  margin: 0.6rem 0 0;
}

.footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem clamp(1rem, 4vw, 3rem) 2.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
}

.footer p {
  margin: 0;
}

.footer a {
  color: #8bc8ff;
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.85rem;
}

/* ─── Diagram showcase ─── */

.diagram-showcase {
  margin-top: 4rem;
}

.diagram-showcase h2 {
  margin-bottom: 0.3rem;
}

.diagram-showcase > .lead {
  color: var(--muted);
  margin-bottom: 0;
}

.diagram-wrap {
  position: relative;
  margin-top: 1.5rem;
  border: 1px solid rgba(79, 195, 247, 0.15);
  border-radius: 18px;
  background: linear-gradient(170deg, rgba(15, 24, 45, 0.96), rgba(9, 14, 28, 0.98));
  padding: 1.5rem 1.2rem 1rem;
  overflow: hidden;
  box-shadow: 0 0 80px -20px rgba(79, 195, 247, 0.08), var(--shadow);
}

.diagram-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(79, 195, 247, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(79, 195, 247, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  border-radius: 18px;
  pointer-events: none;
}

.diagram-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 12 / 5;
}

.diagram-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 800ms ease 400ms;
}

.diagram-wrap.in-view .diagram-svg {
  opacity: 1;
}

.dg-edge {
  stroke-width: 2.2;
  stroke-linecap: round;
  fill: none;
}

.dg-edge--rest {
  stroke: rgba(79, 195, 247, 0.65);
  stroke-dasharray: 8 6;
  animation: dgFlow 1.6s linear infinite;
}

.dg-edge--grpc {
  stroke: rgba(167, 139, 250, 0.65);
  stroke-dasharray: 8 6;
  animation: dgFlow 1.6s linear infinite;
  animation-delay: 0.3s;
}

.dg-edge--kafka {
  stroke: rgba(245, 158, 11, 0.65);
  stroke-dasharray: 12 8;
  animation: dgFlow 2s linear infinite;
  animation-delay: 0.6s;
}

@keyframes dgFlow {
  to {
    stroke-dashoffset: -28;
  }
}

.dg-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  fill-opacity: 0.5;
}

.dg-label--rest {
  fill: #4fc3f7;
}

.dg-label--grpc {
  fill: #a78bfa;
}

.dg-label--kafka {
  fill: #f59e0b;
}

.dg-node {
  position: absolute;
  padding: 7px 10px 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(23, 38, 68, 0.95), rgba(16, 27, 50, 0.95));
  border: 1px solid rgba(159, 178, 212, 0.22);
  border-left: 3px solid var(--nc);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  z-index: 2;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity 420ms ease, transform 420ms ease;
}

.diagram-wrap.in-view .dg-node {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: dgNodeFloat 3.5s ease-in-out infinite;
}

@keyframes dgNodeFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

.dg-head {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nc);
  flex-shrink: 0;
  box-shadow: 0 0 6px 1px var(--nc);
}

.dg-head strong {
  font-size: 0.66rem;
  color: #e8f2ff;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-type {
  display: block;
  font-size: 0.56rem;
  color: #8eb4e0;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 1px;
}

.dg-ep {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.54rem;
  color: #c2d6f0;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dg-badge {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.dg-badge--get {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.dg-badge--post {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.dg-badge--grpc {
  background: rgba(167, 139, 250, 0.2);
  color: #a78bfa;
}

.dg-badge--kafka {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.dg-handle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nc);
  border: 1.5px solid rgba(9, 14, 28, 0.8);
}

.dg-handle--l {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.dg-handle--r {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
}

.dg-handle--b {
  left: 50%;
  bottom: -5px;
  top: auto;
  transform: translateX(-50%);
}

.dg-handle--t {
  left: 50%;
  top: -5px;
  transform: translateX(-50%);
}

.diagram-legend {
  display: flex;
  gap: 1.2rem;
  margin-top: 0.8rem;
  justify-content: center;
}

.dg-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.dg-legend i {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.dg-legend--rest i {
  background: #4fc3f7;
}

.dg-legend--grpc i {
  background: #a78bfa;
}

.dg-legend--kafka i {
  background: #f59e0b;
}

.diagram-download {
  margin-top: 1.5rem;
  text-align: center;
}

.diagram-download p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ─── Tutorial video ─── */

.tutorial-video {
  margin-top: 4rem;
  text-align: center;
}

.tutorial-video h2 {
  margin-bottom: 0.3rem;
}

.tutorial-video > p {
  color: var(--muted);
  margin-bottom: 0;
}

.video-wrap {
  position: relative;
  margin-top: 1.5rem;
  width: 100%;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(79, 195, 247, 0.2);
  box-shadow: 0 0 60px -15px rgba(79, 195, 247, 0.1), var(--shadow);
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Install choice modal */

body.install-modal-open {
  overflow: hidden;
}

.install-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.install-modal[hidden] {
  display: none;
}

.install-modal__backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 22% 15%, rgba(79, 195, 247, 0.12), rgba(6, 9, 20, 0.58) 48%), rgba(6, 9, 20, 0.42);
  backdrop-filter: blur(4px);
}

.install-modal__card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  border-radius: 20px;
  border: 1px solid rgba(79, 195, 247, 0.34);
  padding: 1.3rem 1.25rem 1.15rem;
  background:
    linear-gradient(145deg, rgba(20, 32, 58, 0.95), rgba(11, 16, 33, 0.96)),
    radial-gradient(circle at 85% 12%, rgba(124, 58, 237, 0.28), transparent 45%);
  box-shadow: 0 24px 60px rgba(2, 6, 20, 0.65), 0 0 0 1px rgba(159, 178, 212, 0.08);
  animation: installModalEnter 220ms ease-out;
}

@keyframes installModalEnter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.install-modal__close {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  border: 1px solid rgba(159, 178, 212, 0.3);
  background: rgba(9, 14, 28, 0.7);
  color: #d8e9ff;
  border-radius: 999px;
  padding: 0.33rem 0.7rem;
  font-size: 0.76rem;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
}

.install-modal__close:hover {
  background: rgba(79, 195, 247, 0.15);
}

.install-modal__eyebrow {
  margin: 0;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #9ec3f5;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
}

.install-modal h3 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  line-height: 1.2;
}

.install-modal p {
  margin: 0.62rem 0 0;
  color: #bed2f3;
}

.install-modal__actions {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.install-modal__btn {
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 46px;
}

.install-modal__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.install-modal__btn span {
  line-height: 1;
}

/* ─── Reveal animation ─── */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .nav {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .mini-flow__graph {
    min-height: 190px;
  }

  .rf-node {
    min-width: 90px;
  }

  .rf-node--dotnet { left: 8px; top: 6px; }
  .rf-node--node { left: 8px; top: 54px; }
  .rf-node--go { left: 8px; top: 102px; }
  .rf-node--python { left: 108px; top: 122px; }
  .rf-node--ai { right: 8px; }

  .cards,
  .use-grid,
  .stack-grid {
    grid-template-columns: 1fr;
  }

  .diagram-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .diagram-canvas {
    min-width: 860px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .install-modal__card {
    padding-top: 2.4rem;
  }

  .install-modal__actions {
    grid-template-columns: 1fr;
  }
}
