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

body {
  font-family: "Poppins", sans-serif;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.5;
  letter-spacing: 0.2px;
  padding: 20px 0px;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

h1,
h2,
h3 {
  letter-spacing: 0.5px;
}

p,
li {
  letter-spacing: 0.2px;
}

small,
footer {
  letter-spacing: 0.4px;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  column-gap: 30px;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-bottom: 0%;
}

header,
main,
footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

header {
  background: #222;
  color: white;
  padding: 10px 0;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  height: auto;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  padding: 0px 0px 12px 0px;
}

#PN {
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  list-style: none;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

nav ul li a:hover {
  text-decoration: underline;
  color: #25d366;
}

button {
  background: #25d366;
  color: white;
  border: none;
  padding: 6px 12px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  white-space: nowrap;
  letter-spacing: 0.6px;
}

nav ul li button:hover {
  background: #1ebe5c;
}

section {
  padding: 80px 0px;
  max-width: 1000px;
  margin: 0 auto;
  padding-block: clamp(2rem, 5vw, 7rem);
  gap: 0;
}

h2 {
  font-size: 26px;
  margin-bottom: 20px;
  color: #222;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 22px;
  margin-bottom: 30px;
}

p {
  font-size: 17px;
  margin-bottom: 15px;
}

ul {
  list-style-type: none;
}

#about img {
  max-width: 100%;
  height: auto;
  margin: 0;
}

#portfolio {
  display: block !important;
  height: auto;
  min-height: 100vh;
  align-items: stretch;
  width: 100%;
  position: relative;
  transform: none;
  padding: 0px;
  margin-top: 0;
  z-index: 0;
  padding-bottom: clamp(6rem, 5vw, 12rem);
  color: #eeeeee;
  overflow: visible;
}

.project {
  background: white;
  padding: 20px 0px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
  flex: 1 1 clamp(300px, 400px, 45%);
  max-width: 45%;
  min-width: 280px;
  height: auto;
}

.project:hover {
  transform: scale(1.05) translateZ(10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.project img {
  aspect-ratio: 16/9;
  width: 100%;
  height: 500px;
  object-fit: cover;
}

/* Основной контейнер формы */
#form {
  display: flex;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4rem) 0; /* отступы секции */
  padding-top: 0%;
  position: relative;
  width: 100%;
  z-index: 0;
  transform: none;
  position: relative;
  top: 0;
  height: auto;
}

#form form {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  width: clamp(300px, 90%, 400px); /* вписывается в любой экран */
  padding: clamp(1rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  transform: scale(0.85);
}

/* Заголовок формы */
#form h4 {
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  margin: 0;
  color: rgb(10, 10, 10);
}

/* Общие стили для полей */
#form input[type="text"],
#form input[type="email"],
#form textarea {
  width: 100%;
  padding: clamp(0.75rem, 2vw, 1rem);
  font-size: clamp(0.9rem, 2vw, 1rem);
  border: 1px solid #ccc;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

/* Минимальная высота для textarea */
#form textarea {
  min-height: clamp(80px, 20vh, 150px);
  resize: none;
  font-family: inherit;
}

/* Фокус */
#form input:focus,
#form textarea:focus {
  border-color: #25d366;
}

/* Кнопка отправки */
#form input[type="submit"] {
  width: 100%;
  padding: clamp(0.75rem, 2vw, 1rem);
  font-size: clamp(1rem, 2vw, 1.1rem);
  font-weight: 600;
  color: rgb(10, 10, 10);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}

#form input[type="submit"]:hover {
  background: linear-gradient(135deg, #1ebe5c, #24c15f);
  transform: translateY(-2px);
}

#Contact {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  background: #f4f4f4;
  text-align: center;
  padding-block: clamp(24px, 3vw, 80px);
  padding-bottom: 0;
}

#Contact .container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

nav ul li:last-child {
  display: flex;
  align-items: center;
}

nav button {
  padding: 6px 12px;
  font-size: 14px;
  white-space: nowrap;
}

nav ul li {
  list-style: none;
  display: flex;
  max-width: 150px;
  text-align: center;
  flex: 0 1 auto;
  min-width: 100px;
  align-items: center;
}

.hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.visible {
  opacity: 1;
  transform: translateY(0);
}

button a {
  transition: all 0.3s ease;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.hidden:nth-child(2) {
  transition-delay: 0.1s;
}

.hidden:nth-child(3) {
  transition-delay: 0.3s;
}

.hidden.left {
  transform: scale(0.9);
}

.hidden.right {
  transform: scale(0.9) translateY(30px);
}

section svg {
  position: center;
}

img {
  max-width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  margin-top: 20px;
}

#Services {
  margin-bottom: -10vw;
  padding-top: clamp(2rem, 3vw, 5rem);
  padding-bottom: 0;
  z-index: 0;
  position: relative;
  width: 100%;
  transform: none;
}

#hportf {
  padding-right: auto;
  color: #eeeeee;
  margin-top: clamp(2rem, 3vw, 5rem);
  margin-bottom: 50px;
}

h2 {
  text-align: left;
}

#hcnt {
  position: relative;
  top: -40px;
  padding-top: 2vw;
  padding-bottom: 2vw;
}

/* Анимации лого, занавеса: */

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgb(163, 177, 196);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  transition: opacity 0.4s ease-in-out;
}

#logo {
  position: absolute;
  z-index: 1100;
  animation: fadeIn 1.5s ease-in-out;
  display: block;
  margin: auto;
  opacity: 1;
  transition: opacity 1s ease-in-out;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.preloader-hidden {
  opacity: 0;
  pointer-events: none;
}

