/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size */
}

body {
  font-family: "Ysabeau Infant", "Century Gothic", CenturyGothic, Geneva,
    AppleGothic, sans-serif;
  line-height: 1.2;
}

/* Header styles */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  padding: 15px 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.nav-container {
  display: flex;
  width: 20%;
  align-items: center;
  justify-content: center;
}

.logo {
  height: 40px;
  width: auto;
}

nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  width: 60%;
}

nav a {
  text-decoration: none;
  color: #222222;
  font-weight: 500;
  transition: color 0.3s;
  font-size: 1rem;
}

nav a:hover {
  color: #007bff;
}

.lammin-koti {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.lammin-koti h3 {
  font-weight: 500;
  font-size: 1.5rem;
  margin-bottom: 0.125rem;
  color: #000000;
}

.lammin-koti p {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.0625rem;
  color: #272727;
  font-weight: normal;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.logo-text {
  display: none;
}
.feedback-button {
  font-weight: 500;
  display: inline-block;
  padding: 0.625rem 1.25rem; /* 10px 20px */
  background-color: #94bdc7;
  color: white;
  text-decoration: none;
  border-radius: 0.3125rem; /* 5px */
  transition: background-color 0.3s;
  font-size: 1rem; /* 16px */
}

.feedback-button:hover {
  background-color: #397786;
}

/* Hero section */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

main.hero {
  width: 100%;
  height: 100vh;
  background-image: url("static/img/image3.jpg");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: flex-start;
  padding: 10%;
  align-items: center;
  position: relative;
  color: white;
  text-align: center;
}

main.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  z-index: 0;
}

.hero-text {
  color: #000000;
  position: relative;
  z-index: 1;
  max-width: 50rem; /* 800px */
  padding: 1.25rem; /* 20px */
  background-color: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 0.625rem; /* 10px */
  -webkit-border-radius: 0.625rem;
  -moz-border-radius: 0.625rem;
  -ms-border-radius: 0.625rem;
  -o-border-radius: 0.625rem;
}

.hero-text h1 {
  color: #397786;
  text-align: start;
  font-weight: 500;
  font-stretch: narrower;
  font-size: 1.8rem; /* 20px */
  margin-bottom: 1.25rem; /* 20px */
  text-transform: uppercase;
}

.hero-text .subtitle {
  text-align: start;
  font-size: 1.5rem; /* 10px */
  margin-bottom: 1.25rem; /* 20px */
  font-weight: 300;
}

.hero-text .description {
  text-align: start;
  font-size: 1.2rem; /* 10px */
  margin-bottom: 1.875rem; /* 30px */
  line-height: 1.2;
}

.hero-buttons {
  display: flex;
  gap: 1.25rem; /* 20px */
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.875rem; /* 12px 30px */
  border-radius: 0.3125rem; /* 5px */
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  text-shadow: none;
  font-size: 1rem; /* 16px */
}

.btn-primary {
  background-color: #94bdc7;
  color: white;
}

.btn-primary:hover {
  background-color: #397786;
}

.btn-secondary {
  background-color: transparent;
  color: white;
  border: 0.125rem solid white; /* 2px */
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Container styles */
.container,
.container-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem; /* 20px */
}

.container h2,
.container-profile h2 {
  margin: 0.625rem 0; /* 10px */
  font-weight: 500;
  font-size: 1.5rem; /* 24px */
}

.features {
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.features-wrapper {
  width: 100%;
  padding: 5rem 0; /* 80px */
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.875rem; /* 30px */
  margin-top: 2.5rem; /* 40px */
}

.feature-card {
  /* дефолтные переменные: scale и translateY */
  --s: 1;
  --ty: 0px;

  transform: scale(var(--s)) translateY(var(--ty));
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* остальные правила, если нужны */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f8f8f8;
  padding: 1.875rem;
  border-radius: 0.5rem;
}

.feature-card.hovered,
.feature-card:hover {
  --ty: -6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.feature-card-img {
  margin: 0.625rem 0; /* 10px */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #94bdc7;
  padding: 0.625rem; /* 10px */
  width: 4.5rem; /* 72px */
  height: 4.5rem; /* 72px */
  border-radius: 50%;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  -ms-border-radius: 50%;
  -o-border-radius: 50%;
}

.feature-card img {
  width: 60%;
  height: 60%;
}

.feature-card h3 {
  font-weight: 500;
  font-size: 1.125rem; /* 18px */
  margin: 1.25rem 0; /* 20px */
}

.expertise {
  padding: 5rem 0; /* 80px */
}

.expertise-content {
  margin-top: 3.75rem; /* 60px */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem; /* 40px */
  align-items: start;
}

.expertise-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.rounded-img {
  width: 100%;
  max-width: 31.25rem; /* 500px */
  border-radius: 0.75rem; /* 12px */
  object-fit: cover;
}

.expertise-text {
  max-width: 43.75rem; /* 700px */
}

.expertise-text h2 {
  margin-bottom: 1.25rem; /* 20px */
  font-size: 1.5rem; /* 24px */
}

.expertise-text p {
  margin-bottom: 0.9375rem; /* 15px */
  line-height: 1.6;
  font-size: 1rem; /* 16px */
}

.expertise-text ul {
  margin-top: 1.25rem; /* 20px */
  padding-left: 1.25rem; /* 20px */
}

.expertise-text ul li {
  margin-bottom: 0.5rem; /* 8px */
  line-height: 1.6;
  font-size: 1rem; /* 16px */
}

.services {
  padding: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background-color: #f8f8f8;
}

.services-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 1.25rem; /* 20px */
}

.services-container h2 {
  font-weight: 500;
  padding-bottom: 0.625rem; /* 10px */
  font-size: 1.5rem; /* 24px */
}

.services-container p {
  padding-bottom: 0.625rem; /* 10px */
  font-size: 1rem; /* 16px */
}

.services-wrapper {
  width: 100%;
  padding: 5rem 0; /* 80px */
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(390px, 100%), 1fr));
  gap: 1.875rem; /* 30px */
  margin: 0 6.25rem; /* 100px */
  margin-top: 2.5rem; /* 40px */
  justify-content: center;
}

