:root {
  --bg: #eeeeee;
  --surface: #ffffff;
  --surface-soft: #f6f6f6;
  --ink: #0a0a0a;
  --muted: #555555;
  --muted-2: #888888;
  --line: #d9d9d9;
  --dark: #202020;
  --dark-2: #151515;
  --accent: #2148ff;
  --accent-soft: rgba(33, 72, 255, 0.12);
  --radius: 28px;
  --radius-sm: 16px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.12);
  --container: 1180px;
  --header-height: 82px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 30px);
}

body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  min-width: 320px;
}

body.modal-open,
body.menu-open {
  overflow: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

::selection {
  color: #ffffff;
  background: var(--accent);
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(31, 31, 31, 0.96);
  color: #ffffff;
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  font-weight: 800;
  font-size: clamp(24px, 2vw, 34px);
  letter-spacing: -0.05em;
  transition: transform .25s ease, opacity .25s ease;
}

.logo:hover {
  transform: translateY(-1px);
  opacity: .86;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-list a {
  position: relative;
  color: rgba(255, 255, 255, .86);
  font-size: 19px;
  transition: color .22s ease;
}

.nav-list a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -10px;
  height: 2px;
  background: #ffffff;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .22s ease;
}

.nav-list a:hover,
.nav-list a.is-active {
  color: #ffffff;
}

.nav-list a:hover::after,
.nav-list a.is-active::after {
  transform: scaleX(1);
}

.burger {
  display: none;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  background: transparent;
  color: #fff;
  padding: 11px;
  cursor: pointer;
}

.burger span {
  display: block;
  height: 2px;
  margin: 6px 0;
  background: currentColor;
  border-radius: 10px;
  transition: transform .25s ease, opacity .25s ease;
}

.menu-open .burger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-open .burger span:nth-child(2) {
  opacity: 0;
}

.menu-open .burger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

main {
  padding-top: var(--header-height);
}

.section {
  padding: clamp(70px, 9vw, 128px) 0;
}

.section--white {
  background: #ffffff;
}

.section--soft {
  background: var(--surface-soft);
}

.section-title {
  max-width: 980px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-title h1,
.section-title h2 {
  margin: 0;
  font-size: clamp(44px, 6vw, 82px);
  line-height: .96;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.section-title p {
  max-width: 820px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 26px);
}

.hero {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: #171717 url('../img/hero/hero-main.svg') center/cover no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.42), rgba(0,0,0,.18) 50%, rgba(0,0,0,.34));
}

.hero .container {
  position: relative;
}

.hero-content {
  width: min(720px, 100%);
  padding: 60px 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: rgba(255,255,255,.75);
  font-size: 15px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 36px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  line-height: .98;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.hero p {
  max-width: 640px;
  margin: 28px 0 0;
  color: rgba(255,255,255,.82);
  font-size: clamp(19px, 2vw, 26px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 42px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, background-color .22s ease, color .22s ease, border-color .22s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0,0,0,.16);
}

.btn:active {
  transform: translateY(-1px);
}

.btn--dark {
  color: #ffffff;
  background: var(--dark-2);
}

.btn--dark:hover {
  background: #000000;
}

.btn--light {
  color: #171717;
  background: #ffffff;
}

.btn--ghost {
  color: #fff;
  border-color: rgba(255,255,255,.4);
  background: rgba(255,255,255,.08);
}

.btn--wide {
  width: 100%;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}

.about-copy h2 {
  margin: 0;
  font-size: clamp(44px, 6vw, 76px);
  line-height: .98;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.about-copy p {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 25px);
}

.about-panel {
  padding: clamp(26px, 4vw, 42px);
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.stats {
  display: grid;
  gap: 22px;
}

.stat {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.stat:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.stat strong {
  display: block;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.stat span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
}

.directions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
}

.direction-card {
  padding: 30px 24px 26px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid #e2e2e2;
  box-shadow: 0 15px 38px rgba(0,0,0,.06);
  text-align: center;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.direction-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: rgba(0,0,0,.12);
}

.direction-card__media {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 0 auto 22px;
  color: var(--accent, #111);
  background: #f7f7f7;
  background: color-mix(in srgb, var(--accent) 10%, #ffffff);
  border-radius: 34px;
  transition: transform .25s ease;
}

.direction-card:hover .direction-card__media {
  transform: scale(1.04) rotate(-2deg);
}

.direction-card svg {
  width: 86px;
  height: 86px;
}

.direction-card h3 {
  margin: 0;
  color: #07072c;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.direction-card p {
  min-height: 96px;
  margin: 14px 0 0;
  color: var(--muted);
}

.direction-card ul {
  min-height: 88px;
  padding: 0;
  margin: 18px 0 24px;
  list-style: none;
  color: #171717;
}

.direction-card li + li {
  margin-top: 5px;
}

.project-grid,
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.project-card,
.portfolio-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(0,0,0,.07);
  transition: transform .25s ease, box-shadow .25s ease;
}

.project-card:hover,
.portfolio-card:hover {
  transform: translateY(-7px);
  box-shadow: var(--shadow);
}

.project-card__image {
  position: relative;
  aspect-ratio: 1.35 / 1;
  overflow: hidden;
  display: block;
}

.project-card__image img,
.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease, filter .45s ease;
}

.project-card:hover img,
.portfolio-card:hover img {
  transform: scale(1.06);
  filter: saturate(1.08);
}

.project-card__image span {
  position: absolute;
  left: 18px;
  top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  font-size: 14px;
}

.project-card__content {
  padding: 22px;
}

.project-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.project-card p {
  margin: 10px 0 18px;
  color: var(--muted);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.project-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  background: #f0f0f0;
  color: #444;
  font-size: 14px;
}

.cta {
  color: #ffffff;
  background: #151515;
  overflow: hidden;
}

.cta-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}

.cta h2 {
  margin: 0;
  font-size: clamp(40px, 5vw, 70px);
  line-height: 1;
  letter-spacing: -0.06em;
}

.cta p {
  margin: 18px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 20px;
}

.footer {
  padding: 44px 0;
  color: #ffffff;
  background: #202020;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}

.footer strong {
  display: block;
  font-size: 26px;
  letter-spacing: -0.05em;
}

.footer p {
  margin: 8px 0 0;
  color: rgba(255,255,255,.68);
}

.footer a {
  color: #ffffff;
  border-bottom: 1px solid rgba(255,255,255,.4);
}

.service-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 20% 25%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 32%),
    linear-gradient(135deg, #111111 0%, #252525 55%, #101010 100%);
  overflow: hidden;
}

.service-hero::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 680px;
  height: 680px;
  border-radius: 50%;
  border: 100px solid rgba(255,255,255,.06);
}

.service-hero__content {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  padding: clamp(64px, 8vw, 110px) 0;
}

.service-hero h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 80px);
  line-height: .96;
  letter-spacing: -0.06em;
  font-weight: 900;
}

