/* ============================================
   КОТОВСК ФАРМ — Interactive Sections
   Gallery Accordion + Showcase + Higsfield
   Taste-skill: spring motion, generous spacing
   ============================================ */

/* ================================================
   1. GALLERY ACCORDION
   ================================================ */
.gallery-section {
  background: #0B1410;
  padding: clamp(64px, 8vw, 120px) 0;
  overflow: hidden;
}

.gallery-header {
  margin-bottom: clamp(32px, 4vw, 56px);
}

.gallery-accent-line {
  width: 48px;
  height: 2px;
  background: var(--color-accent);
  margin-bottom: 16px;
  border-radius: 2px;
}

.gallery-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* Desktop accordion */
.gallery-accordion {
  display: flex;
  gap: 12px;
  height: clamp(400px, 50vw, 600px);
}

.gallery-item {
  position: relative;
  flex: 1;
  cursor: pointer;
  overflow: hidden;
  border-radius: 20px;
  transition: flex 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item.is-active {
  flex: 5;
}

.gallery-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item.is-active img {
  transform: scale(1.02);
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: #0B1410;
  opacity: 0.5;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.gallery-item.is-active .gallery-item__overlay {
  opacity: 0;
}

.gallery-item__gradient {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(11, 20, 16, 0.92), transparent);
  pointer-events: none;
}

.gallery-item__caption {
  position: absolute;
  bottom: 28px;
  left: 28px;
  right: 28px;
  z-index: 2;
  opacity: 0;
  transform: translateY(14px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s;
}

.gallery-item.is-active .gallery-item__caption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item__title {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.gallery-item__desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.4;
}

.gallery-item__border {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

/* Mobile gallery (horizontal scroll) */
/* ============================
   MOBILE: Bento asymmetric grid
   - Item 1: full-width hero tile
   - Items 2-3: square 1fr 1fr
   - Items 4-5: asymmetric 1.4fr 1fr, taller
   Captions live BELOW the image (gallery-style), not overlaid.
   ============================ */
.gallery-mobile {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-mobile__item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  opacity: 0;
  transform: translateY(14px);
  animation: gm-rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}

@keyframes gm-rise {
  to { opacity: 1; transform: translateY(0); }
}

.gallery-mobile__item:nth-child(1) { grid-column: 1 / -1; --i: 0; }
.gallery-mobile__item:nth-child(2) { --i: 1; }
.gallery-mobile__item:nth-child(3) { --i: 2; }
.gallery-mobile__item:nth-child(4) { grid-column: 1 / -1; --i: 3; }
.gallery-mobile__item:nth-child(5) { grid-column: 1 / -1; --i: 4; }

.gallery-mobile__media {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #111b16;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gallery-mobile__item:nth-child(1) .gallery-mobile__media { aspect-ratio: 16 / 10; border-radius: 18px; }
.gallery-mobile__item:nth-child(2) .gallery-mobile__media,
.gallery-mobile__item:nth-child(3) .gallery-mobile__media { aspect-ratio: 1 / 1; }
.gallery-mobile__item:nth-child(4) .gallery-mobile__media { aspect-ratio: 16 / 10; border-radius: 18px; }
.gallery-mobile__item:nth-child(5) .gallery-mobile__media { aspect-ratio: 16 / 9; border-radius: 18px; }

.gallery-mobile__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-mobile__item:active img { transform: scale(1.03); }

.gallery-mobile__gradient { display: none; }

.gallery-mobile__caption {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px;
}

.gallery-mobile__index {
  font-family: var(--font-mono, 'SF Mono', Menlo, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 2px;
}

.gallery-mobile__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.gallery-mobile__desc {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.35;
}

.gallery-mobile__item:nth-child(1) .gallery-mobile__title { font-size: 1.1rem; }
.gallery-mobile__item:nth-child(1) .gallery-mobile__desc { font-size: 0.85rem; color: rgba(255,255,255,0.55); }

@media (max-width: 768px) {
  .gallery-accordion { display: none; }
  .gallery-mobile { display: grid; }
  .gallery-section { overflow-x: clip; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-mobile__item { animation: none; opacity: 1; transform: none; }
  .gallery-mobile__item img { transition: none; }
}

/* ================================================
   2. INTERACTIVE SHOWCASE (О компании)
   ================================================ */
.showcase-section {
  background: #0B1410;
  padding: clamp(64px, 8vw, 120px) 0;
  overflow: hidden;
}

.showcase-header {
  margin-bottom: clamp(32px, 4vw, 48px);
}

.showcase-accent-line {
  width: 48px;
  height: 2px;
  background: var(--color-accent);
  margin-bottom: 16px;
  border-radius: 2px;
}

.showcase-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.showcase-title {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.showcase-title--outline {
  color: #fff;
}

/* Grid: image left, list right */
.showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

/* Featured image */
.showcase-image__wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  overflow: hidden;
}

.showcase-image__wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

.showcase-image__wrap img.is-switching {
  opacity: 0;
  transform: scale(1.06);
}

.showcase-image__gradient {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 55%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 50%, transparent 100%);
  pointer-events: none;
}

.showcase-image__info {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  z-index: 2;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-image__info.is-fading {
  opacity: 0;
  transform: translateY(10px);
}

.showcase-image__cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.showcase-image__title {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.showcase-image__desc {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.5);
  max-width: 36ch;
  line-height: 1.4;
}

/* Higsfield badge on image */
.showcase-video-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 100px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-video-badge:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.showcase-video-badge svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Interactive list */
.showcase-counter {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}

.showcase-item {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 6px;
}

.showcase-item:active {
  transform: scale(0.985);
}

.showcase-item.is-active {
  background: #141A16;
  border-color: rgba(255, 255, 255, 0.06);
}

.showcase-item__thumb {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
}

.showcase-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-item__info {
  flex: 1;
  min-width: 0;
}

.showcase-item__cat {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.showcase-item.is-active .showcase-item__cat,
.showcase-item:hover .showcase-item__cat {
  opacity: 1;
}

.showcase-item__title {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  transition: color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.showcase-item.is-active .showcase-item__title {
  color: #fff;
}

.showcase-item:hover .showcase-item__title {
  color: rgba(255, 255, 255, 0.75);
}

.showcase-item__desc {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.25);
  line-height: 1.4;
  margin-top: 2px;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-item.is-active .showcase-item__desc {
  opacity: 1;
  max-height: 60px;
}

.showcase-item:hover .showcase-item__desc {
  opacity: 0.6;
  max-height: 60px;
}

.showcase-item__arrow {
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.showcase-item.is-active .showcase-item__arrow {
  opacity: 1;
  transform: translateX(0);
}

.showcase-item:hover .showcase-item__arrow {
  opacity: 0.5;
  transform: translateX(0);
}

@media (max-width: 768px) {
  .showcase-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .showcase-image__wrap {
    aspect-ratio: 4 / 3;
  }

  .showcase-title--outline {
    -webkit-text-stroke-width: 1px;
  }

  .showcase-section { overflow-x: clip; }

  .showcase-item {
    padding: 12px 12px;
    gap: 12px;
  }

  .showcase-item__thumb {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
}

@media (max-width: 389px) {
  .showcase-section { padding: clamp(40px, 6vw, 64px) 0; }
  .showcase-title { font-size: 1.5rem; }
  .showcase-item { padding: 10px; gap: 10px; }
  .showcase-item__thumb { width: 42px; height: 42px; }
  .showcase-item__title { font-size: 0.82rem; }
}

/* ================================================
   3. HIGSFIELD ANIMATION PLACEHOLDERS
   ================================================ */
.higsfield-placeholder {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-top: clamp(32px, 4vw, 48px);
  cursor: pointer;
}

.higsfield-placeholder__img {
  width: 100%;
  height: clamp(220px, 30vw, 400px);
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.higsfield-placeholder--video {
  position: relative;
  height: clamp(240px, 34vw, 460px);
  background: #0b1410;
  cursor: default;
}

.higsfield-placeholder__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.higsfield-placeholder__video.is-active { opacity: 1; }

.higsfield-placeholder__overlay--soft {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,20,16,0.15) 0%, rgba(11,20,16,0) 35%, rgba(11,20,16,0) 70%, rgba(11,20,16,0.25) 100%);
  pointer-events: none;
}

.higsfield-placeholder:hover .higsfield-placeholder__img {
  transform: scale(1.03);
}

.higsfield-placeholder__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 20, 16, 0.45);
  transition: background 0.3s ease;
}

.higsfield-placeholder:hover .higsfield-placeholder__overlay {
  background: rgba(11, 20, 16, 0.3);
}

.higsfield-placeholder__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(var(--color-primary-rgb), 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
}

.higsfield-placeholder:hover .higsfield-placeholder__play {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(var(--color-primary-rgb), 1);
}

.higsfield-placeholder__play svg {
  margin-left: 3px;
}

.higsfield-placeholder__pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(var(--color-primary-rgb), 0.4);
  animation: higs-pulse 2s ease-in-out infinite;
}

@keyframes higs-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0; }
}

.higsfield-placeholder__label {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  z-index: 2;
  letter-spacing: 0.02em;
}

/* ================================================
   4. ANIMATED NUMBER COUNTERS
   ================================================ */
.hero__stat-value {
  font-variant-numeric: tabular-nums;
}

/* Subtle floating animation for particles */
@keyframes float-gentle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(1deg); }
}


/* ================================================
   VIDEO LIGHTBOX (about video)
   ================================================ */
.video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.video-lightbox.is-open { opacity: 1; visibility: visible; }

.video-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 12, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

.video-lightbox__inner {
  position: relative;
  width: min(1100px, 100%);
  transform: scale(0.94);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.video-lightbox.is-open .video-lightbox__inner { transform: scale(1); }

.video-lightbox__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.6);
}
.video-lightbox__frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-lightbox__close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}
.video-lightbox__close:hover { background: rgba(255,255,255,0.2); transform: rotate(90deg); }

.showcase-video-badge {
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: inherit;
}
.showcase-video-badge__icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #fff;
  align-items: center;
  justify-content: center;
}
.showcase-video-badge__icon svg { width: 10px; height: 10px; margin-left: 1px; }

body.lightbox-open { overflow: hidden; }
