/* Halloween: the paper ghost, the postmark and the bat take turns on the homepage; the app keeps the ghost.
   Activation belongs to the server's seasonal policy. */
body[data-seasonal-active="halloween"] {
  /* The season's two paints, from the art: the bat's night plum (bg-tokens.css) and the pumpkin's candle. */
  --seasonal-night: var(--season-night);
  --seasonal-candle: rgb(224 129 47 / .32);
  --seasonal-logo-art-width: 56px;
  --seasonal-logo-art-height: 64px;
  --seasonal-logo-tuck: 40px;
  --seasonal-logo-font: 35px;
  --seasonal-sidebar-slot: 120px;
}

body[data-seasonal-active="halloween"] .seasonal-logo-lockup[data-seasonal-placement="logo"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  height: var(--seasonal-logo-art-height);
  vertical-align: middle;
  isolation: isolate;
}

.seasonal-logo-lockup[data-seasonal-logo="postmark"] { --seasonal-logo-art-width: 44px; --seasonal-logo-tuck: 42px; }
/* The bat crosses a moon left of the B, and a second one flies over the d, behind the letters. */
.seasonal-logo-lockup[data-seasonal-logo="bat"] { --seasonal-logo-art-width: 144px; --seasonal-logo-tuck: 42px; }

/* The character peeks out from behind the B: the wordmark sits over its right edge. */
.seasonal-logo-lockup > .brandmark {
  position: relative;
  z-index: var(--z-sticky);
  margin-left: var(--seasonal-logo-tuck);
}

.seasonal-logo-lockup .bg-wordmark { font-size: var(--seasonal-logo-font); }

.seasonal-trigger {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.seasonal-trigger[hidden], .seasonal-feedback[hidden] { display: none; }

.seasonal-trigger:focus-visible, .seasonal-controls button:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.seasonal-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.seasonal-logo-lockup .seasonal-trigger {
  width: var(--seasonal-logo-art-width);
  height: var(--seasonal-logo-art-height);
  left: 0;
  top: -3px;
}

body[data-seasonal-active="halloween"] aside.bg-nav-sidebar .seasonal-sidebar-scene {
  position: relative;
  flex: 0 0 var(--seasonal-sidebar-slot);
}

aside.bg-nav-sidebar .seasonal-sidebar-scene .seasonal-trigger {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--seasonal-sidebar-slot) + 88px);
  overflow: hidden;
  border-radius: 0;
}

aside.bg-nav-sidebar .seasonal-sidebar-scene .seasonal-art {
  position: absolute;
  width: min(88%, 200px);
  height: auto;
  left: 50%;
  bottom: 2px;
  translate: -50% 0;
}

/* The dark sidebar gets its own ghost: a sand outline, warmer paper and a faint moonlit glow. */
.seasonal-art--dark { display: none; }
[data-theme="dark"] .seasonal-art--light { display: none; }
[data-theme="dark"] .seasonal-art--dark { display: block; }

body.bg-app[data-seasonal-active="halloween"] aside.bg-nav-sidebar:has(.seasonal-trigger) .nav {
  position: relative;
  z-index: var(--z-sticky);
}

body.bg-app[data-seasonal-active="halloween"] aside.bg-nav-sidebar:has(.seasonal-trigger) .sidebar-foot {
  border-top-color: transparent;
  z-index: var(--z-dropdown);
}

body.bg-app[data-seasonal-active="halloween"] aside.bg-nav-sidebar:has(.seasonal-trigger) #bgAccountBtn {
  min-height: 44px;
  background: var(--cream);
}

body.bg-app[data-seasonal-active="halloween"] aside.bg-nav-sidebar:has(.seasonal-trigger) #bgAccountBtn .who span {
  color: var(--text-muted);
}

body.bg-app[data-seasonal-active="halloween"] aside.bg-nav-sidebar:has(.seasonal-trigger) #bgAccountBtn .caret {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--sand-300);
  border-radius: var(--r-sm);
}

/* The headline says the season's line at one size, scaled so "Go trick-or-treating." (7.98em) fills its column, and the
   character stands in the room that leaves beside "Do the work. / Get paid.": two lines of type tall, its foot on the
   second line's baseline, flush with the end of the long line. All of it is measured in the headline's own size. */
