.gallery-section {
  position: relative;
  min-height: 100vh;
  padding-top: clamp(96px, 10vh, 130px);
  padding-bottom: clamp(74px, 8vh, 110px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(201, 168, 76, 0.12), transparent 22%),
    linear-gradient(180deg, #050505 0%, #030303 100%);
  border-top: 1px solid rgba(201, 168, 76, 0.12);
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
}

.gallery-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 54%, rgba(201, 168, 76, 0.08), transparent 34%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.46), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.46));
  pointer-events: none;
}

.gallery-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
}

.gallery-heading {
  max-width: 920px;
  margin: 0 auto clamp(24px, 4vw, 48px);
  text-align: center;
}

.gallery-heading .label {
  color: rgba(255, 255, 255, 0.58);
}

.gallery-heading h2 {
  margin-bottom: 18px;
  font-size: clamp(3.1rem, 5.5vw, 5.8rem);
  text-transform: capitalize;
  letter-spacing: 0;
  text-shadow: 0 20px 50px rgba(255, 255, 255, 0.06);
}

.gallery-heading p:last-child {
  max-width: 680px;
  margin: 0 auto;
  color: rgba(245, 239, 226, 0.72);
  line-height: 1.7;
}

.fan-gallery-shell {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  grid-template-areas:
    "prev gallery next"
    "dots dots dots";
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
  min-height: clamp(340px, 45vw, 560px);
  perspective: 1600px;
}

.fan-gallery {
  grid-area: gallery;
  position: relative;
  height: clamp(320px, 40vw, 520px);
  transform-style: preserve-3d;
}

.fan-card {
  --fan-x: 0px;
  --fan-y: 0px;
  --fan-rot: 0deg;
  --fan-scale: 1;
  --fan-opacity: 1;
  --gyro-rx: 0deg;
  --gyro-ry: 0deg;
  --glow-x: 50%;
  --glow-y: 50%;
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(205px, 20vw, 315px);
  height: clamp(300px, 29vw, 455px);
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.18);
  border-radius: 18px;
  background: #080808;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  transform:
    translate3d(calc(-50% + var(--fan-x)), calc(-50% + var(--fan-y)), 0)
    rotateX(var(--gyro-rx))
    rotateY(var(--gyro-ry))
    rotate(var(--fan-rot))
    scale(var(--fan-scale));
  opacity: var(--fan-opacity);
  transform-origin: 50% 78%;
  transform-style: preserve-3d;
  will-change: transform, opacity;
  transition:
    transform 560ms cubic-bezier(0.22, 0.68, 0.18, 1),
    opacity 360ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease,
    filter 260ms ease;
}

.fan-card::before,
.fan-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}

.fan-card::before {
  z-index: 2;
  background:
    radial-gradient(circle at var(--glow-x) var(--glow-y), rgba(255, 235, 180, 0.24), transparent 30%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.16), transparent 28%, transparent 72%, rgba(201, 168, 76, 0.12));
  mix-blend-mode: screen;
}

.fan-card::after {
  z-index: 3;
  background: linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.42));
}

.fan-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translateZ(36px) scale(1.02);
  filter: contrast(1.03) saturate(0.96) brightness(0.9);
  transition: transform 440ms ease, filter 260ms ease;
}

.fan-card.is-center {
  border-color: rgba(224, 195, 106, 0.74);
  box-shadow:
    0 44px 110px rgba(0, 0, 0, 0.72),
    0 0 44px rgba(201, 168, 76, 0.14),
    0 0 0 1px rgba(255, 226, 155, 0.12) inset;
}

.fan-card.is-hovered {
  border-color: rgba(224, 195, 106, 0.9);
  filter: saturate(1.06);
}

.fan-card.is-hovered::before,
.fan-card.is-hovered::after {
  opacity: 1;
}

.fan-card.is-hovered img {
  transform: translateZ(54px) scale(1.07);
  filter: contrast(1.06) saturate(1.08) brightness(1);
}

.fan-arrow {
  position: relative;
  z-index: 30;
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 168, 76, 0.46);
  border-radius: 50%;
  background: rgba(5, 5, 5, 0.76);
  color: #f7e08a;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.42), 0 0 24px rgba(212, 175, 55, 0.12);
  backdrop-filter: blur(14px);
  transition: transform 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.fan-prev {
  grid-area: prev;
}

.fan-next {
  grid-area: next;
}

.fan-arrow span {
  display: block;
  font-size: 1.8rem;
  line-height: 1;
  transform: none;
}

.fan-arrow:hover {
  color: var(--gold-soft);
  border-color: rgba(224, 195, 106, 0.72);
  transform: translateY(-3px);
  box-shadow: 0 0 34px rgba(201, 168, 76, 0.3);
}

.fan-dots {
  grid-area: dots;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.fan-dot {
  width: 10px;
  height: 10px;
  border: 1px solid rgba(247, 224, 138, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: width 220ms ease, transform 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.fan-dot.is-active {
  width: 34px;
  background: #d4af37;
  transform: scale(1);
  box-shadow: 0 0 18px rgba(201, 168, 76, 0.68);
}

@media (max-width: 900px) {
  .fan-gallery-shell {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "gallery gallery"
      "prev next"
      "dots dots";
    min-height: clamp(430px, 82vw, 590px);
  }

  .fan-gallery {
    height: clamp(350px, 74vw, 500px);
  }

  .fan-prev {
    justify-self: end;
  }

  .fan-next {
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .gallery-section {
    padding-top: 110px;
  }

  .fan-card {
    width: min(62vw, 240px);
    height: min(88vw, 360px);
    border-radius: 14px;
  }

  .fan-arrow {
    width: 48px;
    height: 48px;
  }
}
