/* Landing page animations (public invitation + marketing front page) */

.toitap-invitation-page .toitap-hero-write-title,
.toitap-front-page .toitap-hero-write-title {
  display: inline-block;
  max-width: 100%;
}

.toitap-invitation-page .toitap-hero-write-line,
.toitap-front-page .toitap-hero-write-line {
  --toitap-hero-write-duration: 3s;
  --toitap-hero-write-delay: 0.25s;
  display: block;
  -webkit-mask-image: linear-gradient(
    100deg,
    #000 0%,
    #000 calc(50% - 1.5rem),
    rgb(0 0 0 / 35%) calc(50% - 0.35rem),
    transparent 50%,
    transparent 100%
  );
  mask-image: linear-gradient(
    100deg,
    #000 0%,
    #000 calc(50% - 1.5rem),
    rgb(0 0 0 / 35%) calc(50% - 0.35rem),
    transparent 50%,
    transparent 100%
  );
  -webkit-mask-size: 220% 100%;
  mask-size: 220% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: toitap-hero-write var(--toitap-hero-write-duration)
    cubic-bezier(0.22, 1, 0.36, 1) var(--toitap-hero-write-delay) both;
}

.toitap-invitation-page .toitap-hero-write-line--empty,
.toitap-front-page .toitap-hero-write-line--empty {
  animation: none;
  -webkit-mask-image: none;
  mask-image: none;
  opacity: 1;
  transform: none;
}

@keyframes toitap-hero-write {
  from {
    -webkit-mask-position: 100% 0;
    mask-position: 100% 0;
    opacity: 0.9;
    transform: translateY(0.4rem);
  }

  to {
    -webkit-mask-position: 0 0;
    mask-position: 0 0;
    opacity: 1;
    transform: translateY(0);
  }
}

.toitap-front-page .toitap-hero-neon-text {
  color: #fff;
  font-weight: 600;
  /* text-shadow:
    0 0 4px rgb(255 255 255 / 100%),
    0 0 12px rgb(255 255 255 / 90%),
    0 0 24px rgb(186 230 253 / 80%),
    0 0 40px rgb(56 189 248 / 55%),
    0 0 64px rgb(14 165 233 / 35%); */
  /* animation: toitap-hero-neon-glow 2.6s ease-in-out infinite; */
}

@keyframes toitap-hero-neon-glow {
  0%,
  100% {
    text-shadow:
      0 0 4px rgb(255 255 255 / 95%),
      0 0 12px rgb(255 255 255 / 75%),
      0 0 22px rgb(186 230 253 / 65%),
      0 0 36px rgb(56 189 248 / 40%),
      0 0 52px rgb(14 165 233 / 25%);
  }

  50% {
    text-shadow:
      0 0 6px rgb(255 255 255 / 100%),
      0 0 16px rgb(255 255 255 / 95%),
      0 0 32px rgb(186 230 253 / 90%),
      0 0 52px rgb(56 189 248 / 70%),
      0 0 80px rgb(14 165 233 / 50%);
  }
}

.toitap-invitation-page.is-reveal-ready .toitap-reveal:not(.is-visible),
.toitap-front-page.is-reveal-ready .toitap-reveal:not(.is-visible) {
  opacity: 0;
  transform: translateY(2rem);
}

