/* Seasonal atmosphere for the store, profile, and admin.
   The active season is html[data-season], set for everyone from the admin panel. */

html:not([data-season]) body.season-stage,
html[data-season="autumn"] body.season-stage {
  background-color: #2c261e;
  background-image:
    radial-gradient(920px 480px at 50% -120px, rgba(242, 156, 48, 0.42), transparent 62%),
    radial-gradient(640px 460px at -8% 92%, rgba(186, 62, 28, 0.28), transparent 60%),
    radial-gradient(560px 380px at 108% 12%, rgba(224, 176, 72, 0.2), transparent 58%),
    radial-gradient(420px 260px at 72% 70%, rgba(140, 64, 28, 0.16), transparent 70%);
}

html[data-season="winter"] {
  --gem-hi: #f7fbff;
  --gem-mid: #9ec4ff;
  --gem-lo: #3a679e;
}

html[data-season="winter"] body.season-stage {
  background-color: #243044;
  background-image:
    radial-gradient(980px 520px at 48% -140px, rgba(186, 216, 255, 0.55), transparent 62%),
    radial-gradient(620px 440px at -6% 78%, rgba(110, 160, 220, 0.32), transparent 60%),
    radial-gradient(520px 360px at 108% 16%, rgba(230, 242, 255, 0.22), transparent 58%),
    radial-gradient(760px 220px at 50% 108%, rgba(150, 190, 230, 0.24), transparent 70%);
}

.season-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.season-field::before {
  content: '';
  position: absolute;
  left: -12%;
  right: -12%;
  bottom: -10%;
  height: 42vh;
  background: radial-gradient(ellipse at 50% 100%, var(--season-mist, rgba(190, 100, 36, 0.18)), transparent 68%);
}

html[data-season="winter"] .season-field::before {
  --season-mist: rgba(176, 208, 242, 0.16);
}

.season-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(28px);
  animation: season-drift 26s ease-in-out infinite alternate;
}

html:not([data-season]) .season-orb-a,
html[data-season="autumn"] .season-orb-a {
  width: min(52vw, 680px);
  height: min(52vw, 680px);
  left: 16%;
  top: -22%;
  background: radial-gradient(circle, rgba(244, 164, 52, 0.55), rgba(244, 164, 52, 0) 68%);
}

html:not([data-season]) .season-orb-b,
html[data-season="autumn"] .season-orb-b {
  width: min(38vw, 480px);
  height: min(38vw, 480px);
  right: -8%;
  top: 18%;
  background: radial-gradient(circle, rgba(214, 92, 36, 0.38), transparent 70%);
  animation-duration: 32s;
  animation-delay: -8s;
}

html:not([data-season]) .season-orb-c,
html[data-season="autumn"] .season-orb-c {
  width: min(34vw, 420px);
  height: min(34vw, 420px);
  left: -6%;
  bottom: 6%;
  background: radial-gradient(circle, rgba(196, 72, 40, 0.32), transparent 70%);
  animation-duration: 36s;
  animation-delay: -14s;
}

html[data-season="winter"] .season-orb-a {
  width: min(54vw, 720px);
  height: min(46vw, 560px);
  left: 18%;
  top: -24%;
  background: radial-gradient(circle, rgba(186, 220, 255, 0.5), transparent 68%);
}

html[data-season="winter"] .season-orb-b {
  width: min(36vw, 460px);
  height: min(36vw, 460px);
  right: -4%;
  top: 22%;
  background: radial-gradient(circle, rgba(140, 180, 230, 0.32), transparent 70%);
  animation-duration: 30s;
}

html[data-season="winter"] .season-orb-c {
  width: min(42vw, 520px);
  height: min(28vw, 320px);
  left: 8%;
  bottom: -4%;
  background: radial-gradient(circle, rgba(210, 232, 255, 0.22), transparent 70%);
  animation-duration: 34s;
}

.season-grain {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    radial-gradient(rgba(255, 220, 160, 0.28) 0.7px, transparent 0.85px),
    radial-gradient(circle at 18% 22%, rgba(255, 196, 110, 0.16) 0 80px, transparent 140px),
    radial-gradient(circle at 78% 36%, rgba(255, 150, 70, 0.12) 0 90px, transparent 160px);
  background-size: 4px 4px, auto, auto;
  mask-image: radial-gradient(ellipse at 50% 18%, #000 8%, transparent 76%);
}

html[data-season="winter"] .season-grain {
  background-image:
    radial-gradient(rgba(226, 240, 255, 0.38) 0.65px, transparent 0.8px),
    radial-gradient(circle at 22% 18%, rgba(210, 230, 255, 0.16) 0 90px, transparent 150px),
    radial-gradient(circle at 80% 40%, rgba(170, 205, 245, 0.12) 0 100px, transparent 170px);
}

.season-flakes {
  position: absolute;
  inset: 0;
  mask-image: linear-gradient(to bottom, #000 0%, #000 46%, transparent 82%);
}

html[data-season="winter"] .season-flakes {
  mask-image: linear-gradient(to bottom, #000 0%, #000 68%, transparent 96%);
}

.season-flake {
  position: absolute;
  top: -12vh;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  opacity: var(--o);
  animation: season-fall var(--d) linear var(--delay) infinite;
}

.season-flake svg {
  display: block;
  width: 100%;
  height: 100%;
}

.season-flake.is-snow {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, rgba(214, 232, 255, 0.15) 68%, transparent 72%);
  box-shadow: 0 0 8px rgba(210, 230, 255, 0.55);
}

.season-flake.is-leaf {
  filter: drop-shadow(0 2px 3px rgba(80, 30, 8, 0.28));
}

@keyframes season-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 5%, 0) scale(1.06); }
}

