/* Seasonal touches, switched on by season.js through html[data-season].
   Each season dresses the logo (a hat, ears, a heart, a crosshair) and
   may add a sparse ambient layer. Nothing here changes layout, and all
   motion stops under prefers-reduced-motion. */

/* Palettes: each season swaps the accent family (buttons, links, chart
   bars) and, on the dark theme, tints the page background. Status colours
   (good / warn / bad) stay put so meaning never changes with the season. */
:root[data-season="christmas"]:not([data-theme="light"]) {
  --bg: #0c0f0d; --bg-2: #111813; --grid: #1d2a22;
  --accent: #f0555d; --accent-2: #c93b43; --accent-ink: #2a0507;
  --accent-wash: rgba(240, 85, 93, 0.10); --accent-line: rgba(240, 85, 93, 0.38);
  --series-1: #c93b43; --series-2: #27a8a1;
}
:root[data-season="christmas"][data-theme="light"] {
  --accent: #b8323b; --accent-2: #9e2630; --accent-ink: #ffffff;
  --accent-wash: rgba(184, 50, 59, 0.08); --accent-line: rgba(184, 50, 59, 0.35);
  --series-1: #b8323b; --series-2: #1f9e97;
}
:root[data-season="halloween"]:not([data-theme="light"]) {
  --bg: #0d0a11; --bg-2: #141019; --grid: #251d2e;
  --accent: #ff8a1f; --accent-2: #d96c0a; --accent-ink: #2a1300;
  --accent-wash: rgba(255, 138, 31, 0.10); --accent-line: rgba(255, 138, 31, 0.38);
  --series-1: #d96c0a; --series-2: #27a8a1;
}
:root[data-season="halloween"][data-theme="light"] {
  --accent: #b95400; --accent-2: #9a4500; --accent-ink: #ffffff;
  --accent-wash: rgba(185, 84, 0, 0.08); --accent-line: rgba(185, 84, 0, 0.35);
  --series-1: #c45a00; --series-2: #1f9e97;
}
:root[data-season="easter"]:not([data-theme="light"]) {
  --bg: #0c0c13; --bg-2: #13121c; --grid: #22202f;
  --accent: #b9a2f0; --accent-2: #9479dc; --accent-ink: #1a1030;
  --accent-wash: rgba(185, 162, 240, 0.10); --accent-line: rgba(185, 162, 240, 0.38);
  --series-1: #9479dc; --series-3: #27a8a1;
}
:root[data-season="easter"][data-theme="light"] {
  --accent: #6c4fc2; --accent-2: #5a3fae; --accent-ink: #ffffff;
  --accent-wash: rgba(108, 79, 194, 0.08); --accent-line: rgba(108, 79, 194, 0.35);
  --series-1: #7a5fd0; --series-3: #1f9e97;
}
:root[data-season="valentines"]:not([data-theme="light"]) {
  --bg: #110a0e; --bg-2: #181015; --grid: #2c1d26;
  --accent: #ff6f9a; --accent-2: #e04b7a; --accent-ink: #2e0614;
  --accent-wash: rgba(255, 111, 154, 0.10); --accent-line: rgba(255, 111, 154, 0.38);
  --series-1: #e04b7a; --series-2: #27a8a1;
}
:root[data-season="valentines"][data-theme="light"] {
  --accent: #c8336a; --accent-2: #ad2457; --accent-ink: #ffffff;
  --accent-wash: rgba(200, 51, 106, 0.08); --accent-line: rgba(200, 51, 106, 0.35);
  --series-1: #d0427a; --series-2: #1f9e97;
}
:root[data-season="elimination"]:not([data-theme="light"]) {
  --bg: #0f0b0a; --bg-2: #171110; --grid: #2b1f1c;
  --accent: #ff6a3d; --accent-2: #db4e24; --accent-ink: #2b0c02;
  --accent-wash: rgba(255, 106, 61, 0.10); --accent-line: rgba(255, 106, 61, 0.38);
  --series-1: #db4e24; --series-2: #27a8a1;
}
:root[data-season="elimination"][data-theme="light"] {
  --accent: #c2401a; --accent-2: #a63312; --accent-ink: #ffffff;
  --accent-wash: rgba(194, 64, 26, 0.08); --accent-line: rgba(194, 64, 26, 0.35);
  --series-1: #c94a22; --series-2: #1f9e97;
}

.sidebar .brand { --brand-pad-l: 8px; --brand-pad-t: 4px; }

[data-season] .brand { position: relative; }
[data-season] .brand img { position: relative; z-index: 1; }
[data-season] .brand::before {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  left: var(--brand-pad-l, 0px); top: var(--brand-pad-t, 0px);
  background: no-repeat center / contain;
}