#curtain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  z-index: 1000;
  overflow: hidden;
}

.curtain-left,
.curtain-right {
  width: 50vw;
  height: 100vh;
  position: absolute;
  top: 0;
  transition: transform 1.2s ease-in-out;
}

.curtain-left {
  left: 0;
  background: linear-gradient(to right, darkred, black);
}
.curtain-right {
  right: 0;
  background: linear-gradient(to left, darkred, black);
}

/* Класс для анимации открытия */
.open .curtain-left {
  transform: translateX(-100%);
}
.open .curtain-right {
  transform: translateX(100%);
}

/* Прожектор */

#spotlight {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1004;
  opacity: 1;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  gap: 1rem;
}

.spotlight-circle {
  position: absolute;
  width: clamp(50px, 20vw, 150px);
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  top: 50%;
  left: 50%;
}

@keyframes spotlightFadeIn {
  to {
    opacity: 1;
  }
}

@keyframes flicker {
  0%,
  18%,
  22%,
  25%,
  100% {
    opacity: 1;
  }
  19%,
  23%,
  24% {
    opacity: 0.3;
  }
}

#spotlight-text {
  position: relative;
  color: #ffbb00;
  font-size: clamp(0.8em, 1.2em, 1.5em);
  text-align: center;
  z-index: 1005;
  opacity: 0;
  animation: textAppear 1s ease-out forwards;
  animation-delay: 1.9s;
  text-shadow: 0 0 12px rgb(255, 255, 255);
  max-width: 90%;
}

@keyframes textAppear {
  to {
    opacity: 1;
  }
}

.spotlight-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 2vh, 2rem);
  transition: transform 0.8 ease;
}

.spotlight-content.open {
  transform: translateY(-100%);
}

#about {
  margin: auto;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  text-align: center;
  gap: 13px;
  width: 60vw;
  height: auto;
  background-image: url(/image/Jp_.png);
  background-position: center;
  background-size: 100%;
  background-repeat: no-repeat;
  width: 100%;
}

img,
svg,
input,
button {
  max-width: 100%;
  box-sizing: border-box;
}

#spotlight-path {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%; /* тянем по ширине контейнера */
  height: auto; /* сохраняем пропорции */
  max-width: 90vw; /* не больше 80% ширины окна */
  max-height: 90vh; /* не больше 80% высоты окна */
  pointer-events: none;
  visibility: visible;
}
#firstBut {
  margin-top: 1rem;
  margin-bottom: 0;
  width: auto;
  height: auto;
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
  border: none;
  background-color: #25d366;
  color: white;
  transition: background 0.3s ease;
  max-width: fit-content;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
}

#firstBut:hover {
  background: #1ebe5c;
}

#call_to {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3vw;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

#cta-l {
  flex: 1 1 45%;
}

#cta-r {
  flex: 1 1 45%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  text-align: left;
}

#about h1 {
  padding-bottom: 5rem;
  padding-top: 1rem;
  font-size: 26px;
  color: rgb(9, 9, 9);
}

#problem {
  z-index: 0;
  position: relative;
}

#problem::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw; /* ширина во всю ширину окна */
  height: 100%;
  transform: translateX(-50%); /* центрируем по X */
  background-color: #eee; /* ваш серый фон */
  z-index: -1; /* подложка позади всего внутри #CTA */
}

#problem,
#problem h2 {
  text-align: center;
}

#problem ul {
  line-height: 2em;
  list-style-type: disc;
  padding-left: 1em;
  margin: 0;
}

#problem h2 {
  line-height: 1.7em;
  padding: 1em auto;
}

#pr2 {
  padding-top: 1em;
}

#prUl1 {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-end;
  text-align: left;
}

#prUl2 {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  width: 60vw;
  text-align: left;
}

.h-head {
  font-weight: 500;
  font-size: clamp(16px, 20px, 24px);
  text-align: center;
  width: 40%;
}

#Mlog {
  padding: 10px 0px;
}

#benefits h2 {
  text-align: center;
  position: relative;
  transform: translateY(-40%);
  color: white;
}

.benefits-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(
    120deg,
    #2bd770 0%,
    #1ebe5c 25%,
    #2bd770 50%,
    #1ebe5c 75%,
    #2bd770 100%
  );
  background-size: 200% 200%;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Меню-кнопка чуть компактнее */
.btn-nav {
  padding: 8px 16px;
  font-size: 16px;
}

/* 1. Базовый класс для анимации при скролле */
.scroll-reveal {
  opacity: 0;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

/* 2. Варианты направления */
.FromL {
  transform: translateX(-50px);
}
.FromR {
  transform: translateX(50px);
}
.FromUp {
  transform: translateY(-30px);
}
.FromDown {
  transform: translateY(30px);
}

/* 3. Когда в зоне видимости */
.scroll-reveal.visible {
  opacity: 1;
  transform: translate(0, 0);
}

/* 4. «Хаотичные» смещения для картинок */
.chaotic-1 {
  position: relative;
  top: 0px;
  left: 20vw;
}
.chaotic-2 {
  position: relative;
  top: 10px;
  left: -8vw;
}
.chaotic-3 {
  position: relative;
  top: -10px;
  left: 35vw;
}

.Hleft {
  position: relative;
  left: 20vw;
}

.Hright {
  position: relative;
  right: 20vw;
}

.benefits-grid .benefit {
  transition: transform 0.5s ease;
  margin-top: 1vh;
}

/* Первая карточка — без сдвига, чуть повёрнута */
.benefits-grid .benefit:nth-child(1) {
  transform: translateY(-2vw) rotate(-2deg) translateX(-2vw);
}

/* Вторая — чуть ниже и наоборот наклонена */
.benefits-grid .benefit:nth-child(2) {
  transform: translateY(3vw) rotate(2deg) translateX(1vw);
}

/* Третья — сильнее вниз и опять влево */
.benefits-grid .benefit:nth-child(3) {
  transform: translateY(-2vw) rotate(2deg) translateX(4vw);
}

/* Четвёртая — ещё ниже и вправо */
.benefits-grid .benefit:nth-child(4) {
  transform: translateY(3vw) rotate(-2deg) translateX(5vw);
}

.srv-intro {
  position: relative;
  right: -10vw;
  font-weight: bold;
}

h2,
img {
  margin-bottom: clamp(1rem, 2.5vw, 3rem);
}

#CTA > * + * {
  margin-bottom: clamp(0.5rem, 2vw, 1.5rem);
}

