@font-face { font-family: "Gogol"; src: url("assets/fonts/gogol.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "NT Somic"; src: url("assets/fonts/nt-somic-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "NT Somic"; src: url("assets/fonts/nt-somic-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Luculent"; src: url("assets/fonts/luculent.woff2") format("woff2"); font-display: swap; }

:root {
  --cream: #fef9f2;
  --red: #b63522;
  --ink: #000;
  --line: #414141;
  --red-line: rgb(182 53 34 / 0.45);

  --script: "Gogol", "Snell Roundhand", cursive;
  --sans: "NT Somic", -apple-system, "Helvetica Neue", sans-serif;
  --mono: "Luculent", ui-monospace, Menlo, monospace;
  --mono-tracking: -1px;

  --bar: 96px;
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 8px);
  -webkit-text-size-adjust: 100%;
}

/* Запрет выделения и копирования текста, внешний вид не меняется */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

html,
body { overscroll-behavior-x: none; }

html,
body,
.menu { scrollbar-width: none; }

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.menu::-webkit-scrollbar { display: none; }

body.menu-open { overflow: hidden; }

body.menu-open .bar__logo { opacity: 0; }
body.menu-open .bar::after { opacity: 0; }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul, dl, dd { margin: 0; padding: 0; }
ul { list-style: none; }

:focus-visible { outline: 1px solid var(--red); outline-offset: 3px; }

/* Карточка — кнопка: после касания у неё не остаётся красной рамки фокуса */
.card:focus,
.card:focus-visible { outline: none; }

/* Сайт мобильный: на больших экранах держим ту же колонку по центру */
.page { max-width: 393px; margin: 0 auto; }

/* ---------- Верхняя панель ---------- */

.bar {
  /* Мягкий выезд и заезд шторки: плавный разгон и плавное торможение */
  transition: transform 0.55s cubic-bezier(0.45, 0, 0.2, 1);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--bar) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--cream);
}

/* Тонкая красная линия под шапкой — общая для всех экранов */
.bar::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 0;
  border-top: 1px solid var(--red-line);
}

.bar__logo {
  margin: 0;
  font-size: 0;
  font-weight: 400;
  line-height: 0;
  transition: opacity 0.2s ease;
}

.bar__logo img {
  width: 177.348px;
  height: 61px;
  max-width: none;
}

.burger {
  position: absolute;
  right: 16px;
  top: calc(50% + env(safe-area-inset-top) / 2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: none;
  transform: translateY(-50%);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.burger__icon {
  position: absolute;
  width: 30px;
  height: 9px;
  transition: opacity 0.2s;
}

.burger__line {
  position: absolute;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--red);
  opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.2s;
}

.burger[aria-expanded="true"] .burger__icon { opacity: 0; }
.burger[aria-expanded="true"] .burger__line { opacity: 1; }
.burger[aria-expanded="true"] .burger__line:nth-child(2) { transform: rotate(45deg); }
.burger[aria-expanded="true"] .burger__line:nth-child(3) { transform: rotate(-45deg); }

/* ---------- Меню ---------- */

.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--cream);
  color: var(--red);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s var(--ease), visibility 0s 0.3s;
}

.menu.is-open {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s var(--ease);
}

.menu__inner {
  max-width: 393px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 176px 4px 48px;
}

.menu__list { border: 0; }

.menu__list li {
  border-bottom: 1px solid var(--red-line);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.menu__list li:last-child { border-bottom: 0; }

.menu.is-open li { opacity: 1; transform: none; }
.menu.is-open li:nth-child(2) { transition-delay: 0.05s; }
.menu.is-open li:nth-child(3) { transition-delay: 0.1s; }
.menu.is-open li:nth-child(4) { transition-delay: 0.15s; }

.menu__list a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 0 13px;
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.48px;
  text-align: center;
  text-transform: uppercase;
}

/* ---------- Первый экран ---------- */

.hero { padding: 25px 0 62px; }

.hero__mark {
  position: relative;
  width: min(392px, 100%);
  margin: 0 auto;
}

.hero__logo {
  position: relative;
  z-index: 1;
  width: 100%;
}

