/* Bijeh Games — motion layer v2 (home + Solitaire). Applies only after motion.js adds .m-on
   to <html>, so the pages stay complete without it. Everything calms down for visitors
   whose device asks for reduced motion. */

/* section snap lives in motion.js (smooth glide to the nearest section edge) */

/* ---------- logo: grows on load, leaves sway on hover ---------- */
.bg-mark .mk-seed { transform-origin: 54px 62px; }
.bg-mark .mk-leaf1 { transform-origin: 38px 18px; }
.bg-mark .mk-leaf2 { transform-origin: 38px 34px; }
.m-intro .bg-mark .mk-stem, .m-intro .bg-mark .mk-bowl, .m-intro .bg-mark .mk-root { stroke-dasharray: 1 1; }
.m-intro .bg-mark .mk-seed { animation: mk-pop .5s cubic-bezier(.3,1.6,.5,1) .1s both, mk-glow 1.4s ease-in-out 2s both; }
.m-intro .bg-mark .mk-bowl { animation: mk-draw .6s ease-out .4s both; }
.m-intro .bg-mark .mk-stem, .m-intro .bg-mark .mk-root { animation: mk-draw .65s cubic-bezier(.2,.8,.2,1) .9s both; }
.m-intro .bg-mark .mk-leaf2 { animation: mk-unfurl .5s cubic-bezier(.3,1.5,.5,1) 1.35s both; }
.m-intro .bg-mark .mk-leaf1 { animation: mk-unfurl .55s cubic-bezier(.3,1.5,.5,1) 1.5s both; }
.m-intro .bg-logo > span { animation: m-fade-up .6s cubic-bezier(.2,.8,.2,1) 1.6s both; }
.m-on .bg-logo:hover .mk-leaf1, .m-on a:focus-visible .mk-leaf1 { animation: mk-sway 1s ease-in-out; }
.m-on .bg-logo:hover .mk-leaf2, .m-on a:focus-visible .mk-leaf2 { animation: mk-sway 1s ease-in-out .1s; }
@keyframes mk-draw { 0% { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes mk-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes mk-unfurl { from { transform: scale(0) rotate(-45deg); } to { transform: scale(1) rotate(0); } }
@keyframes mk-glow { 0%,100% { filter: none; } 50% { filter: drop-shadow(0 0 4px #9BE36A); } }
@keyframes mk-sway { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 65% { transform: rotate(7deg); } }

/* ---------- hero text arrives on load ---------- */
@keyframes m-fade-up { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.m-on .m-load { animation: m-fade-up .8s cubic-bezier(.2,.8,.2,1) both; }

/* ---------- scroll reveal ---------- */
.m-on .m-reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.m-on .m-reveal.m-in { opacity: 1; transform: none; }

/* ---------- buttons and links ---------- */
.m-on a[style*="border-radius: 999px"], .m-on button[style*="border-radius: 999px"] {
  transition: transform .2s ease, box-shadow .25s ease, filter .2s ease;
}
.m-on a[style*="border-radius: 999px"]:hover, .m-on button[style*="border-radius: 999px"]:hover {
  transform: translateY(-2px); box-shadow: 0 10px 26px -8px rgba(155,227,106,.55); filter: brightness(1.06);
}
.m-on .m-gold a[style*="border-radius: 999px"]:hover, .m-on.m-gold a[style*="border-radius: 999px"]:hover,
.m-on.m-gold button[style*="border-radius: 999px"]:hover { box-shadow: 0 10px 26px -8px rgba(240,194,79,.6); }
.m-on a[style*="border-radius: 999px"]:active, .m-on button[style*="border-radius: 999px"]:active { transform: scale(.97); }
.m-on header nav a:not([style*="border-radius"]), .m-on footer nav a {
  background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat;
  background-position: 0 100%; background-size: 0% 1.5px; transition: background-size .3s ease;
}
.m-on header nav a:not([style*="border-radius"]):hover, .m-on footer nav a:hover { background-size: 100% 1.5px; }

/* ---------- studio hero: hand of cards ---------- */
.m-on .m-hand { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.m-on .m-hand > .m-card {
  transform: translate(var(--tx, 0px), var(--ty, 0px)) rotate(var(--r));
  transition: transform .55s cubic-bezier(.2,.8,.2,1), opacity .5s ease;
  animation: m-bob 6s ease-in-out infinite;
  will-change: transform;
}
.m-on .m-hand > .m-card:nth-child(2) { animation-delay: -2s; }
.m-on .m-hand > .m-card:nth-child(3) { animation-delay: -4s; }
@keyframes m-bob { 0%,100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.m-on .m-hand.m-dealing > .m-card { transform: translate(0px, 80px) rotate(0deg); opacity: 0; }
.m-on .m-hand.m-fan > .m-card { transform: translate(var(--fx), 0px) rotate(calc(var(--r) * 1.6)); }
.m-on .m-hand.m-fan > .m-card.m-lift { transform: translate(var(--fx), -24px) rotate(calc(var(--r) * 1.15)); }

/* sparks and element rings */
@keyframes m-drift { 0%,100% { transform: translate(0,0); opacity: .9; } 50% { transform: translate(6px,-14px); opacity: .5; } }
.m-on .m-spark { animation: m-drift 5s ease-in-out infinite; }
.m-on .m-spark:nth-of-type(2n) { animation-duration: 6.5s; animation-delay: -2s; }
@keyframes m-breathe { 0%,100% { filter: brightness(1); transform: scale(1); } 50% { filter: brightness(1.4); transform: scale(1.06); } }
.m-on .m-ring-card > div:first-child { animation: m-breathe 3.2s ease-in-out infinite; }
.m-on .m-ring-card:nth-child(2) > div:first-child { animation-delay: -.8s; }
.m-on .m-ring-card:nth-child(3) > div:first-child { animation-delay: -1.6s; }
.m-on .m-ring-card:nth-child(4) > div:first-child { animation-delay: -2.4s; }
.m-on .m-ring-card { transition: transform .3s ease, border-color .3s ease; }
.m-on .m-ring-card:hover { transform: translateY(-4px); border-color: #5A4B6E !important; }

/* lifting cards (release list, Solitaire steps, dealers) */
.m-on .m-lift-card { transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease; }
.m-on .m-lift-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
.m-on .m-lift-card img { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.m-on .m-lift-card:hover img { transform: scale(1.04); }

/* ---------- Solitaire: boss cards ---------- */
.m-on .m-flipwrap { perspective: 1200px; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .3s ease, box-shadow .3s ease; }
.m-on .m-flipwrap:hover { transform: translateY(-6px); box-shadow: 0 0 0 1px rgba(240,194,79,.6), 0 24px 50px -20px rgba(240,194,79,.45); }
.m-on .m-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.3,.7,.2,1); }
.m-on .m-flipwrap.m-open .m-flip { transform: rotateY(180deg); }
.m-on .m-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.m-on .m-face.m-back { transform: rotateY(180deg); }
.m-on .m-face.m-front { display: flex; align-items: center; justify-content: center; background: #1D1838; }
.m-on .m-face.m-front img { width: 62%; height: auto; object-fit: contain; filter: drop-shadow(0 10px 24px rgba(0,0,0,.45)); transition: transform .3s ease; animation: m-float 4.5s ease-in-out infinite; }
.m-on #dealers figure:nth-child(2) .m-front img { animation-delay: -1.1s; }
.m-on #dealers figure:nth-child(3) .m-front img { animation-delay: -2.2s; }
.m-on #dealers figure:nth-child(4) .m-front img { animation-delay: -3.3s; }
@keyframes m-float { 0%,100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -8px; rotate: -1.5deg; } }
/* a light sweep across the card backs */
.m-on .m-face.m-front::after {
  content: ""; position: absolute; inset: -20%; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,243,191,.16) 50%, transparent 60%);
  animation: m-sheen 5s ease-in-out infinite;
}
@keyframes m-sheen { 0% { transform: translateX(-60%); } 55%,100% { transform: translateX(60%); } }
/* lantern glow on the revealed portraits */
.m-on .m-face.m-back::after {
  content: ""; position: absolute; left: 20%; right: 20%; bottom: 4%; height: 45%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,200,110,.35), transparent); mix-blend-mode: screen;
  animation: m-flicker 2.6s ease-in-out infinite;
}
.m-on .m-lantern { position: relative; }
.m-on .m-lantern::after {
  content: ""; position: absolute; left: 25%; right: 25%; bottom: 2%; height: 40%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,200,110,.32), transparent); mix-blend-mode: screen;
  animation: m-flicker 2.4s ease-in-out infinite;
}
@keyframes m-flicker { 0%,100% { opacity: .55; } 20% { opacity: .9; } 35% { opacity: .65; } 60% { opacity: 1; } 80% { opacity: .7; } }
.m-on .m-flipwrap.m-open .m-back img { animation: m-zoom 6s ease-out both; }
@keyframes m-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.m-on .m-rule { opacity: 0; transform: translateY(-6px); transition: opacity .45s ease .35s, transform .45s ease .35s; }
.m-on .m-flipwrap.m-open + figcaption .m-rule { opacity: 1; transform: none; }
.m-on .m-flipwrap:focus-visible { outline: 3px solid #FFD77A; outline-offset: 4px; }
.m-hint { margin: 0; font-size: .9375rem; color: #F0C24F; }

/* Charm cards: tilt to the pointer, bounce on tap */
.m-on .m-tilt { transition: transform .25s ease, filter .25s ease; transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px)) scale(var(--s, 1)); will-change: transform; animation: m-float 5s ease-in-out infinite; }
.m-on .m-tilt:nth-child(2) { animation-delay: -1.2s; }
.m-on .m-tilt:nth-child(3) { animation-delay: -2.4s; }
.m-on .m-tilt:nth-child(4) { animation-delay: -3.6s; }
.m-on .m-tilt:hover { --lift: -8px; filter: drop-shadow(0 18px 28px rgba(0,0,0,.45)); }
.m-on .m-tilt.m-pop { --s: 1.08; --lift: -10px; }

/* lantern motes */
.m-motes { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .m-on *, .m-on *::after { animation: none !important; }
  .m-on .m-reveal { opacity: 1; transform: none; transition: none; }
  .m-on .m-flip, .m-on .m-hand > .m-card, .m-on .m-tilt { transition: none; }
  .m-motes { display: none; }
}
