/* === БАЗОВЫЕ НАСТРОЙКИ === */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem;
  line-height: 1.8;
  background-color: #1e1e2f;
  color: #e0e0e0;
  scroll-behavior: smooth;
  position: relative;
  z-index: 1;
}

/* === КНОПКА НАВЕРХ === */
#scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #ffcc00;
  color: #1e1e2f;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.3s;
}

#scroll-top-btn:hover {
  background-color: #e6b800;
  transform: scale(1.1);
}

/* === Заголовки с иконками === */
h2::before {
  content: attr(data-icon);
  display: inline-block;
  font-size: 1.4rem;
  color: #ffcc00;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Фоновая анимация на canvas */
#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

/* === HEADER И НАВИГАЦИЯ === */
header {
  background-color: #1e1e2f;
  padding: 0;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.nav-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 769px) {
  .nav-wrapper {
    position: sticky;
    top: 0;
    background-color: #1e1e2f;
    z-index: 1000;
  }
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  max-width: calc(100vw - 40px);
}

nav a {
  text-decoration: none;
  color: #bbb;
  font-weight: bold;
  transition: all 0.3s ease;
  padding: 8px 12px;
  border-radius: 6px;
}

nav a:hover,
nav a.active {
  background-color: #2f2f4a;
  color: #fff;
}

/* === БУРГЕР-МЕНЮ === */
.burger {
  position: fixed;
  top: 16px;
  right: 8px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2000;
  padding: 0;
  display: none;
  box-sizing: border-box;
}

.burger svg {
  width: 100%;
  height: 100%;
  fill: #fff;
  transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    position: fixed;
    top: 64px;
    right: 12px;
    background-color: #2f2f4a;
    padding: 20px;
    border-radius: 10px;
    display: none;
    z-index: 1001;
    max-width: 90vw;
    box-sizing: border-box;
  }

  nav ul.show {
    display: flex;
  }

  .burger {
    display: block;
  }
}

/* === ОСНОВНОЙ КОНТЕНТ === */
main {
  padding: 40px 20px;
  max-width: 960px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

section {
  margin-bottom: 60px;
  scroll-margin-top: 100px;
}

h2 {
  font-size: 2rem;
  margin-bottom: 24px;
  border-left: 4px solid #ffcc00;
  padding-left: 12px;
  color: #ffcc00;
  font-weight: 600;
}

h3 {
  font-size: 1.4rem;
  color: #ffcc00;
  margin-bottom: 8px;
  font-weight: 600;
}

p {
  margin-bottom: 1.2em;
  color: #ddd;
}

ul {
  list-style: none;
  padding-left: 24px;
  margin-bottom: 1.5em;
}

ul li {
  margin-bottom: 0.6em;
  position: relative;
  padding-left: 12px;
}

ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background-color: #ffcc00;
  border-radius: 50%;
}

/* === СЕКЦИЯ ABOUT === */
#about {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
}

#about h1 {
  font-size: 3.2rem;
  margin: 16px 0 8px;
  color: #ffcc00;
}

#about .subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  color: #66d9ef;
  margin-bottom: 20px;
}

#about p {
  max-width: 800px;
  font-size: 1.125rem;
  color: #ccc;
}

.photo-container {
  margin-bottom: 16px;
}

.profile-photo {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #ffcc00;
  box-shadow: 0 0 20px rgba(255, 204, 0, 0.5);
  transition: transform 0.3s ease;
}
.profile-photo:hover {
  transform: scale(1.05);
}
@media (min-width: 769px) {
  .profile-photo {
    max-width: 600px;
  }
}

/* === ОПЫТ РАБОТЫ === */
.experience-entry h3 {
  font-size: 1.7rem;
  color: #ffcc00;
  margin-bottom: 6px;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.6);
  animation: fadeInGlow 1s ease-in-out both;
}

.experience-entry .position {
  font-size: 1.3rem;
  color: #66d9ef;
  margin-bottom: 14px;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(102, 217, 239, 0.5);
  animation: fadeInGlow 1s ease-in-out both;
}

/* Анимация появления и свечения */
@keyframes fadeInGlow {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}


/* === СЕРТИФИКАТЫ === */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cert-item {
  display: block;
  text-align: center;
  background-color: #2b2b40;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: inherit;
}

.cert-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(255, 204, 0, 0.4);
}

.cert-item img {
  width: 100%;
  height: auto;
  border-radius: 5px;
  margin-bottom: 8px;
}

/* === КОНТАКТЫ === */
.contacts-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
}

.contacts-list li {
  display: flex;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s;
}

.contact-link:hover {
  color: #fff;
}

.contact-link svg {
  width: 32px;
  height: 32px;
  fill: #ffcc00;
  flex-shrink: 0;
}

/* === FOOTER === */
footer {
  text-align: center;
  padding: 40px 20px 20px;
  background-color: #1e1e2f;
  color: #999;
}

/* === АНИМАЦИЯ ПОЯВЛЕНИЯ === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.achievement-card {
  background-color: #2b2b40;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(255, 204, 0, 0.2);
  border-left: 4px solid #ffcc00;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.achievement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(255, 204, 0, 0.4);
}

.achievement-card svg {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  fill: #ffcc00;
}

.achievement-card p {
  margin: 0;
  color: #e0e0e0;
  font-weight: 500;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .cert-item {
    padding: 8px;
    border-radius: 8px;
  }

  .cert-item img {
    border-radius: 4px;
    margin-bottom: 6px;
  }

  .cert-item p {
    font-size: 0.9rem;
  }

  .cert-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
  }
}

.about-text {
  max-width: 800px;
  background-color: rgba(255, 255, 255, 0.02);
  border-left: 4px solid #ffcc00;
  padding: 24px;
  border-radius: 12px;
  font-size: 1.05rem;
  color: #cccccc;
  box-shadow: 0 0 10px rgba(255, 204, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.about-text:hover {
  box-shadow: 0 0 14px rgba(255, 204, 0, 0.1);
}

.about-text p {
  margin-bottom: 1.2em;
  line-height: 1.8;
  text-align: justify;
}

#about h2::before {
  content: "🧑‍💻";
  margin-right: 0.5rem;
}

.explosion-particle {
  position: fixed;
  font-size: 1.2rem;
  font-weight: bold;
  pointer-events: none;
  animation: particle-fly 0.8s ease-out forwards;
  z-index: 3000;
  color: #ffcc00;
  filter: drop-shadow(0 0 4px #ffcc00);
}

@keyframes particle-fly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1.6);
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  p, li, a, button, input, label, .position, .typing-role {
    font-size: 0.95rem;
  }

  .cert-item p,
  .achievement-card p {
    font-size: 0.9rem;
  }

  nav a {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .about-text p {
    text-align: left !important;
    font-size: 0.95rem;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
  }
}
