/* Загальні налаштування */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Roboto', sans-serif;
  background: #e9a1dd;
  color: #333;
  scroll-behavior: smooth;
  line-height: 1.6;
}

/* Header */
header {
  background: linear-gradient(270deg, #2b084d, #502984, #ee6fff, #2b084d);
  background-size: 800% 800%;
  animation: gradientBG 12s ease infinite;
  color: #fff;
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: box-shadow 0.3s ease;
}
header:hover {
  box-shadow: 0 4px 25px rgba(80, 40, 150, 0.7);
}
header img {
  max-width: 200px;
  margin-bottom: 10px;
  animation: float 2s ease-in-out infinite;
  transition: transform 0.3s ease;
}
header img:hover {
  transform: scale(1.1);
}
@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0); }
}
@keyframes gradientBG {
  0%{background-position:0% 50%;}
  50%{background-position:100% 50%;}
  100%{background-position:0% 50%;}
}

/* Навігація */
nav {
  background: #222;
  padding: 10px 0;
  text-align: center;
  position: sticky;
  top: 72px;
  z-index: 1000;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
nav a {
  color: #fff;
  margin: 0 15px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  transition: color 0.3s, text-shadow 0.3s, transform 0.3s;
  display: inline-block;
}
nav a:hover, nav a:focus {
  color: #00ffff;
  text-shadow: 0 0 8px #00ffff;
  outline: none;
  transform: scale(1.1);
}
.nav-education-logo {
  height: 20px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Герой */
.hero {
  background:
    linear-gradient(to right, #502984cc, #aa7ddacc),
    url('https://images.unsplash.com/photo-1527333656061-8a402d0baf72?auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  color: white;
  padding: 110px 20px;
  text-align: center;
  border-radius: 0 0 70px 70px;
  margin-bottom: 60px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.7);
  animation: heroPulse 6s ease-in-out infinite;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  cursor: default;
  transform-style: preserve-3d;
}
.hero:hover {
  transform: scale(1.05) translateZ(20px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.85);
}
.hero h1 {
  font-size: 3.6em;
  margin-bottom: 20px;
  text-shadow: 3px 3px 8px rgba(0,0,0,0.85);
  letter-spacing: 1.3px;
  transform-style: preserve-3d;
}
@keyframes heroPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

/* Заголовки секцій */
.section-title {
  font-size: 2.3em;
  margin-bottom: 30px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: #2b084d;
  font-weight: 900;
  text-shadow: 0 0 6px #502984;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  transform-style: preserve-3d;
}
.section-title:hover {
  transform: scale(1.1) translateZ(15px);
}

/* Секції */
section {
  padding: 55px 25px;
  max-width: 1000px;
  margin: 50px auto;
  background: rgba(255 255 255 / 0.95);
  border-radius: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  cursor: default;
  transform-style: preserve-3d;
}
section:hover {
  transform: translateY(-12px) scale(1.05) translateZ(20px);
  box-shadow: 0 25px 60px rgba(80, 40, 150, 0.45);
}

/* Портфоліо */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 25px;
}
.portfolio-item {
  background: white;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.12);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
  cursor: pointer;
  user-select: none;
  transform-style: preserve-3d;
}
.portfolio-item:hover {
  animation: shadowPulse 2.5s infinite ease-in-out;
  transform: translateY(-14px) scale(1.1) translateZ(25px);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
@keyframes shadowPulse {
  0%, 100% {
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  }
  50% {
    box-shadow: 0 24px 70px rgba(0,0,0,0.45);
  }
}

/* Галерея */
.portfolio-gallery {
  display: flex;
  overflow-x: auto;
  gap: 18px;
  padding-bottom: 12px;
  scroll-behavior: smooth;
  transform-style: preserve-3d;
}
.portfolio-gallery::-webkit-scrollbar {
  height: 10px;
}
.portfolio-gallery::-webkit-scrollbar-thumb {
  background: #00aaff;
  border-radius: 6px;
  box-shadow: inset 0 0 6px #0077bbaa;
}
.portfolio-gallery img {
  max-height: 210px;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(0,0,0,0.18);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
  transform-style: preserve-3d;
}
.portfolio-gallery img:hover {
  transform: scale(1.15) rotate(3deg) translateZ(15px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.38);
}

/* Контейнер для таблиці з горизонтальним скролом */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch; /* плавний скрол для iOS */
  margin-top: 25px;
}

/* Таблиця цін */
.price-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.15em;
  box-shadow: 0 6px 15px rgba(43,8,77,0.18);
  cursor: default;
  transform-style: preserve-3d;
  min-width: 600px; /* мінімальна ширина, щоб не ламалась таблиця */
}
.price-table:hover {
  transform: scale(1.05) translateZ(15px);
  box-shadow: 0 22px 55px rgba(52, 21, 105, 0.45);
}
.price-table th,
.price-table td {
  border: 1px solid #ccc;
  padding: 14px 18px;
  text-align: left;
  white-space: nowrap; /* не переносити текст */
  transition: background 0.3s ease;
}
.price-table th {
  background: #2b084d;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1.3px;
}
.price-table tr:nth-child(even) {
  background: #f7f3fb;
}
.price-table tr:hover {
  background: #dcd0f7;
}

