/* Dynamic Text Animation Styles */
.dynamic-text {
  display: inline-block;
  position: relative;
  vertical-align: baseline;
}

.word-wrapper {
  display: inline-block;
  position: relative;
  min-width: 180px;
  min-height: 1.2em;
  vertical-align: baseline;
}

/* General word styling */
.word {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  color: #00987a;
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-weight: 600;
  visibility: hidden;
  white-space: nowrap;
}

/* Default fade animation for most dynamic text */
.word.active {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Special styling for the typing animation */
.typing-animation .word {
  position: static;
  display: none;
  transform: none;
  transition: none;
  visibility: visible;
}

.typing-animation .word.active {
  display: inline-block;
  opacity: 1;
  position: relative;
}

/* Typing cursor effect */
.typing-animation .word.active::after {
  content: '|';
  position: absolute;
  right: -5px;
  color: #00987a;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to { opacity: 0; }
  50% { opacity: 1; }
}

/* Hero title styling */
.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.5rem 0;
  margin-top: 0;
  color: #2c3e50;
}

.hero-title .dynamic-text {
  color: #00987a;
  font-weight: 600;
  font-size: 2rem;
}

/* Hero title with typing animation */
.hero-title .dynamic-text {
  margin-left: 0.5rem;
  display: inline-block;
  min-height: 2.5rem;
  vertical-align: middle;
}

/* Responsive design */
@media (max-width: 1199px) {
  .hero-title {
    font-size: 2.1rem;
  }
  
  .hero-title .dynamic-text {
    font-size: 1.9rem;
  }
  
  .word-wrapper {
    min-width: 170px;
  }
}

@media (max-width: 991px) {
  .hero-title {
    font-size: 2rem;
    line-height: 1.3;
  }
  
  .hero-title .dynamic-text {
    font-size: 1.8rem;
  }
  
  .word-wrapper {
    min-width: 160px;
    min-height: 2.2rem;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 1.8rem;
    line-height: 1.3;
  }
  
  .hero-title .dynamic-text {
    font-size: 1.6rem;
  }
  
  .word-wrapper {
    min-width: 140px;
    min-height: 2rem;
  }
}

@media (max-width: 575px) {
  .hero-title {
    font-size: 1.6rem;
    line-height: 1.4;
  }
  
  .hero-title .dynamic-text {
    font-size: 1.4rem;
  }
  
  .word-wrapper {
    min-width: 120px;
    min-height: 1.8rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.5rem;
    line-height: 1.4;
  }
  
  .hero-title .dynamic-text {
    font-size: 1.3rem;
    margin-left: 0.3rem;
  }
  
  .word-wrapper {
    min-width: 110px;
    min-height: 1.7rem;
  }
}