.service-hero p {
  width: min(760px, 100%);
  margin: 28px 0 0;
  color: rgba(255,255,255,.78);
  font-size: clamp(19px, 2vw, 26px);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.chips span {
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}

.services-list {
  max-width: 900px;
  margin: 0 auto;
}

.service-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
}

.service-row strong {
  color: #1d1d1d;
  white-space: nowrap;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  align-items: stretch;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 32px;
  border: 1px solid #e3e3e3;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 15px 40px rgba(0,0,0,.06);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.price-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 44%, #e3e3e3);
}

.price-card--featured {
  border-color: color-mix(in srgb, var(--accent) 60%, #ffffff);
  box-shadow: 0 22px 70px color-mix(in srgb, var(--accent) 14%, transparent);
}

.price-card__badge {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 8px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.price-card h3 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.04em;
}

.price-card__price {
  margin-top: 14px;
  font-size: clamp(32px, 4vw, 42px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.price-card p {
  min-height: 54px;
  margin: 14px 0 22px;
  color: var(--muted);
}

.feature-list {
  padding: 24px 0 22px;
  margin: 0 0 auto;
  list-style: none;
  border-top: 1px solid var(--line);
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 14px;
}

.feature-list li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  color: #111;
  font-weight: 700;
}

.feature-list .is-muted {
  color: #9a9a9a;
}

.feature-list .is-muted span {
  color: #bdbdbd;
}

.portfolio-card__button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  padding: 0;
  border: 0;
  color: #ffffff;
  background: #111111;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
}

.portfolio-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.74));
}

