/* Шрифт Inter — тот же, что в программе «Учёт КРС», хранится у сайта (без внешних подключений) */
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/inter-cyrillic-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --text: #15201a;
  --muted: #66736b;
  --line: #e7ece9;
  --brand: #167743;
  --radius: 22px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Шапка */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand__mark { flex: none; border-radius: 9px; }
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__name { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.2; }
.brand__tagline { color: var(--muted); font-size: 0.8rem; line-height: 1.2; }
.today {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.today::first-letter { text-transform: uppercase; }

/* Приветствие */
.intro { padding: 40px 0 24px; }
.intro__hello {
  margin: 0 0 4px;
  color: var(--brand);
  font-weight: 600;
  font-size: 0.95rem;
}
.intro__title {
  margin: 0;
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

/* Плитки */
/* Все плитки в один ряд: делят ширину поровну; не помещаются (уже 200px) — ряд листается вбок, как в кино-приложении.
   Отступы с отрицательными полями — чтобы подъем и тень плитки при наведении не обрезались прокруткой */
.tiles {
  list-style: none;
  margin: -10px -10px 0;
  padding: 10px 10px 48px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 10px;
  scrollbar-width: thin;
}
.tiles > li { scroll-snap-align: start; }
/* Справа есть еще плитки (ряд не поместился) — край ряда затухает, подсказывая листать */
.tiles--more {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 72px), transparent);
}

.tile {
  --c1: #2f9a5e;
  --c2: #0b5a33;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 4 / 5;
  padding: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(160deg, var(--c1), var(--c2));
  box-shadow: 0 1px 2px rgba(16, 40, 26, 0.08), 0 8px 24px -12px rgba(16, 40, 26, 0.35);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
/* Крупный полупрозрачный значок на фоне — «постер» как в приложениях кино */
.tile::after {
  content: '';
  position: absolute;
  right: -18%;
  bottom: -14%;
  width: 78%;
  aspect-ratio: 1;
  background: var(--watermark, none) center / contain no-repeat;
  opacity: 0.12;
  pointer-events: none;
}

a.tile:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 2px 4px rgba(16, 40, 26, 0.08), 0 22px 40px -16px rgba(16, 40, 26, 0.5);
}
a.tile:active { transform: scale(0.98); }
a.tile:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}

.tile__badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.75rem;
  font-weight: 600;
}
a.tile .tile__badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8ff0b4;
  box-shadow: 0 0 0 3px rgba(143, 240, 180, 0.25);
}

.tile__icon {
  width: 64px;
  height: 64px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.16);
}

.tile__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tile__title {
  font-size: clamp(1.2rem, 0.9rem + 0.6vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.tile__desc {
  font-size: 0.875rem;
  line-height: 1.35;
  opacity: 0.88;
}
.tile__open {
  align-self: flex-start;
  margin-top: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--c2);
  font-size: 0.875rem;
  font-weight: 600;
}
.tile__open::after { content: ' →'; }

.tile--soon {
  cursor: default;
  box-shadow: none;
  background: repeating-linear-gradient(135deg, #f4f7f5 0 14px, #eef2ef 14px 28px);
  border: 2px dashed #cfd8d2;
  color: var(--muted);
}
.tile--soon .tile__badge { background: #fff; color: var(--muted); border: 1px solid var(--line); }
.tile--soon .tile__icon { background: var(--c2); }

.note { color: var(--muted); }

.foot {
  padding-top: 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

/* Телефон: две плитки в ряд, как в мобильном приложении */
@media (max-width: 560px) {
  .top__row { height: 56px; }
  .brand__tagline { display: none; }
  .intro { padding: 24px 0 16px; }
  .tiles {
    margin: 0;
    padding: 0 0 48px;
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
  }
  .tile { padding: 14px; border-radius: 18px; aspect-ratio: 3 / 4.2; }
  .tile::after { right: -30%; bottom: -24%; opacity: 0.09; }
  .tile__badge { top: 10px; right: 10px; font-size: 0.68rem; padding: 3px 8px; }
  .tile__icon { width: 46px; height: 46px; padding: 7px; border-radius: 13px; }
  .tile__title { font-size: 1.08rem; }
  .tile__desc { font-size: 0.75rem; }
  .tile__open { margin-top: 6px; padding: 6px 12px; font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .tile { transition: none; }
  a.tile:hover, a.tile:active { transform: none; }
}
