/* Добавьте в самое начало styles.css */
html, body {
    width: 100%;
    max-width: 100%;
    
}

body {
    overflow-x: clip; /* Более безопасная альтернатива */
}

* {
    box-sizing: border-box;
}

/* Убедитесь, что контейнеры не выходят за пределы */
.max-w-7xl, .max-w-6xl, .max-w-5xl, .max-w-4xl, .max-w-3xl {
    width: 100%;
}

/* Оптимизация анимаций */
* {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Базовые стили */
:root {
    --cubic-bezier: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    background-color: #f4efe9;
    color: #2b1f1a;
    overflow-x: hidden;
}

/* Breathing glow анимация */
@keyframes breathingGlow {
    0%, 100% {
        opacity: 0.18;
        transform: scale(0.96);
    }
    50% {
        opacity: 0.32;
        transform: scale(1.04);
    }
}

/* Pulse glow для карточек */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 
            0 25px 60px rgba(201, 162, 124, 0.25),
            0 5px 15px rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow: 
            0 25px 70px rgba(201, 162, 124, 0.35),
            0 8px 20px rgba(0, 0, 0, 0.08);
    }
}

/* Анимации для появления при скролле - ИСПРАВЛЕНО */
.animate-fade-in-left {
    opacity: 0;
    transform: translateX(-18px);
    transition: opacity 1.4s var(--cubic-bezier),
                transform 1.4s var(--cubic-bezier);
}

.animate-fade-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.animate-fade-in-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 1.4s var(--cubic-bezier),
                transform 1.4s var(--cubic-bezier);
}

.animate-fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-fade-in-scale {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
    transition: opacity 1.6s var(--cubic-bezier),
                transform 1.6s var(--cubic-bezier);
}

.animate-fade-in-scale.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Stagger элементы */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.4s var(--cubic-bezier),
                transform 1.4s var(--cubic-bezier);
}

.stagger-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Request cards анимация */
.request-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s var(--cubic-bezier),
                transform 0.8s var(--cubic-bezier);
}

.request-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Breathing glow элемент */
.breathing-glow {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 620px;
    height: 620px;
    border-radius: 50%;
    background: #c9a27c;
    filter: blur(220px);
    opacity: 0.18;
    animation: breathingGlow 8s ease-in-out infinite;
    pointer-events: none;
}

/* Hover эффекты */
.card-hover {
    box-shadow: 0 20px 60px rgba(201,162,124,0.35);
    transition: box-shadow 0.4s var(--cubic-bezier), 
                transform 0.3s ease;
}

.card-hover:hover {
    box-shadow: 0 30px 90px rgba(201,162,124,0.55);
    transform: translateY(-4px);
}

.logo-hover {
    transition: transform 0.3s ease;
}

.logo-hover:hover {
    transform: scale(1.05);
}

.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-4px);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* REQUESTS SECTION STYLES */
.requests-container {
    opacity: 1;
}

.request-card-inner {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 32px 28px;
    height: 100%;
    min-height: 180px;
    transition: all 0.6s var(--cubic-bezier);
    box-shadow: 
        0 10px 40px rgba(201, 162, 124, 0.15),
        0 1px 3px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.request-card-inner:hover {
    transform: translateZ(20px) translateY(-8px);
    box-shadow: 
        0 25px 60px rgba(201, 162, 124, 0.25),
        0 5px 15px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-color: rgba(201, 162, 124, 0.4);
    animation: pulseGlow 2s ease-in-out infinite;
}

.request-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(201, 162, 124, 0.4), 
        rgba(201, 162, 124, 0.6),
        rgba(201, 162, 124, 0.4),
        transparent);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.request-card:hover .request-glow {
    opacity: 1;
}

.request-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

.request-icon {
    font-size: 28px;
    opacity: 0.8;
    transition: all 0.4s ease;
    margin-bottom: 8px;
}

.request-card:hover .request-icon {
    opacity: 1;
    transform: scale(1.1);
}

