/* MorrMedia v3 motion vocabulary — driven by motion.js (sets --p, --page, --dist, data-shown). */
@property --mxc { syntax: '<integer>'; initial-value: 0; inherits: false; }
:root { --mx-ease: cubic-bezier(.2,.8,.2,1); --mx-snap: cubic-bezier(.77,0,.18,1); }
html { scroll-behavior: smooth; }

/* Cursor + hover preview */
.mx-dot { position: fixed; left: 0; top: 0; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; mix-blend-mode: difference; pointer-events: none; z-index: 10001; transition: scale .2s; opacity: 0; }
.mx-ring { position: fixed; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 1px solid #fff; mix-blend-mode: difference; pointer-events: none; z-index: 10000; opacity: 0; transition: background-color .35s, opacity .3s; will-change: transform; }
.mx-ring.is-link { background: rgba(255,255,255,.14); }
.mx-trail { position: fixed; inset: 0; pointer-events: none; z-index: 9998; mix-blend-mode: difference; }
.mx-pill { position: fixed; left: 0; top: 0; z-index: 10002; pointer-events: none; padding: 9px 14px 8px; border-radius: 999px; background: #F5F5F2; color: #000; font: 500 11px/1 'Geist Mono', ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 10px 30px rgba(0,0,0,.28); opacity: 0; scale: .6; transform-origin: 0 0; transition: opacity .25s, scale .45s cubic-bezier(.34,1.56,.64,1); }
.mx-pill.on { opacity: 1; scale: 1; }
html.mx-cursor-on .mx-dot, html.mx-cursor-on .mx-ring { opacity: 1; }
.mx-preview { position: fixed; left: 0; top: 0; width: min(28vw, 400px); aspect-ratio: 4/3; pointer-events: none; z-index: 40; border-radius: 12px; overflow: hidden; background: #111; transform-style: preserve-3d; clip-path: inset(50% 50% 50% 50% round 12px); opacity: 0; transition: clip-path .7s cubic-bezier(.16,1,.3,1), opacity .4s, box-shadow .6s; box-shadow: 0 2px 0 rgba(255,255,255,.08) inset, 0 30px 60px -18px rgba(0,0,0,.7), 0 50px 120px -40px var(--pv-glow, rgba(255,255,255,.3)); }
.mx-preview.on { clip-path: inset(0 0 0 0 round 12px); opacity: 1; }
.mx-preview img { position: absolute; inset: -8%; width: 116%; height: 116%; object-fit: cover; display: block; transform: scale(1.18); transition: transform 1.1s cubic-bezier(.16,1,.3,1); }
.mx-preview.on img { transform: scale(1); }
.mx-preview-glare { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; }
.mx-preview::after { content: ''; position: absolute; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); pointer-events: none; }
html.mx-has-cursor body, html.mx-has-cursor a, html.mx-has-cursor button { cursor: none; }
@media (pointer: coarse) { .mx-dot, .mx-ring, .mx-preview, .mx-trail, .mx-pill { display: none; } }
[data-magnetic] { display: inline-flex; transition: translate .6s var(--mx-ease); }

/* Page curtain */
.mx-curtain { position: fixed; inset: 0; z-index: 9000; background: #000; display: grid; place-items: center; transform: translateY(100%); pointer-events: none; }
.mx-curtain::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(255,255,255,.4); }
.mx-curtain.cover { transform: translateY(0); }
.mx-curtain.in { transform: translateY(0); transition: transform .6s var(--mx-snap); }
.mx-curtain.out { transform: translateY(-100%); transition: transform .8s var(--mx-snap) .1s; }
.mx-curtain { place-content: center; justify-items: center; gap: 28px; }
.mx-curtain-mark { display: block; width: clamp(88px, 11vw, 150px); aspect-ratio: 222 / 208; background: #fff; -webkit-mask: url("../assets/mm-logo-white.png") center / contain no-repeat; mask: url("../assets/mm-logo-white.png") center / contain no-repeat; }
.mx-curtain-label { font: 600 11px/1 'Geist Mono', ui-monospace, monospace !important; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.6) !important; min-height: 1em; }
.mx-curtain.in .mx-curtain-mark { animation: mx-mark-in .62s cubic-bezier(.16,1,.3,1) .08s both; }
.mx-curtain.in .mx-curtain-label { animation: mx-fade-in .4s ease .3s both; }
.mx-curtain.cover .mx-curtain-mark { opacity: 1; }
.mx-curtain.out .mx-curtain-mark { animation: mx-mark-out .5s cubic-bezier(.7,0,.84,0) both; }
.mx-curtain.out .mx-curtain-label { opacity: 0; transition: opacity .2s; }
@keyframes mx-mark-in { from { opacity: 0; transform: scale(1.18); filter: blur(14px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes mx-mark-out { from { opacity: 1; transform: none; filter: blur(0); } to { opacity: 0; transform: scale(.9); filter: blur(8px); } }
@keyframes mx-fade-in { from { opacity: 0; } to { opacity: 1; } }
/* Footer easter egg: a quiet mark that opens the brand room */
.mx-egg { display: inline-flex; align-items: center; gap: 10px; opacity: .28; transition: opacity .4s, translate .6s var(--mx-ease); }
.mx-egg i { display: block; width: 18px; aspect-ratio: 222 / 208; background: currentColor; -webkit-mask: url("../assets/mm-logo-white.png") center / contain no-repeat; mask: url("../assets/mm-logo-white.png") center / contain no-repeat; }
.mx-egg b { font-weight: 600; max-width: 0; overflow: hidden; white-space: nowrap; transition: max-width .6s var(--mx-ease); }
.mx-egg:hover, .mx-egg:focus-visible { opacity: 1; }
.mx-egg:hover b, .mx-egg:focus-visible b { max-width: 12em; }

/* Preloader (home) */
.mx-pre { position: fixed; inset: 0; z-index: 9500; background: #030307; color: #F2F4F8; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(20px, 4vw, 48px); animation: mx-pre-out 1.1s var(--mx-snap) 1.25s forwards; pointer-events: none; }
.mx-pre-n { --mxc: 0; counter-reset: c var(--mxc); animation: mx-pre-count 1.1s cubic-bezier(.65,0,.25,1) .05s forwards; }
.mx-pre-n::after { content: counter(c); }
.mx-pre-bar { height: 2px; background: linear-gradient(90deg, #00F0FF, #FCEE0A); transform-origin: left; transform: scaleX(0); animation: mx-bar 1.1s cubic-bezier(.65,0,.25,1) .05s forwards; }
@keyframes mx-pre-count { to { --mxc: 100; } }
@keyframes mx-bar { to { transform: scaleX(1); } }
@keyframes mx-pre-out { to { transform: translateY(-100%); visibility: hidden; } }

/* Line rise on load: <span class="mx-rise" style="--d:.1"><span>Text</span></span> */
.mx-rise { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .04em; }
.mx-rise > * { display: inline-block; animation: mx-up 1.3s cubic-bezier(.16,1,.3,1) both; animation-delay: calc(var(--base, 0s) + var(--d, 0) * 1s); }
@keyframes mx-up { from { transform: translateY(105%); } to { transform: none; } }
/* Hero window: settles in on load, independent of the scroll-driven clip */
.mx-intro { animation: mx-win 1.8s cubic-bezier(.16,1,.3,1) both; animation-delay: var(--base, 0s); }
@keyframes mx-win { from { transform: scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }

/* Scroll reveal (only when JS runs) */
.mx-js [data-in] { opacity: 0; transform: translateY(28px); transition: opacity 1.2s cubic-bezier(.16,1,.3,1), transform 1.2s cubic-bezier(.16,1,.3,1); }
.mx-js [data-in][data-shown] { opacity: 1; transform: none; }
.mx-js [data-in].mx-clip { opacity: 1; transform: none; overflow: hidden; clip-path: circle(0% at 50% 62%); border-radius: 48% 52% 61% 39% / 44% 58% 42% 56%; transition: clip-path 1.7s cubic-bezier(.65,0,.35,1), border-radius 2.4s cubic-bezier(.65,0,.35,1) .15s; }
.mx-js [data-in].mx-clip[data-shown] { clip-path: circle(75% at 50% 50%); border-radius: 0; }
/* Organic hero window: a living blob (morphing radius + slow spin) that grows with scroll; the image counter-spins so it stays level */
.mx-blob { inset: auto !important; left: 50% !important; top: 50% !important; width: calc(48vmin + var(--q, 0) * 240vmax); height: calc(48vmin + var(--q, 0) * 240vmax); margin: calc((48vmin + var(--q, 0) * 240vmax) / -2) 0 0 calc((48vmin + var(--q, 0) * 240vmax) / -2); overflow: hidden; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; animation: mx-morph 12s ease-in-out infinite, mx-spin 46s linear infinite; will-change: border-radius, rotate; }
.mx-intro .mx-blob > img { position: absolute; left: 50%; top: 50%; width: 100vw !important; height: 100vh !important; max-width: none; margin: -50vh 0 0 -50vw; animation: mx-kb 22s ease-in-out infinite alternate, mx-unspin 46s linear infinite; }
@keyframes mx-morph { 0%, 100% { border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; } 25% { border-radius: 58% 42% 38% 62% / 55% 61% 39% 45%; } 50% { border-radius: 36% 64% 52% 48% / 62% 38% 62% 38%; } 75% { border-radius: 61% 39% 47% 53% / 40% 57% 43% 60%; } }
@keyframes mx-spin { to { rotate: 360deg; } }
@keyframes mx-unspin { to { rotate: -360deg; } }
.mx-para { overflow: hidden; }
.mx-para > img { transform: translateY(calc((var(--p, .5) - .5) * -12%)) scale(1.18); will-change: transform; }

/* Word sweep: container has data-p + --wn; words .w carry --i */
.mx-sweep .w { --x: clamp(0, calc((var(--p) * 1.9 - .35) * var(--wn) - var(--i)), 1); opacity: calc(.14 + var(--x) * .86); background: linear-gradient(var(--hl, transparent), var(--hl, transparent)) no-repeat 0 var(--hlp, 90%) / calc(var(--x) * 100%) var(--hlh, .28em); }

/* Count-up: <span class="mx-count" style="--t:26"> inside a [data-in] */
.mx-count { --mxc: 0; counter-reset: c var(--mxc); transition: --mxc 2s cubic-bezier(.2,.7,0,1); }
.mx-count::after { content: counter(c); }
[data-shown] .mx-count { --mxc: var(--t); }

/* Horizontal track inside a pinned host */
.mx-track { display: flex; transform: translateX(calc(var(--p, 0) * var(--dist, 0px) * -1)); will-change: transform; }

/* Marquee + ticker */
.mx-marquee { display: flex; width: max-content; animation: mx-mq var(--dur, 32s) linear infinite; }
.mx-marquee:hover { animation-play-state: paused; }
@keyframes mx-mq { to { transform: translateX(-50%); } }
.mx-ticker { display: inline-block; height: 1.04em; overflow: hidden; vertical-align: bottom; }
.mx-ticker > span { display: flex; flex-direction: column; animation: mx-tick 8s var(--mx-snap) infinite; }
.mx-ticker > span > span { height: 1.04em; line-height: 1.04em; }
@keyframes mx-tick { 0%,20% { transform: translateY(0); } 25%,45% { transform: translateY(-1.04em); } 50%,70% { transform: translateY(-2.08em); } 75%,95% { transform: translateY(-3.12em); } 100% { transform: translateY(-4.16em); } }
@keyframes mx-scrollcue { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
.mx-cue { display: block; width: 1px; height: 48px; background: #F2F4F8; animation: mx-scrollcue 1.8s var(--mx-ease) infinite; }

/* Work rows */
.mx-row .mx-row-title { transition: transform .7s var(--mx-ease), color .4s; }
.mx-row .mx-row-bar { transform: scaleX(0); transform-origin: left; transition: transform .8s var(--mx-ease); }
.mx-row .mx-row-arrow { transform: translateX(-12px) rotate(-45deg); opacity: 0; transition: transform .6s var(--mx-ease), opacity .4s; }
.mx-row:hover .mx-row-title { transform: translateX(clamp(12px, 2vw, 32px)); color: var(--row-accent, #00F0FF); }
.mx-row:hover .mx-row-bar { transform: scaleX(1); }
.mx-row:hover .mx-row-arrow { transform: none; opacity: 1; }
.mx-row-thumb { display: none; }
/* Touch: rows light up as they cross the screen centre; press feedback everywhere */
@media (pointer: coarse) {
  .mx-row-thumb { display: block; }
  .mx-row[data-centered] .mx-row-title { transform: translateX(10px); color: var(--row-accent, #00F0FF); }
  .mx-row[data-centered] .mx-row-bar { transform: scaleX(1); }
  .mx-row[data-centered] .mx-row-arrow { transform: none; opacity: 1; }
  .mx-row[data-centered] .mx-row-thumb img { transform: scale(1); filter: none; }
  a, button { -webkit-tap-highlight-color: transparent; transition: scale .25s var(--mx-ease); }
  a:active, button:active { scale: .97; }
}
.mx-row-thumb img { transform: scale(1.15); filter: grayscale(1) brightness(.7); transition: transform 1s var(--mx-ease), filter .6s; }

/* Case-study minimap */
.mx-minimap { display: flex; }
@media (max-width: 960px) { .mx-minimap { display: none; } }

/* Cinematic layer */
.mx-grain { position: absolute; inset: -50%; pointer-events: none; z-index: 6; opacity: .09; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); animation: mx-grain .9s steps(6) infinite; }
@keyframes mx-grain { 0% { transform: translate(0,0); } 20% { transform: translate(-5%,3%); } 40% { transform: translate(4%,-6%); } 60% { transform: translate(-3%,5%); } 80% { transform: translate(6%,2%); } 100% { transform: translate(0,0); } }
.mx-intro img { animation: mx-kb 22s ease-in-out infinite alternate; }
@keyframes mx-kb { from { scale: 1; translate: 0 0; } to { scale: 1.08; translate: -1.6% -1.2%; } }
.mx-rec { animation: mx-blink 1.2s steps(2) infinite; }
.mx-wide { display: flex; }
@media (max-width: 1100px) { .mx-wide { display: none; } }
@keyframes mx-blink { 50% { opacity: .2; } }

/* Mobile layer */
html.mx-pre-seen .mx-pre { display: none; }
html.mx-pre-seen .mx-rise > * { animation-delay: calc(.1s + var(--d, 0) * 1s); }
html.mx-pre-seen .mx-intro { animation-delay: 0s; }
@media (max-width: 720px) {
  .mx-row { grid-template-columns: 56px minmax(0,1fr) !important; align-items: start !important; row-gap: 12px !important; }
  .mx-row .mx-row-thumb { display: block; }
  .mx-row-meta { grid-column: 2; justify-self: start; }
  .mx-row-meta > span:first-child { flex-direction: row !important; flex-wrap: wrap; align-items: baseline !important; gap: 4px 14px !important; text-align: left !important; }
  .mx-row-meta .mx-row-arrow { display: none; }
  .mx-ch-aside { position: static !important; }
  .mx-hide-sm { display: none !important; }
}
/* Touch: every nav / footer / link-row target gets an invisible 44px+ hit area without moving the layout */
.mx-touch-only { display: none; }
@media (pointer: coarse) {
  .mx-touch-only { display: flex; }
  nav a, footer a, header a, .mx-tap a, nav button, footer button { position: relative; }
  nav a::before, footer a::before, header a::before, .mx-tap a::before { content: ''; position: absolute; inset: -14px -8px; }
  .mx-curtain.in { transition-duration: .42s; }
}
@keyframes mx-turn { 0%, 18% { transform: rotate(0); } 40%, 64% { transform: rotate(-90deg); } 86%, 100% { transform: rotate(0); } }
.mx-phone { display: inline-block; flex: none; width: 12px; height: 20px; border: 1.5px solid currentColor; border-radius: 3px; animation: mx-turn 3.2s cubic-bezier(.65,0,.35,1) infinite; }
@media (prefers-reduced-motion: reduce) { .mx-phone { animation: none; transform: rotate(-90deg); } }

/* Hit areas (motion.js adds .mx-hit to small static links) */
.mx-hit { position: relative; }
.mx-hit::before { content: ''; position: absolute; inset: -10px -6px; }
@media (pointer: coarse) { .mx-hit::before { inset: -14px -8px; } }

/* Glass nav (motion.js tags fixed top bars with data-glass and toggles html.mx-scrolled) */
[data-glass] { transition: background-color .5s var(--mx-ease), box-shadow .5s var(--mx-ease), -webkit-backdrop-filter .5s, backdrop-filter .5s; }
[data-glass]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none; opacity: 0; transition: opacity .6s; background: linear-gradient(90deg, transparent, rgba(139,92,246,.55) 25%, rgba(94,234,212,.5) 60%, transparent); }
html.mx-scrolled [data-glass] { mix-blend-mode: normal !important; -webkit-backdrop-filter: blur(18px) saturate(1.7) hue-rotate(-10deg); backdrop-filter: blur(18px) saturate(1.7) hue-rotate(-10deg); }
html.mx-scrolled [data-glass]::after { opacity: 1; }
html.mx-scrolled [data-glass="dark"] { background: linear-gradient(100deg, rgba(139,92,246,.07), rgba(94,234,212,.05) 55%, rgba(255,255,255,.02)), rgba(8,8,10,.64) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
html.mx-scrolled [data-glass="light"] { background: linear-gradient(100deg, rgba(139,92,246,.06), rgba(94,234,212,.05) 55%, rgba(255,255,255,0)), rgba(250,249,246,.74) !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.5); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html.mx-scrolled [data-glass="dark"] { background: rgba(8,8,10,.94) !important; }
  html.mx-scrolled [data-glass="light"] { background: rgba(250,249,246,.95) !important; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  html.mx-scrolled [data-glass="dark"] { background: #08080A !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
  html.mx-scrolled [data-glass="light"] { background: #FAF9F6 !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Inside the MorrMedia frame: the shell owns nav, progress, preloader and transitions */
.mx-framed [data-chrome] { display: none !important; }
.mx-framed .mx-pre { display: none; }
.mx-framed .mx-rise > * { animation-delay: calc(.15s + var(--d, 0) * 1s); }
html.mx-cursor-out .mx-dot, html.mx-cursor-out .mx-ring, html.mx-cursor-out .mx-preview, html.mx-cursor-out .mx-trail, html.mx-cursor-out .mx-pill { opacity: 0 !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mx-rise > *, .mx-marquee, .mx-ticker > span, .mx-cue { animation: none; }
  .mx-pre { display: none; }
  .mx-js [data-in], .mx-js [data-in].mx-clip { opacity: 1; transform: none; clip-path: none; }
  .mx-para > img { transform: none; }
}

/* ---- Accessibility + navigation polish (shared) ---- */
.mx-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mx-skip { position: fixed; left: 12px; top: 12px; z-index: 10000; padding: 12px 18px; border-radius: 999px; background: #FFFFFF; color: #000000 !important; font: 600 14px/1 'Geist', system-ui, sans-serif; text-decoration: none; transform: translateY(-160%); transition: transform .2s; }
.mx-skip:focus, .mx-skip:focus-visible { transform: none; outline: 2px solid #000; outline-offset: 2px; }
[id] { scroll-margin-top: 96px; }
main:focus, [role="main"]:focus { outline: none; }
nav[data-chrome] > div { font-size: 13px !important; gap: clamp(2px, 1.4vw, 18px) !important; }
nav[data-chrome] a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; border-radius: 999px; }
nav[data-chrome] > a:first-child { padding-left: 0; }
nav[data-chrome] a:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
nav[data-chrome] a:active { opacity: .7; }
@media (max-width: 420px) { nav[data-chrome] > div { letter-spacing: .14em !important; } nav[data-chrome] a { padding: 0 8px; } }
@media (prefers-reduced-motion: reduce) { .mx-drift { transform: none !important; } .mx-skip { transition: none; } }
