/* Ping — low-latency VPN. Visual identity: signal / sonar / round-trip.
   Palette: ink-navy field, phosphor-mint signal, one warm spark used once. */

:root {
  --ink:        #080B14;
  --panel:      #0F1522;
  --panel-2:    #141C2C;
  --line:       #1E2836;
  --signal:     #4CE0B3;   /* phosphor mint — "latency: good" */
  --signal-dim: #2C7C66;
  --spark:      #FF6A3D;   /* the one warm accent, used sparingly */
  --text:       #EAF0F6;
  --muted:      #8A96A8;
  --muted-2:    #5C6675;

  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "Inter", system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, monospace;

  --maxw: 1120px;
  --r: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* faint measurement grid, like an oscilloscope screen */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 30%, transparent 75%);
  pointer-events: none;
}

main, .nav, .footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.7rem 1.25rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--signal);
  color: #05231B;
  box-shadow: 0 0 0 0 rgba(76,224,179,0.5);
}
.btn-primary:hover {
  background: #63EBC1;
  box-shadow: 0 8px 30px -8px rgba(76,224,179,0.55);
  transform: translateY(-1px);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255,255,255,0.02);
}
.btn-ghost:hover { border-color: var(--signal-dim); color: #fff; }
.btn-lg { padding: 0.95rem 1.6rem; font-size: 1.05rem; }
.btn-sub { font-family: var(--mono); font-size: 0.72rem; font-weight: 400; opacity: 0.7; }

/* ---------- nav ---------- */
.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.brand-node {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px rgba(76,224,179,0.18), 0 0 16px 2px rgba(76,224,179,0.6);
}
.nav-links { display: flex; gap: 1.75rem; margin-left: auto; font-size: 0.92rem; color: var(--muted); }
.nav-links a { transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }
.nav-cta { padding: 0.55rem 1.1rem; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 5rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.2vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 34rem; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 2.8rem; }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.hero-stats dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); margin-bottom: 0.3rem; }
.hero-stats dd { font-family: var(--mono); font-weight: 500; font-size: 1.05rem; color: var(--text); }

/* ---------- signature: sonar ping ---------- */
.sonar {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  min-height: 340px;
}
.sonar-core {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 24px 4px rgba(76,224,179,0.8);
  z-index: 2;
}
.sonar-ring {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--signal);
  opacity: 0;
  animation: ripple 3s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}
.sonar-ring:nth-child(2) { animation-delay: 1s; }
.sonar-ring:nth-child(3) { animation-delay: 2s; }
@keyframes ripple {
  0%   { transform: scale(1); opacity: 0.9; }
  70%  { opacity: 0.12; }
  100% { transform: scale(20); opacity: 0; }
}
.sonar-readout {
  position: absolute;
  bottom: 8%;
  right: 4%;
  text-align: right;
  background: rgba(8,11,20,0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  backdrop-filter: blur(6px);
}
.rtt-label { display: block; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.rtt-value { font-family: var(--mono); font-weight: 700; font-size: 1.7rem; color: var(--signal); }
.rtt-unit { font-size: 0.9rem; color: var(--muted); margin-left: 2px; }

/* ---------- sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: 5.5rem 1.5rem; }
.section-eyebrow { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 0.9rem; }
.section-title { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 3.5vw, 2.6rem); letter-spacing: -0.02em; margin-bottom: 0.6rem; }
.section-sub { color: var(--muted); margin-bottom: 2.5rem; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 2.5rem; }
.feature { background: var(--panel); padding: 1.9rem 1.6rem; transition: background 0.2s ease; }
.feature:hover { background: var(--panel-2); }
.feature h3 { font-family: var(--display); font-weight: 600; font-size: 1.12rem; margin-bottom: 0.6rem; }
.feature h3::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); margin-right: 0.55rem; vertical-align: middle; box-shadow: 0 0 10px rgba(76,224,179,0.6); }
.feature p { color: var(--muted); font-size: 0.95rem; }

/* protocol path */
.section-protocol { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(15,21,34,0.4), transparent); }
.path { list-style: none; margin-top: 2.5rem; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.path-step { background: var(--panel); display: flex; gap: 1.4rem; align-items: flex-start; padding: 1.6rem 1.7rem; position: relative; }
.path-mark { font-family: var(--mono); font-weight: 700; font-size: 0.85rem; color: var(--signal); background: rgba(76,224,179,0.08); border: 1px solid var(--signal-dim); border-radius: 8px; padding: 0.4rem 0.55rem; min-width: 2.6rem; text-align: center; letter-spacing: 0.05em; }
.path-step h3 { font-family: var(--display); font-weight: 600; font-size: 1.1rem; margin-bottom: 0.3rem; }
.path-step p { color: var(--muted); font-size: 0.95rem; max-width: 46rem; }
.spec-link { margin-top: 1.6rem; font-family: var(--mono); font-size: 0.9rem; color: var(--muted); }
.spec-link a { color: var(--signal); border-bottom: 1px solid var(--signal-dim); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; margin-top: 2.5rem; }
.step { padding: 1.8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.step-n { font-family: var(--mono); font-weight: 700; font-size: 0.9rem; color: var(--muted-2); }
.step h3 { font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin: 0.8rem 0 0.5rem; }
.step p { color: var(--muted); font-size: 0.95rem; }
.step code { font-family: var(--mono); font-size: 0.85em; color: var(--signal); background: rgba(76,224,179,0.08); padding: 0.1rem 0.35rem; border-radius: 5px; }

/* download */
.section-download { padding-top: 2rem; }
.download-card {
  display: flex; align-items: center; justify-content: space-between; gap: 2.5rem;
  flex-wrap: wrap;
  padding: 2.8rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at 85% 20%, rgba(76,224,179,0.14), transparent 55%),
    var(--panel);
  border: 1px solid var(--line);
}
.download-card h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.7rem; letter-spacing: -0.02em; }
.download-card p { color: var(--muted); max-width: 34rem; }
.download-note { font-size: 0.85rem; color: var(--muted-2); margin-top: 0.5rem; }
.download-actions { display: flex; flex-direction: column; gap: 0.8rem; }

/* footer */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 3rem 1.5rem 4rem; border-top: 1px solid var(--line); display: grid; gap: 1rem; }
.footer-brand { display: flex; align-items: center; gap: 0.55rem; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.footer-meta { color: var(--muted); font-size: 0.9rem; max-width: 40rem; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.footer-links a:hover { color: var(--signal); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .sonar { order: -1; min-height: 260px; }
  .features, .steps { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero-stats { flex-wrap: wrap; gap: 1.5rem; }
  .download-card { padding: 1.8rem; }
  .download-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .sonar-ring { animation: none; opacity: 0.2; }
  * { scroll-behavior: auto; }
}

/* focus visibility for keyboard users */
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