#CTA > *:last-child {
  margin-bottom: 0;
}

#CTA {
  position: relative;
  z-index: 0;
  padding-top: 5%;
  padding-bottom: 5%;
}

#CTA h3 {
  color: white;
}

#CTA_img {
  width: 100%;
  height: auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}

#CTA::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background: rgb(0, 0, 0);
  z-index: -1;
}

#CTA p {
  color: white;
  width: 50%;
  text-align: left;
  margin: 0 auto;
}

#benefits {
  z-index: 0;
  position: relative;
  margin-bottom: 0;
  padding-bottom: 100px;
  color: white;
  z-index: 0;
}

#benefits::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background-color: rgb(0, 0, 0);
  z-index: -1;
}

.benefit {
  font-size: large;
  color: white;
}

#portfolio::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  transition: opacity 0.5s ease;
  opacity: 1;
  background-color: #3c3c3c;
  z-index: -1;
  animation: fadeIn 1s ease forwards;
}

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

#Services::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background-color: #eee;
  z-index: -1;
}

#reviews {
  position: relative;
  width: 100%;
  height: auto;
  z-index: 0;
  padding-bottom: 10vw;
}

#reviews::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background-color: #eee;
  z-index: -1;
}

#form::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 100vw;
  height: 100%;
  transform: translateX(-50%);
  background-color: #333;
  z-index: -1;
}

footer {
  position: relative;
  width: 100%;
  z-index: 0;
  height: auto;
  color: #222;
  padding-top: 2vw;
}

footer p {
  position: relative;
  top: 50%;
}

footer nav {
  padding: 15px 0;
}

footer nav ul li a {
  color: #222;
  z-index: 1;
}

.feature {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin: 60px auto;
  max-width: 1280px;
  padding: 0 20px;
  text-align: left;
}

.feature.reverse {
  flex-direction: row-reverse;
}

.feature .text {
  flex: 1;
  z-index: 1;
}

.text-left {
  opacity: 1;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transform: translateX(-600px);
  z-index: 1;
  width: 50%;
}

.text-right {
  opacity: 1;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transform: translateX(10px);
  z-index: 1;
  width: 50%;
}

.text-center {
  opacity: 1;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transform: translateX(-600px);
  z-index: 1;
  width: 30%;
}

.feature .image {
  flex: 1;
  position: relative;
  overflow: visible;
  z-index: 0;
}

.feature .image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-right {
  transform: translateX(300px);
}

.image-left {
  transform: translateX(-30px);
}

.image-center {
  transform: translateX(-100px);
}

#Con-Ch1 {
  position: relative;
  top: 0px;
  left: -15vw;
}

#Con-Ch2 {
  position: relative;
  top: -90px;
  left: -10vw;
}

#Con-Tx1 {
  opacity: 1;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transform: translateX(-200px) translateY(-300px);
  z-index: 1;
  width: 40%;
}

#Con-Tx2 {
  opacity: 1;
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  transform: translateX(470px) translateY(-300px);
  z-index: 1;
  width: 50%;
}

#p-srv {
  position: relative;
  left: 13vw;
  font-style: italic;
  font-size: 1.3em;
  padding-bottom: 3vw;
}

#img-srv {
  position: relative;
  top: -12vw;
  left: -20vw;
}

#s1,
#s2,
#s3 {
  padding-top: 7px;
  margin-bottom: 70px;
  margin-top: 70px;
  width: 50%;
  text-align: left;
}

#s1 {
  position: relative;
  left: -7vw;
}

#s2 {
  position: relative;
  left: 22vw;
  top: 0vw;
}

#s3 {
  position: relative;
  left: 38vw;
  top: 4vw;
}

#Hd {
  width: 60%;
  color: black;
}

#Hd_1 {
  position: relative;
  top: 2vw;
  left: -20vw;
  margin: 10% auto;
  margin-top: 2%;
  color: black;
}

#Hd_2 {
  position: relative;
  top: 1vw;
  left: 20vw;
  margin: 10% auto;
  margin-bottom: 5%;
  color: black;
}

.testimonials-list {
  display: flex;
  flex-direction: row;
  flex: 1 1 45%;
  align-content: center;
  gap: 10vw;
  justify-content: center;
  width: 100%;
  height: auto;
}

/* Общая база для всех */
.button-red {
  display: inline-block;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 600;
  color: rgb(0, 0, 0);
  border: none;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  background-size: 200% 200%;
}

