/* ==========================================================================
   Background — hex grid & section decorators
   ========================================================================== */

.hexagonal-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.1;
}

.hexagonal-bg .hex-item {
  position: absolute;
  animation: hex-float var(--hex-duration, 25s) ease-in-out infinite;
  animation-delay: var(--hex-delay, 0s);
  will-change: transform, opacity;
}

.hexagonal-bg .hex-item svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hexagonal-bg .hex-item polygon {
  fill: none;
  stroke: rgb(var(--color-brand));
  stroke-width: 1;
}

@keyframes hex-float {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px);
    opacity: 0.6;
  }
}

.hex-decorator {
  animation: hex-decorator-spin 20s linear infinite, hex-decorator-pulse 20s ease-in-out infinite;
  transform-origin: center;
  will-change: transform, opacity;
}

@keyframes hex-decorator-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes hex-decorator-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ----- Homepage section atmospheres (subtle brand imagery + scrim) ----- */

.gg-section-atmosphere {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.gg-section-atmosphere::before,
.gg-section-atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gg-section-atmosphere::before {
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.28;
}

.gg-section-atmosphere::after {
  z-index: 0;
  background: rgb(var(--color-bg) / 0.78);
}

.gg-section-atmosphere > *:not(.gg-hex-watermark) {
  position: relative;
  z-index: 1;
}

.gg-section-atmosphere > .gg-hex-watermark {
  z-index: 0;
}

.gg-section-atmosphere--breves::before {
  background-image: url("../../img/sections/section-breves-atmosphere.png");
  opacity: 0.26;
}

.gg-section-atmosphere--breves::after {
  background: rgb(var(--color-bg) / 0.78);
}

.gg-section-atmosphere--videos::before {
  background-image: url("../../img/sections/section-videos-atmosphere.png");
  opacity: 0.32;
}

.gg-section-atmosphere--videos::after {
  background: rgb(var(--color-bg) / 0.74);
}

.gg-section-atmosphere--videos.section-tint {
  background-color: rgb(var(--section-tint) / 0.05);
}

.gg-section-atmosphere--newsletter::before {
  background-image: url("../../img/sections/section-newsletter-atmosphere.png");
  opacity: 0.3;
}

.gg-section-atmosphere--newsletter::after {
  background: rgb(var(--color-bg) / 0.8);
}

.light-mode .gg-section-atmosphere::before {
  opacity: 0.18;
}

.light-mode .gg-section-atmosphere::after {
  background: rgb(var(--color-bg) / 0.88);
}

/* Flat ice scrim — solid, no gradient wash */
.light-mode .gg-section-atmosphere--breves::after,
.light-mode .gg-section-atmosphere--videos::after,
.light-mode .gg-section-atmosphere--newsletter::after {
  background: rgb(var(--color-bg) / 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .hexagonal-bg .hex-item,
  .hex-decorator {
    animation: none;
  }
}
