:root {
  --bg: #000000;
  --text: #ffffff;
  --card-bg: #1a1a1a;
  --accent: #0a84ff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.light-theme {
  --bg: #f8f9fa;
  --text: #000000;
  --card-bg: #ffffff;
  --accent: #1e3a5f;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
   --nav-bg: rgba(255, 255, 255, 0.9);
}

.dark-theme {
  --bg: #0a192f;      
  --text: #ccd6f6;
  --card-bg: #112240;
  --accent: #0a84ff;
  --shadow: 0 6px 18px rgba(2, 12, 27, 0.7);
  --nav-bg: rgba(10, 25, 47, 0.85);
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.4s, color 0.4s;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  background: var(--bg);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.lang-toggles {
    display: flex !important;
    background-color: var(--card-bg) !important;
    padding: 4px !important;   
    border-radius: 12px !important; 
    border: 1px solid var(--accent) !important;
    gap: 4px !important;
    width: fit-content;
    margin-right: 15px; 
}

.lang-toggle {
    background: transparent !important;
    border: none !important;
    color: var(--text) !important;
    padding: 6px 14px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    transition: all 0.3s ease !important;
    border-radius: 8px !important; 
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.lang-toggle.active {
    background-color: var(--accent) !important; 
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.lang-toggle:hover:not(.active) {
    background-color: rgba(128, 128, 128, 0.1) !important;
}

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--card-bg);
  border: 1px solid var(--accent);
  transition: 0.4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between; 
  padding: 0 6px;                
  font-size: 14px;
  box-sizing: border-box;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 3px;
  background-color: var(--accent);
  transition: 0.4s;
  border-radius: 50%;
  z-index: 5; 
}

input:checked + .slider:before {
  transform: translateX(22px); 
  background-color: #ffffff;   
}

input:checked + .slider {
  background-color: var(--accent);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 100px 40px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.profile-content {
  flex: 1;
  padding-right: 40px;
}

.profile-content h1 {
  font-size: 3.5rem;
  margin-bottom: 5px;
}

.profile-content h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  opacity: 0.85;
}

.profile-content p {
  font-size: 1.2rem;
  margin-bottom: 10px;
  max-width: 500px;
}

.buttons {
  margin-top: 20px;
}

.buttons button {
  padding: 12px 24px;
  margin-right: 15px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.buttons button:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

.profile-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 30px rgba(10, 132, 255, 0.4);
}

.info-section {
  display: flex;
  justify-content: center;
  align-items: stretch;  
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 40px;
  max-width: 1200px;
  margin: 0 auto;
  margin-bottom: 0 auto;
}

.info-bar {
  background: var(--card-bg);
  padding: 15px 20px;       
  border-radius: 12px;      
  display: flex;
  align-items: center;
  gap: 12px;  
  box-shadow: var(--shadow);
  font-size: 1rem;
  flex: 1 1 250px;          
  min-height: 70px;         
  margin-bottom: 0 auto;
  }

.info-bar .icon {
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;          
}

#projects h2, #skills-about h2 {
  text-align: center;
  font-size: 2.5rem;
  margin: 0 auto;
  margin-bottom: 15px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  padding: 0 40px;
  max-width: 1200px;
  margin: 0 auto;
  margin-bottom: 0 auto;
}

.project-card {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  margin: 0 auto;
  margin-bottom: 0 auto;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-card h3 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.project-card p {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.project-card ul {
  list-style: none;
  margin-bottom: 20px;
}

.project-card ul li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  font-size: 1rem;
}

.project-card ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.project-buttons {
  display: flex;
  gap: 15px;
}

.project-buttons button {
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.project-buttons button:hover {
  background: #0056b3;
}

#skills-about {
  display: flex;
  gap: 30px;
  padding: 40px 40px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: stretch;
}


.skills, .about-me {
  flex: 1;
  display: flex; 
  flex-direction: column;   
  gap: 20px;                 
}

.skills h2, .about-me h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.skill-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  /*margin-bottom: 20px;*/
  box-shadow: var(--shadow);
  position: relative;
  flex: 1;
}

.icon-container {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffffff;
  position: absolute;
  top: 20px;
  left: 20px;
}

.analysis-icon {
  background: linear-gradient(135deg, #4caf50, #f44336); 
}

.engineering-icon {
  background: #757575; 
}

.visualization-icon {
  background: #2196f3; 
}

.skill-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  padding-left: 50px; 
}

.skill-card ul {
  padding-left: 50px; 
}

.about-me p {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  font-size: 1.1rem;
  line-height: 1.7;
  flex: 1;
}

.contact-item {
  background: var(--card-bg);
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--shadow);
  list-style-type: none;  
}

.contact ul {
  list-style-type: none;  
  padding-left: 0; 
  margin: 0; 
}

.contact-item li {
  list-style-type: none;  
}

.contact-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #ffffff;
}

.email-icon {
  background: #2196f3; 
}

