/* Hallmark · shape: single-screen ambient display · theme: custom · genre: atmospheric · hero: Poster · signature: four flames on their photographed wicks · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4 · weakest: E, the photograph needs a soft edge and all four flames must stay registered during resize */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: clip;
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  color-scheme: dark;
}

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(var(--space-lg), env(safe-area-inset-top))
    max(var(--space-md), env(safe-area-inset-right))
    max(var(--space-lg), env(safe-area-inset-bottom))
    max(var(--space-md), env(safe-area-inset-left));
  font-family: var(--font-body);
}

.display {
  display: grid;
  justify-items: center;
  width: 100%;
  max-width: 78rem;
  text-align: center;
}

h1 {
  min-width: 0;
  overflow-wrap: break-word;
  margin: 0;
  font: 400 clamp(2.25rem, min(6.5vw, 9svh), 4.75rem)/1.06 var(--font-display);
  letter-spacing: -.057em;
  text-wrap: balance;
}

time:not([hidden]) {
  display: block;
  margin-top: var(--space-sm);
  color: var(--color-date);
  font-size: clamp(.875rem, 1.65vw, 1.0625rem);
  line-height: 1.4;
}

.wreath {
  position: relative;
  width: min(100%, 65rem, 108svh);
  margin: 0;
}

.wreath img {
  display: block;
  width: 100%;
  height: auto;
  mask-image: radial-gradient(ellipse 74% 77% at 50% 45%,
    var(--color-mask) 50%, var(--color-clear) 89%);
}

.wick {
  position: absolute;
  left: var(--wick-x);
  bottom: var(--wick-y);
  width: 2.45%;
  height: 7.5%;
  transform: translateX(-50%);
}

.wick:nth-of-type(1) { --wick-x: 26.63%; --wick-y: 63.15%; --flicker: -1.4s; }
.wick:nth-of-type(2) { --wick-x: 35.17%; --wick-y: 81.8%; --flicker: -.7s; }
.wick:nth-of-type(3) { --wick-x: 64.68%; --wick-y: 81.8%; --flicker: -2.5s; }
.wick:nth-of-type(4) { --wick-x: 73.17%; --wick-y: 62.92%; --flicker: -3.6s; }

.wick::before, .wick::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.wick::before {
  inset: -80% -240% -62%;
  background: radial-gradient(ellipse, var(--color-glow-inner), var(--color-glow) 28%, var(--color-clear) 67%);
  animation: candle-glow 4.6s ease-in-out var(--flicker) infinite;
}

.wick::after {
  inset: 0;
  border-radius: 74% 26% 58% 42% / 81% 64% 36% 19%;
  background: radial-gradient(ellipse at 46% 69%, var(--color-flame-center) 17%,
    var(--color-flame-mid) 47%, var(--color-flame-edge) 75%, var(--color-flame-base));
  transform: rotate(4deg);
  transform-origin: 50% 96%;
  animation: candle-flame 4.6s ease-in-out var(--flicker) infinite;
}

@keyframes candle-flame {
  0%, 100% { transform: rotate(4deg) scale(1); }
  22% { transform: rotate(-3deg) scale(.92, 1.03); }
  49% { transform: rotate(5deg) scale(1.06, .92); }
  72% { transform: rotate(1deg) scale(.94, 1.02); }
}

@keyframes candle-glow {
  0%, 100% { opacity: .92; }
  38% { opacity: .72; }
  70% { opacity: .84; }
}

@media (prefers-reduced-motion: reduce) {
  .wick::before, .wick::after { animation: none; }
}
