:root {
  --bg-core: #0a0c10;
  --bg-card: #0e1217;
  --bg-card-hover: #131821;
  --bg-slate: #161b22;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(0, 255, 102, 0.4);
  --accent-neon: #00ff66;
  --accent-emerald: #10b981;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-dim: #6b7280;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --shadow-neon: 0 0 25px rgba(0, 255, 102, 0.15);
  --shadow-subtle: 0 8px 30px rgba(0, 0, 0, 0.5);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --container-max: 1240px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-core);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 0%, #161b22 0%, #0a0c10 70%);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography Utility */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 255, 102, 0.08);
  border: 1px solid var(--border-active);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-neon);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-neon);
  box-shadow: 0 0 10px var(--accent-neon);
  animation: pulsePing 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulsePing {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.3); }
}

/* Header & Navigation */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent-neon);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: var(--accent-neon);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-toggle svg {
  stroke: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-neon);
  color: #000;
  box-shadow: var(--shadow-neon);
}

.btn-primary:hover {
  background: #00e059;
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 255, 102, 0.3);
}

.btn-secondary {
  background: var(--bg-slate);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: #1c222b;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
  padding: 6rem 0 4rem;
  text-align: center;
  position: relative;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 1.5rem auto;
  max-width: 900px;
}

.hero-title .highlight {
  color: transparent;
  background: linear-gradient(90deg, #00ff66 0%, #10b981 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 780px;
  margin: 0 auto 2.5rem;
  font-weight: 400;
  line-height: 1.7;
}

.hero-ctas {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 4rem;
}

/* Latency Visualizer Bar */
.latency-bar-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  box-shadow: var(--shadow-subtle);
}

.latency-node {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
  border-right: 1px solid var(--border-subtle);
  padding-right: 1rem;
}

.latency-node:last-child {
  border-right: none;
}

.latency-node-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 600;
}

.latency-node-broker {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.latency-node-ping {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-neon);
}

/* Content Sections */
.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 4rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.section-description {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Architecture Cards Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2.25rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-active);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: rgba(0, 255, 102, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.card-icon svg {
  stroke: var(--accent-neon);
}

.card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.card-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Billing Toggle */
.billing-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.switch-label {
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.toggle-track {
  width: 56px;
  height: 30px;
  background: var(--bg-slate);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-knob {
  width: 22px;
  height: 22px;
  background: var(--accent-neon);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 4px;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-active .toggle-knob {
  transform: translateX(26px);
}

.save-pill {
  background: rgba(0, 255, 102, 0.15);
  color: var(--accent-neon);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
}

/* Pricing Cards */
.pricing-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-card.popular {
  border-color: var(--accent-neon);
  box-shadow: var(--shadow-neon);
}

.pricing-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--accent-neon);
  color: #000;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.pricing-tier-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pricing-price {
  font-size: 2.75rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin: 1rem 0;
}

.pricing-price sub {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-dim);
}

.pricing-specs {
  list-style: none;
  margin: 1.5rem 0 2rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.pricing-specs li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.pricing-specs li svg {
  stroke: var(--accent-neon);
  flex-shrink: 0;
}

/* Data Comparison Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th, .comparison-table td {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.95rem;
}

.comparison-table th {
  background: var(--bg-slate);
  color: var(--text-primary);
  font-weight: 700;
}

.comparison-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

.comparison-table .highlight-col {
  background: rgba(0, 255, 102, 0.03);
  font-weight: 600;
  color: var(--accent-neon);
}

/* Accordion */
.accordion-wrapper {
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.accordion-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
}

.accordion-trigger {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}

.accordion-trigger:hover {
  color: var(--accent-neon);
}

.accordion-chevron {
  transition: transform 0.3s ease;
  stroke: var(--accent-neon);
}

.accordion-item.active .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
  padding: 0 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
  transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
  padding-bottom: 1.5rem;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-subtle);
  padding: 5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 4rem;
}

.footer-heading {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent-neon);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Error Pages */
.error-page-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.terminal-card {
  width: 100%;
  max-width: 650px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  font-family: var(--font-mono);
}

.terminal-header {
  background: var(--bg-slate);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-left: 0.5rem;
}

.terminal-content {
  padding: 2.5rem;
}

.error-code {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-neon);
  margin-bottom: 1rem;
}

.error-desc {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}

.terminal-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .hero-title { font-size: 2.75rem; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .latency-bar-wrapper { grid-template-columns: repeat(2, 1fr); }
  .latency-node { border-right: none; }
}

@media (max-width: 768px) {
  .mobile-toggle { display: block; }
  .nav-menu {
    position: fixed;
    top: 73px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 73px);
    background: var(--bg-core);
    flex-direction: column;
    padding: 2.5rem 1.5rem;
    gap: 1.5rem;
    transition: left 0.3s ease;
    border-top: 1px solid var(--border-subtle);
  }
  .nav-menu.open { left: 0; }
  .hero-title { font-size: 2.25rem; }
  .hero-ctas { flex-direction: column; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .latency-bar-wrapper { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}