/* Главная кнопка — насыщенный градиент */
.button-red-primary {
  background: linear-gradient(
    120deg,
    #570101 0%,
    #660000 25%,
    #710000 50%,
    #940000 75%,
    #be0000 100%
  );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Вторичная кнопка — темнее, без анимаций */
.button-red-secondary {
  background: rgb(163, 177, 196);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  color: rgb(0, 0, 0);
}

/* Нейтральная красная — для фона и контактов */
.button-red-muted {
  background: rgb(163, 177, 196);
  font-size: 16px;
  padding: 10px 20px;
  box-shadow: none;
}

/* Новые стили для портфолио */

.text-left-Port {
  opacity: 1;
  transform: translate(-50px, -5px);
  z-index: 1;
  width: 50%;
}

.text-right-Port {
  opacity: 1;
  transform: translate(50px, 80px);
  z-index: 1;
  width: 50%;
}

.text-center-Port {
  opacity: 1;
  transform: translate(-600px, 200px);
  z-index: 1;
  width: 50%;
}

.image-right-Port {
  transform: translate(200px, -10px);
}

.image-left-Port {
  transform: translate(-110px, 70px);
}

.image-center-Port {
  transform: translate(600px, 200px);
}

.case-badge {
  font-size: 17px;
}

.case-desc {
  margin-bottom: 50px;
}

.case-title {
  margin-top: 15px;
  margin-bottom: 15px;
  width: 50%;
}

.case-4 {
  margin-top: 350px;
}

.case-media > img,
.case-media > svg {
  cursor: pointer;
  -webkit-user-drag: none;
  user-select: none;
}

.text-left-Port-4 {
  opacity: 1;
  transform: translate(50px, 10px);
  z-index: 1;
  width: 50%;
}

.image-right-Port-4 {
  transform: translate(-100px, -10px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999999;
  padding-top: clamp(16px, 6vh, 48px);
}
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: min(720px, 92vw);
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 28px;
  background: transparent;
  border: 0;
  cursor: pointer;
  z-index: 3;
  line-height: 1;
  color: #111;
}

.modal-gallery {
  position: relative;
  inset: auto;
  background-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: auto;
  overflow: visible;
}

.modal-image {
  display: none;
  max-width: 90%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain; /* 👈 важнейшая часть */
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.modal-pdf {
  display: none;
  width: 100%;
  height: min(70vh, 640px);
  border: 0;
}

.modal-gallery .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: auto;
}
.modal-gallery .prev {
  left: 8px;
}
.modal-gallery .next {
  right: 8px;
}

.gallery-viewport {
  width: min(92vw, 720px);
  height: min(70vh, 640px);
  overflow: hidden; /* при зуме будем панорамировать внутри */
  position: relative;
  background: #fff;
  border-radius: 8px;
  z-index: 1;
  -ms-touch-action: none;
  touch-action: none;
  cursor: grab;
}

.modal-image,
.modal-pdf {
  display: none;
  max-width: none; /* управляем размером через transform */
  max-height: none;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.modal-toolbar {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  z-index: 3;
}

.modal-toolbar .tool {
  border: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: #717171;
  cursor: pointer;
  font-weight: 700;
}
.modal-toolbar .tool:hover {
  background: #424242;
}

.modal-counter {
  margin-left: 8px;
  font-weight: 600;
  color: #111; /* читабельно на белом */
}

.modal-desc {
  color: #111; /* тоже читабельно */
  margin-top: 10px;
}

.modal-gallery .gallery-viewport {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.modal-gallery .gallery-controls {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 90vw;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 1rem;
  box-sizing: border-box;
}

.modal-gallery .modal-image {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
  image-rendering: auto;
}

/* Конец портфолио с новыми стилями */

.testimonial-1 {
  transform: translate(-3vw, 5vw);
}

.testimonial-2 {
  transform: translateX(3vw);
}

.testimonials-list img {
  width: auto;
  height: 100%;
}

.client-name {
  font-size: 18px;
  font-weight: 600;
}

.big-number {
  font-size: 1.4rem;
  font-weight: 550;
}

:root {
  --header-h: 72px;
  --form-bg: #111; /* подложка секции, если нужно */
  --card-bg: #141414;
  --card-br: 16px;
  --card-bd: 1px solid rgba(255, 255, 255, 0.08);
  --muted: #aaa;
  --text: #fff;
  --ring: #ff3b3b; /* акцент под твои красные кнопки */
  --gap: clamp(12px, 2.5vmin, 20px);
} /* дефолт, JS перезапишет */

section[id] {
  scroll-margin-top: calc(var(--header-h) + 16px); /* отступ под фикс-хедер */
}

#Contact a,
#Contact a:hover {
  color: initial;
  text-decoration: none;
}

/* Адаптив под устройства */

@media (max-width: 480px) {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body,
  html {
    height: auto;
    min-height: 100vh;
    width: 100%;
    padding: 0px !important;
  }

  header {
    height: auto;
    padding: 0px 0px 7px 0px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 10%;
  }

  .logo {
    grid-row: 1 / 2;
    justify-self: center;
    margin-bottom: 10px;
  }

  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-content: center;
  }

  header .container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* 2) Горизонтальное меню одним рядом */
  header nav ul {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px; /* подстрой при необходимости */
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap; /* строго в один ряд */
  }

  header nav li {
    display: inline-flex; /* чтобы <li> не тянулся на 100% */
    white-space: nowrap; /* текст не переносится на новую строку */
  }

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

  #PN {
    font-size: 24px;
  }

  form {
    max-width: 100%;
    width: 70%;
    transform: none;
    padding: 1rem;
  }

  h2 {
    position: relative;
    text-align: center;
    margin: auto;
    padding-top: 10%;
  }

  main {
    margin-top: auto;
    padding: auto 0;
  }

  h1,
  h2 {
    font-size: 1.3rem; /* Уменьшаем заголовки */
    padding-bottom: 10px;
  }

  h1 {
    text-align: center;
  }

  p {
    font-size: 15px; /* Основной текст */
    padding-top: 10px;
  }

  #portfolio > * {
    text-align: center;
  }

  #Services {
    padding-top: 0px;
    padding-bottom: clamp(2rem, 3vw, 5rem);
  }

  .container section {
    column-gap: 5px;
  }

  #about p {
    width: 80%;
  }

  footer {
    align-content: center;
  }

  #Contact {
    flex-direction: column;
    align-content: center;
    justify-content: center;
  }

  #problem h2 {
    left: auto;
    right: auto;
  }

  #prUl1,
  #prUl2 {
    display: block;
    list-style-position: inside;
    text-align: left;
    margin: 0 auto;
    width: auto;
  }

  .feature.reverse {
    flex-direction: column !important;
  }
  .feature,
  .feature.reverse {
    flex-direction: column;
    text-align: center;
  }

  .feature .image img {
    transform: none;
    max-width: 100%;
  }

  .modal-gallery .nav {
    display: none;
  }

  #about {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
    width: 100%;
    background-image: url(/image/Jp_mob_750.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    padding-bottom: 25vw;
  }

  #cta-r {
    text-align: center;
  }

  #CTA p {
    width: 100%;
    text-align: center;
  }

  #call_to {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  #problem h2 {
    padding-top: 0;
  }

  #problem ul {
    padding-bottom: 5%;
  }

  .hide-mob {
    display: none;
  }

  #Hd {
    width: 90%;
  }

  #about h1 {
    padding-top: 2.5rem;
  }

  .anim {
    opacity: 0;
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  }

  .anim.visible {
    opacity: 1;
    transform: translate(0, 0);
  }

  .mob_an_l {
    transform: translateX(-3vw);
  }

  .mob_an_r {
    transform: translateX(3vw);
  }

  .text-left {
    transform: translateX(-50px);
    text-align: left;
    width: 70%;
  }

  .image-right {
    transform: translateX(-25px);
  }

  .image-right img {
    position: relative;
  }

  .text-right {
    transform: translateX(80px);
    text-align: right;
  }

  .image-left {
    transform: translateX(-40px);
  }

  .text-center {
    transform: translateX(0px);
    width: 100%;
  }

  .chaotic-3 {
    left: 0;
  }

  .benefits-grid {
    flex-direction: column;
    align-content: center;
  }

  .benefits-grid .benefit:nth-child(n),
  .benefits-grid .benefit * {
    transform: none;
  }

  #p-srv {
    left: 5vw;
    width: 90%;
    text-align: right;
  }

  nav ul li {
    width: auto;
    min-width: 50px;
  }

  #s1,
  #s2,
  #s3 {
    padding-top: 5vw;
    margin-bottom: 5vw;
    margin-top: 5vw;
    width: 50%;
    text-align: left;
  }

  #s1 {
    position: relative;
    left: 5vw;
  }

  #s2 {
    position: relative;
    left: 22vw;
    top: 0vw;
  }

  #s3 {
    position: relative;
    left: 45vw;
    top: 2vw;
    margin-bottom: 20vw;
  }

  #Hd_1 {
    text-align: left;
    width: 50%;
  }

  #Hd_2 {
    text-align: right;
    width: 65%;
    left: 15vw;
  }

  #Hd_1,
  #Hd_2 {
    font-size: 17px;
  }

  .mob_port_txt {
    transform: none;
    width: 90%;
  }
  .mob_port_img {
    transform: none;
  }

  .mob_port_img svg {
    padding: 0;
  }

  .case-title {
    width: 100%;
  }

  .case-4 {
    margin-top: auto;
  }

  .testimonials-list {
    flex-direction: column-reverse;
  }

  .testimonial-1,
  .testimonial-2 {
    transform: none;
  }

  #Contact .container {
    flex-direction: column;
    width: 100vw;
    height: auto;
  }

  .con {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
    align-content: center;
  }

  #Con-Ch1 img,
  #Con-Ch2 img {
    width: 60%;
    transform: none;
  }

  #Con-Tx1,
  #Con-Tx2 {
    transform: none;
  }

  .chaotic-1,
  .chaotic-2,
  .chaotic-3 {
    position: static;
  }

  #Con-Ch1 {
    left: -25%;
  }
  #Con-Ch2 {
    left: 25%;
    top: -7%;
  }
  #Con-Tx2 {
    position: relative;
    left: 50%;
    top: -7%;
  }
  .form-card {
    padding: calc(var(--gap) * 1);
  }
}

