@import url(./explanation_container.css);
@import url(./button_container.css);
@import url(./key-container.css);
@import url(./drum-grid.css);
@import url(./on_off_transitions.css);
@import url(./loader.css);
/* @import url(./loader.css); */

/* @import url('https://fonts.googleapis.com/css2?family=Rock+Salt&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rock+Salt&display=swap'); */

html {
    /* border box fix */
    box-sizing: border-box;

    font-family: 'JetBrains Mono', monospace;
    /* font-family: 'Rock Salt', cursive; */

    cursor: default;
}

*, *:before, *:after {
    box-sizing: inherit;
    margin: 0;
    padding: 0;
}

body{
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    
    /* VARIABLES
    ----------------------------------------------------------------*/
    /*--- DIMENSIONS ---*/
    --depth: 5vh;

    /* keys: width and height */
    --k-w: calc(2/22*100vw);
    --k-h: calc(2/20*100vh);

    /* buttons: width and height */
    --b-w: calc(2/22*100vw - 1vh);
    --b-h: calc(2/20*100vh - 1vh);

    /* cell-bars: width and height */
    --cb-w: calc(1/22*100vw);
    --cb-h: calc(1/20*100vh);

    --color-text-black: rgb(9, 9, 11, 0.9);
    
    --color-text-black: rgb(9, 9, 11, 0.8);

    --color-white-text: hsl(0, 0%, 99%);

    --color-drawboard-bg: rgb(54, 57, 69);

    --color-hole1: #BABDC9;
    --color-hole1: rgb(186, 189, 201);
    --color-hole1: hsl(228, 12%, 70%);
    --color-hole2: #24262E;
    --color-hole2: rgba(36, 38, 46, 0.701);

    --color-fill-off: #24262E;
    --color-fill-off: #36394542;
    --color-fill-off: rgb(10, 10, 12, 0.5);

    overflow: hidden;
}



/* BACKGROUND
------------------------------------------------------------------------
*/
.background-wrapper {
    position: absolute;
    width: 100vw;
    height: 100vh;
    left: 0;
    top: 0;
}

.grid-line-container{
    display: grid;
    position: absolute;
    height: 100%;
    width: 100%;
    filter: opacity(20%);
}
.grid-line-container.column {
    grid-template-columns: repeat(22, 1fr);
    grid-template-rows: auto;
}
.grid-line-container.row {
    grid-template-rows: repeat(20, 1fr);
    grid-template-columns: auto;
}

.grid-line{
    /* FIXA */
    position: relative;
    border-color: var(--c-g3); 
    border-width: 1px;
    border-style: dashed;
}

.column .grid-line {
    grid-column: 1fr;
    grid-row: 1 / -1;
}

.row .grid-line {
    grid-column: 1 / -1;
    grid-row: 1fr;
}

.column b:nth-child(23),
.column b:nth-child(24) {
    display: hidden;
    position: absolute;
}


/* GLOBAL
------------------------------------------------------------------------
*/
.side {
    width: 100%;
    height: 100%;
    position:absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    --webkit-backface-visibility: hidden;
}



/* MAIN
------------------------------------------------------------------------
*/
main {
    position: absolute; 
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;

    display: grid;
    grid-template-columns: repeat(22, 1fr);
    grid-template-rows: repeat(20, 1fr);

    perspective: 1500px;
    transform-style: preserve-3d;

    background: rgb(255, 255, 255,0.2);
    
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
}

/* HEADER
------------------------------------------------------------------------
*/

/* header {
    grid-row: 1/2;
    grid-column: 4/-4;
    display: flex;
    align-items: flex-end;
    position: absolute;
    width: 100%;
    height: 100%;
} */
header {
    grid-row: 1/2;
    grid-column: 4/-4;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    position: absolute;
    width: 100%;
    height: 100%;
}

.title-container {
    display: flex;
}

a {
    color: var(--color-ink);
    text-decoration: none;
    line-height: 100%;
}

a:hover {
    color: rgb(180,0,0);
}

/* DRAW BOARD
------------------------------------------------------------------------
*/
.draw-board-wrapper {
    transform-style: preserve-3d;
    box-sizing: content-box;

    grid-row: 3/8;
    grid-column: 3/-3;

    min-height: 100%;
}

.draw-board{
    box-sizing: border-box;

    position: relative;

    display: grid;
    grid-template-columns: repeat(18, 1fr);
    grid-template-rows: 1fr;
    padding: 1px;
    padding-right: 2px;
    grid-gap: 1px;

    transform-style: preserve-3d;
    
    min-height: 100%;
}

