/* ═══════════════════════════════════════════════════════════════════════════
   AiPayGen Design System — main.css
   Dark theme, glass morphism, premium micro-interactions
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  --bg: #020408;
  --bg-elevated: #0d1117;
  --surface: rgba(13,17,23,0.8);
  --surface-hover: rgba(13,17,23,0.95);
  --border: rgba(0,255,157,0.1);
  --border-hover: rgba(0,255,157,0.25);
  --accent: #00ff9d;
  --accent-dim: rgba(0,255,157,0.15);
  --accent2: #00d4ff;
  --accent2-dim: rgba(0,212,255,0.15);
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --danger: #f85149;
  --warning: #d29922;
  --success: #3fb950;
  --font-mono: 'IBM Plex Mono', 'Fira Code', monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-glow: 0 0 20px rgba(0,255,157,0.1);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Typography scale (1.25 ratio) */
  --text-xs: 0.64rem;
  --text-sm: 0.8rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.563rem;
  --text-2xl: 1.953rem;
  --text-3xl: 2.441rem;
  --text-4xl: 3.052rem;
  --text-hero: clamp(2.5rem, 6vw, 4.5rem);
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent2); }
img { max-width: 100%; display: block; }
code, pre { font-family: var(--font-mono); }

/* ── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; width: 100%; z-index: 100;
  background: rgba(2,4,8,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0;
  transition: border-color var(--transition);
}
.nav.scrolled { border-bottom-color: var(--border-hover); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-mono); font-size: var(--text-lg);
  font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px;
}
.nav-logo .dot {
  width: 8px; height: 8px; background: var(--accent); border-radius: 50%;
  box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,255,157,0.4);
  animation: pulse-dot 2s ease-in-out infinite;
}
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-links a {
  font-size: var(--text-sm); color: var(--text-secondary);
  transition: color var(--transition); font-weight: 500;
}
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  background: linear-gradient(135deg, var(--accent), #00cc7d);
  color: #000; padding: 6px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: var(--text-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.nav-links .nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,255,157,0.3);
  color: #000;
}
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; transition: var(--transition);
}
@media (max-width: 768px) {
  .nav-hamburger { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(2,4,8,0.98); backdrop-filter: blur(20px);
    flex-direction: column; padding: 16px 24px; gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-weight: 600;
  border: none; cursor: pointer; border-radius: var(--radius-md);
  transition: all var(--transition); text-decoration: none;
  font-size: var(--text-base); padding: 12px 28px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00cc7d);
  color: #000; box-shadow: 0 2px 12px rgba(0,255,157,0.2);
}
.btn-primary:hover {
  transform: translateY(-2px); color: #000;
  box-shadow: 0 6px 24px rgba(0,255,157,0.35);
}
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  border-color: var(--border-hover); color: var(--text);
  background: var(--accent-dim);
}
.btn-sm { font-size: var(--text-sm); padding: 8px 18px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}
.card-accent {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(0,255,157,0.08);
}

/* ── Code Blocks ────────────────────────────────────────────────────────── */
.code-block {
  position: relative; background: #0d1117;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden;
}
.code-block pre {
  padding: 16px 20px; overflow-x: auto; font-size: var(--text-sm);
  line-height: 1.7; color: var(--text);
}
.code-block .copy-btn {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-secondary); padding: 4px 10px; border-radius: var(--radius-sm);
  font-size: var(--text-xs); cursor: pointer; font-family: var(--font-mono);
  transition: all var(--transition); opacity: 0;
}
.code-block:hover .copy-btn { opacity: 1; }
.code-block .copy-btn:hover { background: var(--accent-dim); color: var(--accent); }
.code-block .copy-btn.copied { color: var(--success); }

/* ── Terminal ───────────────────────────────────────────────────────────── */
.terminal {
  background: #0d1117; border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-card);
}
.terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.terminal-dot {
  width: 12px; height: 12px; border-radius: 50%;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }
.terminal-title {
  flex: 1; text-align: center; font-size: var(--text-xs);
  color: var(--text-muted); font-family: var(--font-mono);
}
.terminal-body {
  padding: 20px; font-family: var(--font-mono);
  font-size: var(--text-sm); line-height: 1.8;
  min-height: 200px;
}
.terminal-body .prompt { color: var(--accent); }
.terminal-body .command { color: var(--text); }
.terminal-body .response { color: var(--text-secondary); }
.terminal-body .string { color: #a5d6ff; }
.terminal-body .number { color: #79c0ff; }
.terminal-body .key { color: #d2a8ff; }

/* ── Sections ───────────────────────────────────────────────────────────── */
.section {
  max-width: 1200px; margin: 0 auto; padding: 80px 24px;
}
.section-title {
  font-family: var(--font-mono); font-size: var(--text-2xl);
  font-weight: 700; margin-bottom: 12px;
}
.section-subtitle {
  color: var(--text-secondary); font-size: var(--text-lg);
  max-width: 600px; margin-bottom: 48px;
}

/* ── Bento Grid ─────────────────────────────────────────────────────────── */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 16px;
}
.bento-grid .card-lg { grid-column: span 2; }
@media (max-width: 1024px) {
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-grid .card-lg { grid-column: span 1; }
}

/* ── Stats Bar ──────────────────────────────────────────────────────────── */
.stats-bar {
  display: flex; justify-content: center; gap: 32px; flex-wrap: wrap;
  padding: 16px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-value {
  font-family: var(--font-mono); font-size: var(--text-xl);
  font-weight: 700; color: var(--accent);
}
.stat-label {
  font-size: var(--text-xs); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.stat-skeleton {
  width: 48px; height: 24px; background: var(--accent-dim);
  border-radius: var(--radius-sm); animation: shimmer 1.5s infinite;
  margin: 0 auto 4px;
}

/* ── Pricing Cards ──────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.pricing-card {
  text-align: center; padding: 32px 24px;
}
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 40px rgba(0,255,157,0.1);
  position: relative;
}
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), #00cc7d);
  color: #000; font-size: var(--text-xs); font-weight: 700;
  padding: 4px 16px; border-radius: 20px; text-transform: uppercase;
}
.pricing-amount {
  font-family: var(--font-mono); font-size: var(--text-3xl);
  font-weight: 700; margin: 16px 0 4px;
}
.pricing-period { color: var(--text-muted); font-size: var(--text-sm); }
.pricing-features {
  list-style: none; margin: 24px 0; text-align: left;
  font-size: var(--text-sm); color: var(--text-secondary);
}
.pricing-features li { padding: 6px 0; display: flex; align-items: center; gap: 8px; }
.pricing-features li::before {
  content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0;
}
@media (max-width: 1024px) { .pricing-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .pricing-grid { grid-template-columns: 1fr; } }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 24px;
  background: rgba(2,4,8,0.95);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
}
.footer-brand { color: var(--text-secondary); font-size: var(--text-sm); line-height: 1.7; }
.footer-brand .logo {
  font-family: var(--font-mono); font-size: var(--text-lg);
  font-weight: 700; color: var(--text); margin-bottom: 8px;
}
.footer-col h4 {
  font-size: var(--text-sm); font-weight: 600; color: var(--text);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
.footer-col a {
  display: block; font-size: var(--text-sm);
  color: var(--text-secondary); padding: 4px 0;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1200px; margin: 32px auto 0; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: var(--text-xs); color: var(--text-muted);
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(0,255,157,0.4); }
  50% { opacity: 0.6; box-shadow: 0 0 4px var(--accent); }
}
@keyframes shimmer {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ── Gradient Orb (hero background) ─────────────────────────────────────── */
.gradient-orb {
  position: absolute; width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,255,157,0.12) 0%, rgba(0,212,255,0.06) 40%, transparent 70%);
  filter: blur(80px); pointer-events: none;
  animation: gradient-shift 8s ease-in-out infinite;
  background-size: 200% 200%;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--text-xs); font-weight: 600;
  padding: 4px 12px; border-radius: 20px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(0,255,157,0.2);
}
.badge-cyan {
  background: var(--accent2-dim); color: var(--accent2);
  border-color: rgba(0,212,255,0.2);
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 1000;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 20px;
  font-size: var(--text-sm); color: var(--text);
  box-shadow: var(--shadow-card);
  transform: translateY(100px); opacity: 0;
  transition: all var(--transition);
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Utility ────────────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-secondary); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.pt-nav { padding-top: 64px; }

/* ── Focus Styles (Accessibility) ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ── Print Styles ──────────────────────────────────────────────────── */
@media print {
  .nav, .footer, .gradient-orb, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  a { color: #000; text-decoration: underline; }
  .btn { border: 1px solid #000; }
}

/* ── Scroll-to-Top ─────────────────────────────────────────────────── */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-dim); border: 1px solid var(--border);
  color: var(--accent); font-size: 1.2rem; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: all var(--transition); backdrop-filter: blur(8px);
}
.scroll-top:hover {
  background: var(--accent); color: #000;
  box-shadow: 0 4px 16px rgba(0,255,157,0.3);
}
.scroll-top.visible { display: flex; }

/* ── Reduced Motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .fade-in { opacity: 1; transform: none; }
}

/* ── Selection ─────────────────────────────────────────────────────── */
::selection { background: rgba(0,255,157,0.25); color: #fff; }
::-moz-selection { background: rgba(0,255,157,0.25); color: #fff; }
