/* ============================================================
   1. RESET & BASE
   ============================================================ */
* {
  box-sizing: border-box;
}

html,
body,
html.with-fancybox {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
  --fancybox-scrollbar-compensate: 0 !important;
}

body {
  font-size: 24px;
  font-family: ProximaNova, 'Proxima Nova', sans-serif;
  max-width: 100vw;
}

p {
  margin: 0 auto 1em;
  line-height: 1.3em;
}

img {
  display: block;
  max-width: 100%;
}

a,
button,
input,
label,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

a:focus,
button:focus {
  outline: none;
  -webkit-tap-highlight-color: transparent;
}


/* ============================================================
   2. DESIGN TOKENS
   ============================================================ */
:root {
  /* Цвета */
  --m-red: #53091c;
  --m-light-yellow: #f1e7d7;
  --m-yellow: #d2b877;
  --m-dark-red: #53091c;
  --m-orange: #8a4329;
  --m-bright-orange: #9e4123;
  --m-white: #fff;
  --m-black: #000;
  --m-grey-bg: #ddd;

  /* Производные / служебные */
  --m-red-rgb: 83, 9, 28;
  --m-orange-border: #d77d2c;
  --m-frame-bg: #dbaa59;
  --m-shadow-soft: #0000003f;
  --m-shadow-img: #00000026;
  --m-shadow-img-light: #00000019;
  --m-menu-bg: rgba(63, 9, 28, .8);
  --m-link-underline: #ffffff7f;

  /* Размеры / отступы */
  --chess-line-width: 4px;
  --block-spacing: 10px;
  --mobile-padding: 30px;
  --image-aspect-ratio: 16 / 9;
  --transition-duration: 0.3s;

  /* Ширины */
  --container-width: 1180px;
  --text-max-width: 900px;
  --intro-width: 770px;
  --h-graphics-width: 380px;
  --h-graphics-size: 300px;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1.project-title {
  position: relative;
  z-index: 3; /* над кругом (1) и зданием (2), под line.l1 (4) */
  margin: 0;
  padding: 0;
  font-size: 102px;
  line-height: 1.2em;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--m-light-yellow);
}


/* ============================================================
   4. LAYOUT
   ============================================================ */
section {
  position: relative;
  width: 100%;
  padding: 72px 0;
  min-height: 50vh;
  scroll-behavior: smooth;
  margin: 0 auto;
  overflow-x: hidden;
}

section#home {
  padding: 72px 0;
  min-height: 100vh;
  background-color: var(--m-red);
}

section#about {
  background-color: #8a4329;
  color: var(--m-light-yellow);
  padding: 72px 0 24px;
}

section#history {
  background-color: var(--m-yellow);
}

section h2 {
  margin: 0 auto .5em;
  font-size: 80px;
  font-weight: 800;
  line-height: 1.1em;
  text-transform: uppercase;
}

section#history h2 {
  color: var(--m-white);
}

section#rebirth {
  padding-bottom:20px;
}
section#rebirth,
.subsection {
  background-color: var(--m-bright-orange);
}

.section#stadium {
  background-color:#ab5a34
}

section#rebirth h2 {
  text-align: center;
  color: var(--m-red);
}

section#rebirth .textblock,
.subsection .textblock {
  color: var(--m-white);
}

.subsection .textblock {
  text-align: center;
  font-size: 20px;
  position: relative;
  margin: 0 auto;
  width: 900px;
  max-width: calc(100% - 32px);
}

.section.subsection {
  padding: 48px 0;
}

.subsection h2,
.subsection h3 {
  text-transform: uppercase;
  font-size: 32px;
  font-weight: 900;
  margin: 0 auto .5em;
  color: var(--m-yellow);
  letter-spacing: 0.05em;
}

.intro {
  text-align: center;
  width: var(--intro-width);
  position: relative;
  margin: 0 auto 64px;
  max-width: calc(100% - 32px);
}

.container {
  position: relative;
  width: var(--container-width);
  margin: 0 auto;
  max-width: calc(100%) !important;
  padding: 0;
}

.graphics-wrapper.graphics-top {
  position: relative;
  min-height: calc(100vh - 144px);
}


/* ============================================================
   5. DECORATIVE BASE — все <i> как графические блоки
   ============================================================ */
i {
  display: block;
  position: absolute;
}

i::before,
i::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.horsman-wrapper {
  position: relative;
  width: 100%;
  height: 90px; /* меняйте под нужды — JS подстроится */
  overflow: hidden;
}

