/* QMD preloader «Калибровка» (variant A, approved 13.10.2026). Shown once per session on pages with a 3D chapter
   (home, the three verification directions). The inline gate in <head> adds html.pl-on before the first paint;
   preloader.js drives it from window.__qmdWarm and removes it. Source and notes: proto-preloader/README.md. */
.qmd-pl { --g: 64px; --hd: 92px; position: fixed; inset: 0; z-index: 1000; overflow: hidden; background: #0c0f11; color: #e9edef;
  font: 400 16px/1.55 'Onest', system-ui, sans-serif; -webkit-user-select: none; user-select: none; cursor: progress; contain: strict;
  animation: pl-failsafe .4s 8s forwards; }
@media (max-width: 1150px) { .qmd-pl { --g: 36px; } }
@media (max-width: 760px) { .qmd-pl { --g: 22px; --hd: 76px; } }
html:not(.pl-on) .qmd-pl { display: none; }
.qmd-pl.is-live { background: transparent; animation: none; }
@keyframes pl-failsafe { to { opacity: 0; visibility: hidden; } }
.pl-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pl-layer { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.pl-mark { position: absolute; left: var(--g); top: calc(var(--hd) / 2); transform: translateY(-50%); font-weight: 500; font-size: 20px; line-height: 1; letter-spacing: .04em; }
.pl-mark span { color: #5fd091; }
.pl-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; line-height: 1.6; letter-spacing: .08em; text-transform: uppercase; }
.pl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.pl-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); color: #788890; opacity: 0; transition: opacity .5s; white-space: nowrap; }
.pl-hint.is-on { opacity: 1; }

/* A — «Калибровка» */
.pl-a .pl-kick { position: absolute; right: var(--g); top: calc(var(--hd) / 2); transform: translateY(-50%); margin: 0; color: #9aa6ab; }
.qmd-pl:not(.is-live) .pl-tag { opacity: 0; }
.pl-a .pl-tag { position: absolute; left: 0; top: 0; white-space: nowrap; color: #e9edef; font-variant-numeric: tabular-nums; }
.pl-a .pl-tag b { font-weight: 400; color: #788890; margin-right: .35em; }
.pl-a .pl-tag.is-zero, .pl-a .pl-tag.is-zero b { color: #5fd091; }
.pl-a .pl-count { position: absolute; left: var(--g); bottom: 40px; display: flex; align-items: flex-start; }
.pl-a .pl-count-cap { position: absolute; left: .1em; top: -10px; color: #9aa6ab; }
.pl-a .pl-digits { display: flex; font: 300 clamp(104px, 16vw, 236px)/1 'Onest', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.pl-a .pl-col { display: block; height: 1em; overflow: hidden; width: .6em; margin-right: -.02em;
  -webkit-mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(transparent, #000 16%, #000 84%, transparent); }
.pl-a .pl-strip { display: block; will-change: transform; }
.pl-a .pl-strip i { display: block; height: 1em; font-style: normal; text-align: center; }
.pl-a .pl-pct { margin: 1.2em 0 0 .9em; color: #9aa6ab; font-size: 14px; }
.pl-a .pl-status { position: absolute; right: var(--g); bottom: 58px; text-align: right; display: grid; gap: 2px; }
.pl-a .pl-status span:first-child { color: #788890; }
.pl-a .pl-state.is-ok { color: #5fd091; }
.pl-a .pl-state.is-ok::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #5fd091; margin: 0 .7em .1em 0; vertical-align: middle; }
@media (max-width: 760px) {
  .pl-a .pl-kick .pl-long { display: none; }
  .pl-a .pl-count { bottom: 46px; }
  .pl-a .pl-status { bottom: 62px; }
  .pl-a .pl-pct { margin-left: .4em; }
}

/* The page under the overlay arrives as the screen opens: --qmd-intro goes 0 → 1 during the exit, then html.pl-on is
   removed and the page has no transform at all (1.04 − 0.04 × 1 = 1, so nothing jumps). */
html.pl-on [data-page] { transform: scale(calc(1.04 - 0.04 * var(--qmd-intro, 0))); transform-origin: 50% 40vh;
  opacity: calc(0.35 + 0.65 * var(--qmd-intro, 0)); will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) { html.pl-on [data-page] { transform: none; } }
