/* Logo styling */
.logo img {
  width: 120px;
  height: 120px;
  transition: all 0.3s ease;
  border-radius: 16px;
}

/* Top buttons */
:root {
    --purple: #800080;
    --white: #fff;
    --black: #000;
    --bg-dark: #000;
    --bg-light: #ffffff;
    --text-dark: #fff;
    --text-light: #111;
}



/* Logo GIF Animation Container */
#logo-gif-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(2);
  z-index: 9999;
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

#logo-gif-container .logo-gif {
  width: 120px;
  height: 120px;
  display: block;
  /* Prevent GIF from looping */
  animation-iteration-count: 1 !important;
  animation-fill-mode: forwards !important;
}



#logo-gif-container .logo-static {
  width: 120px;
  height: 120px;
  display: none;
  opacity: 1;
  transition: opacity 0.2s ease;
}



/* Auto-theme colors for logos */
#logo-static-dark {
  /* Dark theme logo - white lines, purple eye */
}

#logo-static-light {
  /* Light theme logo - black lines, purple eye */
}

/* Show appropriate GIF based on theme */
#logo-gif-dark {
  display: block; /* Black background GIF for dark theme */
}

#logo-gif-light {
  display: none; /* White background GIF for light theme */
}

body.light-theme #logo-gif-dark {
  display: none; /* Hide black background GIF on light theme */
}

body.light-theme #logo-gif-light {
  display: block; /* Show white background GIF on light theme */
}


/* GIF Animation - Drawing phase */
#logo-gif-container.logo-drawing {
  transform: translate(-50%, -50%) scale(2);
  transition: none;
}

/* GIF Animation - Flying to final position */
#logo-gif-container.logo-flying {
  position: fixed;
  left: var(--target-x, 50%);
  top: var(--target-y, 50%);
  transform: scale(1.0) translateZ(0);
  transition:
    left 0.8s cubic-bezier(0.4,0,0.2,1),
    top 0.8s cubic-bezier(0.4,0,0.2,1),
    transform 0.8s cubic-bezier(0.4,0,0.2,1);
  z-index: 9998;
  will-change: left, top, transform;
}

/* Fix for mobile */
@media (max-width: 600px) {
  #logo-gif-container.logo-flying {
    position: absolute;
  }
}



@keyframes splashPulse {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  10% {
    opacity: 1;
    transform: scale(1.2);
  }
  90% {
    transform: scale(0.4) translateY(-200px);
    opacity: 0.3;
  }
  100% {
    transform: scale(0.3) translateY(-250px);
    opacity: 0;
  }
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-dark);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  /* allow scrolling and selection for accessibility */
  transition: background 0.3s ease, color 0.3s ease;
}

body.light-theme {
  background: var(--bg-light);
  color: var(--text-light);
}

body.dark-theme {
  color: var(--text-dark);
}

body.light-theme .top-buttons button {
  color: var(--text-light);
}

body.light-theme .social-btn {
  color: var(--text-light);
}

body.light-theme .modal-content {
  background: #fff;
  color: #111;
}
  
  

.hidden { 
  display: none; 
}

#lang-menu.hidden {
  display: none !important;
}

#content.invisible { 
  visibility: hidden; 
  opacity: 0;
}

#content.visible { 
  visibility: visible; 
  opacity: 1;
}

.modal.hidden {
  display: none;
}

header {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  margin-bottom: 0;
}




.top-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
}

.lang-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10005;
}

.top-buttons button {
  background: none;
  border: none;
  color: var(--text-dark);
  font-size: 20px;
  margin: 0;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.top-buttons button:hover {
  transform: scale(1.1);
}

.slogan {
  margin: 100px 0 20px 0;
  font-size: 2rem;
  text-align: center;
  height: 56px; /* фиксированная высота, чтобы не смещать элементы */
  line-height: 1.2;
  overflow: hidden;
}

.links {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: center;
  margin-top: 60px;
}

.links span {
  transition: all 0.3s ease;
}

.social-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s ease;
}

