/* MJ v4 redesign: motion and effects layer. Everything is scoped to mj- classes, so older pages are untouched. */
html.mj-lenis, html.mj-lenis body { height: auto; }
.mj-lenis.lenis-smooth { scroll-behavior: auto !important; }

/* Header */
.mj-header { position: fixed !important; top: 0; left: 0; right: 0; z-index: 50; color: var(--mj-white); transition: background-color .4s ease, color .4s ease, transform .5s cubic-bezier(.22,1,.36,1); }
.admin-bar .mj-header { top: 32px; }
.mj-header.is-light { background-color: var(--mj-white); color: var(--mj-black); }
.mj-header.is-hidden { transform: translateY(-110%); }
.mj-header a, .mj-header .e-heading-base, .mj-header .e-paragraph-base { color: inherit; }
.mj-header .mj-logo { transition: filter .4s ease; }
.mj-header.is-light .mj-logo { filter: brightness(0); }

/* New-design links inherit their colour, overriding the old kit hover colour (atomic elements only) */
html body a.e-paragraph-link-base, html body a.e-paragraph-link-base:hover, html body a.e-heading-link-base, html body a.e-heading-link-base:hover { color: inherit; }

/* Text roll on links and buttons */
.mj-roll { display: inline-block; overflow: hidden; height: 1.15em; line-height: 1.15; vertical-align: bottom; }
.mj-roll > span { display: block; transition: transform .45s cubic-bezier(.22,1,.36,1); }
a:hover .mj-roll > span, .mj-btn:hover .mj-roll > span { transform: translateY(-100%); }

/* Hero */
.mj-hero-title > span:not(.mj-line), .mj-hero-title .mj-rot, .mj-hl span { color: var(--mj-lime); }
.mj-line { display: block; overflow: hidden; padding: .04em 0 .16em; margin-bottom: -.14em; }
.mj-line > .mj-line-in { display: inline-block; transform: translateY(110%); transition: transform 1.1s cubic-bezier(.22,1,.36,1); }
.mj-ready .mj-line > .mj-line-in { transform: none; }
.mj-caret { display: inline-block; width: .06em; height: .8em; background: var(--mj-orange); margin-left: .04em; vertical-align: -.05em; animation: mjBlink 1s steps(1) infinite; }
@keyframes mjBlink { 50% { opacity: 0; } }

