/* ============================================================
   ALPHA POD — Base Design System
   Dark fintech / institutional trading aesthetic
   ============================================================ */

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

:root {
  /* Surfaces */
  --bg: #0a0a0b;
  --surface-1: #111111;
  --surface-2: #161616;
  --surface-3: #1a1a1a;
  --surface-blue-1: #0d1117;
  --surface-blue-2: #111820;
  --surface-card: linear-gradient(145deg, #1a1a1a 0%, #111111 50%, #0a0a0a 100%);

  /* Brand */
  --gold: #c9a84c;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --gold-glow: rgba(201, 168, 76, 0.06);

  /* Semantic */
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --amber: #e07b00;

  /* Text — premium off-white hierarchy */
  --text-primary: rgba(255,255,255,0.95);
  --text-secondary: rgba(255,255,255,0.65);
  --text-tertiary: rgba(255,255,255,0.45);
  --text-faint: rgba(255,255,255,0.30);

  /* Borders */
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-gold: rgba(201, 168, 76, 0.2);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Type scale — pushed hero to TWI-level 5.5rem max */
  --text-xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.8125rem, 0.75rem + 0.25vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.25vw, 1.0625rem);
  --text-lg: clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.1rem + 1vw, 2rem);
  --text-2xl: clamp(2rem, 1rem + 3vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4.5vw, 5.5rem);
  --text-display: clamp(3rem, 1.5rem + 5vw, 6rem);

  /* Fonts */
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Radius — TWI/premium reference: 24px cards, 9999px buttons */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition: 300ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 600ms cubic-bezier(0.23, 1, 0.32, 1);

  /* Edge lighting tokens */
  --edge-subtle: rgba(255,255,255,0.06);
  --edge-medium: rgba(255,255,255,0.10);
  --edge-strong: rgba(255,255,255,0.16);

  /* Layout */
  --content-max: 1280px;
  --content-narrow: 800px;
  --nav-height: 64px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--bar-height, 40px) + var(--space-8));
}

body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { letter-spacing: -0.03em; }
h2 { letter-spacing: -0.022em; }

p { max-width: 65ch; text-wrap: pretty; }

::selection {
  background: rgba(201, 168, 76, 0.25);
  color: var(--text-primary);
}

/* ============================================================
   FILM GRAIN TEXTURE — Borrowed from Kairos/AlphaTrades
   SVG feTurbulence noise at 3% opacity. Prevents dark bg
   from feeling flat/digital. Invisible until you look for it.
   ============================================================ */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
  z-index: 1000;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   SHARED COMPONENTS
   ============================================================ */

/* Container */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Section spacing — generous at large screens */
.section {
  padding: clamp(4rem, 8vw, 8rem) 0;
}

@media (min-width: 1280px) {
  .section { padding: 10rem 0; }
}

/* Section pre-header — eyebrow */
.section__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: var(--space-4);
}

/* Section headline */
.section__title {
  font-size: var(--text-2xl);
  font-weight: 600;
  line-height: 1.12;
  margin-bottom: var(--space-4);
}

.section__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 600px;
}

/* Divider — gradient fade, not solid border */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent);
  border: none;
  max-width: 1200px;
  margin: 0 auto;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--primary {
  background: var(--green);
  color: #000;
}
.btn--primary:hover {
  background: #16a34a;
  box-shadow: 0 4px 24px rgba(34, 197, 94, 0.3);
}

.btn--primary:active {
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
}

.btn--ghost {
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  background: transparent;
}
.btn--ghost:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}

.btn--ghost:active {
  background: rgba(255,255,255,0.06);
}

/* Arrow micro-interaction on CTAs with → */
.btn--arrow svg,
.btn--arrow .btn-arrow {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

.btn--arrow:hover svg,
.btn--arrow:hover .btn-arrow {
  transform: translateX(3px);
}

.btn--gold {
  background: var(--gold);
  color: #000;
}
.btn--gold:hover {
  background: #d4b35a;
  box-shadow: 0 4px 24px rgba(201, 168, 76, 0.3);
}

.btn--sm {
  padding: 10px 20px;
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 18px 36px;
  font-size: var(--text-base);
}

/* ============================================================
   CARDS
   ============================================================ */

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow:
    inset 0 1px 0 var(--edge-subtle),
    0 4px 24px rgba(0,0,0,0.4);
  transition: border-color var(--transition), box-shadow var(--transition);
}

@media (min-width: 1024px) { .card { padding: 2.5rem; } }

.card:hover {
  border-color: var(--edge-medium);
  box-shadow:
    inset 0 1px 0 var(--edge-strong),
    inset 1px 0 0 var(--edge-subtle),
    0 8px 40px rgba(0,0,0,0.5);
}