.social-btn span {
  color: inherit;
}

.social-btn img {
  height: 32px;
  width: 32px;
}

.social-btn:hover {
  transform: scale(1.05);
  text-decoration: underline;
}

/* Modal styles moved to accessibility section */

/* Make social icons invert for dark/light themes */
.icon:not(#main-logo):not(#mobile-logo) {
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

/* Logo should not have filter applied */
#main-logo {
  filter: none !important;
}

/* Mobile logo should not have filter applied */
#mobile-logo {
  filter: none !important;
}

/* Ensure theme toggle icon (in #theme-btn) and language icon (in #lang-btn) respect theme colors */
#theme-btn img,
#lang-btn img {
  height: 20px;
  width: 20px;
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

/* Ensure about button icon matches other top buttons size */
#about-btn img {
  width: 20px;
  height: 20px;
}

/* Ensure about button icon respects theme colors */
body.light-theme #about-btn img {
  filter: none;
}

body.dark-theme #about-btn img {
  filter: brightness(0) invert(1);
}

/* GitHub icon specific styling */
#github-icon {
  filter: brightness(0) invert(1);
  transition: filter 0.3s ease;
}

body.light-theme #github-icon {
  filter: none;
}

body.dark-theme #github-icon {
  filter: brightness(0) invert(1);
}

body.light-theme #theme-btn img,
body.light-theme #lang-btn img {
  filter: none;
}

body.light-theme .icon:not(#main-logo):not(#mobile-logo) {
  filter: none;
}

/* --- DESKTOP STYLES --- */
.desktop-layout {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  margin-top: 150px !important;
  margin-left: -120px !important;
  gap: 20px !important;
}

/* Hide mobile layout on desktop */
.mobile-layout {
  display: none !important;
}

.desktop-layout .logo {
  margin: 0 !important;
  flex-shrink: 0 !important;
}

.desktop-layout .nickname-cta {
  margin: 0 !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  padding-left: 0 !important;
}

.desktop-layout .nickname,
.desktop-layout #nickname,
.desktop-layout .nickname-cta .nickname {
  margin-left: 0 !important;
  text-align: center !important;
  width: auto !important;
  transform: translateX(5px) !important;
}

/* Force mobile override - removed duplicate */

