/* Snow theme module for Linkify: chunky pixel snowflakes drifting over an icy night sky.
 *
 * Two fixed layers fall behind the content: small, slow far flakes (::before) and
 * larger plus-shaped near flakes (::after). Each layer is a repeating SVG tile; one
 * animation cycle moves it exactly one tile width sideways and two or three tile
 * heights down, so the loop is seamless and the snow blows gently to the right.
 * Both layers sit at z-index -1, behind the card and buttons.
 */

body[data-theme="Snow"] {
  --shell-top: #172231;
  --shell-bottom: #2d3f55;
  --panel-bg: #d6dde5;
  --pill-bg: rgba(255, 255, 255, 0.16);
  --pill-border: rgba(28, 40, 56, 0.55);
  --frame-border: rgba(28, 40, 56, 0.55);
  --ink: #1a2533;
  --ink-soft: rgba(26, 37, 51, 0.9);
}

body[data-theme="Snow"]::before,
body[data-theme="Snow"]::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: repeat;
}

/* Far layer: small flakes on a 140 x 220 tile; 1 tile across per 3 tiles down. */
body[data-theme="Snow"]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='220' shape-rendering='crispEdges' fill='%23eef5ff'%3E%3Crect x='12' y='18' width='2' height='2'/%3E%3Crect x='48' y='96' width='2' height='2'/%3E%3Crect x='86' y='40' width='3' height='3'/%3E%3Crect x='120' y='150' width='2' height='2'/%3E%3Crect x='30' y='182' width='3' height='3'/%3E%3Crect x='102' y='206' width='2' height='2'/%3E%3Crect x='64' y='130' width='2' height='2'/%3E%3Crect x='132' y='70' width='2' height='2'/%3E%3C/svg%3E");
  background-size: 140px 220px;
  opacity: 0.28;
  animation: snowDriftFar 12s steps(110, end) infinite;
}

/* Near layer: plus-shaped flakes on a 200 x 280 tile; 1 tile across per 2 tiles down. */
body[data-theme="Snow"]::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='280' shape-rendering='crispEdges' fill='%23ffffff'%3E%3Crect x='22' y='30' width='2' height='6'/%3E%3Crect x='20' y='32' width='6' height='2'/%3E%3Crect x='132' y='150' width='2' height='6'/%3E%3Crect x='130' y='152' width='6' height='2'/%3E%3Crect x='80' y='90' width='3' height='3'/%3E%3Crect x='170' y='40' width='3' height='3'/%3E%3Crect x='46' y='226' width='3' height='3'/%3E%3Crect x='150' y='250' width='3' height='3'/%3E%3Crect x='98' y='200' width='2' height='6'/%3E%3Crect x='96' y='202' width='6' height='2'/%3E%3C/svg%3E");
  background-size: 200px 280px;
  opacity: 0.36;
  animation: snowDriftNear 7.5s steps(80, end) infinite;
}

/* Card overlay: a faint frosty wash with scanlines. */
body[data-theme="Snow"] .phone-frame::before {
  background:
    linear-gradient(180deg, rgba(238, 245, 255, 0.12), rgba(238, 245, 255, 0.02)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 2px, transparent 2px 6px);
  opacity: 0.6;
}

body[data-theme="Snow"][data-color-mode="dark"] {
  --shell-top: #0b111b;
  --shell-bottom: #1a2637;
  --panel-bg: #141c28;
  --pill-bg: rgba(10, 16, 26, 0.6);
  --pill-border: rgba(190, 214, 240, 0.28);
  --frame-border: rgba(190, 214, 240, 0.28);
  --ink: #edf3fb;
  --ink-soft: rgba(237, 243, 251, 0.84);
  /* Filled buttons: a frozen slate blue rather than the default greyed shell tone. */
  --pill-fill: #2f4560;
  --pill-fill-hover: #3a5474;
}

body[data-theme="Snow"][data-color-mode="dark"] .phone-frame::before {
  background:
    linear-gradient(180deg, rgba(10, 16, 26, 0.3), rgba(10, 16, 26, 0.1)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 6px);
  opacity: 0.5;
}

/* Open layout, light mode keeps the night scene (see index.html); Filled buttons
   use the same Snow blue as dark mode. */
body[data-theme="Snow"][data-layout="open"]:not([data-color-mode="dark"]) {
  --pill-fill: #2f4560;
  --pill-fill-hover: #3a5474;
}

@keyframes snowDriftFar {
  from { background-position: 0 0; }
  to { background-position: 140px 660px; }
}

@keyframes snowDriftNear {
  from { background-position: 0 0; }
  to { background-position: 200px 560px; }
}

/* Still snow for visitors who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  body[data-theme="Snow"]::before,
  body[data-theme="Snow"]::after {
    animation: none;
  }
}
