/* =========================================================================
   ArkHost winter 2026 seasonal layer
   -------------------------------------------------------------------------
   Additive and removable. It is loaded by includes/hooks/arkhost_winter.php
   only inside the seasonal window, and changes no template, copy or layout.
   Remove the hook to return the site to its normal appearance.

   Assets: templates/arkhost/images/winter/*.png
   Palette: site tokens #eaf6ff / #cae4f0 / #9bdcff / #84e3ef over #08111d.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Falling snow over the public page header sky.
   Two layers: a wide slow field and a closer, faster one, both built from
   the same seamless 512px tile. pointer-events stays off.
   ---------------------------------------------------------------------- */
html.ark-dark .header-holder .bg-animation::before,
html.ark-dark .header-holder .bg-animation::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
    background-image: url(../images/winter/winter-snow-tile-512.png);
    background-repeat: repeat;
    background-position: 0 0;
    image-rendering: pixelated;
}

/* Far field: behind the sea and the boat, slow drift. */
html.ark-dark .header-holder .bg-animation::before {
    background-size: 560px 560px;
    opacity: .38;
    z-index: 0;
    -webkit-animation: ark-winter-snow-far 90s linear infinite;
    animation: ark-winter-snow-far 90s linear infinite;
}

/* Near field: in front of the sea but behind the boat, quicker and fainter. */
html.ark-dark .header-holder .bg-animation::after {
    background-size: 420px 420px;
    opacity: .22;
    z-index: 2;
    -webkit-animation: ark-winter-snow-near 55s linear infinite;
    animation: ark-winter-snow-near 55s linear infinite;
}

@-webkit-keyframes ark-winter-snow-far {
    from { background-position: 0 0; }
    to   { background-position: -560px 560px; }
}
@keyframes ark-winter-snow-far {
    from { background-position: 0 0; }
    to   { background-position: -560px 560px; }
}

@-webkit-keyframes ark-winter-snow-near {
    from { background-position: 0 0; }
    to   { background-position: -420px 420px; }
}
@keyframes ark-winter-snow-near {
    from { background-position: 0 0; }
    to   { background-position: -420px 420px; }
}

@-webkit-keyframes ark-winter-snow-inner {
    from { background-position: 0 0; }
    to   { background-position: -360px 360px; }
}
@keyframes ark-winter-snow-inner {
    from { background-position: 0 0; }
    to   { background-position: -360px 360px; }
}

@-webkit-keyframes ark-winter-snow-page {
    from { background-position: 0 0; }
    to   { background-position: -520px 520px; }
}
@keyframes ark-winter-snow-page {
    from { background-position: 0 0; }
    to   { background-position: -520px 520px; }
}

/* A slow, shallow pulse: the string reads as switched on without flashing. */
@-webkit-keyframes ark-winter-garland-twinkle {
    0%, 100% { opacity: .85; -webkit-filter: brightness(1); filter: brightness(1); }
    50%      { opacity: .95; -webkit-filter: brightness(1.08); filter: brightness(1.08); }
}
@keyframes ark-winter-garland-twinkle {
    0%, 100% { opacity: .85; filter: brightness(1); }
    50%      { opacity: .95; filter: brightness(1.08); }
}

@-webkit-keyframes ark-winter-floe-bob {
    from { -webkit-transform: translateY(0); }
    to   { -webkit-transform: translateY(-3px); }
}
@keyframes ark-winter-floe-bob {
    from { transform: translateY(0); }
    to   { transform: translateY(-3px); }
}

/* Inner pages hide .bg-animation, so the snow paints on the header band
   itself and the two nav rows are lifted above it. */
html.ark-dark .header-holder.inner-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(../images/winter/winter-snow-tile-512.png);
    background-repeat: repeat;
    background-position: 0 0;
    background-size: 360px 360px;
    image-rendering: pixelated;
    opacity: .44;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    -webkit-animation: ark-winter-snow-inner 75s linear infinite;
    animation: ark-winter-snow-inner 75s linear infinite;
}