/* --- MOBILE RESPONSIVE STYLES --- */
@media (max-width: 600px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden !important;

    width: 100% !important;

  }
  
  html {
    overflow-x: hidden !important;

  }
  
  /* Main content container */
  .main-centered-content {
    padding: 0 20px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  
  /* Header adjustments */
  .header-centered {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
    gap: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    position: relative !important;
    top: 0 !important;
  }
  
  /* Hide desktop layout on mobile */
  .desktop-layout {
    display: none !important;
  }

  /* Show mobile layout on mobile */
  .mobile-layout {
    display: block !important;
  }
  
  /* Top buttons - 10px from top */
  .top-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    margin: 10px auto 15px auto !important;
    padding: 0 !important;
    position: relative !important;
    top: 0 !important;
    width: auto !important;
    max-width: 300px !important;
    transform: translateX(-20px) !important;
  }
  
  .top-buttons button {
    padding: 10px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 10 !important;
  }
  
  .top-buttons button img {
    width: 18px !important;
    height: 18px !important;
    pointer-events: none !important;
  }
  
  .top-buttons button:active {
    transform: scale(0.95) !important;
  }
  
  /* Logo - positioned at top, highest z-index */
  .mobile-layout .logo,
  .logo {
    position: fixed !important;
    bottom: 380px !important;  /* Опущен на 20px вниз (было 400px) */
    left: 50% !important;  /* Вернули в центр */
    transform: translateX(-50%) !important;
    margin: 0 !important;
    display: block !important;
    width: 160px !important;  /* Увеличен в 2 раза (было 80px) */
    height: 160px !important;  /* Увеличен в 2 раза (было 80px) */
    z-index: 100 !important;
    text-align: center !important;  /* Дополнительное центрирование */
  }
  
  /* Force logo image to fit container */
  .logo img {
    width: 160px !important;  /* Увеличен в 2 раза (было 80px) */
    height: 160px !important;  /* Увеличен в 2 раза (было 80px) */
    margin: 0 auto !important;  /* Центрирование изображения */
    display: block !important;
    object-fit: contain !important;
  }
  
  /* Nickname - positioned below logo */
  .mobile-layout .nickname-cta,
  .nickname-cta {
    position: fixed !important;
    bottom: 320px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 200px !important;
    display: block !important;
    text-align: center !important;
    z-index: 90 !important;
  }
  
  .mobile-layout .nickname,
  .mobile-layout .nickname-cta .nickname {
    margin-left: 0 !important;
    text-align: center !important;
    transform: translateX(5px) !important;
  }
  
  .nickname {
    font-size: 20px !important;
    margin: 0 auto 10px auto !important;
    margin-left: 0 !important;
    text-align: center !important;
    width: 100% !important;
    transform: translateX(5px) !important;
  }
  
  /* Typing text and cursor */
  .typing-text {
    text-align: center !important;
    width: auto !important;
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }
  
  .cursor {
    text-align: center !important;
    top: 0 !important;
    display: inline-block !important;
    white-space: nowrap !important;
    font-size: 1.2em !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
  }
  
  /* Mobile nickname - keep text and cursor on same line */
  .mobile-layout .nickname {
    white-space: nowrap !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
  }
  
  /* Mobile typing text and cursor - force inline */
  .mobile-layout .typing-text {
    display: inline !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  
  .mobile-layout .cursor {
    display: inline !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 1.2em !important;
    line-height: 1 !important;
    vertical-align: baseline !important;
    margin-left: 2px !important;
  }
  
  /* CTA buttons - positioned below nickname, above slogan */
  .mobile-layout .cta-container,
  .cta-container {
    position: fixed !important;
    bottom: 230px !important;  /* Поднято ещё на 50px вверх */
    left: 50% !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important;
    gap: 10px !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 200px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    z-index: 80 !important;
  }
  
  .cta-button {
    min-width: 20px !important;
    min-height: 18px !important;
    justify-content: center !important;
    padding: 1px 2px !important;
    font-size: 6px !important;
    width: 100% !important;
    text-align: center !important;
    max-width: 20px !important;
    box-sizing: border-box !important;
    height: 18px !important;
    line-height: 18px !important;
    overflow: hidden !important;
  }

  /* Force override for mobile CTA buttons */
  .mobile-layout .cta-button,
  .mobile-layout .cta-container .cta-button {
    min-width: 160px !important;
    max-width: 160px !important;
    width: 160px !important;
    height: 50px !important;
    padding: 10px 16px !important;
    font-size: 16px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Force override for mobile CTA container */
  .mobile-layout .cta-container {
    max-width: 160px !important;
    width: 160px !important;
    gap: 0 !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  
  /* Slogan - positioned above social links with 120px gap */
  .slogan {
    position: fixed !important;
    bottom: 150px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 1.1rem !important;
    text-align: center !important;
    margin: 0 !important;
    line-height: 1.4;
    z-index: 998 !important;
    width: 100% !important;
    max-width: 300px !important;
  }
  
  /* Social links - positioned above footer with 25px gap */
  .links,
  .main-centered-content .links,
  #content .links {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -60px !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 120px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999 !important;
    padding: 0 !important;
    transform: none !important;
  }
  
  .social-btn {
    min-width: 50px !important;
    max-width: 50px !important;
    width: 50px !important;
    height: 50px !important;
    justify-content: center !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
    text-decoration: none !important;
    border-radius: 50% !important;
    transition: all 0.3s ease !important;
    background: rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: blur(5px) !important;
    font-size: 0 !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
  }

  .social-btn img {
    height: 28px !important;
    width: 28px !important;
  }
  
  /* Скрываем текст на мобилке, оставляем только иконки */
  .social-btn span {
    display: none !important;
  }

  /* Force override for mobile social buttons */
  .mobile-layout .social-btn {
    min-width: 50px !important;
    max-width: 50px !important;
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-radius: 50% !important;
  }
  
  .mobile-layout .social-btn span {
    display: none !important;
  }
  
  .mobile-layout .social-btn img {
    height: 28px !important;
    width: 28px !important;
  }

  /* Force override for mobile social links container */
  .mobile-layout .links,
  .mobile-layout .main-centered-content .links,
  .mobile-layout #content .links {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -60px !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 120px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    transform: none !important;
  }
  
  .social-btn:active {
    transform: scale(0.95) !important;
  }
  
  /* Language menu positioning */
  #lang-menu {
    left: 50%;
    transform: translateX(-50%);
    z-index: 10004;
    width: 50px !important;
    min-height: 100px !important;
    overflow: visible !important;
  }
  
  .lang-wrapper {
    position: relative;
    z-index: 10005;
  }
  
  /* Modal adjustments */
  .modal-content {
    padding: 20px;
    margin: 20px;
    max-width: calc(100% - 40px);
  }
  
  #services-modal h2 {
    font-size: 1.5rem;
  }
  
  .service-item {
    padding: 15px;
  }
  
  .service-item h3 {
    font-size: 1.1rem;
  }
  
  .service-item p {
    font-size: 0.9rem;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .main-centered-content {
    padding: 0 15px;
  }
  
  .header-centered {
    gap: 0 !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    position: relative !important;
    top: 0 !important;
  }
  
  .mobile-layout .logo,
  .logo {
    position: fixed !important;
    bottom: 380px !important;  /* Опущен на 20px вниз (было 400px) */
    left: 50% !important;  /* Вернули в центр */
    transform: translateX(-50%) !important;
    width: 140px !important;  /* Увеличен в 2 раза (было 70px) */
    height: 140px !important;  /* Увеличен в 2 раза (было 70px) */
    margin: 0 !important;
    z-index: 100 !important;
    text-align: center !important;  /* Дополнительное центрирование */
  }
  
  /* Force logo image to fit container for small screens */
  .logo img {
    width: 140px !important;  /* Увеличен в 2 раза (было 70px) */
    height: 140px !important;  /* Увеличен в 2 раза (было 70px) */
    margin: 0 auto !important;  /* Центрирование изображения */
    display: block !important;
    object-fit: contain !important;
  }
  
  .nickname {
    font-size: 20px !important;
    margin-bottom: 8px !important;
    margin-left: 0 !important;
    transform: translateX(5px) !important;
  }
  
  .cta-button {
    min-width: 140px !important;
    max-width: 140px !important;
    width: 140px !important;
    height: 45px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
  }
  
  .social-btn {
    min-width: 120px !important;
    padding: 6px 10px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
  }
  
  .mobile-layout .cta-container,
  .cta-container {
    position: fixed !important;
    bottom: 230px !important;  /* Поднято ещё на 50px вверх */
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-width: 160px !important;
    width: 160px !important;
    gap: 0 !important;
    justify-content: center !important;
    z-index: 80 !important;
  }
  
  .top-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 10px auto 15px auto !important;
    padding: 0 !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: translateX(-15px) !important;
    width: auto !important;
    max-width: 250px !important;
    z-index: 10003 !important;
  }
  
  .top-buttons button {
    padding: 6px;
    min-width: 32px;
    min-height: 32px;
  }
  
  .top-buttons button img {
    width: 16px;
    height: 16px;
  }
  
  /* Adjust spacing for very small screens */
  
  .mobile-layout .nickname-cta,
  .nickname-cta {
    position: fixed !important;
    bottom: 320px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    z-index: 90 !important;
  }
  
  .mobile-layout .nickname,
  .mobile-layout .nickname-cta .nickname {
    margin-left: 0 !important;
    text-align: center !important;
    transform: translateX(5px) !important;
  }
  
  .slogan {
    position: fixed !important;
    bottom: 150px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    z-index: 70 !important;
    width: 100% !important;
    max-width: 280px !important;
  }
  
  .links {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -60px !important;
    margin-right: 0 !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 120px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 10px !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 999 !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Show footer on mobile */
  #site-footer {
    display: block !important;
    position: fixed !important;
    bottom: 5px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    text-align: center !important;
    font-size: 12px !important;
    color: var(--text-color) !important;
    opacity: 0.7 !important;
    z-index: 1000 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Ensure links inherit theme text color */
a, a:link, a:visited, a:active, a:focus, a:hover {
  text-decoration: none;
  color: inherit !important;
}

.links * {
  color: inherit !important;
}

body.dark-theme {
  color: var(--text-dark) !important;
}
body.light-theme {
  color: var(--text-light) !important;
}


#lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  z-index: 10004;
  width: 50px;
  min-height: 100px;
  box-sizing: border-box;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: visible;
}

