:root {
  --bg1:#1a1b4b;
  --bg2:#4c3a8d;
  --bg3:#7b52ab;
  --accent:#9b6dff;
  --muted:#9f9fb7;
  --glass:rgba(255,255,255,0.15);
  --trans: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --fade: opacity 0.15s ease-out;
  --scale: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*{box-sizing:border-box;margin:0;padding:0;}
html, body{height:100%;scroll-behavior:smooth;font-family:'Inter',sans-serif;}
body{
  color:#fff;
  background: radial-gradient(circle at center, var(--bg3), var(--bg2), var(--bg1)),
              linear-gradient(45deg, rgba(43, 9, 107, 0.8), rgba(49, 24, 123, 0.8));
  background-size: 200% 200%, 100% 100%;
  animation: gradientShift 15s ease infinite;
  -webkit-font-smoothing:antialiased;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><filter id="f"><feTurbulence type="fractalNoise" baseFrequency="0.005" numOctaves="2"/><feColorMatrix values="0 0 0 7 -4 0 0 0 7 -4 0 0 0 7 -4 0 0 0 0 1"/></filter><rect width="100%" height="100%" filter="url(%23f)"/></svg>');
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
}

/* Container */
.container{width:90%;max-width:1400px;margin:0 auto;padding:24px 0;}

/* Header */
.site-header{
  position:sticky;top:0;z-index:80;
  backdrop-filter:blur(10px);
  background:rgba(26, 27, 75, 0.3);
  border-bottom:1px solid rgba(155, 109, 255, 0.15);
  transition:var(--trans);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding:12px 0;}
.logo{font-family:'Playfair Display',serif;font-size:24px;font-weight:700;color:#fff;opacity:0;transition:var(--trans);}
.logo-accent{color:var(--accent);}
.nav a{margin-left:18px;text-decoration:none;color:#fff;font-weight:600;transition:color .25s;}
.nav a:hover{color:var(--accent);}

/* Hero */
.hero{display:flex;gap:40px;align-items:center;flex-wrap:wrap;justify-content:center;}
.hero-card{flex:1;display:flex;align-items:center;justify-content:center;min-width:300px;}
.hero-image-wrap{width:100%;max-width:480px;border-radius:20px;overflow:hidden;box-shadow:0 14px 35px rgba(12,10,20,0.12);transition:var(--trans);}
.hero-image-wrap img{
    width:100%;
    height:auto;
    display:block;
    object-fit:cover;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.15s ease-out, transform 0.2s ease-out;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.fade-out {
    opacity: 0 !important;
    transform: scale(0.995) !important;
}

/* Оптимизация производительности для всех анимированных элементов */
.hero-title,
.hero-description {
    transition: opacity 0.15s ease-out;
    will-change: opacity;
}
.hero-image-wrap img:hover{transform:scale(1.03);}
.hero-info {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
}

.hero-info h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    margin-bottom: 12px;
    transition: var(--trans);
}

.hero-description-container {
    min-height: 180px; /* Фиксированная минимальная высота для текста */
    display: flex;
    flex-direction: column;
}

.hero-info p {
    font-size: 18px;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 20px;
    transition: var(--trans);
    flex-grow: 1;
}

/* Hero controls */
.hero-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 16px 0;
    position: relative;
    height: 60px; /* Фиксированная высота для контейнера кнопок */
}

.gallery-btn {
    width: 50px;
    height: 50px;
    font-size: 28px;
    font-weight: 700;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
    position: absolute; /* Абсолютное позиционирование для кнопок */
}

.gallery-btn:hover {
    background: #5840c4;
    transform: translateY(-2px);
}

/* Позиционирование кнопок */
.gallery-btn:first-child {
    left: calc(50% - 60px); /* Смещение влево от центра */
}

.gallery-btn:last-child {
    right: calc(50% - 60px); /* Смещение вправо от центра */
}

/* Buy block */
.buy-block {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--glass);
    padding: 16px;
    border-radius: 14px;
    backdrop-filter: blur(6px);
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    height: 100px; /* Фиксированная высота */
}

.buy-thumb {
    width: 72px;
    height: 72px;
    flex: 0 0 72px; /* Предотвращает сжатие */
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.buy-meta {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* Предотвращает переполнение */
}

.buy-title {
    font-weight: 600;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.buy-btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: var(--trans);
    text-align: center;
    width: fit-content;
}

.buy-btn:hover {
    background: #5840c4;
    transform: translateY(-2px);
}

/* Thumbnails */
.thumbs {
    padding: 24px 0;
}

.thumbs-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.thumb {
    width: 120px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    transition: var(--trans);
    border: 2px solid transparent;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease, filter .45s ease;
}

.thumb:hover {
    transform: scale(1.05);
}

.thumb.active {
    border-color: rgba(107,76,224,0.9);
}

/* About */
.about {
  padding: 60px 40px;
  background: rgba(155, 109, 255, 0.1);
  border-radius: 16px;
  margin: 40px auto;
  text-align: left;
  max-width: 800px;
  border: 1px solid rgba(155, 109, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}
.about h2 {
  font-size: 36px;
  margin-bottom: 30px;
  text-align: center;
  font-family: 'Playfair Display', serif;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(155, 109, 255, 0.3);
}
.about p {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  margin-bottom: 24px;
}
.about p:first-of-type {
  font-size: 21px;
  margin-bottom: 28px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px rgba(155, 109, 255, 0.3);
}

/* Footer */
.site-footer{padding:18px 0;text-align:center;color:rgba(0,0,0,0.6);}

/* Animations */
[data-aos]{opacity:0;transform:translateY(10px);transition:var(--trans);}
[data-aos].aos-animate{opacity:1;transform:none;}

/* Gradient Animation */
@keyframes gradientShift{
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}

/* Responsive */
@media (max-width: 1200px) {
    .container {
        width: 95%;
    }
}

@media (max-width: 980px) {
    .hero {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .hero-info {
        text-align: center;
        padding: 0 20px;
    }
    
    .hero-image-wrap {
        max-width: 400px;
    }
    
    .thumbs-row {
        justify-content: flex-start;
        padding: 10px 20px;
    }
}

@media (max-width: 768px) {
    .hero-image-wrap {
        max-width: 100%;
    }
    
    .buy-block {
        flex-direction: column;
        height: auto;
        text-align: center;
        padding: 20px;
    }
    
    .buy-thumb {
        margin: 0 auto;
    }
    
    .buy-btn {
        margin: 10px auto 0;
    }
}

@media (max-width: 480px) {
    .thumb {
        width: 88px;
        height: 120px;
    }
    
    .hero-image-wrap img {
        height: 360px;
    }
    
    .hero-info h1 {
        font-size: 28px;
    }
    
    .hero-info p {
        font-size: 16px;
    }
    
    .thumbs {
        height: 150px;
    }
}

@media (max-width: 360px) {
    .thumb {
        width: 80px;
        height: 110px;
    }
    
    .container {
        width: 100%;
        padding: 0 10px;
    }
}