/* Smiley mark, drawn in CSS so no SVG upload is needed */
.mj-smiley { aspect-ratio: 1 / 1; background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='48' fill='%23DBE028'/%3E%3Cellipse cx='36' cy='40' rx='5.5' ry='8' fill='%231C3FB8'/%3E%3Cellipse cx='64' cy='40' rx='5.5' ry='8' fill='%231C3FB8'/%3E%3Cpath d='M30 60 Q50 80 70 60' fill='none' stroke='%231C3FB8' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E"); transition: transform .7s cubic-bezier(.34,1.56,.64,1); }
.mj-smiley--blue { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='48' fill='%231C3FB8'/%3E%3Cellipse cx='36' cy='40' rx='5.5' ry='8' fill='%23DBE028'/%3E%3Cellipse cx='64' cy='40' rx='5.5' ry='8' fill='%23DBE028'/%3E%3Cpath d='M30 60 Q50 80 70 60' fill='none' stroke='%23DBE028' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E"); }
.mj-smiley--dark { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='48' fill='%230B0B0C'/%3E%3Cellipse cx='36' cy='40' rx='5.5' ry='8' fill='%23FF5A30'/%3E%3Cellipse cx='64' cy='40' rx='5.5' ry='8' fill='%23FF5A30'/%3E%3Cpath d='M30 60 Q50 80 70 60' fill='none' stroke='%23FF5A30' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E"); }
.mj-smiley--ink { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='48' fill='%23DBE028'/%3E%3Cellipse cx='36' cy='40' rx='5.5' ry='8' fill='%230B0B0C'/%3E%3Cellipse cx='64' cy='40' rx='5.5' ry='8' fill='%230B0B0C'/%3E%3Cpath d='M30 60 Q50 80 70 60' fill='none' stroke='%230B0B0C' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* Marquees */
.mj-marquee { overflow: hidden; white-space: nowrap; }
.mj-marquee-track { display: inline-flex !important; width: max-content !important; flex-wrap: nowrap !important; animation: mjMarq 32s linear infinite; }
.mj-logos-track { animation-duration: 45s; }
.mj-marquee-track > * { flex: none; }
@keyframes mjMarq { to { transform: translateX(-50%); } }
.mj-marquee-item::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mj-black); margin: 0 18px 0 36px; vertical-align: middle; }
.mj-logos-track img:not(.mj-logo-keep) { filter: brightness(0); opacity: .85; }

/* Stacking case study cards */
.mj-card { position: sticky !important; top: 90px; transform-origin: center top; will-change: transform; overflow: hidden; }
.mj-card img { width: 100%; height: 118% !important; object-fit: cover; transform: translateY(var(--py, 0px)) scale(1.02); transition: filter .5s; }
.mj-card:hover img { filter: brightness(.85); }
.mj-card-tags span { display: inline-block; font-size: 13px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); margin: 0 0 6px 6px; }
.mj-cursor { position: fixed; left: 0; top: 0; z-index: 60; width: 96px; height: 96px; border-radius: 50%; background: var(--mj-lime); color: var(--mj-black); display: grid; place-items: center; font: 700 15px var(--mj-font), sans-serif; pointer-events: none; transform: translate(-50%,-50%) scale(0); transition: transform .35s cubic-bezier(.22,1,.36,1); }
.mj-cursor.is-on { transform: translate(-50%,-50%) scale(1); }
@media (hover: hover) { .mj-card { cursor: none; } }

/* Wavy checkerboard band */
.mj-check { height: 46px; background: 0 0 / 100% 46px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 46' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cpattern id='c' width='46' height='46' patternUnits='userSpaceOnUse'%3E%3Crect width='46' height='46' fill='%23FFFFFF'/%3E%3Crect width='23' height='23' fill='%231C3FB8'/%3E%3Crect x='23' y='23' width='23' height='23' fill='%231C3FB8'/%3E%3C/pattern%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.02' numOctaves='2' seed='6' result='n'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='n' scale='12'/%3E%3C/filter%3E%3C/defs%3E%3Crect x='-20' y='-20' width='1240' height='86' fill='url(%23c)' filter='url(%23w)'/%3E%3C/svg%3E"); }

/* Services: pinned horizontal panels */
.mj-hscroll { position: relative; }
.mj-hs-pin { position: sticky !important; top: 0; height: 100vh; overflow: hidden; }
.mj-hs-track { will-change: transform; }
.mj-hs-bar { overflow: hidden; }
.mj-hs-bar > * { transform-origin: left; transform: scaleX(0); }
.mj-panel ul { list-style: none; margin: 0; padding: 0; }
.mj-panel li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1.5px solid currentColor; font-weight: 700; }
.mj-panel li::after { content: "\2192"; transition: transform .3s ease; }
.mj-panel li:hover::after { transform: translateX(4px); }

/* Who I work with */
.mj-sector:hover .mj-smiley { transform: rotate(360deg) scale(1.1); }
.mj-letters { display: inline-flex; overflow: hidden; height: 1.22em; padding-top: .02em; vertical-align: top; }
.mj-letters > span { display: inline-block; transition: transform .5s cubic-bezier(.22,1,.36,1); text-shadow: 0 1.22em 0 var(--mj-blue); }
.mj-sector:hover .mj-letters > span { transform: translateY(-1.22em); }
.mj-sector-img { display: none !important; }
.mj-peek { position: fixed; left: 0; top: 0; z-index: 30; width: 300px; aspect-ratio: 4 / 3; border-radius: 18px; overflow: hidden; pointer-events: none; transform: translate(-50%,-50%) scale(0) rotate(-6deg); transition: transform .4s cubic-bezier(.22,1,.36,1); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.mj-peek.is-on { transform: translate(-50%,-50%) scale(1) rotate(-6deg); }
.mj-peek img { width: 100%; height: 100%; object-fit: cover; }

/* Footer CTA (original behaviour, new palette) */
.mj-fcta { transition: background-color .5s ease, color .5s ease; }
.mj-fcta:hover { background-color: var(--mj-blue) !important; color: var(--mj-white) !important; }
.mj-fcta .mj-eyebrow { transition: color .5s ease; }
.mj-fcta:hover .mj-eyebrow { color: var(--mj-lime); }
.mj-fcta-h span { display: inline-block; transition: color .5s ease, transform .6s cubic-bezier(.22,1,.36,1); }
.mj-fcta:hover .mj-fcta-h span { color: var(--mj-lime); transform: rotate(-4deg); }
.mj-fcta .mj-smiley { transform: rotate(-14deg) scale(0); }
.mj-fcta:hover .mj-smiley { transform: rotate(-14deg) scale(1); }
.mj-bubble { position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none; display: flex; align-items: center; justify-content: center; width: 110px; height: 110px; border-radius: 50%; background: var(--mj-white); color: var(--mj-blue); font: 700 13px var(--mj-font), sans-serif; letter-spacing: .06em; text-transform: uppercase; transform: translate(-50%,-50%) scale(0); transition: transform .28s cubic-bezier(.2,.7,.2,1); }
.mj-bubble.is-on { transform: translate(-50%,-50%) scale(1); }
@media (hover: hover) { .mj-fcta { cursor: none; } }

/* Reveal on scroll */
.mj-js .mj-reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.22,1,.36,1), transform 1s cubic-bezier(.22,1,.36,1); }
.mj-js .mj-reveal.is-in { opacity: 1; transform: none; }

