:root {
  --primary-brand: #165b4d;
  --secondary-brand: #ffba3a;
  --accent-coral: #ff6b9d;
  --accent-blue: #69c6f5;
  --accent-green: #70e17b;
  --pastel-yellow: #fff3cd;
  --pastel-blue: #cce7ff;
  --pastel-pink: #ffd6e0;
  --pastel-green: #d4edda;
  --pastel-purple: #e2d5f1;
  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --bg-light: #f8f9fa;
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 12px 48px rgba(0, 0, 0, 0.15);
  --border-radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Lexie Readable', 'Inter', sans-serif;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    var(--pastel-blue) 0%,
    var(--pastel-yellow) 50%,
    var(--pastel-pink) 100%
  );
  min-height: 100vh;
  overflow-x: hidden;
}

/* Dyslexia-friendly text styling 
.dyslexia-friendly {
  font-family: 'Open-Dyslexic', 'Lexend', sans-serif;
  line-height: 1.8;
  letter-spacing: 0.05em;
  word-spacing: 0.1em;
}*/

/* Floating background elements */
.floating-icons {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.floating-icon {
  position: absolute;
  font-size: 2rem;
  opacity: 0.2;
  animation: float 6s ease-in-out infinite;
}

.floating-icon:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
  color: var(--secondary-brand);
}

.floating-icon:nth-child(2) {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
  color: var(--accent-coral);
}

.floating-icon:nth-child(3) {
  top: 40%;
  left: 5%;
  animation-delay: 2s;
  color: var(--accent-blue);
}

.floating-icon:nth-child(4) {
  top: 60%;
  right: 10%;
  animation-delay: 3s;
  color: var(--accent-green);
}

.floating-icon:nth-child(5) {
  top: 80%;
  left: 20%;
  animation-delay: 4s;
  color: var(--accent-coral);
}

.floating-icon:nth-child(6) {
  top: 70%;
  right: 25%;
  animation-delay: 5s;
  color: var(--secondary-brand);
}

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

  25% {
    transform: translateY(-20px) rotate(5deg);
  }

  50% {
    transform: translateY(-40px) rotate(-5deg);
  }

  75% {
    transform: translateY(-20px) rotate(3deg);
  }
}

/* Header Styles */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.nav-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
  margin: 0 0.25rem;
}

.nav-btn.login {
  color: var(--primary-brand);
  border-color: var(--primary-brand);
  background: transparent;
}

.nav-btn.login:hover {
  background: var(--primary-brand);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.nav-btn.register {
  background: linear-gradient(
    45deg,
    var(--accent-coral),
    var(--secondary-brand)
  );
  color: white;
  border: none;
}

.nav-btn.register:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  filter: brightness(1.1);
}

.logo-img {
  width: 108px;
  height: auto;
}

/* Hero Section */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 10;
  padding: 2rem 0;
}

.hero-content {
  animation: slideInLeft 1s ease-out;
}

.hero-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    45deg,
    var(--accent-coral),
    var(--secondary-brand),
    var(--accent-blue),
    var(--accent-green)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}
.tts-toolbar { display: flex; gap: .5rem; align-items: center; }
.tts-toolbar .tts-btn { border: none; background: transparent; color: #fff; padding: .25rem .5rem; border-radius: .25rem; }
.tts-toolbar .tts-btn:hover { background: rgba(255,255,255,0.12); }
.instructions-segments { line-height: 1.6; }
.instructions-list { margin: 0; padding-left: 1.1rem; }
.instructions-list li { margin-bottom: .4rem; }

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(
    45deg,
    var(--accent-coral),
    var(--secondary-brand)
  );
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.hero-cta:hover::before {
  left: 100%;
}

.hero-cta:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-hover);
  color: white;
  text-decoration: none;
}

.rocket-icon {
  animation: rocket 2s ease-in-out infinite;
}

@keyframes rocket {
  0%,
  100% {
    transform: translateY(0px);
  }

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

.hero-illustration {
  animation: slideInRight 1s ease-out;
  position: relative;
}

.hero-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  animation: bounce 3s ease-in-out infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0px);
  }

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

/* Character illustration */
.character-container {
  position: relative;
  display: inline-block;
}

.character-bubble {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  opacity: 0.7;
  animation: bubbleFloat 4s ease-in-out infinite;
}

.character-bubble.bubble-2 {
  display: none;
}

.bubble-1 {
  background: var(--pastel-yellow);
  top: -20px;
  left: -30px;
  animation-delay: 0s;
}

