/* ============================================================
   OPTIMIZIRUEM SYSTEM DESIGN v2.0
   Единая стилистика сайта: чистая, технологичная, минималистичная
   ============================================================ */

/* === 1. ПЕРЕМЕННЫЕ === */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f9f9fb;
  --color-text: #111;
  --color-text-secondary: #555;
  --color-accent: #7c3aed;
  --radius: 10px;
  --section-space: 60px;
}

/* === 2. БАЗОВЫЕ ЭЛЕМЕНТЫ === */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'Inter', 'Nunito', 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: var(--section-space) 0;
  position: relative;
}

.section h2 {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 12px auto 0;
  border-radius: 2px;
}

/* === 3. HERO === */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
  background: var(--color-bg);
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(circle, rgba(240,242,255,0.7) 0%, transparent 80%);
  filter: blur(70px);
  z-index: 0;
}

.hero .container { position: relative; z-index: 1; }

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-text);
  line-height: 1.2;
}

.hero p {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin: 0 auto 28px;
  max-width: 560px;
}

/* --- Primary Button --- */
.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: 0.25s;
}

.btn-primary:hover {
  background: #5b50ff;
  box-shadow: 0 0 20px rgba(79,70,229,0.3);
  transform: translateY(-2px);
}

/* === 4. БЛОК “ЧТО ДЕЛАЮ” === */
.section.what-i-do {
  background: linear-gradient(180deg, #ffffff 0%, #fafaff 100%);
  border-top: 1px solid #e9e9ee;
  padding: 60px 0; /* было 50px 0 60px — теперь ровный ритм */
}

.section.cases {
  background: linear-gradient(180deg, #fafaff 0%, #f7f7fc 100%);
  border-top: 1px solid #e9e9ee;
  padding: 70px 0 60px;
}

.what-i-do .cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 25px;
}

.what-i-do .card {
  border: 1px solid #e4e4ec;
  border-radius: var(--radius);
  background: #fff;
  padding: 24px 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.what-i-do .card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.1);
  transform: translateY(-2px);
}

.what-i-do .card h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.what-i-do .card p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* === 5. БЛОК “ПРИМЕРЫ АВТОМАТИЗАЦИИ” === */
.cases {
  border-top: 1px solid #e9e9ee;
  padding: 56px 0 64px;
  background: linear-gradient(180deg, #fafaff 0%, #f7f7fc 100%);
}

.cases h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--color-accent);
  margin: 12px auto 0;
  border-radius: 2px;
}


.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.case-card {
  border: 1px solid #e0e0ec;
  border-radius: var(--radius);
  padding: 24px 20px;
  background: #fff;
transition: border-color 0.3s ease, box-shadow 0.35s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.case-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
  transform: translateY(-3px);
}

.case-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.4;
}

.case-card p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

/* --- Кнопка внутри кейса --- */
.btn-secondary {
  align-self: start;
  padding: 8px 16px;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--color-accent);
  color: #fff;
}

/* === 6. CTA (если используется) === */
.cta {
  text-align: center;
  padding: 70px 20px 80px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f8ff 100%);
  border-top: 1px solid #e9e9ee;
}

.cta h3 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
}

.cta p {
  font-size: 18px;
  color: var(--color-text-secondary);
  margin-bottom: 24px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta .btn-primary {
  padding: 12px 32px;
}

/* === 7. УТИЛИТЫ === */
.fadein {
  opacity: 0;
  animation: fadein 0.9s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(12px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}


.fadein-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  filter: blur(8px);
  transition: opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.9s cubic-bezier(0.25, 0.1, 0.25, 1),
              filter 1s ease;
}

.fadein-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.case-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.case-card.visible {
  opacity: 1;
  transform: translateY(0);
}




/* --- HEADER --- */
.site-header {
  position: relative;
  width: 100%;
  background-color: #fff;        /* фон на всю ширину */
  border-bottom: 1px solid #ececf3;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  min-width: 100vw;
  z-index: 1000;
}

.site-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed 0%, #5b21b6 100%);
  opacity: 0.08;
}


.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px;
}

/* ЛОГОТИП */
.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.25px;
  text-decoration: none;
  color: var(--color-text);
  transition: color 0.25s ease;
}


.logo span {
  color: var(--color-accent);
  transition: color 0.3s ease, letter-spacing 0.2s ease;
}

