/* ========================================
   Donut Sort — Game Landing Page Styles
   ======================================== */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  color-scheme: dark;

  /* Palette */
  --bg: #1a0a2e;
  --bg-gradient: linear-gradient(160deg, #1a0a2e 0%, #2d1052 35%, #1a0a2e 70%, #0f0620 100%);
  --panel: rgba(40, 18, 72, 0.75);
  --panel-solid: #2a1252;

  --text: #faf5ff;
  --text-dim: #c9b8e8;
  --muted: #9a82c4;

  --donut-pink: #ff6b9d;
  --donut-brown: #c67b4e;
  --donut-mint: #5de8b5;
  --donut-yellow: #ffe156;
  --donut-blue: #6ec6ff;

  --accent: #ff6b9d;
  --accent-glow: rgba(255, 107, 157, 0.35);
  --accent-secondary: #a855f7;
  --accent-secondary-glow: rgba(168, 85, 247, 0.3);

  --border: rgba(168, 85, 247, 0.2);
  --border-hover: rgba(255, 107, 157, 0.4);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-hover: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 60px rgba(255, 107, 157, 0.15);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-full: 999px;

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-gradient);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.1;
  font-weight: 800;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ---------- Layout ---------- */
.page {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 60px;
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 24px;
  background: rgba(26, 10, 46, 0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.nav-brand span {
  background: linear-gradient(135deg, var(--donut-pink), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--glass-hover);
  border-color: var(--border);
}

.nav-link.active {
  color: var(--text);
  background: rgba(255, 107, 157, 0.12);
  border-color: rgba(255, 107, 157, 0.3);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

/* ---------- Hero Section ---------- */
.hero {
  position: relative;
  margin-top: 80px;
  padding: 80px 60px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.png') center / cover no-repeat;
  opacity: 0.18;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(255, 107, 157, 0.12);
  border: 1px solid rgba(255, 107, 157, 0.25);
  color: var(--donut-pink);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 700;
  width: fit-content;
}

.eyebrow::before {
  content: '🍩';
}

.hero h1 {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  background: linear-gradient(135deg, var(--text) 30%, var(--donut-pink) 60%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .description {
  max-width: 520px;
  color: var(--text-dim);
  font-size: 1.15rem;
  line-height: 1.75;
}

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

.hero-screenshot {
  width: 300px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(168, 85, 247, 0.2);
  transform: perspective(800px) rotateY(-5deg) rotateX(2deg);
  transition: var(--transition);
  border: 2px solid rgba(168, 85, 247, 0.3);
}

.hero-screenshot:hover {
  transform: perspective(800px) rotateY(0deg) rotateX(0deg) scale(1.03);
  box-shadow: var(--shadow-lg), 0 0 120px rgba(168, 85, 247, 0.3);
}

/* Floating donut decorations */
.hero-visual::before,
.hero-visual::after {
  content: '🍩';
  position: absolute;
  font-size: 2.5rem;
  animation: float 4s ease-in-out infinite;
}

.hero-visual::before {
  top: -20px;
  right: -10px;
  animation-delay: 0s;
}

.hero-visual::after {
  bottom: -10px;
  left: 10px;
  animation-delay: 2s;
  font-size: 2rem;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(10deg); }
}

/* ---------- Store Badges ---------- */
.store-badges {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(8px);
  transition: var(--transition);
  cursor: pointer;
}

.store-badge:hover {
  background: var(--glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.store-badge-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.store-badge-text {
  display: flex;
  flex-direction: column;
}

.store-badge-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 500;
}

.store-badge-store {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

/* ---------- Section Titles ---------- */
.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 14px;
  background: linear-gradient(135deg, var(--text), var(--donut-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Features Section ---------- */
.features {
  margin-top: 80px;
}

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

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

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--donut-pink), var(--accent-secondary), var(--donut-mint));
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  background: var(--glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

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

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: rgba(255, 107, 157, 0.1);
  border: 1px solid rgba(255, 107, 157, 0.2);
  font-size: 1.6rem;
  margin-bottom: 18px;
}

.card:nth-child(2) .card-icon {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.card:nth-child(3) .card-icon {
  background: rgba(93, 232, 181, 0.1);
  border-color: rgba(93, 232, 181, 0.2);
}

.card:nth-child(4) .card-icon {
  background: rgba(255, 225, 86, 0.1);
  border-color: rgba(255, 225, 86, 0.2);
}

.card:nth-child(5) .card-icon {
  background: rgba(110, 198, 255, 0.1);
  border-color: rgba(110, 198, 255, 0.2);
}

.card:nth-child(6) .card-icon {
  background: rgba(198, 123, 78, 0.1);
  border-color: rgba(198, 123, 78, 0.2);
}

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

.card p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

/* ---------- How to Play ---------- */
.how-to-play {
  margin-top: 80px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 36px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--glass);
  text-align: center;
  transition: var(--transition);
  counter-increment: step;
}

.step:hover {
  background: var(--glass-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--donut-pink), var(--accent-secondary));
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 1.3rem;
  color: white;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.3);
}

.step-emoji {
  font-size: 2.5rem;
  margin-bottom: 14px;
}

.step h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.step p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- CTA Section ---------- */
.cta-section {
  margin-top: 80px;
  padding: 60px 48px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(168, 85, 247, 0.08));
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 107, 157, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.cta-section h2 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 16px;
  position: relative;
}

.cta-section p {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}

.cta-section .store-badges {
  justify-content: center;
  position: relative;
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 60px;
  padding: 40px 0 24px;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  margin-bottom: 10px;
}

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

.footer-brand span {
  background: linear-gradient(135deg, var(--donut-pink), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-tagline {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 280px;
}

.footer-links-group {
  display: flex;
  gap: 80px;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.footer-col a {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--donut-pink);
}

.footer-bottom {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding-top: 20px;
  border-top: 1px solid rgba(168, 85, 247, 0.1);
}

/* ---------- Buttons ---------- */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  background: linear-gradient(135deg, var(--donut-pink), var(--accent-secondary));
  color: white;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.25);
}

.button.primary:hover {
  box-shadow: 0 12px 32px rgba(255, 107, 157, 0.35);
}

.button.secondary {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--glass);
  backdrop-filter: blur(8px);
}

.button.secondary:hover {
  border-color: var(--border-hover);
  background: var(--glass-hover);
}

/* ---------- Legal Pages ---------- */
.legal-page {
  margin-top: 100px;
}

.legal-page .hero {
  margin-top: 0;
  padding: 48px 60px;
}

.legal-content {
  margin-top: 32px;
  padding: 40px 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(8px);
}

.legal-content h2 {
  font-size: 1.4rem;
  margin-top: 36px;
  margin-bottom: 12px;
  color: var(--donut-pink);
  font-weight: 700;
}

.legal-content h2:first-child {
  margin-top: 0;
}

.legal-content h3 {
  font-size: 1.1rem;
  margin-top: 24px;
  margin-bottom: 8px;
  color: var(--text-dim);
}

.legal-content p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 14px;
}

.legal-content ul,
.legal-content ol {
  color: var(--muted);
  padding-left: 24px;
  margin-bottom: 14px;
}

.legal-content li {
  line-height: 1.8;
  margin-bottom: 6px;
}

.legal-content strong {
  color: var(--text-dim);
}

.legal-content a {
  color: var(--donut-pink);
  text-decoration: underline;
  text-decoration-color: rgba(255, 107, 157, 0.3);
  text-underline-offset: 3px;
  transition: var(--transition);
}

.legal-content a:hover {
  text-decoration-color: var(--donut-pink);
}

.legal-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: var(--accent-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ---------- Support Page ---------- */
.support-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.support-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--glass);
  transition: var(--transition);
}

