:root {
  --bg: #0b0e10;
  --surface: #14181b;
  --surface-2: #1b2023;
  --border: #262c30;
  --text: #ecefea;
  --text-muted: #8b9298;
  --accent: #EB6100;
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --signal-up: #3ddc84;
  --signal-down: #e5484d;
  --content-w: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.mono { font-family: "IBM Plex Mono", monospace; }

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.eyebrow::before {
  content: "";
  width: 0.5em;
  height: 0.5em;
  background: var(--accent);
  border-radius: 1px;
  display: inline-block;
}

a { color: inherit; }

.wrap {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Nav */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
header.nav .wrap {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand-mark {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
}
.brand-mark .dot { color: var(--accent); }
nav.links {
  display: flex;
  gap: 1.75rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
nav.links a {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}
nav.links a:hover, nav.links a:focus-visible {
  color: var(--text);
  border-color: var(--accent);
}
nav.links a[aria-current="page"] { color: var(--text); border-color: var(--accent); }

section { scroll-margin-top: 80px; }

/* Hero */
.hero { padding: 5.5rem 0 4rem; border-bottom: 1px solid var(--border); }
.hero h1 {
  font-size: clamp(2.2rem, 4.2vw + 1rem, 3.6rem);
  max-width: 16ch;
  margin: 1rem 0 1.25rem;
}
.hero p.lede { max-width: 56ch; color: var(--text-muted); font-size: 1.1rem; margin: 0 0 2rem; }
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 3.5rem; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  border-radius: 3px;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #14181b; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-muted); }

/* Topology panel — signature element */
.topology { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 1.75rem 1.75rem 1.25rem; }
.topology-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.topology svg { width: 100%; height: auto; display: block; }
.node-label { font-family: "IBM Plex Mono", monospace; font-size: 11px; fill: var(--text); }
.node-sub { font-family: "IBM Plex Mono", monospace; font-size: 9.5px; fill: var(--text-muted); }
.path-line { fill: none; stroke: var(--border); stroke-width: 2; }
.path-flow-primary {
  fill: none; stroke: var(--signal-up); stroke-width: 2; stroke-dasharray: 6 8;
  animation: flow 1.6s linear infinite, primary-blip 9s ease-in-out infinite;
}
.path-flow-backup {
  fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-dasharray: 6 8; opacity: 0.35;
  animation: flow 1.6s linear infinite reverse, backup-blip 9s ease-in-out infinite;
}
@keyframes flow { to { stroke-dashoffset: -28; } }
@keyframes primary-blip {
  0%, 55% { stroke: var(--signal-up); opacity: 1; }
  60%, 75% { stroke: var(--signal-down); opacity: 0.6; }
  80%, 100% { stroke: var(--signal-up); opacity: 1; }
}
@keyframes backup-blip {
  0%, 55% { opacity: 0.35; }
  62%, 78% { opacity: 1; }
  85%, 100% { opacity: 0.35; }
}
.node-dot { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; }
@media (prefers-reduced-motion: reduce) {
  .path-flow-primary, .path-flow-backup { animation: none; }
}

/* Sections */
.section { padding: 4.5rem 0; border-bottom: 1px solid var(--border); }
.section-head { margin-bottom: 2.5rem; max-width: 60ch; }
.section-head h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.1rem); margin-top: 0.75rem; }
.section-head p { color: var(--text-muted); margin: 0.75rem 0 0; }

/* Compact page header, used on standalone /terms and /privacy pages */
.page-header { padding: 3.5rem 0 0; }
.page-header .section-head { margin-bottom: 0; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.card { background: var(--surface); padding: 1.75rem; }
.card h3 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

/* Downloads */
.downloads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); }
.download-card { background: var(--surface); padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; text-decoration: none; color: var(--text); }
.download-card:hover { background: var(--surface-2); }
.download-card .platform { font-weight: 600; font-size: 1rem; }
.download-card .action { font-family: "IBM Plex Mono", monospace; font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.downloads-note { margin-top: 1.5rem; font-size: 0.88rem; color: var(--text-muted); }
.downloads-note a { color: var(--accent); text-decoration: none; }

/* Legal */
.legal-meta { font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; color: var(--text-muted); margin: 1.5rem 0 2.5rem; }
.clause { margin-bottom: 1.75rem; display: flex; gap: 1.25rem; }
.clause .num { font-family: "IBM Plex Mono", monospace; color: var(--accent); font-size: 0.85rem; flex: 0 0 2.25rem; padding-top: 0.15rem; }
.clause .body h3 { font-size: 1rem; margin-bottom: 0.4rem; font-family: "IBM Plex Sans", sans-serif; font-weight: 600; }
.clause .body p { color: var(--text-muted); margin: 0; font-size: 0.94rem; }
.clause .body a { color: var(--accent); text-decoration: none; }

footer { padding: 3rem 0; }
footer .wrap {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-family: "IBM Plex Mono", monospace; font-size: 0.78rem; color: var(--text-muted);
}
footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  nav.links { display: none; }
}