.horseman-riding {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-position: 0 center;
  background-size: auto 100%;
  will-change: background-position;
  pointer-events: none;
}

/* ============================================================
   6. HOME SCREEN GRAPHICS

   Иерархия z-index в общем контексте .graphics-wrapper:
     0  i.house .line.l2          (внутри дома, за домом)
     1  i.house-bg-circle          (внутри дома, за домом, за h1)
     2  i.house::before (здание)   (над кругом, под h1)
     3  h1.project-title
     4  i.house .line.l1           (внутри дома, над домом)
     5  i.horse-logo-r
     6  i.horseman                 (перед h1)
     7  .top-slogan

   ВАЖНО: i.house НЕ создаёт стекинг-контекст —
   без z-index, без transform, без filter, без opacity.
   Иначе всё содержимое дома изолируется и не сможет
   "проваливаться" за h1 по отдельности.
   ============================================================ */

/* --- 6.1. Контейнер дома: БЕЗ z-index и transform --- */
i.house {
  width: 774px;
  height: 495px;
  right: -48px;
  /* было: top: 50%; transform: translateY(-50%); margin-top: 40px;
     теперь: top = 50% - 495/2 + 40 */
  top: calc(50% - 207.5px);
}

/* Здание — над кругом и line.l2, под h1 */
i.house::before {
  background-image: url(../img/i-building.png);
  z-index: 2;
}

/* --- 6.2. Круг — за зданием и за h1 --- */
i.house .house-bg-circle {
  position: absolute;
  width: 700px;
  height: 700px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 64px solid var(--m-orange);
  border-radius: 50%;
  z-index: 1;
}

i.house .house-bg-circle::before {
  content: '';
  width: 80%;
  height: 80%;
  top: 50%;
  left: 50%;
  background-color: var(--m-orange);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

/* --- 6.3. Дальняя линия — за зданием, внутри дома --- */
i.house .line.l2 {
  position: absolute;
  bottom: 32px;
  right: 0;
  width: 1000px;
  height: 16px;
  background-color: var(--m-orange);
  z-index: 0;
}

/* --- 6.4. Передняя линия — внутри дома, по нижнему краю, над домом --- */
i.house .line.l1 {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1240px;
  max-width: 100vw;
  height: 16px;
  background-color: var(--m-orange);
  z-index: 4; /* над зданием (2) и над h1 (3) */
}

/* --- 6.5. Лого-лошадь в углу --- */
.horse-logo-r {
  position: absolute;
  width: 156px;
  height: 156px;
  right: 0;
  top: 20px;
  z-index: 5;
}

.horse-logo-r::before {
  background-image: url(../img/logo-horse-u.png);
}

/* --- 6.6. Всадник — перед h1, наезжает на заголовок --- */
i.horseman {
  position: absolute;
  width: 494px;
  height: 467px;
  left: -64px;
  top: 200px;
  z-index: 6;
}

i.horseman::before {
  background-image: url(../img/i-horseman.png);
  filter: drop-shadow(6px 6px 6px rgba(0, 0, 0, 0.5));
}

#rebirth .graphics {
  height: 706px;
  position: relative;
  overflow: visible;
  margin: 0 auto;
}

i.i-rebirth {
  width: 841px;
  height: 706px;
  max-height: 100%;
  top: 50%;
  left: -80px;
  transform: translate(0, -50%);
}

i.i-rebirth:before {
  background-image: url(../img/rebirth.png);
}

i.i-troyka {
  right: -80px;
  top: 50%;
  transform: translate(0, -50%);
  width: 550px;
  height: 426px;
  z-index: 5;
  margin-top: 72px;
}

i.i-troyka:before {
  background-image: url(../img/i-troyka-2.png);
}

#rebirth .lines {
  position: absolute;
  width: 100vw;
  bottom: 64px;
  left: 50%;
  transform: translate(-50%, 0);
}

#rebirth .line {
  background-color: var(--m-yellow);
  height: 16px;
  position: absolute;
  width: 100vw;
  bottom: 0;
  z-index: 2;
  left: 50%;
  transform: translate(-50%, 0);
}

#rebirth .line.r2 {
  width: calc(100vw - 110px);
  bottom: 32px;
  left: 1360px;
  transform: translate(0, 0);
}

#rebirth .line.r3 {
  bottom: -32px;
  left: 0;
}

