/* Eruditica Press journal-pages motion layer (2026-10-08) — the landing page's design language on every public OJS page.
   Compositor-only effects (transform/opacity via CSS transitions started by IntersectionObserver, CSS scroll-driven
   animations, one WAAPI-free curtain). Scoped to html.epj, which the inline guard in the journal customHeaders adds only on
   public pages, only when motion is allowed (OS setting or the visitor's Motion switch), and removes after 3 s if the JS
   never boots. Page rules of the journal stylesheet load after customHeaders, so every selector is prefixed `html.epj`. */

:root { --epj-out: cubic-bezier(.16,1,.3,1); --epj-spring: cubic-bezier(.34,1.56,.64,1); }
@property --epj-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

/* ---------------------------------------------------------------- page enter */
@keyframes epjIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
html.epj .pkp_structure_main > .page,
html.epj .pkp_structure_main > .page_index_journal,
html.epj .pkp_structure_main > div:not(#pkp_content_main) {
  animation: epjIn .9s var(--epj-out) both !important;
}
html.epj .pkp_structure_sidebar { animation: epjIn 1.1s var(--epj-out) .12s both !important; }
@keyframes epjDown { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
html.epj header.site-head { animation: epjDown .8s var(--epj-out) both !important; }

/* ---------------------------------------------------------------- curtains (intro once per session, arrive after an in-site navigation) */
html.epj-intro body::after, html.epj-arrive body::after {
  content: ""; position: fixed; inset: 0; z-index: 99990; pointer-events: none; background: #2b1834; transform-origin: 50% 0%;
  transition: transform .9s cubic-bezier(.76,0,.24,1), opacity .3s .9s !important;
}
html.epj-intro body::after { background: radial-gradient(60% 50% at 50% 50%, rgba(0,194,168,.18), transparent 70%), #2b1834; }
html.epj-intro body::before {
  content: "EP"; position: fixed; z-index: 99991; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; display: grid; place-items: center;
  font: 700 20px/1 "IBM Plex Mono", ui-monospace, monospace; color: #fff; background: #2b1834; border: 2px solid #ff4d5e; box-shadow: 7px 7px 0 #00c2a8; pointer-events: none;
  animation: epjMark .8s var(--epj-out) both !important;
}
html.epj-go body::after { transform: scaleY(0); opacity: 0; }
html.epj-go body::before { animation: epjMarkOut .5s cubic-bezier(.76,0,.24,1) forwards !important; }
@keyframes epjMark { from { opacity: 0; transform: scale(.6) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes epjMarkOut { to { opacity: 0; transform: translateY(-30px) scale(.8); } }
.epj-leave { position: fixed; inset: 0; z-index: 99990; pointer-events: none; background: #2b1834; transform: scaleY(0); transform-origin: 50% 100%; transition: transform .5s cubic-bezier(.76,0,.24,1) !important; }
.epj-leave.on { transform: scaleY(1); }

/* ---------------------------------------------------------------- scroll reveals (data-epj set by JS, .epj-rv added by IntersectionObserver) */
html.epj [data-epj] { opacity: 0; transition: opacity .9s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform 1.1s var(--epj-out) var(--d, 0s) !important; }
html.epj [data-epj="rise"]  { transform: translateY(44px); }
html.epj [data-epj="scale"] { transform: translateY(32px) scale(.94); }
html.epj [data-epj="side"]  { transform: translateX(-30px); }
html.epj [data-epj="pop"]   { transform: translateY(22px) scale(.86); transition: opacity .6s ease var(--d, 0s), transform 1s var(--epj-spring) var(--d, 0s) !important; }
html.epj [data-epj].epj-rv  { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- hover polish (buttons, cards) */
html.epj .cmp_button, html.epj .pkp_button, html.epj a.obj_galley_link, html.epj button.submit, html.epj .cmp_button_wire {
  transition: transform .4s var(--epj-out), box-shadow .4s var(--epj-out), background-color .25s, color .25s !important;
}
html.epj .cmp_button:hover, html.epj .pkp_button:hover, html.epj a.obj_galley_link:hover, html.epj button.submit:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(16,26,61,.45); }
html.epj .obj_issue_summary, html.epj .obj_article_summary, html.epj .ep-step, html.epj .cmp_article_list > li, html.epj .search_results > li {
  transition: transform .45s var(--epj-out), box-shadow .45s var(--epj-out) !important;
}
html.epj .obj_issue_summary:hover, html.epj .obj_article_summary:hover, html.epj .ep-step:hover, html.epj .search_results > li:hover { transform: translateY(-4px); box-shadow: 0 22px 38px -26px rgba(0,0,0,.55); }
html.epj main.wrap .card { transition: transform .45s var(--epj-out), box-shadow .45s var(--epj-out) !important; }
html.epj main.wrap button, html.epj main.wrap .btn, html.epj main.wrap a.button { transition: transform .4s var(--epj-out), box-shadow .4s var(--epj-out), background-color .25s !important; }
html.epj main.wrap button:hover, html.epj main.wrap .btn:hover, html.epj main.wrap a.button:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -12px rgba(16,26,61,.45); }
html.epj .pkp_structure_main a:not(.cmp_button):not(.pkp_button) { transition: color .25s, background-color .25s, text-decoration-color .25s; }

/* ---------------------------------------------------------------- reading progress (scroll-driven, compositor) */
.epj-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 99980; pointer-events: none; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #ff4d5e, #ffd166 45%, #00c2a8); box-shadow: 0 0 12px rgba(0,194,168,.55); display: none; }
@keyframes epjProg { to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) { html.epj .epj-progress { display: block; animation: epjProg linear both !important; animation-duration: auto !important; animation-timeline: scroll(root) !important; } }

/* ---------------------------------------------------------------- motion on/off switch (same control as the landing page) */
.epm-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 99970; display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 12px 0 14px;
  border: 0; cursor: pointer; color: #fff; font: 700 12px/1 "Inter", system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(16,26,61,.94); border-radius: 16px; corner-shape: squircle;
  box-shadow: 3px 3px 0 #00c2a8, 0 14px 30px -12px rgba(16,26,61,.6), inset 0 1px 0 rgba(255,255,255,.12);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s cubic-bezier(.2,.7,.2,1) !important;
}
@supports (corner-shape: squircle) { .epm-toggle { border-radius: 24px; } }
.epm-toggle:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 #ff4d5e, 0 18px 34px -14px rgba(16,26,61,.7), inset 0 1px 0 rgba(255,255,255,.12); }
.epm-toggle:focus-visible { outline: 2px solid #ffd166; outline-offset: 3px; }
.epm-toggle-ic { color: #ffd166; font-size: 13px; }
.epm-toggle-sw { position: relative; width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); transition: background-color .25s !important; }
.epm-toggle-sw i { position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .26s cubic-bezier(.2,.7,.2,1) !important; }
.epm-toggle.is-on .epm-toggle-sw { background: #00c2a8; }
.epm-toggle.is-on .epm-toggle-sw i { transform: translateX(16px); }
.epm-toggle-st { min-width: 24px; color: #c6d0f2; font-size: 11px; }
.epm-toggle.is-on .epm-toggle-st { color: #00c2a8; }
@media (max-width: 620px) { .epm-toggle { right: 12px; bottom: 12px; height: 40px; } .epm-toggle-lb { display: none; } }
@media print { .epm-toggle, .epj-progress, .epj-leave { display: none !important; } }
@media (prefers-reduced-motion: reduce) { html:not(.epj-force) .epj-progress { display: none !important; } }
