

:root {
  --bg-main: #09090b;
  --bg-card: #121215;
  --bg-card-hover: #18181c;
  --bg-glass: rgba(18, 18, 21, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.4);
  
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --accent-primary: #6366f1; 
  --accent-secondary: #a855f7; 
  --accent-cyan: #06b6d4; 
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #06b6d4 100%);
  --accent-glow: rgba(99, 102, 241, 0.15);

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 0.3s cubic-bezier(0.16, 1, 0.3, 1);

  --max-width: 960px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg-main);
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background: var(--bg-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

[data-en][data-ru] {
  transition: opacity 0.2s ease-in-out;
}

.lang-fade-out {
  opacity: 0.4;
}

.bg-grid {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 70%, transparent 100%);
  opacity: 0.7;
  pointer-events: none;
}

.bg-glow-top {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(168, 85, 247, 0.08) 40%, transparent 70%);
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.header {
  position: sticky;
  top: 16px;
  z-index: 100;
  width: calc(100% - 32px);
  max-width: var(--max-width);
  margin: 0 auto 32px auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.logo {
  font-weight: 800;
  font-size: 1.125rem;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

.lang-slider-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  cursor: pointer;
  user-select: none;
  width: 90px;
  height: 34px;
}

.lang-slider-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 40px;
  height: 26px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
  z-index: 1;
}

.lang-slider-container[data-lang="ru"] .lang-slider-thumb {
  transform: translateX(44px);
}

.lang-slider-option {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  z-index: 2;
  transition: color 0.2s ease;
}

.lang-slider-container[data-lang="en"] .lang-option-en,
.lang-slider-container[data-lang="ru"] .lang-option-ru {
  color: #ffffff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-main);
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.15);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.profile-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

.profile-banner {
  height: 140px;
  background: linear-gradient(135deg, #1e1b4b 0%, #311b92 40%, #0f172a 100%);
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
}

.profile-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.3), transparent 60%);
}

.profile-header-body {
  padding: 0 32px 32px 32px;
  position: relative;
}

.profile-avatar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -50px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: #18181c;
  border: 4px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  background-image: var(--accent-gradient);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.profile-name {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.profile-headline {
  font-size: 1.125rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 12px;
  line-height: 1.5;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-meta-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.profile-meta-link:hover {
  color: var(--text-primary);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #22c55e;
  box-shadow: 0 0 10px #22c55e;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cv-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  padding: 32px;
  margin-bottom: 24px;
  transition: var(--transition-normal);
}

.cv-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(99, 102, 241, 0.08),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.cv-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.cv-card:hover::before {
  opacity: 1;
}

.cv-card-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.cv-card-icon {
  color: var(--accent-primary);
}

.resume-item {
  display: flex;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.resume-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.company-logo {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.resume-details {
  flex: 1;
}

.resume-role {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.resume-company {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.resume-date {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.resume-description {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 14px;
}

.resume-bullets {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 14px;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.resume-bullets li {
  margin-bottom: 6px;
}

.skill-group {
  margin-bottom: 24px;
}

.skill-group:last-child {
  margin-bottom: 0;
}

.skill-group-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.skill-pill:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.project-card {
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  padding: 24px;
  transition: var(--transition-fast);
}

.project-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.project-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: #18181b;
  border: 1px solid var(--accent-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 40px 0;
  margin-top: 60px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

/* --------------------------------------------------------------------------
   8. Mobile Bottom Navigation & Responsive Elements
   -------------------------------------------------------------------------- */
.mobile-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(18, 18, 21, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-secondary);
  gap: 4px;
  flex: 1;
  height: 100%;
  transition: var(--transition-fast);
  text-decoration: none;
}

.mobile-nav-link svg {
  stroke: var(--text-secondary);
  transition: var(--transition-fast);
}

.mobile-nav-link.active,
.mobile-nav-link:hover {
  color: var(--text-primary);
}

.mobile-nav-link.active svg {
  stroke: var(--accent-primary);
}

.header-social-icon {
  display: none;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom) + 20px);
  }

  .nav-btn-text {
    display: none;
  }

  .header-social-icon {
    display: block;
  }

  .header-social-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .header {
    top: 10px;
    width: calc(100% - 20px);
    margin-bottom: 24px;
    padding: 8px 16px;
  }

  .profile-header-body {
    padding: 0 20px 24px 20px;
  }

  .profile-name {
    font-size: 1.75rem;
  }

  .nav-links {
    display: none;
  }

  .resume-item {
    flex-direction: column;
    gap: 12px;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  /* Prevent horizontal scroll on small screens */
  .container {
    padding: 0 12px;
    overflow-x: hidden;
  }
  
  .profile-avatar-row {
    margin-top: -40px;
  }
  
  .profile-avatar {
    width: 90px;
    height: 90px;
    font-size: 1.75rem;
  }
}

@media (max-width: 480px) {
  .logo-name {
    display: none;
  }
  
  .profile-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .profile-actions .btn {
    width: 100%;
  }
}
