@font-face {
    font-family: 'Compagnon';
    src: url('fonts/Compagnon-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Compagnon';
    src: url('fonts/Compagnon-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Compagnon';
    src: url('fonts/Compagnon-Roman.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Velvelyne';
    src: url('fonts/Velvelyne-Regular.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Velvelyne';
    src: url('fonts/Velvelyne-Book.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Velvelyne';
    src: url('fonts/Velvelyne-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Velvelyne';
    src: url('fonts/Velvelyne-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PlacardKS';
    src: url('fonts/PlacardKS-Regular.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}


:root {
    --font-body: 'Velvelyne', sans-serif;
    --font-title: 'Compagnon', monospace;
    --line-height-body: 1.5;
    --line-height-title: 1.2;
    --color-bl: #4489EA;
    --color-gr: #C9FF34;
    --color-lg: #D9D9D9;
    --color-pk: #FF71E3;
    --color-br: #AF8F67;
    --color-dg: #949494;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}

::-webkit-scrollbar {
    width: 15px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-bl);
}

::-webkit-scrollbar-thumb:hover {
    background: #65a2f8;
}

html {
    font-size: 22px;
}

body {
    margin: 0;
    width: 100%;
    height: 100vh;
    font-family: var(--font-body);
    font-weight: 400;
    line-height: var(--line-height-body);
    font-size: 1rem;
    text-wrap: pretty;
    display: grid;
    grid-template-columns: 100vh 1fr;
    grid-template-rows: 100vh;
    gap: 0px;
}

main#library {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    width: 100vh;
    height: 100vh;
    position: relative;
    transform-origin: center;
}

div.storage {
    width: calc(100vh - 100vh / 13 * 2);
    height: calc(100vh / 13 * 2);
    position: absolute;
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0px;
}

#deg_0 {
    transform: rotate(0deg);
    left: calc(100vh / 13);
}

#deg_90 {
    transform: rotate(90deg) translateY(-50vh);
    right: calc(100vh / 13 * 2);
    top: calc(50% - 100vh / 13);
}

#deg_180 {
    transform: rotate(180deg);
    left: calc(100vh / 13);
    bottom: 0;
}

#deg_270 {
    transform: rotate(270deg) translateY(-50vh);
    left: calc(100vh / 13 * 2);
    top: calc(50% - 100vh / 13);
}

.entry {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: calc(100vh / 13);
    padding: 0 1rem;
    font-weight: 500;
    font-size: clamp(0.8rem, 2vh, 0.9rem);
    text-align: center;
    text-decoration: none;
    color: black;
}

.entry:not(#en-2-1):not(#en-3-1):not(#en-4-1) {
    cursor: pointer;
}

.entry:not(#en-2-1):not(#en-3-1):not(#en-4-1):hover {
    border: black 1.5px solid;
}

.entry div {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* limit to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: var(--line-height-title);
    max-height: calc(1.2rem * 2);
}

div.brick {
    background: var(--color-lg);
}

#en-1-1 {
    grid-column: span 4 / span 4;
    background: var(--color-bl);
}

#en-1-2 {
    grid-column: span 4 / span 4;
    grid-column-start: 8;
    background: var(--color-bl);
}

#en-1-3 {
    grid-column: span 4 / span 4;
    grid-column-start: 3;
    grid-row-start: 2;
    background: var(--color-pk);
}

#brk-1-1 {
    grid-column: span 3 / span 3;
    grid-column-start: 5;
    grid-row-start: 1;
}


#brk-1-2 {
    grid-column: span 3 / span 3;
    grid-column-start: 8;
    grid-row-start: 2;
}

#brk-1-3 {
    grid-column: span 3 / span 3;
    grid-column-start: 9;
    grid-row-start: 2;
}

#en-2-1 {
    grid-column: span 4 / span 4;
    background: var(--color-dg);
}

#en-2-2 {
    grid-column: span 4 / span 4;
    grid-column-start: 5;
    background: var(--color-bl);
}

#en-2-3 {
    grid-column: span 4 / span 4;
    grid-column-start: 2;
    grid-row-start: 2;
    background: var(--color-br);
}

#en-2-4 {
    grid-column: span 4 / span 4;
    grid-column-start: 7;
    grid-row-start: 2;
    background: var(--color-gr);
}

