/* ============================================
   D1 Website — Design System & Styles
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111119;
  --bg-card: rgba(20, 20, 35, 0.7);
  --bg-card-hover: rgba(30, 30, 50, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.15);

  --accent: #FF6B00;
  --accent-glow: rgba(255, 107, 0, 0.4);
  --accent-light: #FF8C38;
  --accent-secondary: #c850c0;
  --accent-tertiary: #4158D0;
  --accent-gradient: linear-gradient(135deg, #FF6B00, #c850c0);

  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.65);
  --text-muted: rgba(240, 240, 245, 0.4);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --nav-height: 72px;
  --max-width: 1200px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* RTL support */
[dir="rtl"] {
  text-align: right;
}

[dir="ltr"] {
  text-align: left;
}

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

a:hover {
  color: var(--accent-light);
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
}

/* ---------- Utilities ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 16px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 56px;
}

[dir="rtl"] .section-subtitle,
[dir="rtl"] .section-title {
  margin-left: auto;
  margin-right: 0;
}

[dir="ltr"] .section-subtitle,
[dir="ltr"] .section-title {
  margin-right: auto;
  margin-left: 0;
}

.text-center {
  text-align: center !important;
}

.text-center .section-subtitle {
  margin-inline: auto;
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.navbar .container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 40px;
  width: 40px;
  border-radius: 10px;
}

.nav-logo span {
  display: none;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
}

.lang-toggle button {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  transition: var(--transition);
}

.lang-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.lang-toggle button:hover:not(.active) {
  color: var(--text-primary);
}

.nav-cta {
  padding: 10px 24px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.nav-cta:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 25px var(--accent-glow);
  color: #fff !important;
}

/* Mobile menu */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  padding: 8px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Hero Section ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-height) + 40px) 24px 80px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 107, 0, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(200, 80, 192, 0.05) 0%, transparent 50%),
    var(--bg-primary);
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 100px,
      rgba(255, 255, 255, 0.01) 100px, rgba(255, 255, 255, 0.01) 101px);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-fire-container {
  width: 120px;
  height: 120px;
  margin: 0 auto 32px;
  position: relative;
  animation: heroFloat 4s ease-in-out infinite;
}

.hero-fire-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(255, 107, 0, 0.5)) drop-shadow(0 0 60px rgba(255, 107, 0, 0.25));
  animation: heroPulse 2s ease-in-out infinite;
}

.hero-fire-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes heroFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes heroPulse {

  0%,
  100% {
    filter: drop-shadow(0 0 30px rgba(255, 107, 0, 0.5)) drop-shadow(0 0 60px rgba(255, 107, 0, 0.25));
  }

  50% {
    filter: drop-shadow(0 0 40px rgba(255, 107, 0, 0.7)) drop-shadow(0 0 80px rgba(255, 107, 0, 0.4));
  }
}

@keyframes glowPulse {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 1;
  }
}

.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.hero h1 .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p.hero-sub {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* Store Badges */
.store-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.store-badge:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(255, 107, 0, 0.15);
  color: var(--text-primary);
}

.store-badge svg {
  flex-shrink: 0;
}

.store-badge .store-label {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.store-badge .store-label small {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ---------- Floating particles (hero background) ---------- */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: particleRise linear infinite;
}

@keyframes particleRise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0;
  }

  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}