@media (min-width: 480px) and (max-width: 768px) {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body,
  html {
    height: auto;
    min-height: 100vh;
    width: 100%;
    padding: 0px !important;
  }

  header {
    height: auto;
    padding: 0px 0px 7px 0px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 10%;
  }

  .logo {
    grid-row: 1 / 2;
    justify-self: center;
    margin-bottom: 10px;
  }

  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    text-align: center;
    justify-content: center;
    align-content: center;
  }

  header .container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* 2) Горизонтальное меню одним рядом */
  header nav ul {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px; /* подстрой при необходимости */
    margin: 0;
    padding: 0;
    list-style: none;
    flex-wrap: nowrap; /* строго в один ряд */
  }

  header nav li {
    display: inline-flex; /* чтобы <li> не тянулся на 100% */
    white-space: nowrap; /* текст не переносится на новую строку */
  }

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

  #PN {
    font-size: 24px;
  }

  form {
    max-width: 100%;
    width: 70%;
    transform: none;
    padding: 1rem;
  }

  h2 {
    position: relative;
    text-align: center;
    margin: auto;
    padding-top: 10%;
  }

  main {
    margin-top: auto;
    padding: auto 0;
  }

  h1,
  h2 {
    font-size: 1.3rem; /* Уменьшаем заголовки */
    padding-bottom: 10px;
  }

  h1 {
    text-align: center;
  }

  p {
    font-size: 15px; /* Основной текст */
    padding-top: 10px;
  }

  #portfolio > * {
    text-align: center;
  }

  #Services {
    padding-top: 0px;
    padding-bottom: clamp(2rem, 3vw, 5rem);
  }

  .container section {
    column-gap: 5px;
  }

  #about p {
    width: 80%;
  }

  footer {
    align-content: center;
  }

  #problem h2 {
    left: auto;
    right: auto;
  }

  #prUl1,
  #prUl2 {
    display: block;
    list-style-position: inside;
    text-align: left;
    margin: 0 auto;
    width: auto;
  }

  .feature.reverse {
    flex-direction: column !important;
  }
  .feature,
  .feature.reverse {
    flex-direction: column;
    text-align: center;
  }

  .feature .image img {
    transform: none;
    max-width: 100%;
  }

  .modal-gallery .nav {
    display: none;
  }

  #about {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
    width: 100%;
    background-image: url(/image/Jp_mob_1280.png);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
  }

  #cta-r {
    text-align: center;
  }

  #CTA p {
    width: 100%;
    text-align: center;
  }

  #call_to {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  #problem h2 {
    padding-top: 0;
  }

  #problem ul {
    padding-bottom: 5%;
  }

  .hide-mob {
    display: none;
  }

  #Hd {
    width: 80%;
  }

  #about h1 {
    padding-top: 2.5rem;
  }

  .anim {
    opacity: 0;
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
  }

  .anim.visible {
    opacity: 1;
    transform: translate(0, 0);
  }

  .mob_an_l {
    transform: translateX(-3vw);
  }

  .mob_an_r {
    transform: translateX(3vw);
  }

  .text-left {
    transform: translateX(-50px);
    text-align: left;
    width: 70%;
  }

  .image-right {
    transform: translateX(-25px);
  }

  .text-right {
    transform: translateX(80px);
    text-align: right;
  }

  .image-left {
    transform: translateX(-40px);
  }

  .text-center {
    transform: translateX(0px);
    width: 100%;
  }

  .chaotic-3 {
    left: 0;
  }

  .benefits-grid {
    flex-direction: column;
    align-content: center;
  }

  .benefits-grid .benefit:nth-child(n),
  .benefits-grid .benefit * {
    transform: none;
  }

  #p-srv {
    left: 5vw;
    width: 90%;
    text-align: right;
  }

  nav ul li {
    width: auto;
    min-width: 100px;
  }

  #s1,
  #s2,
  #s3 {
    padding-top: 5vw;
    margin-bottom: 5vw;
    margin-top: 5vw;
    width: 50%;
    text-align: left;
  }

  #s1 {
    position: relative;
    left: 5vw;
  }

  #s2 {
    position: relative;
    left: 22vw;
    top: 0vw;
  }

  #s3 {
    position: relative;
    left: 45vw;
    top: 2vw;
    margin-bottom: 20vw;
  }

  #Hd_1 {
    text-align: left;
  }

  #Hd_2 {
    text-align: right;
  }

  .mob_port_txt {
    transform: none;
    width: 90%;
  }
  .mob_port_img {
    transform: none;
  }

  .mob_port_img svg {
    padding: 0;
  }

  .case-title {
    width: 100%;
  }

  .case-4 {
    margin-top: auto;
  }

  .testimonials-list {
    flex-direction: column-reverse;
  }

  .testimonial-1,
  .testimonial-2 {
    transform: none;
  }

  #Contact .container {
    flex-direction: column;
    width: 100vw;
    height: auto;
  }

  .con {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
    align-content: center;
  }

  #Con-Ch1 img,
  #Con-Ch2 img {
    width: 60%;
    transform: none;
  }

  #Con-Tx1,
  #Con-Tx2 {
    transform: none;
  }

  .chaotic-1,
  .chaotic-2,
  .chaotic-3 {
    position: static;
  }

  #Con-Ch1 {
    left: -25%;
  }
  #Con-Ch2 {
    left: 25%;
    top: -7%;
  }
  #Con-Tx2 {
    position: relative;
    left: 50%;
    top: -7%;
  }

  .image-right img {
    position: relative;
  }

  #Con-Ch1 img {
    position: static;
  }

  #Con-Ch2 img {
    position: static;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  #PN {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  nav ul {
    gap: 12px;
    justify-content: center;
  }
  nav ul li a {
    font-size: 17px;
  }

  nav ul li button {
    font-size: 17px;
    padding: 5px 10px;
  }

  h1,
  h2 {
    font-size: 1.8rem; /* Уменьшаем заголовки */
    text-align: center;
  }

  p {
    font-size: 16px; /* Основной текст */
  }

  #hsrv,
  #hcnt {
    position: static;
  }

  #p-srv {
    left: 6vw;
  }

  #portfolio {
    align-content: center;
    flex-direction: column;
  }

  #about h1 {
    padding-bottom: 2rem;
    padding-top: 3rem;
    font-size: 26px;
  }

  #Hd {
    width: 80%;
    color: black;
  }

  #Hd_1 {
    text-align: left;
  }

  #Hd_2 {
    text-align: right;
  }

  #about {
    background-image: url(/image/Jp_tablet.png);
  }

  #cta-r {
    align-items: center;
    gap: 3rem;
  }

  #CTA h3 {
    text-align: center;
  }

  #firstBut {
    font-size: 21px;
  }

  #CTA p {
    width: 80%;
    font-size: 20px;
  }

  #problem ul {
    font-size: 18px;
  }

  .Hleft {
    left: 20vw;
    text-align: right;
    width: 80%;
  }

  .Hright {
    left: -10vw;
    text-align: left;
    width: 80%;
  }

  #prUl1 {
    padding-bottom: 10vw;
  }

  .text-left {
    transform: translateX(-50vw);
    text-align: left;
  }

  .image-right {
    transform: translateX(35vw);
  }

  .text-right {
    transform: translateX(-2vw);
    text-align: right;
  }

  .image-left {
    transform: translateX(5vw);
  }

  .tabl_center {
    flex-direction: column !important;
    width: 100%;
    align-content: center !important;
  }

  .text-center {
    text-align: center;
    width: 100%;
    transform: translateY(5vw);
  }
  .image-center {
    width: 100%;
    height: auto;
    transform: none !important;
    align-content: center !important;
  }

  .feature {
    text-align: center;
  }
  .chaotic-3 {
    position: static;
  }

  .benefits-grid {
    flex-direction: column;
    align-content: center;
  }

  .benefits-grid .benefit:nth-child(n),
  .benefits-grid .benefit * {
    transform: none;
  }

  #s1 {
    position: relative;
    left: 5vw;
  }

  #s2 {
    position: relative;
    left: 22vw;
    top: 0vw;
  }

  #s3 {
    position: relative;
    left: 45vw;
    top: 2vw;
    margin-bottom: 20vw;
  }

  .mob_port_txt {
    transform: none;
    width: 70%;
    text-align: left;
  }
  .mob_port_img {
    transform: none;
    text-align: right;
  }

  .mob_port_img svg {
    padding: 0;
  }

  .case-title {
    width: 100%;
  }

  .case-4 {
    margin-top: auto;
  }

  .testimonials-list {
    flex-direction: column-reverse;
  }

  .testimonial-1,
  .testimonial-2 {
    transform: none;
  }

  .testimonial-1 {
    transform: translateX(-15vw);
  }

  .testimonial-2 {
    transform: translateX(15vw);
  }

  #Con-Tx1 {
    transform: translateX(50vw) translateY(-40vw);
  }

  #Con-Ch2 {
    position: relative;
    top: -90px;
    left: 6vw;
  }

  #Con-Tx2 {
    transform: translateX(-15vw) translateY(-60vw);
  }

  #Contact {
    padding-block: 0;
  }
}

