/* ───────────────────────────────────────────
   NodeRouter — Custom Styles
   Blue · Zinc dark surfaces · Flat design
   ─────────────────────────────────────────── */

/* ── 1. Zinc surface tokens ─────────────────────────────────────────────── */

[data-bs-theme="light"] {
  color-scheme: light;
  --bs-body-bg: #f4f4f5; /* zinc-100 */
  --bs-secondary-bg: #ffffff; /* white    */
  --bs-tertiary-bg: #e4e4e7; /* zinc-200 */
  --bs-body-color: #09090b; /* zinc-950 */
  --bs-secondary-color: #71717a; /* zinc-500 */
  --bs-emphasis-color: #000000;
  --bs-border-color: #d4d4d8; /* zinc-300 */
  --bs-border-color-translucent: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] {
  color-scheme: dark;
  --bs-body-bg: #09090b; /* zinc-950 */
  --bs-secondary-bg: #18181b; /* zinc-900 */
  --bs-tertiary-bg: #27272a; /* zinc-800 */
  --bs-body-color: #fafafa; /* zinc-50  */
  --bs-secondary-color: #a1a1aa; /* zinc-400 */
  --bs-emphasis-color: #ffffff;
  --bs-border-color: #3f3f46; /* zinc-700 */
  --bs-border-color-translucent: rgba(255, 255, 255, 0.08);
}

/* ── 2. Blue primary ─────────────────────────────────────────────────────── */

:root {
  --bs-primary: #3b82f6; /* blue-500 */
  --bs-primary-rgb: 59, 130, 246;
  --nr-primary: #3b82f6;
  --nr-primary-glow: rgba(59, 130, 246, 0.3);
}

.btn-primary {
  --bs-btn-color: #ffffff;
  --bs-btn-bg: #3b82f6;
  --bs-btn-border-color: #3b82f6;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #2563eb;
  --bs-btn-hover-border-color: #2563eb;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #1d4ed8;
  --bs-btn-active-border-color: #1d4ed8;
  --bs-btn-disabled-bg: #60a5fa;
  --bs-btn-disabled-border-color: #60a5fa;
}

.btn-outline-primary {
  --bs-btn-color: #60a5fa;
  --bs-btn-border-color: #3b82f6;
  --bs-btn-hover-color: #ffffff;
  --bs-btn-hover-bg: #3b82f6;
  --bs-btn-hover-border-color: #3b82f6;
  --bs-btn-active-color: #ffffff;
  --bs-btn-active-bg: #2563eb;
  --bs-btn-active-border-color: #2563eb;
}

/* ── 3. Flat design ──────────────────────────────────────────────────────── */

:root {
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);

  --bs-border-radius: 6px;
  --bs-border-radius-sm: 4px;
  --bs-border-radius-lg: 8px;
  --bs-border-radius-xl: 10px;
  --bs-border-radius-xxl: 12px;
  --bs-border-radius-pill: 50rem;

  --bs-box-shadow: none;
  --bs-box-shadow-sm: none;
  --bs-box-shadow-lg: none;
  --bs-box-shadow-inset: none;

  --nr-radius: 6px;
  --nr-surface: var(--bs-body-bg);
  --nr-surface-alt: var(--bs-tertiary-bg);
  --nr-border: var(--bs-border-color);
  --nr-card-bg: var(--bs-secondary-bg);
  --nr-text-muted: var(--bs-secondary-color);
}

.btn {
  box-shadow: none !important;
  border-radius: 6px;
  transition:
    background-color 0.12s,
    border-color 0.12s,
    color 0.12s;
}
.btn:focus-visible {
  box-shadow: none !important;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ── Base ────────────────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
  overflow-x: clip; /* clip instead of hidden — doesn't create a scroll container, preserves position:sticky */
}

body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: var(--bs-font-sans-serif);
  overflow-x: clip;
}

/* Prevent flex children from overflowing their container (e.g. code blocks) */
.d-flex > .w-100 {
  min-width: 0;
}

