/* DoodleCraft — Homepage Styles */

.hero {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, var(--bg-primary) 0%, var(--bg-secondary) 40%, var(--primary-light) 100%);
}

body.dark-mode .hero {
  background: linear-gradient(160deg, var(--bg-primary) 0%, var(--bg-secondary) 60%, #2a1a3e 100%);
}

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

@keyframes magicalGlow {
  0% { text-shadow: 0 0 10px rgba(211, 166, 37, 0.4), 0 0 20px rgba(211, 166, 37, 0.2); }
  50% { text-shadow: 0 0 20px rgba(211, 166, 37, 0.8), 0 0 40px rgba(211, 166, 37, 0.6), 0 0 60px rgba(211, 166, 37, 0.4); }
  100% { text-shadow: 0 0 10px rgba(211, 166, 37, 0.4), 0 0 20px rgba(211, 166, 37, 0.2); }
}

.hero-content h1 {
  margin-bottom: var(--space-lg);
  animation: slideUp 0.7s var(--ease-out) both, magicalGlow 4s ease-in-out infinite alternate;
  line-height: 1.15;
  color: var(--accent-yellow);
}

.hero-content .hero-subtitle {
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
  animation: slideUp 0.7s var(--ease-out) 0.1s both;
  line-height: 1.5;
}

.hero-content .btn {
  animation: slideUp 0.7s var(--ease-out) 0.2s both;
  font-size: 1.1rem;
}

/* Hero floating doodle decorations */
.hero-doodles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-doodle {
  position: absolute;
  font-size: 2rem;
  opacity: 0.15;
  animation: floatSlow 6s ease-in-out infinite;
}
body.dark-mode .hero-doodle { opacity: 0.1; }

.hero-doodle:nth-child(1) { top:10%; left:8%; animation-delay:0s; font-size:2.5rem; }
.hero-doodle:nth-child(2) { top:20%; right:10%; animation-delay:1s; font-size:1.8rem; }
.hero-doodle:nth-child(3) { bottom:25%; left:12%; animation-delay:2s; font-size:3rem; }
.hero-doodle:nth-child(4) { bottom:15%; right:8%; animation-delay:0.5s; font-size:2rem; }
.hero-doodle:nth-child(5) { top:45%; left:3%; animation-delay:1.5s; font-size:1.5rem; }
.hero-doodle:nth-child(6) { top:60%; right:5%; animation-delay:3s; font-size:2.2rem; }
.hero-doodle:nth-child(7) { top:8%; left:45%; animation-delay:2.5s; font-size:1.6rem; }
.hero-doodle:nth-child(8) { bottom:8%; left:40%; animation-delay:1.2s; font-size:2rem; }

@keyframes mistFloat {
  0% { transform: translateY(0) scale(1); opacity: 0.2; }
  50% { transform: translateY(-20px) scale(1.1); opacity: 0.4; }
  100% { transform: translateY(0) scale(1); opacity: 0.2; }
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: blob 10s ease-in-out infinite, mistFloat 8s ease-in-out infinite;
}
.hero-blob-1 {
  width: 400px; height: 400px;
  background: var(--primary);
  top: -10%; right: -5%;
  opacity: 0.12;
}
.hero-blob-2 {
  width: 300px; height: 300px;
  background: var(--secondary);
  bottom: -5%; left: -5%;
  opacity: 0.10;
}

/* ── Features Section ── */
.features-section {
  padding: var(--space-4xl) var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.features-section h2 {
  text-align: center;
  margin-bottom: var(--space-sm);
}

.features-section .section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: var(--space-2xl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-lg);
}

.feature-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
  transition: all var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}

.feature-card:hover::before { transform: scaleX(1); }
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  display: block;
}

.feature-card h3 {
  margin-bottom: var(--space-sm);
  font-size: 1.15rem;
}

.feature-card p {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── CTA Section ── */
.cta-section {
  padding: var(--space-4xl) var(--space-lg);
  text-align: center;
  background: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
  position: relative;
  overflow: hidden;
}

body.dark-mode .cta-section {
  background: linear-gradient(135deg, #2a1a2e, #1a1a3e);
}

.cta-section h2 { margin-bottom: var(--space-md); }
.cta-section p {
  font-size: 1.1rem;
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Sample Marquee ── */
.sample-section {
  padding: var(--space-3xl) 0;
  overflow: hidden;
}

.sample-section h2 {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding: 0 var(--space-lg);
}

.sample-marquee {
  display: flex;
  gap: var(--space-lg);
  animation: marquee 30s linear infinite;
  width: max-content;
}

.sample-marquee:hover { animation-play-state: paused; }

.sample-card {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  transition: transform var(--transition);
}

.sample-card:hover { transform: scale(1.05) rotate(-2deg); }

/* ── Games Section ── */
.games-page {
  padding: var(--space-2xl) var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}
.game-container {
  margin-top: var(--space-xl);
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  height: 60vh;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}
#game-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#game-score {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-yellow);
  z-index: 10;
  background: var(--bg-overlay);
  padding: 5px 15px;
  border-radius: var(--radius-md);
}
.snitch {
  position: absolute;
  font-size: 3rem;
  cursor: crosshair;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: flutter 0.1s infinite alternate;
  user-select: none;
}
@keyframes flutter {
  from { transform: rotate(-15deg) scale(1); }
  to { transform: rotate(15deg) scale(1.1); }
}

@keyframes bobbing {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

/* ── Hogwarts Runner (Pseudo-3D) ── */
#runner-game-area {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  perspective: 800px;
  perspective-origin: 50% 30%;
}

#runner-score-board {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--accent-yellow);
  z-index: 10;
  background: var(--bg-overlay);
  padding: 5px 15px;
  border-radius: var(--radius-md);
}

#runner-ground {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 120px;
  background: repeating-linear-gradient(
    90deg,
    #1a472a 0px,
    #1a472a 60px,
    #11321d 60px,
    #11321d 120px
  );
  transform-origin: bottom;
  transform: rotateX(70deg);
  border-top: 10px solid #3c2a1e;
  box-shadow: inset 0 20px 50px rgba(0,0,0,0.8);
}

.runner-ground-anim {
  animation: scrollGround 1.5s linear infinite;
}

@keyframes scrollGround {
  0% { transform: rotateX(70deg) translateX(0); }
  100% { transform: rotateX(70deg) translateX(-120px); }
}

#runner-player {
  position: absolute;
  bottom: 25px;
  left: 50px;
  width: 80px;
  height: 80px;
  background-image: url('../images/harry_sticker_1777102259714.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  transition: bottom 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 15px 5px rgba(0,0,0,0.5));
}

.runner-obstacle {
  position: absolute;
  bottom: 25px;
  width: 70px;
  height: 70px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  filter: drop-shadow(0 15px 5px rgba(0,0,0,0.5));
}

@media (max-width: 768px) {
  .hero { padding: var(--space-xl) var(--space-md); min-height: 80vh; }
  .features-grid { grid-template-columns: 1fr; }
  .sample-card { width: 160px; height: 160px; font-size: 3rem; }
  .game-container { height: 70vh; }
}