@keyframes season-fall {
  0% { transform: translate3d(0, -12vh, 0) rotate(0deg); }
  35% { transform: translate3d(var(--sway), 38vh, 0) rotate(140deg); }
  70% { transform: translate3d(calc(var(--sway) * -0.7), 74vh, 0) rotate(260deg); }
  100% { transform: translate3d(calc(var(--sway) * 0.35), 112vh, 0) rotate(360deg); }
}

body.season-stage > .main-content,
body.season-stage > .site-footer {
  position: relative;
  z-index: 1;
}

html:not([data-season]) body.season-stage .navbar,
html[data-season="autumn"] body.season-stage .navbar {
  background: rgba(42, 32, 22, 0.62);
  border-bottom-color: rgba(236, 170, 72, 0.2);
}

html:not([data-season]) body.season-stage .navbar.scrolled,
html[data-season="autumn"] body.season-stage .navbar.scrolled {
  background: rgba(38, 28, 20, 0.9);
  border-bottom-color: rgba(236, 170, 72, 0.32);
  box-shadow: 0 1px 0 rgba(236, 170, 72, 0.12), 0 8px 28px rgba(40, 18, 6, 0.28);
}

html[data-season="winter"] body.season-stage .navbar {
  background: rgba(20, 28, 40, 0.64);
  border-bottom-color: rgba(176, 210, 255, 0.2);
}

html[data-season="winter"] body.season-stage .navbar.scrolled {
  background: rgba(18, 26, 38, 0.9);
  border-bottom-color: rgba(176, 210, 255, 0.32);
  box-shadow: 0 1px 0 rgba(176, 210, 255, 0.12), 0 8px 28px rgba(8, 16, 32, 0.28);
}

html:not([data-season]) body.season-stage .site-footer,
html[data-season="autumn"] body.season-stage .site-footer {
  background: rgba(40, 30, 22, 0.9);
  border-top-color: rgba(236, 170, 72, 0.16);
}

html[data-season="winter"] body.season-stage .site-footer {
  background: rgba(20, 28, 40, 0.9);
  border-top-color: rgba(176, 210, 255, 0.16);
}

html:not([data-season]) body.season-stage .product-card,
html[data-season="autumn"] body.season-stage .product-card {
  background: linear-gradient(180deg, rgba(62, 46, 32, 0.94), rgba(44, 32, 24, 0.96));
  border-color: rgba(236, 176, 90, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.14), 0 12px 28px rgba(40, 18, 6, 0.22);
}