.hero__photo {
  position: absolute;
  left: 50%;
  top: calc(95% - 34px);
  width: 110px;
  border-radius: 50%;
  transform: translateX(-50%);
}

.hero__text {
  width: min(84%, 319px);
  margin: 90px auto 0;
  font-family: var(--script);
  font-size: 26px;
  line-height: 1.35;
  text-align: center;
}

/* ---------- Карточки ---------- */

/* Карточки на 32 px шире половины экрана, ряд листается вбок */
.catalog {
  display: flex;
  gap: 8px;
  padding: 0 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 8px;
  scrollbar-width: none;
}

.catalog::-webkit-scrollbar { display: none; }

/* Отступ справа после последней карточки */
.catalog::after {
  content: "";
  flex: 0 0 0px;
}

.catalog > .card {
  flex: 0 0 calc((min(100vw, 393px) - 24px) / 2 + 32px);
  scroll-snap-align: start;
}

.card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* После появления карточка реагирует на нажатие быстро, а не с задержкой анимации появления */
.js .card.reveal.is-settled { transition: transform 0.16s ease-out; }

.js .card.reveal.is-pressed { transform: translateY(3px) scale(0.985); }

/* Рамка ровно 0,5 px на любом экране: линия 1 px, уменьшенная вдвое */
.card__frame {
  position: relative;
  padding: 4px;
}

.card__frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  border: 1px solid #000;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
}

/* Пропорция фото 896:1152 — снимок помещается в рамку целиком */
.card__photo {
  position: relative;
  height: 254px;
  overflow: hidden;
}

.card__track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.card__track.is-animating { transition: transform 0.42s cubic-bezier(0.22, 0.8, 0.24, 1); }

.card__track img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Маленькие точки под рамкой фото */
.dots--under {
  gap: 4px;
  margin: 2px 0 0;
}

.dots.dots--under span {
  width: 4px;
  height: 4px;
}

/* Подсказка нажать: сама карточка уже кнопка, поэтому касание проходит сквозь */
.card__cta {
  position: absolute;
  left: 50%;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 8px);
  height: 33px;
  padding: 0 15px;
  transform: translateX(-50%);
  border: 0.5px solid var(--line);
  border-radius: 24px;
  background: var(--red);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1;
  letter-spacing: -0.28px;
  pointer-events: none;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 6px 22px;
  font-family: var(--mono);
  text-align: center;
}

/* Отступы подобраны по видимым буквам, чтобы текст стоял посередине карточки */
/* Блок заголовка в обеих карточках одной высоты — как у двухстрочного «Говяжий паштет»,
   однострочное название стоит в нём по центру */
.card__title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-bottom: 18px;
  padding-top: 6px;
  font-family: var(--script);
  font-size: 32px;
  font-weight: 400;
  line-height: 0.56;
  color: var(--red);
  -webkit-text-stroke: 0.2px var(--red);
}


.card__text {
  align-self: center;
  width: 100%;
}

/* Заголовки в ряду стоят на одной высоте, цены прижаты к низу карточки */
.card__price {
  margin-top: auto;
  padding-top: 12px;
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -0.28px;
  white-space: nowrap;
}

.card__text {
  letter-spacing: -0.28px;
  font-size: 14px;
  line-height: 1.15;
}

.prices {
  letter-spacing: -0.5px;
  display: grid;
  gap: 3px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.3;
}

.prices div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prices div::before {
  content: "";
  order: 1;
  flex: 1;
  min-width: 10px;
  border-top: 0.5px solid var(--line);
}

.prices dt { order: 0; white-space: nowrap; }
.prices dd { order: 2; white-space: nowrap; }

/* ---------- Страница товара ---------- */

.bar--over {
  position: absolute;
  left: 0;
  right: 0;
  background: none;
  pointer-events: none;
}

.page--item { position: relative; }

.bar--over > * { pointer-events: auto; }

.round {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 16px;
  display: flex;
  align-items: center;
  width: 44px;
  height: 44px;
}

.hero-item {
  position: relative;
  overflow: hidden;
}

/* Линия под описанием: по той же сетке, что и контент ниже */
.hero-item::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  border-top: 0.5px solid var(--line);
}

