/*
 * The OT-AM landing page's motion on the theme's sections, for every page that is not built
 * as the landing page itself (Emilie, 30 Oct 2026: "der er generel for lidt bevægelse", and
 * "Ja tak" to the same motion on the other pages). The values are the landing page's own
 * (lp.css): parts rise 28 px out of a 6 px blur in .7 to .9 s, one after the other, when their
 * section comes into view; photos settle from 107 %; card lines draw in from the left; a light
 * sweeps along the top edge of the boxes.
 *
 * A small script in the head sets .bc-mjs on <html> (not with reduced motion), so nothing is
 * drawn first and hidden after; motion.js sets .bc-mon once it runs and .bc-on on each section
 * as it comes into view (.bc-done when its parts are in place). If motion.js never runs, the
 * parts show anyway after 3 s.
 *
 *  1. What moves
 *  2. Photos, the hero picture and the OT-AM mark
 *  3. Card lines, the sweep and the lift
 */

/* 1. What moves ------------------------------------------------------------ */

/* Rise: the hero text, section heads, the cards of a grid, boxes and the closing card. */
.bc-mjs .bc-page-hero__text > *,
.bc-mjs .bc-post-hero__inner > *,
.bc-mjs .bc-head > *,
.bc-mjs .bc-inner > [class*="__grid"] > *,
.bc-mjs .bc-inner > .bc-cards4 > *,
.bc-mjs .bc-inner > .bc-quotes > *,
.bc-mjs .bc-inner > .bc-industries > *,
.bc-mjs .bc-inner > .bc-tiles > *,
.bc-mjs .bc-inner > .bc-frameworks > *,
.bc-mjs .bc-inner > .bc-chips > *,
.bc-mjs .bc-next__box,
.bc-mjs .bc-question__box,
.bc-mjs .bc-failclosed,
.bc-mjs .bc-secure__top,
.bc-mjs .bc-bigquote__quote,
.bc-mjs .bc-closing__inner > *,
/* Zoom: the hero picture and the figures. */
.bc-mjs .bc-page-hero__art,
.bc-mjs .bc-otam-arch,
.bc-mjs .bc-how__img,
/* Slide in from the left: the rows of a table box. */
.bc-mjs .bc-glance__rows > * {
	transition: opacity .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1), filter .7s ease;
	transition-delay: var(--bc-d, 0s);
}

.bc-mjs .bc-section:not(.bc-on) :is(.bc-page-hero__text > *, .bc-post-hero__inner > *, .bc-head > *, .bc-inner > [class*="__grid"] > *, .bc-inner > .bc-cards4 > *, .bc-inner > .bc-quotes > *, .bc-inner > .bc-industries > *, .bc-inner > .bc-tiles > *, .bc-inner > .bc-frameworks > *, .bc-inner > .bc-chips > *, .bc-next__box, .bc-question__box, .bc-failclosed, .bc-secure__top, .bc-bigquote__quote, .bc-closing__inner > *) {
	opacity: 0;
	transform: translateY(28px);
	filter: blur(6px);
}

.bc-mjs .bc-section:not(.bc-on) :is(.bc-page-hero__art, .bc-otam-arch, .bc-how__img) {
	opacity: 0;
	transform: scale(.92);
	filter: blur(6px);
}

.bc-mjs .bc-section:not(.bc-on) .bc-glance__rows > * {
	opacity: 0;
	transform: translateX(-28px);
	filter: blur(6px);
}

