/* Magik Motion — what the animations need from CSS. */

/* Until the script has prepared the page, animated blocks stay hidden (no flash of the final state).
   If the script never runs, they appear on their own after 2.5 s. */
.mk-js:not(.mk-motion-ready) :is(.mk-hero, .mk-reveal, .mk-stagger, .mk-split, .mk-unveil, .mk-draw),
.mk-js:not(.mk-motion-ready) body:has(.mk-hero) .elementor-location-header {
	visibility: hidden;
	animation: mk-failsafe 0s 2.5s forwards;
}
@keyframes mk-failsafe { to { visibility: visible; } }

/* Split headings: each line slides out of its own mask. */
.mk-line { will-change: transform; }

/* Endless band */
.mk-marquee { overflow: hidden; }
.mk-marquee .elementor-heading-title { white-space: nowrap; display: block; }
.mk-marquee-track { display: inline-flex; white-space: nowrap; will-change: transform; }
.mk-marquee-item { display: inline-block; padding-right: 0.6em; }

/* Header: sticky, compact once scrolled, hidden while reading down. */
.elementor-location-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 90;
	transition: transform 0.45s var(--mk-ease), box-shadow 0.3s ease;
}
.elementor-location-header > .e-con,
.elementor-location-header .e-con:first-child { transition: padding 0.35s var(--mk-ease), background-color 0.3s ease; }
.elementor-location-header.mk-scrolled > .e-con {
	padding-top: 10px;
	padding-bottom: 10px;
	background-color: color-mix(in srgb, var(--mk-color-background) 82%, transparent) !important;
	-webkit-backdrop-filter: saturate(1.6) blur(14px);
	backdrop-filter: saturate(1.6) blur(14px);
}
.elementor-location-header.mk-scrolled { box-shadow: 0 1px 0 color-mix(in srgb, var(--mk-color-text) 8%, transparent); }
.elementor-location-header.mk-header-hidden { transform: translateY(-110%); }

/* Cards answer the pointer. */
.mk-card { transition: box-shadow 0.4s var(--mk-ease), transform 0.4s var(--mk-ease); }
.mk-card:hover { box-shadow: 0 2px 6px rgba(15, 20, 18, 0.05), 0 24px 48px rgba(15, 20, 18, 0.09); }
.mk-tilt { will-change: transform; }

/* Drawings */
.mk-drawing svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Big numbers (01, 02…) */
.mk-index .elementor-heading-title {
	font-variant-numeric: tabular-nums;
	color: var(--mk-color-signal, var(--mk-color-accent));
}

@media (prefers-reduced-motion: reduce) {
	.elementor-location-header.mk-header-hidden { transform: none; }
}

/* Lenis (smooth scroll) */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Widgets: Dessin d'architecte, Maquette 3D */
.mk-drawing { color: var(--mk-color-primary); }
.mk-drawing text { fill: currentColor; stroke: none; font-family: var(--mk-font-body); }
.mk-drawing .mk-accent { stroke: var(--mk-drawing-accent, var(--mk-color-signal, var(--mk-color-accent))); }
.mk-model { position: relative; width: 100%; height: 560px; touch-action: pan-y; }
.mk-model canvas { display: block; }