.request-text {
    font-size: 18px;
    font-weight: 500;
    color: #4a372f;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.request-card:hover .request-text {
    color: #2b1f1a;
}

/* Цветные акценты для разных карточек */
.request-card:nth-child(1) .request-glow {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 107, 107, 0.4), 
        rgba(255, 107, 107, 0.6),
        rgba(255, 107, 107, 0.4),
        transparent);
}

.request-card:nth-child(2) .request-glow {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(107, 185, 255, 0.4), 
        rgba(107, 185, 255, 0.6),
        rgba(107, 185, 255, 0.4),
        transparent);
}

.request-card:nth-child(3) .request-glow {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 179, 71, 0.4), 
        rgba(255, 179, 71, 0.6),
        rgba(255, 179, 71, 0.4),
        transparent);
}

.request-card:nth-child(4) .request-glow {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(123, 97, 255, 0.4), 
        rgba(123, 97, 255, 0.6),
        rgba(123, 97, 255, 0.4),
        transparent);
}

.request-card:nth-child(5) .request-glow {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(71, 207, 115, 0.4), 
        rgba(71, 207, 115, 0.6),
        rgba(71, 207, 115, 0.4),
        transparent);
}

.request-card:nth-child(6) .request-glow {
    background: linear-gradient(90deg, 
        transparent, 
        rgba(201, 162, 124, 0.4), 
        rgba(201, 162, 124, 0.6),
        rgba(201, 162, 124, 0.4),
        transparent);
}

section {
    scroll-margin-top: 120px;
  }

  /* Состояние при прокрутке */
.header-shrink #header-inner {
    padding-top: 0.75rem;   /* py-3 */
    padding-bottom: 0.75rem;
  }
  
  .header-shrink img {
    height: 3rem; /* было h-14 / md:h-20 */
  }
  
  /* Плавная тень при скролле */
  .header-shrink {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }

/* Fallback иконки для Font Awesome */
.icon-fallback {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .request-card-inner {
        padding: 24px 20px;
        min-height: 160px;
    }
    
    .request-text {
        font-size: 16px;
    }
    
    .request-icon {
        font-size: 24px;
        margin-bottom: 6px;
    }
    
    .request-card:hover .request-card-inner {
        transform: translateY(-4px);
    }
    
    /* Убираем задержки для stagger на мобильных */
    .stagger-item.visible {
        transition-delay: 0s !important;
    }
}

@media (max-width: 640px) {
    .requests-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .request-card-inner {
        min-height: 140px;
    }
}

/* Для Pricing секции с 5 элементами */
@media (min-width: 768px) {
    #pricing .stagger-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    #pricing .stagger-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Чтобы 4-й и 5-й элементы занимали меньше места на десктопе */
@media (min-width: 1024px) {
    #pricing .stagger-item:nth-child(4),
    #pricing .stagger-item:nth-child(5) {
        grid-column: span 1;
    }
}

.main-wrapper {
    width: 100%;
    overflow-x: clip;
    position: relative;
    
}

#site-header {
    position: sticky;
    top: 0;
    z-index: 50;  
    
}
/* ===== In-page gallery (1 mobile / 3 desktop) ===== */
.gal-viewport { overflow: hidden; border-radius: 3rem; }
.gal-track {
  display: flex;
  gap: 16px;
  transition: transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  padding: 8px;
}

/* ===== Gallery: thumbnails that don't crop ===== */
.gal-slide {
    flex: 0 0 100%;                /* КЛЮЧ: 1 слайд на мобиле */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
  }
  
  .gal-slide img {
    display: block;
    width: 100%;
    height: 240px;
    object-fit: contain;           /* не обрезаем */
    background: rgba(255,255,255,0.15);
    border-radius: 1.75rem;
    cursor: zoom-in;
  }
  
  @media (min-width: 1024px) {
    .gal-slide {
      flex: 0 0 calc((100% - 32px) / 3);  /* 3 в ряд на десктопе */
    }
    .gal-slide img {
      height: 260px;               /* высота превью на десктопе */
    }
  }

