:root {
  --bg: #FFFFFF;
  --text: #222222;
  --muted: #777777;
  --content-width: 1090px;
  --radius: 25px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.container {
  width: var(--content-width);
  margin: 0 auto;
  flex-grow: 1;
}

/* ===== Header ===== */
.header { height: 100px; display: flex; align-items: center; }
.header-inner {
  width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav { display: flex; gap: 50px; align-items: center; font-size: 16px; }
.nav a { transition: color 0.2s ease; color: #ADB3B3; }
.nav a.active, .nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 30px; }

.languages { 
  display: flex; 
  gap: 3px; 
  padding: 3px; 
  border-radius: 100px; 
  background: #F2F5F5; /* ← было #ededeb */
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03);
}

.languages button, .languages .lang-link {
  border: 0; 
  background: transparent; 
  border-radius: 100px;
  width: 34px; 
  height: 34px; 
  cursor: pointer; 
  color: #ADB3B3; 
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.languages button.active { 
  background: #fff; 
  color: var(--text); 
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08); /* ← добавили мягкую тень */
}

.contact-button {
  padding: 13px 30px; border-radius: 100px; background: #222; color: #fff;
  font-size: 16px; font-weight: 700; transition: background 0.2s ease;
}
.contact-button:hover { background: #555; }

/* ===== Intro ===== */
.intro { padding-top: 20px; }
h1 { font-size: 70px; line-height: 1.05; letter-spacing: -4px; font-weight: 700; margin: 0 0 30px; }
.intro-description { max-width: 700px; font-size: 16px; line-height: 1.4; margin: 0; }

/* ===== Project grid ===== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 600px 353px;
  gap: 15px;
  margin-top: 40px;
}
.project-card {
  position: relative; overflow: hidden; border-radius: var(--radius); color: white;
  padding: 40px; display: flex; flex-direction: column; justify-content: flex-end;
  isolation: isolate; background: #333;
}
.project-card.featured { grid-column: 1 / -1; grid-row: 1; min-height: 600px; }
.project-card img.card-image {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: -3; transition: transform 0.6s ease;
}
.project-card:hover img.card-image { transform: scale(1.025); }
.project-title { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 0 0 14px; }
.project-subtitle { font-size: 16px; margin: 0; }
.project-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 28px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 7px 13px;
  border-radius: 100px;
  background: rgba(224, 232, 232, 0.3);
  backdrop-filter: blur(4px) saturate(1.4) brightness(1.05);
  -webkit-backdrop-filter: blur(4px) saturate(1.4) brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}

.arrow {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(4px) saturate(1.4) brightness(1.05);
  -webkit-backdrop-filter: blur(4px) saturate(1.4) brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  font-size: 14px;
  line-height: 1;
  color: #fff;
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
}
.arrow svg {
  display: block;
  width: 12px;
  height: 10px;
}
.project-card:hover .arrow { background: rgba(255,255,255,0.45); transform: translate(2px, -2px); }

/* ===== Tabs ===== */
.project-tabs {
  display: flex; gap: 50px; margin-top: 100px;
  font-size: 16px; font-weight: 500; white-space: nowrap;
  scroll-margin-top: 120px;
}
.project-tabs a { color: #adb3b3; cursor: pointer; transition: color 0.2s ease; }
.project-tabs a.active { color: var(--text); }

/* ===== Cases ===== */
.case-content-wrapper { padding-top: 90px; }
.case-item { display: none; }
.case-item.active { display: block; }

.case-item h2 {
  font-size: 40px; line-height: 1.1; letter-spacing: -1.5px; margin: 0 0 20px;
}
.case-intro { max-width: 700px; margin: 0; font-size: 16px; line-height: 1.4; }

.case-visual {
  margin-top: 50px;
}

.case-visual img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 18px;
  object-fit: contain;
}

.case-section { margin-top: 80px; }
.case-section h3 {
  font-size: 16px;
  line-height: 1.3;
  margin: 0 0 15px;
  font-weight: 700;
}
.case-section h3.case-title-large {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 20px;
  letter-spacing: -0.5px;
}

/* Стили для новых подразделов */
.case-subsection {
  margin-bottom: 40px;
}
.case-subsection:last-child {
  margin-bottom: 0;
}
.case-subsection h4 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 15px;
}

.case-section p { max-width: 700px; margin: 0 0 25px; line-height: 1.4; }
.case-subsection p { max-width: 700px; margin: 0 0 25px; line-height: 1.4; }
.case-section + .case-section { margin-top: 80px; }
.case-section p { max-width: 700px; margin: 0 0 15px; line-height: 1.4; }
.case-section + .case-section { margin-top: 80px; }

.two-images { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 25px; }
.three-images { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 25px; }

/* Сетка для Smartlabs */
.grid-masonry { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); /* 3 колонки */
  gap: 15px; 
  margin-top: 40px; 
  align-items: stretch;
}

/* Базовая квадратная картинка (занимает 1 колонку) */
.gm-square {
  grid-column: span 1;
  min-height: 353px;
}

