/* Шапка, первый экран и «Как всё устроено» (финальный макет naydi-hero-final, 30.11; body.hero-v2).
   Сцена .h3-scene — единая система координат для картинки, дыма и конверта (в % её ширины/высоты), картинка не обрезается.
   Компьютер (>1050): сцена во всю ширину снизу, текст колонкой слева (≤47 %). Телефон и планшет: текст и кнопка выше сцены. */
.hero-v2{--h2-cream:#fff0d4;--h2-muted:#e2eaf6;--h2-gold:#ffda8b;--h2-sky:#031630;--h2-night:#041e3b}
.hero-v2 .snowcap{display:none}

/* ——— шапка поверх сцены ——— */
.hero-v2 header.top{position:absolute;top:0;left:0;right:0;z-index:6;max-width:1320px;margin:0 auto;padding:10px 50px;min-height:0;
  display:flex;align-items:center;justify-content:space-between;gap:20px}
.hero-v2 .top .brand{--logo-h:76px}
.h2-links{display:flex;gap:clamp(12px,2vw,30px);font:800 clamp(13px,1.15vw,17px)/1.2 var(--ui)}
.h2-links a{color:var(--h2-cream);text-decoration:none;text-shadow:0 1px 4px #03132b}
.h2-links a:hover{color:var(--h2-gold)}
.h2-login{flex:none;padding:9px 26px;border-radius:999px;border:1.5px solid #d6b472;color:var(--h2-cream);font:800 15px/1.2 var(--ui);text-decoration:none;background:#03132b40}
.h2-login:hover{border-color:var(--h2-gold);color:var(--h2-gold)}

/* ——— первый экран ——— */
/* по горизонтали сцена обрезается (она шире экрана), по вертикали — нет: низ конверта ложится на следующий блок */
.hero2{position:relative;z-index:2;isolation:isolate;overflow:hidden;overflow:clip visible;background:var(--h2-sky);display:flex;flex-direction:column;min-height:max(565px,45.51vw)}
.h3-scene{position:absolute;top:0;bottom:0;right:0;left:auto;height:100%;width:auto;min-width:100%;aspect-ratio:1859/846;z-index:0;isolation:isolate;
  --chimney-x:95.8%;--chimney-y:32.5%;--puff-size:6.5%}
.h3-scene picture,.h3-scene picture img{display:block;width:100%;height:100%}
.h3-scene::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(0deg,var(--night),transparent 12%)}
.h3-copy{position:relative;z-index:4;width:min(1320px,calc(100% - 100px));margin:0 auto;padding:clamp(110px,9vw,150px) 0 40px}
.h3-copy>*{max-width:47%}
.h3-copy>h1{max-width:58%}
.h2-eyebrow{display:inline-flex;align-items:center;gap:8px;margin:0;padding:7px 15px;border-radius:999px;background:linear-gradient(#b03938,#8c202b);border:1px solid #cb584b;
  color:#ffead0;font:800 15px/1.2 var(--ui)}
/* заголовок — как раньше: белый «снежный» Nunito 900 (владелец 30.11) */
.hero2 h1{margin:13px 0 19px;font:900 clamp(42px,4.2vw,72px)/1.08 var(--ui);letter-spacing:-.01em;color:var(--snow);text-shadow:0 2px 10px #0008}
.h2-sub{margin:0 0 25px;max-width:min(47%,30ch)!important;font:600 clamp(17px,1.58vw,23px)/1.43 var(--ui);color:var(--h2-muted);text-shadow:0 1px 5px var(--h2-sky)}
.h2-cta{min-width:285px;min-height:58px;font-size:22px}
.hero2 .cta-note{margin:12px 0 20px;text-align:left;color:var(--h2-muted);font-size:clamp(13px,1.1vw,16px);text-shadow:0 1px 4px var(--h2-sky),0 1px 2px var(--h2-sky)}
.h2-facts{list-style:none;margin:0;padding:0;display:flex;gap:clamp(12px,2vw,30px);align-items:center}
.h2-facts li{display:flex;align-items:center;gap:8px;font:800 clamp(11px,1vw,15px)/1.3 var(--ui);color:var(--h2-cream);text-shadow:0 1px 4px var(--h2-sky)}
.h2-facts svg{width:27px;height:27px;flex:none;fill:none;stroke:var(--h2-gold);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* конверт V3 (naydi-letter-v3): основа, лист в «колодце» с обрезкой снизу, передний карман с печатью и тенью — одна
   система координат 1027×1038; наклонён весь конверт (−5°), а не слои по отдельности. Текст — наш рукописный шрифт. */
/* место конверта — перед Дедом Морозом, от правого края сцены; когда сцена шире экрана (первый экран выше 45 % ширины),
   отступ и размер ограничены шириной окна, чтобы конверт не заезжал на текст и кнопку */
.h3-env{position:absolute;z-index:3;left:auto;right:min(33%,30vw);bottom:1%;width:min(24%,25vw);pointer-events:none}
.nl{position:relative;isolation:isolate;container-type:inline-size;aspect-ratio:1027/1038;width:100%;rotate:-5deg;opacity:0;transition:opacity .45s ease-out}
/* конверт показывается целиком, когда загрузились все слои (скрипт index.html), а не собирается на глазах по слоям */
.nl.ready{opacity:1}
.nl-layer{position:absolute;inset:0;width:100%;height:100%;display:block;pointer-events:none;user-select:none}
.nl-base{z-index:1}.nl-pocket{z-index:4}
.nl-well{position:absolute;inset:0;z-index:2;overflow:hidden;clip-path:inset(0 0 1.7% 0 round 0 0 1.5% 1.5%)}
.nl-sheet{position:absolute;left:9.1%;top:30.8%;width:81.8%;height:65.5%;color:#482b1a;text-align:center}
.nl-sheet>img{position:absolute;inset:0;width:100%;height:100%}
.nl-copy{position:absolute;top:13%;left:8%;right:8%;font:400 4.6cqw/1.2 var(--hand)}
.nl-copy p{margin:0}
.nl-greet{color:#a62624;font-size:6.2cqw;line-height:1.1;margin-bottom:2.6cqw!important}
.nl-sign{color:#a62624;font-size:5.2cqw;margin-top:2.2cqw!important}


/* дым из трубы: 12 облачков по 9,6 с со сдвигом 0,8 с и две постоянные струйки у основания; только transform/opacity */
.smoke{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;opacity:.78}
.smoke-puff,.smoke-source{position:absolute;left:var(--chimney-x);top:var(--chimney-y);width:var(--puff-size);aspect-ratio:1;background:var(--sprite) center/contain no-repeat;transform-origin:center;opacity:0}
.smoke-puff{animation:h3rise 9.6s linear infinite;animation-delay:var(--delay)}
@keyframes h3rise{
 0%{transform:translate(-50%,-50%) translate(0,-4%) scale(.20,.27);opacity:0}
 5%{transform:translate(-50%,-50%) translate(var(--x1),-13%) scale(.30,.40);opacity:.48}
 19%{transform:translate(-50%,-50%) translate(var(--x2),-34%) scale(.44,.57) rotate(var(--r1));opacity:.56}
 38%{transform:translate(-50%,-50%) translate(var(--x3),-62%) scale(.64,.77) rotate(var(--r2));opacity:.49}
 62%{transform:translate(-50%,-50%) translate(var(--x4),-96%) scale(.92,1.05) rotate(var(--r3));opacity:.32}
 82%{transform:translate(-50%,-50%) translate(var(--x5),-132%) scale(1.15,1.25) rotate(var(--r4));opacity:.15}
 100%{transform:translate(-50%,-50%) translate(var(--x6),-160%) scale(1.42,1.45) rotate(var(--r5));opacity:0}}
.smoke-source{width:calc(var(--puff-size) * .34);animation:h3breathe 3.7s ease-in-out infinite alternate;opacity:.42;transform-origin:50% 90%}
.smoke-source:nth-last-child(1){animation-duration:4.9s;animation-delay:-2.6s;opacity:.31}
@keyframes h3breathe{0%{transform:translate(-50%,-81%) rotate(-8deg) scale(.56,1.02)}100%{transform:translate(-50%,-82%) rotate(8deg) scale(.70,1.13)}}
.smoke.paused .smoke-puff,.smoke.paused .smoke-source{animation-play-state:paused}
.smoke-lite .smoke-puff:nth-child(even){display:none}
.smoke-lite .smoke{opacity:.7}.smoke-lite .h3-pocket{filter:none}

/* телефон и планшет: текст и кнопка выше сцены, у сцены своё кадрирование (Дед Мороз целиком, дым из трубы) */
@media (max-width:1199px){  /* было 1050: на 1050–1200 текст наезжал на сцену (01.12) */
  .hero-v2 header.top{padding:10px 18px;max-width:726px}
  .hero-v2 .top .brand{--logo-h:64px}
  .h2-links{display:none}
  .h2-login{padding:8px 20px;font-size:14px}
  .hero2{min-height:0}
  .h3-copy{order:0;width:min(690px,calc(100% - 36px));padding:88px 0 6px}
  .h3-copy>*,.h3-copy>.h2-sub{max-width:none!important}
  .h3-scene{order:1;position:relative;inset:auto;height:auto;min-width:0;width:100%;max-width:690px;align-self:center;aspect-ratio:989/846;--chimney-x:92%;--chimney-y:32.5%;--puff-size:12%}
  .h3-scene::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;background:linear-gradient(180deg,var(--h2-sky),transparent 10%)}
  .h2-eyebrow{font-size:13px;padding:5px 12px}
  .hero2 h1{font-size:clamp(32px,8vw,58px);margin:12px 0}
  .h2-sub{font-size:clamp(16px,3.5vw,22px);margin-bottom:18px}
  .h2-cta{width:100%;min-width:0;max-width:450px;min-height:54px;font-size:20px}
  .hero2 .cta-note{margin:10px 0 16px}
  .h2-facts{justify-content:space-between;max-width:460px;gap:8px}.h2-facts li{font-size:12px;gap:6px}.h2-facts svg{width:24px;height:24px}
  .h3-env{left:1%;right:auto;bottom:2%;width:52%}
  .nl-copy{font-size:5cqw;left:6%;right:6%}.nl-greet{font-size:6.6cqw}.nl-sign{font-size:5.6cqw}
}
@media (max-width:359px){.hero2 h1{font-size:30px}.h2-facts li{font-size:11px}}



/* Плавная загрузка (владелец 30.11: «дёргано проявляется»): пока не готовы шрифты и картинка сцены (не дольше 1,2 с),
   первый экран невидим; потом сцена и текст проявляются вместе. Без JS (нет html.h2-wait) — сразу как есть. */
html.h2-wait .hero2 .h3-scene,html.h2-wait .hero2 .h3-copy,html.h2-wait header.top{opacity:0}
.hero2 .h3-scene,.hero2 .h3-copy,.hero-v2 header.top{transition:opacity .5s ease-out}
html.h2-in .hero2 .h3-copy{transition-delay:.08s}

/* 01.12: окно 720–1199 px — сцена отдельным блоком; края мягко растворяются в небе, а не обрезаются прямоугольником */
@media (min-width:720px) and (max-width:1199px){
  .h3-scene{max-width:780px;-webkit-mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent),linear-gradient(180deg,#000 82%,transparent);
    -webkit-mask-composite:source-in;mask-image:linear-gradient(90deg,transparent,#000 9%,#000 91%,transparent),linear-gradient(180deg,#000 82%,transparent);mask-composite:intersect}
}