/* Mobile */
@media (max-width: 767px) {
  .mj-hide-mobile { display: none !important; }
  .mj-card { top: 70px; }
  .mj-hscroll { height: auto !important; }
  .mj-hs-pin { position: static !important; height: auto; overflow: visible; }
  .mj-hs-track { width: 100% !important; max-width: 100vw; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scroll-padding-inline: var(--mj-space-x); transform: none !important; padding-bottom: 8px !important; }
  .mj-hs-track > * { scroll-snap-align: start; }
  .mj-peek, .mj-cursor, .mj-bubble { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mj-marquee-track, .mj-caret { animation: none !important; }
  .mj-line > .mj-line-in, .mj-js .mj-reveal { transform: none !important; opacity: 1 !important; transition: none !important; }
  .mj-hscroll { height: auto !important; }
  .mj-hs-pin { position: static !important; height: auto; }
  .mj-hs-track { width: 100% !important; overflow-x: auto; transform: none !important; }
}

/* ================= Case studies (only pages with .mj-cs) ================= */
/* Intro wipe: pure CSS so there is no flash before the script loads */
.mj-cs::before { content: ""; position: fixed; inset: 0; z-index: 100; background: var(--mj-blue); pointer-events: none; animation: mjCsWipe .9s cubic-bezier(.22,1,.36,1) .35s forwards; }
@keyframes mjCsWipe { to { transform: translateY(-100%); } }
.elementor-editor-active .mj-cs::before { display: none; }

/* Reading progress + chapter rail (built by the script) */
.mj-cs-progress { position: fixed; left: 0; top: 0; height: 4px; width: 100%; background: var(--mj-lime); transform-origin: left; transform: scaleX(0); z-index: 60; pointer-events: none; }
.admin-bar .mj-cs-progress { top: 32px; }
.mj-cs-rail { position: fixed; left: var(--mj-space-x); top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; gap: 10px; font: 700 13px var(--mj-font), sans-serif; opacity: 0; pointer-events: none; transition: opacity .4s; }
.mj-cs-rail.is-on { opacity: 1; pointer-events: auto; }
.mj-cs-rail a { display: flex; align-items: center; gap: 10px; color: rgba(11,11,12,.35) !important; text-decoration: none; transition: color .3s; }
.mj-cs-rail a i { width: 18px; height: 2px; background: currentColor; transition: width .4s cubic-bezier(.22,1,.36,1); }
.mj-cs-rail a.is-active { color: var(--mj-black) !important; }
.mj-cs-rail a.is-active i { width: 34px; background: var(--mj-blue); }
.mj-cs-rail.is-dark a { color: rgba(255,255,255,.4) !important; }
.mj-cs-rail.is-dark a.is-active { color: var(--mj-white) !important; }
.mj-cs-rail.is-dark a.is-active i { background: var(--mj-lime); }
.mj-cs-chapter-label { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; }

/* Hero title letters rise in */
.mj-cs-title { display: flex !important; overflow: hidden; padding-bottom: .04em; }
.mj-cs-title .mj-cs-l { display: inline-block; transform: translateY(105%); transition: transform 1.1s cubic-bezier(.22,1,.36,1); }
.mj-cs-title.is-in .mj-cs-l { transform: none; }
.elementor-editor-active .mj-cs-title .mj-cs-l { transform: none; }

/* Hero image grows to full bleed */
.mj-cs-frame { clip-path: inset(0 var(--gx, 5%) 0 var(--gx, 5%) round var(--gr, 22px)); will-change: clip-path; }
.mj-cs-frame img { width: 100% !important; height: 115% !important; max-width: none !important; object-fit: cover; display: block; transform: translateY(var(--py, 0px)); }

/* Highlight words inside headings */
.mj-cs-h2 span { color: var(--mj-blue); }

/* Text links inside case study body copy */
.mj-cs-p a, .mj-cs-p a:hover { color: var(--mj-blue) !important; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* From / to */
.mj-cs-from::after { content: ""; position: absolute; left: 0; right: 0; top: 55%; height: 3px; background: var(--mj-orange); transform: scaleX(0); transform-origin: left; transition: transform .8s cubic-bezier(.22,1,.36,1) .2s; }
.mj-js .mj-cs-to { opacity: 0; transform: translateX(-24px); transition: opacity .8s cubic-bezier(.22,1,.36,1) .7s, transform .8s cubic-bezier(.22,1,.36,1) .7s; }
.mj-js .mj-cs-mid { opacity: 0; transition: opacity .5s .5s; }
.mj-cs-ft.is-in .mj-cs-from::after { transform: scaleX(1); }
.mj-cs-ft.is-in .mj-cs-to { opacity: 1; transform: none; }
.mj-cs-ft.is-in .mj-cs-mid { opacity: 1; }
.elementor-editor-active .mj-cs-to, .elementor-editor-active .mj-cs-mid { opacity: 1 !important; transform: none !important; }

/* Numbers, cards, figures */
.mj-cs-num, .mj-cs-num * , .mj-cs-fcard, .mj-cs-fcard * { transition: background-color .4s, color .4s, transform .5s cubic-bezier(.22,1,.36,1); }
.mj-cs-num:hover *, .mj-cs-fcard:hover * { color: inherit !important; }
.mj-cs-fig img { width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; display: block; }
.mj-cs-video iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Stacked image blocks sit 16px apart, the last one keeps the section spacing */
.mj-cs-gallery:has(+ .mj-cs-gallery) { padding-bottom: 16px !important; }

/* Quote */
.mj-cs-quote-text::before { content: "\201C"; display: block; font-size: 2.4em; line-height: .6; color: var(--mj-blue); margin-bottom: 10px; }

/* Outcome: words light up on scroll */
.mj-cs-reveal-text .mj-w { opacity: .14; transition: opacity .25s linear; }
.mj-cs-reveal-text .mj-w.is-lit { opacity: 1; }
.mj-cs-reveal-text em, .mj-cs-reveal-text em .mj-w { font-style: normal; color: var(--mj-lime); }
.elementor-editor-active .mj-cs-reveal-text .mj-w { opacity: 1; }

/* Next project */
.mj-cs-next img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; transform: scale(1.08); transition: transform 1.4s cubic-bezier(.22,1,.36,1); }
.mj-cs-next::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,11,12,.15), rgba(11,11,12,.75)); pointer-events: none; }
.mj-cs-next:hover img { transform: scale(1); }
.mj-cs-next-inner > * { width: auto !important; }
.mj-cs-go { transition: transform .5s cubic-bezier(.22,1,.36,1); }
.mj-cs-next:hover .mj-cs-go { transform: rotate(-45deg) scale(1.08); }