/* Широкая картинка (занимает 2 колонки из 3) */
.gm-wide {
  grid-column: span 2;
  min-height: 353px;
}

/* Убираем жесткие ограничения по высоте для картинок внутри сетки */
.grid-masonry .image-placeholder {
  height: auto;
  min-height: 353px;
}

.grid-masonry .image-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-placeholder {
  border-radius: var(--radius); overflow: hidden; background: #e5e5e2;
  min-height: 353px;
}
.image-placeholder img { width: 100%; height: 100%; min-height: 353px; object-fit: cover; display: block; }
.full-width-img { margin-top: 25px; min-height: 450px; }
.full-width-img img { min-height: 450px; }

.brand-logos {
  display: flex; flex-wrap: wrap; gap: 20px; margin-top: 30px;
  align-items: center; padding: 30px; background: #fff; border-radius: var(--radius);
}
.brand-logos img { height: 28px; opacity: 0.7; }

/* ===== Result block ===== */
.result {
  margin-top: 100px; padding: 40px; border-radius: var(--radius); background: #eaeae7;
}
.result h3 { font-size: 24px; margin: 0 0 20px; }
.result p { max-width: 700px; margin: 0 0 20px; line-height: 1.4; }

/* ===== Footer ===== */
.footer {
  /* Растягиваем на всю ширину экрана, выходя за пределы контейнера */
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  
  /* Высота 50px и выравнивание по центру */
  height: 50px;
  display: flex;
  align-items: center;
  
  /* Черный фон */
  background-color: #222222;
  height: 50px;
  display: flex;
  align-items: center;
  background-color: #222222;
  
  margin-top: 80px; /* отступ сверху оставляем, чтобы текст не прилипал */
  margin-bottom: 0;  /* убираем отступ снизу */
  padding-bottom: 0; /* убираем внутренний отступ снизу */
}

/* Внутренний контейнер, чтобы текст не растягивался на весь экран, а стоял по краям */
.footer-bottom {
  width: var(--content-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  /* Белый текст */
  color: #FFFFFF;
  font-size: 13px;
  padding: 0; /* убираем старые отступы */
}

/* ===== Back to top ===== */
/* Обертка для кнопки, чтобы задать отступы */
.back-to-top-wrapper {
  margin-top: 80px;
  margin-bottom: 0px;
}

/* Сама кнопка */
.back-to-top {
  border: 0;
  border-radius: 100px;
  background: #222;
  color: #fff;
  padding: 13px 30px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}

.back-to-top:hover {
  background: #555;
}

/* Стиль для иконки */
.back-to-top .icon-arrow-up {
  display: block;
  width: 12px;
  height: 10px;
  transform: rotate(180deg);
}

/* ===== About page ===== */
.about-page { padding-top: 50px; padding-bottom: 0px; }

/* Секция 1: Фото и интро */
.about-hero { 
  display: grid; 
  grid-template-columns: 300px 1fr; 
  gap: 60px; 
  align-items: start; 
  margin-bottom: 100px;
}
.about-photo img { 
  width: 100%; 
  border-radius: var(--radius); 
  display: block; 
}
.about-text p { 
  font-size: 16px; 
  line-height: 1.5; 
  margin: 0 0 20px; 
  max-width: 640px; 
  font-weight: 500;
}

/* Общие стили для секций */
.about-section { 
  margin-top: 90px; 
}
.about-title { 
  font-size: 28px; 
  letter-spacing: -1px; 
  margin: 0 0 15px; 
  font-weight: 700;
}
.about-desc { 
  max-width: 700px; 
  line-height: 1.5; 
  margin: 0 0 30px; 
  font-size: 16px;
  font-weight: 500;
}

/* Стек */
.tech-stack { 
  display: flex; 
  gap: 15px; 
  flex-wrap: wrap; 
  margin-top: 20px; 
}
.tech-stack img { 
  width: 55px; 
  height: 55px; 
}

/* Проекты (без линеек, по макету) */
.about-projects-list { 
  margin-top: 10px; 
}
.about-project-item {
  display: grid; 
  grid-template-columns: 70px 1fr; 
  gap: 0 20px; /* Убираем вертикальный gap, зададим его через margin у описания */
  padding: 20px 0; 
  align-items: center; /* Выравниваем иконку и заголовок по центру */
}
.about-project-item:last-child {
  padding-bottom: 0;
}
.ap-icon {
  width: 70px; 
  height: 70px; 
  border-radius: 14px; 
  overflow: hidden;
  background: #ededeb; 
  display: grid; 
  place-items: center;
}
.ap-icon img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
}
.ap-content { 
  padding-top: 4px; 
}
.ap-header { 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
  margin-bottom: 12px; 
}
.ap-name { 
  font-size: 16px; 
  font-weight: 700; 
}
.ap-role { 
  font-size: 16px; 
  color: #9FA4A4; 
  font-weight: 400; 
}
.ap-desc { 
  grid-column: 1 / -1; /* Растягиваем на обе колонки */
  margin: 15px 0 0 0; 
  font-size: 15px; 
  line-height: 1.5; 
  color: var(--text); 
  max-width: 640px; 
}

