/* ==========================================================================
   Сброс + сцена показа + корпус устройства

   Два режима отображения:
   1) «Макет» (десктоп, ноутбук, планшет) — приложение всегда рисуется в своём
      логическом разрешении 390×844 и масштабируется под окно через --k.
      Поэтому на любом ноутбуке вёрстка идентична телефонной, просто мельче.
   2) «Телефон» (ширина ≤ 760px) — приложение занимает весь экран, раскладка
      резиновая.

   Главное правило проекта: ни один элемент интерфейса не имеет обводки.
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  border: 0 solid transparent;   /* обводок нет нигде и никогда */
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
  color: var(--on-light);
  background: var(--stage-3);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1;
  overflow: hidden;
  overscroll-behavior: none;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
}

button { cursor: pointer; user-select: none; }
input::placeholder, textarea::placeholder { color: currentColor; opacity: .38; }
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button { display: none; }

a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; max-width: 100%; }

:focus { outline: 0; }
:focus-visible { outline: 0; filter: brightness(1.18); }

::-webkit-scrollbar { width: 0; height: 0; }
.noscroll { scrollbar-width: none; -ms-overflow-style: none; }
.noscroll::-webkit-scrollbar { display: none; }

/* --------------------------------------------------------------------------
   Сцена
   -------------------------------------------------------------------------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: center;
  background:
    radial-gradient(120% 100% at 50% -10%, var(--stage-1) 0%, var(--stage-2) 46%, var(--stage-3) 100%);
  padding: 20px 20px calc(20px + var(--dock-h) + 24px);
}

.stage-brand {
  position: absolute;
  top: 30px;
  left: 34px;
  user-select: none;
  max-width: 230px;
}

.stage-brand__mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--stage-ink);
}

.dotmark {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .10);
  flex: none;
}

.stage-brand__sub {
  margin-top: 8px;
  margin-left: 21px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--stage-ink-2);
}

.stage-brand__keys {
  margin-top: 20px;
  margin-left: 21px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  color: var(--stage-ink-3);
}
.stage-brand__keys b {
  display: inline-block;
  min-width: 56px;
  font-weight: 600;
  color: var(--stage-ink-2);
}

/* --------------------------------------------------------------------------
   Корпус устройства
   -------------------------------------------------------------------------- */

.device {
  position: relative;
  flex: none;
  width: calc(var(--device-w) + var(--device-bezel) * 2);
  height: calc(var(--device-h) + var(--device-bezel) * 2);
  padding: var(--device-bezel);
  border-radius: var(--device-r);
  background: #08080A;
  margin-top: var(--dy, 0px);
  transform: scale(var(--k));
  transform-origin: top center;
  box-shadow:
    0 50px 100px -30px rgba(0, 0, 0, .70),
    0 16px 40px -16px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(255, 255, 255, .06) inset;
}

.device__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--device-r) - var(--device-bezel));
  overflow: hidden;
  background: var(--black);
  isolation: isolate;
  display: flex;
  flex-direction: column;
}

/* Статус-бар */
.statusbar {
  position: absolute;
  z-index: 60;
  top: 0; left: 0; right: 0;
  height: 50px;
  padding: 15px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  color: var(--on-dark);
  transition: color var(--t-base) var(--e-out);
}
.statusbar.is-light { color: var(--on-light); }

.statusbar__time {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.statusbar__icons { display: flex; align-items: center; gap: 6px; }

/* Полоса-индикатор снизу */
.homebar {
  position: absolute;
  z-index: 60;
  bottom: 7px; left: 0; right: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.homebar span {
  width: 130px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .92);
  transition: background var(--t-base) var(--e-out);
}
.device__screen.is-light .homebar span { background: rgba(10, 10, 11, .82); }

/* Контейнер экранов */
.screens {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--black);
  will-change: transform, opacity;
}

.screen.theme-light { background: var(--paper); color: var(--on-light); }
.screen.theme-dark  { background: var(--black); color: var(--on-dark); }

/* Внутренняя обёртка экрана: наследует фон и цвет темы */
.pane {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
  color: inherit;
}