#lang-menu.show {
  display: flex !important;
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0) !important;
}

#lang-menu.hidden {
  display: none !important;
}

/* Override inherited .top-buttons button styles inside lang menu */
#lang-menu .lang-option {
  min-width: 0;
  transform: none;
}
#lang-menu .lang-option:hover {
  transform: none;
}

body.light-theme #lang-menu {
  background: #fff;
  border-color: #ccc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

body.dark-theme #lang-menu {
  background: #333;
  border-color: #555;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#lang-menu .lang-option img {
  display: block;
  margin: 0 auto;
  width: 20px;
  height: 15px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Restored and extended for new hover effect with pseudo-element */
#lang-menu .lang-option {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
  transition: background 0.2s ease;
  text-align: center;
  line-height: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  border-radius: 4px;
}

#lang-menu button.lang-option {
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* New hover effect using pseudo-element */
#lang-menu .lang-option::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s;
}

#lang-menu .lang-option:hover::after {
  opacity: 1;
}

body.light-theme #lang-menu .lang-option:hover::after {
  background: rgba(0, 0, 0, 0.05);
}

body.dark-theme #lang-menu .lang-option:hover::after {
  background: rgba(255, 255, 255, 0.1);
}

/* --- NICKNAME ANIMATION --- */
.nickname {
  font-size: 37px;
  font-weight: bold;
  color: var(--text-dark);
  font-family: monospace;
  overflow: hidden;
  white-space: nowrap;
  margin-bottom: 18px; /* Отступ между никнеймом и кнопкой */
  margin-top: 10px; /* Опускаем никнейм на 10px */
  margin-left: 0; /* Сброшено для десктопа, используется padding-left на контейнере */
  cursor: pointer; /* Показываем что элемент кликабельный */
  user-select: none; /* Запрещаем выделение текста */
  -webkit-user-select: none; /* Для Safari */
  -moz-user-select: none; /* Для Firefox */
  -ms-user-select: none; /* Для IE */
}