#brk-2-1 {
    grid-column: span 3 / span 3;
    grid-column-start: 9;
}

#en-3-1 {
    grid-column: span 4 / span 4;
    background: var(--color-dg);
}

#en-3-2 {
    grid-column: span 4 / span 4;
    grid-column-start: 8;
    grid-row-start: 1;
    background: var(--color-bl);
}

#en-3-3 {
    grid-column: span 4 / span 4;
    grid-column-start: 3;
    grid-row-start: 2;
    background: var(--color-pk);
}

#brk-3-1 {
    grid-column: span 3 / span 3;
    grid-column-start: 5;
    grid-row-start: 1;
}

#brk-3-2 {
    grid-column: span 3 / span 3;
    grid-column-start: 8;
    grid-row-start: 2;
}

#en-4-1 {
    grid-column: span 4 / span 4;
    background: var(--color-dg);
}

#en-4-2 {
    grid-column: span 4 / span 4;
    grid-column-start: 8;
    grid-row-start: 1;
    background: var(--color-gr);
}

#en-4-3 {
    grid-column: span 4 / span 4;
    grid-column-start: 2;
    grid-row-start: 2;
    background: var(--color-br);
}

#en-4-4 {
    grid-column: span 4 / span 4;
    grid-column-start: 7;
    grid-row-start: 2;
    background: var(--color-bl);
}

#brk-4-1 {
    grid-column: span 3 / span 3;
    grid-column-start: 5;
    grid-row-start: 1;
}

#hover-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    left: calc(100vh / 13 * 2);
    top: calc(100vh / 13 * 3.5);
    width: calc(100vh / 13 * 9);
    height: calc(100vh / 13 * 7.5);
    padding: calc(100vh / 26);
    z-index: 10;
    gap: 1rem;
    overflow: visible;
}

.quote,
.q-text {
    width: 100%;
    max-width: 500px;
    text-align: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
    text-overflow: ellipsis;
    display: none;
}

.quote {
    font-family: var(--font-title);
    line-height: var(--line-height-title);
    font-size: clamp(0.8rem, 3.5vh, 1.5rem);
    font-weight: 500;
    flex-shrink: 0;
}

.q-text {
    font-family: var(--font-body);
    color: var(--color-dg);
    font-size: clamp(0.8rem, 2.5vh, 1rem);
    line-height: var(--line-height-body);
}

.quote.visible,
.q-text.visible {
    opacity: 1;
}

.collage {
    width: 100%;
    height: 100%;
    z-index: 15;
    position: relative;
    overflow: visible;
}

#collage img {
    position: absolute;
    max-height: 40vh;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    cursor: grab;
    filter: drop-shadow(0 0 2px #2828288d);

}


/* ------------------ aside ------------------ */

aside {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    grid-template-rows: repeat(2, 1fr);
    overflow-x: hidden;
}

.top {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    height: calc(100vh / 13 * 5);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.top:hover #home {
    transform: scale(1.1);
}

#home {
    display: flex;
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    justify-content: flex-start;
    padding: 1.5rem 2rem;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    touch-action: none;
    user-select: none;
    font-kerning: normal;
    background: var(--color-pk);
    transition: transform 500ms ease-in-out;
}

#home h3 {
    font-family: var(--font-title);
    line-height: var(--line-height-title);
    font-weight: 500;
    font-size: clamp(1rem, 3.5vw, 4rem);
    margin-bottom: -1rem;
    padding-bottom: 1rem;
}

.letter {
    transition: transform 0.2s cubic-bezier(0.5, 1, 0.89, 1);
    cursor: pointer;
    display: inline-block;
}

.letter:hover {
    transform: translateY(8px);
    font-weight: 700;
}

.tight-i {
    margin-right: -0.05em;
}

.space {
    width: 0.2em;
    display: inline-block;
    pointer-events: none;
}

.bottom {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    background: var(--color-br);
    height: calc(100vh / 13 * 8);
    width: 100%;
    display: flex;
    flex-direction: column;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
}

.summary {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: calc(100vh / 13 * 7);
    padding: 1.5rem;
    text-align: justify;
    overflow-y: auto;
}

