/* ==========================================================================
   Phase 1 — Home Page (Mobile First Composition)
   Visual hierarchy:
   1. Background image (assets/images/inicio.jpg)
   2. Top navigation menu (FuzzyBubbles-Bold)
   3. Decorative element (assets/images/vector__1trans.png)
   4. Main arched title: ¡NOS CASAMOS! (FuzzyBubbles-Regular)
   5. Progressive handwriting names: Elisa y Esther (BlindmatteDemo-V486Z)
   ========================================================================== */

.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: url('../assets/images/inicio.jpg');
  background-size: cover;
  background-position: 56% 50%;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero__content {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: 100%;
  padding-top: max(env(safe-area-inset-top, 0px), clamp(0.9rem, 2.8svh, 1.75rem));
  padding-inline: var(--container-inline-padding);
  padding-bottom: clamp(1rem, 3svh, 2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* 3. Decorative flourish vector__1trans */
.hero__ornament {
  margin-top: clamp(0.45rem, 1.8svh, 1.15rem);
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__ornament-img {
  width: clamp(2.35rem, 10.5vw, 2.9rem);
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

/* 4. Arched Main Title: ¡NOS CASAMOS! */
.hero__title {
  margin-top: clamp(0.25rem, 1svh, 0.7rem);
  width: min(46vw, 11.25rem);
  line-height: 1;
}

.hero__title-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero__title-text {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 31.5px;
  letter-spacing: 0.045em;
  fill: var(--color-primary);
}

/* 5. Progressive Handwriting Names: Elisa y Esther */
.hero__names {
  margin-top: clamp(1rem, 3.2svh, 1.9rem);
  font-family: var(--font-names);
  font-weight: 400;
  font-size: clamp(3.08rem, 14.28vw, 4.27rem);
  line-height: 1.15;
  color: var(--color-primary);
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 0.22em;
  white-space: nowrap;
}

.hero__name-word {
  display: inline-block;
  /* Extra padded mask box prevents clipping script ascenders and the descender of "y" */
  padding-block: 0.3em;
  padding-inline: 0.12em;
  margin-block: -0.3em;
  margin-inline: -0.06em;
}

/* Initial pending state before fonts settle */
.hero__names.is-pending .hero__name-word {
  opacity: 0;
}

/* Progressive handwriting sweep via slanted ink-edge mask */
@supports ((mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000))) {
  .hero__names.is-writing .hero__name-word {
    opacity: 1;
    -webkit-mask-image: linear-gradient(
      104deg,
      #000 0%,
      #000 44%,
      transparent 49%,
      transparent 100%
    );
    mask-image: linear-gradient(
      104deg,
      #000 0%,
      #000 44%,
      transparent 49%,
      transparent 100%
    );
    -webkit-mask-size: 260% 100%;
    mask-size: 260% 100%;
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation-name: handwriteReveal;
    animation-timing-function: var(--ease-handwriting);
    animation-fill-mode: both;
  }

  .hero__names.is-writing [data-write-word="1"] {
    animation-duration: 1.2s;
    animation-delay: 0.15s;
  }

  .hero__names.is-writing [data-write-word="2"] {
    animation-duration: 0.45s;
    animation-delay: 1.48s;
  }

  .hero__names.is-writing [data-write-word="3"] {
    animation-duration: 1.35s;
    animation-delay: 2.05s;
  }

  .hero__names.is-written .hero__name-word {
    opacity: 1;
    -webkit-mask-image: none;
    mask-image: none;
    animation: none;
  }
}

@keyframes handwriteReveal {
  0% {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
  }
  100% {
    -webkit-mask-position: 0% 0;
    mask-position: 0% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__names.is-pending .hero__name-word,
  .hero__names.is-writing .hero__name-word,
  .hero__names.is-written .hero__name-word {
    opacity: 1;
    -webkit-mask-image: none;
    mask-image: none;
    animation: none;
  }
}

/* ==========================================================================
   Responsive Scaling Prepared for Tablet & Desktop
   ========================================================================== */

@media (min-width: 768px) {
  .hero {
    background-position: 50% 48%;
  }

  .hero__content {
    padding-top: clamp(1.5rem, 3.5svh, 2.5rem);
  }

  .hero__ornament {
    margin-top: clamp(0.85rem, 2.2svh, 1.5rem);
  }

  .hero__ornament-img {
    width: 3.1rem;
  }

  .hero__title {
    width: min(36vw, 13.5rem);
  }

  .hero__names {
    margin-top: clamp(1.35rem, 3svh, 2.2rem);
    font-size: clamp(4.41rem, 7.7vw, 5.6rem);
  }
}

@media (min-width: 1024px) {
  .hero {
    background-position: 50% 45%;
  }

  .hero__title {
    width: 14rem;
  }

  .hero__names {
    margin-top: clamp(1.15rem, 2.7svh, 1.9rem);
    font-size: 5.74rem;
  }
}