.draw-board::before {
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    top:0;
    left:0;
}

.draw-board > div{
    position: relative;
    grid-row: span 1;
    grid-column: span 1;

    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 1fr);

    max-height: 100%;
    min-height: 100%;

    width: 100%;

    grid-gap: 1px;
}

/* BOARD CONTAINER
------------------------------------------------------------------------
*/
.draw-board > div.board-container{
    grid-template-rows: repeat(1, 1fr);
    justify-items: center;
    padding-right: 0;
}

/* "DRUM GRID" right border */
.board-container::after {
    position: absolute;
    content: '';
    height: 100%;
    width: 100%;
    left: 0;
    right: 0;
    border-right: 3px solid var(--color-border);
}

/* "DRUM GRID" right border */
.board {
    grid-row: span 1;
    font-weight: 900;
    writing-mode: vertical-rl;
    text-orientation: upright;
    text-align: center;

    font-size: 1rem;
}

/* channels text */
.channels div {
    font-size: 0.9rem;
    padding: 0.1rem 0.3rem;
}


/* CELL COLUMNS
------------------------------------------------------------------------
*/
.cell-column {
    transform-style: preserve-3d;
    justify-items: center;
    align-items: center;

    position: relative;
    transform-origin: bottom;
}

/* contains measure nad beat */
.counter {
    transform-style: preserve-3d;
    position: absolute;
    grid-column: span 1;
    grid-row: 1 / 2;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: flex-end;
}

.measure {
    position: relative;

    font-size: 1.8rem;
    margin-top: auto;
}

.measure::after {
    position: absolute;
    grid-column: span 1;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;

    font-size: 1.8rem;
    margin-top: auto;
}

.beat {
    font-size: 1rem;
}

/* CELLS
------------------------------------------------------------------------
*/
.cell {
    transform-style: preserve-3d;

    grid-column: span 1;
    width: 100%;
    height: 100%;

    border-radius: var(--radius-cell);
    border: var(--b-width-medium) solid var(--color-border); 
}

.cell::before, .cell::after{
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;

    border-radius: var(--radius-cell);
}

.cell .side {
    transform-style: preserve-3d;
    border-radius: var(--radius-cell-inner);
}

.cell[data-channel="kick"]{
    grid-row: 2 / 3;
}
.cell[data-channel="snare"]{
    grid-row: 3 / 4;
}
.cell[data-channel="clap"]{
    grid-row: 4 / 5;
}
.cell[data-channel="hihat"]{
    grid-row: 5 / 6;
}

/* KEYBOARD
------------------------------------------------------------------------
*/
.keyboard-wrapper {
    transform-style: preserve-3d;
    grid-column: 2/-2;
    grid-row: 10 /20;
    /* max-width: 100%; */

    /* min-width: 50vw;
    max-width: calc(18vw/20vw); */
}

.keyboard {
    transform-style: preserve-3d;
    position: relative;

    width: 100%;
    height: 100%;

    display: grid; 
    /* grid-template-columns: repeat(20, 1fr); */
    grid-template-rows: repeat(10, 1fr);
    grid-gap: 0px;

    border-radius: var(--radius-button-inner);

    user-select: none;
}


/* BUTTONS
------------------------------------------------------------------------
*/
.button-container {
    transform-style: preserve-3d;

    grid-row: 1 / 4;
    height: 100%;
    width: 100%;

    display: grid;
    grid-template-columns: repeat(20, 1fr);
    grid-template-rows: 1fr;

    justify-items: auto;

    /* ? */
    align-items: stretch;

}


.control {
    transform-style: preserve-3d;
    position: relative;

    grid-row: span 1;

    display: grid;
    grid-template-rows: repeat(3, 1fr);
    justify-items: center;
    align-items: center;
}

.control-wrapper {
    transform-style: preserve-3d;
    grid-column: 10/ 14;
    
    display: grid;
    grid-template-rows: repeat(3, 1fr);
}

.control-title {
    grid-column: 1/-1;
    grid-row: span 1;
    
    text-align: center;

    font-size: 1rem;
}

.button-wrapper {
    transform-style: preserve-3d;
    position: relative;
    grid-row: 1/2;
    grid-column: 2/3;
    width: 100%;
    height: 100%;

    display: grid;
    grid-template-columns: 1fr 1fr;
}


