/* Brimble Christmas layer — loaded after the site's own stylesheet. Decorative only:
   nothing here changes layout, copy, links or the site's interactions. */

:root {
  --xmas-cranberry: #8e1930;
  --xmas-evergreen: #173c2d;
  --xmas-dot: rgba(118, 124, 132, 0.55);
  /* White page instead of Brimble's #f5f7f7 surface. */
  --brimble-surface: #ffffff;
}

/* ---------- Snow canvas ---------- */
#xmas-snow {
  position: fixed;
  inset: 0;
  z-index: 65; /* above the sticky header (50), below the reindeer cursor (70) */
  pointer-events: none;
}

/* ---------- Hero: reindeer + snowflake flight trail ---------- */
main > section:first-child .my-\[60px\] {
  position: relative;
}
main > section:first-child .my-\[60px\]::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(980px, 96vw);
  aspect-ratio: 1891 / 530;
  transform: translate(-50%, -50%);
  background: url("/xmas/assets/flight-trail.webp?v=e42f5f91cd") center / contain no-repeat;
  pointer-events: none;
  opacity: 0;
  animation: xmas-trail-in 1.4s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes xmas-trail-in {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 0.9; clip-path: inset(0 0 0 0); }
}

/* Header logo with Santa hat: the hat pokes out above the 32px box. */
header img[src^="/xmas/assets/logo.svg?v=e42f5f91cd"] {
  transform: scale(1.28) translateY(-2px);
  transform-origin: 50% 70%;
}

/* ---------- Dotted dividers ---------- */
main [class*="border-[rgba(152,157,164,0.25)]"]:not([class*="rounded"]) {
  border-style: dotted !important;
  border-color: var(--xmas-dot) !important;
}

/* Snowflake accents where the two-column feature rows meet (every other row, desktop only). */
@media (min-width: 768px) {
  main section.grid[class*="md:grid-cols-2"][class*="border-t"] {
    position: relative;
  }
  main section.grid[class*="md:grid-cols-2"][class*="border-t"]:nth-of-type(odd)::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 18px;
    height: 18px;
    transform: translate(-50%, -50%);
    background: #fff url("/xmas/assets/snowflake.svg?v=e42f5f91cd") center / 16px no-repeat;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
  }
}
/* A snowflake on the line above the changelog and under the features grid title. */
main .dash-rule-top {
  position: relative;
}
main .dash-rule-top::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  background: #fff url("/xmas/assets/snowflake.svg?v=e42f5f91cd") center / 16px no-repeat;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}

/* ---------- Snowcaps ---------- */
/* Snow covers the whole top edge of each element and spills a little over the corners.
   Small elements use crisp vector mounds (photo snow turns to grey fuzz at ~10px); big ones use
   the photographic snow. A faint cool shadow lets white snow read on the white page. */
main [data-slot="button"][data-variant^="pill"],
main [class*="border-[#e2e3e5]"][class*="shadow-[0_1px_2px"]:not([class*="absolute"]):not([class*="shadow-none"]),
main [class*="rounded-[13.25px]"][class*="bg-[#222528]"],
main .rounded-3xl[class*="bg-brimble-air-gray"] {
  position: relative;
}
main [data-slot="button"][data-variant^="pill"]::after,
main [class*="border-[#e2e3e5]"][class*="shadow-[0_1px_2px"]:not([class*="absolute"]):not([class*="shadow-none"])::after,
main .rounded-3xl[class*="bg-brimble-air-gray"]::after,
main [class*="rounded-[13.25px]"][class*="bg-[#222528]"]::after,
main div:has(> [class*="rounded-t-xl"][class*="border-b-0"])::before {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 0.5px 0.8px rgba(70, 92, 122, 0.38));
}

/* Buttons */
main [data-slot="button"][data-variant^="pill"]::after {
  left: -2px;
  right: -2px;
  height: 12px;
  top: -10px;
  background: url("/xmas/assets/snowcap-small.svg?v=e42f5f91cd") center / 100% 100% no-repeat;
}

/* Product cards (deploy logs, databases, domains, scaling, CI runners) */
main [class*="border-[#e2e3e5]"][class*="shadow-[0_1px_2px"]:not([class*="absolute"]):not([class*="shadow-none"])::after {
  left: -3px;
  right: -3px;
  height: 14px;
  top: -10.5px;
  background: url("/xmas/assets/snowcap-wide.svg?v=e42f5f91cd") center / 100% 100% no-repeat;
}
main [class*="border-[#e2e3e5]"][class*="w-[180px]"]:not([class*="absolute"]):not([class*="shadow-none"])::after,
main [class*="border-[#e2e3e5]"][class*="w-[200px]"]:not([class*="absolute"]):not([class*="shadow-none"])::after {
  background-image: url("/xmas/assets/snowcap-small.svg?v=e42f5f91cd");
  height: 13px;
  top: -11px;
}