#about {
    height: calc(100vh / 13);
    padding: 0 1.5rem;
    background: var(--color-br);
    width: 100%;
    z-index: 5;
    font-family: var(--font-body);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-size: 0.8rem;
}

#about a {
    color: black;
    font-family: PlacardKS;
    letter-spacing: 0.01rem;
    text-decoration: none;
    font-size: 1rem;

}

.drag-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.5rem;
    cursor: grab;
}

.drag-handle span {
    display: block;
    width: 10%;
    height: 2px;
    background: black;
    border-radius: 2px;
    opacity: 0.2;
}


#cred-line {
    font-size: 0.75rem;
}

#rotate-btn {
    position: fixed;
    top: calc(100vh / 13 * 2.5);
    left: 50vh;
    background: var(--color-lg);
    border: var(--color-dg) 1px solid;
    box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.3);
    width: 3.5vh;
    height: 3.5vh;
    cursor: pointer;
    transform: translateX(-50%);
}

#rotate-btn:hover {
    border: black 1.5px solid;
}

#rotate-btn img {
    width: 70%;
}

p.blink {
    position: fixed;
    top: calc(100vh / 13 * 3.25);
    left: 50vh;
    font-size: 0.8rem;
    color: var(--color-dg);
    transform: translateX(-50%);
    animation: fadeBlink 1.5s ease-in-out infinite;
}

@keyframes fadeBlink {

    0%,
    60% {
        opacity: 1;
    }

    20% {
        opacity: 0;
    }
}

/* -------------------- menu --------------------*/

#menu {
    display: none;
}





@media (max-width:1200px) {
    * {
        overflow: visible;
    }

    html {
        font-size: 20px;
    }

    body {
        display: flex;
        flex-direction: column-reverse;
        height: auto;
        overflow: auto;
        min-height: 100vh;
    }

    ::-webkit-scrollbar {
        width: 8px;
    }

    aside {
        flex: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        height: auto;
    }

    .top {
        width: 100%;
        height: auto;
        border: 0.25px solid #606060;
        outline: 0.25px solid #606060;
        outline-offset: -.5px;
    }

    #home {
        height: 100%;
        width: 100%;
        padding: 0.5rem 0 0.75rem 0;
        position: static;
        font-kerning: normal;
    }

    #home h3 {
        font-size: 1.5rem;
        margin-top: 0;
    }


    .bottom {
        flex: 1;
        background: var(--color-br);
        height: max-content;
        width: 100%;
        position: relative;
        border: 0.25px solid #606060;
        outline: 0.25px solid #606060;
        outline-offset: -.5px;
    }

    .summary {
        position: static;
        width: 100%;
        height: auto;
        padding: 1rem 0.5rem;
        overflow-y: auto;
        font-size: 0.85rem;
        text-align: justify;
    }

    #about {
        display: none;
    }

    #menu {
        display: block;
        z-index: 100;
    }

    #menu li {
        text-align: center;
        border: 0.25px solid #606060;
        outline: 0.25px solid #606060;
        outline-offset: -.5px;
    }

    #menu li a:not(#footnote a) {
        display: block;
        padding: 0.75rem 1rem;
        text-decoration: none;
        color: black;
    }

    #menu li#footnote {
        background: var(--color-lg);
        font-size: 0.85rem;
        border-bottom: none;
        padding: 2rem 0.5rem 1rem 0.5rem;
    }

    #footnote a {
        color: black;
        font-family: PlacardKS;
        letter-spacing: 0.01rem;
        text-decoration: none;
        font-size: 0.8rem;
    }

    .bg-bl {
        background: var(--color-bl);
    }

    .bg-gr {
        background: var(--color-gr);
    }

    .bg-pk {
        background: var(--color-pk);
    }

    .bg-br {
        background: var(--color-br);
    }


    main#library {
        display: none;
    }

    #rotate-btn,
    p.blink,
    #cred-line {
        display: none;
    }


    #hover-wrapper {
        display: none;
    }

    #deg_0,
    #deg_90,
    #deg_180,
    #deg_270 {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: column;
        transform: none;
        position: static;
        z-index: 1;
    }

    .storage>* {
        width: 100%;
        display: flex;
        flex-direction: column;
    }
}