/* Once the parts are in place, cards answer the pointer at once again. */
.bc-mjs .bc-section.bc-done :is(.bc-inner > [class*="__grid"] > *, .bc-inner > .bc-cards4 > *, .bc-inner > .bc-quotes > *, .bc-inner > .bc-industries > *, .bc-inner > .bc-tiles > *) {
	transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

/* One after the other: the hero as on the landing page, then .08 s apart. */
.bc-page-hero__text > :nth-child(2),
.bc-post-hero__inner > :nth-child(2) { --bc-d: .08s; }
.bc-page-hero__text > :nth-child(3),
.bc-post-hero__inner > :nth-child(3) { --bc-d: .16s; }
.bc-page-hero__text > :nth-child(4),
.bc-post-hero__inner > :nth-child(4) { --bc-d: .28s; }
.bc-page-hero__text > :nth-child(5) { --bc-d: .4s; }
.bc-page-hero__art { --bc-d: .3s; }

.bc-head > :nth-child(2),
.bc-closing__inner > :nth-child(2) { --bc-d: .08s; }
.bc-head > :nth-child(3),
.bc-closing__inner > :nth-child(3) { --bc-d: .16s; }
.bc-head > :nth-child(4),
.bc-closing__inner > :nth-child(4) { --bc-d: .24s; }
.bc-closing__inner > :nth-child(5) { --bc-d: .32s; }

/* The cards of a grid and the rows of a box start as the head is in place. */
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(1) { --bc-d: .2s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(2) { --bc-d: .28s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(3) { --bc-d: .36s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(4) { --bc-d: .44s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(5) { --bc-d: .52s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(6) { --bc-d: .6s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(7) { --bc-d: .68s; }
.bc-inner > :not(.bc-head):not(.bc-page-hero__text) > :nth-child(n+8) { --bc-d: .76s; }

.bc-next__box,
.bc-question__box,
.bc-failclosed,
.bc-otam-arch,
.bc-how__img { --bc-d: .12s; }

/* motion.js did not run: everything shows after 3 s. */
.bc-mjs:not(.bc-mon) .bc-section :is(.bc-page-hero__text > *, .bc-post-hero__inner > *, .bc-head > *, .bc-inner > [class*="__grid"] > *, .bc-inner > .bc-cards4 > *, .bc-inner > .bc-quotes > *, .bc-inner > .bc-industries > *, .bc-inner > .bc-tiles > *, .bc-inner > .bc-frameworks > *, .bc-inner > .bc-chips > *, .bc-next__box, .bc-question__box, .bc-failclosed, .bc-secure__top, .bc-bigquote__quote, .bc-closing__inner > *, .bc-page-hero__art, .bc-otam-arch, .bc-how__img, .bc-glance__rows > *) {
	animation: bc-mshow .6s ease 3s forwards;
}

@keyframes bc-mshow {
	to {
		opacity: 1;
		transform: none;
		filter: none;
	}
}

/* 2. Photos, the hero picture and the OT-AM mark ---------------------------- */

/* The photo behind the hero settles from 107 %, as on the landing page. */
.bc-mjs .bc-photo:not(.bc-photo--drift)::before {
	transform: scale(1.07);
}

.bc-mjs .bc-photo.bc-on:not(.bc-photo--drift)::before {
	animation: bc-msettle 9s ease-out forwards;
}

@keyframes bc-msettle {
	from { transform: scale(1.07); }
	to { transform: scale(1); }
}

/* The hero picture: a soft glow behind it and a slow float, as the unit on the landing page. */
.bc-page-hero__art {
	position: relative;
}

.bc-page-hero__art::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 110%;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border-radius: 9999px;
	background: radial-gradient(closest-side, rgba(82, 186, 230, .3), rgba(82, 186, 230, 0));
	pointer-events: none;
	animation: bc-hxglow 6s ease-in-out infinite;
}

.bc-page-hero__art .wp-block-image {
	position: relative;
	animation: bc-mfloat 6s ease-in-out infinite alternate;
}

@keyframes bc-mfloat {
	from { transform: translateY(0); }
	to { transform: translateY(-12px); }
}

/* The OT-AM mark draws in when its section comes into view. */
.bc-mjs .bc-section:not(.bc-on) .bc-otam .ol {
	animation: none;
	stroke-dashoffset: 1.05;
}

/* 3. Card lines, the sweep and the lift -------------------------------------- */

/* Features and figures: their own thin line is drawn in from the left over a grey one. */
.bc-feature::before,
.bc-stat::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -2px;
	height: 2px;
	background: linear-gradient(90deg, var(--bc-check), var(--bc-check)) left top / 100% 2px no-repeat;
	pointer-events: none;
	transition: background-size 1.2s cubic-bezier(.3, .7, .2, 1) var(--bc-d, 0s);
}

.bc-mjs .bc-feature,
.bc-mjs .bc-stat {
	border-top-color: var(--bc-line);
}

.bc-mjs .bc-section:not(.bc-on) :is(.bc-feature, .bc-stat)::before {
	background-size: 0 2px;
}

/* A light along the top edge of the next step box, as on the landing page's question box. */
.bc-next__box {
	position: relative;
	overflow: hidden;
}

.bc-next__box::after {
	content: "";
	position: absolute;
	top: 0;
	left: -40%;
	width: 40%;
	height: 2px;
	background: linear-gradient(90deg, transparent, var(--bc-check), transparent);
	pointer-events: none;
	animation: bc-sweep 6s ease-in-out infinite;
}

/* The cards that are links lift a little under the pointer, as on the landing page. */
.bc-atcard,
.bc-tcard {
	transition: border-color .25s ease, transform .25s ease, box-shadow .25s ease;
}

.bc-atcard:hover,
.bc-tcard:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 26px rgba(14, 27, 38, .07);
}

@media (prefers-reduced-motion: reduce) {
	.bc-page-hero__art .wp-block-image,
	.bc-next__box::after {
		animation: none;
	}

	.bc-atcard:hover,
	.bc-tcard:hover {
		transform: none;
	}
}
