/* ==========================================================================
   Christmas. Loaded by /seasonal/seasonal_head.cfm (via /site/site_head.cfm)
   only while the season is on, AFTER /site/site.css. Built the way
   halloween.css is (read its header for the rules a season follows):

          .site-header         every page: a snow-white header with dark text
                               and the logo made for light grounds, a Santa
                               hat on the logo, a string of lights under it
          .home-hero           front-page stage: a cold night, falling snow
          .site-band           a page's closing band: holly in the corner,
                               two ornaments on their strings
          .site-band--lead     a block that opens the page: holly low,
                               ornaments beside the form
          .site-band--plain    a dark block that only takes the colors
          .site-footer         every page: snow on its top edge
          .site-ledge          every page: presents on the footer's ledge;
                               they open the game, Downhill Dash

   The hidden surprise (christmas.js): three quick taps on the front-page
   stage whip the snow into a blizzard for a few seconds.
   ========================================================================== */

:root {
    /* The header: snow white, dark text, and the logo made for a light ground */
    --site-header-bg: #ffffff;
    --site-header-text: #18181b;
    --site-header-text-soft: #26262b;
    --site-header-text-muted: #5c5c66;
    --site-header-hover: rgba(16, 38, 28, 0.07);
    --site-header-current: #b3132b;                     /* the current page in the phone menu: holly red */
    --site-nav-current: rgba(16, 38, 28, 0.09);
    --site-header-logo-dark: none;
    --site-header-logo-light: block;
    --site-coin-img: url("/assets/images/smlogo-on-light.png");

    /* Everything else that's dark: an evergreen night */
    --site-stage-bg: #10261c;
    --site-video-bg: #0c1f17;
    --site-hero-tint: rgba(12, 30, 45, 0.62);           /* the hero's one flat overlay, as dark as the normal 56% black, a cold night blue */
    --site-band-bg: #10261c;
    --site-band-edge: transparent;                      /* the bands carry glows, not the edge line */
    /* Gold or red light on green mixes to olive and brown, so the glows stay cold and dark;
       the red and gold live in the ornaments, the holly and the lights */
    --site-band-glow-top: rgba(200, 230, 255, 0.14);    /* moonlight on snow */
    --site-band-glow-bottom: rgba(0, 0, 0, 0.4);        /* a shadow at the bottom left, as the normal site has */
    --site-footer-bg: #0b1c15;
    --site-mist: #eef4f7;               /* light page grounds take a cold blue-white; white cards stay white */

    /* The logo's coin (three taps on the front page) lands on a snowflake */
    --site-coin-face: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cdefs%3E%3Cpath id='a' d='M20 20V5.5M20 10L16.5 6.5M20 10L23.5 6.5M20 14.5L17.5 12M20 14.5L22.5 12'/%3E%3C/defs%3E%3Ccircle cx='20' cy='20' r='19.5' fill='%23c8202f'/%3E%3Cg fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'%3E%3Cuse href='%23a'/%3E%3Cuse href='%23a' transform='rotate(60 20 20)'/%3E%3Cuse href='%23a' transform='rotate(120 20 20)'/%3E%3Cuse href='%23a' transform='rotate(180 20 20)'/%3E%3Cuse href='%23a' transform='rotate(240 20 20)'/%3E%3Cuse href='%23a' transform='rotate(300 20 20)'/%3E%3C/g%3E%3C/svg%3E");

    /* Christmas's own art */
    --xm-hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 36'%3E%3Cpath d='M5 27C7 15 15 6 27 5C35 4.5 40 10 39 18L35 18.5C35 13 31 10.5 27 11.5C21 13 19 20 30 27Z' fill='%23d42a35'/%3E%3Ccircle cx='37' cy='20.5' r='4.6' fill='%23fff' stroke='%23cfd8df'/%3E%3Crect x='2' y='24.5' width='31' height='9' rx='4.5' fill='%23fff' stroke='%23cfd8df'/%3E%3C/svg%3E");

    /* The string of lights: one 128px stretch holds four bulbs. The second layer dims two of them,
       and stepping it along by one bulb makes the string twinkle. */
    --xm-lights: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 22'%3E%3Cpath d='M0 3Q16 9 32 3Q48 9 64 3Q80 9 96 3Q112 9 128 3' fill='none' stroke='%2324443a' stroke-width='1.4'/%3E%3Cg fill='%232f4f43'%3E%3Crect x='14.6' y='5' width='2.8' height='3.6' rx='0.6'/%3E%3Crect x='46.6' y='5' width='2.8' height='3.6' rx='0.6'/%3E%3Crect x='78.6' y='5' width='2.8' height='3.6' rx='0.6'/%3E%3Crect x='110.6' y='5' width='2.8' height='3.6' rx='0.6'/%3E%3C/g%3E%3Cellipse cx='16' cy='12.8' rx='3.1' ry='4.6' fill='%23e23744'/%3E%3Cellipse cx='48' cy='12.8' rx='3.1' ry='4.6' fill='%23f5c242'/%3E%3Cellipse cx='80' cy='12.8' rx='3.1' ry='4.6' fill='%232fb36b'/%3E%3Cellipse cx='112' cy='12.8' rx='3.1' ry='4.6' fill='%233d8ae8'/%3E%3Cg fill='%23fff' opacity='0.6'%3E%3Cellipse cx='15' cy='11.2' rx='0.9' ry='1.6'/%3E%3Cellipse cx='47' cy='11.2' rx='0.9' ry='1.6'/%3E%3Cellipse cx='79' cy='11.2' rx='0.9' ry='1.6'/%3E%3Cellipse cx='111' cy='11.2' rx='0.9' ry='1.6'/%3E%3C/g%3E%3C/svg%3E");
    --xm-lights-dim: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 22'%3E%3Cg fill='rgba(10,24,18,0.55)'%3E%3Cellipse cx='16' cy='12.8' rx='3.3' ry='4.8'/%3E%3Cellipse cx='80' cy='12.8' rx='3.3' ry='4.8'/%3E%3C/g%3E%3C/svg%3E");

    --xm-holly: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cdefs%3E%3Cg id='h'%3E%3Cpath d='M0 0Q6-2 10-7Q16-6 21-11Q27-7.5 33-12Q39-7 45-10Q53-4 60 0Q53 4 45 10Q39 7 33 12Q27 7.5 21 11Q16 6 10 7Q6 2 0 0Z'/%3E%3Cpath d='M2 0H56' stroke='rgba(0,0,0,0.25)' stroke-width='1.2' fill='none'/%3E%3C/g%3E%3C/defs%3E%3Cuse href='%23h' fill='%232f9a58' transform='translate(40 40) rotate(-12)'/%3E%3Cuse href='%23h' fill='%23268a4c' transform='translate(40 40) rotate(98)'/%3E%3Cuse href='%23h' fill='%232f9a58' transform='translate(40 40) rotate(215)'/%3E%3Cg fill='%23d62a3a'%3E%3Ccircle cx='40' cy='40' r='5.5'/%3E%3Ccircle cx='49' cy='36' r='5'/%3E%3Ccircle cx='44' cy='48' r='5'/%3E%3C/g%3E%3Cg fill='%23fff' opacity='0.45'%3E%3Ccircle cx='38.5' cy='38.5' r='1.5'/%3E%3Ccircle cx='47.5' cy='34.5' r='1.3'/%3E%3Ccircle cx='42.5' cy='46.5' r='1.3'/%3E%3C/g%3E%3C/svg%3E");

    --xm-ornaments: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 190'%3E%3Cpath d='M18 0V118M44 0V64' stroke='rgba(255,255,255,0.5)' stroke-width='0.8'/%3E%3Crect x='14' y='116' width='8' height='6' rx='1' fill='%23d9b44a'/%3E%3Ccircle cx='18' cy='136' r='14' fill='%23c8202f'/%3E%3Cpath d='M4.6 139Q18 145 31.4 139' stroke='%23f2d27a' stroke-width='2' fill='none'/%3E%3Cellipse cx='12.5' cy='130' rx='3.2' ry='5' fill='%23fff' opacity='0.35' transform='rotate(30 12.5 130)'/%3E%3Crect x='40.5' y='62' width='7' height='5' rx='1' fill='%23d9b44a'/%3E%3Ccircle cx='44' cy='78' r='11' fill='%23d9a63a'/%3E%3Cpath d='M33.4 80Q44 85 54.6 80' stroke='%23fff3cf' stroke-width='1.6' fill='none'/%3E%3Cellipse cx='39.5' cy='73.5' rx='2.6' ry='4' fill='%23fff' opacity='0.4' transform='rotate(30 39.5 73.5)'/%3E%3C/svg%3E");

    --xm-presents: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-2 0 112 44'%3E%3Crect x='0' y='16' width='40' height='28' fill='%23c8202f'/%3E%3Crect x='-1' y='11' width='42' height='7' rx='1' fill='%23b01b29'/%3E%3Crect x='17' y='11' width='6' height='33' fill='%23f2d27a'/%3E%3Cpath d='M20 11C13 1 6 7 20 11C34 7 27 1 20 11Z' fill='none' stroke='%23f2d27a' stroke-width='2.4'/%3E%3Crect x='46' y='24' width='30' height='20' fill='%231f7a45'/%3E%3Crect x='45' y='20' width='32' height='6' rx='1' fill='%231a6a3b'/%3E%3Crect x='58.5' y='20' width='5' height='24' fill='%23f4f7f9'/%3E%3Cpath d='M61 20C56 13 51 17 61 20C71 17 66 13 61 20Z' fill='none' stroke='%23f4f7f9' stroke-width='2'/%3E%3Crect x='82' y='30' width='24' height='14' fill='%23e8c35a'/%3E%3Crect x='81' y='27' width='26' height='5' rx='1' fill='%23d9b04a'/%3E%3Crect x='92' y='27' width='4' height='17' fill='%23c8202f'/%3E%3C/svg%3E");

    --xm-snowcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 20'%3E%3Cpath d='M0 0H120V9Q110 18 100 11Q90 5 80 12Q70 19 58 12Q48 6 38 13Q26 19 16 10Q8 5 0 9Z' fill='%23f4f8fa'/%3E%3C/svg%3E");

    /* Snow in three depths (small and slow far away, big and quicker up close), plus a flurry for the blizzard */
    --xm-snow-far: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%23fff' fill-opacity='0.7'%3E%3Ccircle cx='20' cy='30' r='1.4'/%3E%3Ccircle cx='85' cy='12' r='1.1'/%3E%3Ccircle cx='150' cy='40' r='1.6'/%3E%3Ccircle cx='60' cy='90' r='1.2'/%3E%3Ccircle cx='130' cy='110' r='1.5'/%3E%3Ccircle cx='180' cy='150' r='1.1'/%3E%3Ccircle cx='30' cy='160' r='1.6'/%3E%3Ccircle cx='100' cy='180' r='1.2'/%3E%3Ccircle cx='170' cy='80' r='1.3'/%3E%3Ccircle cx='10' cy='110' r='1'/%3E%3C/g%3E%3C/svg%3E");
    --xm-snow-mid: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'%3E%3Cg fill='%23fff' fill-opacity='0.85'%3E%3Ccircle cx='40' cy='60' r='2.2'/%3E%3Ccircle cx='170' cy='30' r='2.6'/%3E%3Ccircle cx='250' cy='120' r='2'/%3E%3Ccircle cx='90' cy='200' r='2.8'/%3E%3Ccircle cx='210' cy='250' r='2.2'/%3E%3Ccircle cx='20' cy='280' r='2'/%3E%3Ccircle cx='140' cy='140' r='2.4'/%3E%3C/g%3E%3C/svg%3E");
    --xm-snow-near: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 420 420'%3E%3Cdefs%3E%3Cfilter id='b'%3E%3CfeGaussianBlur stdDeviation='0.7'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='%23fff' fill-opacity='0.9' filter='url(%23b)'%3E%3Ccircle cx='60' cy='100' r='3.6'/%3E%3Ccircle cx='300' cy='60' r='4.2'/%3E%3Ccircle cx='200' cy='260' r='3.4'/%3E%3Ccircle cx='380' cy='330' r='4'/%3E%3Ccircle cx='110' cy='380' r='3.8'/%3E%3C/g%3E%3C/svg%3E");
    --xm-snow-flurry: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 160'%3E%3Cg fill='%23fff' fill-opacity='0.9'%3E%3Ccircle cx='12' cy='18' r='1.8'/%3E%3Ccircle cx='46' cy='6' r='1.4'/%3E%3Ccircle cx='80' cy='30' r='2.2'/%3E%3Ccircle cx='120' cy='12' r='1.6'/%3E%3Ccircle cx='150' cy='44' r='2'/%3E%3Ccircle cx='30' cy='58' r='2.4'/%3E%3Ccircle cx='66' cy='76' r='1.5'/%3E%3Ccircle cx='104' cy='62' r='1.9'/%3E%3Ccircle cx='140' cy='96' r='1.4'/%3E%3Ccircle cx='18' cy='104' r='1.7'/%3E%3Ccircle cx='54' cy='124' r='2.1'/%3E%3Ccircle cx='92' cy='110' r='1.3'/%3E%3Ccircle cx='126' cy='140' r='2.3'/%3E%3Ccircle cx='36' cy='150' r='1.5'/%3E%3C/g%3E%3C/svg%3E");
}


