/* Seasonal theme (js/lib/season-core.js), homepage only.

   Nothing here applies until js/home-page.js sets data-season on <html>,
   along with three custom properties:

     --season-glow   "r g b", the main light (pumpkin orange, frost blue...)
     --season-alt    "r g b", a second light for side fills and seam ends
     --season-hue    degrees, the card spotlight's hue

   It re-tints the lights the homepage already has and adds none: the band
   glows keep their shapes and positions from css/home.css ("BANDS"), the
   seams keep their reveal, the spotlight keeps its drift across the screen.
   The hero's WebGL gradient is re-coloured by js/lib/hero-flow.js itself. */

/* Homepage-wide accent tokens. Dark custom palettes get a lighter tint for
   small text, and filled controls use a contrast-selected foreground.
   This stylesheet is loaded only by the homepage; removing data-season
   restores every original brand colour without touching other pages. */
html[data-season] {
  --season-text: color-mix(in srgb, rgb(var(--season-glow)) 45%, white);
  --orange: rgb(var(--season-glow));
  --orange-soft: rgb(var(--season-glow) / .16);
  --accent-primary: var(--season-text);
  --accent-secondary: var(--season-text);
  --accent-tertiary: var(--season-text);
}
/* Set by the head script and js/home-page.js for the instant a palette is
   applied or removed after first paint, so nothing animates from one palette
   into the other (the chrome's colour transitions would show the old colour
   fading through). They flush the new styles and remove the class in the same
   task, so no later hover or entrance transition is affected. */
html.season-swap,
html.season-swap *,
html.season-swap *::before,
html.season-swap *::after { transition: none !important; }

/* The official logo's chevron takes the season's light; the white "A" never
   changes. The two layers are the logo's own paths, split by colour
   (scripts/build-brand-assets.js), so they stack exactly. */
