:root {
  --bg: #0d0d1c;
  --bg2: #14142b;
  --fg: #f5f5fa;
  --muted: #a9a9c4;
  --accent: #2563eb;
  --accent2: #4f8cff;
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.09);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

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

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 13, 28, 0.85);
  backdrop-filter: blur(8px);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; color: var(--fg); font-size: 18px; display: inline-flex; align-items: center; gap: 9px; }
/* The weft mark uses navy strokes designed for light backgrounds; on the dark
   nav it needs a white chip to read. */
.brand img { height: 32px; width: 32px; display: block; background: #fff; border-radius: 7px; padding: 3px; box-sizing: border-box; }
.nav nav a { margin-left: 22px; color: var(--muted); }
.nav nav a:hover { color: var(--fg); text-decoration: none; }
.nav nav a.ico { display: inline-flex; align-items: center; gap: 6px; }
.nav nav a.ico svg { display: block; }

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  /* Pull up behind the 60px sticky topbar (+1px border) so the video is flush
     to the very top; padding-top clears the bar for the copy. */
  margin-top: -61px;
  padding: 150px 0 96px;
  background: #0b1532 url("/img/hero-datacenter.jpg") center / cover no-repeat;
}
/* Looping datacenter video, full-bleed and gaussian-blurred into a frosted
   backdrop; scaled up so the blur's soft edges never show. Poster paints first. */
.hero-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; pointer-events: none;
  filter: blur(9px) saturate(1.15) brightness(0.85);
  transform: scale(1.12);
}
/* Dark veil over the video so the hero copy stays legible. */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(13, 13, 28, 0.62) 0%, rgba(13, 13, 28, 0.84) 100%),
    radial-gradient(120% 90% at 50% 0%, rgba(42, 42, 82, 0.45) 0%, transparent 60%);
}
.hero .wrap { position: relative; z-index: 2; }
@media (prefers-reduced-motion: reduce) { .hero-video { display: none; } }
/* Weft's devise — the weaving epigraph, laid over the video. */
.devise {
  font-style: italic;
  color: #eef2ff;
  font-size: clamp(17px, 2.6vw, 24px);
  letter-spacing: 0.2px;
  max-width: 640px;
  margin: -6px auto 26px;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.55);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.1;
  margin: 0 auto 20px;
  max-width: 760px;
  letter-spacing: -0.5px;
}
.lead { color: var(--muted); font-size: 19px; max-width: 640px; margin: 0 auto 34px; }
.cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); text-decoration: none; }
.btn.ghost { border: 1px solid var(--border); color: var(--fg); }
.btn.ghost:hover { border-color: var(--accent2); text-decoration: none; }

/* Sections */
section { padding: 64px 0; }
section h2 { font-size: 28px; margin: 0 0 28px; text-align: center; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.card .icon { font-size: 28px; margin-bottom: 10px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { color: var(--muted); margin: 0; }
.card.link { display: block; color: var(--fg); transition: border-color 0.15s, transform 0.1s; }
.card.link:hover { border-color: var(--accent2); transform: translateY(-2px); text-decoration: none; }
.card.link h3 { color: var(--accent2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }

/* How */
.how ol { max-width: 720px; margin: 0 auto; padding-left: 22px; }
.how li { margin-bottom: 12px; color: var(--muted); }
.how li strong { color: var(--fg); }

/* Topology — the animated isometric WireGuard-mesh view */
.topology { text-align: center; }
.topology .eyebrow {
  display: inline-block; color: var(--accent2);
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 10px;
}
.topology p { color: var(--muted); max-width: 760px; margin: 0 auto 30px; }
.topology p code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; color: var(--accent2); }
.topology .mesh { margin: 0; }
.topology .mesh img {
  display: block; width: 100%; max-width: 940px; height: auto; margin: 0 auto;
  border: 1px solid var(--border); border-radius: 16px; background: var(--bg2);
}

footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
}
footer p { margin: 0; }