/* Security card */
main .rounded-3xl[class*="bg-brimble-air-gray"]::after {
  left: -6px;
  right: -6px;
  height: 30px;
  top: -14px;
  background: url("/xmas/assets/snowcap.webp?v=e42f5f91cd") center / 100% 100% no-repeat;
}

/* CLI terminal: its children are transparent, so it can let the snow sit over its edge. */
main [class*="rounded-[13.25px]"][class*="bg-[#222528]"] {
  overflow: visible;
}
main [class*="rounded-[13.25px]"][class*="bg-[#222528]"]::after {
  left: -5px;
  right: -5px;
  height: 24px;
  top: -11px;
  background: url("/xmas/assets/snowcap.webp?v=e42f5f91cd") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1px rgba(40, 60, 90, 0.3));
}

/* Observability / storage / agent dashboards: the frame clips its screenshot, so the snow lives
   on the pale-blue field around it, lined up with the frame (960px max, 32px gutters). */
main div:has(> [class*="rounded-t-xl"][class*="border-b-0"]) {
  position: relative;
}
main div:has(> [class*="rounded-t-xl"][class*="border-b-0"])::before {
  left: calc(max(32px, (100% - 960px) / 2) - 8px);
  right: calc(max(32px, (100% - 960px) / 2) - 8px);
  top: 16px;
  height: 36px;
  background: url("/xmas/assets/snowcap.webp?v=e42f5f91cd") center / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1.5px rgba(40, 70, 120, 0.25));
}

/* ---------- Final CTA: snow along the rim + snowy city ---------- */
/* The card clips its contents, so the snow lives on its wrapper and piles over the top edge.
   It fades in once the card has finished its entrance animation. */
main div:has(> .rounded-3xl.bg-brimble-accent-blue) {
  position: relative;
}
main div:has(> .rounded-3xl.bg-brimble-accent-blue)::before {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: -20px;
  height: 46px;
  background: url("/xmas/assets/snowcap.webp?v=e42f5f91cd") center top / 100% 100% no-repeat;
  filter: drop-shadow(0 1px 1.5px rgba(40, 70, 120, 0.25));
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity 0.6s ease;
}
main div:has(> .rounded-3xl.bg-brimble-accent-blue[style*="opacity:1"])::before,
main div:has(> .rounded-3xl.bg-brimble-accent-blue[style*="opacity: 1"])::before {
  opacity: 1;
}
main .bg-brimble-accent-blue img[src^="/xmas/assets/snowy-city.webp?v=e42f5f91cd"] {
  mix-blend-mode: normal;
  opacity: 0.95;
  height: 360px;
  bottom: 70px;
}

/* ---------- Music button ---------- */
#xmas-music-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 66;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 0.5px solid #e2e3e5;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(18, 18, 23, 0.06);
  font: 500 12px/1 "IBM Plex Sans", system-ui, sans-serif;
  color: #222528;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}
#xmas-music-toggle:hover { transform: scale(1.03); }
#xmas-music-toggle:active { transform: scale(0.97); }
#xmas-music-toggle:focus-visible { outline: 2px solid #006fff; outline-offset: 2px; }
#xmas-music-toggle svg { width: 15px; height: 15px; overflow: visible; }
#xmas-music-toggle .bar { fill: var(--xmas-cranberry); transform-box: fill-box; transform-origin: 50% 50%; transform: scaleY(0.45); }
#xmas-music-toggle[data-playing="true"] .bar { animation: xmas-eq 0.9s ease-in-out infinite; }
#xmas-music-toggle[data-playing="true"] .b2 { animation-delay: -0.3s; }
#xmas-music-toggle[data-playing="true"] .b3 { animation-delay: -0.6s; }
#xmas-music-toggle[data-state="off"] { opacity: 0.75; }
/* Waiting for the visitor's first click: a soft glow invites them to start the music. */
#xmas-music-toggle[data-state="ready"] {
  border-color: rgba(142, 25, 48, 0.35);
  animation: xmas-invite 2.2s ease-in-out infinite;
}
@keyframes xmas-invite {
  0%, 100% { box-shadow: 0 1px 2px rgba(18, 18, 23, 0.06), 0 0 0 0 rgba(142, 25, 48, 0.28); }
  50% { box-shadow: 0 1px 2px rgba(18, 18, 23, 0.06), 0 0 0 6px rgba(142, 25, 48, 0); }
}
@keyframes xmas-eq {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}
@media (max-width: 767px) {
  #xmas-music-toggle { width: 32px; padding: 0; justify-content: center; }
  #xmas-music-toggle span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

@media (prefers-reduced-motion: reduce) {
  #xmas-music-toggle .bar { animation: none !important; }
  main > section:first-child .my-\[60px\]::before { animation: none; opacity: 0.9; }
}
