/* Шрифт 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;
  --red: #ff4f12;            /* фирменный оранжевый Ростелекома (имя переменной оставлено для совместимости) */
  --orange: #ff4f12;
  --graphite: #262c2b;
  --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: #6e777d;
}

.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) .card, .screen:not(.active) .bar-btn, .screen:not(.active) .home-btn { visibility: hidden; }

/* ---------- Главный экран ---------- */
.main-bg { position: absolute; inset: 0; background: #6e777d; }
.main-bg svg { position: absolute; inset: 0; width: 1920px; height: 1080px; display: block; }
.main-bg-anim { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.main-bg-anim.on { opacity: 1; }
.main-bg-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.main-bg-video:not([src]) { display: none; }
.rt-logo { position: absolute; left: 80px; top: 51px; width: 413px; height: 106px; pointer-events: none; }
#main-title {
  position: absolute; left: 65px; top: 170px; margin: 0; font-family: var(--font-a); font-weight: 700;
  font-size: 56px; line-height: 1.05; text-transform: uppercase; white-space: pre-line;
}
#main-title:empty { display: none; }

/* Карточки: позиции и размеры считает kiosk.js (правило раскладки для 1–12 кнопок) */
.cards { position: absolute; inset: 0; pointer-events: none; }
/* Стекло по макету Figma: линейный градиент #495762 80%→20%, эффект Glass, тень 15/15/30 #495762 80% */
.card, .bar-btn, .home-btn {
  background: linear-gradient(140deg, rgba(73,87,98,.80) 4%, rgba(73,87,98,.30) 100%);
  backdrop-filter: blur(var(--card-blur)) saturate(1.1); -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.1);
  box-shadow: 15px 15px 30px rgba(73,87,98,.8), inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.05);
}
.card {
  position: absolute; pointer-events: auto; border-radius: 40px; overflow: hidden; color: #fff;
  --pad-x: 76px; --text-top: 46px; --badge-top: 152px;
  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;
}
body.no-blur .card, body.no-blur .bar-btn, body.no-blur .home-btn { backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(140deg, rgb(78,91,101) 0%, rgb(98,109,118) 100%); }
.card.pressed, .bar-btn.pressed, .home-btn.pressed { transform: scale(.975); filter: brightness(1.12); }
.card-text { position: absolute; left: var(--pad-x); right: 36px; top: var(--text-top); display: flex; flex-direction: column; gap: 8px; }
.card-title { font-family: var(--font-a); font-weight: 700; font-size: 30px; line-height: 30px; white-space: pre-line; }
.card-sub { font-family: var(--font-b); font-weight: 400; font-size: 20px; line-height: 20px; color: #fff; white-space: pre-line; }
.card-badge { position: absolute; left: var(--pad-x); top: var(--badge-top); display: flex; align-items: center; gap: 20px;
  color: var(--orange); font: 700 20px/20px var(--font-a); }
.card-badge svg { flex: none; width: 30px; height: 38px; display: block; }
.card-badge span:empty { display: none; }
.card-kv { display: none; }
/* 6 кнопок (3 ряда): 724×224 — заголовок с 46 px, значок с 152 px */
.card.s { --text-top: 46px; --badge-top: 152px; }
/* 4 кнопки (2 ряда): 720×301 — заголовок с 80 px, значок с 195 px */
.card.m { --text-top: 80px; --badge-top: 195px; }
/* 2 кнопки (1 ряд): 722×472 — значок сверху (87 px), заголовок с 236 px, без подписи метки */
.card.l { --text-top: 236px; --badge-top: 87px; }
.card.l .card-badge span { display: none; }
/* 7–12 кнопок (3–4 колонки) — компактнее */
.card.xs { --pad-x: 40px; --text-top: 34px; --badge-top: auto; border-radius: 32px; }
.card.xs .card-title { font-size: 24px; line-height: 26px; white-space: normal; }
.card.xs .card-sub { font-size: 17px; line-height: 19px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.xs .card-badge { top: auto; bottom: 28px; font-size: 18px; gap: 16px; }
.card.xs .card-badge svg { width: 24px; height: 30px; }

/* Кнопки под карточками (например, «Посмотреть ролик») */
.bar { position: absolute; left: 0; right: 0; display: flex; justify-content: center; gap: 24px; pointer-events: none;
  transition: top .5s cubic-bezier(.2,.8,.2,1); }
/* «Посмотреть ролик» — 580×95, радиус 40, круг 35 с треугольником, текст 30 bold по центру */
.bar-btn {
  pointer-events: auto; position: absolute; border: 0; padding: 0;
  width: 580px; height: 95px; border-radius: 40px; color: #fff;
  font: 700 30px/30px var(--font-a);
  transition: transform .12s ease, top .5s cubic-bezier(.2,.8,.2,1);
}
.bar-btn .play { position: absolute; left: 98px; top: 28px; width: 35px; height: 35px; border-radius: 50%; background: var(--orange); display: grid; place-items: center; }
.bar-btn .play svg { fill: #fff; width: 18px; height: 18px; }
.bar-btn .t { position: absolute; left: 49px; right: 49px; top: 32px; text-align: center; }

/* ---------- Экраны сайта / слайдов ---------- */
.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 60px -30px rgba(22,28,32,.6);
}
.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;
  box-shadow: 7.5px 7.5px 15px rgba(73,87,98,.8), inset 0 1px 0 rgba(255,255,255,.16), inset 0 0 0 1px rgba(255,255,255,.05);
  transition: transform .12s ease;
}
.home-btn .hb-ico { position: absolute; left: 37px; top: 10px; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); }
.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: #fff; }
.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: #0a0a12;
}

/* ---------- Скрытая кнопка ---------- */
#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(128,142,152,.58) 4%, rgba(96,110,120,.30) 100%);
  -webkit-backdrop-filter: blur(var(--card-blur)) saturate(1.1); backdrop-filter: blur(var(--card-blur)) saturate(1.1);
  border: 2px solid var(--orange);
  box-shadow: 0 0 18px rgba(255,79,18,.55), 0 0 42px rgba(255,79,18,.28), inset 0 0 16px rgba(255,79,18,.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(--orange);
  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(255,79,18,.45), 0 0 32px rgba(255,79,18,.2), inset 0 0 12px rgba(255,79,18,.16), inset 0 1px 0 rgba(255,255,255,.22); }
  50%      { box-shadow: 0 0 24px rgba(255,79,18,.8), 0 0 60px rgba(255,79,18,.38), inset 0 0 20px rgba(255,79,18,.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(118,132,142) 0%, rgb(100,113,122) 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(--orange); 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(38,44,43,.78); 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(--orange); 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(38,44,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(--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; }