.button {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    --webkit-backface-visibility: hidden;

    position: relative;
    width: 100%;
    height: 100%;
    grid-row: 1/3;
    grid-column: span 1;

    padding: 0.5vh;
    border-radius: var(--radius-button);
}

.button-wrapper .button {
    grid-column: span 1;
}

.button::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;

    box-sizing: content-box;

    top: calc(-1*var(--b-width-medium));
    left: calc(-1*var(--b-width-medium));
    
    border-radius: var(--radius-button);
    border: var(--b-width-medium) solid var(--color-border);
}


.button .side {
    transform-style: preserve-3d;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    grid-template-rows: 1fr 2fr 1fr;

    align-items: center;
    justify-items: center;

    border-radius: var(--radius-button-inner);
}

.button .side::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    border-radius: var(--radius-button-inner);
}

.key-char {
    padding: 0.2rem 0 0 0.2rem;
    text-align: left;
    justify-self: left;
    grid-row: 1/2;
    grid-column: 1/-1;

    font-size: 0.8rem;
}

.symbol {
    grid-row: 2/3;
    text-align: center;
    justify-self:center;
    grid-column: 1/-1;

    font-size: 1rem;
}

/* octave
----------------------------------------*/
.control[data-control="octave"]{
    grid-column: 1 / 5; 
    grid-template-columns: 1fr 1fr;
}

.button[data-control="octave"][data-button="down"] {
    grid-column: 1/2;
}
.button[data-control="octave"][data-button="up"] {
    grid-column: 2/3;
}

/* play-state
----------------------------------------*/
.control[data-control="play-state"]{
    grid-column: 6 / 10; 
    grid-template-columns: 1fr 1fr;
}

.button[data-control="play-state"][data-button="toggle-play"] {
    grid-column: 1/2;
}

.button[data-control="play-state"][data-button="stop"] {
    grid-column: 2/3;
}

/* instrument, tempo
----------------------------------------*/
.control[data-control="instrument"],
.control[data-control="tempo"] {
    grid-template-rows: 1fr;
    grid-template-columns: repeat(2, 1fr);
}

.control[data-control="instrument"] {
    grid-row-start: 1/2;
}
.control[data-control="tempo"] {
    grid-row-start: 2/3;
}

[data-control="instrument"] .control-title,
[data-control="tempo"] .control-title {
    padding: 0.5rem;
    width: 100%;

    grid-column: 1/2;
    text-align: right;
}

[data-control="instrument"] .button-wrapper::before,
[data-control="tempo"] .button-wrapper::before{
    content: '';
    width: 100%;
    height:100%;
    position: absolute;

    box-sizing: content-box;

    top: calc(-1*var(--b-width-medium));
    left: calc(-1*var(--b-width-medium));
    
    border-radius: var(--radius-button);
    border: var(--b-width-medium) solid var(--color-border);

    border-top: var(--b-width-medium) solid transparent;
}

[data-control="instrument"] .button::before,
[data-control="tempo"] .button::before {
    top: calc(-1*var(--b-width-small));
    left: calc(-1*var(--b-width-small));

    border: none;
    border-radius: var(--radius-cell);

    border-left: var(--b-width-small) solid var(--color-border);
}


[data-control="instrument"] .button .side,
[data-control="tempo"] .button .side {
    display: flex;
    justify-content: center;
    align-items: center;
}


/* display
----------------------------------------*/
.control[data-control="display"]{
    grid-column: 14 / 18; 
    grid-template-columns: repeat(4, 1fr);
    justify-content: center;
}

.display {
    transform-style: preserve-3d;
    position: relative;
    grid-row: 1/3;
    grid-column: 1/-1;
    width: 100%;
    height: 100%;
}

.display::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    box-sizing: content-box;

    border-radius: var(--radius-button);
    border: var(--b-width-medium) solid var(--color-border);

    top: calc(-1*var(--b-width-medium));
    left: calc(-1*var(--b-width-medium));

    border-left: none;
}


.display>.side {
    transform-style: preserve-3d;
    height: 100%;
    padding: 0.5vh;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.display .side::before, .display .side::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }


/* display text */
.display .side p {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-size: 0.8rem;
}

.display p::after{
    content: '';
    grid-column: 2/3;
}




/* on-off: button
----------------------------------------*/
.control-wrapper[data-control="on-off"] {
    grid-column: -3/-1;
}

.control[data-control="on-off"] {
    grid-row: 1/-1;

    grid-template-columns: 1fr 1fr;
    grid-template-rows: repeat(3, 1fr);
}