.hero-item { touch-action: pan-y; }

/* В карточке жест вбок может достаться и фото, и ряду карточек — решает скрипт */
.card__photo { touch-action: pan-x pan-y; }

.hero-item__track {
  display: flex;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.hero-item__track.is-animating { transition: transform 0.42s cubic-bezier(0.22, 0.8, 0.24, 1); }

.hero-item__photo {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 896 / 1152;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}

.hero-item__info {
  position: relative;
  margin-top: -110px;
  padding: 96px 16px 24px;
  background: linear-gradient(
    to bottom,
    rgb(254 249 242 / 0) 0,
    rgb(254 249 242 / 0.03) 14px,
    rgb(254 249 242 / 0.1) 28px,
    rgb(254 249 242 / 0.24) 42px,
    rgb(254 249 242 / 0.44) 56px,
    rgb(254 249 242 / 0.66) 70px,
    rgb(254 249 242 / 0.84) 84px,
    rgb(254 249 242 / 0.95) 98px,
    var(--cream) 112px
  );
  pointer-events: none;
  text-align: center;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-line);
  transition: background-color 0.25s;
}

.dots span.is-active { background: var(--red); }

.hero-item__title {
  font-family: var(--script);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--red);
}

.hero-item__title--tight {
  padding-top: 12px;
  padding-bottom: 11px;
  line-height: 0.56;
}

.hero-item__text {
  margin: 20px 0 0;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: var(--mono-tracking);
}

.details {
  display: grid;
  gap: 28px;
  padding: 28px 16px 40px;
}

.details__label {
  font-family: var(--script);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--red);
}

.details__text {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: var(--mono-tracking);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pill {
  padding: 8px 14px;
  border: 0.5px solid var(--line);
  border-radius: 24px;
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.3;
  letter-spacing: var(--mono-tracking);
  color: var(--ink);
}

.pill {
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pill[aria-pressed="true"] { background: var(--red); color: var(--cream); }

.buy {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: 100%;
  max-width: 393px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--red);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: var(--mono-tracking);
  text-align: center;
  transform: translateX(-50%);
}

.buy__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}

.buy__buttons a {
  display: block;
  font-size: 18px;
  padding: 8px 12px;
  border: 0.5px solid var(--cream);
  border-radius: 24px;
  text-transform: uppercase;
}

.page--item main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- Как заказать: экран наезжает на страницу снизу вверх ---------- */

/* Первый экран и карточки «прилипают», когда их низ доходит до края экрана,
   и следующий блок накрывает их, как новая страница */
/* Карточки доезжают до отметки 16 px от верха экрана и фиксируются,
   «Как заказать» идёт следом на расстоянии 64 px */
.stack-under {
  position: sticky;
  top: var(--stick-top, 0px);
  padding-bottom: 64px;
}

.stack-under > * { will-change: opacity; }

/* Шапка-шторка: уезжает за верх экрана при скролле вниз и опускается при скролле вверх */
.bar:not(.bar--over) {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 70;
  width: 100%;
  max-width: 393px;
  transform: translate(-50%, 0);
}

.bar.is-hidden { transform: translate(-50%, -100%); }

.page:not(.page--item) { padding-top: calc(var(--bar) + env(safe-area-inset-top)); }

/* Листы «Как заказать» и «Доставка»: каждый наезжает на предыдущий снизу вверх.
   «Как заказать» прилипает к верху экрана, и «Доставка» накрывает его */
.sheet {
  position: relative;
  min-height: 100svh;
  padding: 56px 24px 64px;
  border-radius: 32px 32px 0 0;
  text-align: center;
}

/* «Как заказать»: кремовый лист без скругления с тонкой рамкой, внутри красный блок с отступом 8 px */
.sheet--red {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  padding: 8px;
  border-radius: 0;
  background: var(--cream);
  color: var(--cream);
}

.sheet--red::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  border: 1px solid #000;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
}

.sheet__inner {
  flex: 1;
  padding: 48px 16px 40px;
  background: var(--red);
}

.sheet__photo {
  display: block;
  width: 100%;
  height: 163px;
  object-fit: cover;
}