/* ── Utility ── */
.py-6 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */

#mainNav {
  background: transparent;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.3s ease;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

#mainNav.scrolled {
  background: transparent;
}

.navbar-brand {
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.navbar-brand span {
  color: var(--nr-primary);
}

.nav-link {
  color: var(--bs-secondary-color) !important;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.12s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--bs-body-color) !important;
}

/* ── Badge Pill ── */
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #1d4ed8; /* blue-700 — 5.2:1 on white */
  border-radius: 6px;
  padding: 0.4rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

[data-bs-theme="dark"] .badge-pill {
  color: #93c5fd; /* blue-300 — 6.1:1 on zinc-950 */
}

/* ── Hero ── */
#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.hero-section {
  min-height: 100vh;
  padding-top: 100px;
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(
    circle,
    var(--nr-primary-glow) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Terminal ──────────────────────────────────────────────────────────────── */

.hero-terminal {
  max-width: 680px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  text-align: left;
}

.terminal-bar {
  background: #1c1c1e;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #3f3f46;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot.red {
  background: #ff5f57;
}
.dot.yellow {
  background: #febc2e;
}
.dot.green {
  background: #28c840;
}

.terminal-body {
  background: #0d1117;
  padding: 1.2rem 1.4rem;
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  line-height: 1.9;
  color: #c9d1d9;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.terminal-body p {
  margin-bottom: 0.25rem;
}

.t-comment {
  color: #6a737d;
}
.t-cmd {
  color: #79c0ff;
}
.t-flag {
  color: #ff7b72;
}
.t-url {
  color: #93c5fd;
  text-decoration: underline;
}
.t-success {
  color: #93c5fd;
}

/* ── Quick-deploy strip ───────────────────────────────────────────────────── */

.cmd-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: #0d1117;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  padding: 0.55rem 1rem;
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  color: #79c0ff;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
}

.btn-copy {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: #6a737d;
  cursor: pointer;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1;
  transition: color 0.12s;
}

.btn-copy:hover {
  color: #c9d1d9;
}

/* ── Info callout note (shared across pages) ─────────────────────────────── */

.qs-note {
  background: rgba(59, 130, 246, 0.07);
  border-left: 3px solid #3b82f6;
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.qs-note strong {
  color: #1d4ed8;
}

[data-bs-theme="dark"] .qs-note strong {
  color: #93c5fd;
}

/* ── Stats ───────────────────────────────────────────────────────────────── */

.stat-number {
  font-size: 2.4rem;
  font-weight: 800;
  color: #1d4ed8; /* blue-700 — 5.2:1 on zinc-100 */
  line-height: 1;
}

[data-bs-theme="dark"] .stat-number {
  color: #60a5fa; /* blue-400 — 4.6:1 on zinc-950 */
}

/* ── Stat Cards ─────────────────────────────────────────────────────────── */

.stat-card {
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  background: rgba(var(--stat-rgb), 0.07);
  border: 1px solid rgba(var(--stat-rgb), 0.2);
  border-radius: 10px;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.18s;
}

.stat-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(var(--stat-rgb), 0.45);
}

.stat-card-icon {
  font-size: 2rem;
  line-height: 1;
  color: var(--stat-color);
}

.stat-card .stat-number {
  font-size: 2.2rem;
  color: var(--stat-color);
}

.stat-card--blue {
  --stat-rgb: 59, 130, 246;
  --stat-color: #60a5fa;
}
.stat-card--purple {
  --stat-rgb: 139, 92, 246;
  --stat-color: #a78bfa;
}
.stat-card--green {
  --stat-rgb: 16, 185, 129;
  --stat-color: #34d399;
}
.stat-card--amber {
  --stat-rgb: 245, 158, 11;
  --stat-color: #fbbf24;
}

/* ── Feature Cards ───────────────────────────────────────────────────────── */

