/* Общие стили */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #333;
    background: #003F9E;
}

/* Обёртка для контента */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0px; /* Отступы по бокам, если нужно */
}

/* Шапка сайта */
header {
    background: #003F9E;
    padding: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-wrapper {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    background: #003F9E;
}

.logo-text-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    opacity: 0;
    animation: fadeInContent 1s forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInContent {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Стили для логотипа с фиксированными размерами */
.logo {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.square {
    position: absolute;
    width: 35px;
    height: 35px;
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.3);
}

/* Анимация появления и вращения для квадратов */
.square:nth-child(1) {
    background-color: #FFD500;
    top: 0;
    left: 0;
    animation: squareAppear 1.2s forwards 0.2s;
}
.square:nth-child(2) {
    background-color: #00BFFF;
    top: 0;
    right: 0;
    animation: squareAppear 1.2s forwards 0.4s;
}
.square:nth-child(3) {
    background-color: #FF00FF;
    bottom: 0;
    left: 0;
    animation: squareAppear 1.2s forwards 0.6s;
}
.square:nth-child(4) {
    background-color: #000000;
    bottom: 0;
    right: 0;
    animation: squareAppear 1.2s forwards 0.8s;
}

@keyframes squareAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(360deg);
    }
}



/* Стили для текста и меню */
.header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: center;
}
.header-text h1 {
    margin: 0;
    color: white;
    opacity: 0;
    animation: textFadeIn 2s forwards;
    animation-delay: 0.7s;
}


@keyframes textFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Меню */
.header-menu {
    width: 100%;
    margin-top: clamp(8px, 1vw, 15px);
    text-align: center;
    opacity: 0;
    animation: fadeInMenu 1s forwards;
    animation-delay: 0.9s;
}

.header-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 20px;
}

.header-menu a {
    text-decoration: none;
    color: #00CCFF;
    font-size: clamp(16px, 1.5vw, 20px);
    transition: color 0.3s, transform 0.3s;
    white-space: nowrap;
}

.header-menu a:hover {
    color: yellow;
    transform: scale(1.1);
}

.header-menu a:active {
    transform: scale(0.95);
}

@keyframes fadeInMenu {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Общие стили для ссылок */
a {
    text-decoration: none;
    color: #333;
}

/* Секция "О нас" */
.about {
    position: relative;
    /* background: #fff; */
    padding: 40px 20px;
    text-align: center;
}

.about h2 {
    margin-top: 0;
}

/* Параграф с анимацией появления из центра через расширение clipping-круга */
.about p {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    color: #003078;
    position: relative;
    overflow: hidden;
    clip-path: circle(0% at 50% 50%);
    animation: revealText 2s ease-out forwards;
    animation-delay: 1.5s;
    font-size: 16px;
    white-space: normal; /* разрешаем перенос строк */
}
@keyframes revealText {
    from { clip-path: circle(0% at 50% 50%); }
    to { clip-path: circle(150% at 50% 50%); }
}


/* Секция "Услуги" */
.services {
 /*   background: #e9e9e9;   */
    padding: 40px 20px;
}

.services h2 {
    text-align: center;
    margin-top: 0;

    opacity: 0;
    /* стартуем чуть выше */
    transform: translateY(-24px) scale(1.1);
    filter: blur(12px) brightness(0.8) drop-shadow(0 2px 12px rgba(131, 123, 231, 0.67));
    animation: fadeInFromTop 0.9s cubic-bezier(.27,1.19,.56,1) 2s forwards;
}
@keyframes fadeInFromTop {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0) brightness(1) drop-shadow(0 2px 22px rgba(183, 176, 253, 0.93));
    }
}

.services-list {
    max-width: 900px;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}

.service-item {
    background-color: rgba(255, 255, 255, 0.5);
    width: 45%;
    margin: 10px 0;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 6px;
	box-shadow: 0 2px 16px 0 rgba(120, 97, 170, 0.07);
	opacity: 0;
      transform: scale(0.95);
      /* По умолчанию — подстраховка */
      animation: fadeInTop 1.05s cubic-bezier(.6,.13,.5,1.05) forwards;
      animation-delay: 3.3s; 
}
.service-item h3 {
    margin-top: 0;
    font-size: 18px;
}
.service-item p {
    line-height: 1.6;
}

