/* Шашлыки от дяди Гадима — общий стиль. Страницы — готовые картинки, кнопки — зоны поверх картинки. */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .2s ease-in both; }
::view-transition-new(root) { animation: vt-in .34s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }

/* Браузеры без плавных переходов: страница просто плавно проявляется */
html.no-vt body { animation: page-in .3s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: #000; color: #fff; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
img { -webkit-user-drag: none; user-select: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Главная ─────────────────────────────────────────────── */
html.is-home, body.home { height: 100%; overflow: hidden; overscroll-behavior: none; }
.stage {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #000;
}
.frame {
  position: relative;
  aspect-ratio: 941 / 1672;
  /* Картинка видна целиком: по ширине экрана или по высоте, что меньше */
  width: min(100vw, calc((100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 941 / 1672));
  width: min(100vw, calc((100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) * 941 / 1672));
}
.frame .bg {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  /* Края картинки мягко уходят в чёрный фон */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 2%, #000 98%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 2%, #000 98%, transparent 100%);
}
.hot {
  position: absolute;
  top: var(--t); left: var(--l); width: var(--w); height: var(--h);
  display: block; border-radius: 22%;
  -webkit-touch-callout: none; user-select: none; touch-action: manipulation;
  outline: none;
}
.hot:focus-visible { box-shadow: 0 0 0 3px rgba(255, 70, 70, .9); }
/* Копия кусочка картинки с кнопкой: при нажатии чуть уменьшается и подсвечивается */
.hot .piece {
  position: absolute; inset: 0; pointer-events: none;
  background-image: var(--img);
  background-size: var(--bs);
  background-position: var(--bp);
  background-repeat: no-repeat;
  opacity: 0; transform: scale(1);
  transition: opacity .14s ease, transform .18s cubic-bezier(.3, .7, .4, 1), filter .18s ease;
  -webkit-mask-image: radial-gradient(closest-side, #000 78%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 78%, transparent 100%);
}
.hot.pressed .piece { opacity: 1; transform: scale(.975); filter: brightness(1.35) saturate(1.1); }

/* ── Внутренние страницы ─────────────────────────────────── */
.back {
  position: fixed; z-index: 10;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  left: calc(env(safe-area-inset-left, 0px) + 16px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; text-decoration: none; font-size: .9rem; letter-spacing: -.01em;
  transition: transform .15s ease, background-color .15s ease;
  touch-action: manipulation;
}
.back.pressed { transform: scale(.94); background: rgba(40, 40, 40, .8); }
.back:focus-visible { outline: 2px solid #ff4646; outline-offset: 2px; }

.stack {
  max-width: 720px; margin: 0 auto;
  padding-top: calc(env(safe-area-inset-top, 0px) + 72px);
  font-size: 0; line-height: 0;
}
.stack img { display: block; width: 100%; height: auto; }

/* Раздел, который ещё готовится */
.soon {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  padding: 96px 28px 48px; text-align: center;
}
.soon h1 { margin: 0; font-size: clamp(1.9rem, 8vw, 2.8rem); line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.soon p { margin: 0; max-width: 30ch; color: rgba(255, 255, 255, .72); font-size: 1.05rem; line-height: 1.5; text-wrap: pretty; }
.soon .line { width: 64px; height: 4px; border-radius: 4px; background: #e82424; }
.btn {
  margin-top: 8px; display: inline-block; padding: 12px 28px; border-radius: 100px;
  border: 1.5px solid rgba(255, 255, 255, .28); color: #fff; text-decoration: none;
  transition: transform .15s ease, background-color .15s ease;
}
.btn.pressed { transform: scale(.95); background: rgba(255, 255, 255, .08); }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html.no-vt body { animation: none; }
  .hot .piece, .back, .btn { transition: none; }
}
