/* Motion kit: word-by-word reveals, scroll reveals, intro morphs and ambient motion.
   Built to the house style rules: words fade up from blurred to sharp with a small rise (~70ms stagger),
   shots change through shape morphs, the next shot eases in from 93% to 100%, and something always moves.
   Everything switches off under prefers-reduced-motion. */
:root {
  --m-accent: #0f6b62;
  --m-accent-ink: #fff;
  --m-ease: cubic-bezier(.22, 1, .36, 1);
  --m-ease-io: cubic-bezier(.65, 0, .35, 1);
}

/* ---------- intro: the brand colour fills the frame from the first paint ---------- */
html.m-intro-on::after {
  content: ""; position: fixed; inset: 0; z-index: 2147483000; background: var(--m-accent);
  animation: m-failsafe .4s 4s forwards; /* never leave the page covered if the script fails */
}
@keyframes m-failsafe { to { opacity: 0; visibility: hidden; } }
.m-intro {
  position: fixed; inset: 0; z-index: 2147483001; display: grid; place-items: center;
  background: var(--m-accent); color: var(--m-accent-ink); cursor: pointer;
}
.m-intro-brand {
  font-family: var(--m-font); font-weight: 650; font-size: clamp(30px, 5.6vw, 72px); line-height: 1.05; letter-spacing: -.03em; text-align: center; padding: 0 6vw;
}
.m-intro-brand small { display: block; margin-top: .7em; font-size: .28em; font-weight: 500; letter-spacing: .32em; text-transform: uppercase; opacity: .75; }
.m-intro .m-w { display: inline-block; opacity: 0; filter: blur(12px); translate: 0 .4em; transition: opacity .7s var(--m-ease), filter .7s var(--m-ease), translate .7s var(--m-ease); transition-delay: calc(var(--wi) * 75ms); }
.m-intro.m-go .m-w { opacity: 1; filter: blur(0); translate: 0 0; }
.m-intro.m-leave .m-intro-brand { opacity: 0; scale: 1.04; filter: blur(6px); transition: opacity .45s, scale .6s var(--m-ease), filter .45s; }
/* the dot that squashes (anticipation) then grows into the next shot */
.m-intro-dot { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--m-dot, #fff); scale: 0; }
.m-intro.m-leave .m-intro-dot { animation: m-dot 1.1s var(--m-ease-io) forwards; }
@keyframes m-dot { 0% { scale: 0; } 16% { scale: 1.6; } 24% { scale: 1.75 1.45; } 32% { scale: 1.6; border-radius: 50%; } 100% { scale: 280; border-radius: 34%; } }
/* curtain: two panels part from the middle */
.m-intro-curtain { background: transparent; }
.m-intro-curtain::before, .m-intro-curtain::after { content: ""; position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--m-accent); transition: translate 1s var(--m-ease-io); z-index: -1; }
.m-intro-curtain::before { left: 0; } .m-intro-curtain::after { right: 0; }
.m-intro-curtain.m-leave::before { translate: -101% 0; } .m-intro-curtain.m-leave::after { translate: 101% 0; }
/* wipe: the panel lifts away with a softening edge */
.m-intro-wipe { transition: translate 1s var(--m-ease-io), border-radius 1s var(--m-ease-io); }
.m-intro-wipe.m-leave { translate: 0 -104%; border-bottom-left-radius: 50% 18%; border-bottom-right-radius: 50% 18%; }
/* iris / shutter: a hole opens in the panel (radius driven from JS) */
.m-intro-iris, .m-intro-shutter { -webkit-mask: radial-gradient(circle at 50% 50%, transparent var(--m-r, 0px), #000 calc(var(--m-r, 0px) + 1px)); mask: radial-gradient(circle at 50% 50%, transparent var(--m-r, 0px), #000 calc(var(--m-r, 0px) + 1px)); }
.m-intro-shutter .m-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.m-intro-shutter.m-leave .m-flash { animation: m-flash .5s ease-out; }
@keyframes m-flash { 0% { opacity: 0; } 15% { opacity: .85; } 100% { opacity: 0; } }
.m-intro-shutter .m-blades { position: absolute; width: min(46vmin, 360px); aspect-ratio: 1; opacity: .9; }
.m-intro-shutter .m-blades svg { width: 100%; height: 100%; animation: m-spin 1.6s var(--m-ease) both; }
@keyframes m-spin { from { rotate: -60deg; scale: .85; } to { rotate: 0deg; scale: 1; } }
.m-intro-shutter .m-intro-brand { position: relative; }
.m-stage { transition: scale 1.1s var(--m-ease), opacity .8s var(--m-ease); }
.m-stage.m-pre { scale: .93; opacity: .4; }

/* ---------- word-by-word text ---------- */
.m-split .m-w { display: inline-block; opacity: 0; filter: blur(10px); translate: 0 .42em; transition: opacity .75s var(--m-ease), filter .75s var(--m-ease), translate .75s var(--m-ease); transition-delay: calc(var(--wd, 0ms) + var(--wi) * 70ms); }
.m-split.m-in .m-w { opacity: 1; filter: blur(0); translate: 0 0; }
.m-split.m-done .m-w { filter: none; translate: none; transition: none; }

/* ---------- scroll reveals ---------- */
.m-r { opacity: 0; translate: 0 30px; filter: blur(6px); transition: opacity .9s var(--m-ease), translate .9s var(--m-ease), filter .9s var(--m-ease); transition-delay: var(--rd, 0ms); }
.m-r.m-in { opacity: 1; translate: none; filter: none; }
.m-r.m-left { translate: -40px 0; } .m-r.m-right { translate: 40px 0; }
.m-r.m-in.m-left, .m-r.m-in.m-right { translate: none; }
.m-img { opacity: 0; clip-path: inset(9% 9% 9% 9% round 18px); scale: 1.08; transition: opacity .8s var(--m-ease), clip-path 1.25s var(--m-ease), scale 1.6s var(--m-ease); transition-delay: var(--rd, 0ms); }
.m-img.m-in { opacity: 1; clip-path: inset(0 0 0 0 round 0); scale: 1; }
.m-img.m-done { clip-path: none; scale: none; transition: none; }
.m-grow { scale: 0 1; transform-origin: left center; transition: scale 1.4s var(--m-ease); transition-delay: var(--rd, 200ms); }
.m-grow.m-in { scale: 1 1; }

/* ---------- always-on motion ---------- */
.m-kb { position: absolute; inset: 0; z-index: -1; pointer-events: none; animation: m-kb 26s ease-in-out infinite alternate; will-change: transform; }
.m-kb-img { animation: m-kb 26s ease-in-out infinite alternate; will-change: transform; }
@keyframes m-kb { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.14) translate(-1.6%, -1.2%); } }
.m-host { isolation: isolate; }
.m-host-clip { overflow: hidden; }