/* Work listing */
.mj-work-tile, .mj-work-tile:hover, .mj-work-tile:focus { color: var(--mj-black) !important; text-decoration: none !important; }
.mj-work-tile:hover *, .mj-work-tile:focus * { text-decoration: none !important; }
.mj-cs-next, .mj-cs-next:hover, .mj-cs-next:focus { color: var(--mj-white) !important; }
.mj-work-name .mj-roll { height: 1.1em; line-height: 1.1; }
.mj-work-name .mj-roll > span + span { color: var(--mj-blue); }
.mj-work-name::after { content: "\2192"; display: inline-block; margin-left: .25em; color: var(--mj-blue); opacity: 0; transform: translateX(-.3em); transition: opacity .35s, transform .45s cubic-bezier(.22,1,.36,1); vertical-align: top; line-height: 1.1; }
.mj-work-tile:hover .mj-work-name::after { opacity: 1; transform: none; }
.mj-work-pill.is-active, .mj-work-pill.is-active:hover { background-color: var(--mj-black) !important; color: var(--mj-white) !important; }
.mj-work-tile.is-hidden { display: none !important; }
.mj-work-img img { width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; display: block; transition: filter .5s; }
.mj-work-tile:hover .mj-work-img img { filter: brightness(.85); }
@media (min-width: 768px) { .mj-work-tile.is-offset { translate: 0 clamp(60px, 9vw, 140px); } .mj-work-grid { padding-bottom: calc(clamp(90px, 10vw, 160px) + clamp(60px, 9vw, 140px)) !important; } }
@media (hover: hover) { .mj-work-tile { cursor: none; } }

@media (max-width: 1024px) { .mj-cs-rail { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .mj-cs::before { display: none; }
  .mj-cs-title .mj-cs-l, .mj-js .mj-cs-to, .mj-js .mj-cs-mid { transform: none !important; opacity: 1 !important; transition: none !important; }
  .mj-cs-reveal-text .mj-w { opacity: 1 !important; }
}