#rebirth .line.r4 {
  bottom: -32px;
  left: 1200px;
  transform: translate(0, 0);
}

#rebirth .line.r5 {
  bottom: -64px;
  left: auto;
  transform: translate(0, 0);
  right: 80%;
}

/* ============================================================
   7. TOP SLOGAN
   ============================================================ */
.top-slogan {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0;
  text-align: center;
  font-size: 90px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px var(--m-light-yellow);
  paint-order: stroke fill;
  z-index: 7;
}


/* ============================================================
   8. NAVIGATION
   ============================================================ */
nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 72px;
  background-color: var(--m-red);
  display: block;
  z-index: 99;
  transition: all 0.5s ease-in-out;
  transform: translate(0, -100%);
}

nav.scroll-down {
  transform: translate(0, -100%);
}

nav.scroll-up.scrolled-top,
nav.scrolled-top {
  transform: translate(0, -100%);
}

nav.scroll-up {
  background-color: rgb(var(--m-red-rgb));
  transform: translate(0, 0);
  transition: all 0.25s ease-in-out 0.1s;
  box-shadow: 0 6px 18px var(--m-shadow-soft);
}

nav .menu {
  position: absolute;
  right: 0;
  top: 50%;
  padding: 0 64px 0 0;
  transform: translate(0, -50%);
  z-index: 50;
  display: block;
  width: 100%;
  text-align: right;
  margin: 0;
  line-height: 1em;
}

nav .menu li {
  display: inline-block;
  margin: 0 0 0 .5em;
  position: relative;
}

nav .menu li a {
  color: var(--m-white);
  text-transform: uppercase;
  font-size: 14px;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease-in-out;
  position: relative;
  display: inline-block;
  opacity: 0.75;
}

nav .menu a.m24-logo {
  display: inline-block;
  width: 130px;
  height: 20px;
  opacity: 1;
  margin: 0 0 -5px 0;
  transition: all 0.25s ease-in-out;
}

nav .menu a.m24-logo:hover {
  transform: scale(1.1);
  opacity: 1;
}

nav .menu li a::after {
  content: '';
  display: block;
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -4px;
  left: 50%;
  opacity: 0;
  background-color: var(--m-link-underline);
  transform: translate(-50%, -50%);
  transition: all 0.25s ease-in-out;
}

nav .menu li.active a {
  color:var(--m-yellow);
}

nav .menu li a:hover,
nav .menu li.active a {
  opacity: 1;
}

nav .menu li a:hover::after,
nav .menu li.active a::after {
  width: 100%;
  bottom: -2px;
  opacity: 1;
}

nav .menu a.m24-logo:hover::after {
  display: none;
}

nav .menu li a:hover {
  color: var(--m-white);
}

input#mobileMenu {
  position: absolute;
  left: -10000px;
  display: block;
}

.ya-share2 {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translate(0, -50%);
  background-color: var(--m-white);
  border-radius: 50%;
  transition: all 0.25s ease-in-out;
  z-index: 500;
}

.ya-share2:hover {
  background-color: var(--m-white);
}

#topNav .mi-share-widget {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translate(0, -50%);
  display: block;
  z-index: 99;
}

#topNav .container {
  height: 100%;
  position: relative;
  margin: 0 auto;
}

#M90logo {
  width: 80px;
  height: 64px;
  z-index: 999;
  display: block;
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translate(0, -50%);
}

#M90logo a {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  text-indent: -10000px;
  overflow: hidden;
  width: 100%;
  height: 100%;
  background-image: url(../img/horse-logo-simple.svg);
  background-position: center;
  background-repeat: no-repeat;
  z-index: 999;
}

label#expandMenu {
  position: absolute;
}


/* ============================================================
   9. WIDGET / CONTENT
   ============================================================ */
.excl,
.slogan,
.second-word,
.description {
  transition: all 0.5s ease-in-out;
}

.main-desc {
  text-align: left;
  position: relative;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: calc(var(--container-width) / 2);
  padding: 64px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  float: right;
}

.logo svg {
  display: block;
  position: relative;
  max-width: calc(100% - 16px);
  width: 470px;
}

#M90Logo path {
  transition: all 0.5s ease-in-out;
}

.even #M90Logo path {
  fill: var(--m-white);
}


/* ============================================================
   10. PHOTO LINE
   ============================================================ */
.photoLine {
  position: relative;
  width: 100%;
  margin: 40px 0;
  will-change: transform;
  contain: strict;
  height: var(--line-height);
  overflow: visible;
}