/* Chantier pas à pas: steps on the left, a sticky model that builds itself on the right. */
.mk-steps {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: clamp(32px, 5vw, 80px);
	align-items: start;
}
.mk-steps-list { position: relative; padding-left: 28px; }
.mk-steps-list ol { list-style: none; margin: 0; padding: 0; }
.mk-steps-bar {
	position: absolute; left: 0; top: 12vh; bottom: 12vh; width: 2px;
	background: color-mix(in srgb, var(--mk-color-text) 10%, transparent);
	border-radius: 2px;
}
.mk-steps-bar i {
	position: absolute; inset: 0; transform-origin: top; transform: scaleY(0);
	background: var(--mk-color-signal, var(--mk-color-accent));
	border-radius: inherit;
}
.mk-step {
	min-height: 72vh;
	display: flex; flex-direction: column; justify-content: center;
	padding-block: 6vh;
	opacity: 0.28;
	transition: opacity 0.6s var(--mk-ease);
}
.mk-step.is-active { opacity: 1; }
.mk-step.is-done { opacity: 0.45; }
.mk-step-num {
	font-family: var(--mk-font-heading);
	font-weight: var(--mk-heading-weight);
	letter-spacing: var(--mk-heading-tracking);
	font-size: clamp(64px, 8vw, 120px);
	line-height: 0.9;
	font-variant-numeric: tabular-nums;
	color: transparent;
	-webkit-text-stroke: 1px color-mix(in srgb, var(--mk-color-text) 45%, transparent);
	transition: color 0.6s var(--mk-ease), -webkit-text-stroke-color 0.6s var(--mk-ease);
	margin-bottom: 18px;
}
.mk-step.is-active .mk-step-num {
	color: var(--mk-color-signal, var(--mk-color-accent));
	-webkit-text-stroke-color: transparent;
}
.mk-step-title { font-size: var(--mk-text-h3); margin: 0 0 12px; }
.mk-step-text { color: var(--mk-color-muted); margin: 0 0 20px; max-width: 46ch; }
.mk-step-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mk-step-checks li {
	font-size: 0.875rem; padding: 6px 12px; border-radius: 999px;
	background: var(--mk-color-surface); color: var(--mk-color-text);
}
.mk-step-checks li::before { content: "✓"; color: var(--mk-color-signal, var(--mk-color-accent)); margin-right: 6px; font-weight: 600; }
.mk-steps-stage { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) + 10vh); }
.mk-steps-frame {
	position: relative;
	border-radius: calc(var(--mk-radius-card) * 1.4);
	background:
		linear-gradient(color-mix(in srgb, var(--mk-color-text) 5%, transparent) 1px, transparent 1px) 0 0 / 32px 32px,
		linear-gradient(90deg, color-mix(in srgb, var(--mk-color-text) 5%, transparent) 1px, transparent 1px) 0 0 / 32px 32px,
		var(--mk-color-surface);
	overflow: hidden;
}
.mk-steps-frame .mk-model { height: 76vh; max-height: 720px; }
.mk-steps-caption {
	position: absolute; left: 20px; right: 20px; bottom: 18px;
	display: flex; justify-content: space-between; gap: 12px;
	font-size: 0.875rem; color: var(--mk-color-muted);
}
.mk-steps-caption b { color: var(--mk-color-text); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
	.mk-steps { grid-template-columns: 1fr; gap: 0; }
	.mk-steps-stage { order: -1; top: calc(var(--wp-admin--admin-bar--height, 0px) + 64px); z-index: 2; background: var(--mk-color-background); padding-bottom: 12px; }
	.mk-steps-frame .mk-model { height: 38vh; }
	.mk-steps-caption span + span { display: none; }
	.mk-step { min-height: 58vh; padding-block: 4vh; }
	.mk-steps-bar { top: 4vh; bottom: 4vh; }
}

