html[data-event-palette="christmas"] {
  --hp-ui-blue-950: 154 50% 8%;
  --hp-ui-blue-900: 152 47% 12%;
  --hp-ui-blue-800: 154 46% 16%;
  --hp-ui-blue-700: 149 34% 25%;
  --hp-ui-blue-600: 140 25% 34%;
  --hp-ui-blue-500: 35 64% 34%;
  --hp-ui-blue-400: 37 55% 49%;
  --hp-ui-blue-300: 40 58% 68%;
  --hp-ui-blue-200: 41 60% 81%;
  --hp-ui-blue-100: 43 65% 91%;
  --hp-ui-blue-50: 44 80% 96%;

  --hp-ui-violet-950: 347 49% 10%;
  --hp-ui-violet-900: 346 49% 16%;
  --hp-ui-violet-800: 346 58% 23%;
  --hp-ui-violet-700: 348 58% 29%;
  --hp-ui-violet-600: 348 52% 34%;
  --hp-ui-violet-500: 348 52% 39%;
  --hp-ui-violet-400: 349 43% 51%;
  --hp-ui-violet-300: 351 41% 66%;
  --hp-ui-violet-200: 9 46% 80%;
  --hp-ui-violet-100: 19 60% 91%;
  --hp-ui-violet-50: 28 75% 97%;

  --hp-button-primary-gradient: linear-gradient(105deg, #681728 0% 32%, #9a3247 68% 100%);
  --hp-button-secondary-gradient: linear-gradient(105deg, #2d6349 0% 32%, #163b2b 68% 100%);
  --christmas-gold-on-dark: #ffe7a3;
  --christmas-red: #8e243b;
  --christmas-rose: #f7e0e1;
  --christmas-fir-frame: url("/images/event-themes/christmas/fir-frame.webp");
  --christmas-frame-width: clamp(460px, 58vw, 820px);
  --event-viewer-tint: #efd2d6;
  --event-viewer-background:
    radial-gradient(ellipse at 68% 24%, rgb(255 250 245 / 78%), transparent 65%),
    linear-gradient(150deg, #fae9e8, var(--event-viewer-tint) 70%, #e6bec5);
  --nextui-focus: 36 62% 37%;
  accent-color: #781e31;
}

html[data-event-palette="christmas"] body {
  background-color: #fffaf0;
}

html[data-event-palette="christmas"] .hp-navbar--hero {
  background: linear-gradient(145deg, rgb(255 250 238 / 86%), rgb(239 222 179 / 71%));
}

html[data-event-palette="christmas"] .hp-navbar--solid {
  background: linear-gradient(145deg, rgb(255 250 238 / 95%), rgb(245 231 202 / 90%));
}

html[data-event-palette="christmas"] .hp-navbar__cta {
  background-image: var(--hp-button-primary-gradient);
}

html[data-event-palette="christmas"] #hp-navbar {
  border-color: rgb(142 36 59 / 28%) !important;
}

html[data-event-palette="christmas"] #hp-navbar::after {
  --navbar-garland: url("/images/event-themes/christmas/navbar-fir-garland.webp");
  --navbar-garland-lights: url("/images/event-themes/christmas/navbar-fir-garland-lights.svg");
  content: "";
  position: absolute;
  z-index: 2;
  top: calc(100% - 4px);
  inset-inline: 0;
  height: clamp(25px, 4.4vw, 55px);
  pointer-events: none;
  background-image: var(--navbar-garland-lights), var(--navbar-garland-lights), var(--navbar-garland), var(--navbar-garland);
  background-position: left top, right top;
  background-size: 52% 100%, 51% 100%;
  background-repeat: no-repeat;
  filter: brightness(1.1) drop-shadow(0 3px 3px rgb(33 43 25 / 28%));
}

@media (max-width: 480px) {
  html[data-event-palette="christmas"] {
    --navbar-garland-height: calc((100vw - 30px) * 149 / 1320);
  }

  html[data-event-palette="christmas"] #hp-navbar::after {
    height: var(--navbar-garland-height);
    background-image: var(--navbar-garland-lights), var(--navbar-garland);
    background-size: 100% 100%;
  }
}