@media (min-width: 1024px) and (max-width: 1460px) {
  h1,
  h2 {
    font-size: 2rem; /* Уменьшаем заголовки */
    text-align: center;
  }

  p {
    font-size: 17px; /* Основной текст */
  }

  #hcnt {
    position: relative;
    text-align: center;
  }

  #hsrv {
    position: relative;
    text-align: left;
    left: 10%;
  }
  nav ul {
    gap: 16px;
  }

  nav ul li button {
    font-size: 1rem;
  }

  #about {
    background-image: url(/image/Jp_note.png);
  }

  .Hleft {
    left: 10vw;
  }

  .text-left {
    transform: translateX(-45vw);
  }
  .image-right {
    transform: translateX(35vw);
  }
  .text-right {
    transform: translateX(5vw);
  }
  .image-left {
    transform: translateX(9vw);
  }
  .text-center {
    transform: translateX(-50vw);
  }
  .chaotic-3 {
    left: 45vw;
  }

  #s1 {
    position: relative;
    left: 5vw;
  }

  #s2 {
    position: relative;
    left: 22vw;
    top: 0vw;
  }

  #s3 {
    position: relative;
    left: 45vw;
    top: 2vw;
    margin-bottom: 20vw;
  }

  .mob_port_txt {
    transform: none;
    width: 50%;
    text-align: left;
  }
  .mob_port_img {
    transform: none;
    text-align: right;
  }

  .mob_port_img svg {
    padding: 0;
  }

  .case-title {
    width: 100%;
  }

  .case-4 {
    margin-top: auto;
  }

  .testimonials-list {
    flex-direction: column-reverse;
  }

  .testimonial-1,
  .testimonial-2 {
    transform: none;
  }

  .testimonial-1 {
    transform: translateX(-15vw);
  }

  .testimonial-2 {
    transform: translateX(15vw);
  }

  .con img {
    width: 90%;
    height: auto;
  }

  #Con-Tx1 {
    transform: translateX(-5vw) translateY(-40vw);
  }

  #Con-Tx2 {
    transform: translateX(28vw) translateY(-30vw);
    text-align: right;
  }

  #Con-Ch1 {
    position: relative;
    top: -5vw;
    left: 20vw;
  }

  #Con-Ch2 {
    position: relative;
    top: 10vw;
    left: -35vw;
    z-index: -1;
  }
}