/* Десктопная версия - сдвиг никнейма вправо на 5px */
.desktop-layout .nickname,
.desktop-layout #nickname,
.desktop-layout .nickname-cta .nickname {
  margin-left: 0 !important;
  text-align: center !important;
  width: auto !important;
  transform: translateX(5px) !important;
}

.desktop-layout .nickname-cta,
.desktop-layout .nickname-cta {
  align-items: center !important;
  padding-left: 0 !important;
}

.nickname.show {
  opacity: 1;
}

body.light-theme .nickname {
  color: var(--text-light);
}

.header-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* removed debug crosshair lines */
/* --- CTA BUTTON STYLES --- */
.cta-container {
  margin-top: -10px;
  display: flex;
  gap: 0; /* Отступ между кнопками CTA */
  justify-content: center;
  width: 100%;
}

/* --- MODERN CTA BUTTONS --- */
.cta-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--purple);
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 200px;
  justify-content: center;
}

/* Mobile CTA buttons - override desktop styles */
@media (max-width: 600px) {
  .cta-button {
    min-width: 200px !important;
    max-width: 200px !important;
    width: 200px !important;
    height: 60px !important;
    padding: 12px 24px !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  .cta-container {
    max-width: 200px !important;
    width: 200px !important;
    gap: 0 !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }
  
  /* Mobile social buttons - только иконки, круглые */
  .social-btn {
    min-width: 50px !important;
    max-width: 50px !important;
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 1.2 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    border-radius: 50% !important;
  }
  
  .social-btn span {
    display: none !important;
  }
  
  .social-btn img {
    height: 28px !important;
    width: 28px !important;
  }
  
  /* Mobile social links container */
  .links,
  .main-centered-content .links,
  #content .links {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -60px !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 120px !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 10px !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    transform: none !important;
  }
  
  /* Prevent scrolling during GIF animation */
  #logo-gif-container.logo-flying {
    position: absolute !important;
  }
  
  /* Prevent body scrolling on mobile */
  body, html {


  }
  
  /* Center language flags in modal */
  #lang-menu .lang-option img {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
  
  /* Smaller nickname on mobile */
  .nickname {
    font-size: 18px !important;
    margin-left: 0 !important;
    transform: translateX(5px) !important;
  }
}

