/* =============================================================
   SCROLL MOTION ENGINE — georgeta-2026
   Reveal-on-scroll + parallax for the 2026 fine-art front page.
   Pairs with assets/scroll-2026.js (adds .is-in, drives parallax).
   Honors the shared animation contract: .rv (+ modifiers),
   [data-parallax], .px-frame > .px-img, .hero26__media.
   ============================================================= */

:root {
	/* Shared motion tokens — tune the whole engine from here. */
	--rv-dur: 1s;                              /* reveal duration            */
	--rv-ease: cubic-bezier(.22, .61, .36, 1); /* refined "ease-out-soft"    */
	--rv-rise: 34px;                           /* default .rv translateY      */
	--rv-shift: 48px;                          /* .rv--left / .rv--right       */
	--rv-scale: .92;                           /* .rv--scale start            */
	--rv-blur: 14px;                           /* .rv--blur start             */
}

/* -------------------------------------------------------------
   REVEAL ON SCROLL
   Base: initial = faded + risen. .is-in (added by JS) = settled.
   var(--rv-d,0ms) lets the markup stagger items inline.
   ------------------------------------------------------------- */
.rv {
	opacity: 0;
	transform: translate3d(0, var(--rv-rise), 0);
	transition:
		opacity var(--rv-dur) var(--rv-ease) var(--rv-d, 0ms),
		transform var(--rv-dur) var(--rv-ease) var(--rv-d, 0ms),
		filter var(--rv-dur) var(--rv-ease) var(--rv-d, 0ms),
		clip-path var(--rv-dur) var(--rv-ease) var(--rv-d, 0ms);
	will-change: opacity, transform;
}

/* --- Variant initial states (modifiers sit alongside .rv) --- */

/* Scale up gently from .92 while rising */
.rv.rv--scale {
	transform: translate3d(0, var(--rv-rise), 0) scale(var(--rv-scale));
}

/* Slide in from the left */
.rv.rv--left {
	transform: translate3d(calc(-1 * var(--rv-shift)), 0, 0);
}

/* Slide in from the right */
.rv.rv--right {
	transform: translate3d(var(--rv-shift), 0, 0);
}

/* Soft-focus reveal: blur + fade, no vertical move */
.rv.rv--blur {
	opacity: 0;
	transform: none;
	filter: blur(var(--rv-blur));
	will-change: opacity, filter;
}

/* Image-style mask reveal: wipe up via clip-path, no fade needed */
.rv.rv--mask {
	opacity: 1;
	transform: none;
	clip-path: inset(100% 0 0 0);
	will-change: clip-path;
}

/* --- Settled state: JS adds .is-in once the element enters view --- */
.rv.is-in {
	opacity: 1;
	transform: translate3d(0, 0, 0) scale(1);
	filter: none;
	clip-path: inset(0 0 0 0);
}

/* Once the motion has played, release the compositor hint so long
   pages don't keep dozens of promoted layers around. */
.rv.is-in {
	will-change: auto;
}

/* No-JS / pre-engine safety: if the script never runs, show content. */
html:not(.has-js) .rv {
	opacity: 1;
	transform: none;
	filter: none;
	clip-path: none;
}

/* -------------------------------------------------------------
   SITE-WIDE REVEAL — apply the same scroll reveal to the rest of
   the site by reusing existing classes (galleries, single artwork,
   news, page content). Gated behind .has-js so no-JS shows all.
   JS adds .is-in as each enters the viewport (honors --rv-d).
   ------------------------------------------------------------- */
.has-js .art-card,
.has-js .section__head,
.has-js .single-art__img,
.has-js .single-art__meta,
.has-js .news-card,
.has-js .entry-content > p,
.has-js .entry-content > h2,
.has-js .entry-content > h3,
.has-js .entry-content > h4,
.has-js .entry-content > ul,
.has-js .entry-content > figure {
	opacity: 0;
	transform: translate3d(0, 28px, 0);
	transition:
		opacity var(--rv-dur) var(--rv-ease) var(--rv-d, 0ms),
		transform var(--rv-dur) var(--rv-ease) var(--rv-d, 0ms);
	will-change: opacity, transform;
}

.art-card.is-in,
.section__head.is-in,
.single-art__img.is-in,
.single-art__meta.is-in,
.news-card.is-in,
.entry-content > .is-in {
	opacity: 1 !important;
	transform: none !important;
	will-change: auto;
}

/* -------------------------------------------------------------
   PARALLAX FRAMES — "images move on scroll"
   .px-frame clips; .px-img is oversized (130%) and drifts inside.
   JS writes translate3d(0,<px>,0) on .px-img. Initial inset keeps
   the image centred so it covers the frame at rest (no gaps).
   ------------------------------------------------------------- */
.fp26 .px-frame,
.px-frame {
	position: relative;
	overflow: hidden;
}

.fp26 .px-frame .px-img,
.px-frame .px-img {
	display: block;
	width: 100%;
	height: 130%;
	object-fit: cover;
	object-position: center;
	position: absolute;
	inset: -15% 0 auto 0; /* overflow 15% top, leaving 15% to drift into */
	will-change: transform;
	backface-visibility: hidden;
}

/* Generic transform-only parallax targets */
[data-parallax] {
	will-change: transform;
}

/* -------------------------------------------------------------
   HERO MEDIA — scales 1 -> ~1.12 + slight rise as the user scrolls.
   Must already cover its box so scaling never reveals edges.
   ------------------------------------------------------------- */
.hero26__media,
.hero26__media[data-parallax-hero] {
	will-change: transform;
	transform-origin: center center;
	backface-visibility: hidden;
}

/* -------------------------------------------------------------
   HERO SCROLL CUE — a thin line that travels down on a loop.
   .hero26__cue is the host; we draw the line as ::after and
   animate its scale + position so it "falls" then resets.
   ------------------------------------------------------------- */
.hero26__cue {
	position: relative;
	display: block;
	width: 1px;
	height: 54px;
	overflow: hidden;
	opacity: .8;
}

.hero26__cue::before {
	/* faint track the line runs down */
	content: "";
	position: absolute;
	inset: 0;
	background: currentColor;
	opacity: .18;
}

.hero26__cue::after {
	/* the travelling segment */
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	height: 40%;
	background: currentColor;
	transform-origin: top center;
	animation: cueTravel 2.4s var(--rv-ease) infinite;
}

@keyframes cueTravel {
	0%   { transform: translateY(-100%) scaleY(1); opacity: 0; }
	18%  { opacity: 1; }
	50%  { transform: translateY(60%) scaleY(1); opacity: 1; }
	82%  { opacity: 1; }
	100% { transform: translateY(250%) scaleY(.6); opacity: 0; }
}

/* -------------------------------------------------------------
   ACCESSIBILITY — full motion opt-out.
   Reveals snap visible; every parallax/scale transform is killed.
   JS also bails early, but these !important rules are the
   authoritative guarantee regardless of script state.
   ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.rv,
	.art-card,
	.section__head,
	.single-art__img,
	.single-art__meta,
	.news-card,
	.entry-content > p,
	.entry-content > h2,
	.entry-content > h3,
	.entry-content > h4,
	.entry-content > ul,
	.entry-content > figure {
		opacity: 1 !important;
		transform: none !important;
		filter: none !important;
		clip-path: none !important;
		transition: none !important;
	}

	.px-img,
	[data-parallax],
	.hero26__media {
		transform: none !important;
	}

	.hero26__cue::after {
		animation: none !important;
		opacity: .5;
	}
}
