/* ==========================================================================
   Sivad Custom Fab — motion layer (theme 1.0.7)
   Everything here sits behind html.sf-motion, which is only added for visitors
   whose device doesn't ask for less motion. No JavaScript, or motion turned
   down: the static 1.0.6 site.
   ========================================================================== */

/* ---- Hero entrance (CSS only, so the headline never waits on a script) ---- */
@keyframes sf-rise { from { opacity: 0; transform: translate3d(0, 28px, 0); } to { opacity: 1; transform: none; } }
@keyframes sf-sheen { from { background-position: 120% 0; } to { background-position: -20% 0; } }
.sf-motion .sf-hero .sf-hero__grid > .wp-block-column:first-child > *,
.sf-motion .sf-pagehead > .alignwide > * {
	animation: sf-rise .95s cubic-bezier(.2, .7, .2, 1) both;
}
.sf-motion .sf-hero .sf-hero__grid > .wp-block-column:first-child > :nth-child(2),
.sf-motion .sf-pagehead > .alignwide > :nth-child(2) { animation-delay: .14s; }
.sf-motion .sf-hero .sf-hero__grid > .wp-block-column:first-child > :nth-child(3),
.sf-motion .sf-pagehead > .alignwide > :nth-child(3) { animation-delay: .26s; }
.sf-motion .sf-hero .sf-hero__grid > .wp-block-column:first-child > :nth-child(n+4),
.sf-motion .sf-pagehead > .alignwide > :nth-child(n+4) { animation-delay: .38s; }
.sf-motion .sf-hero .sf-hero__grid > .wp-block-column:last-child { animation: sf-rise 1.1s cubic-bezier(.2, .7, .2, 1) .1s both; }
/* A plasma-bright sweep across the home headline, once. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
	.sf-motion .sf-hero--home .sf-hero__grid > .wp-block-column:first-child > h1 {
		background-image: linear-gradient(100deg, #fff 0 40%, #f3e9ff 46%, var(--sf-arc) 50%, #ffd9a8 53%, #fff 60% 100%);
		background-size: 260% 100%;
		background-position: -20% 0;
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
		animation: sf-rise .95s cubic-bezier(.2, .7, .2, 1) both, sf-sheen 2.4s cubic-bezier(.45, 0, .2, 1) 3.1s both;
	}
}

/* ---- Home hero drawing, when the script drives the cut ---- */
.sivad-drawing--kerf.sf-js .d-kerf { animation: none; }
.sivad-drawing--kerf.sf-js .d-torch { animation: none; opacity: 1; }
.sivad-drawing--kerf.sf-js .d-kerf-fill { animation: none; opacity: 0; transition: opacity 1s ease; }
.sivad-drawing--kerf.sf-cut-done .d-kerf-fill { opacity: 1; }
.sivad-drawing--kerf.sf-js .d-spark--glow { animation: sf-glow 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sf-glow { 0%, 100% { opacity: .35; transform: scale(1); } 50% { opacity: .7; transform: scale(1.35); } }
.sf-hero { isolation: isolate; }

/* ---- Spark canvas ---- */
/* Layout groups give their children a max width and auto margins; the canvas must keep its own size. */
.sf-sparks { position: absolute; pointer-events: none; z-index: 3; max-width: none !important; margin: 0 !important; }
.sf-hero > .sf-sparks { z-index: 2; }

/* ---- Drawings cut as they scroll in ---- */
.sf-motion:not(.sf-motion-ready):not(.sf-motion-off) svg.sivad-drawing:not(.sivad-drawing--kerf) { opacity: 0; }
.sf-motion .sivad-drawing.sf-anim * { transition: opacity .55s ease; }
.sf-motion:not(.sf-motion-off) .sivad-drawing .sf-sec { opacity: 0; }
.sivad-drawing .sf-torch { pointer-events: none; transition: opacity .25s ease; }
.sivad-drawing .sf-torch__glow { fill: var(--sf-brand); opacity: .22; filter: blur(4px); }
.sivad-drawing .sf-torch__core { fill: #fff; stroke: var(--sf-brand); stroke-width: 2; vector-effect: non-scaling-stroke; }
.sivad-drawing .sf-torch.is-dark .sf-torch__glow { fill: var(--sf-arc); opacity: .5; }
.sivad-drawing .sf-torch.is-dark .sf-torch__core { stroke: var(--sf-arc); }
/* Once drawn: the Parker marker pings, plasma arcs flicker, spark dots breathe. */
@keyframes sf-ping { 0% { transform: scale(.55); opacity: .95; } 75% { transform: scale(2.6); opacity: 0; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes sf-flicker { 0%, 100% { opacity: 1; } 18% { opacity: .55; } 22% { opacity: .95; } 47% { opacity: .7; } 52% { opacity: 1; } 78% { opacity: .6; } }
@keyframes sf-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }
.sf-motion .sivad-drawing.sf-done .d-ring { transform-box: fill-box; transform-origin: center; animation: sf-ping 2.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.sf-motion .sivad-drawing.sf-done .d-arc { animation: sf-flicker 1.3s linear infinite; }
.sf-motion .sivad-drawing.sf-done .d-spark:not(.d-spark--glow) { transform-box: fill-box; transform-origin: center; animation: sf-breathe 1.8s ease-in-out infinite; }

/* ---- Scroll reveals ---- */
.sf-motion .sf-rv {
	opacity: 0;
	transform: translate3d(0, 30px, 0);
	transition: opacity .85s cubic-bezier(.2, .7, .2, 1), transform .85s cubic-bezier(.2, .7, .2, 1);
	transition-delay: var(--sf-d, 0ms);
}
.sf-motion .sf-rv.is-in { opacity: 1; transform: none; }
@media (min-width: 782px) {
	.sf-motion .sf-lines > .wp-block-column.sf-rv:first-child { transform: translate3d(-48px, 0, 0); }
	.sf-motion .sf-lines > .wp-block-column.sf-rv:last-child { transform: translate3d(48px, 0, 0); }
	.sf-motion .sf-lines > .wp-block-column.sf-rv.is-in { transform: none; }
}

/* Section headings: the heading rises and its cut rule is cut left to right, torch glow riding the end. */
.sf-motion .sf-cut-rule.sf-rv::after { transform: scaleX(0); transform-origin: left center; transition: transform 1s cubic-bezier(.6, 0, .2, 1) calc(var(--sf-d, 0ms) + .25s); }
.sf-motion .sf-cut-rule.sf-rv.is-in::after { transform: scaleX(1); }
.sf-motion .has-text-align-center.sf-cut-rule.sf-rv::after { transform: translateX(-50%) scaleX(0); transform-origin: center; }
.sf-motion .has-text-align-center.sf-cut-rule.sf-rv.is-in::after { transform: translateX(-50%) scaleX(1); }
.sf-motion .sf-cut-rule.sf-rv::before {
	content: ""; position: absolute; left: 0; bottom: -3px; width: 8px; height: 8px; border-radius: 50%;
	background: #fff; box-shadow: 0 0 0 2px var(--sf-brand), 0 0 14px 4px color-mix(in srgb, var(--sf-brand) 55%, transparent);
	opacity: 0; pointer-events: none;
}
.sf-motion .sf-cut-rule.sf-rv.is-in::before { animation: sf-rule-torch 1s cubic-bezier(.6, 0, .2, 1) calc(var(--sf-d, 0ms) + .25s) both; }
.sf-motion :is(.is-style-plate, .is-style-deep) .sf-cut-rule.sf-rv::before { box-shadow: 0 0 0 2px var(--sf-arc), 0 0 14px 4px rgba(201, 188, 230, .6); }
.sf-motion .has-text-align-center.sf-cut-rule.sf-rv::before { display: none; }
@keyframes sf-rule-torch { 0% { opacity: 1; transform: translateX(-4px); } 92% { opacity: 1; transform: translateX(calc(7rem - 4px)); } 100% { opacity: 0; transform: translateX(calc(7rem - 4px)); } }

/* How a job runs: the dashed line is cut across, and each step lights up in turn. */
.sf-motion .sf-steps.sf-rv { opacity: 1; transform: none; }
.sf-motion .sf-steps.sf-rv::before { clip-path: inset(0 100% 0 0); transition: clip-path 1.9s cubic-bezier(.45, 0, .25, 1) .25s; }
.sf-motion .sf-steps.sf-rv.is-in::before { clip-path: inset(0 0 0 0); }
.sf-motion .sf-steps.sf-rv > * { opacity: 0; transform: translate3d(0, 22px, 0); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
.sf-motion .sf-steps.sf-rv.is-in > * { opacity: 1; transform: none; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(1) { transition-delay: .1s; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(2) { transition-delay: .6s; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(3) { transition-delay: 1.1s; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(4) { transition-delay: 1.6s; }
.sf-motion .sf-steps.sf-rv.is-in .sf-step-no { animation: sf-light 1.1s ease both; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(1) .sf-step-no { animation-delay: .35s; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(2) .sf-step-no { animation-delay: .85s; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(3) .sf-step-no { animation-delay: 1.35s; }
.sf-motion .sf-steps.sf-rv.is-in > :nth-child(4) .sf-step-no { animation-delay: 1.85s; }
@keyframes sf-light {
	0% { background: var(--sf-paper); color: var(--d-dim, var(--sf-brand)); box-shadow: 0 0 0 0 color-mix(in srgb, var(--d-dim, var(--sf-brand)) 0%, transparent); }
	35% { background: var(--d-dim, var(--sf-brand)); color: #fff; box-shadow: 0 0 0 12px color-mix(in srgb, var(--d-dim, var(--sf-brand)) 18%, transparent), 0 0 32px 6px color-mix(in srgb, var(--d-dim, var(--sf-brand)) 45%, transparent); }
	100% { background: var(--d-dim, var(--sf-brand)); color: #fff; box-shadow: 0 0 0 0 color-mix(in srgb, var(--d-dim, var(--sf-brand)) 0%, transparent), 0 6px 18px -8px color-mix(in srgb, var(--d-dim, var(--sf-brand)) 70%, transparent); }
}
.sf-motion .is-style-plate .sf-steps.sf-rv.is-in .sf-step-no { --d-dim: var(--sf-arc); }

/* Photos: revealed by a cut line sweeping across, then settle. */
.sf-motion .sivad-figure.is-photo { overflow: hidden; border-radius: var(--sf-radius); }
.sf-motion .sivad-figure.is-photo.sf-rv { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); transition: clip-path 1.15s cubic-bezier(.65, 0, .25, 1) var(--sf-d, 0ms); }
.sf-motion .sivad-figure.is-photo.sf-rv.is-in { clip-path: inset(0 0 0 0); }
.sf-motion .sivad-figure.is-photo.sf-rv > img { transform: scale(1.14); transition: transform 2s cubic-bezier(.2, .7, .2, 1) var(--sf-d, 0ms); }
.sf-motion .sivad-figure.is-photo.sf-rv.is-in > img { transform: scale(1); }
.sf-motion .sivad-figure.is-photo.sf-rv::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; z-index: 2; pointer-events: none;
	background: #fff; box-shadow: 0 0 10px 3px var(--sf-arc), 0 0 28px 8px rgba(255, 150, 60, .55);
	opacity: 0;
}
.sf-motion .sivad-figure.is-photo.sf-rv.is-in::after { animation: sf-sweep 1.15s cubic-bezier(.65, 0, .25, 1) var(--sf-d, 0ms) both; }
@keyframes sf-sweep { 0% { left: 0; opacity: 1; } 90% { left: calc(100% - 3px); opacity: 1; } 100% { left: calc(100% - 3px); opacity: 0; } }
.sf-motion .sivad-figure.is-photo.is-cut::after { display: none; }

/* ---- Hover: cards lift, pictures lean in, buttons catch the light ---- */
@media (hover: hover) and (pointer: fine) {
	.sf-motion :is(.sf-lines > .wp-block-column, .sivad-portfolio__link, .sf-cards > *, .sf-shop-cats > *, .sf-specs > *, .wc-block-product-template > li, .wp-block-woocommerce-product-template > li):not(.sf-rv) {
		transition: transform .45s cubic-bezier(.2, .7, .2, 1), box-shadow .45s ease, border-color .3s ease;
	}
	.sf-motion :is(.sf-lines > .wp-block-column, .sivad-portfolio__link, .sf-cards > *, .sf-shop-cats > *, .sf-specs > *, .wc-block-product-template > li, .wp-block-woocommerce-product-template > li):not(.sf-rv):hover {
		transform: translate3d(0, -6px, 0);
		box-shadow: 0 22px 40px -24px rgba(29, 28, 33, .55);
	}
	.sf-motion :is(.sivad-figure, .sivad-portfolio__media) { overflow: hidden; }
	.sf-motion :is(.sivad-figure, .sivad-portfolio__media) > :is(img, svg) { transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
	.sf-motion :is(.sf-lines > .wp-block-column, .sivad-portfolio__link, .sf-build > *, .sf-shop-cats > *, .sf-specs > *):hover :is(.sivad-figure, .sivad-portfolio__media) > :is(img, svg) { transform: scale(1.05); }
	.sf-motion .sivad-figure.is-photo.is-cut:hover > img { transform: scale(1.04); }

	.sf-motion .wp-block-button__link { position: relative; overflow: hidden; isolation: isolate; transition: transform .25s ease, box-shadow .25s ease, background-color .2s ease, color .2s ease; }
	.sf-motion .wp-block-button__link::after {
		content: ""; position: absolute; inset: -2px; z-index: -1; pointer-events: none;
		background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .38) 50%, transparent 65%);
		transform: translateX(-120%);
	}
	.sf-motion .wp-block-button__link:hover { transform: translate3d(0, -2px, 0); box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--sf-brand) 80%, transparent); }
	.sf-motion .wp-block-button__link:hover::after { transform: translateX(120%); transition: transform .75s ease; }
	.sf-motion .sf-more a { transition: letter-spacing .3s ease, color .2s ease; }
	.sf-motion .sf-more a:hover { letter-spacing: .015em; }
}

/* ---- Header: shadow once scrolled, and a cut line that tracks the page ---- */
.sf-motion .site-header { position: relative; transition: box-shadow .3s ease; }
.sf-motion .site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(29, 28, 33, .55); }
.sf-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; max-width: none !important; margin: 0 !important; z-index: 2; }
.sf-progress__line { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0); background: linear-gradient(90deg, var(--sf-brand), #7a5bc4 70%, var(--sf-arc)); }
.sf-progress__tip { position: absolute; top: -3px; left: -4px; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--sf-arc), 0 0 12px 4px rgba(201, 188, 230, .9), 0 0 22px 6px rgba(255, 150, 60, .45); opacity: 0; transition: opacity .3s ease; }

/* ---- Photo strip (Group with the class sf-marquee) ---- */
.sf-marquee { overflow: hidden; }
.sf-marquee__items { display: flex; gap: clamp(.75rem, 1.6vw, 1.25rem); overflow-x: auto; scroll-snap-type: x mandatory; }
.sf-marquee figure { flex: 0 0 auto; margin: 0 !important; height: clamp(190px, 26vw, 340px); scroll-snap-align: start; overflow: hidden; border-radius: var(--sf-radius); }
.sf-marquee figure img { height: 100%; width: auto; max-width: none; object-fit: cover; display: block; }
.sf-marquee.is-running .sf-marquee__items { overflow: visible; }
.sf-marquee__track { display: flex; gap: clamp(.75rem, 1.6vw, 1.25rem); width: max-content; animation: sf-marquee var(--sf-marquee-dur, 60s) linear infinite; }
.sf-marquee:hover .sf-marquee__track, .sf-marquee:focus-within .sf-marquee__track { animation-play-state: paused; }
@keyframes sf-marquee { to { transform: translate3d(calc(-50% - clamp(.75rem, 1.6vw, 1.25rem) / 2), 0, 0); } }
@media (hover: hover) and (pointer: fine) {
	.sf-marquee figure img { transition: transform .8s cubic-bezier(.2, .7, .2, 1), filter .5s ease; }
	.sf-marquee figure:hover img { transform: scale(1.06); }
}

/* ---- Safety: never leave anything hidden ---- */
.sf-motion-off .sf-rv, .sf-motion-off .sf-rv > * { opacity: 1 !important; transform: none !important; clip-path: none !important; }
.sf-motion-off .sivad-drawing [pathLength] { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
.sf-motion-off .sivad-drawing .sf-torch { display: none; }
@media print {
	.sf-motion .sf-rv, .sf-motion .sf-rv > *, .sf-motion .sf-hero * { opacity: 1 !important; transform: none !important; clip-path: none !important; animation: none !important; }
	.sf-sparks, .sf-progress { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
	.sf-sparks, .sf-progress__tip { display: none !important; }
	.sf-marquee__track { animation: none !important; }
}

/* ---- Photo + drawing: cut the drawing on a dark plate, sweep the photo in, park the drawing in the corner ---- */
.sf-motion:not(.sf-motion-ready):not(.sf-motion-off) :is(.has-spec, .sivad-portfolio__media) > img { opacity: 0; }
.sf-motion:not(.sf-motion-ready):not(.sf-motion-off) .sivad-figure__spec { opacity: 0; }
.sf-motion .sf-spec-host { background: #1d1c21; }
.sf-motion .sf-spec-host > img { position: relative; z-index: 1; transition: clip-path 1.2s cubic-bezier(.65, 0, .25, 1), transform 2.2s cubic-bezier(.2, .7, .2, 1); }
.sf-motion .sf-spec-host.sf-intro > img { clip-path: inset(0 100% 0 0); transform: scale(1.12); }
.sf-motion .sf-spec-host .sivad-figure__spec { transition: transform .95s cubic-bezier(.65, 0, .25, 1) .15s, background-color .6s ease .3s, border-color .6s ease .3s, box-shadow .6s ease .3s; transform-origin: center; }
.sf-motion .sf-spec-host.sf-intro .sivad-figure__spec {
	transition: none;
	transform: translate(var(--sf-tx, 0px), var(--sf-ty, 0px)) scale(var(--sf-s, 1));
	background-color: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.sf-motion .sf-spec-host.sf-intro .sivad-figure__spec .d-txt { opacity: 1; }
.sf-motion .sf-spec-host .sivad-figure__spec .d-txt { transition: opacity .3s ease; }
.sf-motion .sf-spec-host::after {
	content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; z-index: 3; pointer-events: none;
	background: #fff; box-shadow: 0 0 10px 3px var(--sf-arc), 0 0 28px 8px rgba(255, 150, 60, .55); opacity: 0;
}
.sf-motion .sf-spec-host.is-built:not(.is-settled)::after { animation: sf-sweep 1.2s cubic-bezier(.65, 0, .25, 1) both; }
.sf-motion .sf-spec-host.is-settled { background: transparent; }

/* ---- Dark bands: embers behind the text ---- */
.sf-sparks.sf-sparks--band { z-index: 0; }
:is(.sf-pagehead, .sf-cta, .sf-hero) > .alignwide { position: relative; z-index: 1; }
.sf-cta, .sf-pagehead { position: relative; isolation: isolate; overflow: hidden; }

/* ---- Page headers: the headline gets its own cut line, torch riding the end ---- */
.sf-motion .sf-pagehead h1 { position: relative; padding-bottom: .9rem; }
.sf-motion .sf-pagehead h1::after {
	content: ""; position: absolute; left: 0; bottom: 0; width: 7rem; height: 2px; transform-origin: left center;
	background: linear-gradient(90deg, var(--sf-brand) 0 62%, transparent 62% 66%, var(--sf-brand) 66% 100%);
	animation: sf-rule-grow 1.1s cubic-bezier(.6, 0, .2, 1) .5s both;
}
.sf-motion .sf-pagehead h1::before {
	content: ""; position: absolute; left: 0; bottom: -3px; width: 8px; height: 8px; border-radius: 50%; z-index: 1;
	background: #fff; box-shadow: 0 0 0 2px var(--sf-brand), 0 0 14px 4px color-mix(in srgb, var(--sf-brand) 55%, transparent);
	animation: sf-rule-torch 1.1s cubic-bezier(.6, 0, .2, 1) .5s both;
}
.sf-motion :is(.sf-pagehead.is-style-plate, .sf-pagehead[style*="background-image"]) h1::after { background: linear-gradient(90deg, var(--sf-arc) 0 62%, transparent 62% 66%, var(--sf-arc) 66% 100%); }
.sf-motion :is(.sf-pagehead.is-style-plate, .sf-pagehead[style*="background-image"]) h1::before { box-shadow: 0 0 0 2px var(--sf-arc), 0 0 14px 4px rgba(201, 188, 230, .6); }
@keyframes sf-rule-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- Hero photo: a slow push in ---- */
@keyframes sf-push { from { background-size: 108% auto; } to { background-size: 100% auto; } }
@media (min-width: 1025px) and (min-aspect-ratio: 16/10) {
	.sf-motion .sf-hero[style*="background-image"] { animation: sf-push 9s cubic-bezier(.2, .7, .2, 1) both; }
}

/* ---- Pricing factors and the trust strip: the rule above them is cut across ---- */
.sf-motion .sf-factors > li.sf-rv strong { transition: color .6s ease calc(var(--sf-d, 0ms) + .3s); }
@media (hover: hover) and (pointer: fine) {
	.sf-motion .sf-factors > li:not(.sf-rv) { transition: transform .3s ease; }
	.sf-motion .sf-factors > li:not(.sf-rv):hover { transform: translate3d(0, -3px, 0); }
	.sf-motion .sf-factors > li:not(.sf-rv):hover strong { color: var(--sf-brand); }
}
.sf-motion .sivad-portfolio__media.sf-spec-host > img { position: absolute; inset: 0; }
