/*
 * si-motion.css (master prompt Task 9). Restrained, on-brand motion.
 * Everything is scoped under .si-motion, which si-motion.js adds only when
 * the visitor has not asked for reduced motion; without it (no JS, reduced
 * motion) the site is fully visible and static. Only transform, opacity,
 * background-size and stroke-dashoffset animate. Colours: Task 4 tokens.
 * See MOTION.md.
 */
:root {
	--si-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--si-hover: 200ms;
	--si-reveal: 600ms;
	--si-shift: 20px;
}

/* ---------- Scroll reveals (below the fold at load only) ---------- */
.si-motion [data-motion-state="pending"] {
	opacity: 0;
	transform: translateY(var(--si-shift));
	transition: opacity var(--si-reveal) var(--si-ease) var(--si-delay, 0ms), transform var(--si-reveal) var(--si-ease) var(--si-delay, 0ms);
}
.si-motion [data-motion-state="pending"].is-in { opacity: 1; transform: none; }

/* ---------- Hero entrance: transform only, starts at once (never hides the LCP) ---------- */
@keyframes si-rise { from { transform: translateY(16px); } to { transform: none; } }
.si-motion .si-hero-split .hero-split__text > *,
.si-motion .si-hero-split .hero-split__media,
.si-motion .si-hero-split .hero-split__aside { animation: si-rise 520ms var(--si-ease) both; }
.si-motion .si-hero-split .hero-split__text > :nth-child(2) { animation-delay: 60ms; }
.si-motion .si-hero-split .hero-split__text > :nth-child(3) { animation-delay: 120ms; }
.si-motion .si-hero-split .hero-split__text > :nth-child(n+4) { animation-delay: 180ms; }
.si-motion .si-hero-split .hero-split__media,
.si-motion .si-hero-split .hero-split__aside { animation-delay: 140ms; }

/* ---------- Heading emphasis: the pink underline draws left to right ---------- */
.si-motion .si-draw em {
	text-decoration: none;
	background-image: linear-gradient(var(--brand), var(--brand));
	background-repeat: no-repeat;
	background-position: 0 calc(100% - 0.04em);
	background-size: 0% var(--emph-thickness);
	transition: background-size 700ms var(--si-ease) 120ms;
}
.si-motion .si-draw.is-drawn em { background-size: 100% var(--emph-thickness); }
.si-motion .section--dark .si-draw em,
.si-motion .section--dark-soft .si-draw em { background-image: linear-gradient(var(--brand-light), var(--brand-light)); }

/* ---------- Count-up: the counting twin is sized to the final value ----------
   The twin is a <span> inside the number, so it must not pick up the label
   rules some components set on their spans (e.g. .stat-band__item span,
   .case-study-card__metric span): it copies the number's own type exactly. */
[data-si-final] > .si-count {
	display: inline-block;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	text-transform: inherit;
}
[data-si-final] > .sr-only { position: absolute; margin: -1px; display: block; }

/* ---------- Cards: lift, soft shadow, pink edge, arrow slides (hover devices) ---------- */
@media (hover: hover) and (pointer: fine) {
	.si-motion .service-card, .si-motion .sector-card, .si-motion .case-study-card, .si-motion a.info-card,
	.si-motion a.l3-related__card, .si-motion .product-card, .si-motion .insight-card, .si-motion .si-badges__item {
		transition: transform var(--si-hover) ease-out, box-shadow var(--si-hover) ease-out, border-color var(--si-hover) ease-out;
	}
	.si-motion .service-card:hover, .si-motion .sector-card:hover, .si-motion .case-study-card:hover, .si-motion a.info-card:hover,
	.si-motion a.l3-related__card:hover, .si-motion .product-card:hover, .si-motion .insight-card:hover {
		transform: translateY(-5px);
		box-shadow: 0 14px 34px rgba(14, 14, 16, 0.1);
		border-color: var(--brand-pink);
	}
	.si-motion .si-badges__item:hover { transform: translateY(-3px); }
	.si-motion .feature-card:hover .feature-card__icon { transform: rotate(-6deg) scale(1.06); }
	.si-motion .feature-card__icon { transition: transform var(--si-hover) ease-out; }
}
.si-motion a.info-card h3::after,
.si-motion a.l3-related__card .l3-related__card-title::after,
.si-motion .case-study-card h3 a::after,
.si-motion .insight-card h3 a::after {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-left: 0.35em;
	vertical-align: -0.08em;
	background-color: var(--brand-pink);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
	transition: transform var(--si-hover) ease-out;
}
.si-motion a.info-card:hover h3::after, .si-motion a.info-card:focus-visible h3::after,
.si-motion a.l3-related__card:hover .l3-related__card-title::after, .si-motion a.l3-related__card:focus-visible .l3-related__card-title::after,
.si-motion .case-study-card:hover h3 a::after, .si-motion .case-study-card h3 a:focus-visible::after,
.si-motion .insight-card:hover h3 a::after, .si-motion .insight-card h3 a:focus-visible::after { transform: translateX(4px); }
@media (hover: none) {
	.si-motion a.info-card:active, .si-motion a.l3-related__card:active, .si-motion .case-study-card:active, .si-motion .insight-card:active { transform: scale(0.99); transition: transform 120ms ease-out; }
}

