/* Dawnchild's Christmas look (v0.186.0).

   Loaded only while the theme setting christmas_look shows it, on a body marked
   data-christmas. Every piece is drawn still and finished: the snow cap and
   drift full, the frost grown, the garland lit. Motion runs only under
   ".js [data-christmas]", so a page without script, or a visitor who asks for
   reduced motion, sees the finished picture and nothing moving. One pause, the
   attribute data-christmas-paused on the html element (set before first paint
   by the page's head script and by christmas.js), holds every loop where it is
   and shows every one-time rise finished; christmas.js stops the snow. */

[data-christmas] {
  --xmas-ledge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 30'%3E%3Cdefs%3E%3ClinearGradient id='i' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='.95'/%3E%3Cstop offset='1' stop-color='%23cfe0ee' stop-opacity='.35'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M12.8 8Q16 13.4 16 17.8Q16.7 12.9 19.2 8Z' fill='url(%23i)'/%3E%3Cpath d='M21.9 8L23.7 13.6L25.5 8Z' fill='url(%23i)'/%3E%3Cpath d='M90.3 8Q92.7 12.2 92.7 15.6Q93.2 11.8 95.1 8Z' fill='url(%23i)'/%3E%3Cpath d='M167.3 8Q169.9 15 169.9 20.8Q170.4 14.4 172.5 8Z' fill='url(%23i)'/%3E%3Cpath d='M204.7 8Q208.1 13.4 208.1 17.8Q208.8 12.9 211.6 8Z' fill='url(%23i)'/%3E%3Cpath d='M213 8L214.8 13.2L216.6 8Z' fill='url(%23i)'/%3E%3Cpath d='M269.3 8Q273.5 14.5 273.5 19.8Q274.3 13.9 277.6 8Z' fill='url(%23i)'/%3E%3Cpath d='M277.9 8L279.7 13.9L281.5 8Z' fill='url(%23i)'/%3E%3Cpath d='M332.9 8Q336.8 12.3 336.8 15.8Q337.6 11.9 340.7 8Z' fill='url(%23i)'/%3E%3Cpath d='M341 8L342.8 11.8L344.6 8Z' fill='url(%23i)'/%3E%3Cpath d='M422.2 8Q425.2 15.3 425.2 21.2Q425.7 14.6 428.1 8Z' fill='url(%23i)'/%3E%3Cpath d='M470.5 8Q473 13.4 473 17.7Q473.4 12.9 475.4 8Z' fill='url(%23i)'/%3E%3Cpath d='M479.4 8L481.2 11.4L483 8Z' fill='url(%23i)'/%3E%3Cpath d='M514.8 8Q518.9 13.6 518.9 18.1Q519.8 13.1 523.1 8Z' fill='url(%23i)'/%3E%3Cpath d='M572.5 8Q575.9 11.3 575.9 14Q576.5 11 579.2 8Z' fill='url(%23i)'/%3E%3Cpath d='M0 11L0 6.5Q33.3 4.3 66.7 7.7Q100 1.7 133.3 6.5Q166.7 4.1 200 6.2Q233.3 3.9 266.7 8Q300 5.8 333.3 8.1Q366.7 3.5 400 5.6Q433.3 1 466.7 8.3Q500 0.4 533.3 4.6Q566.7 0.7 600 6.5L600 11Z' fill='%23d6dbe0' transform='translate(0 1.4)'/%3E%3Cpath d='M0 10L0 4Q27.3 -2.8 54.5 1.7Q81.8 0.1 109.1 5.5Q136.4 -1.1 163.6 3Q190.9 1.9 218.2 5.4Q245.5 -1.6 272.7 3.1Q300 -1 327.3 3.9Q354.5 1 381.8 5.3Q409.1 3.4 436.4 5.9Q463.6 -2.2 490.9 1.6Q518.2 -2.5 545.5 3.5Q572.7 -1.4 600 4L600 10Z' fill='%23fdfcf8'/%3E%3C/svg%3E");
  --xmas-holly: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg transform='translate(4 14) rotate(-14) scale(.9)'%3E%3Cpath d='M2 0C5-3 8-2 10-5C11-2 14-2 16-4C16-1 19 0 21-1C19 2 20 5 22 7C19 7 17 9 16 12C14 10 11 10 9 12C9 9 6 7 3 7C5 5 4 2 2 0Z' fill='%232f5d33' stroke='%231d3b20' stroke-width='.8'/%3E%3Cpath d='M3 2Q11 2 20 5' fill='none' stroke='%238fb47c' stroke-width='.7'/%3E%3C/g%3E%3Cg transform='translate(18 20) rotate(38) scale(.85)'%3E%3Cpath d='M2 0C5-3 8-2 10-5C11-2 14-2 16-4C16-1 19 0 21-1C19 2 20 5 22 7C19 7 17 9 16 12C14 10 11 10 9 12C9 9 6 7 3 7C5 5 4 2 2 0Z' fill='%233a6b3c' stroke='%231d3b20' stroke-width='.8'/%3E%3Cpath d='M3 2Q11 2 20 5' fill='none' stroke='%238fb47c' stroke-width='.7'/%3E%3C/g%3E%3Ccircle cx='17' cy='16' r='3' fill='%23b3261e' stroke='%237a140f' stroke-width='.6'/%3E%3Ccircle cx='16.1' cy='15' r='.8' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='21.5' cy='15' r='3' fill='%23b3261e' stroke='%237a140f' stroke-width='.6'/%3E%3Ccircle cx='20.6' cy='14' r='.8' fill='%23fff' opacity='.7'/%3E%3Ccircle cx='19' cy='19.5' r='3' fill='%23b3261e' stroke='%237a140f' stroke-width='.6'/%3E%3Ccircle cx='18.1' cy='18.5' r='.8' fill='%23fff' opacity='.7'/%3E%3C/svg%3E");
  --xmas-fcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 30' preserveAspectRatio='none'%3E%3Cpath d='M0 30L0 14.1Q25 10.2 50 17.4Q75 3.8 100 8.2Q125 5.7 150 17.1Q175 15.1 200 19.5Q225 8.6 250 12.5Q275 8.2 300 14.6L300 30Z' fill='%23fbf8f1'/%3E%3C/svg%3E");
  --xmas-flake-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c9a24a' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7'/%3E%3C/svg%3E");
  --xmas-flake-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d93a8' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 2v20M3.3 7l17.4 10M3.3 17L20.7 7'/%3E%3C/svg%3E");
}

