/* =============================================================
   WEWO — CINEMATIC ONBOARDING
   Премиальная заставка первого входа. Отдельный модуль:
   ничего из основного style.css не переопределяет.
   Принципы: почти чёрный фон, крупная типографика, паузы,
   очень мягкие переходы. Только opacity / transform / filter — GPU-friendly.
   ============================================================= */

.cine {
  position: fixed; inset: 0; z-index: 9999;
  background: #060607;
  display: flex; align-items: center; justify-content: center;
  font-family: "Onest", "Inter", system-ui, sans-serif;
  color: #EAECF5;
  overflow: hidden;
  /* Безопасные зоны на телефонах (чёлка, домашняя полоса) */
  padding: calc(env(safe-area-inset-top, 0px) + 24px)
           calc(env(safe-area-inset-right, 0px) + 20px)
           calc(env(safe-area-inset-bottom, 0px) + 24px)
           calc(env(safe-area-inset-left, 0px) + 20px);
  /* Плавный уход в интерфейс */
  transition: opacity .9s cubic-bezier(.22,.61,.36,1), transform 1.1s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.cine[hidden] { display: none; }

/* Уход заставки: растворяется и чуть приближается — «входим внутрь системы» */
.cine.exit { opacity: 0; transform: scale(1.06); pointer-events: none; }

/* --- Мягкий световой импульс (сцена «система просыпается») --- */
.cine-veil {
  position: absolute; inset: -20%;
  opacity: 0;
  transition: opacity 2.2s cubic-bezier(.4,0,.2,1), transform 3.4s cubic-bezier(.4,0,.2,1);
  transform: scale(.9);
  pointer-events: none;
  background:
    radial-gradient(closest-side at 50% 50%, rgba(255,255,255,.09), transparent 70%),
    radial-gradient(closest-side at 50% 56%, rgba(111,168,255,.07), transparent 72%);
}
.cine.awake .cine-veil { opacity: 1; transform: scale(1); }

/* --- Сцена --- */
.cine-stage {
  position: relative; z-index: 2;
  width: 100%; max-width: 900px;
  display: grid; place-items: center;
  text-align: center;
}
/* Все сцены лежат в одной точке — переключаются прозрачностью */
.cine-stage > * { grid-area: 1 / 1; }

/* Базовое поведение любого элемента сцены */
.cine-el {
  opacity: 0;
  transform: scale(.98);
  filter: blur(8px);
  will-change: opacity, transform, filter;
  transition:
    opacity .9s cubic-bezier(.22,.61,.36,1),
    transform 1.2s cubic-bezier(.22,.61,.36,1),
    filter .9s cubic-bezier(.22,.61,.36,1);
}
.cine-el.in  { opacity: 1; transform: scale(1);    filter: blur(0); }
.cine-el.out { opacity: 0; transform: scale(1.012); filter: blur(5px); }
/* Быстрые сцены (три фразы) */
.cine-el.quick { transition-duration: .42s, .6s, .42s; }
.cine-el.quick.out { transition-duration: .38s, .5s, .38s; }

/* --- Типографика --- */
.cine-line {
  font-size: clamp(26px, 5.6vw, 58px);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: #EAECF5;
}

.cine-word {
  font-size: clamp(58px, 17vw, 172px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.92;
  color: #ffffff;
}
.cine-sub {
  margin-top: clamp(10px, 1.8vw, 18px);
  font-size: clamp(10px, 1.5vw, 14px);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(245,244,242,.5);
  padding-left: 0.42em;   /* компенсируем трекинг, чтобы блок был по центру */
}

/* --- Финальная сцена ---
   Бренд и приглашение лежат в одной ячейке сетки, поэтому в финале
   разводим их по вертикали сдвигом — заодно получаем плавное движение:
   бренд мягко поднимается, приглашение проявляется под ним. */
/* Сдвиг на половину собственной высоты — корректно на любом экране */
.cine-stage.final-mode .cine-brand.in { transform: translateY(calc(-50% - 14px)); }
.cine-stage.final-mode .cine-final.in { transform: translateY(calc(50% + 14px)); }

.cine-final { display: grid; place-items: center; gap: clamp(20px, 3.4vw, 34px); }
.cine-welcome {
  font-size: clamp(19px, 3.2vw, 34px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #EAECF5;
  max-width: 18em;
}
.cine-start {
  appearance: none; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.045);
  color: #ffffff;
  font-family: inherit; font-size: 15px; font-weight: 500;
  letter-spacing: 0.01em;
  padding: 15px 44px; border-radius: 999px;
  cursor: pointer;
  min-height: 48px;                 /* удобно для пальца */
  transition: background .35s ease, border-color .35s ease, transform .35s cubic-bezier(.22,.61,.36,1);
}
.cine-start:hover { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.38); transform: scale(1.03); }
.cine-start:active { transform: scale(.99); }
.cine-start:focus-visible { outline: 2px solid rgba(255,255,255,.5); outline-offset: 3px; }

/* --- «Пропустить» — намеренно незаметно --- */
.cine-skip {
  position: absolute; z-index: 3;
  right: calc(env(safe-area-inset-right, 0px) + 22px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; letter-spacing: 0.02em;
  color: rgba(245,244,242,.32);
  padding: 10px 6px; min-height: 44px;
  transition: color .3s ease, opacity .8s ease;
  opacity: 0;
}
.cine.ready .cine-skip { opacity: 1; }
.cine-skip:hover { color: rgba(245,244,242,.7); }

/* --- Вход в интерфейс: приложение проявляется из размытия --- */
body.app-enter #homeView,
body.app-enter #officeView,
body.app-enter .topbar {
  animation: appEnter 1.1s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes appEnter {
  from { opacity: 0; transform: scale(1.015); filter: blur(6px); }
  to   { opacity: 1; transform: none;         filter: blur(0); }
}

/* --- Телефон: чуть компактнее --- */
@media (max-width: 560px) {
  .cine-sub { letter-spacing: 0.3em; padding-left: 0.3em; }
  .cine-start { width: 100%; max-width: 280px; }
}

/* --- Уважение к настройке «меньше движения» --- */
@media (prefers-reduced-motion: reduce) {
  .cine, .cine-el, .cine-veil, .cine-start { transition-duration: .01ms !important; }
  body.app-enter #homeView,
  body.app-enter #officeView,
  body.app-enter .topbar { animation: none; }
  .cine-el { filter: none; transform: none; }
  .cine-el.in { filter: none; transform: none; }
}

/* =============================================================
   Шаг 2 — знакомство с бизнесом (после заставки)
   ============================================================= */
.biz {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(246,244,236,.86);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  font-family: "Inter", "Onest", system-ui, sans-serif;
  animation: bizIn .6s cubic-bezier(.22,.61,.36,1) both;
}
.biz[hidden] { display: none; }
@keyframes bizIn { from { opacity: 0; } to { opacity: 1; } }

.biz-card {
  width: 100%; max-width: 480px;
  background: #ffffff; border: 1px solid #B9BDD0;
  border-radius: 20px; padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 24px 70px rgba(0,0,0,.10);
  animation: bizCard .7s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes bizCard { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.biz-title {
  font-size: clamp(20px, 3.4vw, 26px); font-weight: 700;
  letter-spacing: -0.02em; color: #0d0d0d; margin-bottom: 6px;
}
.biz-sub { font-size: 14.5px; color: #6f6d66; line-height: 1.5; margin-bottom: 22px; }
.biz-field { margin-bottom: 12px; }
.biz-label { display: block; font-size: 12.5px; color: #6f6d66; margin-bottom: 5px; }
.biz-input {
  width: 100%; box-sizing: border-box;
  background: #EAECF5; border: 1px solid rgba(255,255,255,.12); border-radius: 11px;
  padding: 12px 14px; font-size: 15px; font-family: inherit; color: #0d0d0d;
  transition: border-color .18s ease;
}
.biz-input:focus { outline: none; border-color: #0d0d0d; }
.biz-input::placeholder { color: #b3b0a6; }
.biz-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.biz-save {
  flex: 1; background: #0d0d0d; color: #fff; border: none; border-radius: 999px;
  padding: 14px 22px; font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; min-height: 48px; transition: background .2s ease;
}
.biz-save:hover { background: #222; }
.biz-later {
  background: none; border: none; color: #6f6d66; font-size: 14px; font-family: inherit;
  cursor: pointer; padding: 12px 8px; min-height: 44px;
}
.biz-later:hover { color: #0d0d0d; }
.biz-err { color: #c0392b; font-size: 13px; min-height: 18px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .biz, .biz-card { animation: none; }
}