.toitap-invitation-page.is-reveal-ready .toitap-reveal,
.toitap-front-page.is-reveal-ready .toitap-reveal {
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.toitap-invitation-page.is-reveal-ready .toitap-reveal.is-visible,
.toitap-front-page.is-reveal-ready .toitap-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toitap-invitation-page.is-reveal-ready .toitap-reveal-scale:not(.is-visible),
.toitap-front-page.is-reveal-ready .toitap-reveal-scale:not(.is-visible) {
  opacity: 0;
  transform: scaleX(0.86) translateY(0.5rem);
}

.toitap-invitation-page.is-reveal-ready .toitap-reveal-scale,
.toitap-front-page.is-reveal-ready .toitap-reveal-scale {
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.toitap-invitation-page.is-reveal-ready .toitap-reveal-scale.is-visible,
.toitap-front-page.is-reveal-ready .toitap-reveal-scale.is-visible {
  opacity: 1;
  transform: scaleX(1) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .toitap-invitation-page .toitap-hero-write-line,
  .toitap-front-page .toitap-hero-write-line {
    animation: none;
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 1;
    transform: none;
  }

  .toitap-front-page .toitap-hero-neon-text {
    animation: none;
    /* text-shadow:
      0 0 8px rgb(255 255 255 / 80%),
      0 0 12px rgb(186 230 253 / 50%); */
  }

  .toitap-invitation-page.is-reveal-ready .toitap-reveal,
  .toitap-invitation-page.is-reveal-ready .toitap-reveal-scale,
  .toitap-front-page.is-reveal-ready .toitap-reveal,
  .toitap-front-page.is-reveal-ready .toitap-reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Photo gallery carousel */
.toitap-gallery-section {
  position: relative;
  z-index: 0;
}

.toitap-gallery-carousel {
  position: relative;
}

.toitap-gallery-viewport {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow:
    0 20px 45px rgb(15 23 42 / 12%),
    inset 0 0 0 1px rgb(255 255 255 / 8%);
  touch-action: pan-x pinch-zoom;
}

.toitap-gallery-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.toitap-gallery-track.is-instant {
  transition: none !important;
}

.toitap-gallery-slide {
  flex-shrink: 0;
  height: 100%;
}

.toitap-gallery-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
  border: 0;
  padding: 0;
  background: rgb(15 23 42 / 4%);
}

.toitap-gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.toitap-gallery-dot {
  width: 0.5rem;
  height: 0.5rem;
  border: 0;
  border-radius: 9999px;
  background: rgb(148 163 184 / 55%);
  transition:
    width 0.25s ease,
    background-color 0.25s ease;
  cursor: pointer;
}

.toitap-gallery-dot.is-active {
  width: 1.35rem;
  background: rgb(109 40 217 / 85%);
}

.toitap-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgb(2 6 23 / 88%);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.toitap-gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.toitap-gallery-lightbox__frame {
  position: relative;
  width: min(92vw, 56rem);
  max-height: 88vh;
}

.toitap-gallery-lightbox__viewport {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 88vh;
  overflow: hidden;
  border-radius: 1rem;
  touch-action: pan-x pinch-zoom;
}

.toitap-gallery-lightbox__track {
  display: flex;
  align-items: center;
  min-height: min(72vh, 88vh);
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toitap-gallery-lightbox__track.is-instant {
  transition: none !important;
}

.toitap-gallery-lightbox__slide {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: inherit;
}

.toitap-gallery-lightbox__image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88vh;
  margin: 0 auto;
  border-radius: 1rem;
  object-fit: contain;
  box-shadow: 0 24px 60px rgb(0 0 0 / 45%);
  user-select: none;
  -webkit-user-drag: none;
}

.toitap-gallery-lightbox__close,
.toitap-gallery-lightbox__nav {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 9999px;
  background: rgb(15 23 42 / 72%);
  color: #fff;
  backdrop-filter: blur(6px);
  transition: background-color 0.2s ease;
  pointer-events: auto;
}

.toitap-gallery-lightbox__close:hover,
.toitap-gallery-lightbox__nav:hover {
  background: rgb(15 23 42 / 78%);
}

.toitap-gallery-lightbox__close {
  top: 0.75rem;
  right: 0.75rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
}

.toitap-gallery-lightbox__nav {
  top: 50%;
  width: 2.75rem;
  height: 2.75rem;
  transform: translateY(-50%);
}

.toitap-gallery-lightbox__nav svg {
  width: 1.2rem;
  height: 1.2rem;
}

.toitap-gallery-lightbox__nav--prev {
  left: 0.75rem;
}

.toitap-gallery-lightbox__nav--next {
  right: 0.75rem;
}

@media (max-width: 640px) {
  .toitap-gallery-lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
  }

  .toitap-gallery-lightbox__nav--prev {
    left: 0.5rem;
  }

  .toitap-gallery-lightbox__nav--next {
    right: 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toitap-gallery-track,
  .toitap-gallery-lightbox__track {
    transition: none;
  }

  .toitap-gallery-photo img {
    transition: none;
  }
}