/* ── The home banner ───────────────────────────────────────────────────────
   The banner gets its own stacking order: snow, frost and drift sit behind the
   picture and the words (z-index -1), the garland hangs in front of both. */
[data-christmas] #home-banner { isolation: isolate; }
.xmas-hero { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.xmas-snow { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; pointer-events: none; }
.xmas-frost__corner {
  position: absolute; z-index: -1; width: clamp(150px, 19vw, 280px); height: clamp(150px, 19vw, 280px); overflow: visible;
  -webkit-mask-image: radial-gradient(circle at 0 0, #000 30%, transparent 78%); mask-image: radial-gradient(circle at 0 0, #000 30%, transparent 78%);
}
.xmas-frost__corner--tr { top: 0; right: 0; transform: scaleX(-1); }
.xmas-frost__corner--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.xmas-garland { position: absolute; top: 0; left: 0; width: 100%; height: 52px; z-index: 3; overflow: visible; }
.xmas-garland .glow { opacity: .55; }
.xmas-garland .t1 { --t: 2.4s; --dl: -.4s; }
.xmas-garland .t2 { --t: 3.1s; --dl: -2.2s; }
.xmas-garland .t3 { --t: 4.6s; --dl: -1.1s; }
.xmas-garland .t4 { --t: 2.8s; --dl: -3.7s; }
.xmas-garland .t5 { --t: 3.9s; --dl: -.9s; }
.xmas-garland .t6 { --t: 4.2s; --dl: -4.4s; }
.xmas-drift { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(22px, 3.2vw, 44px); z-index: -1; transform-origin: 50% 100%; }
.xmas-drift svg, .xmas-cap svg { display: block; width: 100%; height: 100%; }
#home-banner .hw-plaque > .xmas-cap {
  position: absolute; left: 2.1%; right: 2.1%; top: -11px; height: 17px; margin: 0; padding: 0; grid-area: auto;
  z-index: 3; pointer-events: none; transform-origin: 50% 100%;
}

/* ── The header: a snow ledge with icicles, holly on the wordmark ─────────── */
[data-christmas] .site-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 30px; pointer-events: none;
  background: var(--xmas-ledge) repeat-x 0 0 / 600px 30px;
}
[data-christmas] .site-head .lockup .wordmark { position: relative; }
[data-christmas] .site-head .lockup .wordmark::before {
  content: ""; position: absolute; left: -19px; top: -15px; width: 30px; height: 30px; pointer-events: none;
  transform: rotate(-24deg); background: var(--xmas-holly) no-repeat center / contain;
}
[data-christmas] #cart-icon-link { overflow: visible; }
.xmas-burst {
  position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; pointer-events: none;
  background: var(--xmas-flake-a) no-repeat center / contain; opacity: 0;
}
.xmas-burst--b { background-image: var(--xmas-flake-b); }

