/* Scrollcraft : scène épinglée, dispositions, animation au scroll. */

/* ---------------------------------------------------------------------- */
/* Scène                                                                   */
/* ---------------------------------------------------------------------- */

.sc-scene {
	--sc-runway: 600px;
	--sc-top: 100px;
	position: relative;
}

/* ---------------------------------------------------------------------- */
/* Dispositions                                                            */
/* ---------------------------------------------------------------------- */

.sc-layout {
	--sc-gap: 24px;
	display: grid;
	gap: var(--sc-gap);
	align-items: var(--sc-align, start);
}

.sc-layout.sc-layout > * {
	margin-block: 0;
}

.sc-layout.is-mode-columns {
	grid-template-columns: var(--sc-cols, repeat(2, minmax(0, 1fr)));
}

.sc-layout.is-mode-grid {
	grid-template-columns: repeat(var(--sc-n, 3), minmax(0, 1fr));
}

.sc-layout.is-mode-list {
	display: flex;
	flex-direction: column;
}

.sc-layout.is-mode-stack {
	grid-template-columns: minmax(0, 1fr);
}

.sc-layout.is-mode-stack.is-mode-stack > * {
	grid-area: 1 / 1;
	margin-top: calc(var(--sc-i, 0) * var(--sc-offset, 60px));
}

/* Rang de chaque enfant (empilement, délais d'arrivée). */
.sc-layout > :nth-child(1) {
	--sc-i: 0;
}

.sc-layout > :nth-child(2) {
	--sc-i: 1;
}

.sc-layout > :nth-child(3) {
	--sc-i: 2;
}

.sc-layout > :nth-child(4) {
	--sc-i: 3;
}

.sc-layout > :nth-child(5) {
	--sc-i: 4;
}

.sc-layout > :nth-child(6) {
	--sc-i: 5;
}

.sc-layout > :nth-child(7) {
	--sc-i: 6;
}

.sc-layout > :nth-child(8) {
	--sc-i: 7;
}

.sc-layout > :nth-child(9) {
	--sc-i: 8;
}

.sc-layout > :nth-child(10) {
	--sc-i: 9;
}

.sc-layout > :nth-child(11) {
	--sc-i: 10;
}

.sc-layout > :nth-child(12) {
	--sc-i: 11;
}

.sc-layout.has-stagger > .sc-a {
	--sc-start: calc(var(--sc-i, 0) * var(--sc-step, 15));
}

.sc-layout.has-tilt > :nth-child(odd) {
	--sc-rest-r: -1.5deg;
}

.sc-layout.has-tilt > :nth-child(even) {
	--sc-rest-r: 1.2deg;
}

@media (max-width: 781px) {
	.sc-layout.is-mode-columns {
		grid-template-columns: minmax(0, 1fr);
	}

	.sc-layout.is-mode-grid {
		grid-template-columns: repeat(var(--sc-mn, 1), minmax(0, 1fr));
	}
}

/* ---------------------------------------------------------------------- */
/* Effets : point de départ de chaque animation                            */
/* ---------------------------------------------------------------------- */

.sc-fx-up {
	--sc-from-y: var(--sc-dist, 60px);
}

.sc-fx-down {
	--sc-from-y: calc(var(--sc-dist, 60px) * -1);
}

.sc-fx-left {
	--sc-from-x: calc(var(--sc-dist, 60px) * -1);
}

.sc-fx-right {
	--sc-from-x: var(--sc-dist, 60px);
}

.sc-fx-zoom {
	--sc-from-s: 0.85;
}

.sc-fx-rotate {
	--sc-from-r: -8deg;
	--sc-from-s: 0.94;
}

/* ---------------------------------------------------------------------- */
/* Animations (désactivées si le navigateur ne les gère pas, ou si le      */
/* visiteur demande moins de mouvement : le contenu reste alors visible)   */
/* ---------------------------------------------------------------------- */

@keyframes sc-in {
	from {
		animation-timing-function: var(--sc-ease, cubic-bezier(0.25, 0.8, 0.25, 1));
		opacity: var(--sc-from-o, 0);
		transform: translate(var(--sc-from-x, 0), var(--sc-from-y, 0)) rotate(var(--sc-from-r, 0deg)) scale(var(--sc-from-s, 1));
	}

	to {
		opacity: 1;
		transform: rotate(var(--sc-rest-r, 0deg));
	}
}

@keyframes sc-parallax {
	from {
		translate: 0 var(--sc-dist, 60px);
	}

	to {
		translate: 0 calc(var(--sc-dist, 60px) * -1);
	}
}

@keyframes sc-pin {
	from {
		translate: 0 0;
	}

	to {
		translate: 0 var(--sc-runway);
	}
}

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.sc-a {
			animation: sc-in linear both;
			animation-timeline: view();
			animation-range:
				entry calc(var(--sc-start, 0) * 1%)
				entry calc((var(--sc-start, 0) + var(--sc-len, 100)) * 1%);
		}

		.sc-a.sc-fx-parallax {
			animation: sc-parallax linear both;
			animation-timeline: view();
			animation-range: cover;
		}

		/* Scène épinglée (bureau) : la zone de défilement est ajoutée sous le
		   contenu, qui est décalé d'autant à la vitesse du défilement. */
		@media (min-width: 782px) {
			.sc-scene {
				view-timeline: --sc-scene block;
			}

			.sc-scene.is-pinned {
				padding-bottom: var(--sc-runway);
			}

			.sc-scene.is-pinned > .sc-pin {
				animation: sc-pin linear both;
				animation-timeline: --sc-scene;
				animation-range:
					cover calc(100vh - var(--sc-top))
					cover calc(100vh - var(--sc-top) + var(--sc-runway));
			}

			.sc-scene.is-pinned .sc-a:not(.sc-fx-parallax) {
				animation-timeline: --sc-scene;
				animation-range:
					cover calc(100vh - var(--sc-top) + var(--sc-start, 0) * var(--sc-runway) / 100)
					cover calc(100vh - var(--sc-top) + (var(--sc-start, 0) + var(--sc-len, 40)) * var(--sc-runway) / 100);
			}
		}
	}
}

/* ---------------------------------------------------------------------- */
/* Cartes des modèles (classes à surcharger dans le thème si besoin)       */
/* ---------------------------------------------------------------------- */

.sc-card {
	padding: clamp(1.25rem, 2vw, 1.75rem);
	border-radius: 18px;
	box-shadow: 0 12px 30px rgba(14, 27, 44, 0.12);
}

.sc-card.is-ink {
	background: #0e1b2c;
	color: #fff;
}

.sc-card.is-coral {
	background: #ff5a36;
	color: #0e1b2c;
}

.sc-card.is-sky {
	background: #dcebff;
	color: #0e1b2c;
}

.sc-card.is-paper {
	background: #fff;
	color: #0e1b2c;
	border: 1px solid rgba(14, 27, 44, 0.2);
}

.sc-card :where(h2, h3, h4) {
	margin: 0 0 0.5rem;
	color: inherit;
}

.sc-card :where(p) {
	margin: 0;
}

.sc-tall {
	min-height: 320px;
}