.logo:hover span {
  letter-spacing: 0.3px;
  color: #5b50ff; /* чуть ярче при hover */
}

/* МЕНЮ */
.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.main-nav a {
	  font-size: 15px;   /* было 16 (по умолчанию) */
  margin-left: 24px; /* вместо 32 */
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0;
  position: relative;
  transition: color 0.2s ease;
}

/* Тонкая фиолетовая линия при hover */
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 1.5px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.main-nav a:hover {
  color: var(--color-accent);
}

.main-nav a:hover::after {
  transform: scaleX(1);
}

/* === FOOTER === */
.site-footer {
  background: #fafafa;
  border-top: 1px solid #ececf3;
  padding: 32px 20px;
  font-size: 14px;
  color: #666;
  min-width: 100vw;
  
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-link {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #5b50ff;
}

/* === ЗАДЕРЖКА МЕЖДУ ЗАГОЛОВКОМ И КАРТОЧКАМИ === */

/* когда появляется вся сетка кейсов */
/* === ЗАДЕРЖКА ПОЯВЛЕНИЯ КАРТОЧЕК В "ЧТО ДЕЛАЮ" === */

.what-i-do .cases-grid.visible .card {
  opacity: 1;
  transform: translateY(0);
}

/* поэтапная задержка */
.what-i-do .cases-grid.visible .card:nth-child(1) { transition-delay: 0.1s; }
.what-i-do .cases-grid.visible .card:nth-child(2) { transition-delay: 0.2s; }
.what-i-do .cases-grid.visible .card:nth-child(3) { transition-delay: 0.3s; }
.what-i-do .cases-grid.visible .card:nth-child(4) { transition-delay: 0.4s; }



/* ============================================================
   8. МЕЛКАЯ АДАПТИВКА
   ============================================================ */

/* --- Планшеты --- */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
    margin-bottom: 32px;
  }

  .hero {
    padding: 60px 16px 50px;
  }

  .hero p {
    font-size: 16px;
  }

  .main-nav {
    gap: 20px;
  }

  .main-nav a {
    margin-left: 0;
    font-size: 15px;
  }

  .cases-grid,
  .what-i-do .cases-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
  }

  .case-card,
  .what-i-do .card {
    padding: 20px 16px;
  }
}

/* --- Смартфоны --- */
@media (max-width: 480px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 22px;
    margin-bottom: 28px;
  }

  .hero {
    padding: 50px 14px 40px;
  }

  .hero p {
    font-size: 15px;
  }

  .btn-primary,
  .btn-secondary {
    font-size: 14px;
    padding: 9px 18px;
  }

  .cases-grid,
  .what-i-do .cases-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .case-card h3,
  .what-i-do .card h3 {
    font-size: 17px;
  }

  .case-card p,
  .what-i-do .card p {
    font-size: 15px;
  }

  .header-inner {
    flex-direction: column;
    gap: 8px;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }

  .site-footer {
    text-align: center;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }
}

html, body {
  overflow-x: hidden; /* убираем горизонтальную прокрутку */
}

/* фиксируем поведение header и footer */
.site-header,
.site-footer {
  min-width: 100vw;
  box-sizing: border-box; /* чтобы паддинги не расширяли ширину */
  margin: 0;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.case-card:hover {
  transform: translateY(-3px) !important;
}
.case-card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease !important;
}

.case-card:hover {
  transform: translateY(-3px) !important;
}

.case-card:hover {
  border-color: var(--color-accent) !important;
  box-shadow:
    0 6px 18px rgba(124, 58, 237, 0.25),
    0 0 20px rgba(124, 58, 237, 0.20) !important;
  transform: translateY(-3px) !important;
}

.what-i-do .card:hover {
  border-color: var(--color-accent) !important;
  box-shadow:
      0 6px 18px rgba(124, 58, 237, 0.20),
      0 0 20px rgba(124, 58, 237, 0.18) !important;
  transform: translateY(-3px) !important;
}

.case-video-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 32px auto;
}

.case-video-aspect {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* фиксированное 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.case-video-aspect iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}
/* Mobile fix */
@media (max-width: 600px) {
    .case-video-wrapper {
        max-width: 90%;       /* делаем чуть уже контейнер */
        margin: 24px auto;    /* центрируем */
    }

    .case-video-aspect {
        border-radius: 0;     /* убираем скругления */
    }
}