/* ── The footer: pines and a cottage on the sign-off line, light snow ────────
   The scene stands in the footer's bottom padding, which grows to hold it. */
[data-christmas] .site-foot { position: relative; isolation: isolate; }
[data-christmas] .site-foot .foot-inner { padding-bottom: 96px; }
.xmas-scenery { height: 0; }
.xmas-scenery__land { position: absolute; left: 0; right: 0; width: 100%; height: 84px; margin-top: -84px; z-index: -1; display: block; pointer-events: none; }
.xmas-window .win-glow { opacity: .55; }
.xmas-smoke .puff { opacity: .3; transform-box: fill-box; transform-origin: center; }
[data-christmas] .site-foot .lockup .wordmark { position: relative; }
[data-christmas] .site-foot .lockup .wordmark::after {
  content: ""; position: absolute; left: -2px; right: 18%; top: -10px; height: 12px; pointer-events: none;
  background: var(--xmas-fcap) no-repeat 0 0 / 100% 100%; transform-origin: 50% 100%;
}
.xmas-letter { display: inline-block; vertical-align: -6px; width: 30px; height: 22px; margin-right: 8px; overflow: visible; }
.xmas-letter .seal { transform-box: fill-box; transform-origin: center; }

/* ── The pause ─────────────────────────────────────────────────────────────── */
.xmas-pause { font: inherit; color: inherit; cursor: pointer; }
.xmas-pause[hidden] { display: none !important; }
.xmas-pause svg { display: block; width: 18px; height: 18px; flex: none; }
.xmas-pause .xmas-pause__play, [data-christmas-paused] .xmas-pause .xmas-pause__pause { display: none; }
[data-christmas-paused] .xmas-pause .xmas-pause__play { display: block; }
.xmas-pause:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#home-banner > .xmas-pause {
  position: absolute; right: 16px; top: 64px; z-index: 4; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(248, 241, 223, .5); background: rgba(28, 7, 5, .55); color: #f8f1df;
}
#home-banner > .xmas-pause:hover { background: rgba(28, 7, 5, .8); }
#home-banner > .xmas-pause .xmas-pause__text { display: none; }
.foot-signoff .xmas-pause {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 1.2em; padding: 10px 0; border: 0; background: none;
  text-decoration: underline; text-underline-offset: 2px;
}
.foot-signoff .xmas-pause svg { width: 14px; height: 14px; }

/* ── Motion, only with script ──────────────────────────────────────────────── */
.js [data-christmas] .xmas-cap { transform: scaleY(0); animation: xmas-rise 40s cubic-bezier(.25, .6, .3, 1) 1.5s forwards; }
.js [data-christmas] .xmas-drift { transform: scaleY(0); animation: xmas-rise 60s cubic-bezier(.25, .6, .3, 1) 1s forwards; }
.js [data-christmas] .site-foot .lockup .wordmark::after { transform: scaleY(0); animation: xmas-rise 30s cubic-bezier(.25, .6, .3, 1) 1s forwards; }
.js [data-christmas] .xmas-frost__corner { animation: xmas-frost 7s ease-out .3s both; }
.js [data-christmas] .xmas-garland .glow { animation: xmas-twinkle var(--t, 3s) ease-in-out var(--dl, 0s) infinite alternate; }
.js [data-christmas] .xmas-garland .glass { animation: xmas-glass var(--t, 3s) ease-in-out var(--dl, 0s) infinite alternate; }
.js [data-christmas] .xmas-burst { animation: xmas-burst .9s cubic-bezier(.15, .7, .3, 1) forwards; }
.js [data-christmas] .xmas-window .win { animation: xmas-flicker 3.2s steps(1, end) infinite; }
.js [data-christmas] .xmas-window .win-glow { animation: xmas-flicker-glow 3.2s ease-in-out infinite; }
.js [data-christmas] .xmas-smoke .puff { opacity: 0; animation: xmas-smoke 6s ease-out infinite; }
.js [data-christmas] .xmas-smoke .p2 { animation-delay: 2s; }
.js [data-christmas] .xmas-smoke .p3 { animation-delay: 4s; }
.js [data-christmas] .xmas-letter .seal { animation: xmas-seal 1.8s ease-in-out .6s 3; }
.js [data-christmas] .xmas-letter.fly { animation: xmas-fly 1.3s cubic-bezier(.5, 0, .7, 1) forwards; }

