@keyframes img-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.gather-page main {
  padding-bottom: 5rem;
}

.gather-hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3rem, 8vw, 6rem) 0 3rem;
}

.gather-copy p {
  margin: 1.2rem 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.gather-preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: clamp(0.6rem, 2vw, 1rem);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.gather-preview img {
  width: 100%;
  display: block;
  border-radius: 6px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gather-preview.img-loaded img {
  opacity: 1;
}

.feature-band,
.media-section,
.download-section {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.section-heading {
  max-width: 620px;
  margin-bottom: 1.6rem;
}

.section-heading h2,
.download-section h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-grid article,
.media-item,
.download-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.feature-grid article {
  padding: 1.2rem;
}

.feature-grid h3 {
  margin: 0 0 0.55rem;
  font-size: 1.18rem;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.video-section {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 6vw, 5rem) 0;
}

.media-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.media-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.media-item::before,
.gather-preview::before,
.media-video::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.09) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: img-shimmer 1.6s linear infinite;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.media-item.img-loaded::before,
.gather-preview.img-loaded::before,
.media-video.img-loaded::before {
  opacity: 0;
}

.media-video img {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.media-video.img-loaded img {
  opacity: 1;
}

.yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(200, 0, 0, 0.92);
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  pointer-events: none;
}

.yt-play::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 22px solid white;
}

.yt-facade:hover .yt-play {
  background: rgb(255, 0, 0);
  transform: translate(-50%, -50%) scale(1.08);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.media-item {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.media-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.media-item.img-loaded img {
  opacity: 1;
}

figcaption {
  padding: 0.85rem 1rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.download-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: clamp(1.4rem, 4vw, 2rem);
}

.download-section p {
  margin-bottom: 0;
}

.download-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.curseforge-action {
  background: #1a0a0a;
  color: #e8574a;
  border-color: #3d1212;
}

.media-thumb {
  all: unset;
  display: block;
  cursor: pointer;
  width: 100%;
  position: relative;
}

.media-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cpolyline points='9 21 3 21 3 15'/%3E%3Cline x1='21' y1='3' x2='14' y2='10'/%3E%3Cline x1='3' y1='21' x2='10' y2='14'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 2.5rem;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.2s, background-color 0.2s;
  pointer-events: none;
}

.media-item.img-loaded .media-thumb:hover::after {
  background-color: rgba(0, 0, 0, 0.45);
  opacity: 1;
}

.media-thumb:focus-visible {
  outline: 2px solid #8fcf75;
  outline-offset: -2px;
}

.media-thumb img {
  transition: opacity 0.35s ease;
}

#lightbox {
  border: none;
  background: transparent;
  padding: 0;
  overflow: visible;
}

#lightbox::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox-wrap {
  position: relative;
  width: clamp(400px, 56vw, 900px);
  max-width: 92vw;
}

.lightbox-inner {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

#lightbox img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  user-select: none;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(20, 25, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  transition: background 0.15s;
  z-index: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-toolbar {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  display: flex;
  gap: 0.4rem;
}

.lb-btn {
  background: rgba(20, 25, 30, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 6px;
  height: 2rem;
  min-width: 2rem;
  padding: 0 0.5rem;
  cursor: pointer;
  font-size: 0.88rem;
  display: grid;
  place-items: center;
  transition: background 0.15s;
  font-family: inherit;
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 900px) {
  .gather-hero,
  .feature-grid,
  .media-grid {
    grid-template-columns: 1fr;
  }

  .gather-hero {
    min-height: auto;
  }

  .download-section {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .gather-hero,
  .gather-copy,
  .gather-preview {
    min-width: 0;
    max-width: 100%;
  }

  .gather-copy h1 {
    font-size: clamp(2.35rem, 11.5vw, 3rem);
    line-height: 0.95;
    overflow-wrap: anywhere;
  }

  .gather-copy p {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .gather-preview {
    padding: 0.75rem;
  }

  .gather-preview img,
  .media-item img {
    height: auto;
    max-height: 360px;
    object-fit: contain;
  }
}