.feature-card {
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 1.75rem;
  transition:
    border-color 0.18s,
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
  border-color: #3b82f6;
  transform: translateY(-5px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #1d4ed8; /* blue-700 */
}

[data-bs-theme="dark"] .feature-icon {
  color: #60a5fa; /* blue-400 */
}

/* ── How It Works ────────────────────────────────────────────────────────── */

.bg-subtle {
  background-color: var(--bs-tertiary-bg);
}

.step-card {
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  transition:
    border-color 0.18s,
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-card:hover {
  border-color: #3b82f6;
  transform: translateY(-5px);
}

.step-number {
  font-size: 3rem;
  font-weight: 900;
  color: #1d4ed8; /* blue-700 */
  line-height: 1;
}

[data-bs-theme="dark"] .step-number {
  color: #60a5fa; /* blue-400 */
}

.step-icon {
  font-size: 1.8rem;
  color: var(--bs-secondary-color);
}

/* ── Code Callout ────────────────────────────────────────────────────────── */

.code-callout {
  background: #0d1117;
  border: 1px solid #3f3f46;
  border-radius: 10px;
  padding: 1.5rem;
  overflow: hidden;
}

.code-callout pre {
  font-family: "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 0.82rem;
  color: #c9d1d9;
  line-height: 1.8;
  white-space: pre-wrap;
  max-width: 100%;
  overflow-x: auto;
}

.json-key {
  color: #79c0ff;
}
.json-str {
  color: #a5d6ff;
}

/* ── Comparison Table ─────────────────────────────────────────────────────── */

.compare-wrap {
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  overflow: hidden;
}

.compare-row {
  display: grid;
  grid-template-columns: 2fr 1.6fr 1.6fr;
  border-bottom: 1px solid var(--bs-border-color);
}

.compare-row--last {
  border-bottom: none;
}

.compare-row--head {
  background: var(--bs-tertiary-bg);
}

.compare-cell {
  padding: 0.9rem 1.25rem;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  line-height: 1.45;
}

.compare-row--head .compare-cell {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.4rem 1.25rem;
  font-size: 0.92rem;
}

.compare-cell--label {
  color: var(--bs-body-color);
  font-weight: 500;
}

.compare-cell--them {
  border-left: 1px solid var(--bs-border-color);
  background: rgba(239, 68, 68, 0.04);
  color: var(--bs-secondary-color);
  justify-content: center;
  text-align: center;
}

.compare-cell--us {
  border-left: 1px solid rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.06);
  color: var(--bs-body-color);
  justify-content: center;
  text-align: center;
  font-weight: 500;
}

.compare-sub {
  font-size: 0.72rem;
  opacity: 0.6;
  margin-top: 4px;
  font-weight: 400;
}

.compare-icon-bad {
  color: #f87171;
  flex-shrink: 0;
}

.compare-icon-good {
  color: #4ade80;
  flex-shrink: 0;
}

@media (max-width: 575.98px) {
  /* Stack: label spans full width on top, two value cells side-by-side below */
  .compare-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "label label"
      "them  us";
  }

  .compare-cell--label {
    grid-area: label;
    display: flex;
    font-size: 0.8rem;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--bs-border-color);
  }

  .compare-cell--them {
    grid-area: them;
    border-left: none;
    font-size: 0.78rem;
    padding: 0.7rem 0.6rem;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }

  .compare-cell--us {
    grid-area: us;
    font-size: 0.78rem;
    padding: 0.7rem 0.6rem;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
  }

  /* Head row: no label, two header cells fill the full width */
  .compare-row--head {
    grid-template-areas: "them us";
    grid-template-rows: auto;
  }

  .compare-row--head .compare-cell--label {
    display: none;
  }

  .compare-row--head .compare-cell {
    padding: 1rem 0.6rem;
    font-size: 0.82rem;
  }
}

/* ── Compare Chart Cards ─────────────────────────────────────────────── */