html[data-season="winter"] body.season-stage .product-card {
  background: linear-gradient(180deg, rgba(32, 44, 62, 0.94), rgba(22, 32, 46, 0.96));
  border-color: rgba(176, 210, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(220, 236, 255, 0.14), 0 12px 28px rgba(8, 16, 32, 0.22);
}

html:not([data-season]) body.season-stage .product-card:hover:not(.out-of-stock):not(.coming-soon),
html[data-season="autumn"] body.season-stage .product-card:hover:not(.out-of-stock):not(.coming-soon) {
  border-color: rgba(242, 176, 72, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.18), 0 0 0 4px rgba(224, 140, 48, 0.14), 0 18px 36px -16px rgba(180, 80, 20, 0.5);
}

html[data-season="winter"] body.season-stage .product-card:hover:not(.out-of-stock):not(.coming-soon) {
  border-color: rgba(176, 210, 255, 0.75);
  box-shadow: inset 0 1px 0 rgba(220, 236, 255, 0.18), 0 0 0 4px rgba(140, 180, 230, 0.16), 0 18px 36px -16px rgba(80, 130, 190, 0.5);
}

html:not([data-season]) body.season-stage .product-card.selected,
html[data-season="autumn"] body.season-stage .product-card.selected {
  border-color: rgba(242, 176, 72, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.18), 0 0 0 4px rgba(224, 140, 48, 0.22);
}

html[data-season="winter"] body.season-stage .product-card.selected {
  border-color: rgba(186, 216, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(220, 236, 255, 0.18), 0 0 0 4px rgba(140, 180, 230, 0.24);
}

html:not([data-season]) body.season-stage .hero-badge,
html[data-season="autumn"] body.season-stage .hero-badge {
  background: rgba(242, 176, 72, 0.1);
  border-color: rgba(242, 176, 72, 0.28);
  color: #f6d7a6;
}

html[data-season="winter"] body.season-stage .hero-badge {
  background: rgba(186, 216, 255, 0.1);
  border-color: rgba(186, 216, 255, 0.3);
  color: #d7e8ff;
}

html:not([data-season]) body.season-stage .catalog-section-header::after,
html[data-season="autumn"] body.season-stage .catalog-section-header::after {
  background: linear-gradient(90deg, rgba(242, 184, 84, 0.55), rgba(242, 184, 84, 0.08) 48%, transparent 80%);
}

html[data-season="winter"] body.season-stage .catalog-section-header::after {
  background: linear-gradient(90deg, rgba(190, 220, 255, 0.55), rgba(190, 220, 255, 0.08) 48%, transparent 80%);
}

html:not([data-season]) body.season-stage .profile-hero,
html[data-season="autumn"] body.season-stage .profile-hero {
  background: rgba(54, 40, 28, 0.97);
  border-color: rgba(236, 168, 72, 0.32);
  box-shadow: 0 18px 48px rgba(40, 18, 6, 0.28), inset 0 1px 0 rgba(255, 214, 160, 0.16);
}

html:not([data-season]) body.season-stage .profile-hero::after,
html[data-season="autumn"] body.season-stage .profile-hero::after {
  background: radial-gradient(circle, rgba(242, 160, 48, 0.28) 0%, transparent 70%);
}

html[data-season="winter"] body.season-stage .profile-hero {
  background: rgba(28, 40, 58, 0.97);
  border-color: rgba(176, 210, 255, 0.32);
  box-shadow: 0 18px 48px rgba(8, 16, 32, 0.28), inset 0 1px 0 rgba(220, 236, 255, 0.16);
}

html[data-season="winter"] body.season-stage .profile-hero::after {
  background: radial-gradient(circle, rgba(160, 200, 255, 0.28) 0%, transparent 70%);
}

html:not([data-season]) body.season-stage .profile-tabs,
html[data-season="autumn"] body.season-stage .profile-tabs,
html:not([data-season]) body.season-stage .action-card,
html[data-season="autumn"] body.season-stage .action-card,
html:not([data-season]) body.season-stage .purchase-item:not(.purchase-item--highlight),
html[data-season="autumn"] body.season-stage .purchase-item:not(.purchase-item--highlight) {
  background: rgba(54, 40, 28, 0.97);
  border-color: rgba(236, 168, 72, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.1);
}

html[data-season="winter"] body.season-stage .profile-tabs,
html[data-season="winter"] body.season-stage .action-card,
html[data-season="winter"] body.season-stage .purchase-item:not(.purchase-item--highlight) {
  background: rgba(28, 40, 58, 0.97);
  border-color: rgba(176, 210, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(220, 236, 255, 0.1);
}

html:not([data-season]) body.season-stage .action-card:hover,
html[data-season="autumn"] body.season-stage .action-card:hover {
  box-shadow: inset 0 1px 0 rgba(255, 214, 160, 0.14), 0 14px 32px rgba(40, 18, 6, 0.28);
}

html[data-season="winter"] body.season-stage .action-card:hover {
  box-shadow: inset 0 1px 0 rgba(220, 236, 255, 0.14), 0 14px 32px rgba(8, 16, 32, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .season-orb,
  .season-flake { animation: none; }
  .season-flake { top: var(--rest, 24%); }
}

html[data-season="autumn"] body.season-stage .modal-content,
html:not([data-season]) body.season-stage .modal-content {
  background:
    radial-gradient(380px 160px at 100% 0%, rgba(242, 164, 48, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(62, 44, 30, 0.98), rgba(34, 24, 16, 0.98));
  border-color: rgba(236, 168, 72, 0.4);
  box-shadow: 0 24px 60px rgba(40, 18, 6, 0.45), inset 0 1px 0 rgba(255, 214, 160, 0.16);
}
html[data-season="winter"] body.season-stage .modal-content {
  background:
    radial-gradient(380px 160px at 100% 0%, rgba(170, 210, 255, 0.22), transparent 70%),
    linear-gradient(180deg, rgba(28, 40, 62, 0.98), rgba(16, 24, 40, 0.98));
  border-color: rgba(176, 210, 255, 0.4);
  box-shadow: 0 24px 60px rgba(8, 16, 32, 0.45), inset 0 1px 0 rgba(220, 236, 255, 0.16);
}

/* Scroll vine: a pixel spider climbs a growing Minecraft vine. */
@property --mc-progress {
  syntax: '<number>';
  inherits: true;
  initial-value: 0;
}

body.season-stage {
  --vine-a: rgba(20, 16, 12, 0.45);
  --vine-b: #f4efe6;
  --vine-glow: rgba(255, 244, 220, 0.45);
}

html[data-season="winter"] body.season-stage {
  --vine-a: rgba(8, 16, 28, 0.4);
  --vine-b: #f7fbff;
  --vine-glow: rgba(220, 236, 255, 0.55);
}

.mc-scroll {
  position: fixed;
  top: 108px;
  right: 28px;
  bottom: 22px;
  width: 124px;
  z-index: 40;
  pointer-events: none;
  --mc-pull: 0;
}

.mc-scroll-vine {
  position: absolute;
  left: 0;
  top: 0;
  width: 124px;
  height: 100%;
  overflow: visible;
}

.mc-scroll-stem,
.mc-scroll-stem-shadow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mc-scroll-stem-shadow {
  stroke: var(--vine-a);
  stroke-width: 4;
  opacity: 0.55;
}

.mc-scroll-stem {
  stroke: var(--vine-b);
  stroke-width: 2.2;
  filter: drop-shadow(0 0 4px var(--vine-glow));
}

.mc-scroll-rider:focus-visible {
  outline: 2px solid var(--vine-b);
  outline-offset: 2px;
  border-radius: 8px;
}

.mc-vine-leaf {
  opacity: clamp(0, (var(--mc-progress) - var(--at, 0)) * 10, 1);
}

.mc-vine-leaf rect { fill: var(--vine-leaf); }

.mc-scroll-rider {
  pointer-events: auto;
  position: absolute;
  left: 26px;
  top: 0;
  width: 72px;
  height: 72px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: grab;
  touch-action: none;
  transform: translate3d(calc(var(--mc-pull) * 10px), var(--mc-y, 0px), 0) rotate(calc(var(--mc-pull) * 8deg));
}

.mc-scroll.is-drag .mc-scroll-rider { cursor: grabbing; }

.mc-spider {
  display: block;
  width: 72px;
  height: 72px;
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.35));
  animation: mc-bob 1.7s ease-in-out infinite;
}

.mc-spider--profile { margin-left: 0; }
.mc-spider-profile-keep { display: none !important; }

.mc-eye { fill: #e23b2f; }
.mc-snow, .mc-heart, .mc-pumpkin { display: none; }
html[data-season="winter"] .mc-snow { display: block; }
html:not([data-season="winter"]) .mc-pumpkin { display: block; }

.mc-scroll[data-direction="down"] .mc-leg,
.mc-scroll[data-direction="up"] .mc-leg,
.mc-scroll[data-direction="down"] .mc-leg-l,
.mc-scroll[data-direction="up"] .mc-leg-l,
.mc-scroll[data-direction="down"] .mc-leg-r,
.mc-scroll[data-direction="up"] .mc-leg-r {
  transform-box: fill-box;
  transform-origin: center;
  animation: mc-step 0.16s steps(2, end) infinite;
}
.mc-leg-b { animation-delay: 0.04s; }
.mc-leg-c { animation-delay: 0.08s; }
.mc-leg-d { animation-delay: 0.12s; }

.mc-scroll[data-mood="angry"] .mc-spider {
  animation: mc-shake 0.12s linear infinite;
}
.mc-scroll[data-mood="angry"] .mc-eye { fill: #ff6a1a; }

.mc-scroll[data-mood="love"] .mc-spider { animation: mc-bob 0.9s ease-in-out infinite; }
.mc-scroll[data-mood="love"] .mc-eye { fill: #ff7eb6; }
.mc-scroll[data-mood="love"] .mc-heart { display: block; animation: mc-heart 0.8s ease-in-out infinite; }

@keyframes mc-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes mc-shake {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2px) rotate(-2deg); }
}
@keyframes mc-step {
  to { transform: translateY(2px); }
}
@keyframes mc-heart {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(-3px); opacity: 0.7; }
}

.mc-web-bit {
  position: fixed;
  z-index: 39;
  width: 16px;
  height: 16px;
  pointer-events: none;
  animation: mc-web-fly 0.9s ease-out forwards;
}
.mc-web-bit svg { display: block; width: 100%; height: 100%; }
@keyframes mc-web-fly {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

@media (max-width: 759px), (pointer: coarse), (prefers-reduced-motion: reduce) {
  .mc-scroll { display: none; }
}

@media (min-width: 760px) and (pointer: fine) {
  body.season-stage.has-mc-scroll {
    scrollbar-width: none;
  }
  body.season-stage.has-mc-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  body.season-stage.has-mc-scroll .main-content {
    padding-right: 8.5rem;
  }
}
