
@font-face {
  font-family: 'HFont';
  src: url('../main_page/fonts/h_fonts.ttf') format('truetype');
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PFont';
  src: url('../main_page/fonts/p_fonts.ttf') format('truetype');
  font-weight: normal; font-style: normal; font-display: swap;
}

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

:root {
  --ui-font-size: clamp(14px, 1.25vw, 24px);
  --blue: #186BB8;
  --blue-dark: #0f4d8a;
  --card-bg: #959490;
  --text-muted: #cbc9c4;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

html, body {
  width: 100%;
  overflow-x: hidden;
  font-family: 'HFont', sans-serif;
  background-color: #B4B1AC;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.works-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: #B4B1AC;
}

.bricks {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  opacity: 1;
}

.bricks--1 { left: 2vw;   top: 4vw;    width: 24vw; }
.bricks--2 { right: 2vw;  top: 3vw;    width: 24vw; }
.bricks--3 { left: 40vw;  top: 34vw;   width: 22vw; }
.bricks--4 { left: 3vw;   top: 58vw;   width: 24vw; }
.bricks--5 { right: 3vw;  top: 60vw;   width: 24vw; }
.bricks--6 { left: 40vw;  top: 88vw;   width: 22vw; }
.bricks--7 { right: 2vw;  top: 110vw;  width: 24vw; }

.works-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3.4vw 2vw 0;
}

.works-title {
  font-family: 'HFont', sans-serif;
  font-size: 7.8vw;
  line-height: 0.87;
  letter-spacing: 2px;
  color: #ffffff;
  text-transform: uppercase;
}

.works-logo {
  display: flex;
  align-items: center;
}

.works-logo img {
  width: 17.86vw;
  max-width: 343px;
  height: auto;
  object-fit: contain;
}

.works-nav {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-top: 0.6vw;
}
.works-nav__list {
  display: inline-flex;
  align-items: center;
  background-color: rgba(138, 138, 138, 0.92);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.works-nav__link {
  display: block;
  padding: 12px 32px;
  white-space: nowrap;
  font-family: 'HFont', sans-serif;
  font-size: var(--ui-font-size);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  border-radius: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.works-nav__link:hover { background-color: var(--blue); }
.works-nav__link--active { background-color: var(--blue); }

/* Активный пункт со стрелкой «назад» — как на странице работ города:
   стрелка и подпись лежат в одной синей плашке. */
.works-nav__current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--blue);
  padding-left: 12px;
}
.works-nav__current .works-nav__link--active { background: none; }
.works-nav__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.works-nav__arrow:hover { transform: translateX(-3px); }
.works-nav__arrow svg { display: block; width: 22px; height: auto; }

.city-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 31.25vw);
  column-gap: 1.04vw;
  row-gap: 1.3vw;
  justify-content: center;
  margin: 5.36vw auto 0;
  padding-bottom: 5vw;
}

.city-card {
  position: relative;
  height: 21.61vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.35vw 1vw 1vw;
  background: var(--card-bg);
  border: 5px solid transparent;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.3s var(--ease-out),
              transform 0.3s var(--ease-out),
              box-shadow 0.3s var(--ease-out);
}

