/* Элементы страницы (одинаково на сайте, в предпросмотре и в редакторе). */
.page { position: relative; overflow: hidden; transform-origin: 0 0; }
.el { position: absolute; display: block; color: inherit; text-decoration: none; }
.el-lp, .el-rot { width: 100%; height: 100%; }
.el-text .el-lp, .el-text .el-rot { height: auto; }
.tx { white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; min-height: 1em; }
.img { width: 100%; height: 100%; }
.img img { display: block; width: 100%; height: 100%; box-sizing: border-box; user-select: none; }
.img-wait { background: repeating-linear-gradient(135deg, #eef2f7 0 12px, #e2e8f0 12px 24px); border-radius: 6px; }
.img-wait img { visibility: hidden; }
.shp, .ln, .ico { display: block; overflow: visible; }
.ln { position: absolute; left: 0; top: 0; }
a.el { cursor: pointer; }
a.el:focus-visible { outline: 3px solid #2f6bff; outline-offset: 4px; }

/* ---------- Анимации появления (при прокрутке до элемента) ---------- */
.an { opacity: 0; }
.an.in { animation-duration: var(--ad, 800ms); animation-delay: var(--dl, 0ms); animation-fill-mode: both; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
.an.in.no-anim { animation: none !important; opacity: 1; }
.an-fade.in { animation-name: a-fade; }
.an-up.in { animation-name: a-up; }
.an-down.in { animation-name: a-down; }
.an-left.in { animation-name: a-left; }
.an-right.in { animation-name: a-right; }
.an-zoom.in { animation-name: a-zoom; }
.an-pop.in { animation-name: a-pop; animation-timing-function: cubic-bezier(.34, 1.56, .64, 1); }
.an-flip.in { animation-name: a-flip; }
.an-rotate.in { animation-name: a-rotate; }
.an-blur.in { animation-name: a-blur; }
@keyframes a-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes a-up { from { opacity: 0; transform: translateY(60px); } to { opacity: 1; transform: none; } }
@keyframes a-down { from { opacity: 0; transform: translateY(-60px); } to { opacity: 1; transform: none; } }
@keyframes a-left { from { opacity: 0; transform: translateX(80px); } to { opacity: 1; transform: none; } }
@keyframes a-right { from { opacity: 0; transform: translateX(-80px); } to { opacity: 1; transform: none; } }
@keyframes a-zoom { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes a-pop { 0% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: none; } }
@keyframes a-flip { from { opacity: 0; transform: perspective(800px) rotateX(80deg); } to { opacity: 1; transform: none; } }
@keyframes a-rotate { from { opacity: 0; transform: rotate(-25deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes a-blur { from { opacity: 0; filter: blur(18px); } to { opacity: 1; filter: none; } }

/* ---------- Постоянные анимации ---------- */
.lp-pulse { animation: l-pulse 2.2s ease-in-out infinite; }
.lp-float { animation: l-float 3.2s ease-in-out infinite; }
.lp-spin { animation: l-spin 8s linear infinite; }
.lp-swing { animation: l-swing 2.6s ease-in-out infinite; transform-origin: 50% 0; }
.lp-shake { animation: l-shake 3s ease-in-out infinite; }
.lp-beat { animation: l-beat 1.4s ease-in-out infinite; }
@keyframes l-pulse { 50% { transform: scale(1.06); } }
@keyframes l-float { 50% { transform: translateY(-14px); } }
@keyframes l-spin { to { transform: rotate(360deg); } }
@keyframes l-swing { 25% { transform: rotate(6deg); } 75% { transform: rotate(-6deg); } }
@keyframes l-shake { 0%, 84%, 100% { transform: none; } 87% { transform: translateX(-6px) rotate(-2deg); } 90% { transform: translateX(6px) rotate(2deg); } 93% { transform: translateX(-4px); } 96% { transform: translateX(4px); } }
@keyframes l-beat { 0%, 40%, 100% { transform: scale(1); } 20% { transform: scale(1.12); } 60% { transform: scale(1.06); } }

@media (prefers-reduced-motion: reduce) {
  .an { opacity: 1 !important; animation: none !important; }
  [class*="lp-"] { animation: none !important; }
}

/* Масштаб страницы под ширину окна */
.view-outer { position: relative; width: 100%; overflow: hidden; }
.view-scale { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