.linkedin-icon {
  background: #757575;
}

.github-icon {
  background: #ff4081; 
}

.contact a {
  color: var(--text);
  text-decoration: none;
  font-size: 1.1rem;
}

.contact a:hover {
  text-decoration: underline;
}

.contact button {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: var(--shadow);
}

.contact button:hover {
  background: #0056b3;
  transform: translateY(-2px);
}

.site-footer {
  text-align: center;
  padding: 20px 0;
  font-size: 14px;
  color: var(--text); 
 }
 
.dark-only { 
	display: none; 
	} 

.dark-theme .light-only { 
  display: none; 
	}
.dark-theme .dark-only { 
  display: block; 
	}

.light-theme .dark-only { 
  display: none; 
}
.light-theme .light-only { 
  display: block;
 }	
 

@media (max-width: 768px) {
  #skills-about {
    flex-direction: column;
    padding: 30px 20px;
  }
  .skill-card ul, .skill-card h3 {
    padding-left: 0;
  }
  .icon-container {
    position: static;
    margin-bottom: 10px;
  }
  
   .buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    padding: 0 20px;
    align-items: stretch;
  }

  .buttons button {
    width: 100%;
    margin-right: 0;
  }

}

@media screen and (max-width: 1140px) {
  
  .info-section {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
    max-width: 1000px; /* Ограничиваем общую ширину, чтобы 2х2 смотрелось аккуратнее */
    margin: 0 auto;
  }

  .info-bar {
    /* Фиксируем 2 колонки: 50% минус половина gap (20px / 2 = 10px) */
    flex: 0 1 calc(50% - 10px) !important; 
    min-width: 250px !important; 
    box-sizing: border-box !important;
  }
}


@media (max-width: 1024px) {
  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 100px 20px 40px;
  }

  .profile-content {
    padding-right: 0;
    margin-bottom: 30px;
  }
  
  .profile-content h1 {
    font-size: 2.2rem; 
    line-height: 1.15; 
    margin-bottom: 8px;
  }

  .profile-content h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
  }

  #skills-about {
    flex-direction: column;
    align-items: stretch !important; 
    padding: 20px;
    gap: 20px;
  }
  
  h1, h2 {
    order: 0;
  }

  .profile-photo {
    order: 1;
    margin: 15px auto 25px;
  }

  .profile-content {
    order: 2;
  }

  .projects-grid {
    grid-template-columns: 1fr !important; /* Гарантируем одну колонку */
    padding: 0 20px;
    width: 100%;
    display: flex; /* Или оставляем grid, но flex тут надежнее */
    flex-direction: column;
    align-items: center;
  }

  .project-card {
    width: 100% !important;   /* ВОТ ЭТО ИСПРАВИТ РАЗНУЮ ШИРИНУ */
    max-width: 100% !important;
    box-sizing: border-box;   /* Чтобы padding не распирал карточку */
    margin-bottom: 20px;
  }
  
  .info-section {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 20px !important;
    padding: 20px !important;
  }

  .info-bar {
    flex: 0 1 calc(50% - 10px) !important; 
    min-width: 280px !important; 
    min-height: 80px !important;
    justify-content: flex-start !important;
  }

}

@media only screen and (max-width: 770px) {
  

  html body #skills-about {
    display: flex !important;
    flex-direction: column !important; 
    padding: 20px 10px !important;
    gap: 30px !important;
    width: 100% !important;
  }

  html body .skills, 
  html body .about-me {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important; 
    display: block !important;
  }

  html body .skill-card {
    width: 100% !important;
    margin-bottom: 15px !important;
    padding: 25px !important;
    box-sizing: border-box !important;
  }

  html body .lang-toggles {
    padding: 4px !important;
    border-radius: 12px !important;
    margin-right: 0 !important;
    justify-content: center !important;
  }

  html body .lang-toggle {
    padding: 10px 16px !important;
    border-radius: 8px !important;
  }

  html body .profile-header {
    flex-direction: column !important;
    text-align: center !important;
  }
  
  .info-bar {
    flex: 1 1 100% !important;
  }
}

/* =======================
   FOOTER 
   ======================= */
.site-footer {
  padding: 40px 20px;
  text-align: center;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  background: var(--bg);
}

.footer-links {
  margin-bottom: 15px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  margin: 0 10px;
  display: inline-block;
}

/* =======================
   MODAL 
   ======================= */
.modal {
  display: none; 
  position: fixed; 
  z-index: 9999; 
  left: 0; 
  top: 0; 
  width: 100%; 
  height: 100%;
  background-color: rgba(0,0,0,0.8);
}

.modal-content {
  background-color: var(--card-bg);
  color: var(--text);
  margin: 5% auto;
  padding: 40px;
  border: 1px solid var(--accent);
  width: 90%;
  max-width: 700px;
  border-radius: 12px;
  position: relative;
  max-height: 85vh;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 10px;
  font-size: 32px;
  cursor: pointer;
  color: var(--accent);
}