/* ============================================
   LOTTACASH — Global Styles
   Design System: Deep Space + Electric Violet + Gold
   ============================================ */


/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --c-bg:          #0B0718;
  --c-surface:     #150F2E;
  --c-surface-2:   #1E1540;
  --c-surface-3:   #271C52;
  --c-border:      rgba(124, 58, 237, 0.3);
  --c-border-soft: rgba(255,255,255,0.07);

  --c-primary:       #7C3AED;
  --c-primary-light: #A78BFA;
  --c-primary-dark:  #5B21B6;
  --c-primary-glow:  rgba(124, 58, 237, 0.4);

  --c-gold:       #F59E0B;
  --c-gold-light: #FCD34D;
  --c-gold-dark:  #D97706;
  --c-gold-glow:  rgba(245, 158, 11, 0.35);

  --c-success:    #10B981;
  --c-success-bg: rgba(16, 185, 129, 0.12);
  --c-error:      #EF4444;
  --c-error-bg:   rgba(239, 68, 68, 0.12);
  --c-warning:    #F97316;

  --c-text:       #F1ECFF;
  --c-text-muted: #9B8DB8;
  --c-text-faint: #7A6B9F;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

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

  /* Radii */
  --r-sm:   0.5rem;
  --r-md:   0.875rem;
  --r-lg:   1.25rem;
  --r-xl:   1.75rem;
  --r-2xl:  2.5rem;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow-primary: 0 0 24px rgba(124, 58, 237, 0.45);
  --shadow-glow-gold:    0 0 24px rgba(245, 158, 11, 0.45);

  /* Transitions */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
  --duration-fast: 150ms;
  --duration-base: 260ms;
  --duration-slow: 420ms;

  /* Layout */
  --max-width: 1600px;
  --nav-height: 68px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Particle canvas */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-surface-3); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

/* Selection */
::selection {
  background: var(--c-primary);
  color: white;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-text);
}

h1 { font-size: clamp(2rem, 5vw, var(--text-5xl)); }
h2 { font-size: clamp(1.5rem, 3.5vw, var(--text-4xl)); }
h3 { font-size: clamp(1.125rem, 2.5vw, var(--text-2xl)); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p { color: var(--c-text-muted); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--sp-5);
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .container { padding-inline: var(--sp-8); }
}

@media (min-width: 1024px) {
  .container { padding-inline: var(--sp-12); }
}

.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

.grid        { display: grid; }
.text-center { text-align: center; }
.hidden      { display: none !important; }

/* --- Skip to Main Content (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 9999;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-primary);
  color: #fff;
  font-weight: 600;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: var(--sp-4);
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* --- Background Orbs / Ambient --- */
.bg-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
}

.bg-orb--purple {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #6D28D9 0%, transparent 70%);
  top: -250px;
  right: -200px;
  opacity: 0.22;
  animation: orb-drift-1 18s ease-in-out infinite;
}

.bg-orb--gold {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #D97706 0%, transparent 70%);
  bottom: 5%;
  left: -180px;
  opacity: 0.12;
  animation: orb-drift-2 22s ease-in-out infinite;
}

.bg-orb--blue {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #2563EB 0%, transparent 70%);
  top: 35%;
  right: 5%;
  opacity: 0.08;
  animation: orb-drift-3 26s ease-in-out infinite;
}

@keyframes orb-drift-1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-40px, 60px) scale(1.05); }
  66%       { transform: translate(30px, -30px) scale(0.95); }
}
@keyframes orb-drift-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%       { transform: translate(60px, -50px) scale(1.1); }
}
@keyframes orb-drift-3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  40%       { transform: translate(-30px, 40px) scale(1.08); }
  70%       { transform: translate(20px, -20px) scale(0.92); }
}

/* --- Gradient Text --- */
.gradient-text {
  background: linear-gradient(135deg, var(--c-primary-light) 0%, var(--c-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-gold {
  background: linear-gradient(135deg, var(--c-gold-light) 0%, var(--c-gold) 60%, var(--c-gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Glass Card --- */
.glass-card {
  background: rgba(21, 15, 46, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--r-xl);
  transition: border-color var(--duration-base), box-shadow var(--duration-base);
}

.glass-card:hover {
  border-color: var(--c-border);
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.15);
}

/* --- Shimmer border card --- */
.shimmer-border {
  position: relative;
}
.shimmer-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--c-primary), var(--c-gold), var(--c-primary));
  background-size: 200% 200%;
  animation: shimmer-border-anim 3s linear infinite;
  z-index: -1;
  opacity: 0;
  transition: opacity var(--duration-base);
}
.shimmer-border:hover::before {
  opacity: 1;
}
@keyframes shimmer-border-anim {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--c-border), transparent);
  border: none;
  margin: var(--sp-8) 0;
}

