@import url('https://fonts.googleapis.com/css2?family=Product+Sans:wght@400;500;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  --primary-color: #1a73e8;
  --secondary-color: #34a853;
  --accent-color: #188038;
  --background-color: #ffffff;
  --text-color: #202124;
  --surface-color: #f8f9fa;
  --shadow-color: rgba(0, 0, 0, 0.08);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.8;
}

.particles-container canvas {
  filter: hue-rotate(85deg);
}

header {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  position: relative;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
}

.title-container {
  text-align: left;
  margin-bottom: 2rem;
  width: 100%;
}

.glitch-container {
  position: relative;
  text-align: left;
  margin-bottom: 1rem;
}

.glitch {
  font-family: 'Digital-7', 'Product Sans', sans-serif;
  font-size: 7rem;
  font-weight: 700;
  color: var(--primary-color);
  text-shadow: none;
  letter-spacing: -0.02em;
  animation: fadeInUp 1s ease-out;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #34a853;
  clip: rect(44px, 1000px, 90px, 0);
  animation: glitch-anim 3s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 #188038;
  clip: rect(85px, 1000px, 140px, 0);
  animation: glitch-anim2 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(54px, 1000px, 90px, 0);
  }
  20% {
    clip: rect(14px, 1000px, 100px, 0);
  }
  40% {
    clip: rect(89px, 1000px, 94px, 0);
  }
  60% {
    clip: rect(67px, 1000px, 200px, 0);
  }
  80% {
    clip: rect(16px, 1000px, 133px, 0);
  }
  100% {
    clip: rect(81px, 1000px, 115px, 0);
  }
}

@keyframes glitch-anim2 {
  0% {
    clip: rect(24px, 1000px, 150px, 0);
  }
  20% {
    clip: rect(64px, 1000px, 36px, 0);
  }
  40% {
    clip: rect(75px, 1000px, 92px, 0);
  }
  60% {
    clip: rect(17px, 1000px, 165px, 0);
  }
  80% {
    clip: rect(26px, 1000px, 193px, 0);
  }
  100% {
    clip: rect(42px, 1000px, 115px, 0);
  }
}

.subtitle {
  font-family: 'Product Sans', sans-serif;
  font-size: 2rem;
  color: var(--text-color);
  opacity: 0.87;
  margin-top: 1rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile {
  padding: 4rem 2rem;
}

.profile-card {
  background: var(--surface-color);
  border-radius: 28px;
  box-shadow: 0 2px 6px var(--shadow-color);
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.social-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.social-button,
.contact-button {
  font-family: 'Product Sans', sans-serif;
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.social-button:hover,
.contact-button:hover {
  background: #1557b0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.contact-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1;
  padding: 1rem 1.5rem;
}

.skills {
  padding: 4rem 2rem;
  text-align: center;
}

.skills h2 {
  font-size: 2.5rem;
  margin-bottom: 3rem;
  background: linear-gradient(45deg, var(--primary-color), #34a853, #188038);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.skill {
  background: var(--surface-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 6px var(--shadow-color);
}

.skill:hover {
  transform: translateY(-10px);
}

.skill-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
}

.skill-icon.python svg {
  width: 100%;
  height: 100%;
}

.skill-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  margin-top: 1rem;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: var(--primary-color);
  border-radius: 5px;
  animation: progress 1.5s ease-out forwards;
}

@keyframes progress {
  from {
    width: 0;
  }
}

.floating-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--surface-color); /* Используем переменную, зависящую от темы */
  padding: 1rem 2rem;
  box-shadow: 0 2px 6px var(--shadow-color);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.nav-links {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  list-style: none;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-links a {
  font-family: 'Product Sans', sans-serif;
  color: var(--text-color);
  opacity: 0.87;
  font-weight: 500;
  text-decoration: none;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-links a svg {
  width: 20px;
  height: 20px;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: rgba(26, 115, 232, 0.08);
  color: var(--primary-color);
}

.projects {
  padding: 8rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
}

.project-card {
  background: var(--surface-color);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 2px 6px var(--shadow-color);
  border: none;
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-title {
  font-family: 'Product Sans', sans-serif;
  color: var(--primary-color);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary-color), #34a853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-description {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.project-link {
  font-family: 'Product Sans', sans-serif;
  background: var(--primary-color);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 24px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.project-link:hover {
  background: #1557b0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.project-link .link-icon {
  transition: transform 0.3s ease;
}

.project-link:hover .link-icon {
  transform: rotate(-45deg);
}

section {
  opacity: 1;
  transition: opacity 0.5s ease;
  display: block;
}

section.hidden {
  opacity: 0;
  display: none;
}

.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--surface-color);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow-color);
  transition: all 0.3s ease;
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

[data-theme="dark"] {
  --primary-color: #8ab4f8;
  --secondary-color: #81c995;
  --accent-color: #5bb974;
  --background-color: #202124;
  --text-color: #e8eaed;
  --surface-color: #292a2d;
  --shadow-color: rgba(0, 0, 0, 0.2);
}

@media (max-width: 1200px) {
  .glitch {
    font-size: 6rem;
  }
}

@media (max-width: 768px) {
  .glitch {
    font-size: 4rem;
    letter-spacing: -0.03em;
  }
  
  .subtitle {
    font-size: 1.2rem;
  }
  
  .profile-card {
    padding: 1.5rem;
  }
  
  .avatar {
    width: 150px;
    height: 150px;
  }
  
  .floating-nav {
    padding: 0.8rem 1rem;
  }

  .nav-links {
    justify-content: center;
  }

  .nav-links a {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .theme-toggle {
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .glitch {
    font-size: 3rem;
    letter-spacing: -0.02em;
  }
  
  .glitch::before, 
  .glitch::after {
    clip: rect(0, 400px, 70px, 0);
  }
  
  .header-content {
    padding: 0 1rem;
  }
  
  .social-button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
}