:root{}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: sans-serif;
  background: url('../Media/im1.jpg') no-repeat center center fixed;
  background-size: cover;
  overflow-x: hidden;
}

/* La portada usa el primer fotograma del video y comparte su marco 9:16.
   El sello y la manita mantienen su posición respecto al arte. */
#introScreen {
  position: fixed;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  background: #fffaf8;
  isolation: isolate;
}

#coverArtwork,
#videoStage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 56.25vh);
  width: max(100vw, 56.25dvh);
  aspect-ratio: 9 / 16;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

#coverImage,
#introVideo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#coverImage {
  user-select: none;
  -webkit-user-drag: none;
}

/* El sello y la manita tienen áreas táctiles independientes. */
#startBtn,
#sealBtn {
  position: absolute;
  width: 24%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a55778;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#sealBtn {
  top: 48.55%;
  left: 50.7%;
}

#startBtn {
  top: 80%;
  left: 52%;
  display: grid;
  place-items: center;
}

#sealBtn::before, #sealBtn::after {
  content: "";
  position: absolute;
  inset: 1%;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 50%;
  pointer-events: none;
  animation: wax-pulse 2.7s ease-out infinite;
}
#sealBtn::after { animation-delay: 1.35s; }

.tap-indicator {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(29px, 30%, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .95);
  background: rgba(255, 251, 249, .9);
  box-shadow: 0 2px 11px rgba(112, 50, 70, .15), inset 0 0 0 1px rgba(190, 110, 130, .11);
  backdrop-filter: blur(3px);
  animation: icon-tap-pulse 2s ease-in-out infinite;
  pointer-events: none;
}
.tap-indicator::before,
.tap-indicator::after {
  content: "";
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  border: 1.5px solid rgba(181, 113, 137, .6);
  opacity: 0;
}
.tap-indicator::before { animation: indicator-ripple 2s ease-out infinite; }
.tap-indicator::after { animation: indicator-ripple 2s ease-out infinite .4s; }
.tap-indicator svg { width: 55%; height: 55%; }
#startBtn:focus-visible, #sealBtn:focus-visible { outline: 2px solid #b75f87; outline-offset: 4px; }
#coverArtwork.is-starting #startBtn,
#coverArtwork.is-starting #sealBtn { opacity: 0; transition: opacity .15s ease; }

@keyframes wax-pulse {
  0% { transform: scale(.9); opacity: 0; }
  20% { opacity: .48; }
  75%,100% { transform: scale(1.22); opacity: 0; }
}
@keyframes icon-tap-pulse {
  0%, 56%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 11px rgba(112,50,70,.15), 0 0 0 0 rgba(190,110,130,0);
  }
  10% {
    transform: scale(.9);
    box-shadow: 0 1px 8px rgba(112,50,70,.18), 0 0 0 0 rgba(190,110,130,0);
  }
  20% {
    transform: scale(1.28);
    box-shadow: 0 4px 18px rgba(112,50,70,.3), 0 0 0 7px rgba(190,110,130,.14);
  }
  30% {
    transform: scale(1.02);
    box-shadow: 0 2px 11px rgba(112,50,70,.2), 0 0 0 2px rgba(190,110,130,.05);
  }
  40% {
    transform: scale(1.2);
    box-shadow: 0 4px 18px rgba(112,50,70,.28), 0 0 0 5px rgba(190,110,130,.1);
  }
}

@keyframes indicator-ripple {
  0% { transform: scale(.85); opacity: 0; }
  20% { opacity: .7; }
  65%, 100% { transform: scale(1.9); opacity: 0; }
}

/* Alternativa sin zoom ni desplazamiento para movimiento reducido. */
@keyframes indicator-glow {
  0%, 100% {
    background-color: #fffbf9;
    border-color: rgba(181,113,137,.25);
    box-shadow: 0 2px 11px rgba(112,50,70,.15), 0 0 0 7px rgba(190,110,130,0);
  }
  50% {
    background-color: #f6d2df;
    border-color: rgba(165,87,120,.8);
    box-shadow: 0 2px 11px rgba(112,50,70,.3), 0 0 0 7px rgba(190,110,130,.28);
  }
}


#videoStage {
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
  background: transparent;
}
#videoStage.is-playing { opacity: 1; }


/* En pantallas anchas se presenta la invitación completa al centro, con un
   fondo floral muy tenue; no recortamos el nombre ni el sello. */
@media (min-aspect-ratio: 3/5) {
  #introScreen::before {
    content: "";
    position: absolute;
    inset: -35px;
    background: url('../Media/intro-poster.jpg') center / cover no-repeat;
    filter: blur(32px);
    opacity: .22;
  }
  #coverArtwork,
  #videoStage {
    width: min(56.25vh, 100vw);
    width: min(56.25dvh, 100vw);
    box-shadow: 0 0 28px rgba(124, 79, 80, .08);
  }
}

/* En móviles estrechos mantenemos el mismo marco proporcional del arte y del video para evitar cambios de anchura al iniciar. */

@media (prefers-reduced-motion: reduce) {
  #sealBtn::before, #sealBtn::after,
  .tap-indicator::before, .tap-indicator::after { animation: none; }
  .tap-indicator { animation: indicator-glow 2.4s ease-in-out infinite; }
}

#viewerContainer {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.95);
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity .38s ease-in-out;
  overflow-y: auto;
  overflow-x: hidden;
  text-align: center;
  padding-bottom: 50px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

#viewerContainer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

#pdfWrapper {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.invitation-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.pdf-link {
  position: absolute;
  display: block;
  z-index: 10;
  border: 2px dashed transparent;
  text-indent: -9999px;
}

#downloadBtn {
  margin: 20px auto;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #65341A;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: none;
}

/* Estilo del contador*/
#countdown {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 36px;                /* separación entre columnas */
  pointer-events: none;
  font-family: 'Arial', sans-serif;
  color: #9B6D45;
}

.cd-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cd-value {
  font-size: 35px;
  font-weight: 300;
  letter-spacing: 2px;
}

.cd-label {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 2px;
}

/* mensaje cuando termine la cuenta */
.cd-finished {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
}

/* Círculo que marca la cantidad de invitados */
#guestMarker {
  position: absolute;
  z-index: 9;              /* debajo de los links y del contador */
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: #65341A;  /* color de relleno, ajusta al tono del diseño */
  pointer-events: none;
  display: none;           /* se muestra solo cuando hay ?inv= */
}
