/* Шрифт TikTok Sans (открытая лицензия OFL) — тот же, что в заголовках материалов БФТ (начертание Expanded).
   Вариативный: ширина букв задаётся свойством font-stretch (100% — обычная, 125% — Expanded). */
@font-face { font-family: 'TikTok Sans'; font-style: normal; font-display: swap; font-weight: 300 900; font-stretch: 75% 150%;
  src: url('fonts/tiktok-sans-cyrillic-ext-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'TikTok Sans'; font-style: normal; font-display: swap; font-weight: 300 900; font-stretch: 75% 150%;
  src: url('fonts/tiktok-sans-cyrillic-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'TikTok Sans'; font-style: normal; font-display: swap; font-weight: 300 900; font-stretch: 75% 150%;
  src: url('fonts/tiktok-sans-latin-ext-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'TikTok Sans'; font-style: normal; font-display: swap; font-weight: 300 900; font-stretch: 75% 150%;
  src: url('fonts/tiktok-sans-latin-wdth-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --font: 'TikTok Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --red: #eb1e36;            /* красный БФТ (с логотипа) */
  --red-dark: #c9142b;
  --ink: #15172b;            /* основной текст: тёмно-синий, почти чёрный */
  --ink-2: rgba(21, 23, 43, .62);
  --blue: #4a5bd6;           /* сине-фиолетовый из буклетов БФТ */
  --card-blur: 22px;
  /* Светлое матовое стекло: карточки, шапка, кнопки навигации */
  --glass: linear-gradient(140deg, rgba(255,255,255,.74) 0%, rgba(255,255,255,.48) 100%);
  --glass-solid: linear-gradient(140deg, rgb(250,251,255) 0%, rgb(236,240,252) 100%);
  --glass-border: 1px solid rgba(255,255,255,.78);
  --glass-shadow: 0 26px 50px -26px rgba(52,72,160,.5), 0 2px 8px -2px rgba(52,72,160,.12), inset 0 1px 0 rgba(255,255,255,.9);
  /* Внутренние экраны: слева колонка навигации, остальное — контент во всю высоту */
  --nav-w: 160px;
}

[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #000; color: var(--ink);
  font-family: var(--font);
  user-select: none; -webkit-user-select: none;
  touch-action: none; overscroll-behavior: none;
  cursor: none;
}
body.show-cursor, body.show-cursor * { cursor: default; }
img, video { -webkit-user-drag: none; user-select: none; }
button { font-family: inherit; }

/* Сцена 1920×1080, масштабируется под экран в kiosk.js */
#stage {
  position: absolute; left: 0; top: 0;
  width: 1920px; height: 1080px;
  transform-origin: 0 0;
  overflow: hidden; background: #c9d6f6;
}

/* ---------- Фон ---------- */
.main-bg { position: absolute; inset: 0; background: #c9d6f6 url('assets/bg-default.jpg') center / cover no-repeat; }
.main-bg > img, .main-bg > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.main-bg > video { opacity: 0; transition: opacity .6s ease; }
.main-bg > video.on { opacity: 1; }

/* ---------- Экраны ---------- */
.screen { position: absolute; inset: 0; visibility: hidden; transition: visibility 0s linear .25s; z-index: 2; }
.screen.active { visibility: visible; transition: none; z-index: 1; }
/* Стекло в плавном переходе не участвует: пока что-то над ним полупрозрачно, браузер не размывает фон,
   и размытие «включается» рывком. Поэтому стекло появляется сразу, а остальное плавно растворяется. */
.screen > :not(.cards):not(.glass) { transition: opacity .25s ease; }
.screen:not(.active) > :not(.cards):not(.glass) { opacity: 0 !important; }
.screen:not(.active) .card, .screen:not(.active) .glass { visibility: hidden; }

.glass, .card, .nav-btn, .pager-btn, .pager-count {
  background: var(--glass);
  backdrop-filter: blur(var(--card-blur)) saturate(1.15); -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.15);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
}
body.no-blur .glass, body.no-blur .card, body.no-blur .nav-btn, body.no-blur .pager-btn, body.no-blur .pager-count {
  backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-solid);
}

/* ---------- Главный экран ---------- */
.brand-logo { position: absolute; left: 80px; top: 64px; width: 96px; height: 96px; pointer-events: none; z-index: 1;
  box-shadow: 0 18px 30px -16px rgba(235,30,54,.55); }
#main-title {
  position: absolute; left: 200px; top: 64px; height: 96px; margin: 0; display: flex; align-items: center;
  font-weight: 600; font-stretch: 125%; font-size: 40px; line-height: 1.1; letter-spacing: -.01em; white-space: pre-line;
  color: var(--ink); text-shadow: 0 0 28px rgba(255,255,255,.95), 0 0 6px rgba(255,255,255,.6);
}
#main-title:empty { display: none; }

/* Карточки: позиции и размеры считает kiosk.js */
.cards { position: absolute; inset: 0; pointer-events: none; }
.card {
  position: absolute; pointer-events: auto; border-radius: 36px; overflow: hidden; color: var(--ink);
  transition: left .5s cubic-bezier(.2,.8,.2,1), top .5s cubic-bezier(.2,.8,.2,1), width .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1), transform .12s ease, opacity .3s;
}
.card.pressed, .nav-btn.pressed, .pager-btn.pressed { transform: scale(.972); filter: brightness(.97); }

