/* =========================================
   CHRISTMAS THEME — LIGHT
   ========================================= */

:root[data-season="christmas"][data-theme="light"] {
  color-scheme: light;

  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-hover: #edf1f5;

  --text: #1e3244;
  --text-muted: #5b5b5b;

  --primary: #1e3244;
  --primary-hover: #304b63;
  --accent: #527a9e;

  --border: rgba(30, 50, 68, 0.1);
  --border-hover: rgba(30, 50, 68, 0.35);

  --shadow: 0 8px 32px rgba(30, 50, 68, 0.06);
}

/* =========================================
   CHRISTMAS THEME — DARK
   ========================================= */

:root[data-season="christmas"][data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d151e;
  --surface: #15222f;
  --surface-hover: #1e3244;

  --text: #eef2f6;
  --text-muted: #9eabb8;

  --primary: #a8c2d8;
  --primary-hover: #c7dced;
  --accent: #729fc5;

  --border: rgba(168, 194, 216, 0.12);
  --border-hover: rgba(168, 194, 216, 0.4);

  --shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* =========================================
   CHRISTMAS BACKGROUND
   ========================================= */

[data-season="christmas"] body {
  background:
    radial-gradient(
      ellipse 85% 40% at 50% -15%,
      rgba(184, 148, 81, 0.1),
      transparent 95%
    ),
    var(--bg);
}

/* =========================================
   CHRISTMAS COMPONENTS
   ========================================= */

[data-season="christmas"] .avatar {
  border-color: var(--border-hover);
}

[data-season="christmas"] .link:hover {
  box-shadow: 0 12px 34px rgba(104, 83, 34, 0.08);
}

/* =========================================
   CHRISTMAS BADGE
   ========================================= */

.christmas-badge {
  display: none;
}

[data-season="christmas"] .christmas-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  width: fit-content;
  margin: 0 auto 24px;
  padding: 7px 17px;

  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);

  color: var(--accent);

  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* =========================================
   SNOWFALL CONTAINER
   ========================================= */

.snowfall {
  display: none;

  position: fixed;
  inset: 0;

  z-index: 1000;

  overflow: hidden;
  pointer-events: none;

  user-select: none;
}

/* Enabled only during Christmas */

[data-season="christmas"] .snowfall {
  display: block;
}

/* =========================================
   SNOWFLAKES
   ========================================= */

.snowflake {
  --size: 12px;
  --duration: 18s;
  --delay: 0s;
  --drift: 30px;
  --opacity: 0.7;

  position: absolute;
  top: -20px;
  left: 50%;

  width: auto;
  height: auto;

  color: var(--snow-color);
  font-size: var(--size);
  line-height: 1;

  opacity: 0;
  pointer-events: none;

  animation: snowfall var(--duration) linear var(--delay) infinite;
}

.snowflake::before {
  content: "*";
  display: block;
}

/* =========================================
   SNOWFLAKE DISTRIBUTION
   ========================================= */

/* Group 1 */

.snowflake:nth-child(12n + 1) {
  left: 3%;
  --size: 2px;
  --duration: 22s;
  --delay: -15s;
  --drift: 45px;
}

.snowflake:nth-child(12n + 2) {
  left: 12%;
  --size: 4px;
  --duration: 16s;
  --delay: -8s;
  --drift: -35px;
}

.snowflake:nth-child(12n + 3) {
  left: 21%;
  --size: 3px;
  --duration: 25s;
  --delay: -19s;
  --drift: 65px;
}

.snowflake:nth-child(12n + 4) {
  left: 30%;
  --size: 5px;
  --duration: 14s;
  --delay: -5s;
  --drift: -55px;
}

.snowflake:nth-child(12n + 5) {
  left: 39%;
  --size: 2px;
  --duration: 28s;
  --delay: -21s;
  --drift: 75px;
}

.snowflake:nth-child(12n + 6) {
  left: 48%;
  --size: 4px;
  --duration: 19s;
  --delay: -12s;
  --drift: -65px;
}

.snowflake:nth-child(12n + 7) {
  left: 57%;
  --size: 3px;
  --duration: 23s;
  --delay: -17s;
  --drift: 40px;
}

.snowflake:nth-child(12n + 8) {
  left: 66%;
  --size: 5px;
  --duration: 15s;
  --delay: -9s;
  --drift: -45px;
}

.snowflake:nth-child(12n + 9) {
  left: 75%;
  --size: 2px;
  --duration: 27s;
  --delay: -22s;
  --drift: 85px;
}

.snowflake:nth-child(12n + 10) {
  left: 84%;
  --size: 4px;
  --duration: 18s;
  --delay: -11s;
  --drift: -70px;
}

.snowflake:nth-child(12n + 11) {
  left: 93%;
  --size: 3px;
  --duration: 24s;
  --delay: -18s;
  --drift: 55px;
}

.snowflake:nth-child(12n + 12) {
  left: 98%;
  --size: 2px;
  --duration: 29s;
  --delay: -25s;
  --drift: -40px;
}

/* =========================================
   ADDITIONAL VARIATIONS
   ========================================= */

/* Small flakes */

.snowflake:nth-child(3n) {
  --opacity: 0.45;
}

/* Bright flakes */

.snowflake:nth-child(5n) {
  --opacity: 0.9;
}

/* Slight blur for depth */

.snowflake:nth-child(4n) {
  filter: blur(0.5px);
}

/* Additional horizontal distribution */

.snowflake:nth-child(n + 13):nth-child(-n + 24) {
  margin-left: 4%;
  animation-duration: calc(var(--duration) * 1.15);
}

.snowflake:nth-child(n + 25):nth-child(-n + 36) {
  margin-left: -5%;
  animation-duration: calc(var(--duration) * 0.85);
}

/* =========================================
   SNOWFALL ANIMATION
   ========================================= */

@keyframes snowfall {
  0% {
    transform: translate3d(0, -20px, 0);
    opacity: 0;
  }

  5% {
    opacity: var(--opacity);
  }

  50% {
    transform: translate3d(calc(var(--drift) * 0.35), 55vh, 0);
  }

  90% {
    opacity: var(--opacity);
  }

  100% {
    transform: translate3d(var(--drift), 110vh, 0);

    opacity: 0;
  }
}

/* =========================================
   ACCESSIBILITY
   ========================================= */

@media (prefers-reduced-motion: reduce) {
  .snowflake {
    animation: none;
    opacity: 0.25;
    will-change: auto;
  }
}

/* Small */
.snowflake:nth-child(3n) {
  --size: 12px;
}

/* Medium */
.snowflake:nth-child(3n + 1) {
  --size: 18px;
}

/* Large */
.snowflake:nth-child(3n + 2) {
  --size: 22px;
}
