/* HollyDaze Lites: twinkle glints, roofline bulbs and holiday chips, shared by pages A, B and C.
   Written by Claude (Anthropic) with Luke Rebarchik. */

/* a frame whose photograph is cropped by object-fit: cover, with glints laid on its lights */
.lights-frame { position: relative; overflow: hidden; }
.lights-frame > img, .lights-frame > picture, .lights-frame > picture > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }

.tw {
  position: absolute; z-index: 1; width: var(--s, 9px); height: var(--s, 9px); pointer-events: none;
  background:
    radial-gradient(circle, #fff 0 6%, rgb(255 240 200 / .85) 10%, rgb(255 220 150 / 0) 55%),
    linear-gradient(90deg, transparent 47%, rgb(255 250 230 / .9) 50%, transparent 53%),
    linear-gradient(0deg, transparent 47%, rgb(255 250 230 / .9) 50%, transparent 53%);
  mix-blend-mode: screen; opacity: .05; transform: translate(-50%, -50%) scale(.6);
  animation: hl-twinkle var(--d, 4.4s) ease-in-out infinite; animation-delay: var(--dl, 0s);
}
/* a quiet glint: most of the cycle near rest, a short soft peak */
@keyframes hl-twinkle {
  0%, 100% { opacity: .05; transform: translate(-50%, -50%) scale(.6) rotate(0deg); }
  40% { opacity: .05; transform: translate(-50%, -50%) scale(.6) rotate(0deg); }
  55% { opacity: .6; transform: translate(-50%, -50%) scale(1) rotate(12deg); }
  70% { opacity: .2; transform: translate(-50%, -50%) scale(.75) rotate(18deg); }
}

/* bulbs: a straight strip (data-bulbs) or points along a roof (data-points); the chase runs once on load, then rests */
[data-roof][data-bulbs] { display: grid; grid-template-columns: repeat(var(--bulbs, 28), 1fr); gap: 10px; padding: 24px; border-radius: var(--r-md); background: #07080b; }
[data-roof][data-bulbs] i { aspect-ratio: 1; border-radius: 50%; }
[data-roof][data-points] { position: absolute; inset: 0; }
[data-roof][data-points] i { position: absolute; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); }
[data-roof] i {
  background: var(--c, #ffd9a0);
  box-shadow: 0 0 10px 2px var(--c, #ffd9a0), 0 0 26px 6px color-mix(in srgb, var(--c, #ffd9a0) 40%, transparent);
  transition: background-color .35s, box-shadow .35s;
  animation: hl-chase 3s linear 1; animation-delay: calc(var(--n, 0) * -0.11s);
}
@keyframes hl-chase { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(.6); } }

/* holiday chips: one button style, pressed state filled */
[data-chips] { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border: 0; cursor: pointer;
  border-radius: 999px; background: transparent; color: var(--ink); font: 500 15px/1 var(--font-text);
  box-shadow: inset 0 0 0 1px var(--line-strong, currentColor);
  transition: background-color .15s, color .15s, transform .15s;
}
.chip:hover { transform: translateY(-1px); }
.chip:active { transform: translateY(0) scale(.98); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip__dots { display: inline-flex; gap: 3px; }
.chip__dots b { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

@media (prefers-reduced-motion: reduce) {
  .tw { animation: none; opacity: .35; transform: translate(-50%, -50%) scale(.8); }
  [data-roof] i { animation: none; }
}

/* pause buttons (one per moving visual): 44px discs; the hero's sits under the header at the right line,
   the roof's chase plays once (3 s) and rests, so it has none */
.loop-pause {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgb(10 10 12 / .72); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .35); transition: transform .15s, background-color .15s;
}
.loop-pause:hover { transform: translateY(-1px); background: rgb(10 10 12 / .9); }
.loop-pause:active { transform: scale(.96); }
.loop-pause:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; }
section.hero > .loop-pause { position: absolute; z-index: 3; top: calc(var(--nav, 72px) + 16px); right: max(var(--gut, 24px), calc((100vw - 1280px) / 2)); }
[data-pause-host] > .loop-pause { position: absolute; z-index: 3; top: 0; right: 0; }
[data-pause-host], [data-tw-host] { position: relative; }
.is-paused .tw { animation-play-state: paused; }
/* tablet and phone: the hero's words sit under the photograph, so its pause button moves onto the photograph's corner */
@media (max-width: 1023px) {
  .hero [data-pause-host] > .loop-pause { top: calc(-1 * var(--hgap, 40px) - 60px); }
}
/* the hero's glint layer: an empty box inside .hero-text that covers the photograph's part of the hero, inside the
   container's lines; --tw-up reaches it up over a phone photograph that sits above the words */
.tw-layer { position: absolute; left: 0; right: 0; top: calc(-1 * var(--tw-up, 0px)); bottom: 0; pointer-events: none; z-index: 1; }

/* under reduced motion nothing moves, so there is nothing to pause (after the button rules above, so it wins) */
@media (prefers-reduced-motion: reduce) { .loop-pause { display: none; } }