@media (min-width: 1460px) {
  .text-left {
    transform: translateX(-35vw);
  }
  .image-right {
    transform: translateX(25vw);
  }
  .text-right {
    transform: translateX(5vw);
  }
  .image-left {
    transform: translateX(0vw);
  }
  .text-center {
    transform: translateX(-35vw);
  }
  .chaotic-3 {
    left: 35vw;
  }
  .chaotic-1 {
    top: 0vw;
    left: 20vw;
  }
  #Con-Ch2 {
    top: 5vw;
    left: -25vw;
  }
  #Con-Ch1 {
    top: -5vw;
    left: -15vw;
    z-index: 2;
  }
  #Con-Ch1 img,
  #Con-Ch2 img {
    width: 100%;
    height: auto;
  }
  #Con-Tx1 {
    position: relative;
    left: -10%;
    top: -25%;
  }
  #Con-Tx2 {
    position: relative;
    left: 0%;
    top: -15%;
  }
}
/* Конец адаптива */

/* --- базовые переменные --- */
:root {
  --gap: clamp(12px, 3vmin, 24px);
}

/* Оверлей на весь видимый экран, с учётом панелей браузера */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.6);

  /* vh-фиксы для мобильных */
  height: 100vh; /* фолбэк */
  height: 100svh; /* Android */
  height: 100dvh; /* iOS 15.4+ */

  padding: calc(var(--gap) + env(safe-area-inset-top))
    calc(var(--gap) + env(safe-area-inset-right))
    calc(var(--gap) + env(safe-area-inset-bottom))
    calc(var(--gap) + env(safe-area-inset-left));

  overscroll-behavior: contain;
}

