/* Sunset: a single passing reflection and quiet, static pools of warm light.
 * Load after showcase.css. No video, layout, color-token or control changes.
 * Root wiring: data-sunset-lighting="running|paused|static" on <html>;
 * data-lighting-visible="true|false" on .values-strip, observed by the page.
 * The only animated layer runs when BOTH global motion and visibility allow it.
 */

.values-strip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.values-strip > span {
  position: relative;
  z-index: 1;
}

.values-strip::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -100%;
  bottom: -100%;
  left: 0;
  width: clamp(100px, 16vw, 245px);
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(255, 251, 231, 0) 0%,
    rgba(255, 245, 224, .035) 22%,
    rgba(255, 249, 232, .14) 40%,
    rgba(255, 255, 245, .34) 50%,
    rgba(255, 250, 232, .16) 58%,
    rgba(255, 245, 224, .035) 77%,
    rgba(255, 251, 231, 0) 100%);
  opacity: .72;
  transform: translate3d(calc(-100% - 64px), 0, 0) skewX(-17deg);
  animation: sunset-value-reflection 12s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

:root[data-sunset-lighting="running"] .values-strip[data-lighting-visible="true"]::before {
  animation-play-state: running;
}

@keyframes sunset-value-reflection {
  from { transform: translate3d(calc(-100% - 64px), 0, 0) skewX(-17deg); }
  to { transform: translate3d(calc(100vw + 64px), 0, 0) skewX(-17deg); }
}

/* These lights rasterize once. Text and links retain their original ink. */
.hero-copy h1,
.story-copy h2 {
  position: relative;
  isolation: isolate;
}

.hero-copy h1::before,
.story-copy h2::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.hero-copy h1::before {
  inset: -.35em 0 -.25em;
  background: radial-gradient(ellipse closest-side at 50% 50%,
    rgba(255, 250, 231, .36),
    rgba(255, 245, 234, .16) 38%,
    rgba(255, 245, 234, 0) 100%);
}

.story-copy h2::before {
  inset: -20px 0 -18px;
  background: radial-gradient(ellipse closest-side at 50% 50%,
    rgba(255, 247, 225, .22),
    rgba(255, 244, 234, .08) 43%,
    rgba(255, 244, 234, 0) 100%);
}

.occasions {
  isolation: isolate;
}

.occasions::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: min(175px, 65%);
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 241, .31), rgba(255, 255, 241, 0) 2px),
    radial-gradient(ellipse at 72% 0, rgba(255, 246, 224, .17), rgba(255, 246, 224, 0) 72%);
}

/* An intentional stationary reflection replaces animation when requested. */
:root[data-sunset-lighting="static"] .values-strip::before {
  animation: none;
  transform: translate3d(calc(50vw - 50%), 0, 0) skewX(-17deg);
  opacity: .32;
  will-change: auto;
}

@media (max-width: 760px) {
  .values-strip::before { width: 105px; animation-duration: 11s; opacity: .62; }
  .hero-copy h1::before { inset: -.24em 0 -.16em; opacity: .82; }
  .story-copy h2::before { opacity: .72; }
  .occasions::before { opacity: .72; }
}

@media (prefers-reduced-motion: reduce) {
  .values-strip::before {
    animation: none;
    transform: translate3d(calc(50vw - 50%), 0, 0) skewX(-17deg);
    opacity: .28;
    will-change: auto;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .values-strip::before,
  .hero-copy h1::before,
  .story-copy h2::before,
  .occasions::before {
    display: none;
  }
}