@keyframes xmas-rise { to { transform: scaleY(1); } }
@keyframes xmas-frost { from { clip-path: circle(0% at 0 0); } to { clip-path: circle(142% at 0 0); } }
@keyframes xmas-twinkle { 0% { opacity: .12; } 55% { opacity: .5; } 100% { opacity: .95; } }
@keyframes xmas-glass { 0% { opacity: .55; } 100% { opacity: 1; } }
@keyframes xmas-burst {
  0% { transform: translate(0, 0) scale(.4) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.1) rotate(160deg); opacity: 0; }
}
@keyframes xmas-flicker { 0%, 100% { fill: #f6c66a; } 37% { fill: #ffd98a; } 41% { fill: #eab159; } 70% { fill: #ffe0a0; } }
@keyframes xmas-flicker-glow { 0%, 100% { opacity: .55; } 40% { opacity: .8; } 70% { opacity: .65; } }
@keyframes xmas-smoke {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  15% { opacity: .5; }
  100% { opacity: 0; transform: translate(14px, -38px) scale(1.9); }
}
@keyframes xmas-seal { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes xmas-fly {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(220px, -160px) rotate(-18deg) scale(.6); opacity: 0; }
}

/* ── The pause: a rise shows finished, a loop holds where it is ────────────────
   A visitor who paused on an earlier page has the pause before the first paint,
   so a rise never starts; held in its delay it would show its first frame. */
[data-christmas-paused] [data-christmas] .xmas-cap,
[data-christmas-paused] [data-christmas] .xmas-drift,
[data-christmas-paused] [data-christmas] .site-foot .lockup .wordmark::after { animation: none !important; transform: none !important; }
[data-christmas-paused] [data-christmas] .xmas-frost__corner { animation: none !important; }
[data-christmas-paused] [data-christmas] .xmas-garland use,
[data-christmas-paused] [data-christmas] .xmas-burst,
[data-christmas-paused] [data-christmas] .xmas-window *,
[data-christmas-paused] [data-christmas] .xmas-smoke .puff,
[data-christmas-paused] [data-christmas] .xmas-letter,
[data-christmas-paused] [data-christmas] .xmas-letter .seal { animation-play-state: paused !important; }

/* ── On a phone the scene is lower, and the footer's last link clears it ───── */
@media (max-width: 600px) {
  [data-christmas] .site-foot .foot-inner { padding-bottom: 76px; }
  .xmas-scenery__land { height: 64px; margin-top: -64px; }
  #home-banner > .xmas-pause { top: 56px; right: 12px; }
}

/* ── Reduced motion: the finished picture, no snow, nothing to pause ───────── */
@media (prefers-reduced-motion: reduce) {
  .js [data-christmas] .xmas-cap,
  .js [data-christmas] .xmas-drift,
  .js [data-christmas] .site-foot .lockup .wordmark::after { animation: none; transform: none; }
  .js [data-christmas] .xmas-frost__corner,
  .js [data-christmas] .xmas-garland .glow,
  .js [data-christmas] .xmas-garland .glass,
  .js [data-christmas] .xmas-window .win,
  .js [data-christmas] .xmas-window .win-glow,
  .js [data-christmas] .xmas-letter .seal,
  .js [data-christmas] .xmas-letter.fly { animation: none; }
  .js [data-christmas] .xmas-smoke .puff { animation: none; opacity: .3; }
  .js [data-christmas] .xmas-burst { animation: none; display: none; }
  [data-xmas-snow] { display: none; }
  .xmas-pause { display: none !important; }
}

@media print {
  .xmas-hero, .xmas-scenery, .xmas-pause, .xmas-letter, .xmas-cap { display: none !important; }
  [data-christmas] .site-head::after, [data-christmas] .site-head .lockup .wordmark::before,
  [data-christmas] .site-foot .lockup .wordmark::after { content: none; }
}
