/* Glance custom CSS for inaba's homepage. Lives at /mnt/Apps/glance/assets/user.css.
 *
 * The page is ONE tall scene behind everything: night sky with a moon at the top, fading
 * through dusk purples into a rich violet at the bottom, where the rabbits sit.
 * The scene is painted on <html>/<body>, not on the columns, so it doesn't care about layout.
 *
 * Swap in real artwork: drop the file in assets/ and change ONE line below
 * (e.g. --art-moon: url("/assets/moon.png");). Browsers cache CSS, so hard-refresh after.
 */

:root {
    --art-moon: url("/assets/moon.svg");
    --art-rabbits: url("/assets/rabbits.svg");

    /* the scene, top to bottom */
    --scene-night:  hsl(228 55% 7%);
    --scene-night2: hsl(240 45% 11%);
    --scene-dusk:   hsl(262 40% 16%);
    --scene-dusk2:  hsl(276 42% 20%);
    --scene-violet: hsl(282 55% 26%);

    /* section tints (H S L), used with alpha over the scene */
    --tint-sky:    226 45% 14%;
    --tint-search: 245 40% 16%;
    --tint-dusk:   264 38% 18%;
    --tint-ground: 280 45% 20%;

    --moon-size: clamp(90px, 15vw, 170px);
    --ground-height: clamp(80px, 13vw, 150px);
}

/* ---- the scene ---------------------------------------------------------------------------- */

/* Glance sets html/body to height:100%, which would make the gradient repeat every screen.
   Let them grow with the content so the gradient spans the whole page once. */
html, body, .body-content {
    height: auto;
    min-height: 100vh;
}

html {
    background-color: var(--scene-night);
    background-image:
        /* a few stars near the top */
        radial-gradient(1.5px 1.5px at 8% 60px,   #fff9 99%, transparent),
        radial-gradient(1px 1px     at 18% 150px, #fff8 99%, transparent),
        radial-gradient(2px 2px     at 29% 40px,  #fffa 99%, transparent),
        radial-gradient(1px 1px     at 41% 210px, #fff7 99%, transparent),
        radial-gradient(1.5px 1.5px at 52% 95px,  #fff9 99%, transparent),
        radial-gradient(1px 1px     at 63% 30px,  #fff8 99%, transparent),
        radial-gradient(1.5px 1.5px at 88% 230px, #fff8 99%, transparent),
        radial-gradient(1px 1px     at 95% 70px,  #fff7 99%, transparent),
        radial-gradient(1px 1px     at 4% 260px,  #fff6 99%, transparent),
        radial-gradient(1.5px 1.5px at 34% 300px, #fff6 99%, transparent),
        /* sky to ground */
        linear-gradient(to bottom,
            var(--scene-night) 0%,
            var(--scene-night2) 22%,
            var(--scene-dusk) 48%,
            var(--scene-dusk2) 72%,
            var(--scene-violet) 100%);
    background-repeat: no-repeat;
}

body {
    background: transparent;
    position: relative;
}

/* moon, top of the sky */
body::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    right: 12%;
    width: var(--moon-size);
    aspect-ratio: 1;
    background: var(--art-moon) center / contain no-repeat;
    pointer-events: none;
    z-index: 0;
}

/* rabbits on the ground, bottom of the page */
body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--ground-height);
    background:
        var(--art-rabbits) bottom center / auto 100% no-repeat,
        radial-gradient(ellipse 70% 100% at 50% 100%, hsl(282 50% 14% / 0.8), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.body-content {
    position: relative;
    z-index: 1;
    /* room for the moon above the first section, and for the ground below the last */
    padding-top: calc(var(--moon-size) * 0.75);
    padding-bottom: var(--ground-height);
}

/* ---- sections, tinted for where they sit in the scene ------------------------------------- */

.widget-content:not(.widget-content-frameless) {
    background: hsl(var(--tint, var(--tint-dusk)) / 0.55);
    border-color: hsl(var(--tint, var(--tint-dusk)) / 0.9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.scene-sky    { --tint: var(--tint-sky); }
.scene-search { --tint: var(--tint-search); }
.scene-dusk   { --tint: var(--tint-dusk); }
.scene-ground { --tint: var(--tint-ground); }

.widget-header h2 {
    color: hsl(270 40% 82%);
    text-shadow: 0 1px 6px hsl(250 60% 5% / 0.8);
}

/* the sky ones are the big friendly ones */
.scene-sky .monitor-site-icon {
    width: 4.8rem;
}
.scene-sky .monitor-site .size-h3 {
    font-size: 2.1rem;
}
.scene-sky .monitor-site-status-icon {
    width: 2.4rem;
    height: 2.4rem;
}

/* Violet's card sits right under Admin, same ground */
.scene-violet .monitor-site-icon {
    filter: none;
    opacity: 1;
}

/* ---- mobile / narrow ---------------------------------------------------------------------- */

/* One page, one column: Glance's bottom nav bar has nothing to switch, so hide it.
   (Column visibility is CSS-only via the checked radio, which stays in the DOM.) */
@media (max-width: 1190px) {
    .mobile-navigation,
    .mobile-navigation-offset {
        display: none;
    }
}

@media (max-width: 550px) {
    body::before {
        right: 8%;
    }
    .scene-sky .monitor-site .size-h3 {
        font-size: 1.8rem;
    }
}
