.hero {
  position: relative;
  width: 100%;
}

/* Disable hero fade-in animations after the first visit/initial load */
body.no-hero-anim .hero-title-line,
body.no-hero-anim .hero-subtitle-line,
body.no-hero-anim .hero-cta {
  opacity: 1 !important;
  animation: none !important;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: #000;
  background-image: url('../images/hero-background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-container {
  max-width: var(--max-width-container);
  padding: 0 80px;
  margin: 0 auto;
  display: flex;
  padding: 0 80px;
  height: 100dvh;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-title {
  font-family: 'PT Serif Regular', serif;
  font-size: 68px;
  font-weight: 400;
  font-style: italic;
  line-height: 64px;
  color: var(--mesana-cream);
}

.hero-title-line {
  font-family: 'PT Serif Italic', serif;
  display: inline-block;
  opacity: 0;
}

.hero-title-line:nth-child(1) {
  animation: fadeIn 0.8s ease-out 0.4s forwards;
}

.hero-title-line:nth-child(3) {
  animation: fadeIn 0.8s ease-out 0.5s forwards;
}

.hero-title-span {
  font-family: 'Libre Franklin', sans-serif;
  font-size: 64px;
  font-weight: 300;
  font-style: normal;
}

.hero-subtitle {
  font-family: 'Libre Franklin Light', sans-serif;
  font-size: 24px;
  line-height: 42px;
  letter-spacing: 0;
  color: var(--mesana-white);
}

.hero-subtitle-line {
  display: inline-block;
  opacity: 0;
}

.hero-subtitle-line:nth-child(1) {
  animation: fadeIn 0.8s ease-out 0.6s forwards;
}

.hero-subtitle-line:nth-child(3) {
  animation: fadeIn 0.8s ease-out 0.7s forwards;
}

.hero-subtitle-line:nth-child(5) {
  animation: fadeIn 0.8s ease-out 0.8s forwards;
}

.hero-black-overlay {
  position: absolute;
  bottom: -450px;
  left: -420px;
  width: 1280px;
  height: 1280px;
  background: radial-gradient(circle at center,
      rgba(16, 16, 16, 0.95) 42%,
      rgba(16, 16, 16, 0) 70%);
  z-index: -1;
  pointer-events: none;
}

.hero-red-overlay {
  position: absolute;
  bottom: -572px;
  right: 0;
  width: 900px;
  height: 900px;
  background: radial-gradient(circle at center,
      rgb(91, 27, 31) 26%,
      rgba(16, 16, 16, 0) 72%);
  z-index: -1;
  pointer-events: none;
  opacity: 0.95;
}

.hero-cta {
  font-family: 'Libre Franklin', sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5em;
  color: var(--mesana-red);
  text-decoration: none;
  padding: 8px 24px;
  border-radius: 999px;
  background-color: transparent;
  width: fit-content;
  opacity: 0;
  animation: fadeIn 0.8s ease-out 1s forwards;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.2s ease;
}

/* .bottom-gradient-hero {
  background: url('../images/white-gradient.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 80%;
  z-index: 0;
  position: absolute;
  bottom: 0;
} */

/* Hero CTA hover effect (similar to .projects-button, but text turns white) */
.hero-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--mesana-cream);
  z-index: -2;
}

.hero-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, #fff 0%, rgba(95, 28, 33, 0) 100%);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
  z-index: -1;
}

.hero-cta:hover::after {
  transform: scaleY(7);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .hero-black-overlay {
    bottom: -80px;
    left: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle at center,
        rgba(16, 16, 16, 0.98) 42%,
        rgba(16, 16, 16, 0) 76%);
  }

  .hero-red-overlay {
    bottom: -240px;
    right: 60px;
    width: 256px;
    height: 256px;
    background: radial-gradient(circle at center,
        rgb(91, 27, 31) 26%,
        rgba(16, 16, 16, 0) 72%);
    
  }
}

@media (max-width: 768px) {
  .hero-cta {
    font-size: 12px;
    padding: 8px 12px;
  }

  
  .hero-container {
    padding: 0 20px;
  }

  .hero-title {
    font-size: 40px;
    line-height: 56px;
  }

  .hero-title-span {
    font-size: 40px;
  }

  .hero-subtitle {
    font-size: 18px;
    margin-top: 0;
    line-height: 24px;
  }

  .hero-black-overlay {
    bottom: -100px;
    left: -460px;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle at center,
        rgba(16, 16, 16, 0.98) 42%,
        rgba(16, 16, 16, 0) 76%);
  }
}

@media (max-width: 480px) {
  .hero-black-overlay {
    display: none;
  }

  .hero-red-overlay {
    display: none;
  }
}