:root {
    --light-text_color: #3df3c2;
    --light-background-color: #42005a;
    --dark-text_color: #401202;
    --dark-background-color: #BF7C41;
    --base-hover-color: #cef565;
}


/* global styles */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    box-sizing: border-box;
    overflow: hidden;
}

html.lang-en {
    font-family: "Delius", cursive;
    font-optical-sizing: auto;
}

html.lang-ru {
    font-family: "Caveat", cursive;
    font-optical-sizing: auto;
}

body {
    padding: 1.8vh;
    color: var(--light-text_color);
    background-color: var(--light-background-color);
    font-weight: 400;
    font-style: normal;
    text-align: center;
    align-items: center;
}

body.dark-theme {
    color: var(--dark-text_color);
    background-color: var(--dark-background-color);
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: -moz-none;
    -ms-user-select: none;
}


/* main */

.content {
    display: grid;
    grid-template-columns: 20% 20% 20% 20% 20%;
    grid-template-rows: 20% 20% 20% 20% 20%;
    align-items: center;
    padding: 2vh;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    outline: 2px solid var(--light-text_color);
    border-radius: 0.7rem;
}

.contacts {
    grid-column-start: 1;
    grid-column-end: 6;   
    grid-row: 1;  
    display: flex;
    justify-content: flex-end;
    align-items: center;      
    gap: 1.5rem;             
    padding-right: 1.5rem;
}

.contacts svg {
    width: 50px;
    height: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contacts svg:hover {
    transform: scale(1.2) rotate(10deg);
}

body.dark-theme .content {
    outline: 2px solid var(--dark-text_color);
}

svg path {
    fill: var(--light-text_color);
    transition: fill 2.5s ease;
}

body.dark-theme svg path {
    fill: var(--dark-text_color);
}

#phone-wrap svg {
    margin-top: 15px;
    margin-left: 10px;
}

.telegram-logo svg:hover {
    transform: scale(1.2) rotate(10deg);
}


.tooltip {
    border-radius: 0.7rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
    font-size: 1.2rem;
}

.tooltip.show {
    opacity: 1;
    pointer-events: auto;
}

.features {
    grid-row: 2;
    grid-column-start: 1;
    grid-column-end: 6;
    align-self: end;
    touch-action: manipulation;
    margin-bottom: 2vh;
}

.logo {
    grid-row: 3;
    grid-column-start: 1;
    grid-column-end: 6;
    width: 100%;
    pointer-events: none;
}

h1 {
    font-family: "Dancing Script", cursive;
    font-size: 10rem;
    margin: 0%;
}

h2 {
    font-size: 2rem;
    margin: 0;
}

nav {
    display: flex;
    list-style-type: none;
    justify-content: center;
    gap: 7%;
}

.nav-item {
    font-size: 2.5rem;
    cursor: pointer;
    transition: transform 0.4s ease;
}

.nav-item a {
    text-decoration: none;
    color: inherit;
}

.nav-item:hover {
    transform: scale(1.2) rotate(10deg);
    color: var(--base-hover-color);
}

.lang-toggle {
    grid-column: 3;
    grid-row: 4;
    transition: transform 0.4s ease;
}

.lang-toggle:hover {
    cursor: pointer;
    transform: scale(1.2);
    color: var(--base-hover-color);
    transition: transform 0.4s ease;
}

#theme-toggle-icon {
    grid-column: 5;
    grid-row: 4;
    justify-self: center;
    align-self: center;
    display: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

#theme-toggle-icon:hover {
    transform: scale(1.2);
}

@media (max-width: 830px) {
    .content {
        padding: 1vh;
    }

    body {
        padding: 1.2vh;
    }

    .logo h1 {
        font-size: 7rem;
    }

    .logo h2 {
        font-size: 2rem;
    }

    .features nav div {
        font-size: 2rem;
    }
    
    #mail-wrap {
        grid-column: 4;
        justify-self: end;
    }
}

@media (max-width: 768px) {
    #theme-toggle {
        display: none;
    }

    #theme-toggle-icon {
        display: block;
    }

    .content {
        padding: 0;
    }

    body {
        padding: 1vh;
    }

    .logo h1 {
        font-size: 6rem;
    }

    .logo h2 {
        font-size: 1.4rem;
    }

    .features {
        margin-bottom: 0;
    }

    .features nav div {
        font-size: 1.8rem;
    }


}

@media (max-width: 470px) {
    #mail-wrap {
        justify-self: center;
    }
    .logo h1 {
        font-size: 4rem;
    }
}

@media (max-height: 400px) {
    .logo {
        height: 135px;
    }
}

/* bookshelf */
.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 10%;
}

header .title {
    flex: 1;
    text-align: left;
    max-width: 75%;
    margin-left: 3%;
    font-size: 3rem;
}

header .back-button {
    flex: 1;
    max-width: 25%;
    background-color: var(--light-background-color);
    color: var(--light-text_color);
    border: 2px solid var(--light-text_color);
    padding: 0.5rem;
    border-radius: 0.7rem;
    cursor: pointer;
    font-size: 1.6rem;
    transition: background-color 0.4s ease;
    text-align: center;
}

.lang-en .back-button {
    font-family: "Delius", cursive;
}

body.dark-theme .back-button {
    background-color: var(--dark-background-color);
    color: var(--dark-text_color);
    border-color: var(--dark-text_color)
}

html.lang-ru .back-button {
    font-family: "Caveat", cursive;
    font-optical-sizing: auto;
}

header .back-button:hover {
    background-color: var(--base-hover-color);
}

.books_content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 10px;
    width: 100%;
    height: 100%;
    border-radius: 0.7rem;
}

.category {
    outline: 2px solid var(--light-text_color);
    padding: 1rem;
    border-radius: 0.7rem;
}

body.dark-theme .category {
    outline: 2px solid var(--dark-text_color);
}

.book-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.book-list li {
    padding: 5px 0;
    font-size: 1.5rem;
}

.book-list li:hover {
    color: var(--base-hover-color);
}

.lang-ru .book-list li {
    font-size: 1.6rem
}

.lang-ru summary {
    font-size: 2rem;
}


@media (min-width: 769px) {
    details > summary {
        display: block;
        margin: 0 0 1rem 0;
        font-size: 1.8rem;
        text-decoration: underline;
    }
}

@media (max-width: 1280px) {
    .lang-en .book-list li {
        font-size: 1.3rem
    }

    .category {
        padding: 0.6rem;
    }
}

@media (max-width: 1024px) {
    .lang-en .book-list li {
        font-size: 1.1rem
    }

    .lang-ru .book-list li {
        font-size: 1.4rem;
    }

    .category {
        padding: 0.3rem;
    }
}

@media (max-width: 840px) {
    .lang-en .book-list li {
        font-size: 1rem
    }
}

@media (max-width: 768px) {
    .books_content {
        display: flex;
        flex-direction: column;
        border-radius: 0.7rem;
        gap: 1rem;
        padding-top: 3rem;
        align-items: center;
    }

    details > summary {
        font-size: 1.5rem;
    }

    .category{
        width: 90%;
    }
}

@media (max-width: 420px) {
    .lang-ru .book-list li {
        font-size: 1.2rem;
    }
}

@media (max-width: 380px) {
    .lang-en .title {
        font-size: 2rem;
    }

    .category{
        width: 98%;
    }
}