html[data-season] .site-brand-mark {
  position: relative;
  background-image: url('/assets/alr-logo-a.svg');
}
html[data-season] .site-brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgb(var(--season-glow));
  -webkit-mask: url('/assets/alr-logo-chevron.svg') center / contain no-repeat;
  mask: url('/assets/alr-logo-chevron.svg') center / contain no-repeat;
}
html[data-season] .site-nav::before {
  background: radial-gradient(620px 120px at 10% 0%, rgb(var(--season-glow) / .16), transparent 72%),
    radial-gradient(500px 100px at 90% 0%, rgb(var(--season-alt) / .1), transparent 74%);
}
html[data-season] .site-brand .site-early-access-badge {
  color: var(--season-text);
  border-color: rgb(var(--season-glow) / .18);
  background: rgb(var(--season-glow) / .06);
}
html[data-season] .site-nav-link.active::after { background: rgb(var(--season-glow)); }
html[data-season] .site-nav-link-request {
  color: var(--season-text);
  border-color: rgb(var(--season-glow) / .66);
  background: rgb(var(--season-glow) / .06);
}
html[data-season] .site-nav-link-request:is(:hover, .active) {
  color: var(--season-text);
  border-color: rgb(var(--season-glow) / .82);
  background: rgb(var(--season-glow) / .16);
}
html[data-season] :is(.site-nav-signin, .site-account-trigger),
html[data-season] .hero .btn-primary,
html[data-season] .hero .btn-primary:is(:hover, :focus-visible) {
  background: rgb(var(--season-glow));
  border-color: rgb(var(--season-glow));
  color: var(--season-on-accent, #000);
}
/* The hero CTA's hover glow: the same lift and ring as css/home.css's
   ".hero .btn-primary:hover", in the season's light instead of orange. */
html[data-season] .hero .btn-primary:is(:hover, :focus-visible) {
  box-shadow: 0 16px 34px rgb(var(--season-glow) / .33), 0 0 0 1px rgb(var(--season-glow) / .28);
}
html[data-season] :is(.site-nav-signin:hover, .site-account-trigger:hover, .site-account-menu.is-open .site-account-trigger) {
  background: rgb(var(--season-glow));
  border-color: var(--season-text);
  color: var(--season-on-accent, #000);
  box-shadow: 0 8px 22px rgb(var(--season-glow) / .2);
}
html[data-season] .site-account-trigger-avatar {
  border-color: rgb(var(--season-glow) / .42);
  background: rgb(var(--season-glow) / .14);
  color: var(--season-on-accent, #000);
}
html[data-season] .site-nav :is(.site-nav-more-dropdown, .site-account-dropdown) {
  outline-color: rgb(var(--season-glow) / .12);
}
html[data-season] .site-nav-hamburger:hover {
  border-color: rgb(var(--season-glow) / .32);
  background: rgb(var(--season-glow) / .07);
}
html[data-season] .site-nav-mobile-drawer {
  background: radial-gradient(ellipse at 10% 0%, rgb(var(--season-glow) / .11), transparent 48%), #0c1018;
  border-top-color: rgb(var(--season-glow) / .18);
}
html[data-season] .site-nav-mobile-link:is(.active, :hover) i,
html[data-season] .site-nav-mobile-link i:not(.fa-discord) { color: var(--season-text); }
html[data-season] .site-nav-mobile-link.active { background: rgb(var(--season-glow) / .1); }
html[data-season] :is(.site-nav-mobile-link-request, .site-nav-mobile-signin) {
  color: var(--season-text);
  border-color: rgb(var(--season-glow) / .36);
  background: rgb(var(--season-glow) / .06);
}
html[data-season] :is(.site-nav-mobile-link-request:hover, .site-nav-mobile-link-request.active, .site-nav-mobile-signin:hover, .site-nav-mobile-signout:hover) {
  color: var(--season-text);
  border-color: rgb(var(--season-glow) / .58);
  background: rgb(var(--season-glow) / .14);
}
html[data-season] .back-to-top { border-color: rgb(var(--season-glow) / .22); }
html[data-season] .back-to-top:hover {
  background: rgb(var(--season-glow));
  color: var(--season-on-accent, #000);
  border-color: rgb(var(--season-glow) / .45);
  box-shadow: 0 14px 28px rgb(var(--season-glow) / .18);
}
html[data-season] .footer-socials a:hover {
  border-color: rgb(var(--season-glow) / .28);
  background: rgb(var(--season-glow) / .1);
}
html[data-season] .site-announcement:not(.is-neutral) {
  border-color: rgb(var(--season-glow) / .45);
  background: color-mix(in srgb, rgb(var(--season-glow)) 6%, #111114);
}
html[data-season] .join-section::before {
  background: radial-gradient(closest-side, rgb(var(--season-glow) / .16) 0%, rgb(var(--season-glow) / .06) 44%, transparent 100%);
}
html[data-season] .featured-card.is-featured::after {
  background: rgb(var(--season-glow));
  color: var(--season-on-accent, #000);
  box-shadow: 0 2px 10px rgb(var(--season-glow) / .25);
}
html[data-season] #latest .featured-card .card-content .status-pill,
html[data-season] .toolbox-release-notice .toolbox-release-notice-label,
html[data-season] .toolbox-release-notice > a:is(:hover, :focus-visible),
html[data-season] .section-lead-link:is(:hover, :focus-visible),
html[data-season] .hero .btn-ghost:is(:hover, :focus-visible) {
  color: var(--season-text);
}
html[data-season] .hero-figure .hero-art-frame img {
  filter: drop-shadow(0 24px 30px rgba(0,0,0,.24)) drop-shadow(0 6px 12px rgba(0,0,0,.18)) drop-shadow(0 0 14px rgb(var(--season-glow) / .1));
}
@media (max-width: 1024px) {
  html[data-season] .hero-figure .hero-art-frame img {
    filter: drop-shadow(0 16px 22px rgba(0,0,0,.24)) drop-shadow(0 0 12px rgb(var(--season-glow) / .1));
  }
}

/* Registration marks in the hero. */
html[data-season] .hero-mark::before,
html[data-season] .hero-mark::after {
  background: rgb(var(--season-glow));
}

/* The static lights behind the figure only show without WebGL. */
html[data-season] .hero-key-light {
  background: radial-gradient(closest-side,
    rgb(var(--season-glow) / 0.27) 0%, rgb(var(--season-glow) / 0.13) 36%,
    rgb(var(--season-glow) / 0.04) 64%, rgb(var(--season-glow) / 0) 100%);
}
html[data-season] .hero-char-glow {
  background: radial-gradient(closest-side,
    rgb(var(--season-glow) / 0.28) 0%, rgb(var(--season-glow) / 0.11) 48%, rgb(var(--season-glow) / 0) 100%);
}
html[data-season] .hero-char-floor {
  background: radial-gradient(closest-side,
    rgb(var(--season-glow) / 0.2) 0%, rgb(var(--season-glow) / 0.06) 50%, rgb(var(--season-glow) / 0) 100%);
}

/* --- band glows: same places as home.css, the season's two lights ------- */

html[data-season] .featured-section .band-glow {
  background:
    radial-gradient(ellipse 46vw 34% at 69% 10%,
      rgb(var(--season-glow) / 0.24) 0%, rgb(var(--season-glow) / 0.16) 22%, rgb(var(--season-glow) / 0.08) 48%,
      rgb(var(--season-glow) / 0.025) 72%, transparent 100%),
    radial-gradient(ellipse 30vw 40% at 0% 55%,
      rgb(var(--season-alt) / 0.14) 0%, rgb(var(--season-alt) / 0.06) 45%, transparent 100%);
}

html[data-season] .patreon-section .band-glow {
  background:
    radial-gradient(ellipse 42vw 38% at 100% 26%,
      rgb(var(--season-glow) / 0.2) 0%, rgb(var(--season-glow) / 0.12) 25%, rgb(var(--season-glow) / 0.05) 55%,
      transparent 100%),
    radial-gradient(ellipse 70vw 22% at 50% 92%,
      rgb(var(--season-alt) / 0.12) 0%, rgb(var(--season-alt) / 0.05) 45%, transparent 100%);
}

html[data-season] .join-section .band-glow {
  background:
    radial-gradient(ellipse 48vw 70% at 92% 62%,
      rgb(var(--season-glow) / 0.22) 0%, rgb(var(--season-glow) / 0.13) 25%, rgb(var(--season-glow) / 0.05) 55%,
      transparent 100%),
    radial-gradient(ellipse 34vw 50% at 4% 30%,
      rgb(var(--season-alt) / 0.1) 0%, rgb(var(--season-alt) / 0.04) 50%, transparent 100%);
}

/* --- seams: the second light at the ends, the main light in the middle --- */

html[data-season] .band-seam::before {
  background: linear-gradient(90deg,
    transparent 10%,
    rgb(var(--season-alt) / 0.35) 28%,
    rgb(var(--season-glow) / 0.9) 50%,
    rgb(var(--season-alt) / 0.35) 72%,
    transparent 90%);
}
html[data-season] .band-seam::after {
  background: radial-gradient(50% 100% at 50% 0%,
    rgb(var(--season-glow) / 0.11) 0%, rgb(var(--season-glow) / 0.06) 30%,
    rgb(var(--season-glow) / 0.02) 60%, transparent 100%);
}

/* --- card spotlight (css/spotlight.css): the season's hue, same drift ---- */

html[data-season] {
  --season-spot-h: calc(var(--season-hue, 15) + var(--spot-hue, 15) - 15);
}

html[data-season] .spotlight::before {
  background: radial-gradient(
    calc(var(--spot-r, 300px) * 0.87) circle at var(--spot-x, 50%) var(--spot-y, 50%),
    hsl(var(--season-spot-h) 95% 50% / 0.14),
    hsl(var(--season-spot-h) 95% 45% / 0.04) 40%,
    transparent 65%);
}

html[data-season] .spotlight::after {
  background:
    radial-gradient(
      calc(var(--spot-r, 300px) * 0.4) circle at var(--spot-x, 50%) var(--spot-y, 50%),
      hsl(var(--season-spot-h) 95% 64% / 0.85),
      transparent 70%),
    radial-gradient(
      var(--spot-r, 300px) circle at var(--spot-x, 50%) var(--spot-y, 50%),
      hsl(var(--season-spot-h) 95% 50%),
      hsl(var(--season-spot-h) 95% 44% / 0.45) 32%,
      transparent 85%);
}

html[data-season] [data-spotlight]:hover {
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.38),
    0 0 44px -14px hsl(var(--season-spot-h) 95% 46% / 0.5);
}

/* The legacy Latest card border has higher specificity than the shared
   seasonal spotlight. Tint the underlying accents too, so no orange rim or
   wash shows through a different season. Default-theme styling is unchanged. */
html[data-season] #latest .featured-card:not(.is-featured):hover,
html[data-season] #latest .featured-card:not(.is-featured):focus-visible {
  border-color: rgb(var(--season-glow) / .3);
}
html[data-season] .featured-card::before {
  background: linear-gradient(135deg, rgb(var(--season-glow) / .05), transparent);
}
html[data-season] #latest .featured-card .card-image {
  background: radial-gradient(120% 80% at 50% 0%, rgb(var(--season-glow) / .1), transparent 62%), #0f0f13;
}
html[data-season] #latest .featured-card .card-view-overlay {
  background: rgb(var(--season-glow));
}

/* --- preview badge (?season=...) ---------------------------------------- */

.season-preview-badge {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(14, 14, 18, 0.88);
  color: rgba(255, 255, 255, 0.86);
  font: 600 0.75rem/1.2 Montserrat, system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.season-preview-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(var(--season-glow, 255 106 43));
}
.season-preview-badge a {
  color: #fff;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.season-preview-badge a:hover { background: rgba(255, 255, 255, 0.16); }
