/* ==========================================================================
   Portal — motion effects. Concept: origami / folded paper.
   Classes are added by motion.js only when an effect is active.
   ========================================================================== */

/* ---------- intro: origami logo drawn, folded, flown into the header ---------- */
.p-loader {
	position: fixed; inset: 0; z-index: 99999; align-items: center; justify-content: center;
	pointer-events: none;
}
/* the sheet: four triangular flaps meeting in the middle; each opens on its
   screen edge towards the visitor and shows its coloured back */
.p-loader__sheet { position: absolute; inset: 0; perspective: 1800px; transform-style: preserve-3d; } /* perspective only for the flaps, not for the flying logo */
/* white paper on top (--w = 1); as a flap lifts, the paper takes its colour */
.p-flap { position: absolute; inset: -1px; display: block; background: var(--back); will-change: transform; }
.p-flap::before { content: ""; position: absolute; inset: 0; background: var(--paper); opacity: var(--w, 1); }
.p-flap--t { clip-path: polygon(0 0, 100% 0, 50% 50%); transform-origin: 50% 0; --paper: #fcfdfe; }
.p-flap--r { clip-path: polygon(100% 0, 100% 100%, 50% 50%); transform-origin: 100% 50%; --paper: #f5f9fb; }
.p-flap--b { clip-path: polygon(0 100%, 100% 100%, 50% 50%); transform-origin: 50% 100%; --paper: #eef4f7; }
.p-flap--l { clip-path: polygon(0 0, 0 100%, 50% 50%); transform-origin: 0 50%; --paper: #f8fbfc; }
.p-flap--t { --back: linear-gradient(180deg, #ffad4d, #f7941e 70%, #db5c1e); }
.p-flap--r { --back: linear-gradient(270deg, #3cc4f0, #00abe5 70%, #006091); }
.p-flap--b { --back: linear-gradient(0deg, #a6d86e, #8cc751 70%, #4e9d3a); }
.p-flap--l { --back: linear-gradient(90deg, #1f86bd, #006091 70%, #00476e); }
.p-loader__creases { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.p-loader__creases line { stroke: rgba(0, 96, 145, .22); stroke-width: 1; vector-effect: non-scaling-stroke; }
.p-loader__icon { position: relative; z-index: 2; width: min(38vmin, 320px); height: auto; overflow: visible; }
.p-intro .p-header__logo img { opacity: 0; }
.p-header__logo img { transition: opacity .35s ease; }

/* ---------- hero: assembled logo pieces ---------- */
.p-hero__art.is-pieces .p-hero__art-img { visibility: hidden; }
.p-hero__art.is-pieces .p-hero__pieces { display: block; }
.p-piece { position: absolute; display: block; will-change: transform; }
.p-piece__repel { display: block; will-change: transform; }
.p-piece img { display: block; width: 100%; height: auto; will-change: transform; user-select: none; -webkit-user-drag: none; }
.p-piece img { filter: drop-shadow(0 18px 24px rgba(0, 60, 100, .12)); }

/* ---------- unfold: a soft crease shadow while the panel is folded ---------- */
.p-unfold { transform-style: preserve-3d; backface-visibility: hidden; }
.p-unfold-shade { position: relative; }
.p-unfold-shade::after {
	content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 5;
	background: linear-gradient(180deg, rgba(0, 30, 50, .28) 0%, rgba(0, 30, 50, 0) 60%);
	opacity: var(--crease, 0);
}

/* ---------- fold: cards unfold from a crease (uses individual transform
   properties, so the cards' own hover transforms keep working) ---------- */
.p-fold {
	--f: 0;
	rotate: x calc(var(--f) * -62deg);
	translate: 0 calc(var(--f) * 70px);
	transform-origin: 50% 0%;
	opacity: calc(1 - var(--f) * .75);
	backface-visibility: hidden;
}
.p-fold-parent { perspective: 1400px; }

/* ---------- words reveal ---------- */
.p-title .p-mask-w-mask { padding: .14em .08em .2em; margin: -.14em -.08em -.2em; } /* room for ascenders, descenders and nikud */
.p-title .p-w { display: inline-block; will-change: transform, opacity; backface-visibility: hidden; }
.p-title--split { background: none !important; -webkit-text-fill-color: currentColor !important; }
.p-title .p-w.p-wgrad {
	background: var(--g-title); -webkit-background-clip: text; background-clip: text;
	color: transparent; -webkit-text-fill-color: transparent;
	padding-block: .06em .1em; margin-block: -.06em -.1em;
}
.p-accent.p-accent--split { background: none !important; -webkit-text-fill-color: currentColor !important; }

/* ---------- custom cursor (style chosen in the switcher) ---------- */
.fx-cursor-on, .fx-cursor-on * { cursor: none !important; }
.fx-cursor-on :is(input, textarea, select) { cursor: text !important; }
html.fx-cursor-on.fx-seal .p-btn, html.fx-cursor-on.fx-seal .p-btn * { cursor: pointer !important; } /* the seal docks beside it */
.p-cursor { position: fixed; top: 0; left: 0; z-index: 100000; pointer-events: none; display: none; transition: opacity .3s ease; }
.p-cursor.is-on { display: block; }
.p-cursor.is-hidden { opacity: 0; }
.p-cursor__tri { display: none; }
.p-cursor__body, .p-cursor__ring { position: absolute; left: 0; top: 0; border-radius: 50%; }
.p-cursor__ring {
	display: grid; place-items: center;
	transition: width .45s cubic-bezier(.2, .7, .2, 1), height .45s cubic-bezier(.2, .7, .2, 1), margin .45s cubic-bezier(.2, .7, .2, 1),
		background-color .35s ease, border-color .35s ease, opacity .3s ease;
}
.p-cursor__label { font-family: var(--font-ui); font-size: 15px; letter-spacing: .02em; color: #fff; opacity: 0; transition: opacity .25s ease .05s; white-space: nowrap; }

/* blend — inverting disc */
.p-cursor--blend { mix-blend-mode: difference; } /* on the fixed wrapper: it is the stacking context */
.p-cursor--blend.is-card, .p-cursor--blend.is-drag, .p-cursor--blend.is-btn { mix-blend-mode: normal; }
.p-cursor--blend .p-cursor__body { display: none; }
.p-cursor--blend .p-cursor__ring {
	width: 26px; height: 26px; margin: -13px 0 0 -13px; background: #fff;
}
.p-cursor--blend.is-link .p-cursor__ring { width: 74px; height: 74px; margin: -37px 0 0 -37px; }
.p-cursor--blend.is-down .p-cursor__ring { width: 18px; height: 18px; margin: -9px 0 0 -9px; }

/* ring — dot + following ring */
.p-cursor--ring .p-cursor__body { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--c-navy); }
.p-cursor--ring .p-cursor__ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 1.5px solid rgba(0, 96, 145, .55); }
.p-cursor--ring.is-link .p-cursor__ring { width: 66px; height: 66px; margin: -33px 0 0 -33px; border-color: var(--c-sky); background: rgba(0, 171, 229, .1); }
.p-cursor--ring.is-down .p-cursor__ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }

/* origami — the arrow drawn like the pieces of the logo: flat orange facets,
   a flap folded down along a crease with a dark shadow wedge under the fold.
   It turns slightly in 3D as it moves (--rx / --ry from motion.js); on links
   the flap folds up over the crease. Over buttons the hand + seal show. */
.p-fold-arrow { display: none; }
.p-cursor--origami .p-cursor__body { width: 26px; height: 30px; margin: -1px 0 0 -1px; border-radius: 0; background: none; }
.p-cursor--origami .p-cursor__ring { width: 0; height: 0; margin: 0; }
.p-cursor--origami .p-fold-arrow {
	display: block; width: 26px; height: 30px; transform-origin: 1px 1px;
	transform: perspective(160px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
	filter: drop-shadow(0 0 .6px rgba(255, 255, 255, .9)) drop-shadow(0 3px 4px rgba(60, 30, 0, .25));
	transition: opacity .2s ease, scale .3s cubic-bezier(.2, .8, .2, 1.3);
}
.p-fold-arrow svg { display: block; overflow: visible; }
.p-fold-arrow__flap { transform-box: view-box; transform-origin: 6px 20.5px; transition: transform .4s cubic-bezier(.2, .8, .2, 1.15); }
.p-cursor--origami.is-link .p-fold-arrow { scale: 1.1; }
.p-cursor--origami.is-link .p-fold-arrow__flap { transform: rotate3d(6, -3.2, 0, 150deg); } /* folds up along the crease */
.p-cursor--origami.is-down .p-fold-arrow { scale: .86; }
.p-cursor--origami:is(.is-card, .is-drag, .is-btn) .p-fold-arrow { opacity: 0; }

/* logo — the cursor is the Portal mark; on links its pieces open, on click they snap shut */
.p-cursor--logo .p-cursor__body { display: none; }
.p-cursor--logo .p-cursor__ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; }
.p-cursor--logo .p-cursor__ori {
	opacity: 1; width: 30px; height: 30px; margin: -15px 0 0 -15px;
	transition: transform .45s cubic-bezier(.2, .8, .2, 1.25), opacity .2s ease;
	animation: p-ori-turn 14s linear infinite; filter: drop-shadow(0 3px 6px rgba(0, 60, 100, .25));
}
.p-cursor--logo .p-ori { opacity: 1; transform: none; transition: transform .45s cubic-bezier(.2, .8, .2, 1.3); }
.p-cursor--logo.is-link .p-cursor__ori { transform: scale(1.6); }
.p-cursor--logo.is-link .p-ori--o { transform: translateY(-15%) rotate(-10deg); }
.p-cursor--logo.is-link .p-ori--b { transform: translate(14%, 8%) rotate(10deg); }
.p-cursor--logo.is-link .p-ori--g { transform: translate(-14%, 8%) rotate(-10deg); }
.p-cursor--logo.is-down .p-cursor__ori { transform: scale(.8); }
.p-cursor--logo.is-down .p-ori { transform: none; transition-duration: .15s; }
.p-cursor--logo:is(.is-card, .is-drag) .p-cursor__ori { opacity: 0; }

/* wrap — a dot; the ring takes the shape of the hovered button / link */
.p-cursor--wrap .p-cursor__body { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--c-navy); }
.p-cursor--wrap .p-cursor__ring {
	width: 34px; height: 34px; margin: -17px 0 0 -17px; border: 1.5px solid rgba(0, 96, 145, .35);
	transition: width .4s cubic-bezier(.2, .8, .2, 1), height .4s cubic-bezier(.2, .8, .2, 1), margin .4s cubic-bezier(.2, .8, .2, 1),
		border-radius .4s cubic-bezier(.2, .8, .2, 1), background-color .3s ease, border-color .3s ease, box-shadow .3s ease, opacity .3s ease;
}
.p-cursor--wrap.is-link .p-cursor__ring { border-color: var(--c-sky); background: rgba(0, 171, 229, .07); box-shadow: 0 0 0 5px rgba(0, 171, 229, .08); }

/* crease — a dot leaving a fading fold line (canvas .p-crease) */
.p-crease { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 99999; pointer-events: none; }
.p-cursor--crease .p-cursor__body { width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--c-navy); }
.p-cursor--crease .p-cursor__ring { width: 0; height: 0; margin: 0; border: 1.5px solid transparent; }
.p-cursor--crease.is-link .p-cursor__ring { width: 44px; height: 44px; margin: -22px 0 0 -22px; border-color: var(--c-sky); background: rgba(0, 171, 229, .08); }

/* native — the normal pointer; only the seal and the labelled disc show */
.p-cursor--native .p-cursor__body { display: none; }
.p-cursor--native .p-cursor__ring { width: 0; height: 0; margin: 0; opacity: 0; }
.p-cursor--native:is(.is-btn, .is-card, .is-drag) .p-cursor__ring { opacity: 1; }

/* both — labelled disc on cards and carousels */
.p-cursor.is-card .p-cursor__ring,
.p-cursor.is-drag .p-cursor__ring {
	width: 104px; height: 104px; margin: -52px 0 0 -52px;
	background: rgba(0, 96, 145, .92); border-color: transparent; mix-blend-mode: normal;
	box-shadow: 0 14px 30px -10px rgba(0, 60, 100, .5);
}
.p-cursor.is-card .p-cursor__label,
.p-cursor.is-drag .p-cursor__label { opacity: 1; }
.p-cursor.is-card .p-cursor__body,
.p-cursor.is-drag .p-cursor__body { opacity: 0; }
.p-trail { display: none; }

/* both — over a button the cursor becomes a paper seal: the three pieces of the
   logo fold in from their creases (like origami) and the mark turns slowly */
.p-cursor__ori { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; perspective: 260px; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.p-ori {
	position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; opacity: 0;
	transition: transform .7s cubic-bezier(.22, .9, .25, 1.12), opacity .3s ease;
}
.p-ori--o { transform-origin: 50% 12%; transform: translateY(-16px) rotateX(-180deg) scale(.6); }
.p-ori--b { transform-origin: 87% 70%; transform: translate(14px, 8px) rotateY(180deg) scale(.6); }
.p-ori--g { transform-origin: 15% 74%; transform: translate(-14px, 8px) rotateY(-180deg) scale(.6); }
.p-cursor.is-btn .p-cursor__ring {
	width: 50px; height: 50px; margin: -25px 0 0 -25px; background: #fff; border-color: transparent;
	box-shadow: 0 12px 28px -8px rgba(0, 60, 100, .45), 0 0 0 1px rgba(0, 96, 145, .08);
}
.p-cursor.is-btn .p-cursor__body { opacity: 0; }
.p-cursor.is-btn .p-cursor__ori { opacity: 1; animation: p-ori-turn 9s linear .7s infinite; }
.p-cursor.is-btn .p-ori { transform: none; opacity: 1; }
.p-cursor.is-btn .p-ori--b { transition-delay: .08s; }
.p-cursor.is-btn .p-ori--g { transition-delay: .16s; }
.p-cursor.is-btn.is-down .p-ori { transform: scale(.82); transition-duration: .2s; transition-delay: 0s; }
@keyframes p-ori-turn { to { rotate: 360deg; } }


/* ---------- drag carousels ---------- */
.p-carousel__track.is-draggable { user-select: none; }
.p-carousel__track.is-dragging { scroll-snap-type: none !important; scroll-behavior: auto !important; }
.p-carousel__track.is-dragging a { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
	.p-cursor, .p-loader { display: none !important; }
	.p-fold { --f: 0 !important; }
}

/* ---------- 3D origami stage (stage.js) ---------- */
.p-stage { position: fixed; inset: 0; z-index: 3; pointer-events: none; } /* over the panels; pieces stay on the screen edges */
body.portal-site .p-main,
body.portal-site .p-footer { position: relative; z-index: 1; }
.has-stage .p-contact__decor--end { opacity: 0; } /* the 3D mark lands here */