/* Разные направления через nth-child */
.service-item:nth-child(1) {
    animation-name: fadeInLeft;
    animation-delay: 3.1s;
}
.service-item:nth-child(2) {
    animation-name: fadeInRight;
    animation-delay: 3.35s;
}
.service-item:nth-child(3) {
    animation-name: fadeInTop;
    animation-delay: 3.65s;
}
.service-item:nth-child(4) {
    animation-name: fadeInBottom;
    animation-delay: 3.15s;
}
.service-item:nth-child(5) {
    animation-name: fadeInDiag1;
    animation-delay: 3.5s;
}
.service-item:nth-child(6) {
    animation-name: fadeInDiag2;
    animation-delay: 3.25s;
}
/* повторяем или варьируем дальше, если контейнеров больше */

/* Ключевые кадры для разных направлений */
@keyframes fadeInLeft {
    0% { opacity: 0; transform: translateX(-55px) scale(0.92); }
    80% { opacity: 1; transform: translateX(8px) scale(1.04); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes fadeInRight {
    0% { opacity: 0; transform: translateX(65px) scale(0.92); }
    80% { opacity: 1; transform: translateX(-8px) scale(1.04); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes fadeInTop {
    0% { opacity: 0; transform: translateY(-60px) scale(0.92); }
    80% { opacity: 1; transform: translateY(8px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeInBottom {
    0% { opacity: 0; transform: translateY(60px) scale(0.92); }
    80% { opacity: 1; transform: translateY(-8px) scale(1.04); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeInDiag1 {
    0% { opacity: 0; transform: translate(-60px, -38px) scale(0.89);}
    80% { opacity: 1; transform: translate(7px,4px) scale(1.04);}
    100% { opacity: 1; transform: translate(0,0) scale(1);}
}
@keyframes fadeInDiag2 {
    0% { opacity: 0; transform: translate(60px, 40px) scale(0.91);}
    80% { opacity: 1; transform: translate(-7px,-4px) scale(1.04);}
    100% { opacity: 1; transform: translate(0,0) scale(1);}
}


.header3 {
    display: flex;
    /* align-items: center; */
    margin-bottom: 25px;
}
.header3 img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    object-position: top;
    margin-right: 20px;
}
.header3 h1 {
    font-size: 24px;
    margin: 0;
    color: #000;
}




/* Секция "Контакты" */

.contact-table {
  border-collapse: collapse;
  font-size: 16px;
  color: #333;
  width: auto; /* Можно, если ты не хочешь растягивать на 100% */
}
.contact-table td {
  padding: 0 0 20px 0;  
  vertical-align: top;
}
.contact-table td.label {
  font-weight: bold;
  color: #444;
  white-space: nowrap; /* Не переносим и даём колонке сжаться до текста */
  padding-right: 10px;   /* маленький зазор между колонками */
}
.contact-table a {
  color: #333;
  text-decoration: none;
}
.contact-table a:hover {
  text-decoration: underline;
}

.contacts {
    background: #fff;
    padding: 40px 20px 10px 20px;
}

.contacts h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom :-20px;
}

/* Подвал */
footer {
    background: #ccc;
    padding: 20px;
    text-align: center;
    font-size: 14px;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    nav ul {
        display: block;
    }
    nav li {
        display: block;
        margin: 5px 0;
    }
    .services-list {
        flex-direction: column;
        align-items: center;
    }
    .service-item {
        width: 90%;
    }
}


#services {
  position: relative; /* Чтобы потом позиционировать canvas внутри секции */
  overflow: hidden;   /* По желанию, чтобы лишние части canvas не выходили за пределы */
}

#bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* Фон позади остального содержимого */
}

#bannerCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* чтобы на него можно было накладывать другие элементы */
}