.portfolio-card__text {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 10px;
  padding: 28px;
}

.portfolio-card__text strong {
  font-size: 27px;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.portfolio-card__text small {
  color: rgba(255,255,255,.78);
  font-size: 16px;
}

.portfolio-card__text em {
  width: max-content;
  margin-top: 8px;
  font-style: normal;
  border-bottom: 1px solid rgba(255,255,255,.65);
}

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(12px);
}

.project-modal.is-open {
  display: flex;
  animation: fadeIn .2s ease both;
}

.modal-dialog {
  position: relative;
  width: min(1220px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
  overflow: hidden;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 35px 90px rgba(0,0,0,.35);
  animation: modalUp .25s ease both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,0,0,.72);
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
  background: #000;
}

.modal-gallery {
  min-height: 560px;
  display: grid;
  grid-template-rows: 1fr auto;
  background: #111;
}

.modal-main-image {
  position: relative;
  overflow: hidden;
}

.modal-main-image img {
  width: 100%;
  height: 100%;
  min-height: 500px;
  object-fit: cover;
}

.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.84);
  color: #111;
  font-size: 32px;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}

.modal-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.05);
}

.modal-arrow--prev {
  left: 18px;
}

.modal-arrow--next {
  right: 18px;
}

.modal-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
}

.modal-thumb {
  height: 86px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #222;
  cursor: pointer;
  opacity: .72;
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}

.modal-thumb.is-active,
.modal-thumb:hover {
  opacity: 1;
  border-color: #ffffff;
  transform: translateY(-2px);
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info {
  overflow-y: auto;
  padding: clamp(28px, 4vw, 46px);
}

.modal-info__service {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 9px 13px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.modal-info h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  line-height: .98;
  letter-spacing: -0.06em;
}

.modal-info p {
  color: var(--muted);
  font-size: 17px;
}

.modal-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.modal-fact {
  padding: 16px;
  border-radius: 18px;
  background: #f3f3f3;
}

.modal-fact span {
  display: block;
  color: var(--muted-2);
  font-size: 13px;
}

.modal-fact strong {
  display: block;
  margin-top: 5px;
  font-size: 18px;
}

.modal-info h3 {
  margin: 28px 0 10px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.modal-info ul {
  padding-left: 20px;
  color: var(--muted);
}

.modal-info li + li {
  margin-top: 8px;
}

.reveal {
  opacity: 1;
  transform: none;
}

.js-enabled .reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--delay, 0ms);
}

