/* ===== v5.36: финальная адаптивность (только вёрстка, без смены дизайна) ===== */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overflow-x:clip}
img{max-width:100%}
p,h1,h2,h3,.beat-quote,.beat-narration{overflow-wrap:break-word;hyphens:manual}
/* типографика: без висячих строк */
p,.beat-quote,.lineup-voice p,.day4-line,.day5-line,.day2-wash-lead,.day2-wash-later{text-wrap:pretty}
h1,h2,.day4-copy h2,.day5-copy h2,.arrival-intro>p{text-wrap:balance}
/* кнопки — под палец */
button,.reference-enter,.mug-touch,.day4-freeze-control button,#day4-hold,.day2-board-look{min-height:44px}
.mug-touch{min-height:0!important}
/* минимальные размеры мелких подписей */
.hud,.hud span,.day2-header,.day2-header span,.chapter-meta,.chapter-meta span,.day4-light-hint,.mug-hint,.arrival-credits{font-size:max(12px,var(--fs,12px))}
.day4-freeze-control small,.day4-freeze-note{font-size:max(12px,1em)}
.day5-roster{font-size:max(12px,.75em)}
/* safe-area */
.hud,.day2-header,.chapter-meta,.arrival-credits{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.day4-light-hint{bottom:max(8vh,env(safe-area-inset-bottom))}

/* --- первый экран: портрет (телефоны и вертикальные планшеты) --- */
@media (orientation:portrait){
 #arrival{background:#14110e}
 #arrival .reference-art{top:0!important;bottom:auto!important;height:68%!important;object-position:0% 50%!important;-webkit-mask-image:linear-gradient(180deg,#000 82%,transparent);mask-image:linear-gradient(180deg,#000 82%,transparent)}
 #arrival::after{content:'';position:absolute;left:0;right:0;bottom:0;height:46%;z-index:15;pointer-events:none;background:linear-gradient(0deg,rgba(14,11,8,.82),rgba(14,11,8,.5) 55%,transparent)}
 #arrival .arrival-layout{align-content:end!important;padding:0 clamp(18px,5vw,48px) max(5vh,env(safe-area-inset-bottom))!important;grid-template-columns:1fr!important}
 #arrival .arrival-layout>.arrival-intro{grid-column:1!important;grid-row:1!important;margin:0!important;max-width:min(30em,92%)!important}
 #arrival .arrival-intro>p{font-size:clamp(18px,4.6vw,26px)!important}
}
/* --- «Столовая»: подсказка/история не наезжают друг на друга --- */
.dining .mug-hint{max-width:90vw}
/* --- «После обеда»: без обрывка надписи с фото --- */
@media (max-width:767px) and (orientation:portrait){
 #play .photo{object-position:22% 50%!important}
 .day2-lunch-shade{background:linear-gradient(180deg,rgba(17,14,12,.86),rgba(17,14,12,.7) 60%,rgba(17,14,12,.3))!important}
 .day5-dawn-scene .day5-photo{object-position:78% 40%!important}
}
/* --- День 4, «Спальня»: кровать и Катя в кадре на вертикальных экранах --- */
@media (orientation:portrait){
 .day4-bed-scene .day4-sticky{background:#07090c}
 .day4-bed-scene .day4-photo.day4-bed{top:auto!important;bottom:0!important;height:64%!important;object-fit:cover!important;object-position:76% 50%!important;
  -webkit-mask-image:linear-gradient(180deg,transparent,#000 22%);mask-image:linear-gradient(180deg,transparent,#000 22%)}
 .day4-freeze-scene .day4-photo.day4-dark{object-position:85% 50%!important}
 .day4-freeze-scene .day4-flashlight{--light-x:52%;--light-y:48%}
}
/* --- День 4 «Отбой»: опечатки transition, плавность --- */
.day4-freeze-scene .day4-sticky::after{transition:opacity .85s ease}
.day4-freeze-scene .day4-flashlight{transition:opacity .85s ease!important}
/* --- ландшафт на телефоне --- */
@media (orientation:landscape) and (max-height:520px){
 .lineup .lineup-voice p:not(.speaker){font-size:clamp(16px,3.4vh,22px)!important}
 .lineup .lineup-counselor{max-width:46vw!important}
 .day5-paper{top:14%!important;height:min(78svh,420px)!important}
 .day5-list-intro{top:5%!important}
 .day2-lunch-copy{top:22%!important;font-size:clamp(13px,3.4vh,17px)!important}
 .day4-copy{top:16%!important}
 .day4-copy p{margin-bottom:12px!important}
 .day4-copy h2{font-size:clamp(38px,11vh,64px)!important;margin-bottom:12px!important}
}
@media (prefers-reduced-motion:reduce){
 .reveal-on-scroll{opacity:1!important;transform:none!important;transition:none!important}
}
/* --- низкие экраны (телефон в ландшафте, 320×568) --- */
@media (max-height:600px){
 .d-text{bottom:4vh!important}.d-text p{font-size:clamp(13px,3.6vh,17px)!important;line-height:1.3!important}
 .dining .mug-hint{top:70%!important}
 .dining .mug-story{font-size:clamp(12px,3.4vh,15px)!important}
 .day2-content .day2-kicker{margin-bottom:2px}
 .day2-content h2{font-size:clamp(34px,11vh,60px)!important;margin:0 0 6px!important}
 .day2-first{font-size:clamp(13px,3.7vh,17px)!important;line-height:1.3!important}
 .day2-board-copy p,.board-later,.board-detail{font-size:clamp(12px,3.5vh,16px)!important;line-height:1.3!important}
}
