/* ==========================================================================
   Animations (enabled from Theme Options → Animations).
   Classes are added by build/app.js; content is hidden only under html.um-anim.
   ========================================================================== */

:root {
	--um-ease: cubic-bezier(.22, .61, .36, 1);
	--um-dur: .9s;
	--um-dist: 34px;
}

/* ---------- Scroll reveal ---------- */
.um-anim .um-reveal {
	opacity: 0;
	transition: opacity var(--um-dur) var(--um-ease), translate var(--um-dur) var(--um-ease), scale var(--um-dur) var(--um-ease), clip-path 1.1s var(--um-ease);
	transition-delay: var(--um-delay, 0ms);
	will-change: opacity, translate;
}
.um-anim .um-up    { translate: 0 var(--um-dist); }
.um-anim .um-left  { translate: calc(var(--um-dist) * -1.4) 0; }
.um-anim .um-right { translate: calc(var(--um-dist) * 1.4) 0; }
.um-anim .um-zoom  { scale: .94; clip-path: inset(8% 8% 8% 8% round 24px); }


.um-anim .um-reveal.um-in {
	opacity: 1;
	translate: none;
	scale: none;
	clip-path: inset(0 0 0 0 round 0);
}
/* Arch / round shapes keep their own radius once revealed */
.um-anim .um-zoom.um-in { clip-path: none; }

/* (translate/scale are used instead of transform, so the design's own rotations stay intact) */
.um-anim .um-reveal.um-in { will-change: auto; }

/* ---------- Hero entrance (on load, pure CSS) ---------- */
.um-anim .hero-text > *,
.um-anim .page-hero .hero-copy > * {
	opacity: 0;
	animation: umHeroIn 1s var(--um-ease) forwards;
	animation-delay: .15s;
}
.um-anim .hero-text > :nth-child(2), .um-anim .page-hero .hero-copy > :nth-child(2) { animation-delay: .27s; }
.um-anim .hero-text > :nth-child(3), .um-anim .page-hero .hero-copy > :nth-child(3) { animation-delay: .39s; }
.um-anim .hero-text > :nth-child(4), .um-anim .page-hero .hero-copy > :nth-child(4) { animation-delay: .51s; }
.um-anim .hero-text > :nth-child(5), .um-anim .page-hero .hero-copy > :nth-child(5) { animation-delay: .63s; }
.um-anim .hero-text > :nth-child(n+6), .um-anim .page-hero .hero-copy > :nth-child(n+6) { animation-delay: .75s; }

.um-anim .hero-visual,
.um-anim .hero-art,
.um-anim .breath-art,
.um-anim .page-hero .cover {
	opacity: 0;
	animation: umHeroVisual 1.3s var(--um-ease) .3s forwards;
}
.um-anim .hero-visual .book-card { opacity: 0; animation: umHeroIn .9s var(--um-ease) 1s forwards; }
.um-anim .site-header {
	opacity: 0;
	animation: umFadeDown .9s var(--um-ease) .05s forwards;
}
@keyframes umHeroIn     { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: none; } }
@keyframes umHeroVisual { from { opacity: 0; scale: .96; translate: 0 20px; } to { opacity: 1; scale: none; translate: none; } }
@keyframes umFadeDown   { from { opacity: 0; translate: 0 -14px; } to { opacity: 1; translate: none; } }

/* ---------- Ambient motion (glows, rings, ripples) ---------- */
.um-ambient .hero .glow,
.um-ambient .page-hero .glow,
.um-ambient .note-glow,
.um-ambient .glow-blob {
	animation: umGlow 9s ease-in-out infinite alternate;
}
.um-ambient .hero .ring,
.um-ambient .page-hero .ring {
	animation: umRing 12s ease-in-out infinite alternate;
}
.um-ambient .hero .ring-2,
.um-ambient .page-hero .ring-2 { animation-duration: 15s; animation-delay: -4s; }

/* Meditations hero: rings "breathe" */
.um-ambient .breath-art .ring { animation: umBreath 8s ease-in-out infinite; }
.um-ambient .breath-art .r2 { animation-delay: .6s; }
.um-ambient .breath-art .r3 { animation-delay: 1.2s; }
.um-ambient .breath-art .r4 { animation-delay: 1.8s; }

/* Book lights drift */
.um-ambient .light { animation: umGlow 11s ease-in-out infinite alternate; }
.um-ambient .light-cyan { animation-delay: -5s; }

/* Area card ripples pulse on hover */
.area .ripple i:nth-child(1) { transition: scale .6s var(--um-ease), opacity .6s; }
.area:hover .ripple i:nth-child(1) { scale: 1.18; opacity: .5; }
.area { transition: translate .35s var(--um-ease), box-shadow .35s var(--um-ease), opacity var(--um-dur) var(--um-ease); }
.um-anim .area.um-in:hover { translate: 0 -6px; transition-delay: 0ms; box-shadow: 0 24px 50px rgba(0, 43, 71, .10); }

/* Gentle lift on cards */

.um-anim .topic-card.um-in:hover,
.um-anim .tile.um-in:hover { translate: 0 -5px; transition-delay: 0ms; }

/* Images zoom slightly on hover */
.hero-portrait img, .arch-photo img, .portrait-group .photo img, .hero-arch img { transition: transform 1.2s var(--um-ease); }
.hero-portrait:hover img, .arch-photo:hover img, .portrait-group .photo:hover img, .hero-arch:hover img { transform: scale(1.04); }

@keyframes umGlow   { from { opacity: .75; scale: 1; } to { opacity: 1; scale: 1.08; } }
@keyframes umRing   { from { scale: 1; } to { scale: 1.04; } }
@keyframes umBreath {
	0%, 100% { scale: 1; opacity: 1; }
	50%      { scale: 1.05; opacity: .55; }
}

/* ---------- Respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
	.um-anim .um-reveal, .um-anim .site-header, .um-anim .hero-text > *, .um-anim .hero-copy > *, .um-anim .hero-visual, .um-anim .hero-visual .book-card, .um-anim .hero-art, .um-anim .breath-art, .um-anim .page-hero .cover {
		opacity: 1 !important; translate: none !important; scale: none !important; clip-path: none !important; animation: none !important; transition: none !important;
	}
	.um-ambient * { animation: none !important; }
}
@media print {
	.um-anim .um-reveal { opacity: 1 !important; translate: none !important; scale: none !important; clip-path: none !important; }
}
