/*********************************************************************
 * Styling of the Analog clock
 * 
 * @author (Anyanwu Benedict Chuwkwuemeka)
 * @version 0.01
*********************************************************************/

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--bcg-handle) var(--bcg-trpnt);
}

html:root
{
    --bcg-base: #38776d;
    --bcg-bright: #ffffff;
    --bcg-handle: #cdcdcdcd;
    --bcg-shade: #77777777;
    --bcg-trpnt: #00000000;
    --bcg-white: #eafff0;
    --font-clr-heavy: #ffffff;
    --font-clr-mid: #cccccc;
    --font-shadow: #77777733;
    --transition-flow: 250ms;
    --transition-delay: 100ms;
    --const_size: 25rem;
    --clock_ctr: 1.25rem;
    --clock_hand_w: 0.625rem;
    --clock_hand_rad: 0.625rem;
}

html
{
    background-color: var(--bcg-base);
    -moz-user-select: -moz-none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    scroll-behavior: smooth;
}

body
{
    font-family: 'Poppins', sans-serif;
    min-height: 100svh;
    min-height: 100vh;
    background-color: var(--bcg-base);
}

@supports(-webkit-tap-highlight-color: var(--bcg-trpnt))
{
    body
    {
        -webkit-tap-highlight-color: var(--bcg-trpnt);
    }
}



.scope
{
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 4rem 1rem;
}

.clock-base
{
    width: var(--const_size);
    height: var(--const_size);
}

.clock-bdr
{
    position: relative;
    width: inherit;
    height: inherit;
    border-radius: 50%;
    box-shadow: 0 0 0 0.125rem var(--bcg-white);
}

.clock-bdr::after
{
    content: '';
    position: absolute;
    top: calc((50% - (var(--clock_ctr) / 2)));
    left: calc((50% - (var(--clock_ctr) / 2)));
    width: var(--clock_ctr);
    height: var(--clock_ctr);
    border-radius: 50%;
    background-color: var(--bcg-white);
    z-index: 15;
}

.hour-hand-bdr
{
    position: absolute;
    top: 20%;
    left: calc((50% - (var(--clock_hand_w) / 2)));
    width: var(--clock_hand_w);
    height: 60%;
    z-index: 12;
}

.hour-hand-box
{
    position: relative;
    width: 100%;
    height: 50%;
    border-top-left-radius: var(--clock_hand_rad);
    border-top-right-radius: var(--clock_hand_rad);
    background-color: var(--bcg-white);
}

.minute-hand-bdr
{
    position: absolute;
    top: 10%;
    left: calc((50% - (var(--clock_hand_w) / 2)));
    width: var(--clock_hand_w);
    height: 80%;
    z-index: 6;
}

.minute-hand-box
{
    position: relative;
    width: 100%;
    height: 50%;
    border-top-left-radius: var(--clock_hand_rad);
    border-top-right-radius: var(--clock_hand_rad);
    background-color: var(--bcg-white);
}

.seconds-hand-bdr
{
    --clock_hand_sec: calc((var(--clock_hand_w) * 0.5));
    position: absolute;
    top: 2%;
    left: calc((50% - (var(--clock_hand_sec) / 2)));
    width: var(--clock_hand_sec);
    height: 96%;
    z-index: 3;
}

.seconds-hand-box
{
    position: relative;
    width: 100%;
    height: 50%;
    border-top-left-radius: var(--clock_hand_rad);
    border-top-right-radius: var(--clock_hand_rad);
    background-color: #b91900;
}




/************************************************************
 * Clock Face Styles
 * 
 * Clock-style: The overall styling of the clock. 
 * Changing this changes the style of the entire clock face
 * 
 * Clock Stamp: The points across the clocks circumference that reference time
 * rank 0 => All minute hands except the hour hands (1-12)
 * rank 1 => All hour hands (1-12)
 * rank 2 => All hour hands except cardinal points (1,2,4,5,7,8,10,11)
 * rank 3 => The four cardinal points (hour hands) (3, 6, 9, 12)
 * 
 *************************************************************/
 
[clock-style="default"]
{
    --base_w: 0.125rem;
    --base_h: 0.125rem;
    --r1_w_scale: 25%;
    --r1_h_scale: 50%;
}

[clock-style="default"] .clock-stamp
{
    width: var(--base_w);
    height: var(--base_h);
    background-color: #000000;
}

[clock-style="default"] .clock-stamp[rank="1"],
[clock-style="default"] .clock-stamp[rank="2"]
{
    width: calc((var(--base_w) + (var(--base_w) * var(--r1_w_scale))));
    width: calc((var(--base_w) + (var(--base_w) * var(--r1_h_scale))));
}





@media only screen and (max-width: 30.3125rem)
{
    html:root
    {
        --const_size: 17.5rem;
    }
}



