/* Halloween season, layered over the classic theme in styles.css.
   Active only while <html data-season="halloween"> (set by mode.js until its end
   date). Remove that attribute, or let the date pass, and the classic maroon theme
   is back untouched. Night: midnight plum, pumpkin and candle gold.
   Day: parchment with burnt orange ink. The background (bg.js) turns into an
   aurora over a moonlit tree line. */

:root[data-season="halloween"] {
  --ground: #1a0b22;
  --ground-deep: #0f0614;
  --app: #0c0a10;
  --app-2: #13101a;
  --app-3: #1b1624;
  --app-4: #251e2f;
  --rail: #07050a;
  --line: #2a2334;
  --text: #f4ede2;
  --muted: #b2a6b4;
  --faint: #877c8c;
  --accent: #d9591a;
  --accent-hover: #ee6a24;
  --dock-tile: #2a1030;
  --brand-ink: #ff8a3d;
  --accent-soft: rgba(255, 138, 61, 0.14);
  --on-accent: #fff7ef;
  --gold: #f2c14e;
  --gold-soft: rgba(242, 193, 78, 0.12);
  --online: #6fd89a;
  --soon: #625a6a;
  --code: #09070c;
  --focus: #f2c14e;
  --glass: linear-gradient(160deg, rgba(42, 22, 56, 0.6), rgba(12, 9, 16, 0.8) 55%, rgba(9, 7, 12, 0.86));
  --glass-border: rgba(255, 240, 220, 0.075);
  --head-top: #fff5e8;
  --head-bot: #d8c2ad;
  --hw-btn: linear-gradient(180deg, #f5873a 0%, #d9591a 52%, #a8400c 100%);
  --hw-glow: rgba(255, 128, 40, 0.5);
  --hw-glow-strong: rgba(230, 100, 20, 0.8);
}
:root[data-season="halloween"][data-mode="day"] {
  --ground: #eadfcc;
  --ground-deep: #dccfb7;
  --app: #fbf6ec;
  --app-2: #f5ede0;
  --app-3: #ede3d1;
  --app-4: #e2d5bf;
  --rail: #e7dcc8;
  --line: #d9cab0;
  --text: #1c140f;
  --muted: #5c4b3f;
  --faint: #77665a;
  --accent: #b4470f;
  --accent-hover: #c9561a;
  --brand-ink: #b8490d;
  --dock-tile: #2a1030;
  --accent-soft: rgba(180, 71, 15, 0.1);
  --gold: #7a5310;
  --gold-soft: rgba(150, 100, 20, 0.1);
  --online: #2c7a46;
  --soon: #a89a88;
  --code: #f1e8d8;
  --shadow: 0 18px 44px rgba(60, 35, 10, 0.14);
  --focus: #b4470f;
  --glass: linear-gradient(160deg, rgba(255, 253, 247, 0.86), rgba(250, 244, 233, 0.72) 55%, rgba(246, 238, 224, 0.74));
  --glass-border: rgba(80, 45, 15, 0.1);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 24px 46px -24px rgba(60, 35, 10, 0.28), 0 2px 8px rgba(60, 35, 10, 0.06);
  --glass-inner: rgba(80, 45, 15, 0.035);
  --glass-inner-border: rgba(80, 45, 15, 0.07);
  --btn2-border: rgba(80, 45, 15, 0.14);
  --field-border: rgba(80, 45, 15, 0.12);
  --dark-band: linear-gradient(180deg, rgba(80, 45, 15, 0.03), rgba(80, 45, 15, 0.07));
  --head-top: #2a1a10;
  --head-bot: #6e4c33;
  --hw-btn: linear-gradient(180deg, #d9661f 0%, #b4470f 52%, #8c340a 100%);
  --hw-glow: rgba(180, 71, 15, 0.3);
  --hw-glow-strong: rgba(150, 60, 10, 0.55);
}

/* Page ground behind the aurora */
:root[data-season="halloween"].has-silk body { background: #07060c; }
:root[data-season="halloween"][data-mode="day"].has-silk body { background: #efe6d6; }

/* Glossy controls in pumpkin */
:root[data-season="halloween"] .btn--primary,
:root[data-season="halloween"] .nav a.nav__cta,
:root[data-season="halloween"] .drawer__nav a[aria-current="true"] .drawer__ico,
:root[data-season="halloween"] .board-switch[aria-checked="true"] .board-switch__track {
  background: var(--hw-btn);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 -2px 0 rgba(0, 0, 0, 0.22), 0 10px 24px -8px var(--hw-glow-strong);
}
:root[data-season="halloween"] .duty {
  background: linear-gradient(160deg, #e0702a, #b84a12 42%, #5c2208);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -20px 40px rgba(0, 0, 0, 0.18), 0 34px 70px -28px var(--hw-glow-strong);
}
:root[data-season="halloween"] .platform--live .platform__icon {
  background: radial-gradient(circle at 35% 28%, #ffa05a, #d9591a 55%, #6b2606);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -8px var(--hw-glow-strong);
}
:root[data-season="halloween"] .client { box-shadow: var(--glass-shadow), 0 40px 90px -30px rgba(0, 0, 0, 0.75), 0 0 70px -24px var(--hw-glow); }
:root[data-season="halloween"] .plan--main { box-shadow: 0 0 0 1.5px var(--accent), 0 0 38px -8px var(--hw-glow), var(--glass-shadow); }
:root[data-season="halloween"] .pill--safety,
:root[data-season="halloween"] .form-status.is-error,
:root[data-season="halloween"] .field-error { color: #ff9a6a; }
:root[data-season="halloween"][data-mode="day"] .pill--safety,
:root[data-season="halloween"][data-mode="day"] .form-status.is-error,
:root[data-season="halloween"][data-mode="day"] .field-error { color: #a33a0c; }

/* Logo pill: an ember glow instead of the rose one */
:root[data-season="halloween"] .logo {
  background:
    radial-gradient(90px 60px at 22px 50%, rgba(255, 128, 40, 0.3), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02) 55%, rgba(0, 0, 0, 0.12));
}
:root[data-season="halloween"] .logo:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(255, 138, 61, 0.25), 0 14px 30px -14px var(--hw-glow-strong); }
:root[data-season="halloween"] .logo__word span { background-image: linear-gradient(180deg, #ffe3a0 10%, #f2c14e 55%, #c07a1c); }
:root[data-season="halloween"][data-mode="day"] .logo {
  background:
    radial-gradient(90px 60px at 22px 50%, rgba(200, 90, 20, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6));
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px -16px rgba(60, 35, 10, 0.45);
}
:root[data-season="halloween"][data-mode="day"] .logo__word span { background-image: linear-gradient(180deg, #a3661c, #85500f 60%, #663b08); }

/* Menus, dialogs and the drawer */
:root[data-season="halloween"] .cs__list {
  background: linear-gradient(165deg, rgba(44, 22, 58, 0.92), rgba(12, 9, 16, 0.95) 60%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 60px -18px rgba(0, 0, 0, 0.85), 0 0 40px -18px var(--hw-glow);
}
:root[data-season="halloween"] .notice::backdrop { background: radial-gradient(circle at 50% 40%, rgba(40, 14, 52, 0.55), rgba(4, 3, 7, 0.84)); }
:root[data-season="halloween"] .notice__card {
  background: linear-gradient(165deg, rgba(48, 22, 62, 0.94), rgba(12, 9, 16, 0.96) 62%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 40px 90px -30px rgba(0, 0, 0, 0.9), 0 0 60px -20px var(--hw-glow);
}
:root[data-season="halloween"] .drawer__panel {
  background:
    radial-gradient(120% 50% at 100% 0%, rgba(255, 128, 40, 0.14), transparent 60%),
    radial-gradient(90% 40% at 0% 100%, rgba(111, 216, 154, 0.07), transparent 70%),
    color-mix(in srgb, var(--app) 94%, transparent);
}
:root[data-season="halloween"][data-mode="day"] .cs__list,
:root[data-season="halloween"][data-mode="day"] .notice__card { background: linear-gradient(165deg, #fffdf8, #f6eee0); box-shadow: inset 0 1px 0 #fff, 0 30px 60px -24px rgba(60, 35, 10, 0.4); }
:root[data-season="halloween"][data-mode="day"] .notice::backdrop { background: rgba(50, 30, 15, 0.35); }
:root[data-season="halloween"][data-mode="day"] .cs__list li[aria-selected="true"] { background: linear-gradient(180deg, #d0611f, #b4470f); }
:root[data-season="halloween"][data-mode="day"] .client__rail,
:root[data-season="halloween"][data-mode="day"] .client__side,
:root[data-season="halloween"][data-mode="day"] .client__me { background: rgba(80, 45, 15, 0.04); }

/* Ambient orbs: ember, plum and aurora green */
:root[data-season="halloween"] .ambient__orb--maroon i { background: radial-gradient(circle, rgba(217, 89, 26, 0.3), rgba(217, 89, 26, 0) 62%); }
:root[data-season="halloween"] .ambient__orb--rose i { background: radial-gradient(circle, rgba(111, 216, 154, 0.12), rgba(111, 216, 154, 0) 60%); }
:root[data-season="halloween"] .ambient__orb--wine i { background: radial-gradient(circle, rgba(70, 24, 90, 0.45), rgba(70, 24, 90, 0) 62%); }

/* Bats (season.js): a few drift across now and then */
.bats { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bat { position: absolute; left: 0; top: 0; width: 34px; height: 18px; color: #0a0710; opacity: 0; offset-rotate: 0deg; }
:root[data-mode="day"] .bat { color: #3a2a22; }
.bat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.bat .w { transform-box: fill-box; transform-origin: 50% 20%; animation: bat-flap .32s ease-in-out infinite alternate; }
@keyframes bat-flap { to { transform: scaleY(-0.55); } }
.bat.is-flying { animation: bat-fly var(--dur, 16s) linear forwards; }
@keyframes bat-fly {
  0% { opacity: 0; transform: translate(var(--x0), var(--y0)) scale(var(--s)); }
  8%, 88% { opacity: var(--o, .85); }
  50% { transform: translate(var(--xm), var(--ym)) scale(calc(var(--s) * 1.1)); }
  100% { opacity: 0; transform: translate(var(--x1), var(--y1)) scale(var(--s)); }
}
@media (prefers-reduced-motion: reduce) { .bats { display: none; } }

/* ---------- Logo: a jack-o-lantern orb (season.js adds the ribs and stem) ---------- */
:root[data-season="halloween"] #bmOrb stop:nth-child(1) { stop-color: #ffb257; }
:root[data-season="halloween"] #bmOrb stop:nth-child(2) { stop-color: #f06c12; }
:root[data-season="halloween"] #bmOrb stop:nth-child(3) { stop-color: #9a3a06; }
:root[data-season="halloween"] #bmOrb stop:nth-child(4) { stop-color: #3a1402; }
:root[data-season="halloween"] #bmRim stop:nth-child(1) { stop-color: #ffe0b0; }
:root[data-season="halloween"] #bmRim stop:nth-child(2) { stop-color: #ff9a3a; }
:root[data-season="halloween"] #bmRim stop:nth-child(3) { stop-color: #7a2a04; }
:root[data-season="halloween"] #bmMetal stop:nth-child(1) { stop-color: #fff7cf; }
:root[data-season="halloween"] #bmMetal stop:nth-child(2) { stop-color: #ffd779; }
:root[data-season="halloween"] #bmMetal stop:nth-child(3) { stop-color: #f0a03a; }
:root[data-season="halloween"] .logo__mark [fill="#4a0a18"],
:root[data-season="halloween"] #botmark [fill="#4a0a18"] { fill: #4a1604; }
:root[data-season="halloween"] .logo__mark [stroke="#4a0a18"],
:root[data-season="halloween"] #botmark [stroke="#4a0a18"] { stroke: #4a1604; }
:root[data-season="halloween"] .logo__mark [fill="#ff5f7c"],
:root[data-season="halloween"] #botmark [fill="#ff5f7c"] { fill: #ffb040; }
.hw-ribs { stroke: #7a2a04; stroke-opacity: .5; }
.hw-stem path { stroke: #4d6b22; }
.hw-stem .hw-leaf { fill: #6b8f2a; stroke: none; }
:root[data-season="halloween"] .logo__mark { animation-name: hw-candle; }
@keyframes hw-candle {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 14px -4px rgba(0, 0, 0, 0.7), 0 0 20px -2px rgba(255, 140, 40, 0.6); }
  37% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 14px -4px rgba(0, 0, 0, 0.7), 0 0 30px 1px rgba(255, 160, 50, 0.85); }
  61% { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 6px 14px -4px rgba(0, 0, 0, 0.7), 0 0 24px -1px rgba(255, 130, 30, 0.7); }
}
:root[data-season="halloween"] .logo__mark svg { overflow: visible; }

/* ---------- Bot wardrobe (scrollbot.js) ---------- */
.sbx-closet-btn {
  position: fixed; left: 0; top: 0; width: 30px; height: 30px; margin: 0; padding: 0; z-index: 3;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer; pointer-events: none;
  color: #fff7ef; background: var(--hw-btn); border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 16px -6px var(--hw-glow-strong);
  opacity: 0; scale: .6; transition: opacity .35s ease, scale .35s cubic-bezier(.3, 1.6, .5, 1);
}
.sbx-closet-btn.is-on { opacity: 1; scale: 1; pointer-events: auto; }
.sbx-closet-btn:hover { scale: 1.1; }
.sbx-closet-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sbx-closet-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sbx-closet {
  position: fixed; z-index: 4; width: 214px; padding: 8px; pointer-events: auto;
  display: grid; gap: 2px; border-radius: 16px;
  background: linear-gradient(165deg, rgba(44, 22, 58, 0.95), rgba(12, 9, 16, 0.97) 60%);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 240, 220, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 30px 60px -18px rgba(0, 0, 0, 0.85), 0 0 40px -18px var(--hw-glow);
  animation: cs-in .22s cubic-bezier(.2, .9, .3, 1.15); transform-origin: 100% 100%;
}
.sbx-closet[hidden] { display: none; }
.sbx-closet__title { margin: 2px 8px 6px; font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.sbx-closet button {
  appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border-radius: 10px;
  font: inherit; font-size: 0.88rem; text-align: left; color: var(--muted); background: transparent; border: 0; cursor: pointer;
}
.sbx-closet button:hover, .sbx-closet button:focus-visible { color: var(--text); background: rgba(255, 255, 255, 0.07); outline: none; }
.sbx-closet button[aria-checked="true"] { color: var(--text); background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--brand-ink); }
.sbx-closet button.sbx-closet__any { margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.07); border-radius: 0 0 10px 10px; color: var(--gold); }
.sbx-closet__dot { width: 14px; height: 14px; flex: none; border-radius: 50%; box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4); }
.sbx-closet__dot--pumpkin { background: #f07014; }
.sbx-closet__dot--ghost { background: #f1ede6; }
.sbx-closet__dot--zombie { background: #86a86c; }
.sbx-closet__dot--witch { background: linear-gradient(135deg, #1c1424 55%, #ff8a3d 55%); }
.sbx-closet__dot--vampire { background: linear-gradient(135deg, #0e0a12 50%, #b3122e 50%); }
.sbx-closet__dot--devil { background: #e0202e; }
.sbx-closet__dot--mummy { background: repeating-linear-gradient(160deg, #eadfc4 0 3px, #b9ab8a 3px 4px); }
.sbx-closet__dot--cat { background: #1c1820; box-shadow: inset 0 0 0 2px #7cf0a0; }
.sbx-closet__dot--skeleton { background: radial-gradient(circle at 50% 45%, #eee 0 45%, #1b1920 46%); }
:root[data-season="halloween"][data-mode="day"] .sbx-closet { background: linear-gradient(165deg, #fffdf8, #f6eee0); border-color: rgba(80, 45, 15, 0.12); box-shadow: 0 30px 60px -24px rgba(60, 35, 10, 0.4); }
:root[data-season="halloween"][data-mode="day"] .sbx-closet button:hover { background: rgba(80, 45, 15, 0.06); }
:root[data-season="halloween"][data-mode="day"] .sbx-closet button.sbx-closet__any { border-top-color: rgba(80, 45, 15, 0.1); }

/* ---------- Decorations (season.js) ---------- */
.hw-host { position: relative; }
:root[data-season="halloween"] .hero { position: relative; }
.hw-garland { position: absolute; left: 0; right: 0; top: -2px; z-index: 1; pointer-events: none; transform-origin: 50% 0; }
.hw-garland svg { display: block; width: 100%; height: auto; overflow: visible; }
.hw-wire { fill: none; stroke: rgba(255, 232, 205, 0.28); stroke-width: 1.4; }
:root[data-mode="day"] .hw-wire { stroke: rgba(70, 50, 35, 0.6); }
.hw-bulb rect { fill: #2a2226; }
.hw-bulb path { fill: var(--c); filter: drop-shadow(0 0 5px var(--c)) drop-shadow(0 0 12px var(--c)); animation: hw-twinkle 3.2s ease-in-out infinite; animation-delay: calc(var(--d) * -1); }
@keyframes hw-twinkle { 0%, 100% { opacity: 1; } 45% { opacity: .55; } 52% { opacity: 1; } 70% { opacity: .8; } }
@media (prefers-reduced-motion: no-preference) { .hw-garland { animation: hw-sway 7s ease-in-out infinite alternate; } }
@keyframes hw-sway { from { transform: rotate(-.35deg); } to { transform: rotate(.35deg); } }

.hw-pk {
  position: absolute; bottom: calc(100% - 10px); width: 56px; height: 50px; padding: 0; margin: 0; z-index: 2;
  border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.hw-pk--right { right: 18px; }
.hw-pk--left { left: 18px; }
.hw-pk:hover { transform: translateY(-3px) rotate(-4deg) scale(1.06); }
.hw-pk:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 12px; }
.hw-pk.is-bump { animation: hw-bump .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hw-bump { 30% { transform: translateY(-8px) scale(1.12, .9); } 60% { transform: translateY(0) scale(.95, 1.06); } }
.hw-pk svg { width: 100%; height: 100%; display: block; overflow: visible; }
.hw-pk__stem { fill: none; stroke: #4d6b22; stroke-width: 4.5; stroke-linecap: round; }
.hw-pk__side { fill: #d95a0c; }
.hw-pk__mid { fill: #f07a1c; }
.hw-pk__face { fill: #ffcf5a; filter: drop-shadow(0 0 4px #ffb03a); animation: hw-flick 1.7s steps(1) infinite; animation-delay: calc(var(--flick) * -1); }
@keyframes hw-flick { 0% { opacity: 1; } 18% { opacity: .82; } 22% { opacity: 1; } 55% { opacity: .9; } 63% { opacity: .72; } 68% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .hw-pk__face, .hw-bulb path { animation: none; } }

.hw-candy { position: fixed; left: 0; top: 0; width: 12px; height: 8px; margin: -4px 0 0 -6px; z-index: 60; pointer-events: none; border-radius: 4px; background: var(--c); box-shadow: -4px 0 0 -2px var(--c), 4px 0 0 -2px var(--c), inset 0 1px 1px rgba(255, 255, 255, .5); }
.hw-candy--corn { width: 10px; height: 12px; border-radius: 1px 1px 5px 5px; clip-path: polygon(50% 0, 100% 100%, 0 100%); background: linear-gradient(180deg, #fff6e0 0 34%, #f2c14e 34% 66%, #ff8a3d 66%); box-shadow: none; }

.hw-spider { position: absolute; top: 0; z-index: 1; width: 30px; margin-left: -15px; pointer-events: none; }
.hw-spider__thread { position: absolute; left: 50%; top: 0; width: 1px; height: var(--len); background: linear-gradient(180deg, transparent, rgba(255, 245, 230, 0.4) 20%); transition: height 1.1s cubic-bezier(.3, .7, .3, 1); }
:root[data-mode="day"] .hw-spider__thread { background: linear-gradient(180deg, transparent, rgba(40, 25, 15, 0.35) 20%); }
.hw-spider__bug { position: absolute; left: 0; top: var(--len); width: 30px; height: 26px; margin-top: -4px; pointer-events: auto; cursor: pointer; transition: top 1.1s cubic-bezier(.3, .7, .3, 1); }
.hw-spider__bug svg { display: block; width: 100%; height: 100%; }
.hw-spider.is-up .hw-spider__thread { height: 18px; transition-duration: .5s; }
.hw-spider.is-up .hw-spider__bug { top: 18px; transition-duration: .5s; }
@media (prefers-reduced-motion: no-preference) { .hw-spider { animation: hw-bob var(--bob) ease-in-out infinite alternate; } }
@keyframes hw-bob { from { transform: translateY(-6px) rotate(-2deg); } to { transform: translateY(8px) rotate(2deg); } }
.hw-sp__legs { stroke: #120c10; }
.hw-sp__body { fill: #160e14; }
.hw-sp__eye { fill: #ff8a3d; }
:root[data-mode="day"] .hw-sp__legs { stroke: #2a1a14; }
:root[data-mode="day"] .hw-sp__body { fill: #2a1a14; }
@media (max-width: 1100px) { .hw-spider { display: none; } }

.hw-web { position: absolute; width: 96px; height: 96px; pointer-events: none; z-index: 1; opacity: .55; }
.hw-web svg { width: 100%; height: 100%; display: block; }
.hw-web g { stroke: rgba(255, 245, 230, 0.5); stroke-width: .8; }
:root[data-mode="day"] .hw-web g { stroke: rgba(60, 40, 25, 0.35); }
.hw-web--tl { left: 0; top: 0; }
.hw-web--tr { right: 0; top: 0; transform: scaleX(-1); }
