/* Верх страницы номера: свет от обложки, разворот-герой, лента миниатюр разворотов, текст с кодом.
   Один и тот же блок на главной и на экране кода (static/predprosmotr.js). */
:root { --stage: #06080b; --cream: #F1EFE8; --ink: #1C1B18; --dim: rgba(241,239,232,.62); --faint: rgba(241,239,232,.38);
  --font: "Onest", system-ui, sans-serif; --pr: cubic-bezier(.2,.8,.2,1); --pole: clamp(28px, 8vw, 115px); }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; background: var(--stage); color: var(--cream); font-family: var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: inherit; }

/* Фон рисует static/predprosmotr.js (Fon): маленький холст, браузер растягивает его на весь экран. */
.fon { position: fixed; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; background: var(--stage); }
.tem { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(ellipse 72% 72% at 50% 45%, transparent 30%, rgba(6,8,11,.72) 100%); }
.zerno { position: fixed; inset: 0; z-index: 1; opacity: .08; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.vse { position: relative; z-index: 2; max-width: 1560px; margin: 0 auto; padding: 0 var(--pole) 64px; }
header { display: flex; align-items: center; gap: 14px; height: 76px; }
.logo { height: 16px; width: auto; color: var(--cream); display: block; }
header span { font-size: 13px; color: var(--dim); }
.domoy { display: flex; align-items: center; height: 38px; color: var(--cream); text-decoration: none; }
.domoy:hover { opacity: .7; }
/* Вход и кабинет справа в шапке (вариант B, Гриша 16.11.2026): капсула «Войти», после входа — буква и «Мои номера».
   Пока static/profil.js не узнал у службы заказов, вошёл ли читатель, капсула прозрачна — без мигания «Войти». */
.profil { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 20px 0 16px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: var(--cream); font: 500 16px/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: background .2s, opacity .25s; }
.profil:hover { background: rgba(255,255,255,.22); }
.profil:active { transform: scale(.97); }
.profil:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; }
.profil svg { width: 20px; height: 20px; flex: none; }
.profil.s-bukvoy { padding: 0 18px 0 4px; }
.profil-tekst { font-size: inherit; color: inherit; }
.profil-bukva { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: #f65925; color: #14110f; font-weight: 600; font-size: 15px; }
.js .profil:not([data-gotovo]) { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .profil { transition: none; } .profil:active { transform: none; } }

/* Две колонки: герой с подписью и лентой миниатюр, справа текст.
   --k: ширина полосы к высоте; --t: ширина текста (уже, чем раньше: развороту нужна ширина). */
.geroy { --k: .755; --t: min(32vw, 470px); --zazor: clamp(28px, 4vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--t); gap: var(--zazor); align-items: center; min-height: calc(100dvh - 160px); padding: 8px 0 52px; }
.pp { min-width: 0; }

/* Рамка героя: разворот (или обложка) вписан целиком, по центру. Смена — перетеканием слоёв (predprosmotr.js). */
.pp-ramka { position: relative; }
.pp-scena { position: relative; width: 100%; aspect-ratio: calc(2 * var(--k)); max-height: min(64dvh, 620px); container-type: size; border-radius: 3px;
  cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.pp-scena:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }
.pp-sloy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pp-sloy.uhodit { pointer-events: none; }
.pp-razv { --a: var(--k); position: relative; display: flex; height: 100%; aspect-ratio: var(--a); max-width: 100%; border-radius: 3px; overflow: hidden; background: #111;
  box-shadow: 0 50px 120px -30px rgba(0,0,0,.85), 0 18px 40px rgba(0,0,0,.45); }
.pp-razv.dve { --a: calc(2 * var(--k)); }
@supports (width: 1cqw) {
  .pp-razv { width: min(100cqw, 100cqh * var(--a)); height: min(100cqh, 100cqw / var(--a)); aspect-ratio: auto; max-width: none; }
}
.pp-pol { position: relative; flex: 1 1 0; min-width: 0; height: 100%; overflow: hidden; }
.pp-pol img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.pp-pol .mini { filter: blur(1.2px); transform: scale(1.012); }
.pp-pol .polnaya { opacity: 0; transition: opacity .35s var(--pr); }
.pp-pol .polnaya.est { opacity: 1; }
/* корешок разворота — мягкая тень посередине; у обложки — слева */
.pp-razv.dve::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 7%; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,.18) 42%, rgba(0,0,0,.3) 50%, rgba(0,0,0,.18) 58%, transparent); }
.pp-razv.obl::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.2) 0, rgba(0,0,0,.05) 2.2%, transparent 6%); }
/* обложка чуть повёрнута, как журнал на столе; под мышью выпрямляется и приподнимается */
.pp-razv.obl { transform: perspective(2400px) rotateY(7deg) rotateX(2deg); transition: transform .7s var(--pr); }
@media (hover: hover) { .pp-scena:hover .pp-razv.obl { transform: perspective(2400px) translateY(-5px); } }