/* Identité pas à pas: a sample brand board that assembles itself. */
.mk-board {
	aspect-ratio: 4 / 5; max-height: 78vh; margin-inline: auto;
	display: grid; gap: 12px; padding: 18px 18px 48px;
	grid-template-columns: 1fr 1fr; grid-template-rows: auto 1.4fr auto 1fr;
	grid-template-areas: "words words" "logo logo" "colors colors" "type mock";
	font-family: var(--mk-font-body);
}
.mk-b {
	position: relative; background: var(--mk-color-background); border-radius: calc(var(--mk-radius-card) * 0.8);
	padding: 14px; box-shadow: 0 1px 2px rgba(15, 20, 18, .05), 0 10px 30px rgba(15, 20, 18, .06);
	opacity: 0; transform: translateY(24px) scale(.97); transition: opacity .7s var(--mk-ease), transform .7s var(--mk-ease);
	min-height: 0; overflow: hidden;
}
.mk-bsteps.mk-stage-1 .mk-b1, .mk-bsteps.mk-stage-2 .mk-b2, .mk-bsteps.mk-stage-3 .mk-b3, .mk-bsteps.mk-stage-4 .mk-b4, .mk-bsteps.mk-stage-5 .mk-b5 { opacity: 1; transform: none; }
.mk-b1 { grid-area: words; } .mk-b2 { grid-area: logo; } .mk-b3 { grid-area: colors; } .mk-b4 { grid-area: type; } .mk-b5 { grid-area: mock; }
.mk-b-label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mk-color-muted); margin-bottom: 8px; }
.mk-b-words { display: flex; gap: 8px; flex-wrap: wrap; }
.mk-b-words span { padding: 6px 12px; border-radius: 999px; background: #f3e7d3; color: #5a3a22; font-weight: 600; font-size: 14px; }
.mk-b-logo { display: flex; align-items: center; justify-content: center; gap: 18px; height: calc(100% - 22px); background: #f3e7d3; border-radius: 12px; }
.mk-b-logo svg { width: 34%; max-width: 130px; height: auto; fill: none; stroke: #c2562d; stroke-width: 5; stroke-linecap: round; }
.mk-b-ring { stroke-dasharray: 290; stroke-dashoffset: 290; transition: stroke-dashoffset 1.4s var(--mk-ease) .2s; }
.mk-b-rays line { stroke: #e0a83a; opacity: 0; transition: opacity .5s ease 1.1s; }
.mk-b-logo text { fill: #1f3b2d; stroke: none; font: 700 44px Georgia, serif; opacity: 0; transition: opacity .6s ease .9s; }
.mk-bsteps.mk-stage-2 .mk-b-ring { stroke-dashoffset: 0; }
.mk-bsteps.mk-stage-2 .mk-b-rays line, .mk-bsteps.mk-stage-2 .mk-b-logo text { opacity: 1; }
.mk-b-word strong { display: block; font: 700 clamp(18px, 2.2vw, 28px)/1.1 Georgia, serif; color: #1f3b2d; }
.mk-b-word span { font-size: 12px; color: #7a5a3a; letter-spacing: .04em; }
.mk-b-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mk-b-swatches span { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--mk-color-muted); }
.mk-b-swatches i { display: block; height: 46px; border-radius: 10px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--mk-ease); }
.mk-b-swatches span:nth-child(2) i { transition-delay: .1s; } .mk-b-swatches span:nth-child(3) i { transition-delay: .2s; } .mk-b-swatches span:nth-child(4) i { transition-delay: .3s; }
.mk-bsteps.mk-stage-3 .mk-b-swatches i { transform: none; }
.mk-b-swatches b { color: var(--mk-color-text); font-size: 12px; }
.mk-b-type { display: flex; gap: 12px; align-items: center; }
.mk-b-aa { font: 700 54px/1 Georgia, serif; color: #c2562d; }
.mk-b-type div { display: flex; flex-direction: column; font-size: 12px; color: var(--mk-color-muted); }
.mk-b-type strong { color: var(--mk-color-text); font-size: 13px; }
.mk-b-abc { font-family: Georgia, serif; color: var(--mk-color-text); }
.mk-b-mock { position: relative; height: calc(100% - 22px); min-height: 90px; }
.mk-b-card { position: absolute; left: 0; bottom: 6px; width: 62%; aspect-ratio: 1.7; border-radius: 6px; background: #1f3b2d; color: #f3e7d3; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; transform: rotate(-8deg); box-shadow: 0 8px 18px rgba(0,0,0,.18); font-size: 9px; }
.mk-b-card b, .mk-b-cup b, .mk-b-phone b { font: 700 18px Georgia, serif; color: #e0a83a; }
.mk-b-phone { position: absolute; right: 6%; top: 0; width: 30%; aspect-ratio: .5; border-radius: 10px; background: #c2562d; border: 3px solid #15171c; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #f3e7d3; font-size: 9px; transform: rotate(6deg); }
.mk-b-phone i { position: absolute; top: 4px; width: 30%; height: 3px; border-radius: 3px; background: #15171c; }
.mk-b-cup { position: absolute; left: 42%; top: 2px; width: 22%; aspect-ratio: .8; border-radius: 4px 4px 12px 12px; background: #f3e7d3; display: flex; align-items: center; justify-content: center; box-shadow: inset -6px 0 0 rgba(0,0,0,.05); }
@media (max-width: 900px) {
	.mk-board { aspect-ratio: auto; height: 46vh; grid-template-rows: auto 1fr auto; grid-template-areas: "words words" "logo mock" "colors colors"; }
	.mk-b4 { display: none; }
	.mk-b-swatches i { height: 26px; }
}
