/* Fecomas OS v2.4.0 — premium motion + atmosphere layer.
   Loaded after front.css. Colours come only from the design tokens
   (--fos-primary, --fos-accent, --fos-ink, --fos-canvas, --fos-surface),
   so every preset and custom colour choice still re-themes the site. */

/* ---------- Native cross-document page transitions (Chromium + Safari) ---------- */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
	::view-transition-old(root) { animation: fos-vt-out .42s cubic-bezier(.4, 0, .2, 1) both; }
	::view-transition-new(root) { animation: fos-vt-in .62s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes fos-vt-out { to { opacity: 0; transform: translateY(-14px) scale(.985); } }
@keyframes fos-vt-in { from { opacity: 0; transform: translateY(22px); } }

/* ---------- Fallback page curtain (Firefox and other browsers) ---------- */
.fos-curtain {
	position: fixed; inset: 0; z-index: 9999; pointer-events: none;
	background: linear-gradient(135deg, var(--fos-primary), color-mix(in srgb, var(--fos-primary) 60%, var(--fos-ink)));
	transform: scaleY(0); transform-origin: bottom;
}
.fos-curtain.is-covering { transform: scaleY(1); pointer-events: all; transition: transform .45s cubic-bezier(.7, 0, .2, 1); }
.fos-curtain.is-revealing { transform: scaleY(0); transform-origin: top; transition: transform .7s cubic-bezier(.7, 0, .2, 1); }
.fos-curtain::after {
	content: ""; position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px;
	border-radius: 28px; border: 2px solid color-mix(in srgb, var(--fos-accent) 70%, transparent);
	animation: fos-spin 1.4s linear infinite;
}
@keyframes fos-spin { to { transform: rotate(360deg); } }

/* ---------- Shared keyframes ---------- */
@keyframes fos-float {
	0%, 100% { transform: translate3d(0, 0, 0); }
	50% { transform: translate3d(0, -18px, 0); }
}
@keyframes fos-rise {
	from { opacity: 0; transform: translateY(42px) rotate(1.5deg); filter: blur(6px); }
	to { opacity: 1; transform: none; filter: none; }
}
@keyframes fos-shimmer { to { background-position: -200% 0; } }
@keyframes fos-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* ---------- Container stacking above decorative layers ---------- */
.fos-section { position: relative; overflow: clip; }
.fos-section > .fos-container,
#fos-hero > .fos-container,
#fos-hero .fos-hero__inner { position: relative; z-index: 1; }

/* ---------- Decorative blobs used by every section (rendered by PHP) ---------- */
.fos-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.fos-deco i {
	position: absolute; border-radius: 50%; filter: blur(70px); opacity: .9;
}
.fos-deco i:nth-child(1) { width: 440px; height: 440px; left: -160px; top: -140px; background: color-mix(in srgb, var(--fos-accent) 22%, transparent); }
.fos-deco i:nth-child(2) { width: 380px; height: 380px; right: -150px; bottom: -160px; background: color-mix(in srgb, var(--fos-primary) 18%, transparent); }
.fos-deco i:nth-child(3) { width: 240px; height: 240px; left: 46%; top: 38%; background: color-mix(in srgb, var(--fos-accent) 12%, transparent); }
@media (prefers-reduced-motion: no-preference) {
	.fos-deco i { animation: fos-float 16s ease-in-out infinite alternate; }
	.fos-deco i:nth-child(2) { animation-duration: 19s; animation-delay: -6s; }
	.fos-deco i:nth-child(3) { animation-duration: 13s; animation-delay: -10s; }
}

/* ---------- Hero: aurora, grid and float ---------- */
#fos-hero:not(.fos-hero--immersive) {
	position: relative; overflow: clip;
	background:
		radial-gradient(55% 60% at 88% 8%, color-mix(in srgb, var(--fos-accent) 22%, transparent), transparent 68%),
		radial-gradient(50% 55% at 6% 96%, color-mix(in srgb, var(--fos-primary) 16%, transparent), transparent 70%),
		var(--fos-canvas);
}
#fos-hero:not(.fos-hero--immersive)::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image:
		linear-gradient(color-mix(in srgb, var(--fos-ink) 6%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in srgb, var(--fos-ink) 6%, transparent) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 75%);
	        mask-image: radial-gradient(ellipse at 50% 0%, #000 25%, transparent 75%);
}
#fos-hero:not(.fos-hero--immersive)::after {
	content: ""; position: absolute; width: 560px; height: 560px; right: -170px; top: -190px;
	border-radius: 50%; pointer-events: none;
	background: radial-gradient(circle, color-mix(in srgb, var(--fos-accent) 30%, transparent), transparent 66%);
	filter: blur(14px);
}
@media (prefers-reduced-motion: no-preference) {
	#fos-hero:not(.fos-hero--immersive)::after { animation: fos-float 14s ease-in-out infinite alternate; }
	.fos-hero__title-line { display: inline-block; animation: fos-rise 1s cubic-bezier(.2, .7, .2, 1) both; }
	.fos-hero__title-line:nth-child(2) { animation-delay: .12s; }
	.fos-hero__title-line:nth-child(3) { animation-delay: .24s; }
	.fos-hero__title-line:nth-child(4) { animation-delay: .36s; }
	.fos-hero__title-line.is-accent {
		background-image: linear-gradient(100deg, var(--fos-accent) 0%, color-mix(in srgb, var(--fos-accent) 45%, #fff) 45%, var(--fos-accent) 90%);
		background-size: 220% 100%;
		-webkit-background-clip: text; background-clip: text; color: transparent;
		animation: fos-rise 1s cubic-bezier(.2, .7, .2, 1) both, fos-shimmer 5s linear 1.2s infinite;
	}
	.fos-hero__visual-frame { animation: fos-float 9s ease-in-out infinite; }
	.fos-hero__bars i { animation: fos-pulse 2.6s ease-in-out infinite; }
	.fos-hero__bars i:nth-child(2) { animation-delay: .3s; }
	.fos-hero__bars i:nth-child(3) { animation-delay: .6s; }
	.fos-hero__bars i:nth-child(4) { animation-delay: .9s; }
	.fos-hero__bars i:nth-child(5) { animation-delay: 1.2s; }
	.fos-hero__bars i:nth-child(6) { animation-delay: 1.5s; }
}

/* ---------- Section atmospheres (each section gets its own backdrop) ---------- */
#fos-about {
	background:
		radial-gradient(45% 55% at 100% 0%, color-mix(in srgb, var(--fos-accent) 12%, transparent), transparent 70%),
		linear-gradient(180deg, var(--fos-canvas), color-mix(in srgb, var(--fos-primary) 7%, var(--fos-canvas)));
}
#fos-services, #fos-featured, #fos-team, #fos-blog {
	background:
		radial-gradient(60% 50% at 100% 0%, color-mix(in srgb, var(--fos-accent) 14%, transparent), transparent 70%),
		radial-gradient(50% 45% at 0% 100%, color-mix(in srgb, var(--fos-primary) 10%, transparent), transparent 70%),
		var(--fos-canvas);
}
#fos-projects, #fos-technologies, #fos-why {
	background-image:
		radial-gradient(color-mix(in srgb, var(--fos-primary) 13%, transparent) 1px, transparent 1px),
		linear-gradient(160deg, color-mix(in srgb, var(--fos-accent) 9%, var(--fos-canvas)), var(--fos-canvas) 62%);
	background-size: 24px 24px, 100% 100%;
}
#fos-testimonials {
	background: linear-gradient(180deg, color-mix(in srgb, var(--fos-primary) 9%, var(--fos-canvas)), var(--fos-canvas) 80%);
}
#fos-stats, #fos-process, #fos-cta {
	color: #fff;
	background:
		radial-gradient(60% 70% at 92% 0%, color-mix(in srgb, var(--fos-accent) 32%, transparent), transparent 70%),
		radial-gradient(50% 60% at 0% 100%, color-mix(in srgb, var(--fos-accent) 14%, transparent), transparent 70%),
		linear-gradient(135deg, var(--fos-primary), color-mix(in srgb, var(--fos-primary) 62%, var(--fos-ink)));
}
#fos-stats::before, #fos-process::before, #fos-cta::before {
	content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
	background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
	        mask-image: linear-gradient(180deg, #000, transparent 85%);
}
#fos-stats :is(h2, h3, strong, .fos-stat__value), #fos-process :is(h2, h3, .fos-h2, .fos-card__title, .fos-process__step h3), #fos-cta :is(h2, h3) { color: #fff; }
#fos-stats :is(p, .fos-stat__label, .fos-lead), #fos-process :is(.fos-lead, .fos-card__text, .fos-process__step p), #fos-cta p { color: rgba(255, 255, 255, .8); }
#fos-process .fos-eyebrow, #fos-stats .fos-stat__index { color: var(--fos-accent); }
#fos-process .fos-card, #fos-process .fos-process__step {
	background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14);
	backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
