/* ==========================================================================
   Nexa – motion
   All effects are progressive: without JS (no .js class) or with
   "reduce motion" enabled, content is simply shown.
   ========================================================================== */

:root {
	--anim-dur: 1s;
	--anim-ease: cubic-bezier(.16, 1, .3, 1);
	--anim-shift: 34px;
}

/* ---------- Page load ---------------------------------------------------- */
.js .site-header, .js .topbar { transform: translateY(-100%); }
.js.is-loaded .site-header { transform: none; }
.js.is-loaded .topbar { transform: none; }
.js.is-loaded.is-scrolled-page .topbar { transform: translateY(-100%); }

.js .hero-content > *,
.js .page-hero .container > *,
.js .hero-intro > *,
.js .entry-content > .alcair-hero .alcair-hero__content > * {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity 1.1s var(--anim-ease), transform 1.1s var(--anim-ease);
}
.js.is-loaded .hero-content > *,
.js.is-loaded .page-hero .container > *,
.js.is-loaded .hero-intro > *,
.js.is-loaded .entry-content > .alcair-hero .alcair-hero__content > * { opacity: 1; transform: none; }
.js.is-loaded .hero-content > :nth-child(1), .js.is-loaded .hero-intro > :nth-child(1), .js.is-loaded .page-hero .container > :nth-child(1), .js.is-loaded .alcair-hero__content > :nth-child(1) { transition-delay: .25s; }
.js.is-loaded .hero-content > :nth-child(2), .js.is-loaded .hero-intro > :nth-child(2), .js.is-loaded .page-hero .container > :nth-child(2), .js.is-loaded .alcair-hero__content > :nth-child(2) { transition-delay: .4s; }
.js.is-loaded .hero-content > :nth-child(3), .js.is-loaded .hero-intro > :nth-child(3), .js.is-loaded .page-hero .container > :nth-child(3), .js.is-loaded .alcair-hero__content > :nth-child(3) { transition-delay: .55s; }
.js.is-loaded .hero-content > :nth-child(n + 4), .js.is-loaded .hero-intro > :nth-child(n + 4), .js.is-loaded .page-hero .container > :nth-child(n + 4), .js.is-loaded .alcair-hero__content > :nth-child(n + 4) { transition-delay: .7s; }

/* Hero image: soft zoom-out + fade in on load, gentle parallax on scroll (JS). */
.js .hero-media { opacity: 0; transition: opacity 1.4s ease; will-change: transform; }
.js.is-loaded .hero-media { opacity: 1; }

/* Inner page hero media: photo opens from the bottom, quick-facts card slides in. */
.js .hero-intro-media > img,
.js .hero-intro-media > .dband__img { clip-path: inset(100% 0 0 0); transition: clip-path 1.4s var(--anim-ease) .35s; }
.js.is-loaded .hero-intro-media > img,
.js.is-loaded .hero-intro-media > .dband__img { clip-path: inset(0 0 0 0); }
.js .hero-intro-media .dhero__float { opacity: 0; translate: 0 20px; transition: opacity .9s var(--anim-ease) 1.1s, translate .9s var(--anim-ease) 1.1s; }
.js.is-loaded .hero-intro-media .dhero__float { opacity: 1; translate: 0 0; }
.js .hero-intro-late { opacity: 0; transform: translateX(40px); transition: opacity 1.1s var(--anim-ease) .5s, transform 1.1s var(--anim-ease) .5s; }
.js.is-loaded .hero-intro-late { opacity: 1; transform: none; }
.js .dhero__bg { opacity: 0; transition: opacity 1.6s ease; }
.js.is-loaded .dhero__bg { opacity: .26; }

/* ---------- Scroll reveal ------------------------------------------------ */
.js [data-anim] {
	opacity: 0;
	transition: opacity var(--anim-dur) var(--anim-ease), transform var(--anim-dur) var(--anim-ease), clip-path 1.2s var(--anim-ease);
	transition-delay: var(--anim-delay, 0ms);
}
.js [data-anim="up"]    { transform: translateY(var(--anim-shift)); }
.js [data-anim="left"]  { transform: translateX(calc(var(--anim-shift) * -1.4)); }
.js [data-anim="right"] { transform: translateX(calc(var(--anim-shift) * 1.4)); }
.js [data-anim="zoom"]  { transform: scale(.94); }
.js [data-anim="fade"]  { transform: none; }

/* Image wipe: the picture opens from bottom to top and settles from a zoom.
   The clip is applied to the children, so the observed frame itself stays measurable. */
.js [data-anim="wipe"] { opacity: 1; transform: none; }
.js [data-anim="wipe"] > * {
	clip-path: inset(100% 0 0 0);
	transition: clip-path 1.2s var(--anim-ease), transform 1.6s var(--anim-ease);
	transition-delay: var(--anim-delay, 0ms);
}
.js [data-anim="wipe"] img { transform: scale(1.18); }

.js [data-anim].is-visible { opacity: 1; transform: none; }
.js [data-anim="wipe"].is-visible > * { clip-path: inset(0 0 0 0); }
.js [data-anim="wipe"].is-visible img { transform: scale(1); }

/* Headings: a thin line draws under section eyebrows. */
.js .eyebrow[data-anim]::after {
	content: ""; display: block; width: 28px; height: 1px; margin-top: 12px;
	background: currentColor; opacity: .5;
	transform: scaleX(0); transform-origin: left;
	transition: transform 1s var(--anim-ease) .3s;
}
.hero .eyebrow::after, .cta .eyebrow::after { display: none !important; }
.js .eyebrow[data-anim].is-visible::after { transform: scaleX(1); }


/* Buttons & cards micro-interactions */
.btn, .slider-btn, .play-btn__circle, .featured-card { will-change: transform; }
.btn:active { transform: scale(.97); }
.featured-card { transition: transform .5s var(--anim-ease), box-shadow .5s var(--anim-ease); }
.featured-card:hover { transform: translateY(-4px); box-shadow: 0 28px 60px rgba(0, 0, 0, .18); }
.service-card { transition: background-color .4s; }
.post-card, .project-card { transition: transform .5s var(--anim-ease); }
.post-card:hover, .project-card:hover { transform: translateY(-4px); }
.entry-content .alcair-related__card { transition: transform .5s var(--anim-ease), opacity .5s; }
.entry-content .alcair-related__card:hover { transform: translateY(-4px); }

/* Scroll progress bar under the header */
.scroll-progress {
	position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%;
	background: var(--c-ink);
	transform: scaleX(var(--progress, 0)); transform-origin: left;
	pointer-events: none;
}

/* ---------- Reduced motion ---------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.js .site-header, .js .topbar,
	.js .hero-media,
	.js .hero-content > *,
	.js .page-hero .container > *,
	.js .alcair-hero__content > *,
	.js .hero-intro > *, .js .hero-intro-late, .js .hero-intro-media > img, .js .hero-intro-media > .dband__img, .js .hero-intro-media .dhero__float,
	.js [data-anim],
	.js [data-anim] img, .js [data-anim] > * { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
	.scroll-progress { display: none; }
}

/* Keep hover zooms working after an image has been revealed. */
.js .project-card__link:hover .project-card__media.is-visible img,
.js .post-card__media.is-visible:hover img { transform: scale(1.05); transition-duration: .8s; transition-delay: 0ms; }
.js .about-media.is-visible:hover img { transform: scale(1.03); transition-duration: .8s; transition-delay: 0ms; }
