@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface-hover: #f1f3f5;
  --text: #212529;
  --text-secondary: #6c757d;
  --accent: #0d6efd;
  --accent-hover: #0b5ed7;
  --border: #dee2e6;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
  --shadow-hover: 0 12px 24px rgba(0,0,0,0.08);
  --transition: 0.3s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }

h1, h2, h3 { font-weight: 600; color: var(--text); }

.section-title {
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px;
}

/* Hero */
.hero {
  text-align: center;
  padding: 5rem 0 4rem;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 50%, #f8f9ff 100%);
}
.hero-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  margin-bottom: 1.5rem;
  transition: transform var(--transition);
}
.hero-photo:hover {
  transform: scale(1.05);
}
.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
.hero-title {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.hero-contacts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
}
.hero-contacts a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
}
.hero-contacts a:hover {
  color: var(--accent);
  background: white;
  border-color: var(--accent);
}

/* Portfolio grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0 4rem;
}

.project-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.card-img-wrapper {
  overflow: hidden;
}
.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition);
}
.project-card:hover img {
  transform: scale(1.05);
}
.card-body {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.card-date {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.card-date i {
  font-size: 0.8rem;
  color: var(--accent);
}
.card-body .short {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  flex-grow: 1;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: auto;
}
.tags span {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Анимация появления */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Project detail */
.project-detail {
  padding: 3rem 0;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.back:hover { color: var(--accent-hover); }

/* Заглавная картинка проекта */
.project-hero-image {
  margin-bottom: 2rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  max-height: 400px;
}
.project-hero-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.project-detail h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.meta i { margin-right: 0.3rem; color: var(--accent); }

.description {
  max-width: 800px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
  text-decoration: none;
}
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  padding: 1rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity var(--transition);
}
.gallery-item:hover .gallery-caption {
  opacity: 1;
}

/* Technologies cloud */
.tech-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}
.tech-cloud span {
  background: var(--surface);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--transition);
}
.tech-cloud span:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Downloads & external links */
.downloads, .external-links { margin-bottom: 2.5rem; }
.downloads h3, .external-links h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.downloads ul, .external-links ul {
  list-style: none;
  padding-left: 0;
}
.downloads li, .external-links li {
  margin-bottom: 0.5rem;
}
.downloads a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--surface);
  transition: background var(--transition), color var(--transition);
}
.downloads a:hover {
  background: var(--accent);
  color: white;
}
.external-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}
.external-links a:hover { color: var(--accent-hover); }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
/* Переключатель языка */
.lang-switch {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  gap: 0;
  background: var(--surface);
  border-radius: 20px;
  padding: 0.2rem;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  z-index: 10;
}
.lang-switch a {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 18px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.3s;
}
.lang-switch a.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 6px rgba(13,110,253,0.3);
}
.lang-switch a:not(.active):hover {
  background: var(--border);
  color: var(--text);
}
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero-contacts { flex-direction: column; align-items: center; gap: 0.5rem; }
  .meta { flex-direction: column; gap: 0.5rem; }
}