/* 3DMake v2: сцена на всю страницу, карточки-чертежи, экран загрузки, печатающийся текст, курсор-сопло. Файл написан вручную. */

/* ---------- печатающийся текст ---------- */
[data-print] { position: relative; }
[data-print] .pt { display: block; -webkit-mask-image: linear-gradient(to top, #000 calc(var(--r, 1) * 100%), transparent calc(var(--r, 1) * 100%));
  mask-image: linear-gradient(to top, #000 calc(var(--r, 1) * 100%), transparent calc(var(--r, 1) * 100%)); }
[data-print]::after { content: ""; position: absolute; left: -2%; right: -2%; bottom: calc(var(--r, 1) * 100%); height: 2px; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: linear-gradient(90deg, transparent, #ff8c4a 20%, #fff 50%, #ff8c4a 80%, transparent); box-shadow: 0 0 12px 2px rgba(255, 106, 26, .7); }
[data-print]::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--r, 1) * 100%); pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(to top, rgba(20, 20, 21, .6) 0 1px, transparent 1px 3px); }
[data-print].printing::after, [data-print].printing::before { opacity: 1; }
.reduce [data-print] .pt { -webkit-mask-image: none; mask-image: none; }

/* ---------- курсор-сопло и клики (только мышь) ---------- */
.cur-dot, .cur-ring { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity .2s; will-change: transform; }
.cur-dot { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: #ff8c4a; box-shadow: 0 0 10px 2px rgba(255, 106, 26, .75); }
.cur-ring { width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 1px solid rgba(255, 140, 74, .55); transition: opacity .2s, border-color .2s, background-color .2s; }
.cur-ring.hot { border-color: rgba(255, 140, 74, .95); background: rgba(255, 106, 26, .14); }
.cur-on .cur-dot, .cur-on .cur-ring { opacity: 1; }
.cur-on:not(.cur-text), .cur-on:not(.cur-text) * { cursor: none !important; }
.cur-text .cur-dot, .cur-text .cur-ring { opacity: 0; }
.click-fx, .tap-fx { position: fixed; width: 0; height: 0; z-index: 9998; pointer-events: none; }
.click-fx::before, .tap-fx::before { content: ""; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #ff8c4a; animation: cfxr .5s ease-out forwards; }
.click-fx i { position: absolute; left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%; background: #ff8c4a; box-shadow: 0 0 6px #ff6a1a; animation: cfx .6s cubic-bezier(.2, .7, .3, 1) forwards; }
@keyframes cfx { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@keyframes cfxr { to { transform: scale(7); opacity: 0; } }

/* ---------- экран загрузки ---------- */
#boot { position: fixed; inset: 0; z-index: 200; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: #141415; --bp: 0;
  transition: opacity .6s ease, visibility .6s ease; }
.js #boot { display: flex; }
#boot.out { opacity: 0; visibility: hidden; }
.boot-logo { position: relative; width: min(36vw, 190px); aspect-ratio: 1; }
.boot-logo svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-logo .bl-ghost { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: .7; stroke-dasharray: 2 2; }
.boot-logo .bl-fill { fill: url(#bootg); clip-path: inset(calc((1 - var(--bp)) * 100%) 0 0 0); }
.boot-logo .bl-line { position: absolute; left: -12%; right: -12%; bottom: calc(var(--bp) * 100%); height: 2px; background: linear-gradient(90deg, transparent, #ff8c4a, #fff, #ff8c4a, transparent); box-shadow: 0 0 14px 3px rgba(255, 106, 26, .75); }
.boot-pct { font: 500 1.7rem var(--mono, monospace); color: #fff; letter-spacing: .04em; }
.boot-status, .boot-layer { font: 500 .74rem var(--mono, monospace); letter-spacing: .14em; text-transform: uppercase; color: rgba(217, 221, 230, .62); text-align: center; }
.boot-layer { color: var(--accent, #ff772e); }
.boot-bar { width: min(60vw, 280px); height: 3px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: calc(var(--bp) * 100%); background: linear-gradient(90deg, #ff6a1a, #ff9055); }

/* ---------- сцена на всю страницу ---------- */
#stage { position: fixed; top: 0; left: 0; width: 100%; height: 100%; height: 100lvh; z-index: 0; display: block; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.stage-on #stage { opacity: 1; }   /* до готовности сцены холст скрыт (прогрев идёт на крошечном холсте) */
.stage-poster { display: none; }
.stage-fail .stage-poster, .reduce .stage-poster { display: block; position: fixed; inset: 0; z-index: 0; }
.stage-poster img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.stage-fail #stage, .reduce #stage { display: none; }
.stage-run { position: relative; z-index: 2; height: calc(var(--beats, 6) * 100vh); }
.stage-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage-fail .stage-run, .reduce .stage-run { height: auto; }
.stage-fail .stage-sticky, .reduce .stage-sticky { position: relative; height: auto; overflow: visible; padding: calc(var(--nav-h) + 24px) clamp(16px, 5vw, 72px) 40px; display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.after { position: relative; z-index: 3; background: rgba(20,20,21,.74); }   /* принтер виден сквозь зону под сценой */

.slot { position: absolute; top: 50%; height: 0; width: min(27vw, 360px); }
.slot-l { left: clamp(16px, 3.2vw, 64px); }
.slot-r { right: clamp(16px, 3.2vw, 64px); }
.slot > .pcard { position: absolute; left: 0; right: 0; top: 0; transform: translateY(-50%); }
.stage-fail .slot, .reduce .slot { position: static; height: auto; width: auto; display: contents; }
.stage-fail .slot > .pcard, .reduce .slot > .pcard { position: relative; transform: none; opacity: 1 !important; --p: 1 !important; pointer-events: auto !important; }

.pcard { --p: 0; opacity: 0; }
.pcard .pc-bp { position: absolute; inset: 0; border: 1px dashed rgba(255, 119, 46, .6); border-radius: 8px; opacity: calc(1 - var(--p) * .88); pointer-events: none;
  background: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 16px 16px, linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 16px 16px, rgba(20, 20, 21, .35); }
.pcard .pc-bp svg { position: absolute; right: 14px; top: 14px; width: 64px; height: 64px; --ln: rgba(255, 140, 74, .85); --fl: transparent; }
.pcard .pc-bp .dm { position: absolute; font: 500 .6rem var(--mono, monospace); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 160, 110, .8); }
.pcard .pc-bp .dm.a { left: 12px; top: 8px; } .pcard .pc-bp .dm.b { left: 12px; bottom: 8px; } .pcard .pc-bp .dm.c { right: 12px; bottom: 8px; }
.pcard .pc-bp::before, .pcard .pc-bp::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid #ff8c4a; }
.pcard .pc-bp::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.pcard .pc-bp::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.pcard .pc-fin { position: relative; display: block; padding: 18px 18px 16px; border-radius: 8px; color: var(--text, #f4f8ff); text-decoration: none; background: rgba(26, 26, 28, .74);
  border: 1px solid var(--line, rgba(180, 185, 195, .22)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to top, #000 calc(var(--p) * 100%), transparent calc(var(--p) * 100%)); mask-image: linear-gradient(to top, #000 calc(var(--p) * 100%), transparent calc(var(--p) * 100%)); }
.pcard .pc-fin svg.pic { display: block; width: 54px; height: 54px; margin-bottom: 10px; --ln: #ff9055; --fl: rgba(255, 119, 46, .9); }
.pcard .pc-fin .pic .fl { opacity: calc((var(--p) - .45) * 2); }
.pcard .pc-fin .num { font: 500 .72rem var(--mono, monospace); letter-spacing: .14em; color: var(--accent, #ff772e); }
.pcard .pc-fin h3 { margin: 4px 0 6px; font: 700 1.35rem/1.15 var(--sans); letter-spacing: -.02em; color: #fff; border: 0; padding: 0; text-transform: none; }
.pcard .pc-fin p { margin: 0; font: 400 .9rem/1.5 var(--sans); color: rgba(224, 228, 237, .82); }
.pcard .pc-fin .go { display: inline-block; margin-top: 10px; font: 600 .85rem var(--sans); color: var(--accent, #ff772e); }
.pcard a.pc-fin:hover { border-color: var(--accent, #ff772e); }
.pcard::after { content: ""; position: absolute; left: -3%; right: -3%; bottom: calc(var(--p) * 100%); height: 2px; border-radius: 1px; opacity: 0; pointer-events: none; transition: opacity .15s;
  background: linear-gradient(90deg, transparent, #ff8c4a 25%, #fff 50%, #ff8c4a 75%, transparent); box-shadow: 0 0 12px 2px rgba(255, 106, 26, .7); }
.pcard.printing::after { opacity: 1; }

/* крупные тексты первого экрана и финала */
.hero-copy, .end-copy { position: absolute; z-index: 2; left: clamp(20px, 5.2vw, 100px); top: 50%; transform: translateY(-52%); width: min(42vw, 620px); }
.hero-copy h1 { font: 700 clamp(2.9rem, 5.9vw, 6.2rem)/.98 var(--sans); letter-spacing: -.045em; color: #fff; margin: 0 0 .3em; }
.hero-copy h1 span { color: var(--accent); }
.hero-copy .lead { font: 400 clamp(1.1rem, 1.6vw, 1.5rem)/1.4 var(--sans); color: rgba(224, 228, 237, .9); max-width: 18em; margin: 0; }
.hero-copy .cta, .end-copy .cta { margin-top: clamp(1.4rem, 3vw, 2.2rem); display: flex; gap: 16px 24px; flex-wrap: wrap; align-items: center; }
.hero-copy .btn.big, .end-copy .btn.big { min-height: 60px; padding: 0 2em; font-size: 1.1rem; }
.hero-copy .scrollhint { margin: 1.4rem 0 0; font: 500 .76rem var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(217, 221, 230, .7); display: flex; gap: 10px; align-items: center; }
.hero-copy .scrollhint::before { content: ""; width: 1px; height: 28px; background: linear-gradient(180deg, var(--accent), transparent); }
.end-copy h2 { font: 700 clamp(2rem, 4vw, 3.6rem)/1.05 var(--sans); letter-spacing: -.035em; color: #fff; margin: 0 0 .4em; }
.end-copy p { color: rgba(224, 228, 237, .88); font: 400 1.15rem/1.5 var(--sans); margin: 0; max-width: 24em; }
.stage-fail .hero-copy, .stage-fail .end-copy, .reduce .hero-copy, .reduce .end-copy { position: relative; left: auto; top: auto; transform: none; width: auto; grid-column: 1 / -1; opacity: 1 !important; }

.hudcard { position: absolute; z-index: 2; right: clamp(14px, 2vw, 48px); top: calc(var(--nav-h, 76px) + clamp(18px, 6vh, 64px)); width: clamp(224px, 17vw, 300px); }
.hudcard .hud { position: static; opacity: 1; transform: none; display: block; }
@media (max-width: 1180px) { .hudcard { display: none; } }
.stage-fail .hudcard, .reduce .hudcard { display: none; }

/* ---------- телефон: принтер сверху, карточки снизу ---------- */
@media (max-width: 820px) {
  .stage-run { height: calc(var(--beats, 6) * 90vh); }
  .hero-copy { left: 20px; right: 20px; width: auto; top: calc(var(--nav-h, 76px) + 16px); transform: none; }
  .hero-copy h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  .end-copy { left: 20px; right: 20px; width: auto; top: auto; bottom: 18px; transform: none; }
  .end-copy h2 { font-size: 1.9rem; }
  .slot { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; height: 0; }
  .slot-l { bottom: 172px; }
  .slot > .pcard { top: auto; bottom: 0; transform: none; }
  .pcard .pc-fin { padding: 12px 14px; }
  .pcard .pc-fin svg.pic { width: 34px; height: 34px; float: left; margin: 2px 12px 0 0; }
  .pcard .pc-fin h3 { font-size: 1.1rem; margin: 0 0 3px; }
  .pcard .pc-fin p { font-size: .8rem; line-height: 1.4; }
  .pcard .pc-fin .go { display: none; }
  .pcard .pc-bp svg { display: none; }
}

/* ---------- карточка станка (HUD) ---------- */
.hud { padding: 16px 18px 12px; border-radius: 8px; background: rgba(26, 26, 27, .58); border: 1px solid rgba(176, 180, 187, .26); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(7, 7, 8, .4); font: 600 .84rem var(--sans); }
.hud .hh { display: flex; flex-direction: column; color: rgba(236, 244, 255, .95); font: 500 .74rem var(--mono); }
.hud .hh b { align-self: flex-end; font: 500 1.55rem/1.1 var(--mono); color: #fff; }
.hud .hbar { height: 8px; margin: 8px 0 10px; border-radius: 999px; background: rgba(190, 194, 202, .16); overflow: hidden; }
.hud .hbar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #ff6a1a, #ff9055); }
.hud .hl { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(190, 194, 202, .12); color: rgba(217, 221, 230, .78); font: 500 .74rem var(--mono); }
.hud .hl svg { width: 18px; height: 18px; flex: none; fill: none; stroke: rgba(217, 221, 230, .8); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hud .hl span { flex: 1; white-space: nowrap; }
.hud .hl b { font-weight: 500; white-space: nowrap; }
.boot-logo .bl-fill path { fill: url(#bootg); }
.boot-logo .bl-ghost path { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: .7; stroke-dasharray: 2 2; }
body.stage-home { background-attachment: fixed; }

/* анимация входа main (site.css) создаёт «содержащий блок» и ломает position: fixed у сцены — на главной отключаем */
.stage-home main { animation: none; transform: none; }

/* блоки под сценой печатаются при появлении (fx.js) */
.pr { position: relative; --p: 0; }
.pr:not(.pr-done) { -webkit-mask-image: linear-gradient(to top, #000 calc(var(--p) * 100%), transparent calc(var(--p) * 100%)); mask-image: linear-gradient(to top, #000 calc(var(--p) * 100%), transparent calc(var(--p) * 100%)); }
.pr-line { position: absolute; left: 0; right: 0; bottom: calc(var(--p) * 100% - 2px); height: 2px; border-radius: 1px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ff8c4a 25%, #fff 50%, #ff8c4a 75%, transparent); box-shadow: 0 0 12px 2px rgba(255, 106, 26, .7); }
.pr.pr-on > .pr-line { opacity: 1; }
.pr-done > .pr-line { display: none; }