/* Extra small screens */
@media (max-width: 400px) {
  .cta-button {
    min-width: 160px !important;
    max-width: 160px !important;
    width: 160px !important;
    height: 50px !important;
    padding: 10px 20px !important;
    font-size: 16px !important;
  }
  
  .cta-container {
    max-width: 160px !important;
    width: 160px !important;
  }
  
  .social-btn {
    min-width: 50px !important;
    max-width: 50px !important;
    width: 50px !important;
    height: 50px !important;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    border-radius: 50% !important;
  }
  
  .social-btn span {
    display: none !important;
  }
  
  .social-btn img {
    height: 28px !important;
    width: 28px !important;
  }
  
  .links,
  .main-centered-content .links,
  #content .links,
  .mobile-layout .links {
    position: fixed !important;
    bottom: 30px !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -60px !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    width: 120px !important;
    max-width: 120px !important;
    min-width: 120px !important;
    gap: 10px !important;
    padding: 0 !important;
    transform: none !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .nickname {
    font-size: 16px !important;
    margin-left: 0 !important;
    transform: translateX(5px) !important;
  }
  
  .top-buttons {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 10px auto 15px auto !important;
    padding: 0 !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    transform: translateX(-15px) !important;
    width: auto !important;
    max-width: 250px !important;
    z-index: 10003 !important;
  }
  
  .top-buttons button {
    padding: 8px !important;
    min-width: 35px !important;
    min-height: 35px !important;
  }
  
  .top-buttons button img {
    width: 16px !important;
    height: 16px !important;
  }
  
  .slogan {
    font-size: 1rem !important;
    margin: 8px 0 8px 0 !important;
  }
  
  .links {
    margin: 8px 0 0 0 !important;
  }
  
  /* Language menu for small screens */
  #lang-menu {
    width: 50px !important;
    min-height: 100px !important;
    overflow: visible !important;
    z-index: 10004 !important;
  }
}

/* Hide desktop layout on mobile */
@media (max-width: 600px) {
  .desktop-layout {
    display: none !important;
  }
  
  .mobile-layout {
    display: block !important;
  }
}

/* Hide mobile layout on desktop */
@media (min-width: 601px) {
  .mobile-layout {
    display: none !important;
  }
}

