/* ═══════════════════════════════════════════════════════════
   ASG Pay — Shared Design System
   Matches asgcard.dev production standard
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─── Design Tokens ─── */
:root {
  /* Surfaces — pure black like asgcard.dev */
  --bg-base: #000000;
  --bg-surface: #0a0a0a;
  --bg-elevated: #111111;
  --bg-glass: rgba(10, 10, 10, 0.8);

  /* Borders — sharp, minimal */
  --border: #1a1a1a;
  --border-hover: #2a2a2a;
  --border-active: rgba(168, 85, 247, 0.4);

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #888888;
  --text-muted: #555555;

  /* Accents — asgcard.dev palette */
  --accent-purple: #a855f7;
  --accent-vivid: #bd00ff;
  --accent-blue: #0052FF;
  --accent-green: #22c55e;
  --accent-orange: #f97316;
  --accent-cyan: #06b6d4;
  --accent-gold: #eab308;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  --gradient-hero: linear-gradient(135deg, #a855f7 0%, #0052FF 50%, #06b6d4 100%);
  --gradient-fund: linear-gradient(135deg, #a855f7, #c084fc);
  --gradient-card: linear-gradient(135deg, #0052FF, #38bdf8);
  --gradient-pay: linear-gradient(135deg, #f97316, #eab308);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Spacing */
  --section-gap: clamp(80px, 8vw, 120px);
  --container-max: 1100px;
  --container-padding: 24px;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 100px;

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --transition: all 0.2s var(--ease);
  --transition-slow: all 0.4s var(--ease);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

::selection {
  background: rgba(168, 85, 247, 0.3);
  color: #fff;
}

/* ─── Background Texture ─── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.015) 1px, transparent 0);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

body > * {
  position: relative;
  z-index: 1;
}

/* ─── Typography Scale ─── */
h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 16px;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  opacity: 0.8;
}

/* ─── Accent Text ─── */
.accent {
  color: var(--accent-purple);
}

.accent-gradient {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 var(--container-padding);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(0, 0, 0, 0.7);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s var(--ease);
}

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

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

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

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-primary) !important;
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
}

.nav-cta:hover {
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  opacity: 1 !important;
}

.nav-social {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-social a {
  color: var(--text-muted);
  display: flex;
}

.nav-social a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.nav-social svg {
  width: 18px;
  height: 18px;
}

/* ─── Sections ─── */
.section {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-gap) var(--container-padding);
}

.section-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.7;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  background: transparent;
  color: var(--text-primary);
}

.btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface);
  transform: translateY(-1px);
  opacity: 1;
}

.btn-primary {
  background: var(--bg-surface);
  border-color: var(--border-hover);
}

.btn-primary:hover {
  background: var(--bg-elevated);
  border-color: #333;
}

.btn-accent {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  color: white;
}

.btn-accent:hover {
  background: #9333ea;
  border-color: #9333ea;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.btn-full { width: 100%; }

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

/* ─── Cards ─── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* ─── Live Dot ─── */
.live-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  display: inline-block;
  animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ─── Badge / Pill ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-purple {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--accent-purple);
}

.badge-green {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--accent-green);
  font-size: 10px;
  padding: 2px 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ─── Terminal ─── */
.terminal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  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: 12px;
  color: var(--text-muted);
}

.terminal-body {
  padding: 16px;
  min-height: 240px;
  max-height: 400px;
  overflow-y: auto;
}

.terminal-line {
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ─── Code Block ─── */
.code-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.code-block pre {
  padding: 16px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-secondary);
}

/* Syntax colors — Material Ocean palette */
.code-block .kw { color: #c792ea; }
.code-block .str { color: #c3e88d; }
.code-block .fn { color: #82aaff; }
.code-block .cm { color: #546e7a; }
.code-block .num { color: #f78c6c; }
.code-block .op { color: #89ddff; }

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-xs);
  padding: 3px 10px;
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.copy-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

/* ─── Result Card ─── */
.result-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  margin-top: 12px;
  animation: slideUp 0.35s var(--ease);
}

.result-card.success {
  background: rgba(34, 197, 94, 0.04);
  border-color: rgba(34, 197, 94, 0.15);
}

.result-card .result-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 8px;
}

.result-card .result-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}

.result-card .result-label { color: var(--text-muted); }
.result-card .result-value { color: var(--text-primary); font-family: var(--font-mono); }

/* ─── Progress Bar ─── */
.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 12px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  width: 0%;
}

.progress-fill.fund { background: var(--gradient-fund); }
.progress-fill.card { background: var(--gradient-card); }
.progress-fill.pay { background: var(--gradient-pay); }

/* ─── Footer ─── */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px var(--container-padding);
  margin-top: var(--section-gap);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--text-primary);
  opacity: 1;
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Sponsor / Logo Wall ─── */
.logo-wall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 40px 0;
}

.logo-wall-item {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.4;
  transition: var(--transition-slow);
  cursor: default;
}

.logo-wall-item:hover {
  opacity: 1;
  color: var(--text-secondary);
}

.footer-brand-link {
  margin-bottom: 8px;
}

/* ─── Animations ─── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Entrance animation class — added by IntersectionObserver */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children reveals */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.06s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.18s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.30s; opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > *:nth-child(7) { transition-delay: 0.36s; opacity: 1; transform: translateY(0); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }

/* ─── Accessibility ─── */
:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 8px 16px;
  background: var(--accent-purple);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

/* ─── Hamburger Menu (Mobile) ─── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

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

/* ─── Prefers Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

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

  .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 24px;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
    animation: fadeIn 0.2s var(--ease);
  }

  .nav-links a {
    font-size: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-links a.nav-cta {
    margin-top: 12px;
    justify-content: center;
    font-size: 16px;
    padding: 14px;
    border-bottom: none;
  }

  .nav-social { display: none; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

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

  h1 {
    font-size: clamp(2rem, 8vw, 2.8rem);
  }

  h2 {
    font-size: clamp(1.4rem, 5vw, 1.8rem);
  }
}
