:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #0f1624;
  --text: #e8eefc;
  --muted: #9aa7bd;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --border: #1f2937;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #edf2ff;
    --panel: #ffffff;
    --text: #0f172a;
    --muted: #475569;
    --border: #cbd5e1;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(59, 130, 246, 0.25), transparent),
              radial-gradient(900px 500px at 90% 0%, rgba(34, 211, 238, 0.18), transparent),
              var(--bg);
  color: var(--text);
  line-height: 1.6;
}
.card, .downloads a, .btn { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.hero {
  padding: 24px 20px 72px;
  border-bottom: 1px solid var(--border);
}

.nav {
  max-width: 1040px;
  margin: 0 auto 40px;
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: rgba(7, 11, 18, 0.5);
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-right: auto;
  color: #c7d2fe;
}

.nav a {
  padding: 7px 10px;
  border-radius: 8px;
}

.nav a:hover {
  background: rgba(30, 41, 59, 0.65);
  text-decoration: none;
}

.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  animation: rise .5s ease-out;
}

.pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 22, 36, 0.8);
  font-size: 0.85rem;
  color: var(--muted);
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 16px 0 12px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}

.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #031525;
  box-shadow: 0 8px 20px rgba(59,130,246,.35);
}

.btn.ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(15, 22, 36, 0.65);
}

.section {
  max-width: 1040px;
  margin: 0 auto;
  padding: 56px 20px;
}

.section.alt {
  background: rgba(15, 22, 36, 0.55);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}
.card:hover { transform: translateY(-2px); border-color: rgba(59,130,246,.45); }

.icon-card .icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(59,130,246,.15);
  margin-bottom: 10px;
  position: relative;
}
.icon-shield::before,
.icon-bolt::before,
.icon-sync::before {
  content: "";
  position: absolute;
  inset: 9px;
  background: linear-gradient(140deg, #60a5fa, #22d3ee);
}
.icon-shield::before {
  clip-path: polygon(50% 0, 95% 20%, 85% 78%, 50% 100%, 15% 78%, 5% 20%);
}
.icon-bolt::before {
  clip-path: polygon(58% 0, 25% 52%, 52% 52%, 38% 100%, 80% 40%, 52% 40%);
}
.icon-sync::before {
  border-radius: 50%;
  clip-path: polygon(50% 10%, 80% 25%, 82% 42%, 69% 38%, 60% 28%, 50% 26%, 40% 28%, 31% 38%, 18% 42%, 20% 25%);
}

.trust {
  padding-top: 24px;
  padding-bottom: 10px;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.trust-item {
  background: rgba(15,22,36,.55);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: .92rem;
  color: var(--muted);
}

.trust-item span {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-right: 8px;
}

.topology-preview {
  margin-top: 18px;
  position: relative;
}

.topology-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.topo-btn {
  border: 1px solid var(--border);
  background: rgba(15,22,36,.6);
  color: var(--muted);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: .85rem;
  cursor: pointer;
}

.topo-btn.active {
  color: #dbeafe;
  border-color: #60a5fa;
  background: rgba(59,130,246,.2);
}

.traffic-line {
  stroke-dasharray: 7 5;
  animation: flow 1.1s linear infinite;
}

.topo-node {
  cursor: pointer;
  transition: transform .15s ease;
}

.topo-node:hover,
.topo-node.selected {
  transform: scale(1.3);
}

.topology-tooltip {
  position: absolute;
  display: none;
  max-width: 260px;
  z-index: 5;
  pointer-events: none;
  font-size: .78rem;
  line-height: 1.4;
  color: #e2e8f0;
  background: rgba(2,6,23,.95);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
}

.topology-tooltip.show {
  display: block;
}

.topology-detail {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(2,6,23,.5);
}

.topology-detail h4 {
  margin: 0 0 4px;
  color: #e2e8f0;
  font-size: .92rem;
}

.topology-detail p {
  margin: 0;
  font-size: .82rem;
  color: #94a3b8;
}

@media print {
  body * {
    visibility: hidden;
  }
  .topology-preview, .topology-preview * {
    visibility: visible;
  }
  .topology-preview {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: 1px solid #94a3b8;
    background: #fff;
    color: #111827;
  }
  .topology-tooltip,
  .topology-controls {
    display: none !important;
  }
}

.muted { color: var(--muted); }

.downloads {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
}

.downloads a {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1220;
  transition: transform .15s ease, border-color .15s ease;
}

.downloads a:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.5);
  text-decoration: none;
}

.fineprint {
  font-size: 0.85rem;
  color: var(--muted);
}

.footer {
  text-align: center;
  padding: 32px 16px 48px;
  color: var(--muted);
  font-size: 0.9rem;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes flow {
  to { stroke-dashoffset: -12; }
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}
