/* Pages change with a light push forward and back (see below). No decorative rules. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.page-transition-veil {
  display: none; position: fixed; inset: 0; background: var(--paper);
  pointer-events: none; z-index: 90;
}
::view-transition { background: var(--paper); pointer-events: none; }
::view-transition-image-pair(*) { isolation: auto; }
::view-transition-old(*), ::view-transition-new(*) { mix-blend-mode: normal; }
/* Change of page (2026-11-16, Max: «плавный, как в хороших машинах или интерфейсах… вперёд и назад, реверс, с лёгким
   интерфейсным движением»). Forward: the page being left eases a little to the left and fades, the new one arrives from a
   few per cent on the right; back (history, or to a page higher up: public/transitions.js sets data-page-direction) the
   same in mirror. One curve for both, quick at the start and long in the settle, like a system push. The masthead does not
   travel with the page: it keeps its place (or eases in, if one page had it tucked away). */
:root { --vt-ease: cubic-bezier(.32, .72, 0, 1); --vt-time: .56s; }
.site-chrome { view-transition-name: te-head; }
/* an open menu or dialog is part of the page's picture, so the masthead is not pictured over it */
body.nav-open .site-chrome, html:has(dialog[open]) .site-chrome, html[data-intro] .site-chrome { view-transition-name: none; }
::view-transition-group(root) { animation-duration: var(--vt-time); }
::view-transition-old(root) { animation: te-push-out var(--vt-time) var(--vt-ease) both; }
::view-transition-new(root) { animation: te-push-in var(--vt-time) var(--vt-ease) both; }
html[data-page-direction=back]::view-transition-old(root) { animation-name: te-pop-out; }
html[data-page-direction=back]::view-transition-new(root) { animation-name: te-pop-in; }
::view-transition-group(te-head) { z-index: 2; animation-duration: var(--vt-time); animation-timing-function: var(--vt-ease); }
::view-transition-image-pair(te-head) { isolation: isolate; }
::view-transition-old(te-head) { animation: te-head-out .28s linear both; mix-blend-mode: plus-lighter; }
::view-transition-new(te-head) { animation: te-head-in .28s linear both; mix-blend-mode: plus-lighter; }
@keyframes te-push-out { 0% { transform: none; opacity: 1; } 38% { opacity: 0; } 100% { transform: translateX(-3.5%); opacity: 0; } }
@keyframes te-push-in { 0% { transform: translateX(7%); opacity: 0; } 22% { opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes te-pop-out { 0% { transform: none; opacity: 1; } 38% { opacity: 0; } 100% { transform: translateX(3.5%); opacity: 0; } }
@keyframes te-pop-in { 0% { transform: translateX(-7%); opacity: 0; } 22% { opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes te-head-out { to { opacity: 0; } }
@keyframes te-head-in { from { opacity: 0; } }
@media (max-width: 760px) { :root { --vt-time: .48s; } }

:root[data-page-engine=fallback][data-page-transition=leaving] #main {
  animation: te-page-depart .4s ease-out both;
}
:root[data-page-engine=fallback][data-page-transition=arriving] #main {
  animation: te-page-enter .64s ease-out both;
}
:root[data-page-engine=fallback][data-page-transition=arriving] .page-transition-veil {
  display: block; animation: te-veil-open .64s cubic-bezier(.2, .2, .6, 1) both;
}
/* Never transform main: article players and the photographic cover are fixed. */
:root[data-page-engine=fallback][data-page-transition=arriving] :is(.hero-copy, .page-intro, .feature-heading) {
  animation: te-heading-enter .64s cubic-bezier(.2, .2, .6, 1) both;
}
@keyframes te-spread-out {
  to { opacity: 0; transform: translateX(-3vw) scale(.98); filter: blur(6px); }
}
@keyframes te-spread-in {
  from { clip-path: ellipse(0% 110% at 100% 50%); transform: translateX(3vw); filter: blur(3px); }
  to { clip-path: ellipse(113% 110% at 100% 50%); transform: none; filter: blur(0); }
}
@keyframes te-spread-back-out {
  to { opacity: 0; transform: translateX(3vw) scale(.98); filter: blur(6px); }
}
@keyframes te-spread-back-in {
  from { clip-path: ellipse(0% 110% at 0% 50%); transform: translateX(-3vw); filter: blur(3px); }
  to { clip-path: ellipse(113% 110% at 0% 50%); transform: none; filter: blur(0); }
}
@keyframes te-veil-open {
  from { clip-path: ellipse(113% 110% at 0% 50%); }
  to { clip-path: ellipse(0% 110% at 0% 50%); }
}
@keyframes te-heading-enter { from { transform: translateY(20px); } to { transform: none; } }
@keyframes te-page-fade-out { to { opacity: 0; } }
@keyframes te-page-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes te-page-depart { to { opacity: .84; } }
@keyframes te-page-enter { from { opacity: .3; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce), print {
  @view-transition { navigation: none; }
  .page-transition-veil { display: none !important; }
  :root[data-page-transition] #main, :root[data-page-transition] :is(.hero-copy, .page-intro, .feature-heading) { animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