/* место у угла картинки ставит predprosmotr.js (mestoLupy); right/bottom — пока он не посчитал */
.pp-lupa { position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 38px; height: 38px; border: 0; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--cream); background: rgba(20,19,17,.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .18s, transform .18s, left .42s var(--pr), top .42s var(--pr); }
.pp-lupa:hover { background: rgba(20,19,17,.88); }
.pp-lupa:active { transform: scale(.94); }
.pp-lupa:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; }
.pp-lupa svg { width: 18px; height: 18px; }

/* подпись под рамкой: что за разворот и какой по счёту */
.pp-podpis { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 12px; font-size: 13px; line-height: 1.4; color: var(--dim); white-space: nowrap; }
.pp-nazv { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pp-nazv b { color: var(--cream); font-weight: 500; }
.pp-sch { flex: none; font-variant-numeric: tabular-nums; }

/* лента миниатюр разворотов; маски по краям, только когда есть что прокрутить */
.pp-lenta { --l: 0; --r: 0; position: relative; display: flex; gap: 10px; margin-top: 14px; padding: 4px 2px 6px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 calc(var(--l) * 40px), #000 calc(100% - var(--r) * 40px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 calc(var(--l) * 40px), #000 calc(100% - var(--r) * 40px), transparent 100%); }
.pp-lenta::-webkit-scrollbar { display: none; }
.pp-lenta[hidden] { display: none; }
.pp-kadr { --hk: 64px; position: relative; flex: none; display: block; height: var(--hk); border: 0; padding: 0; background: none; cursor: pointer; color: var(--cream); font-family: var(--font); scroll-snap-align: center; opacity: .6; transition: opacity .2s; }
.pp-mini { display: flex; height: 100%; border-radius: 3px; overflow: hidden; background: #111; }
.pp-mini img { display: block; height: 100%; width: auto; aspect-ratio: var(--k); object-fit: cover; -webkit-user-drag: none; user-select: none; }
.pp-kadr:hover, .pp-kadr.akt { opacity: 1; }
.pp-kadr:active { opacity: .85; }
.pp-kadr:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; opacity: 1; }
.pp-nom { position: absolute; left: 5px; bottom: 5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: rgba(6,8,11,.84); font-size: 11.5px; font-weight: 500; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; transition: background .2s, color .2s; }
.pp-kadr.akt .pp-nom { background: var(--cream); color: var(--ink); }
.pp-kadr.zamok { opacity: 1; width: calc(var(--hk) * 2 * var(--k)); }
.pp-zamok { width: 100%; height: 100%; border-radius: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: rgba(241,239,232,.11); transition: background .2s; }
.pp-kadr.zamok:hover .pp-zamok { background: rgba(241,239,232,.18); }
.pp-zamok svg { width: 16px; height: 16px; }
.pp-zamok b { font-weight: 500; font-size: 15px; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pp-zamok em { font-style: normal; font-size: 11px; line-height: 1.1; color: var(--dim); white-space: nowrap; }

/* текст */
.tekst { min-width: 0; margin-right: calc(var(--pole) * -.3); }
.metka { font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.geroy h1 { font-weight: 600; font-size: clamp(40px, 4.6vw, 66px); max-width: 7.2em; line-height: .98; letter-spacing: -.035em; margin-top: 18px; overflow-wrap: break-word; }
.opis { font-size: 16.5px; line-height: 1.55; color: var(--dim); margin-top: 22px; max-width: 460px; }
.o-nomere { margin-top: 22px; max-width: 480px; }
.o-nomere p { font-size: 16.5px; line-height: 1.6; color: rgba(241,239,232,.86); text-wrap: pretty; }
.o-nomere p + p { margin-top: 12px; }
.o-nomere + .opis { margin-top: 14px; font-size: 14.5px; }
.o-nomere.svernuto .o-tekst { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.o-nomere.svernuto .o-tekst p { display: inline; }
.o-nomere.svernuto .o-tekst p + p::before { content: " "; }
.o-esche { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 6px 0; border: 0; background: none;
  color: var(--cream); font: 500 14.5px var(--font); cursor: pointer; }
.o-esche svg { width: 16px; height: 16px; transition: transform .2s var(--pr); }
.o-nomere:not(.svernuto) .o-esche svg { transform: rotate(180deg); }
.o-esche:hover span { text-decoration: underline; text-underline-offset: 3px; }
.o-esche:focus-visible { outline: 2px solid var(--cream); outline-offset: 2px; border-radius: 6px; }
.kod { display: flex; gap: 8px; margin-top: 30px; max-width: 460px; }
.kod input { flex: 1; min-width: 0; height: 54px; padding: 0 18px; border: 0; outline: none; border-radius: 14px; background: rgba(241,239,232,.1); color: var(--cream); font: 500 16px var(--font); transition: background .18s; }
.kod input::placeholder { color: var(--dim); font-weight: 400; }
.kod input:hover { background: rgba(241,239,232,.14); }
.kod input:focus { background: rgba(241,239,232,.2); }
.kod.vspyshka input { animation: pp-vsp .9s ease; }
@keyframes pp-vsp { 0%, 100% { background: rgba(241,239,232,.1); } 35% { background: rgba(241,239,232,.34); } }
.oshibka { color: #ffb4a8; font-size: 14px; line-height: 1.4; margin-top: 10px; min-height: 20px; }
.oshibka:empty { display: none; }
.dey { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.kn { height: 54px; padding: 0 22px; border: 0; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex: none; white-space: nowrap; text-decoration: none; cursor: pointer; font: 500 15.5px var(--font); transition: background .18s, transform .18s, color .18s; }
.kn:active { transform: scale(.97); }
.kn:disabled { opacity: .6; cursor: progress; }
.kn svg { width: 18px; height: 18px; }
.kn.glav { background: var(--cream); color: var(--ink); }
.kn.glav:hover { background: #fff; }
.kn.vtor { background: rgba(241,239,232,.1); color: var(--cream); }
.kn.vtor:hover { background: rgba(241,239,232,.16); }
.kn.tih { background: none; color: var(--dim); height: 44px; padding: 0 2px; margin-top: 10px; font-size: 14.5px; }
.kn.tih:hover { color: var(--cream); }

/* Смена номера на главной: обложки перелетают на свои места, фон живёт сам, поэтому страницу целиком не снимаем. */
:root { view-transition-name: none; }
::view-transition { pointer-events: none; }
::view-transition-group(*) { animation-duration: .72s; animation-timing-function: var(--pr); }
::view-transition-old(zh-tekst), ::view-transition-old(zh-lenta) { animation: zh-uhod .24s ease both; }
::view-transition-new(zh-tekst) { animation: zh-tekst .66s .12s var(--pr) both; }
::view-transition-new(zh-lenta) { animation: zh-lenta .66s .12s var(--pr) both; }
@keyframes zh-uhod { to { opacity: 0; } }
@keyframes zh-tekst { from { opacity: 0; transform: translateY(16px); } }
@keyframes zh-lenta { from { opacity: 0; transform: translateY(10px); } }

/* Телефон и планшет стоя: в столбик — герой, подпись, лента, текст. Рамка одной высоты для обложки и разворотов:
   разворот вписан по ширине, обложка — по высоте, поэтому ничего не прыгает при смене. */
@media (max-width: 860px) {
  .vse { padding: 0 18px 48px; }
  header { height: 60px; }
  header > span { display: none; }
  .profil { height: 40px; font-size: 15px; padding: 0 16px 0 13px; }
  .profil.s-bukvoy { padding: 0 15px 0 4px; }
  .profil-bukva { width: 32px; height: 32px; font-size: 14px; }
  .geroy { display: block; min-height: 0; padding: 4px 0 8px; }
  .pp-scena { aspect-ratio: 1.2; max-height: 62dvh; }
  .pp-razv { box-shadow: 0 30px 70px -24px rgba(0,0,0,.9); }
  .pp-razv.obl, .pp-scena:hover .pp-razv.obl { transform: none; }
  .pp-lenta { margin: 14px -18px 0; padding: 4px 18px 6px; scroll-padding: 0 18px; }
  .pp-kadr { --hk: 56px; }
  .pp-lupa { width: 34px; height: 34px; }
  .pp-lupa svg { width: 16px; height: 16px; }
  .pp-nom { left: 4px; bottom: 4px; min-width: 18px; height: 18px; font-size: 11px; }
  .pp-zamok { gap: 2px; }
  .pp-zamok b { font-size: 14px; }
  .pp-zamok svg { width: 14px; height: 14px; }
  .tekst { padding: 22px 0 0; margin-right: 0; }
  .geroy h1 { font-size: 38px; max-width: none; }
  .opis { font-size: 16px; max-width: none; }
  .tekst { display: flex; flex-direction: column; }
  .o-nomere { order: 5; max-width: none; margin-top: 28px; }
  .o-nomere p { font-size: 16px; }
  .kod { flex-direction: column; max-width: none; }
  .kod input { flex: none; }
  .dey .kn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .pp-kadr, .pp-razv.obl, .pp-pol .polnaya, .pp-lupa { transition: none; } }