/* --- Coin Badge --- */
.coin-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-gold);
}

.coin-badge::before {
  content: '🪙';
  font-size: 1em;
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.badge--success { background: var(--c-success-bg);           color: var(--c-success);       border: 1px solid rgba(16,185,129,0.3); }
.badge--gold    { background: rgba(245,158,11,0.12);          color: var(--c-gold);          border: 1px solid rgba(245,158,11,0.3); }
.badge--primary { background: rgba(124,58,237,0.15);          color: var(--c-primary-light); border: 1px solid rgba(124,58,237,0.3); }
.badge--error   { background: var(--c-error-bg);              color: var(--c-error);         border: 1px solid rgba(239,68,68,0.3); }

/* ========================================
   ANIMATION SYSTEM
   ======================================== */

/* --- Keyframes --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--c-primary-glow); }
  50%       { box-shadow: 0 0 50px var(--c-primary-glow), 0 0 90px rgba(124,58,237,0.15); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-10px) rotate(0.5deg); }
  66%       { transform: translateY(-5px) rotate(-0.5deg); }
}

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

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.4); }
}

@keyframes badge-float-1 {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  50%       { transform: translateY(-8px) translateX(3px); }
}
@keyframes badge-float-2 {
  0%, 100% { transform: translateY(0px) translateX(0px); }
  50%       { transform: translateY(6px) translateX(-4px); }
}

@keyframes typewriter-cursor {
  0%, 100% { border-right-color: var(--c-gold); }
  50%       { border-right-color: transparent; }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes icon-ring-pulse {
  0%   { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* --- Hero reveal (one-shot on load) --- */
.hero-reveal {
  opacity: 0;
  transform: translateY(24px);
}
.hero-reveal.revealed {
  animation: fadeInUp 0.7s var(--ease-out) both;
  opacity: 1;
  transform: none;
}

/* --- Scroll reveal (triggered by IntersectionObserver) --- */
.scroll-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.scroll-reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* --- Utility animation classes --- */
.animate-fade-up    { animation: fadeInUp 0.55s var(--ease-out) both; }
.animate-fade-left  { animation: fadeInLeft 0.55s var(--ease-out) both; }
.animate-fade-right { animation: fadeInRight 0.55s var(--ease-out) both; }
.animate-fade       { animation: fadeIn 0.4s var(--ease-out) both; }
.animate-scale-in   { animation: scaleIn 0.5s var(--ease-spring) both; }
.animate-float      { animation: float 5s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 2.5s ease-in-out infinite; }

.delay-50  { animation-delay: 50ms; }
.delay-100 { animation-delay: 100ms; }
.delay-150 { animation-delay: 150ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-reveal { opacity: 1; transform: none; }
  .scroll-reveal { opacity: 1; transform: none; }
  #particle-canvas { display: none; }
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: var(--sp-6);
  right: var(--sp-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  pointer-events: none;
}

@media (max-width: 480px) {
  .toast-container {
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-soft);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  animation: fadeInUp 0.35s var(--ease-out) both;
  min-width: 260px;
  max-width: 360px;
  pointer-events: all;
}

@media (max-width: 480px) {
  .toast { min-width: 0; max-width: 100%; }
}

.toast--success { border-color: rgba(16,185,129,0.4); }
.toast--error   { border-color: rgba(239,68,68,0.4); }
.toast--gold    { border-color: rgba(245,158,11,0.4); }

/* --- Loading Spinner --- */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin-slow 0.7s linear infinite;
}

/* --- Progress Bar --- */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--c-surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--c-primary), var(--c-gold));
  transition: width 0.8s var(--ease-out);
  position: relative;
}

.progress-bar__fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.8s ease-in-out infinite;
}

/* --- Shimmer Skeleton --- */
.skeleton {
  background: linear-gradient(90deg,
    var(--c-surface-2) 25%,
    var(--c-surface-3) 50%,
    var(--c-surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-md);
}

/* --- Mobile nav overlay backdrop --- */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  top: var(--nav-height);
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-slow) var(--ease-out);
}
.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* --- Magnetic button effect helper --- */
.btn--magnetic {
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out),
              background var(--duration-base), color var(--duration-base);
  will-change: transform;
}

/* ========== PRINT STYLES ========== */
@media print {
  * { background: #fff !important; color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  #particle-canvas,
  .bg-ambient, .bg-orb,
  .navbar, .mobile-nav, .mobile-nav-backdrop,
  .toast-container, .modal-overlay,
  .hero__grid-bg { display: none !important; }
  a { color: #000 !important; text-decoration: underline !important; }
  .container { max-width: 100%; padding: 0 !important; }
  .footer { border-top: 1px solid #ccc !important; }
  .hero-reveal, .scroll-reveal { opacity: 1 !important; transform: none !important; }
}