.photoLine.grey-bg {
  box-shadow: 0 -180px 0 var(--m-grey-bg) inset;
  margin-bottom: 0;
}

.photoLine-inner {
  display: block;
  white-space: nowrap;
  position: relative;
  will-change: transform;
  font-size: 0;
  overflow: visible;
}

.lineImg {
  display: inline-block;
  position: relative;
  margin-right: var(--img-margin);
  vertical-align: top;
  font-size: initial;
  overflow: hidden;
  z-index: 55;
  border-radius: 3px;
  transition: all 0.25s ease-in-out;
}

.lineImg a {
  display: block;
  position: relative;
}

.lineImg a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  box-shadow: 0 3px 16px var(--m-shadow-img) inset;
}

.lineImg img {
  display: block;
  width: calc(var(--line-height) * 4 / 3);
  height: var(--line-height);
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 6px var(--m-shadow-img-light);
  backface-visibility: hidden;
  transition: all 0.25s ease-in-out;
}

.lineImg:hover img {
  filter: saturate(1.2) brightness(1.2) contrast(1.2);
  box-shadow: 0 4px 12px var(--m-shadow-img);
  z-index: 1;
}


/* ============================================================
   11. CHESS BLOCKS
   ============================================================ */
.chess-block h3 {
  color: var(--m-red);
  margin: 0.5em 0;
}

.b-material-incut .desc {
  display: none;
}

.chess-block.live a:hover img {
  filter: saturate(1.25) contrast(1.25) brightness(1.25) invert(0);
  transition: all 0.25s ease-in-out;
  transform: scale(1.1);
}


/* ============================================================
   12. MEDIA QUERIES
   ============================================================ */
@media (max-width: 1080px) {
  .widget-content {
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
  }

  .main-desc {
    display: block;
    position: relative;
    width: 100%;
    max-width: calc(100% - 32px);
    margin: 0 auto;
    text-align: center;
    float: none;
  }

  .widget-content > div {
    flex: 0 1 100% !important;
    width: 100%;
  }

  .left-part svg {
    margin: 0 auto;
    width: 240px;
    max-width: 100%;
  }

  .t-img {
    padding: 85% 0 0;
  }

  ul.menu {
    display: block;
    position: absolute;
    right: auto;
    left: 0;
    width: 80vw;
    height: calc(100vh - 72px);
    top: 72px;
    transform: translate(-100%, 0);
    text-align: left;
    padding: 2rem;
    background-color: var(--m-menu-bg);
    transition: all 0.75s cubic-bezier(0.86, 0, 0.07, 1);
    backdrop-filter: blur(16px);
  }

  ul.menu li {
    display: block;
    font-size: 1rem;
    margin: 0 auto 1.5em;
  }

  ul.menu li a {
    font-size: 1rem;
  }

  label#expandMenu {
    opacity: 1;
    visibility: visible;
    left: 16px;
    top: 50%;
    display: block;
    position: absolute;
    width: 32px;
    height: 32px;
    margin: -16px 0 0;
    cursor: pointer;
    z-index: 999;
  }

  label#expandMenu i {
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--m-white);
    top: 50%;
    position: absolute;
    margin: -2px 0 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  }

  label#expandMenu i::after,
  label#expandMenu i::before {
    content: '';
    position: absolute;
    display: block;
    width: 100%;
    height: 4px;
    background-color: var(--m-white);
    left: 50%;
    margin: 0 0 0 -16px;
    transition: top 0.2s ease-in-out, transform 0.2s ease-in-out 0.2s;
  }

  label#expandMenu i::before {
    top: -8px;
  }

  label#expandMenu i::after {
    top: 8px;
  }

  #mobileMenu:checked + label#expandMenu i::after,
  #mobileMenu:checked + label#expandMenu i::before {
    top: 0;
  }

  #mobileMenu:checked + label#expandMenu i::before {
    transform: rotate(45deg);
  }

  #mobileMenu:checked + label#expandMenu i::after {
    transform: rotate(-45deg);
  }

  #mobileMenu:checked + label#expandMenu i {
    background-color: rgba(0, 0, 0, 0);
    transform: rotate(180deg);
  }

  .m24logo {
    left: 50%;
    transform: translate(-50%, -50%);
  }

  nav #mobileMenu:not(:checked) ~ ul.menu {
    visibility: hidden;
    opacity: 0;
  }

  nav #mobileMenu:checked ~ ul.menu {
    visibility: visible;
    opacity: 1;
    display: block;
    transform: translate(0, 0);
    transition: all 0.25s ease-in-out 0.25s;
  }

  footer {
    padding: 48px 0;
  }

  #M90logo {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 768px) {
  .photoLine.grey-bg {
    box-shadow: 0 -90px 0 var(--m-grey-bg) inset;
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  nav .menu li a {
    font-size: 14px;
  }

  .m24logo {
    width: 100px;
  }
}

