* { margin: 0; padding: 0; box-sizing: border-box; }

/* Убираем горизонтальные баги (вылезание контента) */
html, body { max-width: 100vw; overflow-x: hidden; }

body { 
  background: #e0e2e5 url('bg.jpg') no-repeat center center/cover; 
  background-attachment: fixed; 
  color: #111; 
  font-family: 'Manrope', sans-serif; 
  height: 100vh; 
  overflow: hidden; 
  perspective: 1000px; 
}

.ambient-glow { 
  position: absolute; width: 600px; height: 600px; border-radius: 50%; filter: blur(90px); z-index: -1; animation: floatOrb 10s infinite alternate; 
  /* ОПТИМИЗАЦИЯ GPU: Перенос рендеринга на видеокарту для устранения лагов */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.glow-1 { top: -20%; right: -10%; background: radial-gradient(circle, rgba(147, 51, 234, 0.15), transparent 70%); }
.glow-2 { bottom: -20%; left: -10%; background: radial-gradient(circle, rgba(51, 147, 234, 0.15), transparent 70%); animation-delay: 2s; }
@keyframes floatOrb { 0% { transform: translateY(0) scale(1); } 100% { transform: translateY(50px) scale(1.1); } }

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 2rem 4rem; z-index: 50; position: relative; }
.logo-wrapper { background: rgba(255, 255, 255, 0.3); backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 20px; padding: 8px; display: flex; box-shadow: 0 10px 30px rgba(0,0,0,0.1); transition: 0.3s; }
.logo-wrapper:hover { transform: scale(1.05); }
.brand-logo { height: 50px; width: 50px; object-fit: contain; border-radius: 12px; mix-blend-mode: multiply; }

