/*
 * Motion system shared with the home (GSAP, ScrollTrigger, Lenis).
 * Everything here only applies when html.nc-motion is set, i.e. the visitor did not ask for reduced motion.
 * Selector lists below must stay in sync with TITLES and ARTWORKS in assets/js/motion.js.
 */

/* Lenis smooth scroll. */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

/* Page curtain: covers the page until the script lifts it, and falls back to lifting itself. */
.page-transition { display: none; }
.nc-motion .page-transition { position: fixed; z-index: 2147483647; inset: 0; display: block; pointer-events: none; background: #653b35; transform: translateY(0); transition: transform .62s cubic-bezier(.76, 0, .24, 1); animation: nc-curtain-out .62s cubic-bezier(.76, 0, .24, 1) 2.5s forwards; }
.nc-motion .page-transition__brand { position: absolute; top: 50%; left: 50%; color: #fcfbf8; font: 400 clamp(2rem, 4vw, 4rem) / 1 var(--font-display, Georgia, serif); letter-spacing: -.02em; text-align: center; transform: translate(-50%, -50%); white-space: nowrap; }
.nc-motion.nc-motion-ready .page-transition { animation: none; }
.nc-motion .page-transition--entered { transform: translateY(-101%); }
@keyframes nc-curtain-out { to { transform: translateY(-101%); } }

/* Word reveal for titles: words start blurred and lowered, GSAP brings them in. */
.nc-motion .reveal-text__word { display: inline-block; opacity: 0; filter: blur(8px); transform: translate3d(0, .28em, 0); }
.nc-motion:not(.nc-motion-ready) :is(
	.nc-collection__intro h1, .nc-bio__cartela h1, .nc-bio__chapter h2, .nc-bio__close h2, .nc-bio__role,
	.nc-blog__intro h1, .nc-blog__lede, .nc-blog__aside h2, .nc-entry__head h1, .nc-post__more h2,
	.nc-contact__content h1, .nc-contact__lede, .nc-contact__direct h2, .nc-legal__head h1, .nc-legal__body h2, .nc-awards__head h1, .nc-award__title,
	.artwork-hero h1, .wp-block-post-title
) { visibility: hidden; animation: nc-show-text 0s 2.5s forwards; }
@keyframes nc-show-text { to { visibility: visible; } }

/* Artwork reveal: each work rises in and its image is uncovered. */
.nc-motion :is(.nc-award__media, .nc-collection__work, li.wc-block-product, .woocommerce ul.products li.product, .nc-blog__cover, .artwork-hero__image-wrap) { opacity: 0; }
.nc-motion:not(.nc-motion-ready) :is(.nc-award__media, .nc-collection__work, li.wc-block-product, .woocommerce ul.products li.product, .nc-blog__cover, .artwork-hero__image-wrap) { animation: nc-show-work 0s 2.5s forwards; }
@keyframes nc-show-work { to { opacity: 1; } }
