/* ============================================================
   SPIDYNEX — Master Design System (v6.0.0)
   Light-First Architecture: 65% Light Canvas / 25% Card / 10% Accent
   Typography: Outfit (Headings) + Inter (Body) + JetBrains Mono (Tokens)
   ============================================================ */

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

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --canvas-bg: #F8FAFC;
  --card-bg: #FFFFFF;
  --card-border: #E2E8F0;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  
  --brand-violet: #7C3AED;
  --brand-violet-hover: #6D28D9;
  --brand-cyan: #06B6D4;
  --brand-cyan-light: #22D3EE;
  --signal-emerald: #10B981;
  --signal-amber: #F59E0B;
  --signal-rose: #EF4444;
}

html.dark {
  --canvas-bg: #090A0F;
  --card-bg: #111420;
  --card-border: #1E293B;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
}

/* ── GLOBAL RESET & BASE STYLING ──────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--canvas-bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6, .font-display {
  font-family: 'Outfit', 'Inter', sans-serif;
  letter-spacing: -0.025em;
}

code, kbd, samp, pre, .font-mono {
  font-family: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
ul, ol { list-style: none; }
input, textarea, select { font-family: 'Inter', sans-serif; }
::selection { background: #7C3AED; color: #FFFFFF; }

/* ── BRAND GRADIENT UTILITIES ─────────────────────────────── */
/* Default (Light / White Mode: Deep Violet -> Rich Cyan -> Royal Blue) */
.text-gradient,
.text-gradient-light,
.text-gradient-violet,
.text-gradient-vibrant {
  background-image: linear-gradient(135deg, #7C3AED 0%, #0891B2 50%, #2563EB 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline;
}

/* Dark Mode / Obsidian Backgrounds (Pure White #FFF -> Bright Cyan #22D3EE -> Soft Violet #EDE9FE) */
.dark .text-gradient,
.dark .text-gradient-light,
.dark .text-gradient-violet,
.dark .text-gradient-vibrant,
.bg-obsidian .text-gradient,
.bg-obsidian .text-gradient-light,
.bg-obsidian .text-gradient-violet,
.bg-obsidian .text-gradient-vibrant,
[class*="bg-obsidian"] .text-gradient,
[class*="bg-obsidian"] .text-gradient-violet,
[class*="bg-obsidian"] .text-gradient-vibrant,
.text-gradient-dark,
.text-gradient-white {
  background-image: linear-gradient(to right, #FFFFFF 0%, #22D3EE 50%, #EDE9FE 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
  display: inline;
}

.bg-gradient-spidynex {
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 50%, #06B6D4 100%);
}

.shadow-glow-violet {
  box-shadow: 0 4px 20px -2px rgba(124, 58, 237, 0.3);
}

.shadow-glow-cyan {
  box-shadow: 0 4px 20px -2px rgba(6, 182, 212, 0.3);
}

/* ── CUSTOM SCROLLBAR ─────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #7C3AED; }
.dark ::-webkit-scrollbar-thumb { background: #1E293B; }
.dark ::-webkit-scrollbar-thumb:hover { background: #7C3AED; }

.custom-scrollbar::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 9999px; }

/* ── FOCUS RING ───────────────────────────────────────────── */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #7C3AED;
  outline-offset: 2px;
}

/* ── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  #heroCanvas { display: none !important; }
}

/* ── GLASSMORPHISM SURFACES ───────────────────────────────── */
.glass-nav-light {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.glass-nav-dark {
  background: rgba(17, 20, 32, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bg-grid-pattern {
  background-image: radial-gradient(rgba(148, 163, 184, 0.25) 1px, transparent 1px);
  background-size: 24px 24px;
}

.dark .bg-grid-pattern {
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ── REVEAL ANIMATIONS ────────────────────────────────────── */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── INFINITE LOGO MARQUEE TICKER ─────────────────────────── */
.marquee-wrapper {
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 35s linear infinite;
}
.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.partner-logo-card {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.partner-logo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.4);
  box-shadow: 0 8px 20px -4px rgba(124, 58, 237, 0.15);
}

/* ── PULSE & GLOW KEYFRAMES ───────────────────────────────── */
@keyframes beaconPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.9); }
}
.animate-beacon {
  animation: beaconPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── SELECT & INPUT OVERRIDES ─────────────────────────────── */
select option { background: #FFFFFF; color: #0F172A; }
.dark select option { background: #111420; color: #F8FAFC; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 6px; border-radius: 9999px; background: #E2E8F0; }
.dark input[type="range"] { background: #1E293B; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 9999px; background: #7C3AED; cursor: pointer; box-shadow: 0 2px 6px rgba(124,58,237,0.4); }

/* ── SITE LOADER ─────────────────────────────────────────── */
#siteLoader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #090A0F;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#siteLoader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-bar {
  width: 120px;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 12px;
}
.loader-bar span {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, #7C3AED, #22D3EE);
  border-radius: 9999px;
  animation: loaderSlide 1.2s ease-in-out infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ── UTILITY: RESPONSIVE DISPLAY & HELPERS ───────────────── */
.hidden { display: none; }
.flex { display: flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.grid { display: grid; }

@media (min-width: 640px) {
  .sm\:flex { display: flex !important; }
  .sm\:hidden { display: none !important; }
  .sm\:block { display: block !important; }
  .sm\:grid { display: grid !important; }
}

@media (min-width: 768px) {
  .md\:flex { display: flex !important; }
  .md\:hidden { display: none !important; }
  .md\:block { display: block !important; }
  .md\:grid { display: grid !important; }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:hidden { display: none !important; }
  .lg\:block { display: block !important; }
  .lg\:grid { display: grid !important; }
}

@media (min-width: 1280px) {
  .xl\:flex { display: flex !important; }
  .xl\:hidden { display: none !important; }
  .xl\:block { display: block !important; }
  .xl\:grid { display: grid !important; }
}

/* ── MOBILE DRAWER ───────────────────────────────────────── */
#mobileDrawer {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobileDrawer.open {
  transform: translateX(0);
}

/* ── SMOOTH PAGE TRANSITIONS ─────────────────────────────── */
#app-root {
  animation: fadeInPage 0.3s ease;
}
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