/* Карточка продукта (главный экран): название, подпись, число материалов, красная стрелка */
.card .card-title { font-weight: 600; font-stretch: 125%; font-size: 30px; line-height: 1.16; letter-spacing: -.01em; white-space: pre-line; overflow-wrap: break-word; }
.card .card-sub { margin-top: 12px; font-weight: 400; font-size: 20px; line-height: 1.25; color: var(--ink-2); white-space: pre-line; }
.card .card-sub:empty { display: none; }
.card.product .card-text { position: absolute; left: 40px; right: 40px; top: 38px; }
.card.product .card-meta { position: absolute; left: 40px; bottom: 40px; right: 120px; font-weight: 500; font-size: 19px; line-height: 1.2; color: var(--ink-2); }
.card .card-go {
  position: absolute; right: 32px; bottom: 32px; width: 60px; height: 60px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; box-shadow: 0 12px 22px -10px rgba(235,30,54,.7);
}
.card .card-go svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: square; }
.card.product.s .card-title { font-size: 25px; }
.card.product.s .card-text { left: 30px; right: 30px; top: 28px; }
.card.product.s .card-meta { left: 30px; bottom: 30px; font-size: 17px; }
.card.product.s .card-go { right: 24px; bottom: 24px; width: 50px; height: 50px; }

/* Карточка материала (второе меню): обложка первой страницы, название, тип и объём */
.card.item { border-radius: 30px; }
.card.item .card-thumb { position: absolute; left: 20px; right: 20px; top: 20px; bottom: 150px; padding: 14px; display: grid; place-items: center; border-radius: 16px;
  background: rgba(120,140,210,.14); overflow: hidden; }
.card.item .card-thumb img { position: absolute; left: 14px; top: 14px; width: calc(100% - 28px); height: calc(100% - 28px); object-fit: contain; filter: drop-shadow(0 8px 12px rgba(30,40,100,.28)); }
.card.item .card-thumb .ph { width: 84px; height: 84px; border-radius: 50%; background: var(--red); display: grid; place-items: center; box-shadow: 0 14px 26px -12px rgba(235,30,54,.7); }
.card.item .card-thumb .ph svg { width: 34px; height: 34px; fill: #fff; margin-left: 5px; }
.card.item .card-thumb .ph.doc svg { margin-left: 0; fill: none; stroke: #fff; stroke-width: 2; }
.card.item .card-text { position: absolute; left: 24px; right: 24px; top: calc(100% - 134px); }
.card.item .card-title { font-size: 21px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card.item .card-sub { margin-top: 6px; font-size: 16px; }
.card.item .card-meta { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 16px; color: var(--ink-2); }
.card.item .card-meta i { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--red); }

/* Шапка второго меню */
.menu-head { position: absolute; left: 220px; top: 64px; right: 80px; height: 96px; display: flex; flex-direction: column; justify-content: center;
  text-shadow: 0 0 28px rgba(255,255,255,.95), 0 0 6px rgba(255,255,255,.6); }
.menu-over { font-weight: 500; font-size: 19px; letter-spacing: .08em; text-transform: uppercase; color: var(--red); text-shadow: none; }
#menu-title { margin: 6px 0 0; font-weight: 600; font-stretch: 125%; font-size: 40px; line-height: 1.1; letter-spacing: -.01em; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-empty { position: absolute; left: var(--nav-w); right: 0; top: 50%; text-align: center; font-size: 28px; color: var(--ink-2); }

/* ---------- Навигация внутренних экранов (слева) ---------- */
.nav { position: absolute; left: 0; top: 0; width: var(--nav-w); height: 1080px; z-index: 20; pointer-events: none; }
.nav-btn {
  position: absolute; left: 24px; width: 112px; height: 112px; border-radius: 30px; padding: 0; pointer-events: auto; outline: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink);
  transition: transform .12s ease;
}
#nav-back { top: 420px; }
#nav-home { top: 548px; }
.nav-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--red); display: grid; place-items: center; }
.nav-ico svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.nav-label { font-weight: 600; font-size: 17px; line-height: 1; }
/* Листание: стрелки и счётчик страниц под кнопками навигации */
.pager { position: absolute; left: 24px; top: 716px; width: 112px; pointer-events: none; }
.pager-btn { position: absolute; top: 0; width: 52px; height: 52px; border-radius: 50%; padding: 0; pointer-events: auto; outline: none;
  display: grid; place-items: center; transition: transform .12s ease, opacity .2s; }