.button[data-control="on-off"][data-button="on-off"] {
    grid-column: 1/2;
    width: 3.5vw;
    height: 3.5vw;
    border-radius: 50%;
    justify-self: center;
    align-self: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.button[data-button="on-off"]::before {
    border-radius: 50%;
}

.button[data-button="on-off"] .side {
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* on off text */
[data-button="on-off"] .symbol {
    font-size: 2rem;
}

/* on-off: light
----------------------------------------*/
.light {
    transform-style: preserve-3d;

    grid-column: 2/3;
    grid-row: 1/3;
    position: absolute; 
    width: 1.5vw;
    height: 1.5vw;

    border-radius: 50%;

    border: var(--b-width-medium) solid var(--color-border);
}

.light::before, .light::after {
    content: "";
    border-radius: 50%;
    position: absolute;
    width: 100%;
    height: 100%;
}





/*
----------------------------------------------------------------
        KEYS
----------------------------------------------------------------
*/



/**********/
/**********/
/**********/
/* BORDER STUFF */
body{
    /* border dimensions */

    /* border radius */
    --radius-cell: 0.15rem;
    --radius-cell-inner: 0.1rem;
    
    --radius-button: 0.2rem;
    --radius-button-inner: 0.1rem;
    
    --radius-keys: 0.5rem;
    --radius-keys-inner: 0.3rem;

    
    --radius-large: 0.2rem;

    /* border thickness */
    --b-width-large: 3px;
    --b-width-medium: 2px;
    --b-width-small: 1px;

    /*--- COLOR ---*/

    /* raisin black dark */
    --color-border: rgba(27, 28, 34, 0.8);
    
    /* rich black fogra */
    --color-border: rgba(9, 9, 1, 0.6);
 
    /* eerie black */
    --color-border: rgba(18, 19, 23, 0.5);

    /* eerie black */
    /* --color-ink: hsla(228, 12%, 8%, 0.8); */
    --color-ink: #121317cc;
    

    --color-charcoal: rgb(20, 26, 31, 0.2);
    --color-charcoal: rgb(54, 69, 79);
    --color-charcoal: rgb(41, 53, 61);
    --color-charcoal: rgb(21, 26, 30);
    
    /* Används av key-side */ 
    --c-w4: hsl(48, 20%, 98%);
    
    /* Används av button-side */ 
    --c-w5: hsl(48, 20%, 98%);

    --c-w6: rgb(250, 255, 245);  /*light ivory*/

    /* color for black keys */
    --color-key-black: rgb(35, 35, 35);

    --color-cell-black: rgb(51, 51, 55);

    /* color green light */
    --c-gr1: rgb(132, 251, 13);
    --c-gr2: rgba(132, 251, 13, 0.4);

    color: var(--color-ink);
}

.keyboard-wrapper::before,
.draw-board-wrapper::before {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    box-sizing: content-box;
    
    top: calc(-1*var(--b-width-large));
    left: calc(-1*var(--b-width-large));
    
    border-radius: var(--radius-large);
    border: var(--b-width-large) solid var(--color-border);
}

/* sets pencilfilter on borders */
.keyboard-wrapper::before,
.draw-board-wrapper::before,
.button::before,
[data-control="instrument"] .button-wrapper::before,
[data-control="tempo"] .button-wrapper::before,
[data-control="instrument"] .button::before,
[data-control="tempo"] .button::before, 
.display::before,
header,
.board-container::after {
    filter: url(#pencilTexture6);
}


/* header border */
header {
    border-bottom: 0.2rem solid var(--color-border);
}





/*
TEXT
*/

/* header>.title {
    font-size: 2rem;
} */
header{
    font-family: 'Rock Salt', cursive;
}

h1 {
    font-size: 1.2rem;
    line-height: 160%;
}

.sketch-text{
    position: relative;
    margin-left: 2rem;
}

.sketch-text h1 {
    /* padding-left: 2rem; */
    font-size: 1.4rem;
}

.sketch-text div {
    position: absolute;
    width: 110%;
    height: 100%;
    top: 0.2rem;
    left: -0.2rem;
    background-image: url(../svg/cross-over_2.svg);
    filter: url(#pencilTexture3);

}

h2 {
    font-size: 1rem;
    line-height: 200%;
    padding: 0;
    margin: 0 1rem 0 3rem;

}

header > h1 {
    align-self: flex-end;
}





/* .keyboard::before{
    content:'';
    position: absolute;
    width: 100%;
    height: 100%;
    left: -3px;
    top: -3px;
    box-sizing: content-box;
    border: 3px solid var(--color-border);

    border-radius: var(--radius-button-inner);

    filter: url(#pencilTexture6);
} */




/* 
 - 768: "view on full screen"

768 - 1024: 1- col

1024 - 1200: Mindre font 

i280x800: mac standard

1200 - 1400: Optimal

1600 - : 1+ col



*/
.mobile-text-container {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: red;
    display: none;
    z-index: 150;
}

.mobile-text-container .grid-line-container {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
}

.mobile-text-container .grid-line-container.column {
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: auto;
}
.mobile-text-container .grid-line-container.row {
    grid-template-rows: repeat(12, 1fr);
    grid-template-columns: auto;

}

.mobile-text-container .grid-line-container .grid-line {
        position: relative;
        border-color: var(--c-g3); 
    border-width: 1px;
    border-style: dashed;    
}

@media screen and (max-width:767px){
    .background-wrapper,
    main,
    .loader-container {
        display: none;
    }

    .mobile-text-container {
        position: fixed;
        background: red;
        background: transparent;

        display: grid;
        grid-template-rows: repeat(12, 1fr);
        grid-template-columns: repeat(8, 1fr);
    }

    .mobile-text-container > p{
        text-align: center;
        font-size: 2rem;
        font-family: 'Rock Salt', cursive;
        filter: url(#pencilTexture6);
        display: flex;
        align-items: center;
        justify-content: center;
    }


    p.box-1 {
        grid-row: 4/5;
        grid-column: 1/-1;
    }
    p.box-2 {
        grid-row: 5/6;
        grid-column: 1/-1;
        font-size: 1.5rem;
        border-bottom: 2px solid var(--color-ink);
    }

    p.box-3 {
        grid-row: 7/8;
        grid-column: 1/-1;
        font-size: 1.6rem;
    }
    main{
        z-index: -50;
        display: none;
    }
}

@media screen and (max-width:439px){
    p.box-1 {
        font-size: 1.8rem;
    }
    p.box-2 {
        font-size: 1.5rem;
    }
    p.box-3 {
        font-size: 1.2rem;
    }
}

@media screen and (min-width:768px){
    html {
        font-size: 14px;
    }
    .control-title {
        font-size: 0.9rem;
    }




    .control-title {
        font-size: 0.7rem;
    }

    .keyboard-wrapper::before,
    .draw-board-wrapper::before {
        top: calc(-1*var(--b-width-medium));
        left: calc(-1*var(--b-width-medium));
        border-width: var(--b-width-medium);
    }


    [data-button="on-off"] .symbol {
        font-size: 1.5rem
    }
    .display .side p {
        font-size: 0.7rem;
    }


}

@media screen and (min-width:1024px){

    html {
        font-size: 14px;
    }
    .control-title {
        font-size: 0.9rem;
    }

    html {
        font-size: 16px;
    }

    .control-title {
        font-size: 0.9rem;
    }

    .button[data-control="on-off"][data-button="on-off"]{
        width: 3vw;
        height: 3vw;
    }
}

@media screen and (min-width:1400px){

    html {
        font-size: 18px;
    }

    .grid-line-container.column {
        grid-template-columns: repeat(24, 1fr);
    }
    
    .grid-line-container.row{
        grid-template-rows: repeat(20, 1fr);
    }

    .column b:nth-child(23),
    .column b:nth-child(24) {
        display: block;
        position: relative;
    }

    main {
        grid-template-columns: repeat(24, 1fr);
        grid-template-rows: repeat(20, 1fr);
    }

    .draw-board-wrapper {
        grid-column: 4/-4;
    }

    .keyboard-wrapper {
        grid-column: 3/-3;
    }

    .button[data-control="on-off"][data-button="on-off"]{
        width: 2.5vw;
        height: 2.5vw;
    }

}

@media screen and (min-width:1400px){
    .loader-animation{
        top: -100px;
    }

}

@media screen and (max-height: 850px){
    .board.drums{
        font-size: 0.9rem;
    }    
}

@media screen and (max-height: 760px){
    .board.drums{
        font-size: 0.8rem;
    }
    .control-title {
        font-size: 0.8rem;
    }

    .key-char {
        font-size: 0.7rem;
    }
    .explanation-container div {
        font-size: 0.8rem;
    }
}

@media screen and (max-height: 600px){
    .board.drums{
        font-size: 0.7rem;
    }
    .control-title {
        font-size: 0.7rem;
    }

}