.bubble-2 {
  background: var(--pastel-pink);
  bottom: -20px;
  right: -30px;
  animation-delay: 1s;
}

.bubble-3 {
  background: var(--pastel-green);
  top: 50%;
  left: -40px;
  animation-delay: 2s;
}

@keyframes bubbleFloat {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }

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

/* Features Section */
.features-section {
  padding: 5rem 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 10;
}

.section-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary-brand);
}

.feature-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  height: 100%;
  border: 3px solid transparent;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    45deg,
    var(--accent-coral),
    var(--secondary-brand),
    var(--accent-blue)
  );
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--secondary-brand);
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: block;
  transition: var(--transition);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
  0%,
  100% {
    transform: scale(1.1) rotate(5deg);
  }

  25% {
    transform: scale(1.1) rotate(-5deg);
  }

  75% {
    transform: scale(1.1) rotate(5deg);
  }
}

.feature-title {
  font-family: 'Fredoka', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-brand);
  margin-bottom: 1rem;
  text-align: center;
}

.feature-description {
  color: var(--text-secondary);
  text-align: center;
  font-size: 1rem;
}

/* CTA Section */
.cta-section {
  background: linear-gradient(
    135deg,
    var(--pastel-pink) 0%,
    var(--pastel-purple) 100%
  );
  padding: 5rem 0;
  text-align: center;
  position: relative;
  z-index: 10;
}

.cta-title {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--primary-brand);
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2.5rem;
  background: linear-gradient(
    45deg,
    var(--accent-coral),
    var(--secondary-brand)
  );
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.2rem;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.cta-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.cta-button:hover::after {
  width: 400px;
  height: 400px;
}

.cta-button:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: var(--shadow-hover);
  color: white;
  text-decoration: none;
}

.sparkle-icon {
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%,
  100% {
    transform: scale(1) rotate(0deg);
  }

  50% {
    transform: scale(1.2) rotate(180deg);
  }
}

/* Footer */
.footer {
  background: var(--primary-brand);
  color: white;
  text-align: center;
  padding: 2rem 0;
  position: relative;
  z-index: 10;
}

/* Animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

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

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }

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

/* PWA Download Button */
.pwa-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: linear-gradient(
    45deg,
    var(--accent-coral),
    var(--secondary-brand)
  );
  /* Match hero-cta */
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.pwa-download-btn i {
  font-size: 1.2em;
}

.pwa-download-btn:hover,
.pwa-download-btn:focus {
  background: linear-gradient(
    45deg,
    var(--secondary-brand),
    var(--accent-coral)
  );
  /* Optional: reverse for hover effect */
  transform: translateY(-3px) scale(1.05);
  box-shadow: var(--shadow-hover);
  outline: 3px solid var(--secondary-brand);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    text-align: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
    display: block;
    text-align: center;
  }

  .hero-img {
    width: 100%;
    max-width: 400px;
  }

  .hero-content {
    margin-bottom: 2rem;
  }

  .nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .floating-icon {
    font-size: 1.5rem;
  }

  /* Center the PWA download button on mobile */
  #pwa-install-btn {
    /* display: block; */
    margin-left: 0;
    float: none;
  }
}

/* Remove margin-left for #pwa-install-btn between 1400px and 992px */
@media (max-width: 1400px) and (min-width: 992px) {
  #pwa-install-btn {
    margin-left: 0 !important;
  }
}

@media (max-width: 576px) {
  #pwa-install-btn {
    margin-left: 0 !important;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .feature-card {
    padding: 1.5rem;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }
}

/* Adjust hero-img width for screens between 991px and 769px */
@media (max-width: 991px) and (min-width: 769px) {
  .hero-img {
    width: 100%;
    max-width: 400px;
    margin-top: 5rem;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
}

/* Accessibility improvements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus styles for keyboard navigation */
.nav-btn:focus,
.hero-cta:focus,
.cta-button:focus {
  outline: 3px solid var(--secondary-brand);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 434px) {
  .footer-break {
    display: block !important;
    margin-top: 0.25em;
  }
}

@media (max-width: 381px) {
  .nav-btn {
    font-size: 12px;
  }

  #pwa-install-btn {
    margin-left: 0 !important;
  }
}

@media (max-width: 374px) {
  .hero-cta span, .pwa-download-btn span {
    font-size: .8rem;
  }
  .cta-button span {
    font-size: .85rem;
  }
}

@media (max-width: 359px) {
  .nav-btn {
    font-size: 10px;
  }
}

@media (max-width: 342px) {
  .nav-btn {
    font-size: 9px;
  }
}

