/* MO GROUP website mockups – motion & interaction layer.
   Loaded AFTER each page's own styles. Adds animation and feedback only:
   no layout, colour or typography changes. Every effect is switched off by
   prefers-reduced-motion (see base.css and the block at the end of this file). */

:root {
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-soft: cubic-bezier(.25, .8, .25, 1);
}

/* ---------- 11. Page transitions (short fade in / out) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
.js body { animation: mo-page-in .35s ease-out both; }
html.is-leaving body { opacity: 0; transition: opacity .18s ease-in; }
@keyframes mo-page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 1. Page entrance (pure CSS, staggered) ---------- */
@keyframes mo-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes mo-drop { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes mo-visual { from { opacity: 0; transform: translateY(14px) scale(.975); } to { opacity: 1; transform: none; } }

.js [data-nav] { animation: mo-drop .6s var(--ease-out) both; }

/* hero wrappers no longer wait for the scroll observer – the entrance below runs instead */
.js .hero .reveal, .js .hero .reveal-stagger > * { opacity: 1; translate: none; transition: none; }

.js .hero :is(.eyebrow, .kicker, .badge, .tag),
.js .hero h1,
.js .hero .lead,
.js .hero .hero-actions { animation: mo-rise .7s var(--ease-out) both; }
.js .hero :is(.eyebrow, .kicker, .badge, .tag) { animation-delay: .12s; }
.js .hero h1 { animation-delay: .22s; }
.js .hero .lead { animation-delay: .38s; }
.js .hero .hero-actions { animation-delay: .52s; }

.js .hero :is(.hero-visual, .hero-photo) { animation: mo-visual .9s var(--ease-out) .35s both; }
.js .hero .mosaic > figure { animation: mo-visual .8s var(--ease-out) both; }
.js .hero .mosaic > figure:nth-child(1) { animation-delay: .55s; }
.js .hero .mosaic > figure:nth-child(2) { animation-delay: .47s; }
.js .hero .mosaic > figure:nth-child(3) { animation-delay: .40s; }
.js .hero .mosaic > figure:nth-child(4) { animation-delay: .47s; }
.js .hero .mosaic > figure:nth-child(5) { animation-delay: .55s; }
.js .hero :is(.hero-stats > div, .hero-stat) { animation: mo-rise .6s var(--ease-out) both; }
.js .hero :is(.hero-stats > div, .hero-stat):nth-of-type(1) { animation-delay: .66s; }
.js .hero :is(.hero-stats > div, .hero-stat):nth-of-type(2) { animation-delay: .74s; }
.js .hero :is(.hero-stats > div, .hero-stat):nth-of-type(3) { animation-delay: .82s; }
.js .hero :is(.hero-stats > div, .hero-stat):nth-of-type(4) { animation-delay: .90s; }
.js .hero .float-card { animation: mo-rise .7s var(--ease-out) both; }
.js .hero .fc-1 { animation-delay: .85s; }
.js .hero .fc-2 { animation-delay: .7s; }
.js .hero .hero-map { animation: mo-page-in 1.6s ease-out .3s both; }

/* ---------- 2. Scroll reveals: images ease in with a slight settle ---------- */
:is(.prod-img, .thumb, .pimg, .ab-photo) img {
  transition: transform .8s var(--ease-out), scale 1.2s var(--ease-out), opacity .9s ease-out;
}
.js :is(.reveal, .reveal-stagger > *):not(.in) :is(.prod-img, .thumb, .pimg) img,
.js .ab-photo:not(.in) img { opacity: 0; scale: 1.08; }

/* ---------- 3. Navigation ---------- */
.nav-links a { transition: color .25s ease, background-color .25s ease, opacity .25s ease; }
.nav-links a.active { opacity: 1; }
body.menu-open { overflow: hidden; }
.mobile-menu > a { opacity: 0; transform: translateY(10px); transition: opacity .35s ease-out, transform .45s var(--ease-out), color .2s, padding .3s var(--ease-out); }
.menu-open .mobile-menu > a { opacity: 1; transform: none; }
.menu-open .mobile-menu > a:nth-child(1) { transition-delay: .05s; }
.menu-open .mobile-menu > a:nth-child(2) { transition-delay: .09s; }
.menu-open .mobile-menu > a:nth-child(3) { transition-delay: .13s; }
.menu-open .mobile-menu > a:nth-child(4) { transition-delay: .17s; }
.menu-open .mobile-menu > a:nth-child(5) { transition-delay: .21s; }
.menu-open .mobile-menu > a:nth-child(6) { transition-delay: .25s; }
.menu-open .mobile-menu > a:nth-child(7) { transition-delay: .29s; }
.mobile-menu > a.active:not(.btn) { color: var(--orange); }
.menu-btn svg { transition: transform .35s var(--ease-out), opacity .2s; }
.menu-open .menu-btn .i-close { animation: mo-turn .35s var(--ease-out); }
@keyframes mo-turn { from { transform: rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 4 + 8. Buttons ---------- */
.btn {
  transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out), background-color .25s ease, color .25s ease, border-color .25s ease;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -16px rgba(26, 23, 24, .55); }
.btn-primary:hover { box-shadow: 0 16px 32px -14px rgba(242, 72, 10, .7); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .08s; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--orange, #F2480A); outline-offset: 3px; box-shadow: 0 0 0 6px rgba(242, 72, 10, .18); }
.btn svg, .link svg, .more svg { transition: transform .3s var(--ease-out); }
.btn[aria-busy="true"] { pointer-events: none; opacity: .75; }

/* Animated underline on text links */
.link { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease-out), color .2s; }
.link:hover, :is(.prod, .pcard):hover .link { background-size: 100% 1px; }

/* ---------- 5. Cards ---------- */
:is(.prod, .pcard, .value, .ab-val, .wcard, .cert, .brand-row li, .brand-grid li, .shows, .press, .card) {
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .3s ease, background-color .3s ease;
}
:is(.why-grid li, .value, .ab-val, .wcard, .cert, .why-list li) :is(svg, .ic) { transition: transform .4s var(--ease-out), background-color .3s, color .3s, border-color .3s; }
:is(.why-grid li, .value, .ab-val, .wcard, .cert):hover .ic,
.why-grid li:hover > svg { transform: scale(1.08); }
.pcard .more svg { transition: transform .3s var(--ease-out); }
.pcard:hover .more svg, .prod:hover .link svg, .row:hover .no { transform: translateX(4px); }
.row .no { display: inline-block; transition: transform .35s var(--ease-out), color .3s; }
.row:hover .no { color: var(--orange); }

/* Whole product card is clickable (mockup 1 cards hold a link inside) */
.prod { position: relative; }
.prod .link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.prod:focus-within { box-shadow: 0 0 0 2px var(--orange, #F2480A); }
.prod .link:focus-visible { outline: none; }

/* Touch screens: no sticky hover lift, give a press response instead */
@media (hover: none) {
  :is(.prod, .pcard, .value, .ab-val, .wcard, .cert, .brand-row li, .brand-grid li):hover { transform: none; box-shadow: none; }
  :is(.prod, .pcard, .row, .cta-list a, .cta-links a, .cta-actions a):active { transform: scale(.985); transition-duration: .1s; }
  .link { background-size: 100% 1px; }
}

/* ---------- 9. Images ---------- */
.brand-row img, .brand-grid img { transition: filter .4s ease, opacity .4s ease, transform .45s var(--ease-out); }

/* ---------- 4. Hero: pointer-follow depth (set by mo.js via --mx / --my, -1..1) ---------- */
.hero { --mx: 0; --my: 0; }
.hero.is-tracking :is(.hero-visual, .hero-map, .float-card, .mosaic img, .hero-photo img, .hero-main) { transition: translate .9s var(--ease-soft); }
.hero :is(.hero-visual, .hero-map, .float-card, .mosaic img, .hero-photo img) { transition: translate 1.2s var(--ease-soft); }
.hero .hero-visual { translate: calc(var(--mx) * -9px) calc(var(--my) * -7px); }
.hero .hero-map { translate: calc(var(--mx) * 10px) calc(var(--my) * 6px); }
.hero .float-card { translate: calc(var(--mx) * -6px) calc(var(--my) * -5px); }
.hero .mosaic img { scale: 1.05; translate: calc(var(--mx) * -6px) calc(var(--my) * -4px); }
.hero .hero-photo img { scale: 1.06; translate: calc(var(--mx) * -8px) calc(var(--my) * -6px); }
.hero .hero-main::before { transition: translate 1.2s var(--ease-soft); translate: calc(var(--mx) * 14px) calc(var(--my) * 12px); }

/* ---------- 6. World map ---------- */
.js .worldmap:not([aria-hidden="true"]) .wm-svg { opacity: 0; transform: scale(.965); transition: opacity 1s ease-out, transform 1.2s var(--ease-out); }
.worldmap.in .wm-svg { opacity: 1 !important; transform: none !important; }
.worldmap.in .wm-pulse { animation-duration: 4s; }
.wm-pin[tabindex] { cursor: pointer; outline: none; }
.wm-hit { fill: transparent; }
.wm-dot { transform-box: fill-box; transform-origin: center; transition: transform .35s var(--ease-out), filter .35s ease; }
.wm-pin[tabindex]:is(:hover, :focus-visible, .is-active) .wm-dot { transform: scale(1.55); filter: drop-shadow(0 0 1.4px var(--map-pin, #F2480A)) drop-shadow(0 0 3px var(--map-pin, #F2480A)); }
.wm-pin[tabindex]:focus-visible .wm-dot { stroke: var(--focus, #F2480A); }
.wm-arc { transition: opacity .35s ease, stroke-width .35s ease; }
.worldmap.has-focus .wm-arc { opacity: .25; }
.worldmap.has-focus .wm-arc.is-active { opacity: 1; stroke-width: .55; }

.wm-tip {
  position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none;
  max-width: 230px; padding: 9px 13px; border-radius: 10px;
  background: rgba(26, 23, 24, .94); color: #fff; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .55);
  font: 500 12.5px/1.4 var(--sans, system-ui, sans-serif); letter-spacing: 0;
  opacity: 0; transform: translate(-50%, calc(-100% - 10px)) scale(.96); transform-origin: 50% 100%;
  transition: opacity .2s ease, transform .25s var(--ease-out);
}
.wm-tip b { display: block; font-weight: 700; font-size: 13px; color: #fff; }
.wm-tip span { color: rgba(255, 255, 255, .72); }
.wm-tip.show { opacity: 1; transform: translate(-50%, calc(-100% - 12px)) scale(1); }
.wm-tip::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.wm-tip.flip { transform: translate(-50%, 14px) scale(.96); transform-origin: 50% 0; }
.wm-tip.flip.show { transform: translate(-50%, 16px) scale(1); }
.wm-tip.flip::after { bottom: auto; top: -5px; }

/* ---------- 10. Contact form ---------- */
form label { transition: color .25s ease; }
form label:focus-within { color: var(--orange, #F2480A); }
form :is(input, textarea, select) { transition: border-color .25s ease, background-color .25s ease, box-shadow .3s var(--ease-out), transform .3s var(--ease-out); }
form :is(input, textarea, select):focus { box-shadow: 0 0 0 4px rgba(242, 72, 10, .14); transform: translateY(-1px); }
form [aria-invalid="true"] { border-color: #C2410C; background: #FFF6F2; }
.field-error {
  display: grid; grid-template-rows: 0fr; opacity: 0; font-size: 12.5px; font-weight: 500; color: #B4370A;
  transition: grid-template-rows .3s var(--ease-out), opacity .25s ease, margin .3s;
}
.field-error > span { overflow: hidden; }
.field-error.show { grid-template-rows: 1fr; opacity: 1; margin-top: 2px; }
.form-success {
  grid-column: 1 / -1; display: grid; justify-items: start; gap: 10px; padding: 28px; border-radius: 16px;
  background: var(--rose-soft, #FDF1EC); border: 1px solid rgba(242, 72, 10, .18);
  animation: mo-rise .55s var(--ease-out) both;
}
.form-success .tick { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--orange, #F2480A); color: #fff; }
.form-success .tick svg { width: 24px; height: 24px; }
.form-success .tick path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: mo-tick .5s var(--ease-out) .25s forwards; }
@keyframes mo-tick { to { stroke-dashoffset: 0; } }
.form-success h3 { font-size: 26px; }
.form-success p { color: var(--muted, #6A6264); font-size: 15px; }
.form-success button { margin-top: 6px; background: none; border: 0; padding: 0; font-weight: 600; font-size: 14px; color: var(--orange, #F2480A); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Per-mockup touches (same colours as each mockup already uses) ---------- */
/* Mockup 1 – Prestige */
.m1 .nav-links a.active::after { transform: scaleX(1); }
.m1 .prod:hover { border-color: var(--gold); }
.m1 .cert:hover { box-shadow: 0 18px 36px -26px rgba(35, 31, 32, .45); }
.m1 .why-grid li:hover { box-shadow: inset 0 -2px 0 var(--gold); }
.m1 .shows:hover, .m1 .press:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -30px rgba(35, 31, 32, .4); }
.m1 .brand-row li { transition: border-color .3s, transform .4s var(--ease-out), box-shadow .4s; }
.m1 .brand-row li:hover { border-color: var(--gold); transform: translateY(-3px); box-shadow: 0 16px 30px -24px rgba(35, 31, 32, .45); }

/* Mockup 2 – Editorial */
.m2 .nav-links a { position: relative; padding: 6px 0; }
.m2 .nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.m2 .nav-links a:hover::after, .m2 .nav-links a.active::after { transform: scaleX(1); }
.m2 .nav-links a.active { color: var(--orange); }
.m2 .value:hover { border-color: var(--rose); }
.m2 .card:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -30px rgba(35, 31, 32, .4); }

/* Mockup 3 – Corporate */
.m3 .nav-links a.active { background: var(--black-soft); color: var(--orange); }
.m3 .pcard:hover { border-color: rgba(242, 72, 10, .45); }
.m3 .ab-val:hover { border-color: rgba(242, 72, 10, .35); }
.m3 .wcard:not(.feature):hover { border-color: rgba(242, 72, 10, .35); }
.m3 .wcard.feature:hover { box-shadow: 0 30px 60px -30px rgba(242, 72, 10, .7); }

/* ---------- 13. Reduced motion: everything visible at once, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  .js body, .js [data-nav], .js .hero * { animation: none !important; }
  .hero * { translate: none !important; }
  .js .worldmap .wm-svg { opacity: 1 !important; transform: none !important; }
  .js :is(.reveal, .reveal-stagger > *) img { opacity: 1 !important; scale: 1 !important; }
  .btn:hover, .btn:active { transform: none; }
  .mobile-menu > a { opacity: 1; transform: none; }
}
