/* Шрифт Rostelecom Basis (файлы в /fonts). */
@font-face { font-family: 'Rostelecom Basis'; font-weight: 300; src: url('fonts/RostelecomBasis-Light.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Rostelecom Basis'; font-weight: 400; src: url('fonts/RostelecomBasis-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Rostelecom Basis'; font-weight: 500; src: url('fonts/RostelecomBasis-Medium.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Rostelecom Basis'; font-weight: 700; src: url('fonts/RostelecomBasis-Bold.otf') format('opentype'); font-display: swap; }

:root {
  --font-a: 'Rostelecom Basis', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-b: 'Rostelecom Basis', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  /* Цвета «Нейрошлюза»: розовый → фиолетовый → сиреневый, как на логотипе */
  --pink: #ff2e77;
  --violet: #a061ff;
  --lilac: #8e89fe;
  --accent: linear-gradient(135deg, #ff2e77 0%, #c45ae3 55%, #8e85fe 100%);
  --red: #ff2e77;            /* имя оставлено для совместимости с движком */
  --orange: #a061ff;         /* акцентный цвет (в движке первого тача здесь был оранжевый) */
  --night: #0b0a22;
  --bar-h: 89px;
  --view-h: 991px;
  --card-blur: 20px;
}

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

html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: #000; color: #fff;
  font-family: var(--font-b);
  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; }

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

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

/* ---------- Главный экран ---------- */
/* Логотип-кнопка. Прямоугольник 960×410 стоит в точке (520, 330), как в секвенции design/Logo_button_2 */
#logo-button {
  position: absolute; left: 520px; top: 330px; width: 960px; height: 410px;
  margin: 0; padding: 0; border: 0; background: none; outline: none;
  -webkit-appearance: none; appearance: none;
  transform-origin: 44% 50%;
  transition: opacity .25s ease, transform 160ms cubic-bezier(.2, .7, .2, 1), filter 160ms ease;
}
#logo-button.pressed { transform: scale(.975); filter: brightness(1.12); }
.ns-logo__svg { position: absolute; left: 0; top: 0; width: 960px; height: 410px; display: block; pointer-events: none; }
/* Живая звёздочка: кадры 128×128 из секвенции, стоят в точке (1306, 508) сцены, без масштабирования */
.ns-logo__star { position: absolute; left: 786px; top: 178px; width: 128px; height: 128px; pointer-events: none; }

/* Логотип «Ростелеком» — пиксель в пиксель как в ролике скринсейвера; не кнопка, касания проходят насквозь */
.rt-logo { position: absolute; left: 56px; top: 958px; width: 250px; height: 68px; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }

/* Стекло для кнопок: «На главную» и кнопки под логотипом */
.bar-btn, .home-btn {
  background: linear-gradient(140deg, rgba(104,90,200,.62) 4%, rgba(62,52,140,.34) 100%);
  backdrop-filter: blur(var(--card-blur)) saturate(1.15); -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.15);
  box-shadow: 0 14px 34px rgba(6,5,24,.55), inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.08);
}
body.no-blur .bar-btn, body.no-blur .home-btn { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(140deg, rgb(78,66,160) 0%, rgb(56,48,128) 100%); }
.bar-btn.pressed, .home-btn.pressed { transform: scale(.975); filter: brightness(1.15); }

/* Кнопки под логотипом (вторая, третья… включённые кнопки из админки) */
.bar { position: absolute; left: 160px; right: 160px; top: 812px; display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; pointer-events: none; }
.bar-btn {
  pointer-events: auto; position: relative; border: 0; padding: 0 44px 0 26px; margin: 0;
  height: 84px; max-width: 760px; border-radius: 42px; color: #fff;
  display: flex; align-items: center; gap: 22px;
  font: 700 28px/1.1 var(--font-a); text-align: left;
  transition: transform .12s ease;
}
.bar-btn .ico { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }
.bar-btn .ico svg { width: 20px; height: 20px; fill: #fff; display: block; }
.bar-btn .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar.many { top: 792px; gap: 18px; }
.bar.many .bar-btn { height: 68px; border-radius: 34px; font-size: 22px; padding: 0 32px 0 20px; gap: 16px; max-width: 520px; }
.bar.many .bar-btn .ico { width: 38px; height: 38px; }
.bar.many .bar-btn .ico svg { width: 16px; height: 16px; }

/* ---------- Экраны сайта / слайдов ---------- */
.viewport {
  position: absolute; left: 80px; top: 0; width: 1760px; height: var(--view-h);
  border-radius: 0 0 40px 40px; overflow: hidden; background: #fff;
  box-shadow: 0 30px 70px -26px rgba(4,3,20,.8);
}
.viewport iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
/* Во весь экран: без нижней панели, сайт/демо занимает всю сцену 1920×1080 */
#screen-site.fullscreen .viewport { left: 0; width: 1920px; height: 1080px; border-radius: 0; }
#screen-site.fullscreen .bottom-bar, #screen-video.fullscreen .bottom-bar { display: none; }
.bottom-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--bar-h);
  display: flex; align-items: flex-start; justify-content: center; padding-top: 13px;
  background: transparent;
}
/* «На главную» — 276×60 (x 822, y 1004), круг 40 с домиком, текст 20 bold по центру */
.home-btn {
  width: 276px; height: 60px; border-radius: 40px; padding: 0;
  position: relative; border: 0; color: #fff; font: 700 20px/20px var(--font-a); outline: none;
  transition: transform .12s ease;
}
.home-btn .hb-ico { position: absolute; left: 37px; top: 10px; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); }
.home-btn .hb-ico svg { position: absolute; left: 9px; top: 11px; width: 22px; height: 16px; fill: #fff; }
.home-btn > span:last-child { position: absolute; left: -58px; right: -78px; top: 22px; text-align: center; }

/* Слайды */
.slides-viewport { background: var(--night); }
#screen-slides.doc .slides-viewport { background: #f1f0f8; }
.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: 100%; display: flex; align-items: center; justify-content: center; }
.slide img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.slide img.cover { object-fit: cover; }
.slides-dots {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; gap: 10px; padding: 8px 12px; border-radius: 20px; background: rgba(0,0,0,.35);
}
.slides-dots:empty { display: none; }
.slides-dots { display: none; } /* в макете точек нет — вместо них подсказки «Свайп» */
.slides-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); transition: background .2s, transform .2s; }
.slides-dots i.on { background: #fff; transform: scale(1.2); }
.placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-a); font-size: 36px; color: rgba(255,255,255,.6); background: var(--night);
}

