/* =============================================
   NexVPN — Premium Dark Design System
   VLESS gRPC Landing Page
   ============================================= */

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0:   hsl(222, 22%, 7%);
  --bg-1:   hsl(222, 20%, 11%);
  --bg-2:   hsl(222, 18%, 16%);
  --glass:  rgba(255,255,255,0.05);
  --glass-b:rgba(255,255,255,0.09);
  --border: rgba(255,255,255,0.09);
  --accent: hsl(260, 80%, 65%);
  --accent2:hsl(195, 90%, 55%);
  --accent3:hsl(155, 75%, 52%);
  --text-1: hsl(220, 30%, 96%);
  --text-2: hsl(220, 15%, 70%);
  --text-3: hsl(220, 12%, 50%);
  --r-card: 20px;
  --r-pill: 100px;
  --shadow-glow: 0 0 60px -10px rgba(138, 80, 255, 0.35);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  overflow-x: hidden;
  position: relative;
}

/* ── Animated canvas background ── */
#networkCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

/* ── Utility ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.gradient-text {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
section { position: relative; z-index: 1; }

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background: rgba(14,16,27,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.5px; color: var(--text-1); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-support {
  font-size: 0.84rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.nav-support:hover { color: var(--accent2); }

.nav-badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid rgba(33, 195, 240, 0.3);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: rgba(33,195,240,0.08);
}

/* ── Hero ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  padding: 120px 80px 80px;
  max-width: 1300px;
  margin: 0 auto;
}

.hero-content { flex: 1; max-width: 600px; }

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent3);
  background: rgba(80, 230, 160, 0.1);
  border: 1px solid rgba(80,230,160,0.25);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 0 0 rgba(80,230,160,0.6);
  animation: pulse-ring 1.8s ease infinite;
  flex-shrink: 0;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(80,230,160,0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(80,230,160,0); }
  100% { box-shadow: 0 0 0 0 rgba(80,230,160,0); }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  color: var(--text-1);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

/* ── Server Status Grid ── */
.server-status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  width: 100%;
  max-width: 560px;
}

.server-location {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s, transform 0.25s;
}
.server-location:hover {
  border-color: rgba(138,80,255,0.3);
  transform: translateY(-2px);
}

.server-location-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.flag { font-size: 1.1rem; flex-shrink: 0; }

.loc-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-1);
  flex: 1;
}

.loc-count {
  font-size: 0.7rem;
  color: var(--text-3);
  white-space: nowrap;
}

.server-nodes {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.server-node {
  display: flex;
  align-items: center;
  gap: 7px;
}

.node-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 6px rgba(80,230,160,0.7);
  flex-shrink: 0;
  animation: pulse-ring 2.2s ease infinite;
}

.node-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-2);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  flex: 1;
}

.node-ping {
  font-size: 0.76rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  min-width: 52px;
  text-align: right;
  transition: color 0.4s;
}

/* ping colour classes — set by JS */
.node-ping.ping-good   { color: hsl(140, 80%, 55%); }  /* < 100ms   — green  */
.node-ping.ping-ok     { color: hsl(45,  90%, 55%); }  /* 100–180ms — yellow */
.node-ping.ping-high   { color: hsl(15,  90%, 60%); }  /* > 180ms   — orange */


.stat-pill {
  font-size: 0.82rem;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  color: var(--text-2);
  backdrop-filter: blur(8px);
  transition: all 0.25s;
}
.stat-pill:hover {
  background: var(--glass-b);
  color: var(--text-1);
  border-color: rgba(255,255,255,0.18);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 32px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, hsl(220, 85%, 60%) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(138,80,255,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 48px rgba(138,80,255,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
}
.hero-cta svg { transition: transform 0.2s; }
.hero-cta:hover svg { transform: translateX(4px); }

/* ── Hero Visual (orbiting globe) ── */
.hero-visual {
  flex-shrink: 0;
  position: relative;
  width: 360px;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.globe-core {
  width: 110px; height: 110px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), hsl(220,85%,55%));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff; letter-spacing: 1px;
  box-shadow: 0 0 60px rgba(138,80,255,0.6), 0 0 120px rgba(138,80,255,0.2);
  z-index: 2;
}

.globe-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(138,80,255,0.25);
}
.ring-1 { width: 180px; height: 180px; animation: spin 12s linear infinite; border-color: rgba(138,80,255,0.35); }
.ring-2 { width: 270px; height: 270px; animation: spin 20s linear infinite reverse; border-color: rgba(33,195,240,0.2); }
.ring-3 { width: 360px; height: 360px; animation: spin 30s linear infinite; border-color: rgba(80,230,160,0.15); }

@keyframes spin { to { transform: rotate(360deg); } }

.orbit-dot {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}
.dot-a {
  top: 0; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent);
  animation: orbit-a 12s linear infinite;
}
.dot-b {
  top: 50%; right: 0;
  transform: translateY(-50%);
  background: var(--accent2);
  color: var(--accent2);
  animation: orbit-b 20s linear infinite reverse;
}
.dot-c {
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  background: var(--accent3);
  color: var(--accent3);
  animation: orbit-c 30s linear infinite;
}

@keyframes orbit-a {
  from { transform: rotate(0deg) translateX(90px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(90px) rotate(-360deg); }
}
@keyframes orbit-b {
  from { transform: rotate(0deg) translateX(135px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(135px) rotate(-360deg); }
}
@keyframes orbit-c {
  from { transform: rotate(120deg) translateX(180px) rotate(-120deg); }
  to   { transform: rotate(480deg) translateX(180px) rotate(-480deg); }
}

/* ── Section shared ── */
.section-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  text-align: center;
}

.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -1px;
  text-align: center;
  margin-bottom: 16px;
  color: var(--text-1);
}