html.ark-dark .header-holder.inner-header > .navbar {
    z-index: 1;
}

/* The main content section on inner pages is one plain block. A very light
   snow tile on its background continues the effect behind the content. */
html.ark-dark .header-holder.inner-header + section,
html.ark-dark .header-holder.inner-header + nav + section {
    background-image: url(../images/winter/winter-snow-tile-soft.png);
    background-repeat: repeat;
    background-position: 0 0;
    background-size: 520px 520px;
    -webkit-animation: ark-winter-snow-page 140s linear infinite;
    animation: ark-winter-snow-page 140s linear infinite;
}

/* -------------------------------------------------------------------------
   2. Ice floes floating on the hero sea. No repeating band, so no seam:
   four discrete patches sit at different heights across the water.
   ---------------------------------------------------------------------- */
html.ark-dark .header-holder.main-header .bg-animation .pixel-home-sea::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url(../images/winter/winter-floe-b-96.png),
        url(../images/winter/winter-floe-c-48.png),
        url(../images/winter/winter-floe-b-96.png),
        url(../images/winter/winter-floe-c-48.png);
    background-repeat: no-repeat;
    background-position: 7% 46%, 28% 62%, 47% 52%, 60% 68%;
    background-size: 96px 32px, 48px 32px, 96px 32px, 48px 32px;
    image-rendering: pixelated;
    pointer-events: none;
    user-select: none;
    opacity: .8;
    z-index: 2;
    -webkit-animation: ark-winter-floe-bob 11s ease-in-out infinite alternate;
    animation: ark-winter-floe-bob 11s ease-in-out infinite alternate;
}

/* -------------------------------------------------------------------------
   4. Pixel fairy lights strung under the main menu row.
   Absolutely positioned so the navbar height and layout never move.
   ---------------------------------------------------------------------- */
html.ark-dark .header-holder .main-navbar-wrapper {
    position: relative;
}

html.ark-dark .header-holder .main-navbar-wrapper::after {
    content: '';
    position: absolute;
    left: 0;
    top: 100%;
    width: 100%;
    height: 48px;
    background-image: url(../images/winter/winter-garland-384.png);
    background-repeat: repeat-x;
    background-position: 0 0;
    background-size: 384px 48px;
    image-rendering: pixelated;
    pointer-events: none;
    user-select: none;
    opacity: .85;
    z-index: 4;
    -webkit-animation: ark-winter-garland-twinkle 5s ease-in-out infinite;
    animation: ark-winter-garland-twinkle 5s ease-in-out infinite;
}

/* -------------------------------------------------------------------------
   4. Motion and mobile.
   ---------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html.ark-dark .header-holder .bg-animation::before,
    html.ark-dark .header-holder .bg-animation::after,
    html.ark-dark .header-holder.inner-header::after,
    html.ark-dark .header-holder.inner-header + section,
    html.ark-dark .header-holder.inner-header + nav + section,
    html.ark-dark .header-holder.main-header .bg-animation .pixel-home-sea::after,
    html.ark-dark .header-holder .main-navbar-wrapper::after {
        -webkit-animation: none !important;
        animation: none !important;
    }
}

@media (max-width: 991px) {
    /* Keep the snow present but quieter on a stacked layout. */
    html.ark-dark .header-holder .bg-animation::before { opacity: .32; }
    html.ark-dark .header-holder .bg-animation::after { opacity: .18; }
    html.ark-dark .header-holder.inner-header::after { opacity: .34; }
}

@media (max-width: 575px) {
    /* On phones the sea band is short: keep three floes and drop the fourth. */
    html.ark-dark .header-holder.main-header .bg-animation .pixel-home-sea::after {
        background-image:
            url(../images/winter/winter-floe-b-96.png),
            url(../images/winter/winter-floe-c-48.png),
            url(../images/winter/winter-floe-b-96.png),
            none;
        background-position: 5% 44%, 36% 60%, 70% 50%, 0 0;
        background-size: 96px 32px, 48px 32px, 96px 32px, 0 0;
    }
}