.city-card:hover,
.city-card:focus-visible {
  border-color: var(--blue);
  transform: translateY(-6px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
  outline: none;
}

.city-card__name {
  font-family: 'HFont', sans-serif;
  font-size: 5.21vw;
  line-height: 0.84;
  color: #ffffff;
  text-transform: uppercase;
  text-align: center;
}

.city-card__map {
  position: relative;
  flex: 1;
  width: 100%;
  margin-top: 0.6vw;
}
.city-card__map img {
  position: absolute;

  top: 50%;
  left: 50%;
  width: calc(100% * var(--map-scale, 1.2) * 1.2);
  height: calc(100% * var(--map-scale, 1.2) * 1.2);
  object-fit: contain;
  transform: translate(-50%, -50%);
  transform-origin: center;
}

.city-card__outline {
  opacity: 1;
  transition: opacity 0.4s ease;
}
.city-card:hover .city-card__outline,
.city-card:focus-visible .city-card__outline {
  opacity: 0;
  transition: opacity 0.45s ease 0.5s;
}

.city-card__fill {
  opacity: 1;
  clip-path: polygon(
    0% 100%, 12.5% 100%, 25% 100%, 37.5% 100%, 50% 100%,
    62.5% 100%, 75% 100%, 87.5% 100%, 100% 100%,
    100% 100%, 0% 100%);
  -webkit-clip-path: polygon(
    0% 100%, 12.5% 100%, 25% 100%, 37.5% 100%, 50% 100%,
    62.5% 100%, 75% 100%, 87.5% 100%, 100% 100%,
    100% 100%, 0% 100%);
  transition: clip-path 0.95s var(--ease-out),
              -webkit-clip-path 0.95s var(--ease-out);
  will-change: clip-path;
}
.city-card:hover .city-card__fill,
.city-card:focus-visible .city-card__fill {
  clip-path: polygon(
    0% 2%, 12.5% 0%, 25% 3%, 37.5% 1%, 50% 4%,
    62.5% 1%, 75% 3%, 87.5% 0%, 100% 2%,
    100% 100%, 0% 100%);
  -webkit-clip-path: polygon(
    0% 2%, 12.5% 0%, 25% 3%, 37.5% 1%, 50% 4%,
    62.5% 1%, 75% 3%, 87.5% 0%, 100% 2%,
    100% 100%, 0% 100%);
}

.city-card:hover .city-card__fill,
.city-card:focus-visible .city-card__fill {
  animation: liquid-ripple 2.6s ease-in-out 0.95s infinite;
}

@keyframes liquid-ripple {
  0%, 100% {
    clip-path: polygon(
      0% 2%, 12.5% 0%, 25% 3%, 37.5% 1%, 50% 4%,
      62.5% 1%, 75% 3%, 87.5% 0%, 100% 2%,
      100% 100%, 0% 100%);
  }
  50% {
    clip-path: polygon(
      0% 0%, 12.5% 3%, 25% 1%, 37.5% 4%, 50% 1%,
      62.5% 3%, 75% 0%, 87.5% 3%, 100% 1%,
      100% 100%, 0% 100%);
  }
}

.footer {
    position: relative;
    z-index: 2;
    width: 100%;
    background: var(--blue);
    display: flex;
    padding: 2.6vw 0 2.6vw 2.08vw;
    gap: 2.08vw;
    height: 29.22vw;
}

.footer__heading {
  font-family: 'HFont', sans-serif;
  font-size: 1.82vw;
  line-height: 1;
  letter-spacing: 2px;
  color: #ededed;
  text-transform: uppercase;
}
.footer__line {
  margin-top: 1.5vw;
  max-width: 22.8vw;
  font-family: 'PFont', sans-serif;
  font-weight: 500;
  font-size: 1.3vw;
  line-height: 1.2;
  color: #ffffff;
}
.footer__line:not(.footer__line--address) { margin-top: 1.2vw; max-width: none; }
.footer__line-label { text-transform: uppercase; }
.footer__phone { transition: opacity 0.2s ease; }
.footer__phone:hover { opacity: 0.8; }

.footer__socials { display: flex; align-items: center; gap: 12px; margin-top: 1.25vw; }
.footer__social img {
  display: block;
  width: 2.4vw; max-width: 46px; height: auto;
  object-fit: contain;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.footer__social:hover img { transform: scale(1.1); opacity: 0.85; }

.footer__list { margin-top: 1.5vw; display: flex; flex-direction: column; gap: 1.41vw; }
.footer__link {
  font-family: 'PFont', sans-serif;
  font-weight: 500;
  font-size: 1.3vw;
  color: #ffffff;
  display: inline-block;
  transition: opacity 0.2s ease, translate 0.2s var(--ease-out);
}
.footer__link:hover { opacity: 0.8; translate: 4px 0; }

.footer__legal {
  position: absolute;
  left: 2.08vw;
  bottom: 1.72vw;
  width: 81.56vw;
  font-family: 'PFont', sans-serif;
  font-weight: 500;
  font-size: 1.3vw;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .city-card,
  .city-card__outline,
  .city-card__fill { transition: none; }

  .city-card:hover .city-card__fill,
  .city-card:focus-visible .city-card__fill {
    animation: none;
    clip-path: inset(0 0 0 0);
    -webkit-clip-path: inset(0 0 0 0);
  }
}

@media (max-width: 1024px) {
  .works-title { font-size: 60px; }
  .works-logo img { width: 240px; }
  .works-nav__link { padding: 10px 16px; }
}

@media (max-width: 768px) {
  .works-header { flex-direction: column; gap: 14px; padding: 24px 16px 0; }
  .works-title { font-size: 40px; }
  .works-nav { overflow-x: auto; }
  .works-nav__list { flex-wrap: nowrap; }
  .works-nav__link { padding: 8px 12px; white-space: nowrap; }

  .bricks { display: none; }

  .city-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 22px 16px 0;
    padding-bottom: 32px;
  }
  .city-card {
    height: auto;
    padding: 16px;
    border-width: 3px;
  }
  .city-card__name { font-size: 30px; }
  .city-card__map { height: 56vw; margin-top: 10px; }

  .footer {
    flex-direction: column;
    gap: 28px;
    padding: 28px 16px 32px;
  }
  .footer__heading { font-size: 22px; }
  .footer__line, .footer__link { font-size: 14px; }
  .footer__line { max-width: none; }
  .footer__social img { width: 30px; }
}