/* Описание тем же шрифтом и размером, что и в карточках товаров */
.sheet--red .sheet__text--card {
  margin-top: 40px;
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -0.28px;
}

/* «Доставка»: тот же формат, что у «Как заказать» — внешняя рамка, отступ 8 px и блок со своей рамкой */
.sheet--cream {
  z-index: 41;
  display: flex;
  padding: 8px;
  border-radius: 0;
  background: var(--cream);
  color: var(--red);
}

.sheet__inner--cream {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cream);
}

.sheet__inner--cream::after,
.sheet__photo-frame::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  border: 1px solid #000;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
}

.sheet__photo-frame {
  position: relative;
  margin-top: 40px;
}

/* Подпись в конце блока «Доставка» */
.sheet__inner--cream .foot {
  margin-top: auto;
  padding: 64px 0 8px;
}

.sheet__inner--cream .foot p { color: var(--ink); }

.sheet--cream::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  border: 1px solid #000;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
}

.sheet__title {
  font-family: var(--script);
  font-size: 40px;
  font-weight: 400;
  line-height: 0.56;
}

.sheet__text {
  margin-top: 64px;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.28px;
}

.sheet__buttons {
  display: grid;
  gap: 6px;
  margin-top: 19px;
}

.sheet__button {
  display: block;
  padding: 8px 12px;
  border: 0.5px solid var(--cream);
  border-radius: 24px;
  color: var(--cream);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: var(--mono-tracking);
  text-transform: uppercase;
}

/* ---------- Заказ ---------- */

.order {
  margin: 148px 8px 0;
  padding: 56px 24px 48px;
  text-align: center;
}

.nowrap { white-space: nowrap; }

.order--plain {
  margin-top: 0;
  padding-top: 96px;
}

.order__title {
  font-family: var(--script);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--red);
}

.order__text {
  max-width: 230px;
  margin: 20px auto 0;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: var(--mono-tracking);
}

.order__buttons {
  display: grid;
  gap: 8px;
  margin-top: 36px;
}

.order__button {
  display: block;
  padding: 8px 12px;
  border: 0.5px solid var(--line);
  border-radius: 24px;
  background: var(--red);
  color: var(--cream);
  font-family: var(--mono);
  font-size: 18px;
  letter-spacing: var(--mono-tracking);
  text-transform: uppercase;
}

/* ---------- Общий подвал всех страниц ---------- */

.site-foot {
  position: relative;
  margin-top: 18px;
  padding: 48px 24px calc(80px + env(safe-area-inset-bottom));
  background: var(--red);
  color: var(--cream);
  text-align: center;
  /* Контент сайта ограничен мобильной сеткой 393 px, но цвет футера
     должен доходить до физических краёв любого экрана. */
  box-shadow: 0 0 0 100vmax var(--red);
  clip-path: inset(0 -100vmax);
}

.site-foot::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -10px;
  border-top: 1px solid var(--red);
}

.site-foot__logo {
  width: min(177.348px, 100%);
  height: auto;
  margin: 0 auto 32px;
}

.site-foot__nav {
  display: grid;
  gap: 11px;
  width: calc(50% - 24px);
  margin-left: 50%;
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -0.24px;
  text-align: left;
  text-transform: uppercase;
}

.site-foot__contact {
  width: calc(50% - 24px);
  margin-left: 50%;
  margin-top: 28px;
  font-family: "Overpass Mono", ui-monospace, Menlo, monospace;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: -0.24px;
  text-align: left;
  text-transform: uppercase;
}

.site-foot__contact a { display: block; margin-top: 11px; }

.foot {
  padding: 216px 24px calc(120px + env(safe-area-inset-bottom));
  text-align: center;
}

.foot__logo { width: 226px; margin: 0 auto; }

/* Без отдельного слоя и с запасом снизу: хвосты «р» и «у» выходят за строку, и слой мог бы их обрезать */
.foot p {
  margin-top: -14px;
  margin-bottom: -20px;
  padding-bottom: 20px;
  font-family: var(--script);
  font-size: 26px;
  line-height: 1.35;
}

/* ---------- Появление при прокрутке ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal { opacity: 1; transform: none; }
}