.cta-button:hover {
  background: var(--purple);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(128, 0, 128, 0.2);
}

/* Icons */
.icon-email, .icon-telegram {
  width: 14px;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.3s ease;
}

.icon-email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.icon-telegram {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 00-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.75-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06-.01.13-.02.2z'/%3E%3C/svg%3E");
}

/* Hover effects for icons */
.cta-button:hover .icon-email {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23EA4335'%3E%3Cpath d='M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z'/%3E%3C/svg%3E");
}

.cta-button:hover .icon-telegram {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230088cc'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm4.64 6.8c-.15 1.58-.8 5.42-1.13 7.19-.14.75-.42 1-.68 1.03-.58.05-1.02-.38-1.58-.75-.88-.58-1.38-.94-2.23-1.5-.99-.65-.35-1.01.22-1.59.15-.15 2.71-2.48 2.76-2.69a.2.2 0 00-.05-.18c-.06-.05-.14-.03-.21-.02-.09.02-1.49.95-4.22 2.79-.4.27-.76.41-1.08.4-.36-.01-1.04-.2-1.55-.37-.63-.2-1.12-.31-1.08-.66.02-.18.27-.36.74-.55 2.92-1.27 4.86-2.11 5.83-2.51 2.78-1.16 3.35-1.36 3.75-1.36.08 0 .27.02.39.12.1.08.13.19.14.27-.01.06-.01.13-.02.2z'/%3E%3C/svg%3E");
}

/* Light theme adjustments */
body.light-theme .cta-button {
  color: var(--text-light);
  border-color: var(--purple);
}

body.light-theme .cta-button:hover {
  background: var(--purple);
  color: white;
}

/* --- NICKNAME-CTA + LOGO-NICK ADJUSTMENTS --- */
.nickname-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0; /* Убираем отрицательный margin */
}

.desktop-layout .nickname-cta {
  align-items: center !important;
  padding-left: 0 !important;
}



#content {
  opacity: 0;
  transition: opacity 0.5s ease;
}

#content.visible {
  opacity: 1;
}

/* keep default .cta-button color without !important */
/* --- SITE FOOTER --- */
#site-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  text-align: center;
  padding: 10px 20px;
  font-size: 0.9rem;
  color: var(--text-dark);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 100;
}

#site-footer.visible {
  opacity: 0.5;
}

body.light-theme #site-footer {
  color: var(--text-light);
}

/* Footer hidden on mobile - moved to main mobile styles */
/* Скругление логотипа во время анимации, чтобы совпадало с финальным видом */
#splash-logo.splash-animate img {
  border-radius: 45px;
}

/* --- Services button and modal styles --- */
#services-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  transition: transform 0.3s ease;
}

#services-btn:hover {
  transform: scale(1.1);
}

#services-btn img {
  width: 20px;
  height: 20px;
}

#services-btn img {
  filter: brightness(0) invert(1);
}

body.light-theme #services-btn img {
  filter: none;
}

#services-modal .services-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

#services-modal h2 {
  margin: 0 0 25px 0;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: var(--purple);
}

body.dark-theme #services-modal h2 {
  color: #fff;
}

body.light-theme #services-modal h2 {
  color: var(--purple);
}

#services-modal .service-item {
  padding: 20px;
  border-radius: 8px;
  border-left: 4px solid var(--purple);
  transition: all 0.3s ease;
}

#services-modal .service-item h3 {
  margin: 0 0 10px 0;
  color: var(--purple);
  font-size: 1.2rem;
  font-weight: 600;
}

#services-modal .service-item p {
  margin: 0;
  line-height: 1.6;
  opacity: 0.9;
}

/* Dark theme service items */
body.dark-theme #services-modal .service-item {
  background: #2a2a2a;
  color: #fff;
  border-left-color: var(--purple);
}