/* dots */
.gal-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid rgba(43,31,26,0.2);
  background: rgba(43,31,26,0.2);
}
.gal-dot.active { background: rgba(43,31,26,0.7); }
/* ===== About page system ===== */
.about-card {
    border-radius: 1.5rem; /* rounded-3xl */
    border: 1px solid rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(14px);
    box-shadow: 0 25px 70px rgba(201,162,124,0.22);
  }
  
  .about-glow-a {
    background: rgba(201,162,124,0.22);
    filter: blur(140px);
  }
  
  .about-glow-b {
    background: rgba(143,107,82,0.18);
    filter: blur(160px);
  }
  
  /* Gallery shared buttons */
  .about-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #2b1f1a;
    color: #f4efe9;
    transition: transform .25s ease, background .25s ease, opacity .25s ease;
  }
  .about-nav-btn:hover { background: #3a2a22; transform: translateY(-1px); }
  .about-nav-btn:disabled { opacity: .4; transform: none; cursor: default; }
  
  /* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(20, 15, 12, 0.72);
    backdrop-filter: blur(6px);
  }
  
  .lightbox.is-open { display: flex; }
  
  .lightbox__img {
    max-width: min(1100px, 92vw);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
    box-shadow: 0 35px 120px rgba(0,0,0,0.55);
  }
  
  .lightbox__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.10);
    color: #fff;
    font-size: 22px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
  }
  
  /* ===== Performance fallback for mobile / слабые устройства ===== */
@media (max-width: 768px) {
    /* backdrop-filter часто убивает производительность на Android WebView */
    .about-card,
    .request-card-inner {
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
    }
  
    /* большие blur-«пятна» — тоже тяжело */
    .breathing-glow {
      display: none !important;
    }
  
    /* если в about есть большие светящиеся круги — чуть “дешевле” */
    .about-glow-a,
    .about-glow-b {
      filter: blur(80px) !important;
      opacity: 0.18 !important;
    }
  }

/* ===== Header shrink on scroll ===== */
#site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    transition: box-shadow 220ms ease, background-color 220ms ease, backdrop-filter 220ms ease;
  }
  
  #header-inner {
    transition: padding 220ms ease, transform 220ms ease;
  }
  
  /* Состояние после скролла */
  #site-header.is-scrolled {
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    /* можно чуть “стекло”, но безопасно: без backdrop-filter на мобилках */
  }
  
  /* Уменьшаем вертикальные отступы */
  #site-header.is-scrolled #header-inner {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
  
  /* На очень маленьких экранах можно ещё компактнее */
  @media (max-width: 480px) {
    #site-header.is-scrolled #header-inner {
      padding-top: 10px !important;
      padding-bottom: 10px !important;
    }
  }
  
  /* Уважение reduced motion */
  @media (prefers-reduced-motion: reduce) {
    #site-header, #header-inner { transition: none !important; }
  }
  
/* ===== Mobile render stability fix for About hero (device-specific glitch) ===== */
@media (max-width: 900px) {
  /* Prevent sticky/blur repaint glitches on some Android GPU/WebView builds */
  .main-wrapper {
    overflow-x: hidden !important;
  }

  /* Cancel global backface hack on mobile; it can break compositing */
  *, *::before, *::after {
    backface-visibility: visible !important;
    -webkit-backface-visibility: visible !important;
  }

  /* Keep visual style close, but remove the heaviest effects in first viewport */
  .about-hero-card,
  .about-hero-portrait {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(255, 255, 255, 0.82) !important;
  }

  .about-hero-glow-a,
  .about-hero-glow-b,
  .about-hero-glow-c {
    display: none !important;
  }

  /* Reduce header transform/layout churn during initial scroll */
  #site-header,
  #header-inner,
  .header-shrink #header-inner,
  .header-shrink img {
    transition: none !important;
  }
}
