/* =========================================================
   ToolMystery motion layer. Everything here is decoration:
   content is fully visible without it, and all of it is off
   for visitors who ask their device to reduce motion.
   Only opacity and transform are animated, so nothing shifts.
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {

	/* 10. Smooth fades between pages (browsers without support just load normally) */
	@view-transition { navigation: auto; }
	::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

	/* 6. Cards lift on hover */
	:is(.tp-podium__card, .tp-catcard, .tp-toolcard, .tp-vscard, .tp-stackcard, .tp-post, .tp-revcard, .tp-tile, .tp-deptbox, .tp-vsrow, .tp-pick, .tp-ranked__item, .tp-bestmatch, .tm-stack, .tm-vs, .tm-tod) {
		transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease, border-color .22s ease;
	}
	:is(.tp-podium__card, .tp-catcard, .tp-toolcard, .tp-vscard, .tp-stackcard, .tp-post, .tp-revcard, .tp-tile, .tp-deptbox, .tp-vsrow, .tp-pick, .tp-ranked__item, .tm-stack, .tm-vs):hover {
		transform: translateY(-3px);
		box-shadow: 0 14px 30px rgba(3, 105, 161, .13);
	}
	:is(.tp-catcard, .tp-toolcard, .tp-ranked__item, .tp-post, .tm-stack):hover .tm-logo { transform: scale(1.06); }
	.tm-logo { transition: transform .22s ease; }

	/* 8. FAQ answers slide open (Chrome and Edge today; others open instantly) */
	:root { interpolate-size: allow-keywords; }
	main details::details-content { block-size: 0; overflow: clip; transition: block-size .28s ease, content-visibility .28s allow-discrete; }
	main details[open]::details-content { block-size: auto; }

	/* 7. Sections below the first screen fade up once */
	.tm-motion .tm-rv { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1); }
	.tm-motion .tm-rv.is-in { opacity: 1; transform: none; }

	/* 1. Score bars grow from zero */
	.tm-motion .tm-grow :is(.tp-bar__fill, .tmt-bars__track span) { transform: scaleX(0); transform-origin: left center; transition: transform .9s cubic-bezier(.2, .7, .3, 1); }
	.tm-motion .tm-grow.is-in :is(.tp-bar__fill, .tmt-bars__track span) { transform: none; }
	.tm-motion .tm-grow.is-in .tmt-bars > div:nth-child(2) span,
	.tm-motion .tm-grow.is-in .tp-bars__row:nth-child(3) .tp-bar__fill { transition-delay: .08s; }
	.tm-motion .tm-grow.is-in .tmt-bars > div:nth-child(3) span,
	.tm-motion .tm-grow.is-in .tp-bars__row:nth-child(4) .tp-bar__fill { transition-delay: .16s; }
	.tm-motion .tm-grow.is-in .tmt-bars > div:nth-child(4) span,
	.tm-motion .tm-grow.is-in .tp-bars__row:nth-child(5) .tp-bar__fill { transition-delay: .24s; }
	.tm-motion .tm-grow.is-in .tmt-bars > div:nth-child(5) span,
	.tm-motion .tm-grow.is-in .tp-bars__row:nth-child(6) .tp-bar__fill { transition-delay: .32s; }

	/* 2. Price Index line draws itself, then the dots appear */
	.tm-motion .tm-draw .tp-chart__area, .tm-motion .tm-draw .tp-chart__dot { opacity: 0; transition: opacity .5s ease 1.1s; }
	.tm-motion .tm-draw.is-in .tp-chart__area, .tm-motion .tm-draw.is-in .tp-chart__dot { opacity: 1; }
	.tm-motion .tm-draw .tp-chart__line { transition: stroke-dashoffset 1.4s cubic-bezier(.4, 0, .2, 1); }

	/* 3. Stack timeline fills step by step */
	.tm-motion .tp-steps li.tm-step::before { transform: scaleY(0); transform-origin: top; transition: transform .7s ease .15s; background: #0EA5E9; }
	.tm-motion .tp-steps li.tm-step.is-in::before { transform: none; }
	.tm-motion .tp-steps li.tm-step .tp-steps__n { transform: scale(.6); opacity: .3; transition: transform .45s cubic-bezier(.3, 1.5, .5, 1), opacity .3s ease; }
	.tm-motion .tp-steps li.tm-step.is-in .tp-steps__n { transform: none; opacity: 1; }

	/* 5. Filtered tools fade out instead of vanishing */
	.tp-ranked__item, .tp-vscard { transition: opacity .18s ease, transform .18s ease; }
	.tp-ranked__item.is-out, .tp-vscard.is-out { opacity: 0; transform: scale(.98); }

	/* 9. Verified tick draws itself */
	.tm-tick path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: tm-tick .5s ease .3s forwards; }
	@keyframes tm-tick { to { stroke-dashoffset: 0; } }
}

/* Tick icon (static when motion is reduced) */
.tm-tick { display: inline-block; width: 15px; height: 15px; margin-right: 5px; vertical-align: -2px; flex: none; }
.tm-tick circle { fill: #DCFCE7; }
.tm-tick path { fill: none; stroke: #15803D; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Counting numbers keep their width */
.tm-count { font-variant-numeric: tabular-nums; }

@media print { .tm-motion .tm-rv { opacity: 1 !important; transform: none !important; } }