.js-enabled .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(24px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
  .directions-grid,
  .price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid,
  .portfolio-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  :root {
    --header-height: 72px;
  }

  .burger {
    display: block;
  }

  .site-nav {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    display: none;
    background: rgba(24,24,24,.98);
    padding: 28px 20px;
  }

  .menu-open .site-nav {
    display: block;
    animation: fadeIn .2s ease both;
  }

  .nav-list {
    width: min(100%, 520px);
    margin-inline: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list li {
    border-bottom: 1px solid rgba(255,255,255,.08);
  }

  .nav-list a {
    display: block;
    padding: 18px 0;
    font-size: 28px;
    font-weight: 700;
  }

  .nav-list a::after {
    display: none;
  }

  .about-grid,
  .cta-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .cta-grid {
    text-align: center;
  }

  .cta .btn {
    width: 100%;
  }

  .modal-dialog {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .modal-gallery {
    min-height: auto;
  }

  .modal-main-image img {
    min-height: auto;
    aspect-ratio: 1.35 / 1;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .section {
    padding: 64px 0;
  }

  .section-title {
    margin-bottom: 30px;
  }

  .hero {
    min-height: 720px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .directions-grid,
  .project-grid,
  .portfolio-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .direction-card p,
  .direction-card ul,
  .price-card p {
    min-height: unset;
  }

  .service-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .portfolio-card__button {
    min-height: 320px;
  }

  .project-modal {
    padding: 10px;
  }

  .modal-dialog {
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }

  .modal-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-thumb {
    height: 66px;
  }

  .modal-facts {
    grid-template-columns: 1fr;
  }

  .modal-info {
    padding: 28px 20px;
  }
}
/* =========================================================
   PATCH: нормальное модальное окно проекта + галерея + скролл
   ========================================================= */

.project-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vw, 24px);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.project-modal.is-open {
  display: flex;
  animation: fadeIn 0.2s ease both;
}

.modal-dialog {
  position: relative;
  width: min(1240px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 32px));
  height: min(760px, calc(100dvh - 32px));
  max-height: none;
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(400px, 1.05fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  border-radius: 30px;
  background: #ffffff;
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.35);
  animation: modalUp 0.25s ease both;
}

.modal-gallery {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #111111;
  overflow: hidden;
}

.modal-main-image {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.modal-main-image img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.modal-photo-counter {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.58);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.modal-arrow {
  z-index: 3;
}

.modal-arrow:disabled,
.modal-arrow[hidden] {
  display: none;
}

.modal-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(74px, 1fr));
  gap: 8px;
  max-height: 112px;
  padding: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #111111;
  scrollbar-width: thin;
}

.modal-thumb {
  height: 78px;
  min-width: 74px;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 14px;
  background: #222222;
  cursor: pointer;
  opacity: 0.68;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.modal-thumb.is-active,
.modal-thumb:hover {
  opacity: 1;
  border-color: #ffffff;
  transform: translateY(-2px);
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-info {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: clamp(28px, 4vw, 46px);
}

.modal-info::-webkit-scrollbar {
  width: 10px;
}

.modal-info::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.modal-info::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c7c7c7;
}

.modal-info::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

@media (max-width: 1000px) {
  .project-modal {
    align-items: center;
    padding: 10px;
  }

  .modal-dialog {
    width: min(780px, calc(100vw - 20px));
    height: min(92vh, calc(100vh - 20px));
    height: min(92dvh, calc(100dvh - 20px));
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    border-radius: 24px;
  }

  .modal-gallery {
    height: auto;
    max-height: 42vh;
    max-height: 42dvh;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .modal-main-image img {
    height: clamp(210px, 32vh, 330px);
    height: clamp(210px, 32dvh, 330px);
    object-fit: cover;
  }

  .modal-thumbs {
    grid-auto-flow: column;
    grid-auto-columns: 78px;
    grid-template-columns: none;
    max-height: 76px;
    padding: 8px;
  }

  .modal-thumb {
    height: 58px;
  }

  .modal-info {
    max-height: none;
    padding: 28px 24px 34px;
  }

  .modal-info h2 {
    font-size: clamp(30px, 8vw, 46px);
  }

  .modal-info p {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .project-modal {
    padding: 6px;
  }

  .modal-dialog {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    height: calc(100dvh - 12px);
    border-radius: 20px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    width: 42px;
    height: 42px;
    font-size: 28px;
  }

  .modal-gallery {
    max-height: 36vh;
    max-height: 36dvh;
  }

  .modal-main-image img {
    height: clamp(170px, 26vh, 250px);
    height: clamp(170px, 26dvh, 250px);
  }

  .modal-photo-counter {
    left: 12px;
    top: 12px;
    font-size: 12px;
  }

  .modal-arrow {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .modal-arrow--prev {
    left: 10px;
  }

  .modal-arrow--next {
    right: 10px;
  }

  .modal-thumbs {
    grid-auto-columns: 68px;
    max-height: 68px;
    gap: 6px;
    padding: 6px;
  }

  .modal-thumb {
    height: 52px;
    border-radius: 10px;
  }

  .modal-info {
    padding: 24px 18px 32px;
  }

  .modal-facts {
    grid-template-columns: 1fr;
  }
}
/* =========================================================
   PATCH: исправление бургер-меню на мобильных экранах
   ========================================================= */

@media (max-width: 900px) {
  .site-header {
    z-index: 2000;
  }

  .header-inner {
    position: relative;
    z-index: 2002;
  }

  .burger {
    position: relative;
    z-index: 2003;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    cursor: pointer;
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      transform 0.2s ease;
  }

  .burger:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.34);
  }

  .burger span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 4px 0;
    background: currentColor;
    border-radius: 999px;
    transition:
      transform 0.25s ease,
      opacity 0.25s ease;
  }

  body.menu-open .burger {
    background: rgba(255, 255, 255, 0.1);
  }

  body.menu-open .burger span:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }

  body.menu-open .burger span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .burger span:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
  }

  .site-nav {
    position: fixed !important;
    z-index: 2001;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;

    display: block !important;
    width: 100%;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));

    padding: 34px 20px 44px;
    overflow-y: auto;

    background: rgba(18, 18, 18, 0.98);
    backdrop-filter: blur(18px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);

    transition:
      opacity 0.22s ease,
      visibility 0.22s ease,
      transform 0.22s ease;
  }

  body.menu-open .site-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-list {
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 10px 0 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-list a {
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 18px 4px;
    color: #ffffff;
    font-size: clamp(26px, 7vw, 42px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.04em;
  }

  .nav-list a::after {
    display: none;
  }

  .nav-list a.is-active {
    color: #ffffff;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(100% - 28px, var(--container));
  }

  .logo {
    font-size: 30px;
  }

  .burger {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
    border-radius: 15px;
  }

  .site-nav {
    padding: 26px 16px 36px;
  }

  .nav-list a {
    min-height: 66px;
    font-size: clamp(28px, 9vw, 40px);
  }
}
/* =========================================================
   PATCH: мобильное окно портфолио — видимый крестик и фото без обрезки
   ========================================================= */

/* Во всех размерах фото в модальном окне показываются целиком, без crop. */
.modal-main-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111111;
}