/* ---------- .site-header: snow white, a Santa hat on the logo, a string of lights ---------- */

.site-header { box-shadow: 0 1px 0 rgba(16, 38, 28, 0.08); }

/* The lights hang from the header's bottom edge, over whatever is under it. Behind the header's
   own content (z-index -1 inside the header), so the Products menu and the phone menu cover them. */
.site-header::before,
.site-header::after {
    content: "";
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    /* The art drawn half again as big; its wire runs along the header's bottom edge */
    bottom: -28.5px;
    height: 33px;
    pointer-events: none;
    background: repeat-x 0 0 / 192px 33px var(--xm-lights);
}

.site-header::before { filter: drop-shadow(0 0 3px rgba(255, 214, 120, 0.7)); }
.site-header::after { background-image: var(--xm-lights-dim); }

/* The phone menu hangs from the header's edge, so the lights step aside while it's open */
.site-header:has(.site-drawer:not([hidden]))::before,
.site-header:has(.site-drawer:not([hidden]))::after { content: none; }

/* On the front page the header floats clear over the photo (site.css); the lights come on with its colour */
@media (scripting: enabled) {
    .site-header--over-hero:not(.is-solid)::before,
    .site-header--over-hero:not(.is-solid)::after { opacity: 0; }
}

.site-header__logo::before {
    content: "";
    position: absolute;
    /* A share of the logo, so it sits on the "sm" circle at every logo size */
    top: -16%;
    left: -4%;
    height: 54%;
    aspect-ratio: 44 / 36;
    pointer-events: none;
    transform: rotate(-16deg);
    background: no-repeat center / contain var(--xm-hat);
}

