/* Construct Match — Drawings to Built hero (pinned, scroll-driven) */
.cm.build { --p: 0; --rise: 0; --fx: 62%; --fy: 60%; --wash: rgba(247, 246, 241, .97); --len: 330vh; position: relative; height: var(--len); background-color: var(--paper); }
.cm .build__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.cm .build__pic { position: absolute; inset: 0; }
.cm .build__img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--fx) var(--fy); }
.cm .build__img--draw { mix-blend-mode: multiply; }
/* the build rises from the ground: --rise 0 → 100 */
.cm .build__img--built { clip-path: inset(calc(100% - var(--rise) * 1%) 0 0 0); }
.cm .build__line { position: absolute; left: 0; right: 0; bottom: calc(var(--rise) * 1%); height: 0; border-top: 1.5px solid var(--navy); opacity: calc(min(1, var(--rise) * .08) * (1 - max(0, var(--rise) - 92) / 8)); pointer-events: none; }
.cm .build__line span { position: absolute; right: var(--pad); top: -30px; padding: 5px 10px; border-radius: 4px; background: var(--navy); color: #fff; font: 500 12px/1 var(--mono); white-space: nowrap; }

/* dimension lines, drawn in on load */
.cm .build__dims { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; color: var(--navy); opacity: calc(1 - var(--rise) / 40); pointer-events: none; }
.cm .dim__l, .cm .dim__t { stroke-width: 2.4; vector-effect: non-scaling-stroke; }
.cm .dim__l { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: cm-draw 1.6s var(--ease) .5s forwards; }
.cm .dim--h .dim__l { animation-delay: 1s; }
.cm .dim__t { opacity: 0; animation: cm-fade .4s 1.6s forwards; }
@keyframes cm-draw { to { stroke-dashoffset: 0; } }
@keyframes cm-fade { to { opacity: 1; } }

.cm .note, .cm .tag { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); white-space: nowrap; pointer-events: none; }
.cm .note { padding: 5px 10px; border-radius: 4px; background: var(--paper); color: var(--navy); font: 400 13px/1 var(--mono); opacity: 0; animation: cm-fade .5s 1.7s forwards; }
.cm .note b { font-weight: 500; }
.cm.build.is-rising .note { opacity: calc(1 - var(--rise) / 30); animation: none; }
.cm .tag { z-index: 1; display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px 9px 10px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.2; box-shadow: 0 14px 30px -14px rgba(15, 28, 51, .45); opacity: 0; transform: translate(-50%, -30%) scale(.94); transition: opacity .45s var(--ease), transform .55s var(--ease); }
.cm .tag i { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--ok); }
.cm .tag i::after { content: ""; width: 10px; height: 6px; margin-top: -2px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.cm .tag--warn i { background: var(--warn); }
.cm .tag--warn i::after { width: 2px; height: 6px; margin: -4px 0 0; border: 0; background: #fff; transform: none; box-shadow: 0 5px 0 -.4px #fff; }
.cm .tag.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cm.build.is-built .tag { opacity: 0; }

/* copy: left, over a soft paper wash */
.cm .build__stage::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(120% 90% at 0% 40%, var(--wash) 0%, color-mix(in srgb, var(--wash) 92%, transparent) 32%, transparent 62%); }
.cm .build__copy { position: absolute; z-index: 2; inset: 0; display: flex; align-items: center; padding-top: var(--hdr); pointer-events: none; }
.cm .build__copy .wrap > * { max-width: 660px; }
.cm .build__copy a { pointer-events: auto; }
.cm .build__for { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.cm .build__for span { padding: 7px 12px; border: 1px solid rgba(16, 48, 111, .25); border-radius: 999px; background: rgba(255, 255, 255, .6); font-size: 13.5px; font-weight: 500; color: var(--navy); }
.cm .build__h { font: 700 clamp(42px, 5vw, 80px)/1 var(--cm-display); font-stretch: 108%; letter-spacing: -.04em; color: var(--ink); }
.cm .build__h span { display: block; }
.cm .build__h span + span { color: var(--navy); }
.cm .build__lead { margin-top: 26px; max-width: 44ch; font-size: var(--fs-lead); line-height: 1.6; color: var(--text); }
.cm .build__act { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 34px; }
.cm .build__time { font-size: 15px; color: var(--muted); }
.cm .build__for, .cm .build__h span, .cm .build__lead, .cm .build__act { animation: cm-rise .9s var(--ease) both; }
.cm .build__h span:nth-child(1) { animation-delay: .08s; }
.cm .build__h span:nth-child(2) { animation-delay: .18s; }
.cm .build__lead { animation-delay: .3s; }
.cm .build__act { animation-delay: .42s; }
@keyframes cm-rise { from { opacity: 0; transform: translateY(18px); } }

/* the stage ruler */
.cm .ruler { position: absolute; z-index: 3; left: 0; right: 0; bottom: 26px; pointer-events: none; }
.cm .ruler__in { position: relative; }
.cm .ruler__steps { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); }
.cm .ruler__steps li { position: relative; padding: 0 0 14px; font: 500 12.5px/1 var(--mono); color: var(--muted); transition: color .3s; }
.cm .ruler__steps li::before { content: ""; position: absolute; left: 0; bottom: -5px; width: 1.5px; height: 12px; background: currentColor; }
.cm .ruler__steps li.is-on { color: var(--navy); }
.cm .ruler__track { position: relative; display: block; height: 1.5px; background: rgba(15, 28, 51, .18); }
.cm .ruler__track b { position: absolute; left: 0; top: 0; height: 100%; width: calc(var(--p) * 100%); background: var(--navy); }
.cm .ruler__track b::after { content: ""; position: absolute; right: -6px; top: -5px; width: 11px; height: 11px; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 4px rgba(16, 48, 111, .15); }
.cm .build__hint { position: absolute; z-index: 3; right: var(--pad); bottom: 64px; font: 500 12.5px/1 var(--mono); color: var(--muted); opacity: calc(1 - var(--p) * 6); }

/* Elementor editor: a short, static preview */
.elementor-editor-active .cm.build { height: 100vh; }
.elementor-editor-active .cm .tag { opacity: 1; transform: translate(-50%, -50%); }

/* Phones: a full-screen crop of a wide scene shows only a corner of it, so
   the whole building fills the top of the screen edge to edge in a 4:3 frame
   just under the header (which stays put while the hero is pinned, see
   header.js), the ruler follows, then the copy. The frame shows 3/4 of the scene's width; --mfx picks which part.
   Image, drawing and dimension lines share one box (4/3 of the frame wide),
   so they stay registered. */
@media (max-width: 860px) {
	/* not pinned on phones: natural height, the sequence plays by itself (build.js) */
	.cm.build { --mfx: 14%; height: auto; }
	.cm .build__stage { position: relative; height: auto; display: flex; flex-direction: column; justify-content: flex-start; padding-top: var(--hdr); }
	.cm .build__stage::before { display: none; }
	.cm .build__pic { order: 1; position: relative; inset: auto; flex: none; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; }
	.cm .build__img, .cm .build__dims { left: calc(var(--mfx) / -3); width: 133.334%; height: 100%; object-fit: cover; object-position: 50% 50%; }
	.cm .ruler { order: 2; position: relative; inset: auto; padding-top: 16px; }
	.cm .build__copy { order: 3; position: relative; inset: auto; display: block; padding: 22px 0 8px; }
	.cm .build__h { font-size: clamp(28px, 7.6vw, 40px); letter-spacing: -.035em; }
	.cm .build__lead { margin-top: 12px; font-size: 15px; line-height: 1.55; }
	.cm .build__act { margin-top: 18px; }
	.cm .build__for { margin-bottom: 12px; }
	.cm .note--h, .cm .dim--h { display: none; }
	/* the label's --x is % of the scene: map it into the frame */
	.cm .note--w { left: calc(var(--x) * 4 / 3 - var(--mfx) / 3); }
	.cm .build__line span { top: -26px; font-size: 11px; }
	.cm .tag { left: var(--mx); top: var(--my); font-size: 12.5px; padding: 7px 11px 7px 8px; }
	.cm .tag i { width: 18px; height: 18px; }
	.cm .build__hint { display: none; }
}
@media (max-width: 600px) {
	.cm .build__for span:first-child:not(:only-child) { display: none; }
	.cm .build__act .btn { width: 100%; }
	.cm .build__act .btn { min-height: 52px; font-size: 16px; }
	.cm .build__time { font-size: 13px; }
	.cm .ruler__steps li { font-size: 11px; }
}
