:root {

       /*##############*/
      /*##  COLORS  ##*/
     /*##############*/
    /* root colors */
    --oklch-h: 0;
    --oklch-c: 0.5;
    --oklch-l: 50%;

    /* implemention of tetradict */
    --hue-offset-1: 0;
    --hue-offset-2: 30;
    --hue-offset-3: 150;
    --hue-offset-4: -150;
    --hue-offset-5: -30;
    /* 5 colors for tetradict + original */
    --hue-primary-1: calc(var(--oklch-h) + var(--hue-offset-1));
    --hue-primary-2: calc(var(--oklch-h) + var(--hue-offset-2));
    --hue-primary-3: calc(var(--oklch-h) + var(--hue-offset-3));
    --hue-primary-4: calc(var(--oklch-h) + var(--hue-offset-4));
    --hue-primary-5: calc(var(--oklch-h) + var(--hue-offset-5));

    /* implemention of my chroma model */
    --chr-multiplier-1: 2;      /* Brigth and atention seeking  */
    --chr-multiplier-2: 1;     /* Text                         */
    --chr-multiplier-3: 0.5;  /* BG + border                  */
    --chr-multiplier-4: 0.2; /* Tint of color                */
    --chr-multiplier-5: 0;  /* grayscale                    */
    /* stages of saturation, also it multiplies
     * - 0 = no saturation
     * - 1 = same
     * - 2 = twice as saturated 
    */
    --chr-primary-1: calc(var(--oklch-c) * var(--chr-multiplier-1));
    --chr-primary-2: calc(var(--oklch-c) * var(--chr-multiplier-2));
    --chr-primary-3: calc(var(--oklch-c) * var(--chr-multiplier-3));
    --chr-primary-4: calc(var(--oklch-c) * var(--chr-multiplier-4));
    --chr-primary-5: calc(var(--oklch-c) * var(--chr-multiplier-5));

    /* implemention of my lightness model */
    --lig-multiplier-1: 2;      /* Pure white    */
    --lig-multiplier-2: 1.8;   /* Pastel brigth */
    --lig-multiplier-3: 1;    /* Direct color  */
    --lig-multiplier-4: 0.2; /* Anti pastel   */
    --lig-multiplier-5: 0;  /* grayscale     */
    /* variation of brigthness*/
    --lig-multiplier-25: 1.5;  /* Brigther      */
    /* stages of saturation, also it multiplies
     * - 0 = no saturation
     * - 1 = same
     * - 2 = twice as saturated 
    */
    --lig-primary-1: calc(var(--oklch-l) * var(--lig-multiplier-1));
    --lig-primary-2: calc(var(--oklch-l) * var(--lig-multiplier-2));
    --lig-primary-3: calc(var(--oklch-l) * var(--lig-multiplier-3));
    --lig-primary-4: calc(var(--oklch-l) * var(--lig-multiplier-4));
    --lig-primary-5: calc(var(--oklch-l) * var(--lig-multiplier-5));
    /* variation of brigthness*/
    --lig-primary-25: calc(var(--oklch-l) * var(--lig-multiplier-25));
       /*##############*/
      /*##  FONTS   ##*/
     /*##############*/
    /* 
     * these are managed by lib/font.js, 
     * and open api provided by widget/fonter.js
    */
    --font-header: "sans-serif";
    --font-paragraph: "sans-serif";
    --font-weird: "sans-serif";

      /*#############*/
     /*## OTHERS  ##*/
    /*#############*/
    --font-size-1: 48pt;
    --font-size-2: 24pt;
    --font-size-3: 28pt;
    --div-border-1: 12px;
    --div-border-2: 6px;
    --div-border-3: 4px;
    --div-padding-1: 20px;
    --div-padding-2: 10px;
    --div-padding-3: 5px;
    --div-margin-1: 50px;
    --div-margin-2: 20px;
    --div-margin-3: 5px;
    --div-round-1: 50%;
    --div-round-2: 999px;
    --div-round-3: 10px;
    --div-gap-1: 50px;
    --div-gap-2: 20px;
    --div-gap-3: 5px;

}

body {
    background-image: url("/static/img/placeholders/missing_texture.png");
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-4) 
        var(--hue-primary-4));
    margin: 0;
    overflow: hidden;
}

* {
/* IE, only works on <img> tags */
  -ms-interpolation-mode: nearest-neighbor;
  /* Firefox */
  image-rendering: crisp-edges;
  /* Chromium + Safari */
  image-rendering: pixelated;
  transition: 0.5s cubic-bezier(.08,.82,.17,1);
}
h1 {
    font-family: var(--font-header);
}
p {
    font-family: var(--font-paragraph);
    margin: 0;
}

.font-header {
    font-family: var(--font-header);
    font-size: var(--font-size-1);
}
.font-paragraph {
    font-family: var(--font-paragraph);
    font-size: var(--font-size-2);
}
.font-weird {
    font-family: var(--font-weird);
    font-size: var(--font-size-3);
}

#TEMP {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 50px;
    padding: 10px;
    max-width: 500px;
    border: 10px groove oklch(
        var(--lig-primary-3) 
        var(--chr-primary-3) 
        var(--hue-primary-3));
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-3) 
        var(--hue-primary-4));
    color: oklch(
        var(--lig-primary-3) 
        var(--chr-primary-2) 
        var(--hue-primary-1));
}
#TEMP--log {
    text-align: left;
    padding: 5px;
    width: 90%;
    margin: 10px 0 ;
    display: flex;
    flex-direction: column;
    border: 10px groove oklch(
        var(--lig-primary-2) 
        var(--chr-primary-2) 
        var(--hue-primary-3));
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-2) 
        var(--hue-primary-4));
    color: oklch(
        var(--lig-primary-2) 
        var(--chr-primary-2) 
        var(--hue-primary-5));
}

