/* Godmode — Shared Theme */
:root {
  --bg: #000000;
  --bg-card: #0a0f0a;
  --bg-terminal: #030803;
  --border: #0f3a0f;
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-muted: #0a6b2a;
  --green-dark: #064016;
  --green-glow: rgba(0, 255, 65, 0.12);
  --green-glow-strong: rgba(0, 255, 65, 0.25);
  --text: #00ff41;
  --text-dim: #00aa2a;
  --text-muted: #065a20;
  --white: #c0ffc0;
  --red: #ff3333;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dark) var(--bg);
}

html::-webkit-scrollbar {
  width: 6px;
}

html::-webkit-scrollbar-track {
  background: var(--bg);
}

html::-webkit-scrollbar-thumb {
  background: var(--green-dark);
  border-radius: 3px;
}

html::-webkit-scrollbar-thumb:hover {
  background: var(--green-muted);
}

body {
  font-family: "JetBrains Mono", monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Site-wide input text contrast: keep selected/autofilled text legible
   against the terminal theme instead of washing white on white. Per-page
   overrides (e.g. kombat's amber) take precedence via higher specificity. */
::selection { background: var(--text); color: var(--bg); }
::-moz-selection { background: var(--text); color: var(--bg); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-terminal) inset !important;
  caret-color: var(--text) !important;
  transition: background-color 999999s ease-in-out 0s;
}

/* Scanline overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* 3D Matrix rain canvas (hyperspace tunnel) */
#matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.42;
  pointer-events: none;
  will-change: transform;
}
@media (max-width: 768px) {
  #matrix-canvas { opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) {
  #matrix-canvas { opacity: 0.22; }
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--green);
  color: #000;
  padding: 8px 16px;
  z-index: 10000;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Shared container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* Global nav bar */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  animation: flicker 4s infinite;
}

nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: nowrap;
}

.nav-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--green);
  text-decoration: none;
  text-shadow: 0 0 10px var(--green-glow-strong);
  margin-right: auto;
  white-space: nowrap;
}

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  transition: color 0.2s;
  white-space: nowrap;
  margin-left: 8px;
}

.nav-link:hover {
  color: var(--green);
}

.nav-cta {
  background: transparent;
  color: var(--green);
  padding: 8px 20px;
  border: 1px solid var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
  margin-left: auto;
}

.nav-cta:hover {
  background: var(--green);
  color: #000;
  box-shadow: 0 0 20px var(--green-glow-strong);
}

/* Nav dropdowns */
.nav-dropdown {
  position: relative;
  margin-left: 8px;
}

.nav-dropdown-trigger {
  color: var(--text-dim);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
  user-select: none;
}

.nav-dropdown-trigger:hover {
  color: var(--green);
}

.nav-chevron {
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.2s;
  display: inline-block;
}

.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-top: 1px solid var(--green-dim);
  min-width: 200px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-panel,
.nav-dropdown.dropdown-open .nav-dropdown-panel {
  opacity: 1;
  visibility: visible;
}

.nav-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown.dropdown-open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-item {
  display: block;
  padding: 10px 20px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  color: var(--green);
  background: rgba(0, 255, 65, 0.05);
}

/* Common animations */
@keyframes pulse-green {
  0%,
  100% {
    box-shadow:
      0 0 40px var(--green-glow),
      inset 0 0 40px var(--green-glow);
  }
  50% {
    box-shadow:
      0 0 80px var(--green-glow-strong),
      inset 0 0 60px var(--green-glow);
  }
}

@keyframes cursor-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Common card style used across subpages */
.gm-card {
  position: relative;
  z-index: 1;
  max-width: 520px;
  width: 100%;
  margin: 24px;
  border: 2px solid var(--green);
  background: var(--bg-card);
  padding: 48px 40px;
  text-align: center;
  box-shadow:
    0 0 80px var(--green-glow),
    inset 0 0 60px var(--green-glow);
  animation: pulse-green 4s infinite;
}

.gm-tag {
  display: inline-block;
  background: var(--green);
  color: #000;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 24px;
}

.gm-back-link {
  text-align: center;
  margin-top: 16px;
  position: relative;
  z-index: 1;
}

.gm-back-link a {
  color: var(--green-dark);
  text-decoration: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gm-back-link a:hover {
  color: var(--green);
}

.gm-footer-note {
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}

.gm-footer-note a {
  color: var(--green-muted);
  text-decoration: none;
}

.gm-footer-note a:hover {
  color: var(--green);
}

/* Footer */
footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

footer a {
  color: var(--text-dim);
  text-decoration: none;
}

footer a:hover {
  color: var(--green);
}

/* Hamburger menu button — hidden on desktop */
.nav-hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--green);
  font-size: 18px;
  padding: 4px 8px;
  cursor: pointer;
  font-family: "JetBrains Mono", monospace;
  line-height: 1;
}

.nav-hamburger:hover {
  border-color: var(--green);
}

/* Current page indicator — shown in mobile hamburger */
.nav-current-page {
  display: none;
}