/* Відгуки */
.testimonial {
  background: white;
  padding: 25px;
  border-left: 6px solid #00aaff;
  margin-bottom: 25px;
  font-style: italic;
  box-shadow: 0 3px 10px rgba(0,0,0,0.13);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
  cursor: default;
  transform-style: preserve-3d;
}
.testimonial:focus,
.testimonial:hover {
  box-shadow: 0 0 28px #00aaffcc;
  outline: none;
  transform: scale(1.07) translateY(-8px) translateZ(20px);
}

/* Навчання */
.education-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  cursor: pointer;
  transform-style: preserve-3d;
}
.education-banner:hover {
  transform: scale(1.08) translateY(-7px) translateZ(18px);
  box-shadow: 0 18px 55px rgba(80, 40, 150, 0.42);
}
.education-logo {
  height: 52px;
  animation: float 3s ease-in-out infinite;
  transition: transform 0.4s ease;
  transform-style: preserve-3d;
}
.education-logo:hover {
  transform: scale(1.22) translateZ(30px);
}
.motto {
  font-style: italic;
  color: #502984;
  font-weight: 700;
  text-shadow: 0 0 9px #aa7dda;
  transform-style: preserve-3d;
}

/* Кнопки */
.link-button {
  display: inline-block;
  background: #00aaff;
  color: white;
  padding: 14px 32px;
  margin-top: 20px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 1.05em;
  transition: background 0.35s ease, box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px #00aaffaa;
  cursor: pointer;
  will-change: transform, box-shadow;
  transform-style: preserve-3d;
}
.link-button:hover,
.link-button:focus {
  background: #008ecc;
  outline: none;
  box-shadow: 0 0 38px #0099ffcc, 0 0 48px #00ccff88;
  transform: scale(1.15) translateZ(15px);
  animation: buttonPulse 2.8s infinite ease-in-out;
}

/* Пульсація кнопки */
@keyframes buttonPulse {
  0%, 100% {
    box-shadow: 0 0 38px #0099ffcc, 0 0 48px #00ccff88;
  }
  50% {
    box-shadow: 0 0 55px #00aaffee, 0 0 65px #00ddffbb;
  }
}

/* Ефект пульсації кнопки */
@keyframes pulseAnim {
  0%, 100% {
    box-shadow: 0 0 10px #00aaff99;
  }
  50% {
    box-shadow: 0 0 20px #00aaffcc;
  }
}
.pulse {
  animation: pulseAnim 2.5s infinite ease-in-out;
}

/* Контакти */
#contact a {
  color: #2b084d;
  text-decoration: underline;
  transition: color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  transform-style: preserve-3d;
}
#contact a:hover,
#contact a:focus {
  color: #502984;
  transform: scale(1.1) translateZ(12px);
}

/* --- Адаптивність --- */

/* Планшети */
@media (max-width: 900px) {
  .price-table th, .price-table td {
    padding: 10px 12px;
    font-size: 1em;
  }
  .section-title {
    font-size: 1.8em;
  }
  .hero h1 {
    font-size: 2.8em;
  }
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

/* Телефони */
@media (max-width: 600px) {
  .table-wrapper {
    margin-top: 20px;
  }
  .price-table {
    font-size: 0.9em;
  }
  .price-table th,
  .price-table td {
    padding: 8px 10px;
  }
  .section-title {
    font-size: 1.4em;
    margin-bottom: 20px;
  }
  .hero {
    padding: 70px 15px;
  }
  .hero h1 {
    font-size: 2em;
  }
  nav a {
    margin: 0 8px;
    font-size: 1em;
  }
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .portfolio-item {
    padding: 12px;
    font-size: 0.9em;
  }
  .link-button {
    padding: 10px 20px;
    font-size: 0.95em;
  }
}