#fos-process .fos-step__badge { background: var(--fos-accent); color: var(--fos-primary); }

/* ---------- Stats band: glass counters with icons ---------- */
#fos-stats .fos-stats { background: transparent; border: 0; gap: 18px; }
#fos-stats .fos-stat {
	background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
	border-radius: var(--fos-radius); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
	padding: 32px 26px; overflow: hidden; transition: transform .5s cubic-bezier(.2, .7, .2, 1), background .5s ease;
}
#fos-stats .fos-stat:hover { transform: translateY(-6px); background: rgba(255, 255, 255, .13); }
#fos-stats .fos-stat__value { font-size: clamp(2.3rem, 4.4vw, 3.3rem); font-variant-numeric: tabular-nums; }
.fos-stat__icon {
	display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; margin-bottom: 10px;
	background: var(--fos-accent); color: var(--fos-primary);
}
.fos-stat__icon .fos-icon { width: 22px; height: 22px; }
#fos-stats .fos-stat::after {
	content: ""; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--fos-accent) 35%, transparent), transparent 70%);
}

/* ---------- Icons: everywhere ---------- */
.fos-icon { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.fos-card:hover .fos-card__icon .fos-icon,
.fos-about__pillar:hover .fos-icon,
.fos-contact-option:hover .fos-icon,
.fos-stat:hover .fos-stat__icon .fos-icon { transform: rotate(-10deg) scale(1.12); }
.fos-eyebrow__icon {
	display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; margin-right: 8px;
	border-radius: 7px; background: color-mix(in srgb, var(--fos-accent) 18%, transparent); color: var(--fos-accent);
	vertical-align: -5px;
}
.fos-eyebrow__icon .fos-icon { width: 13px; height: 13px; }
.fos-btn__arrow { display: inline-flex; width: 1.05em; height: 1.05em; margin-left: .5em; transition: transform .35s cubic-bezier(.2, .7, .2, 1); }
.fos-btn__arrow .fos-icon { width: 100%; height: 100%; }
.fos-btn:hover .fos-btn__arrow { transform: translateX(4px); }
.fos-quote__mark {
	display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 14px;
	background: color-mix(in srgb, var(--fos-accent) 16%, transparent); color: var(--fos-accent);
}
.fos-quote__mark .fos-icon { width: 20px; height: 20px; }
.fos-stars { display: flex; gap: 4px; }
.fos-stars .fos-icon { width: 16px; height: 16px; fill: var(--fos-accent); stroke: var(--fos-accent); }

/* ---------- Cards: follow-the-cursor glow + tilt ---------- */
.fos-card { position: relative; overflow: hidden; transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease, border-color .5s ease, background .5s ease; }
.fos-card__glow {
	background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--fos-accent) 24%, transparent), transparent 62%);
}
.fos-card__icon {
	display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 15px;
	background: color-mix(in srgb, var(--fos-accent) 14%, transparent); color: var(--fos-accent);
}
.fos-card__icon .fos-icon { width: 24px; height: 24px; }

