/* ================================================
   APEXDMA — BASE STYLES v2.0
   Design tokens, reset, typography, global utils
   ================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700;800&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:            #05070F;
  --bg2:           #0B0E1A;
  --bg3:           #0F1220;
  --card:          rgba(15,18,32,0.75);
  --card-solid:    #0F1220;
  --accent:        #00C2FF;
  --accent2:       #7B5CFF;
  --accent-dim:    rgba(0,194,255,0.12);
  --accent2-dim:   rgba(123,92,255,0.12);
  --green:         #00E676;
  --green-dim:     rgba(0,230,118,0.12);
  --red:           #FF4D6A;
  --text:          #F0F4FF;
  --muted:         #8A94B2;
  --border:        rgba(255,255,255,0.06);
  --border-hover:  rgba(0,194,255,0.35);
  --border-card:   rgba(255,255,255,0.07);
  --font-heading:  'Space Grotesk', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --shadow-glow:   0 0 40px rgba(0,194,255,0.15);
  --shadow-card:   0 8px 32px rgba(0,0,0,0.4);
  --transition:    0.22s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.45s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); border: none; background: none; }
input, textarea { font-family: var(--font-body); }

/* ── Global Background ── */
#global-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.grid-layer {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,194,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,194,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
}
.grid-layer::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,194,255,0.05) 0%, transparent 70%);
}
.watermark {
  position: absolute;
  width: 700px; height: 700px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.018;
  filter: blur(2px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* ── Glow Orbs ── */
.orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  filter: blur(80px); opacity: 0.25;
}
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  top: -200px; right: -200px;
  animation: orbFloat 12s ease-in-out infinite alternate;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent2), transparent 70%);
  bottom: -150px; left: -150px;
  animation: orbFloat 16s ease-in-out infinite alternate-reverse;
}
@keyframes orbFloat {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px, -40px) scale(1.08); }
}

/* ── Typography ── */
.section-label {
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}
.section-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.section-sub {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 40px;
}
.blue { color: var(--accent); }
.purple { color: var(--accent2); }
.green { color: var(--green); }

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative; z-index: 1;
  /* Prevent any child from causing horizontal scroll */
  overflow-x: clip;
}
/* Hero content should never exceed container width */
.hero-content {
  max-width: 760px;
  width: 100%;
}

/* ── Pages (SPA routing) ── */
.page {
  display: none;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.page.active { display: block; }
.page.visible { opacity: 1; transform: translateY(0); }

/* ── Fade-In Observer ── */
.fi {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1), transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
.fi.vis { opacity: 1; transform: translateY(0); }
.fi-left { opacity:0; transform:translateX(-30px); transition: opacity 0.65s ease, transform 0.65s ease; }
.fi-left.vis { opacity:1; transform:translateX(0); }
.fi-right { opacity:0; transform:translateX(30px); transition: opacity 0.65s ease, transform 0.65s ease; }
.fi-right.vis { opacity:1; transform:translateX(0); }

/* ── Glassmorphism Card ── */
.glass {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
}
.card {
  background: var(--card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 28px rgba(0,194,255,0.08), var(--shadow-card);
  transform: translateY(-3px);
}

/* ── Custom Cursor ── */
#custom-cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%,-50%);
  transition: width 0.18s ease, height 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  mix-blend-mode: screen;
  opacity: 0.85;
}
#custom-cursor.hover {
  width: 28px; height: 28px;
  background: var(--accent);
  opacity: 0.35;
}
@media (pointer: coarse) { #custom-cursor { display: none; } }

/* ── Click Ripple ── */
.click-ripple {
  position: fixed;
  width: 8px; height: 8px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%,-50%) scale(1);
  animation: rippleOut 0.5s ease forwards;
}
@keyframes rippleOut {
  to { transform: translate(-50%,-50%) scale(8); opacity: 0; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(0,194,255,0.25); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,194,255,0.45); }

/* ── Utility ── */
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted); }
.text-mono { font-family: var(--font-mono); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* ── Spin ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.5;} }
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }
@keyframes shimmer {
  from { background-position: -200% center; }
  to   { background-position:  200% center; }
}

/* ── Badge Dot ── */
.dot-pulse {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 4px var(--green); }
  50%      { box-shadow: 0 0 14px var(--green), 0 0 28px rgba(0,230,118,0.4); }
}
