/* ==========================================================================
   Galleria De Rings: site-wide motion
   - Scroll reveals (assets/js/motion.js tags elements with data-reveal)
   - Button sheen and press feedback

   Rules of the house:
   - Only opacity, translate, scale, filter and clip-path move. Photos are
     never zoomed (no scale on images, on hover or on entry).
   - Reveal styles stop applying once an element is "settled", so each
     component's own hover transitions are untouched afterwards.
   - Nothing is hidden unless JS is running (html.g-motion, set in <head>),
     and nothing moves for prefers-reduced-motion.
   ========================================================================== */

:root {
	--g-ease-out: cubic-bezier(.16, 1, .3, 1);      /* expo-out: arrives softly */
	--g-ease-curtain: cubic-bezier(.77, 0, .18, 1); /* slow-fast-slow for image curtains */
	--g-reveal-dur: .95s;
	--g-reveal-dist: 28px;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

/* --------------------------------------------------------------------------
   1. Before motion.js runs: keep reveal targets invisible so they don't
      flash and then disappear. Keep in step with TARGETS in motion.js (at least
      everything that can sit above the fold).
   -------------------------------------------------------------------------- */
.g-motion:not(.g-motion-ready) :is(
	.trust-strip,
	.shop-cats__title, .shop-cats__card,
	.masterpiece-ref-card, .masterpiece-spinning-badge, .masterpiece-eyebrow-text,
	.masterpiece-heading, .masterpiece-lead-text, .masterpiece-point, .masterpiece-cta, .masterpiece-chat,
	.diamond-shapes__title, .diamond-shapes__card, .diamond-shapes__item,
	.arrivals__mobile-title, .arrivals__eyebrow, .arrivals__title, .arrivals__text,
	.arrivals__actions, .arrivals__item,
	.cat-spotlight__media, .cat-spotlight__title, .cat-spotlight__desc, .cat-spotlight__btn,
	.trends__title, .trends__card,
	.lab-edu__head > *, .lab-edu__card,
	.about-band__media, .about-band__text > *,
	.why-lab__title, .why-lab__item,
	.lvn__text > *, .lvn__side, .lvn__vs,
	.tm__heading > *, .tm__card,
	.faq__intro > *, .faq__item,
	.sol-banner__media, .sol-banner__content > *,
	.budget-gifting__title, .budget-gifting__card,
	.section-divider__line
) {
	opacity: 0;
}

/* --------------------------------------------------------------------------
   2. Reveal states. Hidden until .is-revealed; transitions only until
      .is-settled (then the component's own CSS takes over again).
   -------------------------------------------------------------------------- */
.g-motion [data-reveal]:not(.is-settled) {
	transition:
		opacity var(--g-reveal-dur) var(--g-ease-out),
		translate var(--g-reveal-dur) var(--g-ease-out),
		scale var(--g-reveal-dur) var(--g-ease-out),
		filter var(--g-reveal-dur) var(--g-ease-out),
		clip-path 1.35s var(--g-ease-curtain);
	transition-delay: var(--reveal-delay, 0s);
}

/* up: soft fade and rise (cards, text, buttons) */
.g-motion [data-reveal="up"]:not(.is-revealed) {
	opacity: 0;
	translate: 0 var(--g-reveal-dist);
}

/* fade: opacity only (full-width strips) */
.g-motion [data-reveal="fade"]:not(.is-revealed) {
	opacity: 0;
}

/* rise: headings come into focus while rising */
.g-motion [data-reveal="rise"]:not(.is-settled) {
	transition-duration: 1.15s;
}

.g-motion [data-reveal="rise"]:not(.is-revealed) {
	opacity: 0;
	translate: 0 .45em;
	filter: blur(8px);
}

/* curtain: image uncovered from the bottom up (no zoom) */
.g-motion [data-reveal="curtain"]:not(.is-revealed) {
	clip-path: inset(100% 0 0 0 round var(--reveal-radius, 0px));
}

.g-motion [data-reveal="curtain"].is-revealed:not(.is-settled) {
	clip-path: inset(0 0 0 0 round var(--reveal-radius, 0px));
}

.masterpiece-ref-card {
	--reveal-radius: 16px;
}

/* pop: small badges settle in from slightly smaller */
.g-motion [data-reveal="pop"]:not(.is-settled) {
	transition-duration: 1.1s;
}

.g-motion [data-reveal="pop"]:not(.is-revealed) {
	opacity: 0;
	scale: .7;
}

/* left / right: a block slides in from its own side (Lab-Grown vs Natural) */
.g-motion [data-reveal="left"]:not(.is-revealed) {
	opacity: 0;
	translate: calc(var(--g-reveal-dist) * -2) 0;
}

.g-motion [data-reveal="right"]:not(.is-revealed) {
	opacity: 0;
	translate: calc(var(--g-reveal-dist) * 2) 0;
}

/* line: hairline dividers draw outward from the centre */
.g-motion [data-reveal="line"]:not(.is-settled) {
	transform-origin: center;
	transition-duration: 1.4s;
}

.g-motion [data-reveal="line"]:not(.is-revealed) {
	opacity: 0;
	scale: 0 1;
}

/* --------------------------------------------------------------------------
   3. Buttons: a light sheen passes across on hover, and a press dips them.
   -------------------------------------------------------------------------- */
:is(.hero__btn, .sol-banner__btn, .arrivals__all, .arrivals__mobile-all, .masterpiece-cta, .g-card-grid__all) {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

:is(.hero__btn, .sol-banner__btn, .arrivals__all, .arrivals__mobile-all, .masterpiece-cta, .g-card-grid__all)::after {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	z-index: -1;
	width: 60%;
	background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, .28) 50%, transparent 100%);
	translate: -160% 0;
	pointer-events: none;
}

/* Light buttons get a navy-tinted sheen so it still shows. */
.sol-banner__btn::after {
	background: linear-gradient(105deg, transparent 0%, rgba(11, 19, 42, .12) 50%, transparent 100%);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	:is(.hero__btn, .sol-banner__btn, .arrivals__all, .arrivals__mobile-all, .masterpiece-cta, .g-card-grid__all):hover::after {
		translate: 260% 0;
		transition: translate .9s var(--g-ease-out);
	}
}

/* Press: an instant dip gives feedback within a frame; release restores it. */
@media (prefers-reduced-motion: no-preference) {
	:is(.hero__btn, .sol-banner__btn, .arrivals__all, .arrivals__mobile-all, .masterpiece-cta, .g-card-grid__all, .hero__arrow, .arrivals__arrow):active {
		scale: .97;
	}
}

/* --------------------------------------------------------------------------
   4. Reduced motion: everything is simply there.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.g-motion [data-reveal] {
		opacity: 1 !important;
		translate: none !important;
		scale: none !important;
		filter: none !important;
		clip-path: none !important;
		transition: none !important;
	}
}