/* Christmas: a Santa hat tipped over the top-left corner. */
[data-season="christmas"] .brand::before {
  width: 30px; height: 26px; margin: -15px 0 0 -9px; transform: rotate(-18deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 28'%3E%3Cpath d='M4 22C6 12 12 4 20 4c5 0 8 4 9 9l-3 1c-1-3-3-5-5-4-3 2-3 7-1 12z' fill='%23d62839'/%3E%3Cpath d='M20 4c5 0 8 4 9 9l-3 1c-1-3-3-5-5-4-1-2-1-4-1-6z' fill='%23a81c2b'/%3E%3Crect x='2' y='19.5' width='22' height='6.5' rx='3.2' fill='%23f5f5f5'/%3E%3Ccircle cx='27.5' cy='15' r='3.6' fill='%23f5f5f5'/%3E%3C/svg%3E");
}

/* Trick or Treat: a crooked witch hat. */
[data-season="halloween"] .brand::before {
  width: 32px; height: 28px; margin: -19px 0 0 -6px; transform: rotate(-12deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 28'%3E%3Cellipse cx='16' cy='23' rx='15' ry='3.6' fill='%23271a36'/%3E%3Cpath d='M8 23 14 6c1-3 4-5 8-4-3 2-4 5-3 8l5 13z' fill='%23402a5c'/%3E%3Cpath d='M9.1 19.6h13.8l1 2.9H8.1z' fill='%23ff8a1f'/%3E%3C/svg%3E");
}

/* Easter Egg Hunt: bunny ears poking up from behind the logo. */
[data-season="easter"] .brand::before {
  z-index: 0; width: 30px; height: 26px; margin: -20px 0 0 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 28'%3E%3Cg transform='rotate(-14 11 26)'%3E%3Cellipse cx='11' cy='14' rx='4.6' ry='12' fill='%23f3f0f5'/%3E%3Cellipse cx='11' cy='15' rx='2.2' ry='9' fill='%23f6a9c4'/%3E%3C/g%3E%3Cg transform='rotate(14 21 26)'%3E%3Cellipse cx='21' cy='14' rx='4.6' ry='12' fill='%23f3f0f5'/%3E%3Cellipse cx='21' cy='15' rx='2.2' ry='9' fill='%23f6a9c4'/%3E%3C/g%3E%3C/svg%3E");
  transform-origin: 50% 100%; animation: season-wiggle 4s ease-in-out infinite;
}

/* Valentine's Day: a beating heart badge on the bottom-right corner. */
[data-season="valentines"] .brand::before {
  width: 16px; height: 15px; margin: 22px 0 0 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21C5 15 1 11 1 6.5 1 3.4 3.4 1 6.5 1c2.1 0 4.3 1.3 5.5 3.3C13.2 2.3 15.4 1 17.5 1 20.6 1 23 3.4 23 6.5 23 11 19 15 12 21z' fill='%23ff4d6d' stroke='%23ffffff' stroke-width='1.6'/%3E%3C/svg%3E");
  animation: season-beat 1.6s ease-in-out infinite;
}

/* Elimination: a slowly turning crosshair over the logo. */
[data-season="elimination"] .brand::before {
  width: 42px; height: 42px; margin: -4px 0 0 -4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 42'%3E%3Cg fill='none' stroke='%23ff3b3b' stroke-width='2'%3E%3Ccircle cx='21' cy='21' r='16'/%3E%3Cpath d='M21 1v9M21 32v9M1 21h9M32 21h9'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.85; animation: season-spin 14s linear infinite;
}
.brand img { transition: filter 0.2s; }
[data-season="elimination"] .brand:hover img { filter: grayscale(1) contrast(1.1); }

/* Ambient layer: fixed, behind nothing interactive, never catches clicks. */
.season-layer { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.season-bit {
  position: absolute; left: var(--x); top: 0; width: var(--size); height: var(--size);
  opacity: var(--alpha); animation: var(--dur) linear var(--delay) infinite;
}
.season-bit svg { display: block; width: 100%; height: 100%; }
.season-fall { color: #e9f4ff; animation-name: season-fall; }
.season-rise { color: #ff6f8e; animation-name: season-rise; }
.season-fly { color: #ff8a1f; left: 0; top: var(--y); height: calc(var(--size) / 2); animation-name: season-fly; animation-timing-function: ease-in-out; }
.season-fly svg { animation: season-flap 0.35s ease-in-out infinite alternate; }
:root[data-theme="light"] .season-fall { color: #9cc4e4; }
:root[data-theme="light"] .season-fly { color: #3a2650; }

@keyframes season-fall {
  from { transform: translate(0, -5vh); }
  to { transform: translate(var(--drift), 105vh); }
}
@keyframes season-rise {
  0% { transform: translate(0, 105vh) scale(0.8); opacity: 0; }
  10% { opacity: var(--alpha); }
  90% { opacity: var(--alpha); }
  100% { transform: translate(var(--drift), 40vh) scale(1.1); opacity: 0; }
}
@keyframes season-fly {
  0% { transform: translate(-10vw, 0); }
  50% { transform: translate(50vw, var(--drift)); }
  100% { transform: translate(110vw, 0); }
}
@keyframes season-flap { to { transform: scaleY(0.45); } }
@keyframes season-beat { 0%, 60%, 100% { transform: scale(1); } 20% { transform: scale(1.22); } 40% { transform: scale(0.95); } }
@keyframes season-spin { to { transform: rotate(360deg); } }
@keyframes season-wiggle { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-6deg); } 93% { transform: rotate(5deg); } }

/* Easter: the hidden egg. */
.season-egg {
  position: fixed; z-index: 15; width: 26px; height: 32px; padding: 0; border: 0;
  background: none; cursor: pointer; opacity: 0.85; transition: transform 0.2s, opacity 0.2s;
}
.season-egg svg { display: block; width: 100%; height: 100%; }
.season-egg:hover, .season-egg:focus-visible { transform: scale(1.15) rotate(-8deg); opacity: 1; }
.season-egg.found svg { animation: season-crack 0.6s ease-out forwards; }
.season-egg-note {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); white-space: nowrap;
  padding: 6px 10px; border-radius: var(--radius-sm, 6px); font-size: 13px;
  background: var(--surface, #10181f); color: var(--text, #fff); border: 1px solid var(--border-strong, #333);
}
@keyframes season-crack {
  30% { transform: rotate(-14deg) scale(1.2); }
  60% { transform: rotate(10deg) scale(1.25); }
  100% { transform: scale(0); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  [data-season] .brand::before, .season-egg.found svg { animation: none; }
  .season-layer { display: none; }
}
@media print { .season-layer, .season-egg { display: none; } }