/* Orange buttons glow gold */
.site-btn--brand:hover,
.site-btn--brand:focus-visible {
    box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.25), 0 0 26px rgba(242, 201, 76, 0.45);
}


/* ---------- .home-hero: falling snow ---------- */

/* Over the photo, under the words */
.home-hero::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background-image: var(--xm-snow-far), var(--xm-snow-mid), var(--xm-snow-near);
    background-size: 200px 200px, 300px 300px, 420px 420px;
}

/* The blizzard (christmas.js): a flurry joins in and the wind drives it all sideways */
.home-hero.xm-blizzard::before {
    background-image: var(--xm-snow-far), var(--xm-snow-mid), var(--xm-snow-near), var(--xm-snow-flurry);
    background-size: 200px 200px, 300px 300px, 420px 420px, 160px 160px;
}

/* Each layer moves exactly its own size per loop, so the loop never shows a seam */
@keyframes xm-snow {
    from { background-position: 0 0, 0 0, 0 0; }
    to   { background-position: 0 200px, 0 300px, 0 420px; }
}

@keyframes xm-snow-sway {
    from { transform: translateX(-12px); }
    to   { transform: translateX(12px); }
}

@keyframes xm-blizzard {
    from { background-position: 0 0, 0 0, 0 0, 0 0; }
    to   { background-position: 400px 200px, 600px 300px, 840px 420px, 640px 640px; }
}


