/* ===== Основные стили ===== */
html {
  scroll-padding-top: 100px;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  font-family: Inter, sans-serif;
  color: white;
  overflow-x: hidden;
  position: relative;
  z-index: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6); /* Тень для читаемости текста */
}

/* ===== Млечный путь градиент ===== */
body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg,
    #1a0f3b, #3c2f6b, #5a3de8, #3b5f9e, #7ec0ee, #d4b3f2
  );
  background-size: 400% 400%;
  animation: gradientShimmer 10s ease-in-out infinite;
  z-index: -3;
}

/* Overlay для контраста текста */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35); /* тёмный слой для читаемости */
  z-index: -2;
  pointer-events: none;
}

@keyframes gradientShimmer {
  0% { background-position: 0% 50%; }
  25% { background-position: 70% 60%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 70% 40%; }
  100% { background-position: 0% 50%; }
}

/* ===== Световые пятна ===== */
.glow {
  position: fixed;
  top: -250px;
  left: -250px;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 70%);
  filter: blur(250px);
  animation: glowMove 18s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
}

@keyframes glowMove {
  0% { transform: translate(0px,0px) scale(1); }
  50% { transform: translate(220px,180px) scale(1.2); }
  100% { transform: translate(0px,0px) scale(1); }
}

/* ===== Хедер ===== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(12px);
  padding: 0 20px;
  z-index: 1000;
}

.logo img { height: 36px; }

/* ===== Меню ===== */
nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  overflow-x: auto;
  max-width: calc(100% - 60px);
  padding-bottom: 5px;
}

nav::-webkit-scrollbar { display: none; }

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 6px;
  transition: 0.3s;
}

nav a:hover {
  background: rgba(255,255,255,0.15);
}

/* ===== Бургер ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  z-index: 1001;
  width: 36px;
  height: 28px;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: white;
  margin: 4px 0;
  border-radius: 3px;
  transition: 0.3s;
}

.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px,5px);
}

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

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px,-5px);
}

/* ===== Контент ===== */
main { padding-top: 120px; }

.section {
  padding: 80px 20px;
  text-align: center;
}

.about {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  margin: auto;
}

/* ===== Фото ===== */
.photo {
  width: 220px;
  border-radius: 12px;
  transition: transform 0.35s ease;
}

.photo:hover {
  transform: scale(1.08);
}

/* ===== Карточки ===== */
.card {
  background: rgba(255,255,255,0.08);
  padding: 28px;
  border-radius: 14px;
  margin: 20px auto;
  max-width: 900px;
  backdrop-filter: blur(6px);
  transition: 0.35s;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.35);
}

/* ===== Кнопки ===== */
.button {
  display: inline-block;
  padding: 12px 22px;
  background: rgba(70,130,180,0.8);
  border-radius: 8px;
  color: white;
  text-decoration: none;
  transition: 0.3s;
}

.button:hover {
  background: white;
  color: black;
  transform: scale(1.05);
}

/* ===== Навыки ===== */
.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 900px;
  margin: 20px auto;
}

.skill {
  background: rgba(255,255,255,0.15);
  padding: 10px 16px;
  border-radius: 8px;
}

/* ===== Сетка ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(200px,1fr));
  gap: 18px;
  max-width: 900px;
  margin: auto;
}

.recommendation { max-width: 520px; }

/* ===== Кнопки Linux/SQL/API ===== */
.button-card-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 20px auto;
  max-width: 900px;
}

.button-card {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 18px;
  background: rgba(255,255,255,0.15);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.3s;
  min-width: 140px;
}

.button-card:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

/* ===== Контакты ===== */
.contacts-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 30px 0;
}

.contacts-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255,255,255,0.08);
  padding: 16px 20px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  transition: 0.3s;
  cursor: pointer;
  width: 100%;
  max-width: 550px;
  box-sizing: border-box;
  margin: 0 auto;
}

.contact-card:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-2px);
}

.contact-card a,
.contact-card a:visited,
.contact-card a:active {
  color: white;
  text-decoration: none;
}

.contact-card a:hover {
  color: white;
  text-decoration: underline;
}

/* ===== Reveal анимация ===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.7s ease;
}

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

/* ===== Футер ===== */
footer {
  padding: 25px 20px;
  background: rgba(0,0,0,0.4);
  text-align: center;
  font-size: 0.9em;
}

/* ===== Кнопка вверх ===== */
.top {
  text-align: center;
  margin: 30px 0;
}

.top a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 10px 18px;
  background: rgba(255,255,255,0.15);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: 0.3s;
}

.top a:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

/* ===== COOKIE BANNER ===== */
.cookie-banner{
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 900px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 10px 35px rgba(0,0,0,0.35);
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transition: 0.4s;
}

.cookie-banner.show{
  opacity: 1;
  pointer-events: auto;
}

.cookie-content{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

.cookie-content a{
  color: white;
  text-decoration: underline;
}

.cookie-banner .button-card{
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  min-width: 140px;
  cursor: pointer;
  transition: 0.3s;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.cookie-banner .button-card:hover{
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

/* ===== Мобильная версия ===== */
@media(max-width:768px){

  .menu-toggle { display: flex; }

  nav {
    position: fixed;
    top: 70px;
    right: 0;
    min-width: 160px;
    max-width: 220px;
    background: rgba(0,0,0,0.35);
    flex-direction: column;
    padding: 10px 15px;
    gap: 12px;
    transform: translateX(100%);
    transition: 0.3s;
  }

  nav.active { transform: translateX(0); }

  .about { flex-direction: column; }

  .photo {
    width: 180px;
    margin-bottom: 20px;
  }

  .button-card {
    width: 100%;
    min-width: unset;
  }

  .top a { width: 90%; }

  .contact-card {
    width: 90%;
    flex-direction: column;
    text-align: center;
  }

  .cookie-content{
    flex-direction: column;
    text-align: center;
  }

  .cookie-content .button-card{
    width: 100%;
  }
}
