/* ─────────────────────────────────────────────────────────────
   Morris Arena — behaviour styles for the static site.
   (css/styles.css holds the compiled design system; this file adds the
   states that js/main.js toggles.)
   ───────────────────────────────────────────────────────────── */

/* Reveal on scroll. Visible by default when JS is off. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Parallax layers are moved with transforms only */
[data-parallax],
[data-tilt] {
  will-change: transform;
}

/* Header states */
#site-header.is-scrolled,
#site-header.menu-open {
  border-bottom-color: rgba(230, 184, 92, 0.15);
  background: rgba(7, 19, 33, 0.8);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
}
#header-logo {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#site-header.is-scrolled #header-logo,
#site-header.menu-open #header-logo {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Mobile menu */
.mobile-menu {
  animation: menu-in 0.2s ease-out;
}
@keyframes menu-in {
  from { opacity: 0; transform: translateY(-8px); }
}

/* Sticky download bar (phones) */
.sticky-cta {
  transform: translateY(110%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.sticky-cta.is-visible {
  transform: none;
}

/* Lightbox */
.lightbox:not([hidden]) {
  animation: lb-in 0.2s ease-out;
}
@keyframes lb-in {
  from { opacity: 0; }
}
.lb-stage > * {
  animation: lb-zoom 0.25s ease-out;
}
@keyframes lb-zoom {
  from { opacity: 0; transform: scale(0.96); }
}

/* Gallery card state (centred card is full strength on phones/tablets) */
@media (max-width: 1023px) {
  [data-gal-open] {
    transform: scale(0.94);
    opacity: 0.6;
  }
  [data-gal-open].is-active {
    transform: none;
    opacity: 1;
  }
}

/* Copy-link toast */
.share-toast {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  white-space: nowrap;
  border-radius: 0.375rem;
  background: #1f6d57;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f6f4ee;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    transform: none;
    transition: opacity 0.01ms;
  }
  .sticky-cta {
    transition: none;
  }
}

/* Tailwind display utilities must not override the hidden attribute */
[hidden] { display: none !important; }

/* Lightbox stage: landscape phone, as large as the viewport allows */
.lb-stage {
  width: min(94vw, calc((100svh - 10rem) * 2.228));
}

/* Gallery: centred on phones/tablets, left-aligned beside the arrows on desktop */
@media (max-width: 767px) {
  .gallery-head {
    text-align: center;
    margin-inline: auto;
  }
  /* pad the track so the first and last frames can sit dead-centre */
  #gallery-track {
    padding-inline: calc((100vw - min(84vw, 34rem)) / 2);
  }
}

/* Footer: centred on phones/tablets */
@media (max-width: 767px) {
  footer {
    text-align: center;
  }
  footer .container-arena > .grid > div > img,
  footer .container-arena > .grid > div > p {
    margin-inline: auto;
  }
  footer .container-arena > .grid ul,
  footer .container-arena > .grid .flex-wrap {
    justify-content: center;
  }
  footer .container-arena > .mt-14 {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  footer .container-arena > .mt-14 ul {
    justify-content: center;
  }
}