/* Responsive */
@media (max-width: 768px) {
  /* Kill the flicker animation on mobile — causes glitch through hamburger */
  nav {
    animation: none !important;
  }

  nav .container {
    gap: 8px;
    flex-wrap: wrap;
  }

  .nav-logo {
    font-size: 15px;
    margin-right: 0;
  }

  .nav-hamburger {
    display: block;
    margin-left: auto;
  }

  .nav-link,
  .nav-cta,
  .nav-dropdown {
    display: none;
  }

  /* Show current page label between logo and hamburger */
  .nav-current-page {
    display: inline-block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-left: auto;
    margin-right: 8px;
  }

  nav.nav-open .nav-link,
  nav.nav-open .nav-cta,
  nav.nav-open .nav-dropdown {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 14px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    letter-spacing: 2px;
    transition: background 0.15s, color 0.15s;
  }

  nav.nav-open .nav-link:active,
  nav.nav-open .nav-cta:active {
    background: rgba(0, 255, 65, 0.08);
  }

  nav.nav-open .nav-cta {
    background: transparent;
    color: var(--green);
    border-bottom: 1px solid var(--border);
    margin-top: 0;
    padding: 14px 0;
  }

  /* Mobile dropdown overrides */
  nav.nav-open .nav-dropdown {
    padding: 0;
    border-bottom: none;
  }

  nav.nav-open .nav-dropdown-trigger {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-weight: 600;
  }

  nav.nav-open .nav-dropdown-trigger:active {
    background: rgba(0, 255, 65, 0.08);
  }

  nav.nav-open .nav-dropdown-panel {
    position: static;
    transform: none;
    background: rgba(0, 255, 65, 0.02);
    backdrop-filter: none;
    border: none;
    border-bottom: 1px solid var(--border);
    min-width: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s, max-height 0.25s, visibility 0.2s;
  }

  nav.nav-open .nav-dropdown.dropdown-open .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    max-height: 520px;
  }

  /* Disable hover on mobile — use tap only */
  nav.nav-open .nav-dropdown:hover .nav-dropdown-panel {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
  }
  nav.nav-open .nav-dropdown.dropdown-open:hover .nav-dropdown-panel {
    opacity: 1;
    visibility: visible;
    max-height: 520px;
  }

  nav.nav-open .nav-dropdown-item {
    padding: 12px 0;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
  }

  nav.nav-open .nav-dropdown-item:last-child {
    border-bottom: none;
  }

  /* Prevent horizontal scroll on mobile */
  .container {
    overflow-x: hidden;
  }

  /* Footer — stack links vertically on mobile */
  footer p + p {
    font-size: 0;
  }
  footer p + p a {
    display: block;
    padding: 10px 0;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
  }
  footer p + p a:last-child {
    border-bottom: none;
  }
}

@media (max-width: 600px) {
  .gm-card {
    padding: 32px 20px;
  }
}

/* Mobile overflow protection — tables, pre, and long text */
@media (max-width: 480px) {
  .table-scroll-wrap {
    position: relative;
    margin-bottom: 20px;
  }
  .table-scroll-wrap .info-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
  }
  .table-scroll-wrap::after {
    content: "\2192  swipe";
    position: absolute;
    bottom: -18px;
    right: 0;
    font-size: 10px;
    color: var(--green-dark);
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
  }
  .table-scroll-wrap.scrolled::after {
    opacity: 0;
  }
  .article-wrap pre {
    font-size: 11px;
  }
}

/* Built-by-skill badge on blog posts */
.built-by-skill {
  border: 1px solid var(--green);
  background: rgba(0, 255, 100, 0.04);
  padding: 14px 18px;
  margin: 20px 0 28px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.built-by-skill .bbs-text { flex: 1 1 300px; }
.built-by-skill code {
  color: var(--green);
  background: rgba(0, 255, 100, 0.08);
  padding: 1px 6px;
}
.built-by-skill strong { color: var(--green); }
.built-by-skill a.bbs-dl {
  color: #000;
  background: var(--green);
  padding: 7px 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
}
.built-by-skill a.bbs-dl:hover { box-shadow: 0 0 20px var(--green-glow); }

/* ── Dual pricing: shared across pricing.html / index.html / product pages ── */
.price-big .per-yr {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 4px;
}
.price-alt {
  margin: 2px 0 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-align: center;
}
.price-alt .alt-amount { color: var(--text-dim); font-weight: 600; }
.price-alt .alt-note { opacity: 0.7; }
.price-onetime-link {
  display: block;
  text-align: center;
  margin-top: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.price-onetime-link:hover { color: var(--text-dim); text-decoration: underline; }
.price-onetime-link .onetime-amount { color: var(--text-dim); font-weight: 600; }

/* ── One-Shot tier counter widget ── */
.tier-counter {
  margin: 16px 0 4px;
  padding: 14px 12px;
  border: 1px solid rgba(255, 170, 51, 0.25);
  background: rgba(0, 0, 0, 0.3);
}
.tier-counter .tier-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #ffaa33;
  opacity: 0.75;
  margin: 0 0 10px 0;
  letter-spacing: 1.5px;
  text-align: left;
  text-transform: uppercase;
}
.tier-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 170, 51, 0.1);
  border: 1px solid rgba(255, 170, 51, 0.2);
  overflow: hidden;
}
.tier-progress-fill {
  height: 100%;
  background: #ffaa33;
  box-shadow: 0 0 12px rgba(255, 170, 51, 0.4);
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.tier-info {
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-align: left;
}
.tier-spots-num { color: #ffaa33; font-weight: 700; }
.tier-spots-num.tier-urgent {
  color: #ff4444;
  animation: pulse-urgent 1.5s ease-in-out infinite;
}
@keyframes pulse-urgent {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.tier-next {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  text-align: left;
}
.tier-next-price {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: line-through;
  font-weight: 600;
}

/* ── Anti-churn terms block ── */
.terms-block {
  margin-top: 48px;
  padding: 24px 28px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}
.terms-block h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 14px;
}
.terms-block ul { list-style: none; padding: 0; margin: 0; }
.terms-block li {
  font-size: 12px;
  color: var(--text-dim);
  padding: 6px 0;
  line-height: 1.6;
}
.terms-block li::before { content: "// "; color: var(--text-muted); }
.terms-block strong { color: var(--text-dim); font-weight: 600; }