.card--elevated {
  box-shadow:
    inset 0 1px 0 var(--edge-medium),
    0 8px 32px rgba(0,0,0,0.35),
    0 2px 8px rgba(0,0,0,0.2);
}

.card--trading {
  box-shadow:
    inset 0 1px 0 rgba(16,185,129,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    0 4px 24px rgba(0,0,0,0.5);
  border-color: rgba(16,185,129,0.08);
}

/* ============================================================
   NAVIGATION
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition:
    background 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-bottom-color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) { .nav { height: 80px; } }

.nav.is-scrolled {
  background: rgba(10,10,11,0.90);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 12px rgba(0,0,0,0.3);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav__logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  70%  { box-shadow: 0 0 0 6px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

@keyframes ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* ============================================================
   SCROLL-DRIVEN REVEAL SYSTEM
   CSS-native scroll animations for section entries.
   Stagger with animation-delay on children.
   ============================================================ */

.reveal-up {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger delays for grid children */
.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > *:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > *:nth-child(6) { transition-delay: 400ms; }

/* Hero-specific stagger (faster, tighter) */
.hero-stagger > *:nth-child(1) { transition-delay: 0ms; }
.hero-stagger > *:nth-child(2) { transition-delay: 120ms; }
.hero-stagger > *:nth-child(3) { transition-delay: 240ms; }
.hero-stagger > *:nth-child(4) { transition-delay: 360ms; }
.hero-stagger > *:nth-child(5) { transition-delay: 480ms; }
.hero-stagger > *:nth-child(6) { transition-delay: 600ms; }
.hero-stagger > *:nth-child(7) { transition-delay: 720ms; }

/* Number count-up elements */
[data-countup] {
  font-variant-numeric: tabular-nums;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  padding: var(--space-2) 0;
  transition: color 200ms ease;
}

.nav__link:hover {
  color: white;
  background: none;
}

.nav__link--active {
  color: white;
}

.nav__cta {
  margin-left: var(--space-3);
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  position: relative;
  transition: background var(--transition);
}

.nav__toggle span::before,
.nav__toggle span::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: inherit;
  left: 0;
  transition: transform var(--transition);
}

.nav__toggle span::before { transform: translateY(-6px); }
.nav__toggle span::after { transform: translateY(6px); }

/* Mobile menu */
.nav__mobile-menu {
  display: none;
  position: fixed;
  top: calc(var(--nav-height) + var(--bar-height, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  padding: var(--space-6);
  flex-direction: column;
  gap: var(--space-2);
  z-index: 99;
}

.nav__mobile-menu.is-open { display: flex; }

.nav__mobile-link {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.nav__mobile-link:hover,
.nav__mobile-link--active { color: var(--text-primary); }

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
  padding-top: 5rem;
  border-top: none;
}

.footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06) 20%, rgba(255,255,255,0.06) 80%, transparent);
  margin-bottom: 5rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer__brand-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-3);
  max-width: 320px;
}

.footer__col-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

.footer__link {
  display: block;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-1) 0;
  transition: color var(--transition);
}

.footer__link:hover { color: var(--text-primary); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__live {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
}

.footer__disclaimer {
  font-size: 11px;
  color: var(--text-faint);
  max-width: 800px;
  line-height: 1.5;
  margin-top: var(--space-8);
}

.footer__socials {
  display: flex;
  gap: var(--space-3);
}

.footer__social-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-tertiary);
  transition: border-color 200ms ease, color 200ms ease;
}

.footer__social-icon:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.footer__social-icon svg { width: 16px; height: 16px; }

/* ============================================================
   STICKY BOTTOM CTA
   ============================================================ */

.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(10, 10, 11, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-out);
}

.sticky-cta.is-visible { transform: translateY(0); }

.sticky-cta__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.sticky-cta__text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.sticky-cta__close {
  position: absolute;
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  transition: color var(--transition);
}

.sticky-cta__close:hover { color: var(--text-primary); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__toggle { display: flex; }
  .nav__cta { display: none; }

  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .section {
    padding: clamp(var(--space-12), 6vw, var(--space-20)) 0;
  }
}


/* ============================================================
   TOUCH FEEDBACK — Mobile active state
   ============================================================ */
@media (hover: none) {
  .card:active,
  .pricing__card:active,
  .faq__question:active,
  .btn:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }
  .touch-target {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
}


/* ============================================================
   CLIP-PATH REVEALS — Modern scroll entry (replaces some fade-ups)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .reveal-clip-up {
    clip-path: inset(100% 0 0 0);
    transition: clip-path 0.8s cubic-bezier(0.77, 0, 0.175, 1);
  }
  .reveal-clip-up.is-visible {
    clip-path: inset(0% 0 0 0);
  }
  .reveal-clip-right {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1);
  }
  .reveal-clip-right.is-visible {
    clip-path: inset(0 0% 0 0);
  }
}
