/* Ночное волшебство — art direction / visual rework. Only presentation rules. */
:root{--fairy-gold:#e9c98e;--fairy-ink:#242c43;--fairy-paper:#f9f0df}
body{font-family:Georgia,"Palatino Linotype","Book Antiqua",serif;font-size:16px;line-height:1.67;background:#09152b}
.hero h1,.page-intro h1,.section-heading h2,.contact-box h2,.author-copy h2,.invitation-panel h2,.story h3,.service-card h3,.benefit h3,.process-grid h3,.order-intro h3,.order-summary h4,.review-feature h2{font-family:"Palatino Linotype","Book Antiqua",Georgia,serif;letter-spacing:-.018em}
body,html{overflow-x:clip}
/* Stable backdrop. Movement runs in the unobtrusive independent overlay below content. */
.world-backdrop{z-index:-4;background-color:#0b1832;background-image:linear-gradient(180deg,rgba(7,16,40,.45),rgba(8,16,40,.68) 58%,rgba(7,14,34,.83)),url('/assets/background-desktop.webp');background-position:center center;background-attachment:fixed;filter:saturate(1.10)}
.magic-layer{z-index:-1;opacity:.5}
.wonder-world{position:fixed;inset:0;z-index:-2;isolation:isolate;overflow:hidden;pointer-events:none;contain:layout paint}
.wonder-world>div{position:absolute;pointer-events:none}
/* Halo follows the illustrated lanterns at the edges and breathes; keep the central reading zone calm. */
.lantern-breath{inset:-8%;background:radial-gradient(circle 14vmax at 7% 21%,rgba(249,171,60,.20),transparent 78%),radial-gradient(circle 12vmax at 95% 24%,rgba(255,173,66,.13),transparent 82%),radial-gradient(circle 11vmax at 8% 83%,rgba(250,160,54,.11),transparent 78%);animation:lantern-breath 6.8s ease-in-out infinite alternate;mix-blend-mode:screen}
.aura-halo{inset:-15%;background:radial-gradient(ellipse 32vmax 15vmax at 87% 8%,rgba(154,130,212,.09),transparent 78%),radial-gradient(ellipse 25vmax 18vmax at 11% 81%,rgba(255,198,107,.09),transparent 83%);transform:translate3d(0,var(--fairy-parallax,0px),0);transition:transform .08s linear}
.golden-dust{width:min(680px,65vw);height:min(440px,45vw);left:-13%;bottom:-12%;background:url('/assets/magic-dust.webp') center / contain no-repeat;opacity:.30;mix-blend-mode:screen;animation:dust-breathe 10s ease-in-out infinite alternate;transform:translate3d(0,var(--fairy-parallax,0px),0)}
.stars-field,.firefly-field{inset:0}
.wonder-star{position:absolute;display:block;width:var(--size,3px);height:var(--size,3px);left:var(--left);top:var(--top);border-radius:50%;background:#fff2c7;opacity:.42;box-shadow:0 0 7px 2px rgba(248,210,135,.45);animation:star-blink var(--time,5s) ease-in-out var(--delay,0s) infinite alternate;will-change:opacity}
.wonder-star.big{background:#ffefc7;box-shadow:0 0 9px 2px #ffc66d91,0 0 22px 5px #d5a35722}
.wonder-star.big:before,.wonder-star.big:after{content:"";position:absolute;background:linear-gradient(90deg,transparent,#ffe6aa,transparent);top:50%;left:50%;transform:translate(-50%,-50%);width:17px;height:1px;opacity:.82}
.wonder-star.big:after{transform:translate(-50%,-50%) rotate(90deg)}
.wonder-firefly{position:absolute;display:block;width:8px;height:8px;left:var(--left);top:var(--top);border-radius:50%;background:radial-gradient(circle,#fffbe1 0%,#ffe6a2 26%,#eeb151 55%,transparent 72%);box-shadow:0 0 13px 5px #f9be6070,0 0 28px 13px #e6b05024;opacity:.7;transform:translate3d(0,0,0);animation:firefly-float var(--time,12s) ease-in-out var(--delay,0s) infinite alternate;will-change:transform,opacity}
.wonder-firefly:before,.wonder-firefly:after{content:"";position:absolute;top:-3px;left:-5px;width:9px;height:5px;background:rgba(255,232,175,.34);border-radius:70% 20% 80% 30%;transform:rotate(-25deg)}
.wonder-firefly:after{left:4px;transform:rotate(25deg) scaleX(-1)}
@keyframes star-blink{0%{opacity:.12;transform:scale(.64)}45%{opacity:.65}100%{opacity:.95;transform:scale(1.2)}}
@keyframes firefly-float{0%{opacity:.18;transform:translate3d(-20px,15px,0) scale(.75)}22%{opacity:.9}48%{transform:translate3d(14px,-37px,0) scale(1.08);opacity:.5}75%{opacity:.85}100%{transform:translate3d(35px,-85px,0) scale(.85);opacity:.18}}
@keyframes lantern-breath{from{opacity:.45}to{opacity:1}}
@keyframes dust-breathe{from{opacity:.08;translate:0 15px}to{opacity:.28;translate:12px -19px}}
/* Consistent premium brand sizing and paper treatment, without cutting original art. */
.header{border-bottom:1px solid rgba(245,207,135,.35);box-shadow:0 9px 30px #020b2055}
.nav-inner{min-height:108px}
.identity{font-family:"Palatino Linotype",Georgia,serif;letter-spacing:.01em}
.identity img{width:86px;height:86px;object-fit:contain;filter:drop-shadow(0 0 12px #f5d39322)}
.brand-label small{font-size:10px;letter-spacing:.15em;line-height:1.5}
.header nav a{transition:color .2s,border-color .2s}
.header nav a[aria-current="page"]{color:#ffe3ab;text-decoration:underline;text-decoration-color:#d2a969;text-underline-offset:8px}
.hero{overflow:hidden;min-height:0;background:linear-gradient(90deg,rgba(10,21,47,.89),rgba(10,21,44,.51) 75%)}
.hero-inner{min-height:615px;grid-template-columns:minmax(0,1fr) minmax(0,1.07fr);gap:clamp(24px,4.8vw,66px)}
.hero-visual{padding:9px 0 13px;max-width:100%;min-width:0}
.hero-visual img{width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;object-position:center;border:1px solid #e5c588ab;border-radius:44% 44% 18px 18px;box-shadow:0 25px 55px rgba(0,6,28,.75),0 0 45px #dcaa6059}
.hero-ring{inset:-7px;border-radius:44% 44% 18px 18px;opacity:.75;transform:rotate(0)}
.hero-star{right:-9px;top:1%;font-size:46px;animation:star-blink 5s ease-in-out infinite alternate}
.section-heading{position:relative}.section-heading h2{text-shadow:0 3px 22px rgba(1,6,20,.36)}
.section-heading .eyebrow,.page-intro .eyebrow{letter-spacing:.18em}
.story,.service-card,.benefit,.process-grid li,.author-shell,.review-feature,.contact-box,.faq-shell details{border-color:rgba(209,168,104,.77);box-shadow:0 18px 48px rgba(3,13,34,.51)}
.story,.service-card{transition:transform .23s ease,box-shadow .23s ease}
.story:hover,.service-card:hover{box-shadow:0 23px 56px rgba(3,13,34,.65)}
.service-card{background:#f8eddb;overflow:hidden}
.service-card>img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;object-position:center;box-sizing:border-box;padding:clamp(12px,1.7vw,22px);background:radial-gradient(ellipse at 48% 44%,#243657,#101c34 78%);border-bottom:1px solid rgba(215,178,114,.45)}
.service-card .service-body{padding:24px 23px 29px}
.formats-section{background:linear-gradient(180deg,rgba(12,26,53,.94),rgba(17,29,56,.93));isolation:isolate;overflow:hidden}
.formats-section:before{content:"";position:absolute;top:0;left:-90px;width:min(430px,38vw);height:450px;background:url('/assets/lanterns.webp') top left/contain no-repeat;pointer-events:none;opacity:.58;z-index:-1}
.formats-section:after{content:"";position:absolute;right:-85px;bottom:-65px;width:min(390px,34vw);height:390px;background:url('/assets/flowers.webp') center/contain no-repeat;pointer-events:none;opacity:.42;z-index:-1}
.page-intro-art{object-fit:contain;max-height:370px;filter:drop-shadow(0 14px 30px rgba(0,7,28,.3))}
.benefit img{width:clamp(116px,11vw,148px);height:clamp(116px,11vw,148px);object-fit:contain;object-position:center;border:0;border-radius:0;background:transparent;filter:drop-shadow(0 7px 13px rgba(15,22,44,.21))}
.process-grid img{width:122px;height:122px;object-fit:contain;border:0;border-radius:0;background:transparent;filter:drop-shadow(0 6px 12px rgba(22,25,44,.19))}
.author-image img{object-position:center 23%;object-fit:cover} /* Original photo only; no identity alteration */
.portfolio-story .story-image img,.review-work-grid img{object-fit:contain}
.faq-shell details{background:#faf0def7}
.footer{background:linear-gradient(rgba(8,18,39,.82),rgba(6,12,27,.96)),url('/assets/footer.webp') center/cover}
.btn{font-family:Arial,"Segoe UI",sans-serif;letter-spacing:.015em}
.btn.primary:hover,.btn.glass:hover,.portfolio-demo-link:hover{box-shadow:0 12px 33px #d9b37655}
/* Accessibility and stacking: decorations must never intercept reading, buttons or selections. */
.hero-copy,.story-content,.contact-box,.author-shell,.service-body,.order-studio,.faq-shell{position:relative;z-index:1}
@media(min-width:1400px){.hero-inner{min-height:700px}}
@media(max-width:1180px){.nav-inner{min-height:82px}.identity img{width:67px;height:67px}}
@media(max-width:800px){
 .world-backdrop{background-image:linear-gradient(180deg,rgba(6,15,36,.53),rgba(8,16,37,.74) 55%,rgba(6,14,35,.85)),url('/assets/background-mobile.webp');background-attachment:scroll}
 .hero-inner{grid-template-columns:1fr;gap:18px;padding-top:55px;padding-bottom:72px;text-align:center;min-height:0}
 .hero-copy{margin:auto}.hero-lead{margin-inline:auto}.actions{justify-content:center}.hero-visual{width:min(100%,650px);margin:0 auto;padding:6px 0}.hero-visual img{aspect-ratio:16/9}
 .formats-section:before{width:220px;height:250px;opacity:.23;left:-120px}.formats-section:after{width:190px;height:210px;opacity:.27;right:-100px}
 .golden-dust{opacity:.16;width:72vw;left:-22%;bottom:-8%}
}
@media(max-width:600px){
 .nav-inner{gap:14px}.identity{font-size:22px}.identity img{width:61px;height:61px}
 .hero h1{font-size:clamp(38px,11vw,54px)}.hero-inner{padding-inline:18px}.hero-visual img{border-radius:38% 38% 12px 12px;aspect-ratio:16/9}
 .hero-star{font-size:30px;top:2%}.service-card>img{height:auto!important;aspect-ratio:1/1;object-fit:contain;padding:16px 22px}
 .benefit img{width:126px;height:126px}.process-grid img{width:114px;height:114px}
 .lantern-breath{opacity:.62}.aura-halo{display:none}.golden-dust{display:none}
 .page-intro-art{max-height:250px;object-fit:contain;width:min(84vw,390px)}
}
@media(max-width:380px){.identity img{width:56px;height:56px}.identity{font-size:20px}.nav-inner{padding-inline:12px}}
@media(prefers-reduced-motion:reduce){
 .lantern-breath,.golden-dust,.wonder-star,.wonder-firefly,.hero-star{animation:none!important;transition:none!important;will-change:auto!important}
 .wonder-firefly{opacity:.48}.wonder-star{opacity:.55}.magic-layer .orb{animation:none!important}
 .aura-halo{transform:none!important;transition:none!important}
}
@media(prefers-reduced-transparency:reduce){.wonder-world{opacity:.47}.contact-box,.header{backdrop-filter:none}}

/* Финальная оптимизация: не рисовать анимацию вне области просмотра. */
@media (prefers-reduced-motion: reduce){.wonder-star,.wonder-firefly,.wonder-dust,.wonder-lantern{animation:none!important;transition:none!important}}
@media (max-width:680px){.wonder-star,.wonder-firefly{will-change:auto}}

/* Inactive browser tabs should not keep compositing glow and particles. */
html.wonder-paused .wonder-star,html.wonder-paused .wonder-firefly,html.wonder-paused .lantern-breath,html.wonder-paused .golden-dust{animation-play-state:paused!important}