/* Образование (без линеек) */
.education-list { 
  margin-top: 10px; 
}
.edu-item { 
  padding: 20px 0; 
}
.edu-item:last-child {
  padding-bottom: 0;
}
.edu-item h3 { 
  font-size: 16px; 
  margin: 0 0 6px; 
  font-weight: 700; 
}
.edu-item p { 
  margin: 0 0 6px; 
  font-size: 16px; 
  color: #9FA4A4; 
  font-weight: 400;
}
.edu-item .edu-desc { 
  color: var(--text); 
  margin-top: 8px; 
  max-width: 640px; 
  line-height: 1.5; 
  font-weight: 500;
}

/* ===== КАРУСЕЛЬ LIME ===== */
.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 600px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 25px;
  margin-bottom: 15px; /* отступ до панели логотипов */
  background: #f0f0f0;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.5s ease-in-out;
  width: 100%;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* чтобы картинка заполняла блок 600px */
  display: block;
}

/* Стеклянные кнопки (как теги) */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  z-index: 10;
  /* Жидкое стекло на основе ADB3B3 */
  background: rgba(173, 179, 179, 0.4); 
  backdrop-filter: blur(4px) saturate(1.4) brightness(1.05);
  -webkit-backdrop-filter: blur(4px) saturate(1.4) brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: background 0.2s;
}
.carousel-btn .icon-arrow {
  display: block;
  width: 12px;
  height: 10px;
}

/* Стрелка влево = поворот вниз-стрелки на 90 градусов */
.carousel-btn-prev .icon-arrow {
  transform: rotate(90deg);
}

/* Стрелка вправо = поворот вниз-стрелки на -90 градусов */
.carousel-btn-next .icon-arrow {
  transform: rotate(-90deg);
}

.carousel-btn:hover {
  background: rgba(173, 179, 179, 0.6);
}
.carousel-btn-prev { left: 40px; }
.carousel-btn-next { right: 40px; }

/* ===== ПАНЕЛЬ ЛОГОТИПОВ ===== */
.brand-logos-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
  background: #F2F5F5; /* серый фон миниблока */
  border-radius: var(--radius);
  padding: 0 40px;
  gap: 20px;
}

.brand-tab {
  background: none;
  border: none;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6; /* неактивное состояние */
  transition: opacity 0.3s, transform 0.3s;
}
.brand-tab:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Активная вкладка */
.brand-tab.active {
  opacity: 1;
}

/* Логика картинок логотипов */
.brand-tab .logo-light { display: block; }
.brand-tab .logo-dark { display: none; }

.brand-tab.active .logo-light { display: none; }
.brand-tab.active .logo-dark { display: block; }

/* Ограничение размера картинок логотипов */
.brand-tab img {
  max-height: 28px;
  max-width: 120px;
  object-fit: contain;
}
/* Ссылки внутри текста кейсов */
.case-section p a {
  text-decoration: underline;
  text-underline-offset: 2px; /* чуть отодвигаем подчеркивание от текста */
  transition: opacity 0.2s ease;
}

.case-section p a:hover {
  opacity: 0.6;
}
/* Кнопка копирования никнейма */
.copy-nickname {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.copy-nickname:hover {
  opacity: 0.6;
}

/* Фиксированная высота 353px для конкретных картинок */
.img-353,
.img-353 img {
  height: 353px !important;
  min-height: 353px !important;
  object-fit: cover;
}

/* ===== ПОПАП СВЯЗИ ===== */
.contact-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.contact-popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.contact-popup {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 480px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.contact-popup-overlay.active .contact-popup {
  transform: translateY(0);
}

.contact-popup-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #F2F5F5;
  border: none;
  width: 30px;          /* ← было 32px */
  height: 30px;         /* ← было 32px */
  border-radius: 50%;
  font-size: 20px;
  color: #777;
  cursor: pointer;
  display: grid;
  place-items: center;  /* ← центрирует крестик идеально */
  padding: 0;           /* ← убирает стандартные отступы кнопки */
  line-height: 1;       /* ← убирает лишнюю высоту строки */
  transition: background 0.2s, color 0.2s;
}

.contact-popup-close:hover {
  background: #e0e0e0;
  color: #222;
}

.contact-popup-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 30px;
  letter-spacing: -0.5px;
}

.contact-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-option {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #F2F5F5;
  border: 1px solid transparent;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-family: inherit;
}

.contact-option:hover {
  background: #e5eaea;
}

.contact-option-icon {
  width: 48px;
  height: 48px;
  background: #fff;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.contact-option-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-option-title {
  font-size: 16px;
  color: #9FA4A4;
  font-weight: 400;
}

.contact-option-value {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

/* Фиксированная ширина английской кнопки Contact */
html[lang="en"] .contact-button {
  width: 145px; /* Подгони под точную ширину русской кнопки */
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}