/* The English Pills: site-wide motion (public pages). No library: CSS + static/js/motion.js (IntersectionObserver).
   - Everything here only moves for people who did NOT ask their phone/computer to "reduce motion".
   - Elements are hidden before they animate ONLY when <html> has the class "ep-motion" (set by a tiny script in
     base.html and confirmed by motion.js). Without JavaScript, in the Website Twin editor and when printing, every
     element simply shows: nothing can stay invisible.
   - Uses the separate translate / scale properties, so it never fights a transform that a page already has.
   - No fonts are set here (fonts come only from the Font ও রং page / SiteTheme). */
:root {
  --m-ease: cubic-bezier(.22, 1, .36, 1);
  --m-ease-soft: cubic-bezier(.4, 0, .2, 1);
  --m-dur: .85s;
  --m-rise: 28px;
  --m-brand: var(--ep-primary, #5D078A);
  --m-brand-2: #8E2BC9;
  --m-glow: rgba(142, 43, 201, .35);
}
@media (max-width: 760px) { :root { --m-rise: 18px; --m-dur: .7s; } }

/* ---------- always (also for "reduce motion"): calm, non-moving polish ---------- */
.site-header { transition: background-color .35s var(--m-ease-soft), box-shadow .35s var(--m-ease-soft); }
.site-header.is-scrolled { box-shadow: 0 10px 30px rgba(27, 11, 38, .08); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header.is-scrolled { background-color: rgba(248, 248, 249, .82); -webkit-backdrop-filter: saturate(170%) blur(14px);
    backdrop-filter: saturate(170%) blur(14px); }
}
.m-progress { position: fixed; left: 0; top: 0; z-index: 70; height: 3px; width: 100%; transform-origin: 0 50%; scale: 0 1;
  background: linear-gradient(90deg, var(--m-brand), var(--m-brand-2), #25A244); pointer-events: none; }

@media print { .m-progress { display: none !important; } html.ep-motion .m-in-wait { opacity: 1 !important; translate: none !important;
  scale: none !important; filter: none !important; clip-path: none !important; } }

@media (prefers-reduced-motion: no-preference) {

  /* ---------- page transitions: the header stays, the page under it cross-fades (Chrome / Edge / Safari 18) ---------- */
  @view-transition { navigation: auto; }
  .site-header { view-transition-name: ep-header; }
  ::view-transition-old(root) { animation: m-page-out .22s var(--m-ease-soft) both; }
  ::view-transition-new(root) { animation: m-page-in .45s var(--m-ease) both; }
  @keyframes m-page-out { to { opacity: 0; translate: 0 -8px; } }
  @keyframes m-page-in { from { opacity: 0; translate: 0 14px; } }
  @supports not (view-transition-name: none) { html.ep-motion body > main { animation: m-page-in .55s var(--m-ease) both; } }

  /* ---------- header + navigation ---------- */
  .site-nav > ul > li > a, .site-nav .sub-toggle { position: relative; }
  .site-nav > ul > li > a::after, .site-nav .sub-toggle::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 4px; height: 2px;
    border-radius: 2px; background: currentColor; scale: 0 1; transform-origin: 0 50%; transition: scale .35s var(--m-ease); }
  .site-nav > ul > li > a:hover::after, .site-nav .sub-toggle:hover::after, .site-nav > ul > li.active > a::after { scale: 1 1; }
  .site-nav > ul > li > a, .site-nav .sub-toggle, .login { transition: color .25s var(--m-ease-soft); }
  .login svg { transition: rotate .5s var(--m-ease), scale .3s var(--m-ease); }
  .login:hover svg { rotate: 360deg; scale: 1.08; }
  .logo img { transition: scale .4s var(--m-ease); }
  .logo:hover img { scale: 1.04; }
  @media (min-width: 901px) {
    /* drop-down menus slide and fade instead of popping */
    .site-nav .sub { display: block; opacity: 0; visibility: hidden; translate: 0 10px; pointer-events: none; border-radius: 12px;
      box-shadow: 0 18px 40px rgba(27, 11, 38, .14); transition: opacity .22s var(--m-ease-soft), translate .3s var(--m-ease), visibility 0s linear .3s; }
    .site-nav li.has-sub:hover > .sub, .site-nav li.has-sub:focus-within > .sub { opacity: 1; visibility: visible; translate: 0 0;
      pointer-events: auto; transition: opacity .22s var(--m-ease-soft), translate .3s var(--m-ease), visibility 0s; }
    .site-nav .sub a { transition: color .2s, padding-left .25s var(--m-ease), background-color .2s; }
    .site-nav .sub a:hover { padding-left: 26px; background-color: rgba(93, 7, 138, .05); }
  }
  @media (max-width: 900px) {
    .site-nav.open { animation: m-drop .38s var(--m-ease) both; }
    .site-nav.open > ul > li { animation: m-rise-in .45s var(--m-ease) both; }
    .site-nav.open > ul > li:nth-child(2) { animation-delay: .03s; } .site-nav.open > ul > li:nth-child(3) { animation-delay: .06s; }
    .site-nav.open > ul > li:nth-child(4) { animation-delay: .09s; } .site-nav.open > ul > li:nth-child(5) { animation-delay: .12s; }
    .site-nav.open > ul > li:nth-child(6) { animation-delay: .15s; } .site-nav.open > ul > li:nth-child(n+7) { animation-delay: .18s; }
    .site-nav li.sub-open > .sub { animation: m-drop .3s var(--m-ease) both; }
    .menu-toggle span { transition: rotate .35s var(--m-ease), translate .35s var(--m-ease), opacity .2s; }
    .menu-toggle[aria-expanded="true"] span:nth-child(1) { translate: 0 7px; rotate: 45deg; }
    .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .menu-toggle[aria-expanded="true"] span:nth-child(3) { translate: 0 -7px; rotate: -45deg; }
  }
  @keyframes m-drop { from { opacity: 0; translate: 0 -10px; } }
  @keyframes m-rise-in { from { opacity: 0; translate: 0 10px; } }

  /* ---------- home hero: living gradient, soft glows, word-by-word title ---------- */
  .hero { position: relative; overflow: hidden; isolation: isolate;
    background-image: radial-gradient(60% 120% at 15% 0%, rgba(142, 43, 201, .55), transparent 60%),
      radial-gradient(50% 120% at 90% 100%, rgba(37, 162, 68, .22), transparent 60%),
      linear-gradient(120deg, var(--purple-dark) 0%, #3A0556 45%, var(--purple-dark) 100%);
    background-size: 160% 160%, 160% 160%, 200% 200%; animation: m-hero-bg 18s ease-in-out infinite alternate; }
  .hero::before, .hero::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(46px); opacity: .55; pointer-events: none; }
  .hero::before { width: 340px; height: 340px; left: -80px; top: -120px; background: #8E2BC9; animation: m-float-a 14s ease-in-out infinite alternate; }
  .hero::after { width: 300px; height: 300px; right: -60px; bottom: -150px; background: #25A244; opacity: .3; animation: m-float-b 16s ease-in-out infinite alternate; }
  @keyframes m-hero-bg { from { background-position: 0% 0%, 100% 100%, 0% 50%; } to { background-position: 30% 20%, 70% 80%, 100% 50%; } }
  @keyframes m-float-a { to { translate: 120px 60px; scale: 1.15; } }
  @keyframes m-float-b { to { translate: -140px -50px; scale: .9; } }
  .hero-partner a { transition: color .2s, text-underline-offset .3s var(--m-ease); }
  .hero-partner a:hover { color: #FFD54F; text-underline-offset: 6px; }

  /* words of big headings rise in one after the other (motion.js wraps them) */
  html.ep-motion .m-words .m-w { display: inline-block; opacity: 0; translate: 0 .35em; filter: blur(6px);
    transition: opacity .7s var(--m-ease), translate .8s var(--m-ease), filter .7s var(--m-ease); transition-delay: calc(var(--i, 0) * 55ms + var(--m-delay, 0s)); }
  html.ep-motion .m-words.is-in .m-w { opacity: 1; translate: 0 0; filter: none; }

  /* ---------- scroll reveal (motion.js adds m-* classes, then is-in when the element comes into view) ---------- */
  html.ep-motion .m-in-wait { transition: opacity var(--m-dur) var(--m-ease), translate var(--m-dur) var(--m-ease), scale var(--m-dur) var(--m-ease),
      filter var(--m-dur) var(--m-ease), clip-path 1.1s var(--m-ease); transition-delay: var(--m-delay, 0s); }
  html.ep-motion .m-up.m-in-wait:not(.is-in) { opacity: 0; translate: 0 var(--m-rise); }
  html.ep-motion .m-fade.m-in-wait:not(.is-in) { opacity: 0; }
  html.ep-motion .m-left.m-in-wait:not(.is-in) { opacity: 0; translate: -36px 0; }
  html.ep-motion .m-right.m-in-wait:not(.is-in) { opacity: 0; translate: 36px 0; }
  html.ep-motion .m-zoom.m-in-wait:not(.is-in) { opacity: 0; scale: .94; }
  html.ep-motion .m-blur.m-in-wait:not(.is-in) { opacity: 0; filter: blur(10px); translate: 0 12px; }
  /* pictures: a curtain opens and the picture settles */
  html.ep-motion .m-img.m-in-wait:not(.is-in) { clip-path: inset(12% 8% 12% 8% round 14px); scale: 1.06; opacity: .2; }
  html.ep-motion .m-img.m-in-wait.is-in { clip-path: inset(0 0 0 0 round 0); }
  /* stat lines under the numbers draw themselves */
  html.ep-motion .m-line.m-in-wait { transform-origin: 0 50%; transition: scale 1.1s var(--m-ease) var(--m-delay, 0s); }
  html.ep-motion .m-line.m-in-wait:not(.is-in) { scale: 0 1; }
  /* prices pop in with a soft glow underline */
  .m-price { position: relative; display: inline-block; white-space: nowrap; }
  html.ep-motion .m-price.m-in-wait:not(.is-in) { opacity: 0; scale: .8; }
  html.ep-motion .m-price.m-in-wait { transition: opacity .6s var(--m-ease), scale .8s cubic-bezier(.34, 1.56, .64, 1); }
  .m-price::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: -4px; height: 3px; border-radius: 3px; scale: 0 1;
    background: linear-gradient(90deg, transparent, var(--m-brand-2), transparent); transition: scale .9s var(--m-ease) .35s; }
  html.ep-motion .m-price.is-in::after, .m-price:hover::after { scale: 1 1; }
  /* the first banner picture of a page slowly settles (Ken Burns) */
  html.ep-motion .m-banner { animation: m-kenburns 2.4s var(--m-ease) both; }
  @keyframes m-kenburns { from { scale: 1.08; opacity: .4; } }

  /* ---------- buttons ---------- */
  .wa-float { transition: translate .3s var(--m-ease), box-shadow .3s var(--m-ease); }
  .btn, .ep-submit, .wx-btn, .ep-gbtn, .ep-enroll-btn, .rc-btn, .btn-outline {
    position: relative; overflow: hidden; isolation: isolate;
    transition: translate .3s var(--m-ease), box-shadow .3s var(--m-ease), background-color .25s, color .25s, opacity .2s, filter .25s; }
  .btn::after, .ep-submit::after, .wx-btn::after, .ep-gbtn::after, .ep-enroll-btn::after, .rc-btn::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .35) 50%, transparent 75%);
    translate: -120% 0; transition: translate .8s var(--m-ease); }
  @media (hover: hover) {
    .btn:hover, .ep-submit:hover, .wx-btn:hover, .ep-gbtn:hover, .ep-enroll-btn:hover, .rc-btn:hover { translate: 0 -2px;
      box-shadow: 0 10px 24px var(--m-glow); opacity: 1; }
    .btn:hover::after, .ep-submit:hover::after, .wx-btn:hover::after, .ep-gbtn:hover::after, .ep-enroll-btn:hover::after,
    .rc-btn:hover::after { translate: 120% 0; }
    .btn-outline:hover { translate: 0 -2px; box-shadow: 0 10px 24px rgba(93, 7, 138, .18); }
    .btn-outline span { display: inline-block; transition: translate .3s var(--m-ease); }
    .btn-outline:hover span { translate: 4px 0; }
  }
  .btn:active, .ep-submit:active, .wx-btn:active, .ep-gbtn:active { translate: 0 0; scale: .98; }

  /* ---------- cards ---------- */
  .course-card, .mc-card, .post-card-link, .rc-buy, .auth-card, .rc-list, .ls-side, .policy-body, .receipt {
    transition: translate .45s var(--m-ease), box-shadow .45s var(--m-ease), border-color .3s; }
  @media (hover: hover) {
    .course-card:hover, .mc-card:hover { translate: 0 -6px; box-shadow: 0 22px 44px rgba(58, 5, 86, .16); border-color: rgba(93, 7, 138, .35); }
    .post-card-link:hover { translate: 0 -4px; box-shadow: 0 20px 40px rgba(17, 17, 17, .22); }
    .rc-buy:hover { box-shadow: 0 22px 44px rgba(0, 0, 0, .25); }
    .course-card .price { transition: color .3s; }
    .course-card:hover .price { color: var(--m-brand); }
    /* pictures in cards and galleries zoom a little */
    .results-grid a, .wx-tile, .wx-gallery a, .wx-gallery figure { overflow: hidden; display: block; }
    .results-grid img, .wx-tile img, .wx-gallery img { transition: scale .7s var(--m-ease), filter .4s; }
    .results-grid a:hover img, .wx-tile:hover img, .wx-gallery a:hover img { scale: 1.04; filter: saturate(1.08); }
    .wx-icon img { transition: scale .3s var(--m-ease), rotate .3s var(--m-ease); }
    .wx-icon:hover img { scale: 1.15; rotate: -6deg; }
    .footer-social a img, .footer-contact svg { transition: scale .3s var(--m-ease); }
    .footer-social a:hover img { scale: 1.15; }
  }
  .wx-tile { border-radius: 4px; }

  /* ---------- subtle moving backgrounds ---------- */
  .courses { animation: m-pan 40s ease-in-out infinite alternate; }
  @keyframes m-pan { to { background-position: 60% 40%; } }
  .zebra { animation: m-zebra 24s ease-in-out infinite alternate; }
  @keyframes m-zebra { to { translate: -3% 0; } }
  .rc-hero { background-image: radial-gradient(50% 140% at 0% 0%, rgba(142, 43, 201, .45), transparent 60%),
    radial-gradient(40% 120% at 100% 100%, rgba(37, 162, 68, .18), transparent 60%); background-size: 160% 160%;
    animation: m-hero-bg 18s ease-in-out infinite alternate; }

  /* ---------- WhatsApp button: slides in, then a soft ring now and then ---------- */
  html.ep-motion .wa-float { animation: m-wa-in .7s var(--m-ease) 1s both; }
  .wa-float::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; z-index: -1; pointer-events: none;
    box-shadow: 0 0 0 0 rgba(37, 162, 68, .55); animation: m-ring 6s ease-out 3s infinite; }
  @media (hover: hover) { .wa-float:hover { translate: 0 -3px; box-shadow: 0 12px 26px rgba(93, 7, 138, .35); } }
  @keyframes m-wa-in { from { opacity: 0; translate: 0 24px; } }
  @keyframes m-ring { 0% { box-shadow: 0 0 0 0 rgba(37, 162, 68, .5); } 18%, 100% { box-shadow: 0 0 0 14px rgba(37, 162, 68, 0); } }

  /* ---------- forms ---------- */
  .ep-field input, .ep-field textarea { transition: border-color .25s, box-shadow .25s; }
  .ep-field input:focus, .ep-field textarea:focus { box-shadow: 0 6px 0 -4px rgba(93, 7, 138, .25); }
  .ep-check input { transition: scale .2s var(--m-ease); }
  .ep-check input:checked { scale: 1.12; }
}
