/* Motion is progressive enhancement: the page stays readable without JS. */
html { scroll-padding-top: 88px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.reveal { opacity: 1; transform: none; }
.hero-media img { animation: none; transform: none; object-position: 42% center; }
/* .hero-media aísla las capas de las fotos: el degradado oscuro (::after) va siempre encima
   de ellas y todo el bloque queda bajo el texto de la portada. */
.hero-media { z-index: 0; }
.hero-media::after { z-index: 3; }
.hero-slide { position: absolute; inset: 0; overflow: hidden; opacity: 0; }
.hero-slide.is-active { opacity: 1; z-index: 2; }
.hero-slide.is-leaving { opacity: 1; z-index: 1; }
.hero-slide--costa img { object-position: 64% center; }
.hero-slide--velas img { object-position: 12% center; }
/* Indicador de fotos: número y una línea dorada que se llena mientras corre cada foto. */
.hero-dots {
  position: absolute;
  z-index: 3;
  right: max(24px, calc((100vw - 1260px) / 2));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.hero-dots[hidden], .hero-pause[hidden] { display: none; }
.hero-dot, .hero-pause {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
  padding: 0 0 0 10px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .5);
  font: 500 10px/1 var(--sans);
  letter-spacing: .2em;
  cursor: pointer;
  transition: color .4s;
}
.hero-dot:hover, .hero-dot[aria-current="true"] { color: #e5d3aa; }
.hero-dot i { position: relative; width: 26px; height: 1px; overflow: hidden; background: rgba(255, 255, 255, .32); transition: width .6s var(--ease); }
.hero-dot i::after { content: ""; position: absolute; inset: 0; background: #d6bc7d; transform: scaleX(0); transform-origin: left; }
.hero-dot[aria-current="true"] i { width: 58px; }
.hero-dot[aria-current="true"] i::after { transform: none; }
.hero-pause { justify-content: center; width: 30px; margin-top: 6px; padding: 0; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; color: #e5d3aa; }
.hero-pause:hover { border-color: #d6bc7d; }
.hero-pause svg { width: 10px; height: 10px; }
/* La línea marca el tiempo de cada foto también con «reducir movimiento»: ahí las fotos
   rotan con un fundido simple, sin barrido ni acercamiento. */
.hero-dots.is-playing .hero-dot[aria-current="true"] i::after { animation: heroDotFill var(--slide-time, 7s) linear both; }
/* Debe ganarle en especificidad a la regla anterior: el atajo «animation» reinicia el estado. */
.hero-dots.is-playing.is-paused .hero-dot[aria-current="true"] i::after { animation-play-state: paused; }
@keyframes heroDotFill {
  from { transform: scaleX(0); }
  to { transform: none; }
}
.hero-stage { position: relative; }
.hero { min-height: 720px; }
.hero-heading { transform-origin: left center; }
.hero-heading:focus-within { opacity: 1; }
.scroll-mark { display: none; }
.hero-scroll {
  position: absolute;
  z-index: 3;
  right: max(24px, calc((100vw - 1260px) / 2));
  bottom: 30px;
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #e5d3aa;
}
.hero-scroll > span:last-child { font-size: 22px; }
.hero-scroll { display: none; } /* su esquina la ocupa el botón del asistente */
.portrait-frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; }
.mobile-contact { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .motion-ready .reveal {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity .75s var(--ease), transform .9s var(--ease);
    transition-delay: var(--reveal-delay, 0ms);
  }
  .motion-ready .reveal.visible,
  .motion-ready .reveal:focus-within { opacity: 1; transform: none; }
  /* Portada: cada foto entra con un barrido de luz suave de izquierda a derecha sobre la
     anterior y se acerca muy despacio mientras está en pantalla. */
  .motion-ready .hero-slide.is-active,
  .motion-ready .hero-slide.is-leaving { animation: heroDrift 16s cubic-bezier(.33, 0, .2, 1) both; }
  .motion-ready .hero-slide.is-revealing img {
    -webkit-mask-image: linear-gradient(100deg, #000 45%, transparent 55%);
    mask-image: linear-gradient(100deg, #000 45%, transparent 55%);
    -webkit-mask-size: 300% 100%;
    mask-size: 300% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    animation: heroReveal 2.6s cubic-bezier(.65, 0, .35, 1) both;
  }
  @keyframes heroDrift {
    from { transform: scale(1); }
    to { transform: scale(1.07); }
  }
  @keyframes heroReveal {
    from { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
    to { -webkit-mask-position: 0 0; mask-position: 0 0; }
  }
  .motion-ready .hero-media img {
    transform: translate3d(0, var(--hero-pan, 0px), 0) scale(var(--hero-scale, 1));
    transform-origin: 60% 32%;
  }
  .motion-ready .hero-heading {
    opacity: var(--heading-opacity, 1);
    transform: translate3d(0, var(--heading-lift, 0px), 0);
  }
  .motion-ready .hero-kicker { animation: arrival .9s var(--ease) both; }
  .motion-ready .hero h1 { animation: arrival 1.15s .12s var(--ease) both; }
  .motion-ready .hero-bottom { animation: arrival 1.1s .24s var(--ease) both; }
  .motion-ready .portrait-frame img,
  .motion-ready .promise-image img {
    transform: translate3d(0, var(--image-pan, 0px), 0) scale(1.07);
  }
  .motion-ready .eyebrow::before {
    transform-origin: left;
    transition: transform .9s var(--ease);
  }
  .motion-ready .reveal:not(.visible) .eyebrow::before { transform: scaleX(.2); }
  .hero-scroll > span:last-child { animation: scrollInvitation 2.6s var(--ease) 2; }
  @keyframes arrival {
    from { opacity: 0; transform: translate3d(0, 16px, 0); }
    to { opacity: 1; transform: none; }
  }
  @keyframes scrollInvitation {
    0%, 100% { transform: none; }
    50% { transform: translateY(5px); }
  }
}

@media (min-width: 901px) and (min-height: 660px) and (prefers-reduced-motion: no-preference) {
  .motion-ready .hero-stage { height: 148svh; }
  .motion-ready .hero { position: sticky; top: 0; height: 100svh; min-height: 660px; }
}

@media (max-width: 900px) {
  .hero-scroll { display: none; }
  .hero-media img { object-position: 59% center; }
  .hero-slide--velas img { object-position: 52% center; }
  .hero-dots { top: auto; bottom: 16px; left: 20px; right: auto; transform: none; flex-direction: row; align-items: center; gap: 2px; }
  .hero-dot { padding: 0 10px 0 0; gap: 8px; }
  .hero-dot i { width: 16px; }
  .hero-dot[aria-current="true"] i { width: 36px; }
  .hero-pause { margin: 0 0 0 4px; }
  .motion-ready .reveal { transform: translate3d(0, 10px, 0); transition-duration: .5s; }
  .motion-ready .reveal.visible { transform: none; }
  .motion-ready .hero-heading { opacity: 1; transform: none; }
  .motion-ready .portrait-frame img,
  .motion-ready .promise-image img { transform: none; }
  /* A filtered header would otherwise confine the fixed mobile menu. */
  .nav.scrolled { backdrop-filter: none; }
  .menu-open .nav { position: fixed; top: 0; animation: none; }
  .nav-links { height: 100dvh; padding: 95px 22px 40px; overflow-y: auto; }
  .nav-links a { flex-shrink: 0; }
  .menu-btn { width: 44px; height: 44px; }
  footer { padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px)); }
  .mobile-contact {
    position: fixed;
    z-index: 19;
    left: 14px;
    right: 14px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    min-height: 58px;
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: var(--forest);
    border: 1px solid rgba(213, 185, 121, .5);
    box-shadow: 0 6px 24px rgb(16 27 21 / 16%);
    color: var(--paper);
  }
  .mobile-contact > span { max-width: 110px; font-size: 10px; line-height: 1.4; color: #c4cabe; }
  .mobile-contact strong { font-size: 11px; font-weight: 500; }
  .mobile-contact strong span { color: #d6bc7d; padding-left: 8px; }
  .motion-ready .mobile-contact { opacity: 0; visibility: hidden; transform: translateY(12px); transition: .25s; }
  .motion-ready .mobile-contact.is-visible { opacity: 1; visibility: visible; transform: none; }
  .menu-open .mobile-contact { display: none; }
}

@media (max-width: 560px) {
  /* Long editorial words must still fit at 320px and at larger text sizes. */
  .hero h1 { font-size: clamp(46px, 13.5vw, 68px); }
  .hero h1 em { padding-left: 0; }
  .hero-content { padding-top: 130px; padding-bottom: 60px; }
  .hero { height: auto; min-height: max(740px, 100svh); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-media img, .hero-heading, .portrait-frame img, .promise-image img,
  .motion-ready .reveal { transform: none !important; }
  .hero-heading, .motion-ready .reveal { opacity: 1 !important; }
  .hero-stage { height: auto !important; }
  .hero { position: relative !important; }
  .hero-scroll > span:last-child { animation: none; }
  /* index.html apaga toda transición con «* { transition: none !important }»; el fundido de
     la portada es la excepción (es solo opacidad, sin desplazamiento). */
  .motion-ready .hero-slide { transition: opacity 1.6s ease !important; }
}
