/* Premium CSS for WordStory Website - Ultimate Polish & Multi-Theme */

:root {
  /* Light Theme Variables (Default) */
  --primary-gradient: linear-gradient(135deg, #0067EB 0%, #66169A 50%, #7F0286 100%);
  --accent-color: #0067EB;
  --secondary-accent: #7F0286;
  --text-color: #1A1A1A;
  --text-color-light: #555555;
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --card-border: rgba(0, 0, 0, 0.03);
  --shadow-premium: 0 30px 60px rgba(0, 0, 0, 0.08);
  --section-bg-alt: #fdfdfd;
  --nav-bg: rgba(255, 255, 255, 0.8);
  --img-blend: multiply;
  /* To hide white backgrounds on images in light mode */

  --font-headlines: 'Fredoka', 'Comfortaa', cursive;
  --font-body: 'Inter', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}



* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3 {
  font-family: var(--font-headlines);
  font-weight: 600;
  line-height: 1.25;
}

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



/* Hero Section Refined */
.hero {
  position: relative;
  width: 100%;
  min-height: 80vh;
  max-height: 900px;
  background: var(--primary-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  color: white;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -10%;
  left: -5%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  filter: blur(80px);
  z-index: 1;
}

.flag {
  position: absolute;
  width: 120px;
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.flag-de {
  top: 10%;
  left: 5%;
  transform: rotate(-12deg);
}

.flag-us {
  top: 15%;
  right: 5%;
  transform: rotate(15deg);
}

.hero-icon-link {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 40px;
  width: auto;
  z-index: 5;
  transition: var(--transition-smooth);
  border-radius: 48px;
}

.hero-icon-link:hover {
  transform: translateY(-10px) scale(1.02);
}

.hero-icon {
  width: 320px;
  max-width: 60%;
  height: auto;
  border-radius: 48px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
  display: block;
  /* Remove individual margin/transition as wrapper handles it */
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 24px;
  max-width: 1000px;
  z-index: 5;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  margin-bottom: 48px;
  max-width: 750px;
  z-index: 5;
  font-weight: 300;
  opacity: 0.95;
}

.app-store-badge {
  display: inline-block;
  z-index: 10;
  transition: var(--transition-smooth);
}

.app-store-badge:hover {
  transform: scale(1.05) translateY(-5px);
}

.app-store-badge img {
  height: 64px;
}

/* Mascot Grouping for Hero */
.mascot-group {
  position: absolute;
  bottom: -40px;
  right: 12%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 6;
}

.speech-bubble {
  position: relative;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  color: #66169A;
  padding: 16px 24px;
  border-radius: 20px;
  font-family: var(--font-headlines);
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  font-size: 1rem;
  max-width: 200px;
  animation: floatBubble 4s ease-in-out infinite;
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0;
  border-style: solid;
  border-color: white transparent;
}

.mascot-hero-img {
  width: 220px;
  height: auto;
  /* Blend mode to hide white background on mascot in light mode */
}

/* Features Section Polish */
.features {
  padding: 100px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 60px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 40px;
  padding: 0 20px;
}

.feature-card {
  background: var(--card-bg);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--card-border);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.1);
}

.feature-img-wrapper {
  width: 100%;
  padding: 40px 40px 0;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  min-height: 450px;
}

.feature-card img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: contain;
  transition: var(--transition-smooth);
}

/* Fix: Unify image sizes in "Easy Swipe Learning" */
.feature-card.double-img .feature-img-wrapper {
  gap: 20px;
  align-items: flex-end;
  /* Align to bottom for consistency */
}

.feature-card.double-img img {
  width: calc(50% - 10px);
  height: 400px;
  /* Rigorous height unification */
  object-fit: contain;
}

.feature-content {
  padding: 30px 40px 40px;
  text-align: left;
}

.feature-content h3 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: var(--secondary-accent);
}



.feature-content p {
  color: var(--text-color-light);
  font-size: 1.05rem;
}

/* Gallery Section Polish */
.gallery {
  padding: 100px 0;
  background: var(--section-bg-alt);
}

.carousel-outer {
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  /* Hide bounce overflow */
}

.carousel-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 40px 20px;
  gap: 30px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  will-change: transform;
  /* Hint for acceleration */
  max-width: 100%;
  margin: 0 auto;
  width: fit-content;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  flex: 0 0 auto;
  width: 300px;
  scroll-snap-align: center;
  transition: var(--transition-smooth);
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-item img {
  width: 100%;
  height: 600px;
  object-fit: contain;
  transition: var(--transition-smooth);
}

/* Removal of white backgrounds using blend mode */
img[alt*="mascot"],
.carousel-item img,
.feature-card img {
  mix-blend-mode: var(--img-blend);
}

.carousel-item:hover {
  transform: scale(1.08) translateY(-15px);
  z-index: 10;
}



/* Compact Footer */
footer {
  background: #111;
  color: white;
  padding: 60px 20px 40px;
  text-align: center;
}

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

.footer-content .app-store-badge img {
  height: 50px;
}

.footer-links {
  margin: 25px 0;
  display: flex;
  justify-content: center;
  gap: 30px;
}

.footer-links a {
  opacity: 0.7;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
  color: white;
}

.footer-links a:hover {
  opacity: 1;
}

.footer-mascot {
  width: 80px;
  margin: 30px 0 20px;
}

.copyright {
  margin-top: 20px;
  font-size: 0.85rem;
  opacity: 0.4;
}



/* Responsiveness */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 100vh;
  }

  /* Mobile Layout Adjustments */
  .hero h1 {
    font-size: 1.75rem;
    /* Reduced further for mobile */
  }

  .flag {
    width: 60px;
    /* Smaller flags for mobile */
  }

  .hero-icon {
    width: 200px;
  }

  .mascot-group {
    position: relative;
    right: auto;
    bottom: 0;
    margin-top: 40px;
  }

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

  .feature-img-wrapper {
    min-height: auto;
    padding: 30px 30px 0;
  }

  .feature-card.double-img img {
    height: auto;
    max-height: 350px;
  }

  .carousel-item {
    width: 260px;
  }

  .carousel-item img {
    height: 500px;
  }

  .footer-links {
    flex-direction: row;
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .footer-links {
    flex-direction: column;
    gap: 15px;
  }
}

/* Legal Pages Styles */
.legal-header {
  padding: 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-header a {
  display: flex;
  align-items: center;
  gap: 15px;
  font-family: var(--font-headlines);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent-color);
}

.legal-header img {
  height: 48px;
  width: auto;
  border-radius: 12px;
}

.legal-content {
  max-width: 800px;
  margin: 60px auto 100px;
  padding: 0 20px;
}

.legal-content h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-align: center;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-meta {
  text-align: center;
  color: var(--text-color-light);
  margin-bottom: 60px;
  font-size: 0.95rem;
}

.legal-content h2 {
  font-family: var(--font-headlines);
  font-size: 1.6rem;
  margin-top: 50px;
  margin-bottom: 20px;
  color: var(--secondary-accent);
}

.legal-content p,
.legal-content li {
  color: var(--text-color);
  margin-bottom: 16px;
  font-size: 1.05rem;
  opacity: 0.9;
}

.legal-content ul {
  padding-left: 25px;
  margin-bottom: 25px;
}

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

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

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

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