/* ==========================================================================
   Arrow Escape - Master Design System & Stylesheet
   ========================================================================== */

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

:root {
  /* Color Palette derived from Flutter App */
  --bg-dark: #0F172A;
  --bg-surface: #1E293B;
  --bg-surface-hover: #334155;
  --border-color: #334155;
  --border-light: rgba(255, 255, 255, 0.1);
  
  /* Brand Accents */
  --amber-main: #FFC107;
  --amber-light: #FCD34D;
  --amber-glow: rgba(255, 193, 7, 0.35);
  
  --violet-main: #8B5CF6;
  --violet-dark: #6366F1;
  --violet-glow: rgba(139, 92, 246, 0.35);
  
  --emerald-main: #10B981;
  --emerald-dark: #059669;
  --emerald-glow: rgba(16, 185, 129, 0.35);
  
  --pink-main: #EC4899;
  --pink-glow: rgba(236, 72, 153, 0.35);
  
  --red-main: #EF4444;
  
  /* Typography */
  --text-white: #FFFFFF;
  --text-muted: #94A3B8;
  --text-subtle: #64748B;
  
  /* Layout & Shadows */
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-amber: 0 12px 30px rgba(255, 193, 7, 0.25);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s 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;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-white);
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  line-height: 1.6;
  position: relative;
}

/* Typography Utilities */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
}

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

/* Reusable Components */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.gradient-text-amber {
  background: linear-gradient(135deg, var(--amber-light) 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.gradient-text-violet {
  background: linear-gradient(135deg, #A78BFA 0%, var(--violet-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform var(--transition-bounce), box-shadow var(--transition-normal), background var(--transition-fast);
  border: none;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-3px) scale(1.02);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--amber-light) 0%, #F59E0B 100%);
  color: #000000;
  box-shadow: var(--shadow-amber);
}

.btn-primary:hover {
  box-shadow: 0 16px 36px rgba(255, 193, 7, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-white);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--amber-main);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-amber {
  background: rgba(255, 193, 7, 0.15);
  color: var(--amber-light);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Header & Navigation */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 0;
  transition: all var(--transition-normal);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.navbar.scrolled {
  padding: 12px 0;
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: var(--border-color);
  box-shadow: var(--shadow-md);
}

.navbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: 1px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--amber-main);
  object-fit: cover;
  box-shadow: 0 0 12px var(--amber-glow);
}

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

.nav-link {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--amber-light);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-white);
  font-size: 1.8rem;
  cursor: pointer;
}

/* Section Header Structure */
.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 60px auto;
}

.section-title {
  font-size: 2.5rem;
  margin: 12px 0 16px 0;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 100vh;
  padding-top: 140px;
  padding-bottom: 80px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg-glow {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 193, 7, 0.15) 0%, rgba(139, 92, 246, 0.08) 40%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

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

.hero-content h1 {
  font-size: 3.5rem;
  margin: 20px 0;
  line-height: 1.1;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 520px;
}

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

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.store-badge:hover {
  border-color: var(--amber-main);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.store-badge svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.store-badge-text span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.store-badge-text strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text-white);
}

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

.phone-mockup {
  width: 310px;
  height: 630px;
  background: #020617;
  border-radius: 48px;
  border: 12px solid #1E293B;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 193, 7, 0.15);
  position: relative;
  overflow: hidden;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 24px;
  background: #1E293B;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
}

.phone-screen {
  width: 100%;
  height: 100%;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
}

/* App Simulation inside Mockup */
.app-header-sim {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: 16px;
  margin-top: 10px;
  border: 1px solid var(--border-color);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--amber-main);
}

.user-name {
  font-size: 0.8rem;
  font-weight: 700;
}

.user-stats {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.interactive-demo-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
}

#demoCanvas {
  background: #020617;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.demo-instruction {
  font-size: 0.75rem;
  color: var(--amber-light);
  margin-top: 8px;
  animation: pulse 2s infinite;
}

/* Stats Counter Section */
.stats-section {
  padding: 60px 0;
  background: rgba(30, 41, 59, 0.4);
  border-y: 1px solid var(--border-color);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: center;
}

.stat-card {
  padding: 32px 20px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  transition: transform var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--amber-main);
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 8px;
}

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

/* Feature Showcase Section */
.features-section {
  padding: 100px 0;
}

.feature-item {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 100px;
}

.feature-item:last-child {
  margin-bottom: 0;
}

.feature-item.reverse {
  direction: rtl;
}

.feature-item.reverse .feature-text {
  direction: ltr;
}

.feature-text h3 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-text p {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.feature-visual-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Game Modes Grid */
.modes-section {
  padding: 100px 0;
  background: rgba(15, 23, 42, 0.8);
}

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

.mode-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.mode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--amber-main);
}

.mode-card.time-attack::before { background: linear-gradient(90deg, #8B5CF6, #6366F1); }
.mode-card.fog-of-war::before { background: linear-gradient(90deg, #334155, #64748B); }
.mode-card.mastermind::before { background: linear-gradient(90deg, #EF4444, #B91C1C); }
.mode-card.mirror::before { background: linear-gradient(90deg, #EC4899, #A855F7); }

.mode-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.mode-icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.mode-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.mode-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Tier Level Map Timeline */
.map-section {
  padding: 100px 0;
}

.tier-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
}

.tier-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.tier-row:hover {
  border-color: var(--amber-main);
  transform: translateX(6px);
}

.tier-badge {
  font-weight: 800;
  font-size: 1rem;
  width: 140px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.tier-info {
  flex: 1;
}

.tier-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.tier-grid-size {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Download CTA Section */
.cta-section {
  padding: 100px 0;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(30, 41, 59, 0.8) 100%);
  position: relative;
}

.cta-box {
  padding: 60px 40px;
  background: var(--bg-surface);
  border-radius: 32px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(255, 193, 7, 0.1);
}

/* Footer */
.footer {
  padding: 60px 0 30px 0;
  background: #020617;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-brand p {
  margin-top: 12px;
  max-width: 320px;
}

.footer-col h4 {
  color: var(--text-white);
  font-size: 1rem;
  margin-bottom: 16px;
}

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

.footer-links a:hover {
  color: var(--amber-light);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Responsive Rules */
@media (max-width: 992px) {
  .hero-grid, .feature-item {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .hero-visual {
    order: -1;
  }
  
  .feature-item.reverse {
    direction: ltr;
  }
  
  .modes-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

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

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .mobile-toggle {
    display: block;
  }

  .hero-content h1 {
    font-size: 2.4rem;
  }

  .section-title {
    font-size: 1.8rem;
  }
}
