/* ---- Winter -----------------------------------------------------------------
   Art for bin/php/seasonal/winter/*.php: the theme leans ice blue (tint.css),
   the backdrop takes a cool grade, icicles hang from the top bar, snow lies on
   the navigation panel and drifts down behind the panels. Snow and ice are the
   intrinsic colours (--wn-*), mixed with the theme text so they stay in tune. */

:root {
    --vhs-tint: #7aa7cf;    /* ice blue */
    --vhs-glint: #cfe8ff;   /* frost */
}

.vh-season--winter {
    --wn-snow: color-mix(in srgb, var(--vh-text) 25%, #f4faff);
    --wn-ice: color-mix(in srgb, var(--vhs-tint) 45%, #eaf6ff);
}

.vh-season--winter.vh-season-sky {
    background: linear-gradient(180deg, color-mix(in srgb, var(--vhs-tint) 18%, transparent), transparent 60%);
}

/* Icicles: translucent ice, brighter at the root, with a thin highlight. */
.vh-wn-icicles {
    --eaves: 24px;
    background:
        linear-gradient(90deg, transparent 0 46%, color-mix(in srgb, #ffffff 35%, transparent) 50%, transparent 54%) 0 0 / 7px 100%,
        linear-gradient(180deg, var(--wn-ice), color-mix(in srgb, var(--wn-ice) 30%, transparent));
    opacity: 0.85;
}

/* Snow cap on the navigation panel: a drift whose uneven top is the union of
   two wave rows with different periods, so it never reads as a repeated trim. */
.vh-wn-snowcap {
    --wn-drift-a: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 12' preserveAspectRatio='none'%3E%3Cpath d='M0 12V6C14 3.5 27 2.5 41 4.5S67 9 83 6.5 113 1.5 131 3.5 161 8.5 179 7.5 207 2.5 223 3.5 236 5.5 240 6V12Z'/%3E%3C/svg%3E");
    --wn-drift-b: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 12' preserveAspectRatio='none'%3E%3Cpath d='M0 12V8C18 7 30 4 46 5S74 9.5 92 8 118 3 136 4.5 158 8.5 170 8V12Z'/%3E%3C/svg%3E");
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: -2px;
    height: 11px;
    background: linear-gradient(180deg, var(--wn-snow) 40%, color-mix(in srgb, var(--wn-snow) 75%, var(--vhs-tint)));
    -webkit-mask: var(--wn-drift-a) 0 0 / 240px 100% repeat-x, var(--wn-drift-b) 57px 0 / 170px 100% repeat-x;
    mask: var(--wn-drift-a) 0 0 / 240px 100% repeat-x, var(--wn-drift-b) 57px 0 / 170px 100% repeat-x;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

/* Snow: the span drifts down, its content sways; flecks are soft round dots. */
.vh-wn-snow {
    width: var(--s);
    height: var(--s);
    color: var(--wn-snow);
    opacity: var(--o, 0.8);
    animation: vh-wn-fall var(--t) linear var(--d) infinite;
}

.vh-wn-snow--flake svg {
    width: 100%;
    height: 100%;
    animation: vh-wn-sway var(--w, 4s) ease-in-out var(--d) infinite alternate;
}

.vh-wn-flake-arms {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.vh-wn-snow--fleck {
    border-radius: 50%;
    background: radial-gradient(closest-side, currentColor 45%, transparent);
}

.vh-wn-snow:nth-of-type(1)  { --x: 8%;  --s: 16px; --t: 16s; --d: -3s;  --drift: 40px; }
.vh-wn-snow:nth-of-type(2)  { --x: 23%; --s: 7px;  --t: 12s; --d: -8s;  --drift: -20px; --o: 0.7; }
.vh-wn-snow:nth-of-type(3)  { --x: 88%; --s: 13px; --t: 18s; --d: -12s; --drift: -30px; --w: 5s; }
.vh-wn-snow:nth-of-type(4)  { --x: 67%; --s: 6px;  --t: 11s; --d: -2s;  --drift: 25px; --o: 0.6; }
.vh-wn-snow:nth-of-type(5)  { --x: 45%; --s: 18px; --t: 20s; --d: -15s; --drift: 35px; --w: 4.6s; }
.vh-wn-snow:nth-of-type(6)  { --x: 95%; --s: 8px;  --t: 13s; --d: -6s;  --drift: -15px; }
.vh-wn-snow:nth-of-type(7)  { --x: 34%; --s: 12px; --t: 17s; --d: -10s; --drift: -40px; --w: 3.6s; }
.vh-wn-snow:nth-of-type(8)  { --x: 3%;  --s: 6px;  --t: 12s; --d: -9s;  --drift: 20px; --o: 0.65; }
.vh-wn-snow:nth-of-type(9)  { --x: 78%; --s: 15px; --t: 19s; --d: -1s;  --drift: 30px; --w: 4.2s; }
.vh-wn-snow:nth-of-type(10) { --x: 56%; --s: 7px;  --t: 14s; --d: -4s;  --drift: -25px; }
.vh-wn-snow:nth-of-type(11) { --x: 15%; --s: 14px; --t: 21s; --d: -17s; --drift: 45px; --w: 5.4s; }
.vh-wn-snow:nth-of-type(12) { --x: 72%; --s: 5px;  --t: 10s; --d: -7s;  --drift: 15px; --o: 0.6; }
.vh-wn-snow:nth-of-type(13) { --x: 50%; --s: 11px; --t: 16s; --d: -13s; --drift: -35px; }
.vh-wn-snow:nth-of-type(14) { --x: 39%; --s: 8px;  --t: 13s; --d: -11s; --drift: 20px; }
.vh-wn-snow:nth-of-type(15) { --x: 99%; --s: 13px; --t: 18s; --d: -5s;  --drift: -45px; --w: 3.8s; }
.vh-wn-snow:nth-of-type(16) { --x: 28%; --s: 6px;  --t: 11s; --d: -14s; --drift: -10px; --o: 0.7; }

@keyframes vh-wn-fall {
    from { transform: translate3d(0, -6vh, 0); }
    to { transform: translate3d(var(--drift, 0px), 106vh, 0); }
}

@keyframes vh-wn-sway {
    from { transform: translateX(-10px) rotate(0deg); }
    to { transform: translateX(10px) rotate(120deg); }
}