.support-card:hover {
  background: var(--glass-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.support-card-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

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

.support-card p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.support-card a {
  color: var(--donut-pink);
  font-weight: 600;
}

.faq-section {
  margin-top: 48px;
}

.faq-item {
  padding: 20px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--glass);
  margin-bottom: 12px;
  transition: var(--transition);
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-item h3::before {
  content: '🍩';
  font-size: 0.9rem;
}

.faq-item p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Sprinkle Animation ---------- */
.sprinkle-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sprinkle {
  position: absolute;
  width: 4px;
  height: 12px;
  border-radius: 4px;
  opacity: 0.15;
  animation: sprinkle-fall linear infinite;
}

@keyframes sprinkle-fall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.15;
  }
  90% {
    opacity: 0.15;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero {
    padding: 48px 32px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }

  .hero-text {
    align-items: center;
  }

  .hero-screenshot {
    width: 240px;
    transform: none;
  }

  .hero-screenshot:hover {
    transform: scale(1.03);
  }

  .store-badges {
    justify-content: center;
  }

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

  .steps-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }

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

  .footer-links-group {
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .page {
    width: calc(100% - 32px);
  }

  .nav {
    padding: 12px 16px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 12px;
    background: rgba(26, 10, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-mobile-toggle {
    display: flex;
  }

  .hero {
    margin-top: 72px;
    padding: 32px 20px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .store-badge {
    padding: 10px 18px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .support-cards {
    grid-template-columns: 1fr;
  }

  .legal-content {
    padding: 28px 20px;
  }

  .legal-page .hero {
    padding: 32px 20px;
  }

  .cta-section {
    padding: 40px 24px;
  }

  .footer-links-group {
    flex-direction: column;
    gap: 24px;
  }
}

/* ---------- Scroll Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
