/* ============================================
   PATTERN ECHO - Custom Colour Scheme
   ============================================
   
   Primary Colours:
   - Purple: RGB(124, 77, 255)  → #7C4DFF
   - Red:    RGB(255, 82, 82)   → #FF5252
   - Green:  RGB(0, 255, 133)   → #00FF85
   - Blue:   RGB(68, 138, 255)  → #448AFF
   
   Backgrounds:
   - BG1:    RGB(30, 30, 30)    → #1E1E1E
   - BG2:    RGB(45, 45, 45)    → #2D2D2D
   - BG3:    RGB(51, 51, 51)    → #333333
   
   ============================================ */

/* ── CSS Custom Properties ── */
:root {
  /* Primary Colours */
  --color-purple: 124, 77, 255;
  --color-red: 255, 82, 82;
  --color-green: 0, 255, 133;
  --color-blue: 68, 138, 255;

  /* Backgrounds */
  --color-bg1: 30, 30, 30;
  --color-bg2: 45, 45, 45;
  --color-bg3: 51, 51, 51;

  /* Text */
  --color-text-primary: 255, 255, 255;
  --color-text-secondary: 180, 180, 180;
  --color-text-muted: 120, 120, 120;

  /* Hex shortcuts */
  --purple: #7C4DFF;
  --red: #FF5252;
  --green: #00FF85;
  --blue: #448AFF;
  --bg1: #1E1E1E;
  --bg2: #2D2D2D;
  --bg3: #333333;
}

/* ── Base ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  background-color: var(--bg1);
  color: rgb(var(--color-text-primary));
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg1);
}
::-webkit-scrollbar-thumb {
  background: var(--purple);
  border-radius: 3px;
}

/* ── Selection ── */
::selection {
  background: rgba(var(--color-purple), 0.4);
  color: #fff;
}

/* ── Utility Colours ── */
.text-purple { color: var(--purple); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }

.bg-game-1 { background-color: var(--bg1); }
.bg-game-2 { background-color: var(--bg2); }
.bg-game-3 { background-color: var(--bg3); }

/* ── Gradient Utilities ── */
.gradient-purple-blue {
  background: linear-gradient(135deg, var(--purple), var(--blue));
}
.gradient-green-blue {
  background: linear-gradient(135deg, var(--green), var(--blue));
}
.gradient-purple-red {
  background: linear-gradient(135deg, var(--purple), var(--red));
}
.gradient-text {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glow Effects ── */
.glow-purple {
  box-shadow: 0 0 30px rgba(var(--color-purple), 0.3),
              0 0 60px rgba(var(--color-purple), 0.1);
}
.glow-green {
  box-shadow: 0 0 30px rgba(var(--color-green), 0.3),
              0 0 60px rgba(var(--color-green), 0.1);
}
.glow-blue {
  box-shadow: 0 0 30px rgba(var(--color-blue), 0.3),
              0 0 60px rgba(var(--color-blue), 0.1);
}
.glow-red {
  box-shadow: 0 0 30px rgba(var(--color-red), 0.3),
              0 0 60px rgba(var(--color-red), 0.1);
}

/* ── Dot Pulse Animation ── */
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}
.dot-pulse {
  animation: dotPulse 2s ease-in-out infinite;
}
.dot-pulse-delay-1 { animation-delay: 0.3s; }
.dot-pulse-delay-2 { animation-delay: 0.6s; }
.dot-pulse-delay-3 { animation-delay: 0.9s; }

/* ── Float Animation ── */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-float-delay {
  animation: float 6s ease-in-out infinite;
  animation-delay: 2s;
}

/* ── Fade In Up ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}
.fade-in-up-delay-1 { animation-delay: 0.15s; opacity: 0; }
.fade-in-up-delay-2 { animation-delay: 0.3s; opacity: 0; }
.fade-in-up-delay-3 { animation-delay: 0.45s; opacity: 0; }
.fade-in-up-delay-4 { animation-delay: 0.6s; opacity: 0; }

/* ── Shimmer ── */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--green) 0%,
    var(--blue) 25%,
    var(--purple) 50%,
    var(--blue) 75%,
    var(--green) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

/* ── Grid Pattern Background ── */
.grid-pattern {
  background-image:
    linear-gradient(rgba(var(--color-purple), 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-purple), 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Dot Grid Decoration ── */
.dot-grid {
  background-image: radial-gradient(
    rgba(var(--color-purple), 0.15) 1px,
    transparent 1px
  );
  background-size: 24px 24px;
}

/* ── Card Hover ── */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-8px);
}

/* ── Button Styles ── */
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(var(--color-purple), 0.4);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid rgba(var(--color-purple), 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: var(--purple);
  background: rgba(var(--color-purple), 0.1);
  transform: translateY(-2px);
}

/* ── Store Badges ── */
.store-badge {
  height: 54px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.9;
}
.store-badge:hover {
  transform: scale(1.05);
  opacity: 1;
}

/* ── Navbar ── */
.navbar {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(var(--color-bg1), 0.85);
  border-bottom: 1px solid rgba(var(--color-purple), 0.1);
  transition: all 0.3s ease;
}
.navbar.scrolled {
  background: rgba(var(--color-bg1), 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  color: rgb(var(--color-text-secondary));
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}
.nav-link:hover,
.nav-link.active {
  color: var(--green);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--green);
  transition: width 0.3s ease;
  border-radius: 1px;
}
.nav-link:hover::after {
  width: 100%;
}

/* ── Hero Phone Mockup ── */
.phone-mockup {
  width: 280px;
  height: 560px;
  background: var(--bg3);
  border-radius: 40px;
  border: 3px solid rgba(var(--color-purple), 0.3);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 25px 60px rgba(0,0,0,0.5),
    0 0 40px rgba(var(--color-purple), 0.15);
}
.phone-mockup::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: var(--bg1);
  border-radius: 0 0 20px 20px;
  z-index: 10;
}

/* ── Feature Card ── */
.feature-card {
  background: var(--bg2);
  border: 1px solid rgba(var(--color-purple), 0.1);
  border-radius: 20px;
  padding: 32px;
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--purple), var(--blue));
  opacity: 0;
  transition: opacity 0.4s ease;
}
.feature-card:hover {
  border-color: rgba(var(--color-purple), 0.3);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}
.feature-card:hover::before {
  opacity: 1;
}

/* ── Rank Badge ── */
.rank-badge {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  position: relative;
}
.rank-badge::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  padding: 2px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* ── Testimonial Card ── */
.testimonial-card {
  background: var(--bg2);
  border: 1px solid rgba(var(--color-purple), 0.08);
  border-radius: 20px;
  padding: 32px;
  position: relative;
}
.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 16px;
  left: 24px;
  font-size: 4rem;
  font-family: Georgia, serif;
  color: rgba(var(--color-purple), 0.15);
  line-height: 1;
}

/* ── Section Divider ── */
.section-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(var(--color-purple), 0.3),
    transparent
  );
}

/* ── Responsive Adjustments ── */
@media (max-width: 768px) {
  .phone-mockup {
    width: 220px;
    height: 440px;
    border-radius: 32px;
  }
  .phone-mockup::before {
    width: 90px;
    height: 22px;
  }
  .store-badge {
    height: 44px;
  }
  .feature-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .phone-mockup {
    width: 180px;
    height: 360px;
    border-radius: 28px;
  }
  .store-badge {
    height: 40px;
  }
}

/* ── Hamburger Menu ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  z-index: 60;
}
.hamburger span {
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }
  .mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(var(--color-bg1), 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    z-index: 50;
  }
  .mobile-menu .nav-link {
    font-size: 1.3rem;
  }
}