.compare-chart-card {
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: 10px;
  padding: 1.4rem 1.4rem 1rem;
}

.compare-chart-title {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.compare-chart-unit {
  font-size: 0.73rem;
  color: var(--bs-secondary-color);
  margin-bottom: 1.1rem;
}

/* ── FAQ ─────────────────────────────────────────────────────────────────── */

.faq-item {
  background: transparent;
  border: 1px solid var(--bs-border-color) !important;
  border-radius: 10px !important;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.faq-item .accordion-button {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 10px !important;
  box-shadow: none !important;
}

.faq-item .accordion-button:not(.collapsed) {
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8; /* blue-700 — passes on white bg */
}

[data-bs-theme="dark"] .faq-item .accordion-button:not(.collapsed) {
  color: #93c5fd; /* blue-300 — passes on zinc-900 bg */
}

[data-bs-theme="dark"] .faq-item .accordion-button::after {
  filter: invert(1);
}

.faq-item .accordion-body {
  background: var(--bs-secondary-bg);
  border-top: 1px solid var(--bs-border-color);
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--bs-secondary-color);
}

/* ── CTA Section ─────────────────────────────────────────────────────────── */

#cta-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.cta-section {
  background: linear-gradient(
    to bottom,
    var(--bs-secondary-bg),
    var(--bs-tertiary-bg)
  );
}

/* ── FAQ section gradient ────────────────────────────────────────────────── */

#faq {
  background: linear-gradient(
    to bottom,
    var(--bs-body-bg),
    var(--bs-secondary-bg)
  );
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

footer {
  background: linear-gradient(
    to bottom,
    var(--bs-tertiary-bg),
    var(--bs-body-bg)
  );
}

/* ── Scroll reveal animation ─────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal.reveal-left {
  transform: translateX(-36px);
}
.reveal.reveal-right {
  transform: translateX(36px);
}
.reveal.reveal-scale {
  transform: scale(0.88) translateY(16px);
}
.reveal.reveal-heading {
  transform: translateY(40px);
  transition-duration: 0.7s;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Back to top button ────────────────────────────────────────────────────── */

#backToTop {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1050;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
  color: var(--bs-body-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s,
    background 0.15s,
    border-color 0.15s;
}

#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#backToTop:hover {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

/* ── Responsive tweaks ───────────────────────────────────────────────────── */

/* Navbar: solid background when hamburger menu is open (< lg) */
@media (max-width: 991.98px) {
  /* Replace horizontal reveal animations with vertical to avoid overflow */
  .reveal.reveal-left,
  .reveal.reveal-right {
    transform: translateY(28px);
  }

  .navbar-collapse.show,
  .navbar-collapse.collapsing {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.75rem 1rem 1rem;
    margin-top: 0.25rem;
  }
  .navbar-collapse .nav-link {
    padding: 0.4rem 0.25rem;
  }
}

@media (max-width: 768px) {
  .display-2 {
    font-size: 2rem;
  }
  .display-6 {
    font-size: 1.4rem;
  }
  .hero-section {
    padding-top: 76px;
    padding-bottom: 3rem;
  }
  .hero-glow {
    width: 320px;
    height: 320px;
    top: -60px;
  }
  .hero-terminal {
    border-radius: 8px;
  }
  .terminal-body {
    font-size: 0.75rem;
    padding: 1rem;
  }
  .stat-number {
    font-size: 1.9rem;
  }
  .py-6 {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  .step-number {
    font-size: 2rem;
  }
  .feature-card,
  .step-card {
    padding: 1.25rem;
  }
  .code-callout {
    padding: 1rem;
  }
}

@media (max-width: 576px) {
  .display-2 {
    font-size: 1.65rem;
  }
  .hero-section .d-flex.gap-3.flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-section .btn-lg {
    width: 100%;
    text-align: center;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  #cta .d-flex.gap-3.flex-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  #cta .btn-lg {
    width: 100%;
    text-align: center;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .py-6 {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}