.services-card {
  --s: 1;
  --ty: 0px;

  transform: scale(var(--s)) translateY(var(--ty));
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background-color 0.3s ease;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  background: #ffffff;
  padding: 1.875rem; /* 30px */
  border-radius: 0.5rem; /* 8px */
  height: 15rem; /* 240px */
  cursor: pointer;
  position: relative;
}

.services-card.active {
  --ty: -6px;
  background-color: #f0f0f0;
  z-index: 20;
}
.services-card.hovered,
.services-card:hover {
  --ty: -6px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  background-color: #f0f0f0;
}

.services-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #94bdc7;
  width: 2.1875rem; /* 35px */
  height: 2.1875rem; /* 35px */
  border-radius: 0.625rem; /* 10px */
  -webkit-border-radius: 0.625rem;
  -moz-border-radius: 0.625rem;
  -ms-border-radius: 0.625rem;
  -o-border-radius: 0.625rem;
}

.services-card img {
  width: 50%;
  height: 50%;
}

.services-card p {
  font-weight: 500;
  margin-top: 0.625rem; /* 10px */
  font-size: 1rem; /* 16px */
}

.services-card.active .service-details {
  max-height: 15.625rem; /* 250px */
  opacity: 1;
}

.service-details {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out;
  box-shadow: 8px 4px 8px -8px rgba(0, 0, 0, 0.1),
    -8px 4px 8px -8px rgba(0, 0, 0, 0.1), 0 8px 16px -8px rgba(0, 0, 0, 0.1);
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #f0f0f0;
  z-index: 9999;
  padding: 0.9375rem 3.125rem; /* 15px 50px */
  margin-top: -1.25rem; /* -20px */
  border-radius: 0 0 0.625rem 0.625rem;
  -webkit-border-radius: 0 0 0.625rem 0.625rem;
  -moz-border-radius: 0 0 0.625rem 0.625rem;
  -ms-border-radius: 0 0 0.625rem 0.625rem;
  -o-border-radius: 0 0 0.625rem 0.625rem;
  -webkit-transition: max-height 0.3s ease-out;
  -moz-transition: max-height 0.3s ease-out;
  -ms-transition: max-height 0.3s ease-out;
  -o-transition: max-height 0.3s ease-out;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(3.125rem); /* 50px */
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-up.animate {
  opacity: 1;
  transform: translateY(0);
}

.card-fade-in {
  opacity: 0;
  /* немного уменьшенный масштаб до появления */
  --s: 0.95;
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

/* когда элемент попал в зону видимости — увеличиваем scale и показываем */
.card-fade-in.animate {
  opacity: 1;
  --s: 1;
}

.nav-container.mobile-hamburger {
  display: none;
  width: auto; /* чтобы не занимать место, когда станет visible */
  justify-content: center;
  align-items: center;
}

/* Mobile menu styles */
.mobile-menu {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 1rem 0;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a {
  text-decoration: none;
  color: #222222;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem;
  transition: color 0.3s;
  width: 100%;
  text-align: center;
}

.mobile-menu a:hover {
  color: #007bff;
}

.hamburger {
  display: flex;
  width: 30px;
  height: 30px;
  position: relative;
  padding: 0;
  border: none;
  background: transparent;
}

.hamburger span {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  width: 24px;
  height: 3px;
  background: #222;
  transform-origin: center;
  transition: transform 0.25s ease, opacity 0.2s linear;
  border-radius: 2px;
  box-sizing: border-box;
  transform: translate3d(-50%, -50%, 0);
}

/* смещаем только с помощью top (приближённо симметрично) */
.hamburger span:nth-child(1) {
  transform: translate3d(-50%, -50%, 0) translateY(-9px);
}
.hamburger span:nth-child(2) {
  transform: translate3d(-50%, -50%, 0);
}
.hamburger span:nth-child(3) {
  transform: translate3d(-50%, -50%, 0) translateY(9px);
}

/* активное состояние — все центрируем и поворачиваем */
.hamburger.active span:nth-child(1) {
  transform: translate3d(-50%, -50%, 0) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: translate3d(-50%, -50%, 0) scaleX(0.1);
}
.hamburger.active span:nth-child(3) {
  transform: translate3d(-50%, -50%, 0) rotate(-45deg);
}

@media (min-width: 1661px) {
  .services-grid {
    grid-template-columns: repeat(4, minmax(329px, 390px));
    justify-content: space-between;
  }
}

@media (max-width: 1660px) and (min-width: 1296px) {
  .services-grid {
    grid-template-columns: repeat(3, minmax(329px, 390px));
    justify-content: space-between;
  }
}

/* Responsive styles */
@media (max-width: 1295px) and (min-width: 820px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .services-grid {
    grid-template-columns: repeat(2, minmax(329px, 390px));
    justify-content: space-between;
  }
}

@media (max-width: 1026px) {
  nav {
    width: 70%;
  }
  .nav-container {
    width: 14%;
  }
  .feedback-button {
    padding: 0.5rem 0.5rem;
    font-size: 1.2vw;
  }
  nav a {
    font-size: 1.6vw;
  }
  .lammin-koti a {
    font-size: 1.8vw;
  }
  .lammin-koti h3 {
    font-size: 2.3vw;
  }
}

@media (max-width: 819px) {
  header {
    padding: 5px 0;
  }
  .header-content {
    padding: 0 1rem; /* 16px */
  }

  /* Скрываем боковые контейнеры логотипа/кнопок в мобилке (ваше текущее поведение) */
  .nav-container:nth-child(3),
  .nav-container:nth-child(4),
  .nav-container:last-child {
    display: none;
  }
  .logo-text {
    display: flex;
  }
  .lammin-koti {
    width: 70%;
  }
  .lammin-koti h3 {
    font-size: 1rem;
  }

  /* nav скрываем — мобильное меню будет управляться бургером */
  nav {
    display: none;
    width: 100%;
    justify-content: flex-start;
  }

  /* Показываем контейнер с бургером в мобильном медиазапросе (меняем display:none выше) */
  .nav-container.mobile-hamburger {
    display: flex;
    width: auto;
    justify-content: center;
    align-items: center;
  }

  .hamburger {
    display: flex;
  }

  .hero-text h1 {
    font-size: 1.5625rem; /* 25px */
  }

  .hero-text .subtitle {
    font-size: 1.2rem; /* 12px */
  }

  .hero-text .description {
    font-size: 1rem; /* 10px */
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem; /* 20px */
  }

  .expertise-content {
    grid-template-columns: 1fr;
    gap: 1.25rem; /* 20px */
  }

  .services-grid {
    grid-template-columns: repeat(1, minmax(329px, 390px));
    margin: 0 1rem; /* 16px */
    justify-content: center;
  }

  .services-card {
    height: auto;
    min-height: 12.5rem; /* 200px */
  }

  .fade-in-up {
    transform: translateY(2.5rem); /* 40px */
  }
}

@media (max-width: 480px) {
  main.hero {
    padding: 5%;
  }
  .hero-text {
    padding: 1rem; /* 16px */
  }

  .hero-text h1 {
    font-size: 1.5625rem; /* 25px */
  }

  .hero-text .subtitle {
    font-size: 1.2rem; /* 12px */
  }

  .hero-text .description {
    font-size: 1rem; /* 10px */
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 18.75rem; /* 300px */
    text-align: center;
  }

  .feature-card {
    padding: 1.25rem; /* 20px */
  }

  .feature-card h3 {
    font-size: 1rem; /* 16px */
  }

  .container h2,
  .container-profile h2 {
    font-size: 1.25rem; /* 20px */
  }

  .services-container h2 {
    font-size: 1.25rem; /* 20px */
  }
  .services-grid {
    margin: 0 1rem; /* 16px */
  }
  nav * {
    font-size: 0.875rem; /* 14px */
  }
}

/* Стили для модального окна */
.modal-overlay {
  display: none; /* Скрыто по умолчанию */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
  backdrop-filter: blur(5px); /* Блюр фона */
  -webkit-backdrop-filter: blur(5px);
  z-index: 2000; /* Высокий z-index для отображения поверх всего */
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #aaa;
}

.close-button:hover {
  color: #000;
}

#feedbackModal h2 {
  font-weight: 500;
  font-family: "Ysabeau Infant", "Century Gothic", CenturyGothic, Geneva,
    AppleGothic, sans-serif;
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: #333;
  text-align: center;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 400;
  font-family: "Ysabeau Infant", "Century Gothic", CenturyGothic, Geneva,
    AppleGothic, sans-serif;
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 0.25rem;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
}

.error-message {
  color: red;
  font-size: 0.875rem;
  display: block;
  margin-top: 0.25rem;
}

#feedbackForm button {
  width: 100%;
  padding: 0.75rem;
  background-color: #94bdc7;
  color: white;
  border: none;
  border-radius: 0.25rem;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

#feedbackForm button:hover {
  background-color: #397786;
}
