/* Невидимый каркас. Здесь нет ни одного решения о том, как сайт выглядит:
   ни шапки, ни героя, ни карточек, ни ритма секций. Только то, что одинаково
   ломается везде и что пользователь не видит, пока оно работает.

   Всё оформление пишется в `<сайт>/_build/src/site.css`: своя сетка, своя
   шапка, свой первый экран, свои карточки. Это сделано после того, как десять
   макетов подряд вышли на одно лицо.

   Что здесь есть:
   - сброс и типографские умолчания без размеров
   - доступность: фокус, скип-ссылка, прячущийся контент
   - поведение мобильной шторки (движение, не вид)
   - просмотр снимка, который создаёт скрипт
   - страховка при выключенном js и при reduced-motion
   - печать
*/

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip;
  scroll-padding-top: calc(var(--head-h, 64px) + 12px); }
body { margin: 0; overflow-x: clip; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { min-width: 0; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* Доступность */
:focus-visible { outline: 3px solid var(--focus, currentColor); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 200; padding: 10px 16px;
  background: #000; color: #fff; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }

/* Мобильная шторка: движение и блокировка прокрутки. Вид пишет сайт. */
.scrim { position: fixed; inset: 0; z-index: 70; }
.drawer { position: fixed; inset: 0 0 0 auto; z-index: 80; visibility: hidden;
  transform: translateX(100%); overflow-y: auto;
  transition: transform .34s cubic-bezier(.22, .68, .3, 1), visibility .34s; }
.drawer.is-on { transform: none; visibility: visible;
  transition: transform .34s cubic-bezier(.22, .68, .3, 1), visibility 0s; }
body.is-locked { overflow: hidden; }

/* Экран загрузки снимается тремя способами, третий здесь */
.pre { position: fixed; inset: 0; z-index: 120;
  animation: preAway .4s ease 4s forwards; }
.pre.is-off { opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
@keyframes preAway { to { opacity: 0; visibility: hidden; } }

/* Просмотр снимка: разметку создаёт скрипт, поэтому размеры тут */
.zoom { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center;
  padding: 24px; background: rgba(9, 12, 16, .9); }
.zoom img { max-width: min(100%, 1100px); max-height: 86vh; width: auto; }
.zoom__cap { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center;
  color: rgba(255, 255, 255, .8); font-size: 14px; }
.zoom__x { position: absolute; right: 16px; top: 16px; display: grid;
  place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff; }

/* Появление при прокрутке со страховкой: без js блоки должны быть видны */
[data-reveal] { opacity: 0; transform: translateY(12px);
  transition: opacity .55s cubic-bezier(.22, .68, .3, 1),
              transform .55s cubic-bezier(.22, .68, .3, 1); }
[data-reveal].is-in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }
.no-js .pre { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important;
    animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* На телефоне наведение залипает после тапа */
@media (hover: none), (pointer: coarse) {
  [class*="hover"] { transform: none !important; }
}

@media print {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .pre, .drawer, .scrim, .zoom, [data-nav], [data-float] { display: none !important; }
  main .rg a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 10px; }
}