/* ---------- .site-band: evergreen nights on every dark band ----------
   The colour and the two glows come from site.css; the tokens above make them Christmas ones. */

.site-band {
    position: relative;
    overflow: hidden;
}

.site-band .call-action-content,
.site-band .home-closing__inner {
    position: relative;
    z-index: 1;
}

/* A closing band: holly in the top corner, two ornaments on their strings */
.site-band:not(.site-band--lead, .site-band--plain)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: clamp(110px, 14vw, 180px);
    aspect-ratio: 1;
    pointer-events: none;
    background: no-repeat top left / contain var(--xm-holly);
}

.site-band:not(.site-band--lead, .site-band--plain)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 12%;
    width: 76px;
    height: 240px;
    pointer-events: none;
    transform-origin: top center;
    background: no-repeat top center / contain var(--xm-ornaments);
}

/* Phones: shorter strings keep the ornaments clear of the buttons */
@media (max-width: 767px) {
    .site-band:not(.site-band--lead, .site-band--plain)::after {
        right: 6%;
        width: 44px;
        height: 139px;
    }
}

/* A block that opens the page (sign-in, password reset): holly low on the left,
   and on wide screens the ornaments beside the form */
.site-band--lead::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: clamp(120px, 14vw, 190px);
    aspect-ratio: 1;
    pointer-events: none;
    transform: scaleY(-1);
    background: no-repeat top left / contain var(--xm-holly);
}

