/* ==============================================================================
   Mathwize PRO - Official Website Stylesheet
   Crafted with rich dark-mode aesthetics, glassmorphism, and responsive layout
   ============================================================================== */

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

:root {
  --bg-base: #080414;
  --bg-surface: #0f0824;
  --bg-card: rgba(23, 14, 52, 0.6);
  --bg-card-hover: rgba(36, 21, 78, 0.8);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(168, 85, 247, 0.5);
  
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.4);
  --secondary: #ec4899;
  --cyan: #06b6d4;
  --emerald: #10b981;
  --amber: #f59e0b;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #d946ef 50%, #f43f5e 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 35px rgba(139, 92, 246, 0.3);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Atmosphere Glows */
.bg-glow-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.28;
}

.glow-1 {
  top: -10%;
  left: 15%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #8b5cf6, #3b82f6);
}

.glow-2 {
  top: 45%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #ec4899, #8b5cf6);
}

.glow-3 {
  bottom: -15%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #06b6d4, #6366f1);
}

/* Typography */
h1, h2, h3, h4, .brand-font {
  font-family: 'Fredoka', cursive, sans-serif;
  font-weight: 700;
  letter-spacing: 0.5px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 4, 20, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.brand-logo img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.brand-badge {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 0.85em;
  margin-left: 4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-link:hover, .nav-link.active {
  color: #fff;
  text-shadow: 0 0 12px var(--primary-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 8px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 34px;
  font-size: 1.05rem;
}

/* Hero Section */
.hero-section {
  padding: 90px 0 60px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 20px;
}

.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 540px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-badges-row {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.badge-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-icon {
  color: #a855f7;
  font-size: 1.1rem;
}

/* App Mockup Visual */
.mockup-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.mockup-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #180d38 0%, #0d0722 100%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 44px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(139, 92, 246, 0.35);
  overflow: hidden;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

.mockup-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 10px;
}

.mockup-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
  margin-bottom: 16px;
}

.mockup-streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-full);
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.mockup-modes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.mockup-mode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
}

.mode-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mode-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.mode-badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Section Header */
.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-tag {
  color: #c084fc;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  display: block;
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Feature Cards Grid */
.features-section {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.2);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon-box {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
}

.feature-title {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.feature-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Game Modes Showcase */
.modes-section {
  padding: 80px 0;
}

.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.mode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.mode-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-md);
}

.mode-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.mode-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.mode-title {
  font-size: 1.3rem;
}

.mode-tag {
  font-size: 0.78rem;
  color: var(--cyan);
  font-weight: 600;
  text-transform: uppercase;
}

.mode-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Stats Section */
.stats-section {
  padding: 60px 0;
}

.stats-card {
  background: linear-gradient(135deg, rgba(23, 14, 52, 0.8) 0%, rgba(35, 18, 70, 0.8) 100%);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--radius-lg);
  padding: 44px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.stat-num {
  font-family: 'Fredoka', cursive;
  font-size: 2.8rem;
  font-weight: 700;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
}

/* Call to Action Banner */
.cta-section {
  padding: 90px 0;
}

.cta-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(236, 72, 153, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 36px;
  padding: 60px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 50px rgba(139, 92, 246, 0.25);
}

.cta-title {
  font-size: 2.8rem;
  margin-bottom: 16px;
}

.cta-subtitle {
  color: var(--text-secondary);
  font-size: 1.15rem;
  max-width: 580px;
  margin: 0 auto 36px;
}

.cta-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Contact Page Specifics */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 50px;
  padding: 60px 0;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px;
  backdrop-filter: blur(16px);
}

.contact-method-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 24px;
}

.contact-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c084fc;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.contact-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.contact-val {
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 4px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.98rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-textarea:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

/* Legal Pages (Privacy Policy, Terms) */
.legal-header {
  padding: 60px 0 30px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}

.legal-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c084fc;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.legal-content-wrapper {
  padding: 50px 0 90px;
}

.legal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 44px;
  backdrop-filter: blur(16px);
}

.legal-card h2 {
  font-size: 1.8rem;
  color: #fff;
  margin-top: 36px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.legal-card h2:first-of-type {
  margin-top: 0;
}

.legal-card h3 {
  font-size: 1.3rem;
  color: #e2e8f0;
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 16px;
  line-height: 1.75;
}

.legal-card ul, .legal-card ol {
  margin-left: 24px;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.legal-card li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.callout-box {
  background: rgba(139, 92, 246, 0.1);
  border-left: 4px solid var(--primary-light);
  padding: 18px 24px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
}

.callout-box strong {
  color: #fff;
}

/* Footer */
.footer {
  background: #05020d;
  border-top: 1px solid var(--border-light);
  padding: 60px 0 30px;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 14px;
  max-width: 300px;
  line-height: 1.6;
}

.footer-col-title {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 18px;
  font-weight: 700;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-wrap: wrap;
  gap: 16px;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 50px;
  }
  
  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-ctas {
    justify-content: center;
  }
  
  .hero-badges-row {
    justify-content: center;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.6rem;
  }
  
  .section-title {
    font-size: 2.1rem;
  }
  
  .nav-links {
    position: fixed;
    top: 76px;
    left: 0;
    width: 100%;
    background: rgba(8, 4, 20, 0.96);
    backdrop-filter: blur(24px);
    flex-direction: column;
    padding: 30px;
    gap: 20px;
    border-bottom: 1px solid var(--border-light);
    transform: translateY(-150%);
    transition: var(--transition);
  }
  
  .nav-links.active {
    transform: translateY(0);
  }
  
  .menu-toggle {
    display: block;
  }
  
  .legal-card {
    padding: 24px;
  }
  
  .cta-box {
    padding: 40px 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