/* ---------- Buttons: left-to-right fill sweep, press, gentle magnetic pull ---------- */
@media (hover: hover) and (pointer: fine) {
	.si-motion .btn--primary {
		--si-sweep: var(--brand-hover);
		background-image: linear-gradient(var(--si-sweep), var(--si-sweep));
		background-repeat: no-repeat;
		background-size: 0% 100%;
		transform: translate(var(--si-mx, 0), var(--si-my, 0));
		transition: background-size 240ms ease-out, border-color 240ms ease-out, transform 160ms ease-out, color 150ms ease-out;
	}
	.si-motion .section--dark .btn--primary, .si-motion .section--dark-soft .btn--primary,
	.si-motion .mobile-nav .btn--primary, .si-motion .mega-menu__featured .btn--primary { --si-sweep: var(--brand-pink); }
	.si-motion .btn--primary:hover {
		background-color: var(--brand);
		background-image: linear-gradient(var(--si-sweep), var(--si-sweep));
		background-size: 100% 100%;
		border-color: var(--si-sweep);
	}
	.si-motion .btn--primary:active { transform: translate(var(--si-mx, 0), calc(var(--si-my, 0px) + 1px)); }
	.si-motion .btn .arrow, .si-motion .btn svg, .si-motion .sa-link svg { transition: transform var(--si-hover) ease-out; }
	.si-motion .btn:hover .arrow, .si-motion .btn:hover svg, .si-motion .sa-link:hover svg { transform: translateX(3px); }
}

/* ---------- Links: animated pink underline ---------- */
.si-motion .rich-text a { transition: text-decoration-color var(--si-hover) ease-out, text-decoration-thickness var(--si-hover) ease-out, color var(--si-hover) ease-out; }
.si-motion .rich-text a:hover, .si-motion .rich-text a:focus-visible { text-decoration-thickness: 2px; text-decoration-color: var(--brand-pink); }
.si-motion .footer-col a {
	background-image: linear-gradient(var(--brand-light), var(--brand-light));
	background-repeat: no-repeat;
	background-position: 0 calc(100% - 0.15em);
	background-size: 0% 1px;
	transition: background-size var(--si-hover) ease-out, color var(--si-hover) ease-out;
}
.si-motion .footer-col a:hover, .si-motion .footer-col a:focus-visible { background-size: 100% 1px; }

/* ---------- Navigation ---------- */
.si-motion .primary-nav__list > li > a { transition: border-color 160ms ease-out, color 160ms ease-out; }
.si-motion .nav-toggle line { transform-box: fill-box; transform-origin: center; transition: transform 220ms var(--si-ease), opacity 160ms ease-out; }
.si-motion .nav-toggle[aria-expanded="true"] .nav-toggle__l1 { transform: translateY(6px) rotate(45deg); }
.si-motion .nav-toggle[aria-expanded="true"] .nav-toggle__l2 { opacity: 0; }
.si-motion .nav-toggle[aria-expanded="true"] .nav-toggle__l3 { transform: translateY(-6px) rotate(-45deg); }
.si-motion .accordion-item__icon { display: inline-block; transition: transform var(--si-hover) ease-out; }
.si-motion .accordion-item__trigger[aria-expanded="true"] .accordion-item__icon { transform: rotate(45deg); }
.si-motion .l3-faq__card .accordion-item__trigger[aria-expanded="true"] .accordion-item__icon { transform: none; }

/* ---------- Forms: animated focus, gentle message entrance ---------- */
.si-motion .form-field input, .si-motion .form-field select, .si-motion .form-field textarea { transition: border-color 160ms ease-out, box-shadow 220ms ease-out; }
@keyframes si-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.si-motion .form-field__error, .si-motion .form-notice, .si-motion [role="alert"] { animation: si-fade-up 300ms var(--si-ease) both; }

/* ---------- Blog posts: reading progress ---------- */
.si-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 90; height: 3px; background: var(--brand-pink); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

/* ---------- Homepage motif: marketing, website and CRM working together ---------- */
.si-motif { display: block; width: 168px; height: auto; margin-bottom: var(--space-5); color: var(--text-main); }
.si-motif__link { stroke: var(--brand-pink); }
.si-motif__node { fill: var(--bg); stroke: currentColor; }
.si-motif__core { fill: var(--brand-pink); }
@keyframes si-draw-line { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }
@keyframes si-ping { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.55; } }
.si-motion .si-motif__link { stroke-dasharray: 60; animation: si-draw-line 900ms var(--si-ease) 300ms both; }
.si-motion .si-motif__core { transform-box: fill-box; transform-origin: center; animation: si-ping 2.8s ease-in-out 1.2s infinite; }
.si-motion .si-motif__core:nth-of-type(2) { animation-delay: 1.6s; }
.si-motion .si-motif__core:nth-of-type(3) { animation-delay: 2s; }