/* ---------- Buttons: magnetic lift + sheen ---------- */
.fos-btn { position: relative; overflow: hidden; transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease, background .35s ease; }
.fos-btn::after {
	content: ""; position: absolute; top: 0; left: -75%; width: 50%; height: 100%; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent); transform: skewX(-20deg);
}
.fos-btn:hover::after { animation: fos-sheen .8s ease; }
@keyframes fos-sheen { to { left: 130%; } }
.fos-btn:hover { box-shadow: 0 16px 34px -14px color-mix(in srgb, var(--fos-accent) 70%, transparent); }

/* ---------- Testimonials ---------- */
.fos-quote { position: relative; overflow: hidden; transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease; }
.fos-quote::before {
	content: ""; position: absolute; right: -30px; top: -30px; width: 130px; height: 130px; border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--fos-accent) 14%, transparent), transparent 70%); pointer-events: none;
}

/* ---------- Reveal: richer entrance (overrides the basic fade in front.css) ---------- */
@media (prefers-reduced-motion: no-preference) {
	[data-fos-reveal] { opacity: 0; transform: translateY(34px) scale(.98); filter: blur(8px); }
	[data-fos-reveal].is-in {
		opacity: 1; transform: none; filter: none;
		transition: opacity .9s cubic-bezier(.2, .7, .2, 1), transform .9s cubic-bezier(.2, .7, .2, 1), filter .9s ease;
	}
}

/* ---------- Counters: keep numbers tidy while they count ---------- */
[data-fos-count] { font-variant-numeric: tabular-nums; }

/* ---------- Mobile: lighter motion for smaller devices ---------- */
@media (max-width: 720px) {
	.fos-deco i { filter: blur(50px); }
	#fos-hero:not(.fos-hero--immersive)::after { width: 360px; height: 360px; }
}
