/* day-fire.css
 *
 * The day beach's campfire easter egg (js/scenes/day-beach/day-fire.js):
 * the campfire as a button, the faint glow on hover, and the burning
 * campfire fading in over the painting once it is lit.
 */

#scene-beach {
  /* The burning campfire fades in over this long (day-fire.js waits as
     long before the fire's light starts). */
  --fire-fades-in: 1.1s;

  /* The faint warm glow at the base of the logs on hover (or keyboard
     focus, a little stronger), fading in and out over --hover-glow-fades. */
  --hover-glow: rgba(255, 170, 95, 0.32);
  --hover-glow-focus: rgba(255, 170, 95, 0.5);
  --hover-glow-fades: 0.5s;
}

/* The burning campfire: the same size and crop as the painting (its
   object-position is copied from the painting's by day-fire.js), see-through
   except at the campfire, and hidden until the fire is lit. */
.day-fire {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: 0;
  transition: opacity var(--fire-fades-in) ease-in-out;
}

#scene-beach.is-fire-lit .day-fire {
  opacity: 1;
}

/* The fire's glow and sparks (drawn by day-fire.js). */
.day-fire-light {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The campfire's button covers the scene, cut to the campfire's shape by
   day-fire.js (clip-path), so only the campfire is clickable. Nothing of
   it shows. */
.campfire-button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.campfire-button:focus-visible {
  outline: none;
}

/* The faint warm glow at the base of the logs (placed by day-fire.js). */
.campfire-glow {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--hover-glow), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--hover-glow-fades) ease;
}

@media (hover: hover) {
  .campfire-button:hover ~ .campfire-glow {
    opacity: 1;
  }
}

/* Keyboard focus: the glow, a little stronger (the button itself shows
   nothing). */
.campfire-button:focus-visible ~ .campfire-glow {
  background: radial-gradient(closest-side, var(--hover-glow-focus), transparent);
  opacity: 1;
}