html[data-event-palette="christmas"] #hp-navbar .hp-navbar__link--active {
  background: var(--christmas-rose);
  color: var(--christmas-red) !important;
  box-shadow: inset 0 0 0 1px rgb(142 36 59 / 19%);
}

html[data-event-palette="christmas"] [data-site-footer] {
  --tertiary: var(--christmas-gold-on-dark);
  border-block-start: 3px solid var(--christmas-red);
}

html[data-event-palette="christmas"] [data-dark-cta] {
  background: linear-gradient(115deg, #153b2b, #244333 58%, #632333);
}

html[data-event-palette="christmas"] [data-dark-cta] > div:first-child > p:first-child {
  color: var(--christmas-gold-on-dark) !important;
}

html[data-event-palette="christmas"] [data-dark-cta] > div:first-child > p:first-child::before,
html[data-event-palette="christmas"] [data-dark-cta] > div:first-child > p:first-child > span[aria-hidden] {
  background: var(--christmas-gold-on-dark);
}

html[data-event-palette="christmas"] [data-design-surface] {
  background: var(--event-viewer-background);
}

/* Cornice dietro il contenuto delle landing e nelle altre scene della home. */
html[data-event-palette="christmas"] [data-landing-hero] {
  --hp-button-secondary-gradient: var(--hp-button-primary-gradient);
  --christmas-frame-scale: 2;
  position: relative;
  isolation: isolate;
}

html[data-event-palette="christmas"] :is([data-landing-hero], [data-christmas-scene]:not(:first-child))::after {
  --frame-width: calc(var(--christmas-frame-width) * var(--christmas-frame-scale, 1));
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: min(100%, calc(var(--frame-width) / 1.5));
  pointer-events: none;
  background: var(--christmas-fir-frame) left bottom / var(--frame-width) auto no-repeat;
}

html[data-event-palette="christmas"] [data-landing-hero]::after {
  --copy-gutter: max(18px, calc((100% - 1320px) / 2));
  z-index: -1;
  opacity: 0.65;
  mask-image:
    linear-gradient(180deg, transparent, #000 13%),
    linear-gradient(90deg, #000 calc(var(--copy-gutter) * 0.4), rgb(0 0 0 / 20%) var(--copy-gutter)),
    linear-gradient(0deg, #000 12%, transparent 22%);
  mask-composite: intersect, add;
}

/* Anchor the snow to the end of the hero content, above the benefits row. */
html[data-event-palette="christmas"] [data-landing-hero]:has(> [role="list"]:last-child) {
  display: grid;
}

html[data-event-palette="christmas"] [data-landing-hero]:has(> [role="list"]:last-child)::after {
  grid-row: 1 / 2;
}

html[data-event-palette="christmas"] [data-christmas-scene]:not(:first-child)::after {
  opacity: 0.58;
  mask-image: linear-gradient(180deg, transparent, #000 13%);
}

/* Gli accessori usano le stesse proporzioni in home e in Chi siamo. */
html[data-event-palette="christmas"] [data-team-grid] {
  padding-top: 46px;
  row-gap: 56px;
}

html[data-event-palette="christmas"] [data-team-portrait],
html[data-event-palette="christmas"] article:hover [data-team-portrait] {
  overflow: visible;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html[data-event-palette="christmas"] [data-team-portrait] img {
  border-radius: 50%;
}

html[data-event-palette="christmas"] [data-team-portrait]::after,
html[data-event-palette="christmas"] [data-team-portrait="3"]::before {
  content: "";
  position: absolute;
  left: var(--accessory-x, 50%);
  bottom: var(--accessory-bottom);
  width: var(--accessory-width);
  aspect-ratio: var(--accessory-ratio);
  pointer-events: none;
  transform: translateX(-50%) rotate(var(--accessory-tilt, 0deg));
}

html[data-event-palette="christmas"] [data-team-portrait]::after {
  z-index: 1;
  background: var(--team-accessory) center bottom / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgb(44 27 17 / 20%));
}

[data-event-palette="christmas"] [data-team-portrait="0"] {
  --team-accessory: url("/images/event-themes/christmas/elf-hat.webp");
  --accessory-width: 65%;
  --accessory-ratio: 9 / 4;
  --accessory-bottom: 75%;
  --accessory-x: 54%;
  --accessory-tilt: -4deg;
}

[data-event-palette="christmas"] [data-team-portrait="1"] {
  --team-accessory: url("/images/event-themes/christmas/reindeer-antlers.webp");
  --accessory-width: 76%;
  --accessory-ratio: 21 / 10;
  --accessory-bottom: 76%;
}

[data-event-palette="christmas"] [data-team-portrait="2"] {
  --team-accessory: url("/images/event-themes/christmas/team-fairy-lights-ring.svg");
  --accessory-width: 112%;
  --accessory-ratio: 1;
  --accessory-bottom: -6%;
}

[data-event-palette="christmas"] [data-team-portrait="3"] {
  --team-accessory: url("/images/event-themes/christmas/festive-bow-tie-glitter.webp");
  --accessory-width: 32%;
  --accessory-ratio: 23 / 10;
  --accessory-bottom: 4%;
}

html[data-event-palette="christmas"] [data-team-portrait="3"]::before {
  z-index: 2;
  background:
    radial-gradient(circle at 15% 28%, #fff6cf 0 1px, #ffd164 1.3px, transparent 3px),
    radial-gradient(circle at 29% 48%, #fff9e6 0 1px, #ffd164 1.3px, transparent 3px),
    radial-gradient(circle at 17% 71%, #fff9e6 0 .9px, #ffd164 1.2px, transparent 2.6px),
    radial-gradient(circle at 72% 44%, #fff6cf 0 1px, #ffd164 1.3px, transparent 3px),
    radial-gradient(circle at 87% 27%, #fff9e6 0 1px, #ffd164 1.3px, transparent 3px),
    radial-gradient(circle at 86% 70%, #fff9e6 0 .9px, #ffd164 1.2px, transparent 2.6px);
  animation: hp-christmas-bow-glint 7s ease-in-out infinite;
}

@keyframes hp-christmas-bow-glint {
  0%, 22%, 44%, 72%, 100% { opacity: .32; }
  34% { opacity: 1; }
  61% { opacity: .85; }
}

[data-event-palette="christmas"] [data-team-portrait="4"] {
  --team-accessory: url("/images/event-themes/christmas/holly-hair-clip.webp");
  --accessory-width: 55%;
  --accessory-ratio: 3 / 2;
  --accessory-bottom: 72%;
  --accessory-x: 77%;
  --accessory-tilt: 78deg;
}

[data-event-palette="christmas"] [data-team-portrait="5"] {
  --team-accessory: url("/images/event-themes/christmas/winter-earmuffs.webp");
  --accessory-width: 64%;
  --accessory-ratio: 5 / 4;
  --accessory-bottom: 41%;
  --accessory-tilt: -10deg;
}

html[data-event-palette="christmas"] [data-team-portrait="5"]::after {
  background-size: 100% 100%;
}

[data-christmas-snow] {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  overflow: hidden;
  container-type: size;
  pointer-events: none;
  color: #fffaf0;
}

[data-christmas-snow] > svg {
  position: absolute;
  top: -25px;
  left: var(--x);
  width: var(--size);
  height: var(--size);
  opacity: var(--opacity);
  filter: drop-shadow(0 1px 1px rgb(68 28 36 / 55%));
  animation: hp-christmas-snowfall var(--duration) var(--delay) linear infinite;
}

@keyframes hp-christmas-snowfall {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  to {
    transform: translate3d(var(--drift), calc(100cqh + 50px), 0) rotate(var(--turn));
  }
}

@media (max-width: 760px) {
  html[data-event-palette="christmas"] {
    --christmas-frame-width: 115vw;
  }

  [data-christmas-snow] > svg:nth-child(n + 23) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) [data-christmas-snow] {
    display: none;
  }

  html[data-event-palette="christmas"]:not([data-motion="full"]) #hp-navbar::after {
    --navbar-garland-lights: none;
  }

  html[data-event-palette="christmas"]:not([data-motion="full"]) [data-team-portrait="2"] {
    --team-accessory: url("/images/event-themes/christmas/team-fairy-lights-ring.svg#still");
  }

  html[data-event-palette="christmas"]:not([data-motion="full"]) [data-team-portrait="3"]::before {
    animation: none;
  }
}