#pager-prev { left: 0; } #pager-next { right: 0; }
.pager-btn svg { width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pager-btn.off { opacity: .35; pointer-events: none; }
.pager.vertical .pager-btn svg { transform: rotate(90deg); }
.pager-count { position: absolute; left: 0; right: 0; top: 66px; height: 38px; border-radius: 19px; display: grid; place-items: center;
  font-weight: 600; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager-count:empty { display: none; }

/* ---------- Контент: вся высота экрана справа от навигации ---------- */
.content, .viewport { position: absolute; left: var(--nav-w); top: 0; width: 1760px; height: 1080px; overflow: hidden; }
.viewport { background: #fff; }
.viewport iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
/* Во весь экран: без колонки навигации (у демо своя кнопка возврата) */
#screen-site.fullscreen .viewport { left: 0; width: 1920px; }

/* Слайды и развороты: по экрану за раз, листаются свайпом */
.slides-track { position: absolute; inset: 0; display: flex; will-change: transform; }
.slides-track.animate { transition: transform .35s cubic-bezier(.22,.61,.36,1); }
.slide { flex: none; width: 1760px; height: 1080px; display: flex; align-items: center; justify-content: center; padding-right: 20px; }
.slide img { display: block; flex: none; max-width: 1740px; max-height: 1040px; object-fit: contain; pointer-events: none; background: #fff;
  box-shadow: 0 30px 60px -30px rgba(30,40,100,.55), 0 0 0 1px rgba(30,40,100,.06); }
.slide.single img { border-radius: 14px; }
.slide.spread img:first-child { border-radius: 10px 0 0 10px; }
.slide.spread img:last-child { border-radius: 0 10px 10px 0; }
.slide.spread img:only-child { border-radius: 10px; }
/* Корешок между страницами разворота */
.slide.spread img + img { box-shadow: 0 30px 60px -30px rgba(30,40,100,.55), 0 0 0 1px rgba(30,40,100,.06), inset 14px 0 18px -14px rgba(30,40,100,.25); margin-left: 0; }
.slide img.cover { object-fit: cover; width: 1740px; height: 1040px; }

/* Документ прокруткой вниз: длинные страницы (ролл-апы) и «книжные» материалы, если так выбрано в админке */
.doc-scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain;
  padding: 20px 20px 20px 0; display: none; flex-direction: column; align-items: center; gap: 24px; scrollbar-width: none; }
.doc-scroller::-webkit-scrollbar { display: none; }
#screen-slides.doc .doc-scroller { display: flex; }
#screen-slides.doc .slides-track { display: none; }
.doc-scroller img { display: block; flex: none; height: auto; background: #fff; border-radius: 12px;
  box-shadow: 0 30px 60px -30px rgba(30,40,100,.55), 0 0 0 1px rgba(30,40,100,.06); pointer-events: none; }
.doc-rail { position: absolute; right: 22px; top: 40px; bottom: 40px; width: 8px; border-radius: 4px; background: rgba(21,23,43,.12); display: none; }
.doc-rail i { position: absolute; left: 0; right: 0; border-radius: 4px; background: var(--red); min-height: 40px; }
#screen-slides.doc .doc-rail { display: block; }

/* Увеличенная страница: открывается касанием, двигается пальцем в любую сторону, закрывается касанием или «Назад» */
.zoom { position: absolute; inset: 0; z-index: 5; background: rgba(214,224,250,.78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.zoom-scroll { position: absolute; inset: 0; overflow: auto; touch-action: pan-x pan-y; overscroll-behavior: contain; scrollbar-width: none; display: flex; padding: 20px; }
.zoom-scroll::-webkit-scrollbar { display: none; }
.zoom-scroll img { display: block; flex: none; margin: auto; max-width: none; background: #fff; border-radius: 12px; box-shadow: 0 30px 60px -30px rgba(30,40,100,.55); }
.zoom-close { position: absolute; right: 28px; top: 28px; width: 72px; height: 72px; border-radius: 50%; border: 0; padding: 0; background: var(--red);
  display: grid; place-items: center; box-shadow: 0 14px 26px -12px rgba(235,30,54,.7); }
.zoom-close svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }

/* Короткая подсказка поверх материала (сама исчезает) */
.view-hint { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 4; padding: 14px 26px; border-radius: 28px;
  background: rgba(21,23,43,.82); color: #fff; font-weight: 500; font-size: 19px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .5s ease; }
.view-hint.on { opacity: 1; }
.view-hint:empty { display: none; }

.placeholder { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 48px 72px; border-radius: 36px;
  font-weight: 600; font-stretch: 125%; font-size: 32px; color: var(--ink);
  background: var(--glass); border: var(--glass-border); box-shadow: var(--glass-shadow); }

/* ---------- Видео ---------- */
.video-box { position: absolute; left: 0; top: 50px; width: 1740px; height: 979px; border-radius: 14px; overflow: hidden; background: #000;
  box-shadow: 0 30px 60px -30px rgba(30,40,100,.55); }
.video-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp-big { position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; margin: -90px 0 0 -90px; border: 0; border-radius: 50%;
  background: var(--red); display: grid; place-items: center; box-shadow: 0 20px 60px -20px rgba(0,0,0,.7); transition: opacity .25s, transform .12s; }
.vp-big svg { width: 70px; height: 70px; fill: #fff; margin-left: 10px; }
.vp-big.replay svg { margin-left: 0; }
.vp-big.hide { opacity: 0; pointer-events: none; }
.vp-big.pressed { transform: scale(.95); }
.vp-bar { position: absolute; left: 40px; right: 40px; bottom: 30px; height: 64px; display: flex; align-items: center; gap: 24px;
  padding: 0 24px; border-radius: 32px; background: rgba(21,23,43,.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: opacity .35s; }
.vp-bar.idle { opacity: 0; pointer-events: none; }
.vp-toggle { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.vp-toggle svg { width: 26px; height: 26px; fill: #fff; }
.vp-track { flex: 1; height: 44px; position: relative; touch-action: none; }
.vp-track::before { content: ''; position: absolute; left: 0; right: 0; top: 19px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.25); }
.vp-fill { position: absolute; left: 0; top: 19px; height: 6px; border-radius: 3px; background: var(--red); }
.vp-knob { position: absolute; top: 10px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff; }
.vp-time { font-weight: 500; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; min-width: 150px; text-align: right; }

/* ---------- Скрытая кнопка ---------- */
#hotspot { position: absolute; left: 0; bottom: 0; width: 100px; height: 100px; z-index: 50; background: transparent; }
body.debug #hotspot { background: rgba(235, 30, 54, .25); outline: 1px dashed var(--red); }

/* ---------- Скринсейвер ---------- */
#screensaver { position: absolute; inset: 0; z-index: 100; background: #000; }
#screensaver[hidden] { display: none; }
.ss-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.ss-video.on { opacity: 1; }

/* Подсказка «Нажмите, чтобы начать» поверх скринсейвера: светлое стекло, красный контур, расходящиеся кольца */
.tap-hint { position: absolute; left: 50%; top: 955px; width: 620px; height: 96px; transform: translate(-50%, -50%); pointer-events: none; z-index: 2;
  opacity: 0; transition: opacity .6s ease; }
#screensaver.hint-on .tap-hint { opacity: 1; }
.th-pill { position: absolute; inset: 0; border-radius: 48px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, rgba(255,255,255,.86) 0%, rgba(255,255,255,.66) 100%);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.1); backdrop-filter: blur(var(--card-blur)) saturate(1.1);
  border: 2px solid var(--red);
  box-shadow: 0 0 18px rgba(235,30,54,.5), 0 0 42px rgba(235,30,54,.25);
  animation: th-glow 2.6s ease-in-out infinite; }
.th-text { color: var(--ink); font-weight: 600; font-stretch: 125%; font-size: 27px; line-height: 1; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.th-ring { position: absolute; inset: 0; border-radius: 48px; border: 2px solid var(--red); opacity: 0; animation: th-ring 2.6s ease-out infinite; }
.th-ring2 { animation-delay: .5s; }
@keyframes th-glow {
  0%, 100% { box-shadow: 0 0 14px rgba(235,30,54,.4), 0 0 32px rgba(235,30,54,.18); }
  50%      { box-shadow: 0 0 24px rgba(235,30,54,.75), 0 0 60px rgba(235,30,54,.35); }
}
@keyframes th-ring {
  0%   { opacity: .75; transform: scale(1, 1); }
  70%, 100% { opacity: 0; transform: scale(1.1, 1.45); }
}
body.no-blur .th-pill { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--glass-solid); }
@media (prefers-reduced-motion: reduce) { .th-pill, .th-ring { animation: none; } }

/* ---------- Переход в скринсейвер и обратно через затемнение ---------- */
#fade { position: absolute; inset: 0; z-index: 200; background: #000; opacity: 0; pointer-events: none; transition: opacity 450ms ease; }
#fade.on { opacity: 1; pointer-events: auto; }