#TEMP--log > img {
    width: 32px;
}

#TEMP--log a {
    text-decoration: none;
    color: oklch(
        var(--lig-primary-1) 
        var(--chr-primary-1) 
        var(--hue-primary-1));
}

.background {
    transition: opacity 1s;
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-4) 
        var(--hue-primary-1));
    background-image: url("/static/img/placeholders/missing_texture.png");
    background-position: 0% 0%;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0; 
    animation-name: scrollz;
    animation-duration: 120s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    opacity: 1;
}
@keyframes scrollz {
    from {background-position: 0px 0px;}
    to {background-position: 3200px 640px;}
}
.bg_init2 {
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events:none;
}
.bg_init {
    width: 100vw;
    height: 0vh;
    opacity: 1;
}
.background-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 70%,rgba(0,0,0,1) 100%);
}

.middleground {
    transition: opacity 1s;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    right: 0; 
    opacity: 1;
}
.mg_init2 {
    width: 100vw;
    height: 100vh;
    background-color: #fff;
    pointer-events:none;
    opacity: 0;
}
.mg_init {
    width: 0vw;
    height: 100vh;
    background-color: #fff;
    opacity: 1;
}

.mg_name {
    transition: 1s cubic-bezier(1,0,0,1);
    position: absolute;
    max-width: 100vw;
    color: oklch(
        var(--lig-primary-1)
        var(--chr-primary-1) 
        var(--hue-primary-1));
    width: 500px;
    min-width: 300px;
    min-height: 30px;
    padding: 10px;
    border: inset 10px oklch(
        var(--lig-primary-1) 
        var(--chr-primary-1) 
        var(--hue-primary-2));
    bottom: 5px;
    left: 5px;
    border-radius: 0 0 50px 0;
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-2) 
        var(--hue-primary-3));
    font-size: 4rem;
}
.mg_name--hide {
    left: calc((20px + 20px + 500px) * -1);
}
.mg_body {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: auto;
}
.mg_host {
    position: relative;
    text-align: center;
    cursor: clickable;
}
.mg_host > p {
    width: 100%;
    height: 100%;
    align-items: center;
    align-content: center;
}
.mg_floating {
    width: fit-content;
    min-width: 350px;
    width: fit-content;
    max-width: 900.8px;
    position: absolute;
    top: 0;
    left: 0;
    height: fit-content;
    z-index: 1;
}
.mg_floating_handle {
    margin-bottom: var(--div-margin-3);
    border-radius: var(--div-round-3) var(--div-round-3) 0 0;
    padding: var(--div-padding-1) var(--div-padding-2);
    display: flex;
    width: 100%;
    max-width: calc(100% - var(--div-padding-2) * 2 - var(--div-border-3) * 2);
    align-items: baseline;
    justify-content: space-between;
    min-width: 300px;
    cursor: move;
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-4) 
        var(--hue-primary-3));
    border: groove var(--div-border-3) oklch(
        var(--lig-primary-3)
        var(--chr-primary-4)
        var(--hue-primary-2));
    color: oklch(
        var(--lig-primary-3)
        var(--chr-primary-3)
        var(--hue-primary-1));
}
.mg_floating_handle-h {
    height: 0;
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 0;
    border-top: 0;
    border-bottom: 0;
}
.mg_floating_button {
    padding: var(--div-padding-3);
    border-radius: var(--div-round-3);
    background-color: oklch(
        var(--lig-primary-4) 
        var(--chr-primary-3) 
        var(--hue-primary-3));
    border: groove var(--div-border-3) oklch(
        var(--lig-primary-3)
        var(--chr-primary-4)
        var(--hue-primary-3));
    color: oklch(
        var(--lig-primary-2)
        var(--chr-primary-3)
        var(--hue-primary-3));
}
.mg_floating_button:hover {
    background-color: oklch(
        var(--lig-primary-3) 
        var(--chr-primary-3) 
        var(--hue-primary-2));
    border: groove var(--div-border-3) oklch(
        var(--lig-primary-2)
        var(--chr-primary-4)
        var(--hue-primary-2));
    color: oklch(
        var(--lig-primary-1)
        var(--chr-primary-3)
        var(--hue-primary-2));
}
.mg_floating_handle > * {
    display: flex;
    align-items: baseline;
    gap: var(--div-gap-3);
    touch-action: none; 
    user-select: none;
}
.mg_floating_first {
    margin-top: 0;
}
.mg_floating_holder{
    display: grid;
    grid-template-rows: 0fr;
    width: fit-content;
    background-color: oklch(
        var(--lig-primary-5) 
        var(--chr-primary-5) 
        var(--hue-primary-5));
    border: groove var(--div-border-3) oklch(
        var(--lig-primary-2)
        var(--chr-primary-4)
        var(--hue-primary-2));
    color: oklch(
        var(--lig-primary-1)
        var(--chr-primary-3)
        var(--hue-primary-2));
}
.mg_floating_holder.open {
  grid-template-rows: 1fr;
}
.mg_floating_holder:not(.open) {
    height: 0;
    /* height: calc(var(--div-margin-3) + var(--div-padding-1) * 2 + var(--div-border-3) * 2); */
}
.mg_floating_holder:not(.open) * {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    min-height: 0;
}

.view_item{
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border-width: 0;
}

.clickable {
    cursor: pointer;
}