/* When a plain block continues the page, the holly moves to that block's bottom corner */
.site-band--lead:has(+ .site-band--plain)::before { content: none; }

.site-band--lead + .site-band--plain::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: clamp(120px, 14vw, 190px);
    aspect-ratio: 1;
    pointer-events: none;
    transform: scaleY(-1);
    background: no-repeat top left / contain var(--xm-holly);
}

@media (max-width: 719px) {
    .site-band--lead + .site-band--plain::before { width: 90px; }
}

@media (min-width: 992px) {
    .site-band--lead::after {
        content: "";
        position: absolute;
        top: 0;
        right: 5%;
        width: 76px;
        height: 240px;
        pointer-events: none;
        transform-origin: top center;
        background: no-repeat top center / contain var(--xm-ornaments);
    }
}

@keyframes xm-ornament-swing {
    0%, 100% { transform: rotate(-2.5deg); }
    50%      { transform: rotate(2.5deg); }
}


/* ---------- .site-ledge: presents on the footer's ledge (they open Downhill Dash) ---------- */

.site-ledge {
    display: block;
    top: -40px;
    right: 6%;
    width: 112px;
    height: 44px;
    background: no-repeat bottom center / contain var(--xm-presents);
    filter: drop-shadow(0 0 6px rgba(242, 201, 76, 0.25));
}

/* ---------- .site-footer: snow along its top edge ---------- */

.site-footer::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    pointer-events: none;
    background: repeat-x 0 0 / 120px 20px var(--xm-snowcap);
}


/* ---------- Motion: only for visitors who haven't asked for less ---------- */

@media (prefers-reduced-motion: no-preference) {
    .site-header::after { animation: xm-twinkle 1.6s steps(1, end) infinite; }
    .site-header::before { transition: opacity 0.25s; }

    .home-hero::before { animation: xm-snow 18s linear infinite, xm-snow-sway 7s ease-in-out infinite alternate; }
    .home-hero.xm-blizzard::before { animation: xm-blizzard 4s linear infinite; }

    .site-band:not(.site-band--lead, .site-band--plain)::after,
    .site-band--lead::after {
        animation: xm-ornament-swing 5s ease-in-out infinite;
    }
}

/* The dimmed pair of bulbs steps along by one, so the lit and unlit bulbs swap */
@keyframes xm-twinkle {
    0%   { background-position: 0 0; }
    50%  { background-position: 48px 0; }
    100% { background-position: 0 0; }
}
