/* Hartvig as a painter in Image Creator, with clay in the 3D Generator and on
   the holidays (hartvig-extras.mjs). */
.hartvig-x-figure { display: block; pointer-events: none; }
.hartvig-x-figure svg { display: block; width: 100%; height: 100%; overflow: visible; }
@keyframes hartvig-x-pop { from { opacity: 0; transform: scale(.85) translateY(8px); } to { opacity: 1; transform: none; } }

/* 6. The painter at the easel. */
.photo-stage-loading.has-hartvig { position: relative; }
.photo-stage-loading.has-hartvig .photo-loading-tile { margin-bottom: 34px; border: 6px solid #efe5d3; box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.hartvig-x-easel { position: relative; display: block; width: var(--w, 200px); height: 0; margin-top: -40px; pointer-events: none; }
.hartvig-x-easel i { position: absolute; top: -4px; width: 7px; height: 38px; border-radius: 3px; background: linear-gradient(90deg, #b7791f, #8a5a14); transform-origin: 50% 0; }
.hartvig-x-easel i:nth-child(1) { left: 26px; transform: rotate(16deg); }
.hartvig-x-easel i:nth-child(2) { right: 26px; transform: rotate(-16deg); }
.hartvig-x-easel i:nth-child(3) { left: -10px; right: -10px; top: -10px; width: auto; height: 8px; background: linear-gradient(180deg, #c48a2c, #8a5a14); }
.hartvig-x-dabs { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hartvig-x-dabs i { position: absolute; left: var(--x); top: var(--y); width: var(--s); height: calc(var(--s) * .62); border-radius: 50% 46% 54% 50% / 60% 52% 48% 40%; background: var(--c); opacity: 0; transform: rotate(var(--r)) scale(.3); animation: hartvig-x-dab 12s var(--d) ease-out infinite; mix-blend-mode: screen; filter: blur(.4px); }
@keyframes hartvig-x-dab { 0% { opacity: 0; transform: rotate(var(--r)) scale(.3); } 5% { opacity: .78; transform: rotate(var(--r)) scale(1.08); } 8% { transform: rotate(var(--r)) scale(1); } 90% { opacity: .78; } 100% { opacity: 0; transform: rotate(var(--r)) scale(1); } }
.hartvig-x-painter { position: absolute; z-index: 4; width: 110px; height: 110px; filter: drop-shadow(0 10px 16px rgba(240,68,145,.28)); animation: hartvig-x-pop .45s cubic-bezier(.3,1.4,.5,1) both; }
.hartvig-x-brush { transform-box: view-box; transform-origin: 175px 57px; animation: hartvig-x-brush .45s ease-in-out infinite alternate; }
@keyframes hartvig-x-brush { from { transform: rotate(-30deg) translate(-4px, 0); } to { transform: rotate(-4deg); } }
.hartvig-x-painter-say {
  position: absolute; z-index: 5; width: max-content; max-width: 190px; padding: 7px 11px; border-radius: 14px 14px 14px 4px;
  border: 1px solid rgba(240,68,145,.45); background: #241a2c; color: #f7f4fa; font-size: 12.5px; font-weight: 600; line-height: 1.35; text-align: start;
  box-shadow: 0 10px 22px rgba(0,0,0,.35); animation: hartvig-x-pop .4s .25s cubic-bezier(.3,1.5,.5,1) both; pointer-events: none;
}
html[data-theme="light"] .photo-stage-loading.has-hartvig .photo-loading-tile { border-color: #fff; box-shadow: 0 10px 24px rgba(60,20,60,.14); }
html[data-theme="light"] .hartvig-x-painter-say { background: #fff; color: #1e1424; box-shadow: 0 10px 22px rgba(60,20,60,.14); }
html[data-theme="light"] .hartvig-x-dabs i { mix-blend-mode: multiply; }
@media (max-width: 560px) {
  .hartvig-x-painter { width: 80px; height: 80px; }
  .hartvig-x-painter-say { max-width: 172px; font-size: 12px; }
}

/* 7. Clay that becomes a cube. */
.m3d-progress.has-hartvig .m3d-stage-cube { display: none; }
.hartvig-x-clay { display: grid; justify-items: center; gap: 4px; margin: 0 0 8px; --cube: 0; }
.hartvig-x-clay-stage { position: relative; display: block; width: 200px; height: 150px; perspective: 600px; }
.hartvig-x-clay-figure { position: absolute; left: 45px; top: 8px; width: 110px; height: 110px; filter: drop-shadow(0 10px 16px rgba(240,68,145,.25)); animation: hartvig-x-press .5s ease-in-out infinite alternate; }
@keyframes hartvig-x-press { from { transform: translateY(0); } to { transform: translateY(6px); } }
.hartvig-x-clay-table { position: absolute; left: 8px; right: 8px; top: 134px; height: 10px; border-radius: 6px; background: linear-gradient(180deg, #8b5a2b, #5c3a1a); box-shadow: 0 6px 12px rgba(0,0,0,.3); }
.hartvig-x-clay-lump {
  position: absolute; left: 68px; top: 80px; width: 64px; height: 56px; transform-origin: 50% 100%;
  border-radius: 48% 52% 40% 60% / 55% 45% 55% 45%; background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.4), transparent 34%), linear-gradient(135deg, #f9a8d4, #db2777);
  box-shadow: inset -6px -8px 14px rgba(120,10,60,.35); opacity: calc(1 - var(--cube)); animation: hartvig-x-knead .5s ease-in-out infinite alternate; transition: opacity .6s ease;
}
@keyframes hartvig-x-knead { from { border-radius: 48% 52% 40% 60% / 55% 45% 55% 45%; transform: scale(1.06, .88); } to { border-radius: 32% 30% 30% 34% / 34% 32% 30% 30%; transform: scale(.95, 1.04); } }
.hartvig-x-clay-cube { position: absolute; left: 73px; top: 78px; width: 54px; height: 54px; transform-style: preserve-3d; opacity: var(--cube); transform: rotateX(-20deg) rotateY(35deg) scale(calc(.5 + var(--cube) * .3)); transition: opacity .6s ease, transform .6s ease; }
.hartvig-x-clay-cube i { position: absolute; inset: 0; border: 2px solid rgba(255,255,255,.45); border-radius: 5px; background: linear-gradient(135deg, #f472b6, #be185d); }
.hartvig-x-clay-cube i:nth-child(1) { transform: translateZ(27px); }
.hartvig-x-clay-cube i:nth-child(2) { transform: rotateY(180deg) translateZ(27px); }
.hartvig-x-clay-cube i:nth-child(3) { transform: rotateY(90deg) translateZ(27px); background: linear-gradient(135deg, #ec4899, #9d174d); }
.hartvig-x-clay-cube i:nth-child(4) { transform: rotateY(-90deg) translateZ(27px); background: linear-gradient(135deg, #ec4899, #9d174d); }
.hartvig-x-clay-cube i:nth-child(5) { transform: rotateX(90deg) translateZ(27px); background: linear-gradient(135deg, #fbcfe8, #f472b6); }
.hartvig-x-clay-cube i:nth-child(6) { transform: rotateX(-90deg) translateZ(27px); }
.hartvig-x-clay.is-cube .hartvig-x-clay-cube { animation: hartvig-x-spin 4s linear infinite; }
.hartvig-x-clay.is-cube .hartvig-x-clay-figure, .hartvig-x-clay.is-cube .hartvig-x-clay-lump { animation: none; }
@keyframes hartvig-x-spin { from { transform: rotateX(-20deg) rotateY(0); } to { transform: rotateX(-20deg) rotateY(360deg); } }
.hartvig-x-clay-say { color: #ff8cc0; font-size: 12.5px; font-weight: 600; line-height: 1.4; }
html[data-theme="light"] .hartvig-x-clay-say { color: #c0266f; }

/* 10. The holidays on the dashboard. */
.hartvig-x-holiday {
  position: relative; display: flex; align-items: center; gap: 18px; width: min(680px, 100%); margin: 18px auto 4px; padding: 14px 52px 14px 16px; overflow: hidden;
  border: 1px solid rgba(240,68,145,.4); border-radius: 22px; text-align: start; color: #f7f4fa;
  background: radial-gradient(ellipse at 18% 0%, rgba(240,68,145,.24), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(177,76,255,.16), transparent 55%), #1d1724;
  box-shadow: 0 18px 44px rgba(0,0,0,.35); animation: hartvig-x-pop .45s cubic-bezier(.3,1.4,.5,1);
}
.hartvig-x-holiday[data-holiday="newyear"] { border-color: rgba(96,165,250,.4); background: radial-gradient(ellipse at 30% 0%, rgba(96,165,250,.2), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(167,139,250,.18), transparent 55%), #0f1424; }
.hartvig-x-holiday[data-holiday="easter"] { border-color: rgba(74,222,128,.4); background: radial-gradient(ellipse at 20% 0%, rgba(253,224,71,.16), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(74,222,128,.16), transparent 55%), #17201a; }
.hartvig-x-holiday.is-leaving { opacity: 0; transform: scale(.97); transition: opacity .3s ease, transform .3s ease; }
.hartvig-x-holiday-sky { position: absolute; inset: 0; pointer-events: none; }
.hartvig-x-holiday-sky > i { position: absolute; left: var(--x); bottom: -20px; color: #ff5fa6; font-size: var(--s); font-style: normal; line-height: 1; opacity: 0; animation: hartvig-x-rise 3.6s var(--d) ease-in infinite; }
@keyframes hartvig-x-rise { 0% { opacity: 0; transform: translateY(0); } 15% { opacity: .9; } 100% { opacity: 0; transform: translateY(-170px) rotate(18deg); } }
.hartvig-x-firework { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.hartvig-x-firework i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); opacity: 0; animation: hartvig-x-burst 1.8s var(--d) ease-out infinite; }
@keyframes hartvig-x-burst { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--fx), var(--fy)) scale(1); } }
.hartvig-x-holiday-scene { position: relative; z-index: 1; flex: none; width: 150px; height: 118px; }
.hartvig-x-holiday-figure { position: absolute; left: 22px; bottom: 0; width: 108px; height: 108px; filter: drop-shadow(0 10px 16px rgba(240,68,145,.28)); }
.hartvig-x-holiday-figure.is-peeking { bottom: -6px; animation: hartvig-x-peek 2.8s ease-in-out infinite; }
@keyframes hartvig-x-peek { 0%, 100% { transform: translateY(44px); } 35%, 75% { transform: translateY(0); } }
.hartvig-x-bush {
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px; border-radius: 40px 40px 6px 6px;
  background: radial-gradient(circle at 18% 40%, #22c55e 30%, transparent 31%), radial-gradient(circle at 50% 26%, #16a34a 34%, transparent 35%), radial-gradient(circle at 82% 42%, #22c55e 30%, transparent 31%), #15803d;
}
.hartvig-x-egg { position: absolute; bottom: 2px; width: 22px; height: 28px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; box-shadow: inset -3px -4px 6px rgba(0,0,0,.18); animation: hartvig-x-egg .5s cubic-bezier(.3,1.6,.5,1) both; }
.hartvig-x-egg::after { content: ''; position: absolute; left: 0; right: 0; top: 42%; height: 5px; background: rgba(255,255,255,.75); }
.hartvig-x-egg.is-1 { left: -6px; background: #f472b6; }
.hartvig-x-egg.is-2 { left: 64px; bottom: -4px; background: #fde047; animation-delay: .35s; }
.hartvig-x-egg.is-3 { right: -8px; background: #60a5fa; animation-delay: .7s; }
@keyframes hartvig-x-egg { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.hartvig-x-holiday-copy { position: relative; z-index: 1; display: grid; gap: 6px; min-width: 0; }
.hartvig-x-holiday-title { font-size: 20px; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.hartvig-x-holiday-text { margin: 0; color: #cfc6d8; font-size: 13.5px; line-height: 1.5; }
.hartvig-x-holiday .hartvig-x-holiday-close {
  position: absolute; z-index: 2; top: 10px; inset-inline-end: 10px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.16) !important; background: rgba(255,255,255,.05) !important; color: #cfc6d8 !important; font-size: 13px; cursor: pointer;
}
.hartvig-x-holiday .hartvig-x-holiday-close:hover { color: #fff !important; background: rgba(255,255,255,.1) !important; }
.hartvig-x-holiday .hartvig-x-holiday-close:focus-visible { outline: 2px solid #ff8cc0; outline-offset: 2px; }
html[data-theme="light"] .hartvig-x-holiday { color: #1e1424; background: radial-gradient(ellipse at 18% 0%, rgba(240,68,145,.14), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(177,76,255,.1), transparent 55%), #fff; box-shadow: 0 16px 36px rgba(60,20,60,.12); }
html[data-theme="light"] .hartvig-x-holiday[data-holiday="newyear"] { background: radial-gradient(ellipse at 30% 0%, rgba(96,165,250,.16), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(167,139,250,.12), transparent 55%), #fff; }
html[data-theme="light"] .hartvig-x-holiday[data-holiday="easter"] { background: radial-gradient(ellipse at 20% 0%, rgba(253,224,71,.2), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(74,222,128,.14), transparent 55%), #fff; }
html[data-theme="light"] .hartvig-x-holiday-text { color: #5d5066; }
html[data-theme="light"] .hartvig-x-holiday .hartvig-x-holiday-close { border-color: rgba(42,23,48,.16) !important; background: #fff !important; color: #5d5066 !important; }
@media (max-width: 640px) {
  .hartvig-x-holiday { flex-direction: column; align-items: stretch; gap: 6px; padding: 14px 16px 16px; text-align: center; }
  .hartvig-x-holiday-scene { align-self: center; }
}

/* Reduced motion: everything stands still and just appears. */
.hartvig-x-still .hartvig-x-painter, .hartvig-x-still .hartvig-x-painter *, .hartvig-x-still .hartvig-x-painter-say, .hartvig-x-clay.is-still, .hartvig-x-clay.is-still *, .hartvig-x-holiday.is-still, .hartvig-x-holiday.is-still * { animation: none !important; transition: none !important; }
.hartvig-x-still .hartvig-x-dabs i { animation: none !important; opacity: .7; transform: rotate(var(--r)); }
.hartvig-x-holiday.is-still .hartvig-x-holiday-sky > i { opacity: .5; bottom: auto; top: calc(var(--s) * .4); }
.hartvig-x-holiday.is-still .hartvig-x-firework i { opacity: 1; transform: translate(calc(var(--fx) * .6), calc(var(--fy) * .6)); }
@media (prefers-reduced-motion: reduce) {
  .hartvig-x-painter, .hartvig-x-painter *, .hartvig-x-painter-say, .hartvig-x-dabs i, .hartvig-x-clay, .hartvig-x-clay *, .hartvig-x-holiday, .hartvig-x-holiday * { animation: none !important; transition: none !important; }
  .hartvig-x-dabs i { opacity: .7; transform: rotate(var(--r)); }
  .hartvig-x-holiday-sky > i { opacity: .5; bottom: auto; top: calc(var(--s) * .4); }
  .hartvig-x-firework i { opacity: 1; transform: translate(calc(var(--fx) * .6), calc(var(--fy) * .6)); }
}
