/* ========== Custom Properties ========== */
:root {
  --bg-base: #0a0a0f;
  --bg-surface: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --border: #1e1e2e;
  --border-glow: #2a2a3e;
  --text-primary: #e4e4ef;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-blue: #3b82f6;
  --accent-cyan: #22d3ee;
  --accent-purple: #a78bfa;
  --accent-green: #34d399;
  --glow-blue: rgba(59, 130, 246, 0.15);
  --glow-cyan: rgba(34, 211, 238, 0.12);
  --glow-purple: rgba(167, 139, 250, 0.12);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}

/* Dot-grid pattern overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(136, 136, 160, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 100%);
}

/* Floating gradient orbs */
body::after {
  content: '';
  position: fixed;
  top: 20%;
  right: -10%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, rgba(59, 130, 246, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb1 20s ease-in-out infinite;
}

@keyframes floatOrb1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(-40px, 30px) scale(1.05); }
  50% { transform: translate(-20px, -40px) scale(0.95); }
  75% { transform: translate(30px, 20px) scale(1.02); }
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
.bg-orb--1 {
  bottom: 10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.06) 0%, rgba(167, 139, 250, 0.03) 40%, transparent 70%);
  animation: floatOrb2 25s ease-in-out infinite;
}
.bg-orb--2 {
  top: 40%;
  left: 30%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.04) 0%, transparent 60%);
  animation: floatOrb3 30s ease-in-out infinite;
}

@keyframes floatOrb2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(50px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 40px) scale(0.95); }
}
@keyframes floatOrb3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -50px); }
}

.navbar, section, .footer {
  position: relative;
  z-index: 1;
}

#particleCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.3), rgba(34, 211, 238, 0.2), transparent);
  animation: scanLine 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes scanLine {
  0% { top: 10%; }
  100% { top: 90%; }
}

.section-glow-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-cyan), transparent);
  opacity: 0.3;
  margin: 0;
}

section {
  animation: sectionReveal 0.8s ease;
}
@keyframes sectionReveal {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

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

/* ========== Layout ========== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 100px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 48px;
}

/* ========== Scroll Animations ========== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Navigation ========== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.logo svg {
  width: 28px;
  height: 28px;
  color: var(--accent-purple);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-purple) !important;
  padding: 8px 16px;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 100px;
  transition: all 0.25s;
}

.nav-cta:hover {
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(167, 139, 250, 0.3);
}

.nav-cta svg {
  width: 13px;
  height: 13px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* ========== Hero ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding-top: 64px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 1000px;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(167, 139, 250, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(59, 130, 246, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 80%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
  pointer-events: none;
  animation: heroColorShift 12s ease-in-out infinite alternate;
}

@keyframes heroColorShift {
  0% { opacity: 0.8; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-48%) scale(1.05); }
  100% { opacity: 0.85; transform: translateX(-52%) scale(0.98); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-purple);
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.15);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-purple) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subline {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 20px;
  font-family: var(--font-mono);
}

.hero-description {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 20px var(--glow-purple);
}

.btn-primary:hover {
  background: #b9a2fa;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ========== Hero Stats ========== */
.hero-stats {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.hero-stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.hero-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 6px;
}

/* ========== Nameserver Grid ========== */
.ns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.ns-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  --accent: var(--accent-purple);
}

.ns-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0.7;
}

.ns-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.ns-card.accent-purple { --accent: var(--accent-purple); }
.ns-card.accent-cyan   { --accent: var(--accent-cyan); }
.ns-card.accent-green  { --accent: var(--accent-green); }
.ns-card.accent-blue   { --accent: var(--accent-blue); }

.ns-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.ns-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.ns-icon svg {
  width: 24px;
  height: 24px;
}

.ns-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ns-domain {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.ns-flag {
  margin-left: auto;
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.ns-rows {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ns-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ns-row-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.ns-row-label svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.ns-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  word-break: break-all;
  transition: all 0.25s;
}

.ns-value:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.ns-meta {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.ns-meta strong {
  color: var(--text-primary);
  font-weight: 600;
}

.ns-meta span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ========== Map ========== */
#map {
  width: 100%;
  height: 480px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.leaflet-popup-content {
  margin: 14px 16px;
  font-family: var(--font-sans);
}

.leaflet-popup-content h3 {
  margin: 0 0 8px 0;
  font-size: 1rem;
}

.leaflet-popup-content p {
  margin: 4px 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.leaflet-popup-content .mono {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.leaflet-popup-tip {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
}

.leaflet-container a.leaflet-popup-close-button {
  color: var(--accent-purple);
  font-size: 18px;
}

.leaflet-container {
  background: var(--bg-surface);
}

/* Tone the OSM tiles toward the dark theme */
.leaflet-tile-pane {
  filter: brightness(0.7) invert(1) contrast(0.9) hue-rotate(200deg) saturate(0.6) brightness(0.85);
}

/* ========== Status ========== */
.status-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-radius: 100px;
  margin-bottom: 28px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 12px var(--accent-green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-green);
}

.status-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-purple);
  transition: all 0.2s;
}

.status-link:hover {
  gap: 12px;
}

.status-link svg {
  width: 16px;
  height: 16px;
}

/* ========== Tech / Features grid ========== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-purple));
  opacity: 0;
  transition: opacity 0.3s;
}

.service-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
}

.service-card:hover::before {
  opacity: 1;
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glow-purple);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  color: var(--accent-purple);
}

.service-icon svg {
  width: 24px;
  height: 24px;
}

.service-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
}

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

/* ========== Footer ========== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  section {
    padding: 72px 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .ns-grid {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 32px;
  }

  .status-container {
    padding: 28px 24px;
  }

  #map {
    height: 360px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .ns-card {
    padding: 22px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }
}