@supports (container-type: inline-size) {
  .home-hero [data-seasonal-stage] { position: relative; container-type: inline-size; }
  /* Never above the headline's usual size: 70px stacked, 60px on phones (home.css). */
  .home-hero [data-seasonal-stage] > * { --seasonal-type: min(calc(100cqi / 8.1), 70px); }
  .home-hero [data-seasonal-stage] h1 { font-size: var(--seasonal-type); }
  .home-hero [data-seasonal-stage] h1 .accent { white-space: nowrap; }
  .home-hero [data-seasonal-stage] .seasonal-trigger[data-seasonal-placement="hero"] {
    position: absolute;
    right: max(0px, calc(100cqi - var(--seasonal-type) * 7.98));
    bottom: calc(var(--seasonal-type) * 1.12);
    border-radius: var(--r-md);
  }
  .home-hero [data-seasonal-stage] .seasonal-trigger[data-seasonal-placement="hero"] .seasonal-art { width: auto; height: calc(var(--seasonal-type) * 1.9); }
}
@media (max-width: 700px) {
  @supports (container-type: inline-size) {
    .home-hero [data-seasonal-stage] > * { --seasonal-type: min(calc(100cqi / 8.1), 60px); }
  }
}
/* One call to action for the season, painted night plum with a candle glowing up from its edge, and the character
   peeking over the middle of it. Hover lights the candle and lifts the character for a look. */
.home-hero[data-seasonal-hero] .home-watch { display: none; }
.home-hero[data-seasonal-hero] .btn--primary {
  position: relative;
  color: var(--cream);
  background: radial-gradient(120% 150% at 50% 135%, var(--seasonal-candle), transparent 62%), var(--seasonal-night);
  box-shadow: inset 0 0 0 1px rgb(185 151 79 / .35);
  transition: box-shadow .25s var(--ease-out), transform .15s var(--ease-out);
}
.home-hero[data-seasonal-hero] .btn--primary:hover {
  background: radial-gradient(130% 160% at 50% 135%, rgb(224 129 47 / .5), transparent 64%), var(--seasonal-night);
}
.seasonal-peek {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 3px);
  width: 46px;
  translate: -50% 0;
  pointer-events: none;
  transition: translate .25s var(--ease-out);
}
.seasonal-peek .seasonal-art { width: 100%; height: auto; }
.btn--primary:is(:hover, :focus-visible) .seasonal-peek { translate: -50% -4px; }
@media (prefers-reduced-motion: reduce) { .seasonal-peek, .home-hero[data-seasonal-hero] .btn--primary { transition: none; } }

@supports not (container-type: inline-size) {
  .home-hero [data-seasonal-stage] h1 .accent { font-size: .7em; white-space: nowrap; }
  .home-hero [data-seasonal-stage] .seasonal-trigger { display: none; }
}

aside.bg-nav-sidebar .seasonal-trigger:focus-visible { outline-offset: -3px; }
.seasonal-trigger.is-poofing .seasonal-art { opacity: 0; }

.seasonal-controls { font: 500 var(--fs-xs) var(--font-sans); color: var(--text-muted); }
.seasonal-controls--menu { display: block; font: inherit; }
body.bg-app .acct-menu:has(.seasonal-controls--menu) { width: var(--pop-w); right: auto; }
.seasonal-controls--menu .mt-left { padding-left: calc(var(--icon-size-md) + var(--icon-gap-md)); }

.seasonal-feedback {
  position: fixed;
  translate: -50% 0;
  width: max-content;
  max-width: calc(100vw - var(--space-4));
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-panel);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font: 500 var(--fs-sm) var(--font-sans);
  white-space: nowrap;
  z-index: var(--z-popover);
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .seasonal-trigger.is-poofing .seasonal-art { animation: seasonal-poof .4s ease-out both; }
  .seasonal-trigger.is-poofing::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--r-pill);
    background: radial-gradient(circle at 30% 55%, var(--gold-soft) 0 18%, transparent 19%), radial-gradient(circle at 60% 30%, var(--cream-line) 0 24%, transparent 25%), radial-gradient(circle at 70% 65%, var(--gold-soft) 0 22%, transparent 23%);
    animation: seasonal-cloud .45s ease-out both;
    pointer-events: none;
  }
}

@keyframes seasonal-poof {
  0% { opacity: var(--seasonal-art-opacity, 1); scale: 1; }
  35% { opacity: calc(var(--seasonal-art-opacity, 1) * .8); scale: 1.04; }
  100% { opacity: 0; scale: .35; }
}
@keyframes seasonal-cloud { from { opacity: .75; scale: .6; } to { opacity: 0; scale: 1.3; } }

@media (forced-colors: active) {
  .seasonal-art, .seasonal-trigger::after { visibility: hidden; }
  .seasonal-logo-lockup .seasonal-trigger, .home-hero .seasonal-trigger { display: none; }
  aside.bg-nav-sidebar .seasonal-sidebar-scene { display: none; }
  body.bg-app[data-seasonal-active="halloween"] aside.bg-nav-sidebar #bgAccountBtn .caret { color: ButtonText; background: ButtonFace; border-color: ButtonText; }
}