body.dark-theme #services-modal .service-item:hover {
  background: #333;
  transform: translateX(5px);
}

/* Light theme service items */
body.light-theme #services-modal .service-item {
  background: #f8f9fa;
  color: #333;
  border-left-color: var(--purple);
}

body.light-theme #services-modal .service-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.main-centered-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  gap: 20px;
}

/* Typing animation for nickname */
.typing-text {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  width: 0;
}

.cursor {
  display: inline-block;
  opacity: 1;
  margin-left: 0; /* Reset margin */
  position: relative;
  top: -12px; /* Move cursor up by 12px total */
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* CTA button styling */
/* Old styles removed - replaced with modern button design above */



/* --- ACCESSIBILITY FOCUS STYLES --- */
button:focus,
a:focus,
.lang-option:focus {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible,
.lang-option:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--purple);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
}

.skip-link:focus {
  top: 6px;
}

/* --- REDUCED MOTION SUPPORT --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .splash-logo {
    animation: none !important;
  }
  
  .cursor {
    animation: none !important;
  }
  
  .cta-button:hover {
    transform: none !important;
  }
}

/* --- MODAL ACCESSIBILITY --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal.hidden {
  display: none;
}

/* Modal content styling */
.modal-content {
  padding: 30px;
  border-radius: 16px;
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
  position: relative;
  transform: scale(0.7);
  transition: transform 0.3s ease;
}

/* Dark theme modal styling */
body.dark-theme .modal-content {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

/* Light theme modal styling */
body.light-theme .modal-content {
  background: #fff;
  color: #333;
  border: 1px solid #e0e0e0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal.show .modal-content {
  transform: scale(1);
}

/* Close button styling */
.modal span[aria-label="Закрыть"] {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

/* Dark theme close button */
body.dark-theme .modal span[aria-label="Закрыть"] {
  color: #fff;
}

body.dark-theme .modal span[aria-label="Закрыть"]:hover {
  color: var(--purple);
  background: rgba(128, 0, 128, 0.2);
}

/* Light theme close button */
body.light-theme .modal span[aria-label="Закрыть"] {
  color: #333;
}

body.light-theme .modal span[aria-label="Закрыть"]:hover {
  color: var(--purple);
  background: rgba(128, 0, 128, 0.1);
}

/* Focus management for modals */
.modal:focus {
  outline: none;
}

.modal-content:focus {
  outline: none;
}

/* Ensure modal content is focusable */
.modal-content *:focus {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

/* About modal specific styling */
#about-modal .modal-content p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin: 0;
  text-align: center;
  max-width: 500px;
}

body.dark-theme #about-modal .modal-content p {
  color: #fff;
}

body.light-theme #about-modal .modal-content p {
  color: #333;
}

/* --- THEME SUPPORT --- */
@media (prefers-color-scheme: light) {
  body:not(.dark-theme):not(.light-theme) {
    background: var(--bg-light);
    color: var(--text-light);
  }
  
  body:not(.dark-theme):not(.light-theme) .logo img {
    filter: brightness(0) invert(0);
  }
}

@media (prefers-color-scheme: dark) {
  body:not(.dark-theme):not(.light-theme) {
    background: var(--bg-dark);
    color: var(--text-dark);
  }
  
  body:not(.dark-theme):not(.light-theme) .logo img {
    filter: brightness(0) invert(1);
  }
}

/* --- TOAST NOTIFICATION --- */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--purple);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(128, 0, 128, 0.4);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  font-size: 14px;
  font-weight: 500;
  max-width: 90%;
  text-align: center;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(100px);
}

body.light-theme .toast {
  background: var(--purple);
  color: white;
}

body.dark-theme .toast {
  background: var(--purple);
  color: white;
}

/* Mobile toast adjustments */
@media (max-width: 600px) {
  .toast {
    bottom: 80px;
    font-size: 12px;
    padding: 12px 20px;
    max-width: 85%;
  }
}