/* ============================================================
   H-BLOCKS — блоки с графикой и текстом
   ============================================================ */

/* Общий контейнер */
.h-wrapper {
  display: flex;
  flex-direction: column;
  gap: 48px; /* отступ между блоками */
  position: relative;
  max-width: var(--text-max-width);
  margin: 0 auto;
}

/* Базовый блок: две колонки, вертикальное выравнивание */
.h-block {
  display: flex;
  align-items: center; /* вертикальное выравнивание колонок */
  gap: 48px;           /* отступ между графикой и текстом */
}

.h-block .h-text {
  font-size: 18px;
}

.h-block h3 {
  text-transform: uppercase;
  font-weight: 900;
  color: var(--m-orange);
  font-size: 32px;
  letter-spacing: .05em;
  margin: 0 auto .25em;
}

/* Графика: фиксированная ширина, одинаковая во всех блоках */
.h-graphics {
  flex: 0 0 var(--h-graphics-width);
  width: var(--h-graphics-width);
}

/* Квадратный контейнер под графику.
   padding-top: 100% делает его квадратным относительно ширины.
   Внутри — только абсолютно позиционированные слои. */
.h-graphics-item {
  display: block;
  position: relative;
  width: 100%;
  padding: 100% 0 0; /* квадрат */
  margin: 0 auto;
  overflow: visible; /* рамки/декор могут выходить за пределы квадрата */
  border: 1px solid var(--m-orange-border);
  border-radius: 50%;
}

.h-graphics-item:before,
.h-graphics-item:after {
  content: '';
  display: block;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 30px);
  height: calc(100% - 30px);
  position: absolute;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.h-graphics-item:after {
  background-image: url(../img/i-bg-frame.svg);
  z-index: 2;
  opacity: .35;
}

.h-graphics-item:before {
  background-color: var(--m-frame-bg);
  z-index: 1;
  border-radius: 50%;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
}

/* Все прямые дети квадрата — абсолютные слои на всю площадь */
.h-graphics-item img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% - 100px);
  height: calc(100% - 100px);
  transform: translate(-50%, -50%);
  z-index: 5;
}

/* Текст: занимает всё оставшееся пространство */
.h-text {
  flex: 1 1 auto;
  min-width: 0; /* предотвращает переполнение во flex-контейнере */
}

.h-text-item {
  /* оформление текстового содержимого — по вкусу */
}

/* Чётные блоки: текст слева, графика справа */
.h-block:nth-child(even) {
  flex-direction: row-reverse;
}


/* ============================================================
   MOBILE — одна колонка, графика сверху
   ============================================================ */
@media (max-width: 768px) {
  .h-block,
  .h-block:nth-child(even) {
    flex-direction: column;
    align-items: stretch;
  }

  .h-graphics {
    flex: 0 0 auto;
    width: 100%;
  }

  .h-graphics-item {
    padding: 0;
    width: var(--h-graphics-size);
    height: var(--h-graphics-size);
  }

  .h-text {
    width: 100%;
  }
}
.s-content {
  position: relative;
  z-index: 10
}
.section-bg-graphics {
  position: absolute;
  z-index: 0;
  width: 100%;
  height:100%;
  top:0;
  left:0;
}
i.konik {
  position: absolute;
  top:120px;
  width: 214px;
  height: 214px;
}
i.konik:before {
  background-image:url(../img/konik-circle.svg);
}

#yard i.konik:before {
  background-image:url(../img/vodila-circle.svg);
}

i.konik.circ-l {
  left:10px
}
i.konik.circ-r {right:10px;
transform:scaleX(-1)
}
i.obod {
  width: 400px;
  height: 400px;
  left:-200px;
  bottom:0px;
  z-index: 1;
}
#stadium i.obod {
  left:auto;
  right:-160px
}
.subsection {overflow: visible}
i.obod:before {
  background-image: url(../img/i-bg-frame.svg);
}
.b-material__item_underline {
  white-space:nowrap
}