/* Переходы между экранами */
.screen.is-entering { animation: scr-in var(--t-base) var(--e-out) both; }
.screen.is-entering-back { animation: scr-in-back var(--t-base) var(--e-out) both; }
.screen.is-leaving { animation: scr-out var(--t-base) var(--e-out) both; pointer-events: none; }
.screen.is-leaving-back { animation: scr-out-back var(--t-base) var(--e-out) both; pointer-events: none; }

@keyframes scr-in      { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes scr-in-back { from { opacity: 0; transform: translate3d(-14px, 0, 0) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes scr-out     { from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(0, -10px, 0) scale(.99); } }
@keyframes scr-out-back{ from { opacity: 1; transform: none; } to { opacity: 0; transform: translate3d(16px, 0, 0) scale(.995); } }

/* --------------------------------------------------------------------------
   Док демо-сценария
   -------------------------------------------------------------------------- */

.dock {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 10px 10px;
  border-radius: var(--r-pill);
  background: var(--stage-glass);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .40);
  color: var(--stage-ink);
  z-index: 5;
  user-select: none;
  max-width: calc(100vw - 32px);
}

.dock__btn {
  width: 38px; height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  transition: transform var(--t-fast) var(--e-out), opacity var(--t-fast);
}
.dock__btn:active { transform: scale(.9); }
.dock__btn--ghost { background: var(--stage-fill); color: var(--stage-ink); }
.dock__btn svg { width: 15px; height: 15px; }

.dock__body { min-width: 0; flex: 1 1 auto; padding: 0 4px; }
.dock__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--stage-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dock__progress {
  margin-top: 6px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.dock__progress i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: #fff;
  transition: width var(--t-base) var(--e-out);
}

.dock__speed {
  height: 32px;
  flex: none;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--stage-fill);
  font-size: 12px;
  font-weight: 600;
  color: var(--stage-ink);
}

/* Титры демо */
.narrator {
  position: absolute;
  top: 30px;
  right: 34px;
  max-width: 250px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--stage-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .34);
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--stage-ink);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--t-base) var(--e-out), transform var(--t-base) var(--e-out);
  pointer-events: none;
  z-index: 5;
}
.narrator.is-on { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   Узкие / низкие окна в режиме макета: убираем боковую обвязку,
   чтобы телефон занимал максимум места
   -------------------------------------------------------------------------- */

@media (max-width: 1080px), (max-height: 700px) {
  .stage-brand__keys { display: none; }
}

@media (max-width: 940px), (max-height: 620px) {
  .stage-brand, .narrator { display: none; }
  .stage { padding: 12px 12px calc(12px + var(--dock-h) + 14px); }
  .dock { bottom: 14px; }
}

/* --------------------------------------------------------------------------
   Режим телефона: приложение на весь экран
   -------------------------------------------------------------------------- */

@media (max-width: 760px) {
  .stage {
    padding: 0;
    background: #000;
    grid-template-rows: 100%;
    align-content: stretch;
    justify-items: stretch;
    align-items: stretch;
  }
  .stage-brand, .narrator { display: none; }

  .device {
    width: 100%;
    height: 100%;
    padding: 0;
    margin-top: 0;
    border-radius: 0;
    transform: none;
    box-shadow: none;
  }
  .device__screen {
    border-radius: 0;
    padding-bottom: calc(var(--dock-h) + var(--safe-b));
  }
  .statusbar { padding-top: max(15px, var(--safe-t)); height: calc(50px + max(0px, var(--safe-t) - 15px)); }
  .homebar { display: none; }

  .dock {
    bottom: 0; left: 0; right: 0;
    transform: none;
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0;
    background: rgba(24, 24, 27, .94);
    z-index: 90;
    padding: 10px 14px calc(10px + var(--safe-b));
    box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
  }
}

/* Совсем узкие телефоны */
@media (max-width: 360px) {
  .dock { gap: 8px; padding-left: 8px; padding-right: 10px; }
  .dock__btn { width: 34px; height: 34px; }
  .dock__speed { padding: 0 9px; }
}