.burger-btn { background: transparent; border: none; cursor: pointer; display: flex; flex-direction: column; gap: 6px; z-index: 1000; }
.burger-btn span { width: 40px; height: 3px; background: #111; transition: 0.3s; }
.burger-btn:hover span { width: 50px; background: #6b7280; }

.glass-menu { 
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
  background: rgba(224, 226, 229, 0.92); 
  backdrop-filter: blur(15px); /* Снижено для плавной анимации на мобильных */
  z-index: 999; display: flex; justify-content: center; align-items: center; 
  visibility: hidden; opacity: 0; 
  will-change: opacity;
}
.menu-content { text-align: center; }
.menu-link-wrapper { overflow: hidden; margin-bottom: 20px; }
.menu-link { display: inline-block; font-family: 'Unbounded', sans-serif; font-size: 3.5rem; font-weight: 900; color: #111; text-decoration: none; text-transform: uppercase; transform: translateY(100%); transition: 0.3s; }
.menu-link:hover { color: #6b7280; transform: translateY(0) scale(1.05); }

/* Крестик в бургер-меню */
#closeMenu { position: absolute; top: 30px; right: 30px; background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 50%; width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; font-size: 2rem; cursor: pointer; color: #111; transition: all 0.3s; z-index: 1010; }
#closeMenu:hover { background: #fff; transform: scale(1.1) rotate(90deg); }

.hero { display: flex; flex-direction: column; justify-content: center; padding: 0 4rem; height: calc(100vh - 120px); position: relative; }
.hero-title { font-family: 'Unbounded', sans-serif; font-size: 6.5rem; font-weight: 900; line-height: 1.15; text-transform: uppercase; color: #ffffff; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.4)); margin-bottom: 2rem; }
.line { overflow: hidden; padding: 0; margin: 0; }
.word { display: inline-block; transform: translateY(120%); transition: transform 0.3s ease; }
.interactive-word:hover { transform: translateY(0) scale(1.05) rotate(-2deg); cursor: default; }
.highlight { color: transparent; -webkit-text-stroke: 1.5px #ffffff; }

.hero-bottom-grid { display: flex; flex-direction: column; gap: 40px; }
.hero-subtitle { max-width: 550px; font-size: 1.1rem; line-height: 1.6; color: #ffffff; font-weight: 400; opacity: 0; background: rgba(0, 0, 0, 0.3); backdrop-filter: blur(15px); padding: 20px 30px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); }
.opacity-hidden { opacity: 0; }
.hero-actions { display: flex; gap: 20px; align-items: center; }

@keyframes buttonFloat { 0% { transform: translateY(0); } 100% { transform: translateY(-8px); } }
.float-anim { animation: buttonFloat 3s infinite alternate ease-in-out; }
.float-anim-delayed { animation: buttonFloat 3s infinite alternate ease-in-out 1.5s; }
.glass-btn { display: inline-flex; padding: 18px 32px; background: rgba(17, 17, 17, 0.85); backdrop-filter: blur(20px); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 100px; color: #fff; text-decoration: none; font-family: 'Unbounded', sans-serif; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; transition: 0.4s; cursor: pointer; }
.glass-btn:hover { background: rgba(0, 0, 0, 1); box-shadow: 0 15px 30px rgba(0,0,0, 0.3); animation-play-state: paused; }
.glass-btn.outline { background: transparent; border: 1px solid rgba(17, 17, 17, 0.4); color: #111; backdrop-filter: none; }
.glass-btn.outline:hover { background: rgba(17, 17, 17, 0.05); border-color: #111; }

/* === ОПТИМИЗИРОВАННЫЕ ПОПАПЫ (iOS SAFARI СОВМЕСТИМОСТЬ) === */
.popup-section { 
  position: fixed; top: 100%; left: 0; width: 100%; 
  height: 100vh;
  height: 100dvh; /* Динамический viewport для iPhone */
  background: rgba(224, 226, 229, 0.95); backdrop-filter: blur(40px); 
  z-index: 1000; 
  overflow: hidden; 
  transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1); 
}
.popup-section.active { transform: translateY(-100%); }

/* Локальная область скролла */
.popup-scroll-area {
  width: 100%; height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* Плавность для iOS */
  padding: 6rem 4rem 4rem 4rem;
}

/* Статичный «летающий» крестик, независимый от скролла */
.close-popup { 
  position: absolute; top: 30px; right: 30px; 
  background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); 
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 50%; 
  width: 60px; height: 60px; display: flex; justify-content: center; align-items: center; 
  font-size: 2rem; cursor: pointer; color: #111; z-index: 1010; transition: all 0.3s; 
}
.close-popup:hover { background: #fff; transform: scale(1.1) rotate(90deg); }

.popup-title { font-family: 'Unbounded', sans-serif; font-size: 3.5rem; text-transform: uppercase; margin-bottom: 1.5rem; text-align: center; }
.popup-disclaimer { text-align: center; color: #333; font-size: 0.95rem; font-weight: 600; margin-bottom: 3rem; max-width: 700px; margin-left: auto; margin-right: auto; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; max-width: 1000px; margin: 0 auto; }
.glass-card { background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.7); padding: 30px; border-radius: 20px; transition: 0.3s; display: flex; flex-direction: column; }
.glass-card:hover { transform: translateY(-10px); background: rgba(255, 255, 255, 0.9); box-shadow: 0 20px 40px rgba(0,0,0, 0.1); }
.glass-card h3 { font-family: 'Unbounded', sans-serif; font-size: 1.1rem; margin-bottom: 15px; }
.glass-card p { color: #444; font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; flex-grow: 1; }
.price { align-self: flex-start; font-weight: 800; background: #111; color: #fff; padding: 8px 16px; border-radius: 50px; font-size: 0.8rem; }
.link-card { text-decoration: none; color: inherit; cursor: pointer; }

/* === ТАБЫ (ДЛЯ СЕКЦИИ О НАС / ГАРАНТИЙ) === */
.tabs-nav { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; flex-wrap: wrap; }
.tab-btn { 
  background: rgba(255, 255, 255, 0.4); border: 1px solid rgba(255, 255, 255, 0.6); 
  padding: 14px 28px; border-radius: 100px; font-family: 'Unbounded', sans-serif; 
  font-size: 0.9rem; cursor: pointer; transition: 0.3s; color: #111; 
}
.tab-btn.active, .tab-btn:hover { background: #111; color: #fff; border-color: #111; }
.tabs-content { max-width: 1000px; margin: 0 auto; }
.tab-pane { display: none; animation: tabFadeIn 0.5s ease forwards; }
.tab-pane.active { display: block; }

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.about-hero { background: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.7); padding: 40px; border-radius: 24px; text-align: left; }
.about-hero h3 { font-family: 'Unbounded', sans-serif; font-size: 1.6rem; margin-bottom: 20px; line-height: 1.4; }
.about-hero p { font-size: 1.1rem; line-height: 1.7; color: #333; margin-bottom: 20px; }
.about-hero p:last-child { margin-bottom: 0; }

/* Калькулятор */
.calc-wrapper { display: flex; flex-wrap: wrap; gap: 40px; max-width: 1000px; margin: 0 auto; text-align: left; }
.calc-options { flex: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; align-content: start; }
.calc-item { display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.5); padding: 20px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.7); cursor: pointer; transition: 0.3s; font-weight: 600; }
.calc-item:hover { background: rgba(255, 255, 255, 0.9); transform: scale(1.02); }
.calc-cb { width: 22px; height: 22px; margin-right: 15px; accent-color: #111; cursor: pointer; }
.calc-total-box { flex: 1; background: rgba(17, 17, 17, 0.85); color: #fff; padding: 40px; border-radius: 20px; text-align: center; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 20px 50px rgba(0,0,0,0.2); height: max-content; }
.total-price { font-size: 3.5rem; font-family: 'Unbounded', sans-serif; margin: 20px 0; }
.calc-order-btn { width: 100%; justify-content: center; background: #fff; color: #111; border: none; }
.calc-order-btn:hover { background: #e0e2e5; }

/* === МОБИЛЬНАЯ АДАПТАЦИЯ (iPhone 15 Pro Max и др.) === */
@media (max-width: 768px) {
  .navbar { padding: 1.5rem; } 
  .logo-wrapper { padding: 6px; } 
  .brand-logo { height: 40px; width: 40px; }
  .hero { padding: 0 1.5rem; height: calc(100dvh - 90px); }
  
  /* ИСПРАВЛЕНИЕ: "АВТОМАТИЗИРУЕМ" больше не обрезается */
  .hero-title { font-size: clamp(1.2rem, 5.5vw, 2.2rem); line-height: 1.2; margin-bottom: 1rem; word-break: break-word; }
  .line { overflow: visible; padding-bottom: 5px; margin-bottom: -5px; }
  .hero-subtitle { font-size: 0.95rem; padding: 15px 20px; margin-bottom: 1rem; }
  .hero-actions { flex-direction: column; width: 100%; gap: 15px; }
  .glass-btn { width: 100%; text-align: center; justify-content: center; padding: 16px 20px; }
  
  .menu-link { font-size: 2.2rem; }
  
  /* ИСПРАВЛЕНИЕ: Добавлен огромный нижний отступ для безопасного скролла */
  .popup-scroll-area { padding: 5rem 1.5rem 8rem 1.5rem; }
  .popup-title { font-size: 2rem; margin-bottom: 1rem; }
  .popup-disclaimer { font-size: 0.85rem; margin-bottom: 2rem; }
  
  .close-popup, #closeMenu { top: 15px; right: 15px; width: 45px; height: 45px; font-size: 1.5rem; }
  
  .cards-grid, .calc-options { grid-template-columns: 1fr; }
  .calc-wrapper { flex-direction: column; gap: 20px; }
  .total-price { font-size: 2.2rem; }

  .tab-btn { padding: 10px 18px; font-size: 0.8rem; }
  .about-hero { padding: 20px; }
  .about-hero h3 { font-size: 1.2rem; }
  .about-hero p { font-size: 0.95rem; }
}