.section-sub {
  text-align: center;
  color: var(--text-2);
  max-width: 580px;
  margin: 0 auto 60px;
  line-height: 1.7;
  font-size: 1rem;
}

/* ── Features ── */
.features {
  padding: 120px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.feat-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 28px 24px;
  backdrop-filter: blur(12px);
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.feat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138,80,255,0.5), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(138,80,255,0.35);
  box-shadow: 0 16px 48px rgba(0,0,0,0.3), var(--shadow-glow);
}
.feat-card:hover::before { opacity: 1; }

.feat-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  display: block;
}

.feat-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-1);
}

.feat-card p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.65;
}

/* ── Pricing ── */
.pricing {
  padding: 120px 40px;
}

.price-card-wrapper {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
}

.price-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(138,80,255,0.2) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

.price-card {
  background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(138,80,255,0.35);
  border-radius: 24px;
  padding: 40px 36px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glow), 0 1px 0 rgba(255,255,255,0.1) inset;
}

.price-card-header { margin-bottom: 28px; }

.plan-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(138,80,255,0.12);
  border: 1px solid rgba(138,80,255,0.25);
  border-radius: var(--r-pill);
  padding: 5px 14px;
  display: inline-block;
  margin-bottom: 18px;
}

.plan-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-1);
}

.plan-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.plan-price {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.plan-price-meta { display: flex; flex-direction: column; }
.plan-currency { font-size: 1.5rem; font-weight: 700; color: var(--text-2); }
.plan-period { font-size: 0.85rem; color: var(--text-3); }

.plan-features {
  list-style: none;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93rem;
  color: var(--text-2);
}

.check {
  width: 20px; height: 20px;
  background: rgba(80,230,160,0.15);
  border: 1px solid rgba(80,230,160,0.35);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  color: var(--accent3);
  flex-shrink: 0;
}

.buy-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent) 0%, hsl(220, 85%, 60%) 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(138,80,255,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}
.buy-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 48px rgba(138,80,255,0.55);
}
.buy-button svg { transition: transform 0.2s; }
.buy-button:hover svg { transform: translateX(4px); }

.price-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 14px;
}

/* ── How it works ── */
.howto {
  padding: 120px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-top: 20px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.step-num {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.step-body h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-1);
}

.step-body p {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 200px;
  margin: 0 auto;
}

.step-divider {
  flex-shrink: 0;
  width: 80px;
  height: 1px;
  margin-top: 52px;
  background: linear-gradient(90deg, rgba(138,80,255,0.4), rgba(33,195,240,0.4));
}

/* ── Clients ── */
.clients {
  padding: 80px 40px;
  text-align: center;
}

.clients-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.client-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-1);
  transition: all 0.25s;
}
.client-tag:hover {
  background: var(--glass-b);
  border-color: rgba(138,80,255,0.3);
  transform: translateY(-2px);
}

.platform {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--accent2);
  background: rgba(33,195,240,0.1);
  border-radius: var(--r-pill);
  padding: 2px 8px;
}

/* ── Key Section ── */
.key-section {
  display: none;
  padding: 60px 40px;
}

.key-card {
  max-width: 700px;
  margin: 0 auto;
  background: linear-gradient(160deg, rgba(80,230,160,0.07) 0%, rgba(33,195,240,0.04) 100%);
  border: 1px solid rgba(80,230,160,0.3);
  border-radius: 24px;
  padding: 36px;
  backdrop-filter: blur(16px);
  box-shadow: 0 0 60px rgba(80,230,160,0.15);
}

.key-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.key-icon { font-size: 2.4rem; }

.key-card-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}

.key-card-header p {
  font-size: 0.87rem;
  color: var(--text-2);
}

.key-box-wrap {
  position: relative;
  margin-bottom: 16px;
}

.key-box {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(80,230,160,0.2);
  border-radius: 12px;
  padding: 18px 52px 18px 18px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--accent3);
  word-break: break-all;
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.6;
}

.copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-2);
  transition: all 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-1); }

.download-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(80,230,160,0.35);
  background: rgba(80,230,160,0.1);
  color: var(--accent3);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.25s;
  margin-bottom: 20px;
}
.download-btn:hover {
  background: rgba(80,230,160,0.18);
  transform: translateY(-2px);
}

.key-instruction {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 0.87rem;
  color: var(--text-2);
  line-height: 1.65;
}

.key-instruction strong { color: var(--text-1); }

/* ── Footer ── */
.footer {
  padding: 48px 40px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  max-width: 1300px;
  margin: 0 auto;
}

.footer-logo { display: flex; align-items: center; gap: 8px; }

.footer-note {
  font-size: 0.82rem;
  color: var(--text-3);
}

.footer-left { display: flex; flex-direction: column; gap: 6px; }

.footer-links {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.footer-links a {
  font-size: 0.82rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent2); }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero { flex-direction: column; padding: 120px 24px 60px; text-align: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { width: 260px; height: 260px; }
  .globe-core { width: 80px; height: 80px; font-size: 0.8rem; }
  .ring-1 { width: 130px; height: 130px; }
  .ring-2 { width: 195px; height: 195px; }
  .ring-3 { width: 260px; height: 260px; }
  .steps { flex-direction: column; align-items: center; }
  .step-divider { width: 1px; height: 40px; margin-top: 0; }
  .footer { justify-content: center; text-align: center; }
  .server-status-grid { grid-template-columns: 1fr; max-width: 100%; }
}

@media (max-width: 600px) {
  .navbar { padding: 14px 20px; }
  .hero-title { font-size: 2rem; }
  .features { padding: 80px 20px; }
  .pricing, .howto, .clients, .key-section { padding: 80px 20px; }
  .server-status-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
  .server-status-grid { grid-template-columns: 1fr; }
}