/* ---------- Скрытая кнопка ---------- */
#hotspot {
  position: absolute; left: 0; bottom: 0; width: 100px; height: 100px;
  z-index: 50; background: transparent;
}
body.debug #hotspot { background: rgba(239, 49, 36, .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(104,90,200,.60) 4%, rgba(62,52,140,.34) 100%);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.15); backdrop-filter: blur(var(--card-blur)) saturate(1.15);
  border: 2px solid var(--violet);
  box-shadow: 0 0 18px rgba(160,97,255,.55), 0 0 42px rgba(160,97,255,.28), inset 0 0 16px rgba(160,97,255,.22), inset 0 1px 0 rgba(255,255,255,.22);
  animation: th-glow 2.6s ease-in-out infinite;
}
.th-text { color: #fff; font: 700 30px/1 var(--font-a); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.th-ring {
  position: absolute; inset: 0; border-radius: 48px; border: 2px solid var(--violet);
  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(160,97,255,.45), 0 0 32px rgba(160,97,255,.2), inset 0 0 12px rgba(160,97,255,.16), inset 0 1px 0 rgba(255,255,255,.22); }
  50%      { box-shadow: 0 0 24px rgba(160,97,255,.8), 0 0 60px rgba(160,97,255,.38), inset 0 0 20px rgba(160,97,255,.3), inset 0 1px 0 rgba(255,255,255,.22); }
}
@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: linear-gradient(140deg, rgb(86,74,170) 0%, rgb(62,52,140) 100%); }
@media (prefers-reduced-motion: reduce) { .th-pill, .th-ring { animation: none; } }

/* Кнопки «Назад» / «Вперёд» на экране презентации: круг 40, текст 20 bold, отступ 20 */
.swipe-hint {
  position: absolute; top: 27px; height: 40px; padding: 0; border: 0; background: none;
  display: flex; align-items: center; gap: 20px; color: #fff; font: 700 20px/1 var(--font-a);
  cursor: pointer; transition: opacity .25s ease;
}
.swipe-hint.prev { left: 168px; }
.swipe-hint.next { right: 168px; }
.swipe-hint.off { opacity: 0; pointer-events: none; }
.swipe-hint .nav-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; }
.swipe-hint .nav-ico svg { width: 18px; height: 18px; fill: #fff; }
.swipe-hint:active .nav-ico { filter: brightness(1.15); transform: scale(.95); }


/* ---------- Документ (PDF/картинки прокруткой вниз) ---------- */
.doc-scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain;
  padding: 40px 0 80px; display: none; flex-direction: column; align-items: center; gap: 28px; scrollbar-width: none; }
.doc-scroller::-webkit-scrollbar { display: none; }
#screen-slides.doc .doc-scroller { display: flex; }
#screen-slides.doc .slides-track, #screen-slides.doc .swipe-hint { display: none; }
.doc-scroller img { width: 1360px; max-width: 1700px; height: auto; display: block; background: #fff; border-radius: 6px;
  box-shadow: 0 10px 40px -12px rgba(38,44,43,.35); pointer-events: none; }
.doc-scroller img.wide { width: 1680px; }
.doc-rail { position: absolute; right: 18px; top: 40px; bottom: 40px; width: 8px; border-radius: 4px; background: rgba(38,44,43,.12); display: none; }
.doc-rail i { position: absolute; left: 0; right: 0; border-radius: 4px; background: var(--orange); min-height: 40px; }
#screen-slides.doc .doc-rail { display: block; }
.doc-page { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: none;
  padding: 10px 22px; border-radius: 22px; background: rgba(28,24,70,.82); color: #fff; font: 500 20px var(--font-a); }
#screen-slides.doc .doc-page { display: block; }

/* ---------- Видео кнопки ---------- */
.video-viewport { background: #000; }
.video-viewport video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
#screen-video.fullscreen .viewport { left: 0; width: 1920px; height: 1080px; border-radius: 0; }
.vp-big { position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; margin: -90px 0 0 -90px; border: 0; border-radius: 50%;
  background: var(--accent); 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: 60px; right: 60px; bottom: 36px; height: 64px; display: flex; align-items: center; gap: 24px;
  padding: 0 24px; border-radius: 32px; background: rgba(28,24,70,.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(--orange); }
.vp-knob { position: absolute; top: 10px; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: #fff; }
.vp-time { font: 500 20px var(--font-a); color: #fff; font-variant-numeric: tabular-nums; min-width: 150px; text-align: right; }

/* ---------- Переход в скринсейвер и обратно через затемнение ---------- */
#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; }