.modal-main-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  background: #111111;
}

.modal-thumb img {
  object-fit: contain;
  background: #111111;
}

/* Крестик всегда поверх галереи, стрелок и текста. */
.modal-close {
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

@media (max-width: 1000px) {
  .modal-dialog {
    overflow: hidden;
  }

  .modal-gallery {
    max-height: none;
  }

  .modal-main-image {
    min-height: 0;
  }

  .modal-main-image img {
    width: 100%;
    height: auto;
    max-height: min(54vh, 420px);
    max-height: min(54dvh, 420px);
    aspect-ratio: auto;
  }
}

@media (max-width: 560px) {
  .project-modal {
    align-items: flex-start;
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    overflow-y: auto;
  }

  .modal-dialog {
    width: 100%;
    height: auto;
    min-height: auto;
    max-height: none;
    grid-template-rows: auto auto;
    overflow: visible;
    border-radius: 20px;
  }

  .modal-close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 5000;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(15, 15, 15, 0.92);
    font-size: 32px;
    line-height: 1;
    backdrop-filter: blur(12px);
    -webkit-tap-highlight-color: transparent;
  }

  .modal-gallery {
    height: auto;
    max-height: none;
    grid-template-rows: auto auto;
    border-radius: 20px 20px 0 0;
  }

  .modal-main-image {
    width: 100%;
    min-height: 0;
    padding: 0;
  }

  .modal-main-image img {
    width: 100%;
    height: auto;
    max-height: 62vh;
    max-height: 62dvh;
    object-fit: contain !important;
  }

  .modal-info {
    max-height: none;
    overflow: visible;
    padding: 22px 18px 30px;
  }
}

/* =========================================================
   PATCH: модальное окно портфолио поверх мобильной шапки
   ========================================================= */

/* Шапка на мобильных имеет z-index: 2000, поэтому модалку нужно поднять выше. */
.project-modal {
  z-index: 8000 !important;
}

.project-modal.is-open {
  z-index: 8000 !important;
}

/* Крестик находится внутри модалки, поэтому его z-index работает только в рамках
   z-index модального окна. Поднимаем его поверх фото, стрелок, текста и меню. */
.modal-close {
  z-index: 8100 !important;
}

@media (max-width: 560px) {
  .project-modal {
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-right: max(8px, env(safe-area-inset-right));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    padding-left: max(8px, env(safe-area-inset-left));
    background: rgba(0, 0, 0, 0.82);
  }

  .modal-dialog {
    margin: 0;
    width: 100%;
    max-width: 100%;
  }

  .modal-close {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    z-index: 8100 !important;
  }
}