.m-progress { position: fixed; left: 0; top: 0; z-index: 2147482000; height: 3px; width: 100%; background: var(--m-accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }

.m-marquee { position: relative; overflow: hidden; background: var(--m-accent); color: var(--m-accent-ink); padding: 16px 0; white-space: nowrap; user-select: none; }
.m-marquee.m-dark { background: #111; color: #fff; }
.m-marquee.m-light { background: transparent; color: inherit; border-block: 1px solid currentColor; border-color: rgba(127,127,127,.25); }
.m-track { display: inline-flex; gap: 2.2em; padding-right: 2.2em; font-weight: 600; font-size: clamp(15px, 1.5vw, 20px); letter-spacing: .06em; text-transform: uppercase; animation: m-marq var(--m-speed, 38s) linear infinite; }
.m-track span { display: inline-flex; align-items: center; gap: 2.2em; }
.m-track span::after { content: "\2726"; font-size: .7em; opacity: .7; }
.m-marquee:hover .m-track { animation-play-state: paused; }
.m-marquee.m-big .m-track { font-size: clamp(34px, 6vw, 84px); letter-spacing: -.01em; font-weight: 800; }
.m-marquee.m-outline { background: transparent; color: var(--m-accent); border-block: 1px solid rgba(127,127,127,.22); }
.m-marquee.m-big.m-outline .m-track { color: transparent; -webkit-text-stroke: 1.5px var(--m-accent); }
.m-marquee.m-big.m-outline .m-track span:nth-child(even) { color: var(--m-accent); -webkit-text-stroke: 0; }
.m-marquee.m-big.m-outline .m-track span::after { color: var(--m-accent); -webkit-text-stroke: 0; }
@keyframes m-marq { to { transform: translateX(-50%); } }

.m-lift { transition: translate .35s var(--m-ease), box-shadow .35s var(--m-ease); }
.m-lift.m-lift:hover { translate: 0 -3px; }
/* elements that both reveal and react to the pointer: keep the reveal transitions, then hand over to hover ones */
.m-r.m-tilt, .m-r.m-lift { transition: opacity .9s var(--m-ease), translate .9s var(--m-ease), filter .9s var(--m-ease), rotate .5s var(--m-ease); transition-delay: var(--rd, 0ms); }
.m-r.m-done { transition: translate .35s var(--m-ease), rotate .5s var(--m-ease), box-shadow .35s var(--m-ease), opacity .3s; transition-delay: 0ms; }
.m-r.m-done.m-tilting { transition: rotate .12s linear, translate .3s var(--m-ease); }
.m-tilt { transition: rotate .5s var(--m-ease), translate .5s var(--m-ease); will-change: rotate; }
.m-tilt.m-tilting { transition: rotate .12s linear, translate .3s var(--m-ease); }

/* ambient layers */
.m-amb { position: absolute; inset: 0; pointer-events: none; z-index: -1; overflow: hidden; }
.m-amb.m-front { z-index: 3; }
.m-amb canvas { width: 100%; height: 100%; display: block; }
.m-glow i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .45; mix-blend-mode: screen; animation: m-drift 18s ease-in-out infinite alternate; }
.m-glow i:nth-child(1) { left: -12%; top: -20%; background: var(--m-g1, #ffb199); }
.m-glow i:nth-child(2) { right: -14%; top: 10%; background: var(--m-g2, #ffd6e8); animation-duration: 23s; animation-delay: -6s; }
.m-glow i:nth-child(3) { left: 25%; bottom: -30%; background: var(--m-g3, #b8e1ff); animation-duration: 27s; animation-delay: -12s; }
@keyframes m-drift { 0% { translate: 0 0; scale: 1; } 50% { translate: 8% 6%; scale: 1.15; } 100% { translate: -6% 10%; scale: .92; } }
.m-breath { display: grid; place-items: center; }
.m-breath .m-rings { position: relative; width: min(70vmin, 620px); aspect-ratio: 1; }
.m-breath .m-rings i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); animation: m-breathe 8s ease-in-out infinite; }
.m-breath .m-rings i:nth-child(2) { inset: 12%; animation-delay: -.6s; border-color: rgba(255, 255, 255, .28); }
.m-breath .m-rings i:nth-child(3) { inset: 24%; animation-delay: -1.2s; border-color: rgba(255, 255, 255, .22); background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%); }
@keyframes m-breathe { 0%, 100% { scale: .78; opacity: .55; } 45%, 55% { scale: 1.06; opacity: 1; } }
.m-breath b { position: absolute; top: 6%; left: 50%; translate: -50% 0; font-family: var(--m-font); font-weight: 500; font-size: 12px; line-height: 1; letter-spacing: .4em; text-transform: uppercase; color: rgba(255, 255, 255, .75); }
.m-waves { top: auto; height: 120px; bottom: -1px; }
.m-waves svg { position: absolute; bottom: 0; width: 200%; height: 100%; animation: m-wave 14s linear infinite; }
.m-waves svg + svg { animation-duration: 22s; animation-direction: reverse; opacity: .6; }
@keyframes m-wave { to { translate: -50% 0; } }
.m-lines i { position: absolute; height: 2px; width: 30vw; background: linear-gradient(90deg, transparent, var(--m-accent), transparent); opacity: .7; animation: m-streak 3.6s linear infinite; }
@keyframes m-streak { from { translate: -40vw 0; } to { translate: 140vw 0; } }

@media (prefers-reduced-motion: reduce) {
  html.m-intro-on::after, .m-intro, .m-amb, .m-progress { display: none !important; }
  .m-split .m-w, .m-r, .m-img, .m-grow { opacity: 1 !important; filter: none !important; translate: none !important; scale: none !important; clip-path: none !important; transition: none !important; }
  .m-kb, .m-kb-img, .m-track { animation: none !important; }
}
