/* ======================================================================
   Single-page Portfolio — Mikhail Kolchar
   Left sidebar nav · Smooth scroll · Light/Dark theme · EN/RU
   tuqo.app ready
   ====================================================================== */

/* ---------- Theme variables ---------- */
:root {
  --bg-body: #f8fafc;
  --bg-header: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-section: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-glow: rgba(37, 99, 235, 0.1);
  --border: #e2e8f0;
  --surface-hover: #f1f5f9;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --sidebar-width: 280px;
}

[data-theme="dark"] {
  --bg-body: #0b1021;
  --bg-header: #0f172a;
  --bg-sidebar: #0f172a;
  --bg-card: #1e293b;
  --bg-section: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-glow: rgba(59, 130, 246, 0.15);
  --border: #334155;
  --surface-hover: #334155;
  --shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text-primary);
  background: var(--bg-body);
  font-size: 16px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-hover); }

/* ---------- Utility ---------- */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0 60px 0;
  position: relative;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 5px; height: 28px;
  background: var(--accent);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  margin: 0 0 40px 0;
  max-width: 700px;
}

.hero-subtitle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--accent);
  margin-bottom: 20px;
  display: inline-block;
}

.sep {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ---------- Reveal animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ---------- Header (top bar) ---------- */
.site-header {
  position: fixed;
  top: 0; left: var(--sidebar-width); right: 0;
  z-index: 100;
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.brand .accent { color: var(--accent); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.lang-toggle a {
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.lang-toggle a:hover { color: var(--accent); background: var(--surface-hover); }
.lang-toggle a.active { color: var(--accent); background: var(--surface-hover); }

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px; height: 36px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(15deg); }

/* ---------- Sidebar (left navigation) ---------- */
.site-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  z-index: 99;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar-inner {
  padding: 32px 20px;
  overflow-y: auto;
  height: 100%;
}

.sidebar-brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-brand .accent { color: var(--accent); }

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav li { margin: 0; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 10px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.sidebar-nav a:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.sidebar-social {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-social a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.sidebar-social a:hover {
  color: var(--accent);
  background: var(--surface-hover);
}

/* ---------- Main content ---------- */
.site-main {
  flex: 1;
  overflow-y: auto;
  padding-left: var(--sidebar-width);
  background: var(--bg-body);
  transition: all 0.3s ease;
}

.site-main .container {
  max-width: 1000px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 40px 0;
  background: var(--bg-body);
  overflow: hidden;
}

.hero .container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}

.hero-content { position: relative; }

.hero-plaque {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--accent);
  margin-bottom: 20px;
  display: inline-block;
}

.hero h1 {
  font-size: 52px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  letter-spacing: -1px;
  line-height: 1.1;
}

.hero h1 .highlight { color: var(--accent); }

.hero-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-meta span {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
}

.social-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.social-row a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.social-row a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.social-row img { width: 16px; height: 16px; display: block; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  align-items: start;
}

.about-grid .timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.about-grid .timeline-card h3 {
  margin: 0 0 12px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.about-grid .timeline-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- About (legacy classes for compatibility) ---------- */
.about-text p { margin-bottom: 18px; }
.about-text strong { color: var(--text-primary); }

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.about-card h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.about-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.about-card li {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.about-card li::before {
  content: '▹';
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

/* ---------- Mini contact cards (after About) ---------- */
.mini-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 40px 0 0 0;
}

.mini-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.mini-card .icon {
  font-size: 24px;
  margin-bottom: 10px;
  display: block;
}

.mini-card h3 {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.mini-card p {
  margin: 0 0 10px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.mini-card a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
}

.mini-card a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Experience (timeline) ---------- */
.timeline {
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 60px;
  margin-bottom: 40px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 22px;
  top: 4px;
  width: 14px; height: 14px;
  background: var(--accent);
  border: 3px solid var(--bg-body);
  border-radius: 50%;
  z-index: 2;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.timeline-card:hover { transform: translateX(-6px); border-color: var(--accent); }

.timeline-card h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
}

.timeline-card .org {
  color: var(--accent);
  font-weight: 700;
  font-size: 15px;
}

.timeline-card .meta {
  display: flex;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  margin: 8px 0 12px 0;
}

.timeline-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.timeline-card li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.timeline-card li::before {
  content: '—';
  color: var(--accent);
  font-weight: 800;
  position: absolute;
  left: 0;
}

.timeline-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Education & Certifications ---------- */
.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  transition: transform 0.2s ease;
}

.edu-card:hover { transform: translateY(-4px); border-color: var(--accent); }

.edu-card h3 {
  margin: 0 0 8px 0;
  font-size: 17px;
  font-weight: 800;
  color: var(--text-primary);
}

.edu-card .inst {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
}

.edu-card .period {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.edu-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- Carousel (certifications) ---------- */
.carousel-wrapper {
  position: relative;
  margin: 32px 0 0 0;
}

.carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 16px;
}

.carousel-track::-webkit-scrollbar { height: 6px; }
.carousel-track::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.carousel-track > * {
  scroll-snap-align: start;
  flex: 0 0 auto;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.carousel-btn.prev { left: -12px; }
.carousel-btn.next { right: -12px; }

.carousel-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Skills ---------- */
.skills-section {
  margin-top: 32px;
}

.skills-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease;
}

.skill-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.skill-card h4 {
  margin: 0 0 16px 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.skill-tags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tags li {
  background: var(--surface-hover);
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-weight: 500;
  transition: all 0.2s ease;
}

.skill-tags li:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.skill-full {
  grid-column: 1 / -1;
  margin-bottom: 24px;
}

/* ---------- Portfolio accordions ---------- */
.portfolio-intro {
  max-width: 700px;
  margin: 0 auto 48px auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 17px;
}

.portfolio-group {
  margin-bottom: 56px;
}

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

.accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-item summary {
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
}

.accordion-item summary:hover {
  background: var(--surface-hover);
}

.accordion-item summary::-webkit-details-marker { display: none; }

.accordion-item summary::after {
  content: '+';
  font-size: 18px;
  color: var(--accent);
}

.accordion-item[open] summary::after {
  content: '−';
}

.accordion-item .accordion-content {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 14px;
}

.accordion-item .accordion-content p {
  margin: 0 0 10px 0;
  line-height: 1.55;
}

.accordion-item .accordion-content p:last-child { margin-bottom: 0; }

.accordion-item .accordion-content .tags-row {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.accordion-item .accordion-content .tags-row li {
  background: var(--surface-hover);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  list-style: none;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-header);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer p { margin: 0; font-size: 14px; }
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ---------- Mobile menu toggle button ---------- */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 10px;
  z-index: 999999;
  position: relative;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---------- Tablet & Desktop (above 900px) ---------- */
@media (min-width: 901px) {
  .mobile-menu-toggle { display: none !important; }
  .site-sidebar { transform: none !important; visibility: visible !important; }
  body { overflow: hidden; height: 100vh; }
}

/* ---------- Mobile (up to 900px) ---------- */
@media (max-width: 900px) {
  body { overflow: auto; height: auto; }
  .site-header { left: 0; right: 0; z-index: 100; position: fixed; width: 100%; }
  
  .site-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    z-index: 500;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    pointer-events: none;
  }
  .site-sidebar.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 390;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
  }
  .mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.menu-open {
    overflow: hidden !important;
  }
  .site-main {
    padding-left: 0;
    padding-top: 80px;
    width: 100%;
    overflow-y: auto;
  }
  .mobile-menu-toggle { display: flex; }
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .timeline::before { left: 22px; }
  .timeline-item { padding-left: 52px; }
  .timeline-item::before { left: 16px; top: 4px; }
  .section { padding: 70px 0; }
  .carousel-btn.prev { left: 0; }
  .carousel-btn.next { right: 0; }
}

/* ---------- Small mobile (up to 480px) ---------- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 36px; }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .social-row { justify-content: center; }
  .section-title { font-size: 24px; }
  .timeline-item { margin-bottom: 30px; }
  .edu-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}

/* ---------- Prevent horizontal scroll on mobile ---------- */
@media (max-width: 900px) {
  .site-main {
    overflow-x: hidden;
  }
  .container {
    overflow-x: hidden;
  }
  body {
    overflow-x: hidden;
  }
}

/* ---------- Key facts (hero-style bar) ---------- */
.key-facts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 24px 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.key-fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 90px;
}

.key-fact strong {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  white-space: normal;
  margin-bottom: 4px;
}

.key-fact span {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
  white-space: normal;
  line-height: 1.3;
}

/* Tablet */
@media (max-width: 768px) {
  .key-facts {
    gap: 16px;
    padding: 18px 20px;
  }
  .key-fact strong {
    font-size: 18px;
  }
  .key-fact span {
    font-size: 12px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .key-facts {
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 16px;
  }
  .key-fact {
    flex: 1;
    min-width: 120px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px;
    background: var(--surface-hover);
    border-radius: 12px;
    border: 1px solid var(--border);
  }
  .key-fact strong {
    font-size: 18px;
    white-space: normal;
  }
  .key-fact span {
    font-size: 12px;
    white-space: normal;
    line-height: 1.3;
  }
}

/* ---------- Small mobile (up to 480px) ---------- */
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 36px; }
  .hero-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .social-row { justify-content: center; }
  .section-title { font-size: 24px; }
  .timeline-item { margin-bottom: 30px; }
  .edu-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
}

/* ---------- Hide other language ---------- */
/* ---------- Mobile menu overlay ---------- */
.mobile-menu-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 105;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

body.menu-open {
  overflow: hidden !important;
}

body.lang-ru .lang-en,
body.lang-en .lang-ru {
  display: none !important;
}

/* ---------- Additional mobile refinements ---------- */
@media (max-width: 900px) {
  .hero-meta span {
    white-space: nowrap;
    font-size: 12px;
    padding: 5px 12px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hero-actions .btn {
    justify-content: center;
  }
  .social-row {
    justify-content: center;
    flex-wrap: wrap;
  }
  .social-row a {
    font-size: 12px;
    padding: 8px 14px;
  }
  .hero h1 {
    font-size: 42px;
    line-height: 1.15;
  }
  .section-title {
    font-size: 24px;
  }
  .section-subtitle {
    font-size: 16px;
    margin-bottom: 32px;
  }
  .timeline-card {
    padding: 20px;
  }
  .timeline-card h3 {
    font-size: 17px;
  }
  .edu-card {
    padding: 20px;
  }
  .edu-card h3 {
    font-size: 16px;
  }
  .skill-card {
    padding: 20px;
  }
  .skill-card h4 {
    font-size: 12px;
  }
  .skill-tags li {
    font-size: 12px;
    padding: 5px 10px;
  }
  .card {
    padding: 20px;
  }
  .case-card {
    padding: 22px;
  }
  .case-card h3 {
    font-size: 16px;
  }
  .contact-card {
    padding: 22px;
  }
  .mini-card {
    padding: 16px 18px;
  }
  .mini-card .icon {
    font-size: 24px;
  }
  table.data {
    font-size: 13px;
  }
  table.data th, table.data td {
    padding: 8px 10px;
  }
}

/* ---------- Tablet (768px - 900px) ---------- */
@media (min-width: 769px) and (max-width: 900px) {
  .skills-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .skill-full {
    grid-column: 1 / -1;
  }
  .edu-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .about-grid {
    grid-template-columns: 1fr 300px;
  }
}

/* ---------- Prevent horizontal scroll on mobile ---------- */
@media (max-width: 900px) {
  .site-main {
    overflow-x: hidden;
  }
  .container {
    overflow-x: hidden;
  }
  body {
    overflow-x: hidden;
  }
}