/* Панель модалки — колонка. Контент скроллится внутри, футер всегда виден */
.modal-content {
  box-sizing: border-box;
  width: min(92vw, 900px);
  max-height: calc(
    100dvh - 2 * var(--gap) - env(safe-area-inset-top) -
      env(safe-area-inset-bottom)
  );
  background: #fff;
  border-radius: 16px;
  overflow: hidden; /* режем внутренности, не окно */
  display: flex;
  flex-direction: column;
}

/* Заголовки/описание */
.modal-title {
  padding: 16px 20px 6px;
}
.modal-desc {
  padding: 0 20px 14px;
  color: #444;
}

/* Галерея занимает всё оставшееся место панели */
.modal-gallery {
  position: relative;
  flex: 1 1 auto;
  min-height: 0; /* критично во флексах */
  display: grid;
  grid-template-rows: 1fr;
}

/* Область просмотра скроллится, картинка/пдф центрируются */
.gallery-viewport {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  place-items: center;
  padding: 0 20px 12px;
  min-height: 0;
}

.modal-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.modal-pdf {
  display: none; /* по умолчанию скрыта; покажешь через JS при PDF */
  width: 100%;
  height: 100%;
  border: 0;
}

/* Стрелки — поверх контента, по центру по вертикали */
.modal-gallery .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  pointer-events: auto;
  /* стилизация на твой вкус */
}
.modal-gallery .nav.prev {
  left: 8px;
}
.modal-gallery .nav.next {
  right: 8px;
}

/* Панель инструментов всегда видна внизу панели */
.modal-toolbar {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 10px 14px 12px;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.97),
    rgba(255, 255, 255, 0)
  );
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

/* На тач-устройствах не скрываем контролы */
@media (hover: none) and (pointer: coarse) {
  .modal-toolbar {
    display: flex;
  }
}

/* На случай, если где-то глобально «снимал трансформации» */
.modal-gallery .nav,
.modal-gallery .nav * {
  transform: translateY(-50%) !important;
}

body.modal-open {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
}

/* Форма - новые стили 
-
-
-
-
-
*/

/* ===== СКОУП ТОЛЬКО ДЛЯ ФОРМЫ ===== */
#contactForm {
  --accent: #ff3b3b;
  --text: #111;
  --muted: #6b7280;
  --card: #fff;
  --field: #f7f8fb;
  --bd: #e7e9ee;
  --gap: clamp(12px, 2.4vmin, 20px);
  --label-bg: var(--card);
}

/* Карточка */
#contactForm.form-card.form-elegant {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--bd);
  border-radius: 20px;
  padding: calc(var(--gap) * 1.2);
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}
#contactForm .form-title {
  margin: 0 0 calc(var(--gap) * 0.9);
  font-size: clamp(20px, 3.2vw, 24px);
  line-height: 1.25;
}

/* Сетка */
#contactForm .form-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  #contactForm .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Плавающие лейблы */
#contactForm .fld {
  position: relative;
  margin: 14px 0;
}
#contactForm .fld input,
#contactForm .fld textarea {
  width: 100%;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px solid var(--bd);
  background: var(--field);
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#contactForm .fld label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 6px;
  background: var(--label-bg);
  color: #8a9099;
  font-size: 0.95rem;
  pointer-events: none;
  transition: transform 0.15s, top 0.15s, color 0.15s, font-size 0.15s;
}
#contactForm .fld input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.12);
  background: #fff;
}
#contactForm .fld input:not(:placeholder-shown) + label,
#contactForm .fld input:focus + label {
  top: 0;
  transform: translateY(-50%) scale(0.9);
  font-size: 0.78rem;
  color: #606772;
}

/* Ошибки */
#contactForm .fld :is(input, textarea):invalid {
  border-color: #ff7b7b !important;
  box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.18) !important;
}

/* Кнопка и статус */
#contactForm .form-status {
  min-height: 1.2em;
  margin-top: 8px;
  color: #8a9099;
}
#contactForm .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  margin-top: var(--gap);
  border-radius: 12px;
  font-weight: 600;
  transition: transform 0.06s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: 0 10px 22px rgba(255, 59, 59, 0.25);
}
#contactForm .form-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(255, 59, 59, 0.32);
}
#contactForm .form-submit[disabled] {
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

/* Капча и honeypot */
#contactForm .cf-turnstile {
  margin-top: var(--gap);
  display: flex;
  justify-content: center;
}
#contactForm .honeypot {
  position: absolute;
  left: -9999px;
}
