.masthead {
  --hero-mouse-x: 0px;
  --hero-mouse-y: 0px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 35rem;
  height: auto;
  padding: 15rem 0;
  background:
    linear-gradient(135deg, rgba(2, 9, 16, 0.52), rgba(4, 23, 36, 0.18) 58%, rgba(2, 9, 16, 0.72)),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.68) 75%, #020910 100%),
    url("../../assets/img/fondo.jpeg");
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-size: cover;
}

.masthead::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(97, 213, 232, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(97, 213, 232, 0.055) 1px, transparent 1px);
  background-size: 4.25rem 4.25rem;
  content: "";
  mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 82%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 4%, #000 38%, #000 82%, transparent 100%);
  transform: translate(var(--hero-mouse-x), var(--hero-mouse-y)) scale(1.08);
  transition: transform 0.25s ease-out;
}

.masthead::after {
  position: absolute;
  z-index: -1;
  width: 35rem;
  height: 35rem;
  right: -18rem;
  bottom: -21rem;
  border: 1px solid rgba(97, 213, 232, 0.22);
  border-radius: 50%;
  box-shadow:
    0 0 4rem rgba(42, 174, 255, 0.12),
    inset 0 0 4rem rgba(42, 174, 255, 0.06);
  content: "";
  animation: hero-ring-pulse 7s ease-in-out infinite;
}

.hero-ambient,
.masthead > .container,
.hero-scroll-indicator {
  position: relative;
  z-index: 2;
}

.hero-ambient {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.hero-orb {
  position: absolute;
  width: 18rem;
  height: 18rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(42, 174, 255, 0.16), transparent 68%);
  filter: blur(10px);
  animation: hero-orb-drift 11s ease-in-out infinite;
}

.hero-orb-one {
  top: 12%;
  left: -8rem;
}

.hero-orb-two {
  right: -6rem;
  bottom: 2%;
  animation-delay: -5.5s;
}

.hero-scanline {
  position: absolute;
  top: -12%;
  left: 0;
  width: 100%;
  height: 12%;
  background: linear-gradient(to bottom, transparent, rgba(97, 213, 232, 0.08), transparent);
  animation: hero-scan 8s linear infinite;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(97, 213, 232, 0.28);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(4, 18, 30, 0.42);
  backdrop-filter: blur(8px);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16rem;
  text-transform: uppercase;
  opacity: 0;
  animation: hero-content-enter 0.8s 0.15s ease forwards;
}

.hero-status span {
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: #61d5e8;
  box-shadow: 0 0 0.8rem #61d5e8;
  animation: hero-status-pulse 1.8s ease-in-out infinite;
}

.hero-title {
    max-width: 100%;
    position: relative;
    font-family: "Varela Round", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 2.5rem;
    line-height: 1.1;
    letter-spacing: 0.8rem;
    filter: drop-shadow(0 0.8rem 1.4rem rgba(0, 0, 0, 0.38));

    background: linear-gradient(
        to bottom,
        #ffffff 0%,
        rgb(228, 224, 224) 65%,
        rgba(109, 106, 106, 0.65) 100%
    );

    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-title-line {
    display: block;
    white-space: nowrap;
    opacity: 0;
    animation: hero-title-enter 1s cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
}

.hero-title-line:nth-child(1) {
    animation-delay: 0.28s;
}

.hero-title-line:nth-child(2) {
    animation-delay: 0.42s;
}

.masthead h2 {
  max-width: 20rem;
  font-size: 1rem;
  opacity: 0;
  animation: hero-content-enter 0.8s 0.62s ease forwards;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  opacity: 0;
  animation: hero-content-enter 0.8s 0.78s ease forwards;
}

.hero-primary-action {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(97, 213, 232, 0.58) !important;
  background: linear-gradient(135deg, #64a19d, #168bd0) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-primary-action:hover {
  transform: translateY(-0.18rem);
  box-shadow: 0 1rem 2.2rem rgba(42, 174, 255, 0.24) !important;
}

.hero-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08rem;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.25s ease, gap 0.25s ease;
}

.hero-secondary-action:hover {
  gap: 0.8rem;
  color: #61d5e8;
}

.hero-scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14rem;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
  animation: hero-scroll-bounce 2s ease-in-out infinite;
}

@keyframes hero-content-enter {
  from { opacity: 0; transform: translateY(1.25rem); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-title-enter {
  from { opacity: 0; transform: translateY(1.5rem) scale(0.96); filter: blur(8px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes hero-status-pulse {
  50% { opacity: 0.55; transform: scale(0.72); }
}

@keyframes hero-orb-drift {
  50% { transform: translate(3rem, -2rem) scale(1.12); }
}

@keyframes hero-scan {
  from { transform: translateY(-20vh); }
  to { transform: translateY(115vh); }
}

@keyframes hero-ring-pulse {
  50% { transform: scale(1.08); opacity: 0.55; }
}

@keyframes hero-scroll-bounce {
  50% { transform: translate(-50%, 0.45rem); }
}

@media (max-width: 575.98px) {
  .masthead {
    padding: 12.5rem 1rem 8rem;
  }

  .hero-status {
    font-size: 0.58rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-primary-action {
    width: 100%;
  }

  .hero-scroll-indicator {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .masthead *,
  .masthead::before,
  .masthead::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