/* ---------- Features Section ---------- */
.features {
  padding: 100px 24px;
  position: relative;
  background: var(--bg-secondary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 36px 28px;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.feature-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.feature-card:hover {
  border-color: var(--border-glass-hover);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-card.visible:hover {
  transform: translateY(-4px);
}

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

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

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: rgba(255, 107, 0, 0.1);
  position: relative;
}

.feature-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* CSS icons for features without images */
.feature-icon svg {
  width: 28px;
  height: 28px;
}

.feature-icon.purple {
  background: rgba(200, 80, 192, 0.1);
}

.feature-icon.blue {
  background: rgba(65, 88, 208, 0.1);
}

.feature-icon.green {
  background: rgba(40, 200, 120, 0.1);
}

.feature-icon.gold {
  background: rgba(255, 193, 7, 0.1);
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

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

/* ---------- Categories Section ---------- */
.categories {
  padding: 100px 24px;
  background: var(--bg-primary);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.category-card {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.category-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.category-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glass-hover);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.category-card.visible:hover {
  transform: translateY(-6px);
}

.category-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  transition: var(--transition);
}

.category-card:hover .category-icon {
  transform: scale(1.12) rotate(-3deg);
}

.category-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ---------- Gamification Section ---------- */
.gamification {
  padding: 100px 24px;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.gamification::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 107, 0, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.gamification-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.gamification-text h2 {
  margin-bottom: 24px;
}

.gamification-text p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.gamification-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-card {
  text-align: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.stat-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
}

.stat-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stat-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.gamification-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gamification-visual .big-trophy {
  width: 220px;
  height: 220px;
  object-fit: contain;
  filter: drop-shadow(0 0 40px rgba(255, 193, 7, 0.3));
  animation: trophyFloat 5s ease-in-out infinite;
}

@keyframes trophyFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-10px) rotate(2deg);
  }

  75% {
    transform: translateY(5px) rotate(-2deg);
  }
}

/* ---------- CTA Section ---------- */
.cta {
  padding: 100px 24px;
  text-align: center;
  background: var(--bg-primary);
  position: relative;
}

.cta::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(255, 107, 0, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.cta h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 16px;
}

.cta h2 .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
  margin-inline: auto;
}

/* ---------- Footer ---------- */
.footer {
  padding: 48px 24px 32px;
  border-top: 1px solid var(--border-glass);
  background: var(--bg-secondary);
}

.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo img {
  height: 32px;
  width: 32px;
  border-radius: 8px;
}

.footer-logo span {
  font-weight: 700;
  color: var(--text-primary);
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

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

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  width: 100%;
  text-align: center;
  padding-top: 24px;
  margin-top: 16px;
  border-top: 1px solid var(--border-glass);
}

.footer-copy p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ============================================
   Legal Pages (Privacy Policy, Terms of Use)
   ============================================ */
.legal-page {
  padding: calc(var(--nav-height) + 60px) 24px 80px;
  min-height: 100vh;
}

.legal-content {
  max-width: 800px;
  margin: 0 auto;
}

.legal-content h1 {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.legal-content .legal-date {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 0.9rem;
}

.legal-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-glass);
}

.legal-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.legal-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--accent-light);
}

.legal-content p,
.legal-content li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal-content ul,
.legal-content ol {
  padding-inline-start: 24px;
  margin-bottom: 16px;
}

.legal-content ul {
  list-style: disc;
}

.legal-content ol {
  list-style: decimal;
}

.legal-content li {
  margin-bottom: 8px;
}

.legal-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-content a:hover {
  color: var(--accent-light);
}

.legal-content em {
  color: var(--text-secondary);
}

.legal-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.legal-content hr {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 48px 0;
}

.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.85rem;
}

.legal-content th,
.legal-content td {
  border: 1px solid var(--border-glass);
  padding: 12px 16px;
  text-align: left;
}

[dir="rtl"] .legal-content th,
[dir="rtl"] .legal-content td {
  text-align: right;
}

.legal-content th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.legal-content td {
  color: var(--text-secondary);
}

/* TOC */
.legal-toc {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 40px;
}

.legal-toc h3 {
  margin-top: 0;
  font-size: 1rem;
  margin-bottom: 12px;
}

.legal-toc ol {
  padding-inline-start: 20px;
  list-style: decimal;
}

.legal-toc li {
  margin-bottom: 6px;
}

.legal-toc a {
  text-decoration: none;
  font-size: 0.9rem;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
  .gamification-content {
    grid-template-columns: 1fr;
  }

  .gamification-visual {
    order: -1;
    margin-bottom: 20px;
  }

  .gamification-visual .big-trophy {
    width: 160px;
    height: 160px;
  }
}

@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gamification-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.97);
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border-glass);
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-hamburger {
    display: flex;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gamification-stats {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .store-badges {
    flex-direction: column;
  }

  .store-badge {
    width: 100%;
    justify-content: center;
  }

  .footer .container {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}