:root {
    --background1: rgba(20, 20, 20, 0.8);
    --background2: #b9b9b9;
    --background3: #0f1011;
    --background4: rgb(250, 250, 250);
    --background5: #001eff;
    --background6: #8a8a8a;
    --hover1: #555555;
    --hover2: #ccc;
    --hover3: rgb(0, 0, 141);
    --color1: rgba(255, 255, 255, 0.8);
    --color2: #575757;
    --color3: #004556;
    --color4: #006a85;
    --book-front: #2c3e50;
    --book-back: #2c3e50;
    --book-spine: #1a1a1a;
}

* {
    box-sizing: border-box;
    font-family: 'Inter';
    margin: 0;
    padding: 0;
    color: rgb(152, 152, 152);
    scroll-behavior: smooth;
}

body {
    background-color: var(--background3);
}

.nav-bar {
    display: flex;
    position: static;
    width: 100%;
    height: 8vh;
    background-color: var(--background1);
    align-items: center;
}

.left-nav {
    margin-left: 6%;
}

.logo {
    font-size: larger;
    font-weight: 800;
    color: var(--color1);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo:hover svg {
  transform: scale(1.1);
  transition: 0.3s;
}

.center-nav {
    display: flex;
    position: absolute;
    gap: 8px;
    left: 68%;
    transform: translateX(-50%);
}

.center-btn {
    display: flex;
    height: 40px;
    padding: 0 12px;
    font-size: medium;
    background-color: inherit;
    border: none;
    border-radius: 20px;
    transition: background 0.3s, padding 0.3s, color 0.3s;
    cursor: pointer;
    text-decoration: none;
    align-items: center;
}

.center-btn:hover {
    color: white;
    background-color: var(--hover1);
    padding: 0 15px;
}

.right-nav {
    display: flex;
    position: absolute;
    gap: 8px;
    left: 87%;
    transform: translateX(-50%);
    border-left: 2px solid var(--hover1);
    padding-left: 15px;
}

.log-in-btn {
    height: 40px;
    padding: 0 12px;
    font-size: medium;
    background-color: inherit;
    border: none;
    border-radius: 20px;
    transition: background 0.3s, padding 0.3s, color 0.3s;
    cursor: pointer;
}

.log-in-btn:hover {
    color: white;
    background-color: var(--hover1);
    padding: 0 15px;
}

.sign-up-btn {
    height: 40px;
    padding: 0 12px;
    font-size: medium;
    background-color: var(--background2);
    color: black;
    border: none;
    border-radius: 20px;
    transition: background 0.3s, padding 0.3s;
    cursor: pointer;
}

.sign-up-btn:hover {
    background-color: var(--hover2);
    padding: 0 15px;
}

.hero {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 80vh;
    border: 2px solid var(--background1);
    isolation: auto;
}

.hero-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 10%;
    font-weight: 900;
    z-index: 10;
    width: 600px;
}

.hero-text p {
    color: white;
}

.book-container {
  display: flex;
  position: absolute;
  top: 30%;
  left: 70%;
  align-items: center;
  justify-content: center;
  perspective: 600px;
  z-index: 1;
}

@keyframes initAnimation {
  0% {
    transform: rotateY(0deg);
  }
  100% {
    transform: rotateY(-45deg);
  }
}

.book {
  width: 200px;
  height: 300px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-45deg);
  transition: 1s ease;
  animation: 1s ease 0s 1 initAnimation;
}

.book-container:hover .book, 
.book-container:focus .book {
  transform: rotateY(0deg);
}

.book > :first-child {
  position: absolute;
  top: 0;
  left: 0;
  background-color: red;
  width: 200px;
  height: 300px;
  transform: translateZ(37.5px);
  background-color: #1a1a1a;
  border-radius: 0 2px 2px 0;
}

.book::before {
  position: absolute;
  content: ' ';
  background-color: blue;
  left: 0;
  top: 2px;
  width: 73px;
  height: 296px;
  transform: translateX(160.5px) rotateY(90deg);
  background: linear-gradient(90deg, 
    #fff 0%,
    #f9f9f9 5%,
    #fff 10%,
    #f9f9f9 15%,
    #fff 20%,
    #f9f9f9 25%,
    #fff 30%,
    #f9f9f9 35%,
    #fff 40%,
    #f9f9f9 45%,
    #fff 50%,
    #f9f9f9 55%,
    #fff 60%,
    #f9f9f9 65%,
    #fff 70%,
    #f9f9f9 75%,
    #fff 80%,
    #f9f9f9 85%,
    #fff 90%,
    #f9f9f9 95%,
    #fff 100%
    );
}

.book::after {
  position: absolute;
  top: 0;
  left: 0;
  content: ' ';
  width: 200px;
  height: 300px;
  transform: translateZ(-37.5px);
  background-color: #1a1a1a;
  border-radius: 0 2px 2px 0;
}

.hero-btns {
    position: absolute;
    top: 60%;
    left: 10%;
    font-weight: 900;
    width: 1000px;
    display: flex;
    flex-direction: row;
    gap: 15px;
    align-items: center;
}

.hero-btn {
    height: 40px;
    padding: 0 12px;
    font-size: medium;
    background-color: inherit;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(var(--background3), 0.3);
    white-space: nowrap;
    transition: color 0.3s, padding 0.3s, background 0.3s;
    cursor: pointer;
}

.hero-btn:hover {
    padding: 0 15px;
}

.hero-btn:hover {
    color: white;
    background-color: var(--hover1);
    padding: 0 15px;
}

.hero-btn svg {
    transition: transform 0.2s ease;
}

.hero-btn:hover svg {
    transform: translate(3px, -3px);
}

.get-started {
    background-color: rgb(0, 0, 101);
}

.get-started:hover {
    background-color: var(--hover3);
}

.brands-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    height: 12vh;
    border: 2px solid var(--background1);
    overflow: hidden;
    padding: 20px 0;
    top: 80vh;
}

.brands-track {
    display: flex;
    gap: 60px;
    width: max-content;
    animation: scroll 20s linear infinite;
    padding-left: 60px;
}

.brands-track span {
    font-size: 18px;
    color: var(--hover1);
    white-space: nowrap;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
    flex-shrink: 0;
}

.brands-track span:hover {
    color: var(--hover2);
}

.brands-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.brands-note {
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    color: var(--hover1);
    white-space: nowrap;
}


.customization {
    display: flex;
    position: absolute;
    top: 98%;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 90vh;
}

.customization-book {
    position: absolute;
    width: 40vh;
    height: 50vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    text-decoration: none;
    border: 2px solid var(--background1);
}

.book-3d {
    width: 200px;
    height: 300px;
    transform-style: preserve-3d;
}

.book-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-25deg) rotateX(10deg);
    transition: transform 0.5s ease;
}

.book-inner {
    cursor: grab;
}

.book-inner:active {
    cursor: grabbing;
}

.face {
    position: absolute;
    background: var(--book-front, #2c3e50);
    border: 1px solid rgba(0,0,0,0.1);
}

.front, .back {
    width: 200px;
    height: 300px;
}

.left, .right {
    width: 40px;
    height: 300px;
}

.top, .bottom {
    width: 200px;
    height: 40px;
    background: linear-gradient(90deg, 
        #fff 0%, #f0f0f0 25%, 
        #fff 50%, #f0f0f0 75%, #fff 100%
    );
    background-size: 4px 100%;
}

.front  { transform: rotateY(0deg) translateZ(20px); }
.back   { transform: rotateY(180deg) translateZ(20px); }

.left   { 
    width: 40px;
    left: -20px;
    transform: rotateY(-90deg);
}

.right  { 
    width: 40px;
    left: 180px;
    transform: rotateY(90deg);
    background: none;
}

.top    { 
    height: 40px;
    top: -17px;
    transform: rotateX(90deg);
}

.bottom { 
    height: 40px;
    top: 277px;
    transform: rotateX(-90deg);
}

.pages {
    position: absolute;
    width: 38px;
    height: 296px;
    top: 2px;
    left: 180px;
    transform: rotateY(90deg);
    background: linear-gradient(90deg, 
        #fff 0%, #f0f0f0 25%, 
        #fff 50%, #f0f0f0 75%, #fff 100%
    );
    background-size: 4px 100%;
}

.front {
    background: var(--book-front);
    background-size: cover;
    background-position: center;
}
.back   { background: var(--book-back); }
.left   { background: var(--book-spine); }

.controls {
    position: absolute;
    left: 30%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(0,0,0,0.6);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 800;
}

.controls label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    color: white;
    gap: 5px;
}

.customization-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-list {
    position: absolute;
    bottom: -3%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.book-option {
    width: 60px;
    height: 90px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}

.book-option:hover {
    transform: scale(1.1);
    border-color: white;
}

.book-option.active {
    border-color: cyan;
}

.title-toggle {
    position: absolute;
    top: 105%;
    height: 40px;
    padding: 0 12px;
    font-size: medium;
    background-color: inherit;
    border: none;
    border-radius: 20px;
    transition: background 0.3s, padding 0.3s, color 0.3s;
    cursor: pointer;
}

.title-toggle:hover {
    background-color: var(--hover1);
    padding: 0 15px;
    color: white;
}

.book-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    opacity: 0;
    transition: 0.3s;
}

.book-title.active {
    opacity: 1;
}

.prices {
    display: flex;
    position: absolute;
    top: 200vh;
    width: 100%;
    height: 80vh;
    border: 2px solid var(--background1);
    align-items: center;
    justify-content: center;
    flex-direction: row;
    gap: 12px;
}

.price-card {
    width: 30%;
    height: 50vh;
    border-radius: 14px;
    background-color: var(--background4);
    transition: background 0.3s, transform 0.3s;
}

.price-card:hover {
    background-color: var(--hover2);
    transform: scale(1.03);
}

.price-card > h2 {
    width: 60%;
    display: flex;
    position: relative;
    top: 5%;
    left: 5%;
    color: var(--color3);
    font-size: xx-large;
}

.badge {
    display: flex;
    align-items: center;
    font-size: medium;
    margin-left: 97%;
    color: rgb(135, 1, 1);
}

.price {
    width: 60%;
    display: flex;
    position: relative;
    top: 20%;
    left: 5%;
    color: var(--color3);
    font-size: xx-large;
    font-weight: 800;
}

.desc {
    display: flex;
    position: relative;
    align-items: center;
    font-size: medium;
    top: 30%;
    left: 5%;
    color: var(--color2);
}

.sub {
    display: flex;
    position: relative;
    align-items: center;
    font-size: large;
    top: 35%;
    left: 5%;
    color: var(--color4);
    font-weight: 700;
}

.card-btn {
    width: 90%;
    height: 8vh;
    display: flex;
    position: relative;
    font-size: large;
    text-align: center;
    align-items: center;
    justify-content: center;
    top: 50%;
    left: 5%;
    border-radius: 8px;
    border: none;
    font-weight: 800;
    background-color: var(--background5);
    color: white;
    transition: 0.3s;
}

.card-btn:hover {
    background-color: var(--hover3);
}

.free-btn {
    background-color: var(--color4);
}

.free-btn:hover {
    background-color: var(--color3);
}

.contacts {
    display: flex;
    position: absolute;
    top: 280vh;
    width: 100%;
    height: 8vh;
    border: 2px solid var(--background1);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    cursor: pointer;
}

.contacts > a {
    text-decoration: none;
}

.sign-up-menu {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

.log-in-menu {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

.sign-up-menu.active {
    opacity: 1;
    pointer-events: auto;
}

.log-in-menu.active {
    opacity: 1;
    pointer-events: auto;
}

.account {
    width: 40vh;
    height: auto;
    min-height: 30vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    background-color: var(--background4);
    color: var(--color1);
    z-index: 100;
    border: 2px solid var(--background1);
    border-radius: 8px;
    gap: 16px;
    box-sizing: border-box;
}

.account-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--background5);
}

.account-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    border-radius: 5px;
    gap: 12px;
    margin-top: 30%;
    padding: 1vh;
    background-color: var(--background1);
}

.account-container label {
    display: flex;
    flex-direction: column;
    font-size: 0.9rem;
    color: var(--text1);
}

.account-container input {
    margin-top: 4px;
    padding: 6px 8px;
    border: 1px solid var(--background1);
    border-radius: 4px;
    font-size: 0.9rem;
}

.account-btn {
    padding: 8px 12px;
    border: none;
    background-color: var(--background5);
    color: white;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.3s;
}

.account-btn:hover {
    background-color: var(--hover3);
}

.account-a {
    font-size: 1rem;
    font-weight: 800;
    color: var(--background5);
    cursor: pointer;
    margin-top: 8px;
    text-decoration: none;
    transition: 0.3s;
}

.account-a:hover {
    color: var(--hover3);
}

.cancel {
    display: flex;
    position: absolute;
    top: 1vh;
    right: 1.5vh;
    background-color: inherit;
    border: none;
    cursor: pointer;
    font-size: larger;
    color: var(--background3);
}

@media (max-width: 1200px) {

    html, body {
        overflow-x: hidden;
    }

    .right-nav {
        position: static;
        transform: none;
        margin-left: auto;
    }

    .hero {
        width: 95%;
        min-height: 85vh;
        height: auto;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
    }

    .hero-text {
        width: 80%;
        text-align: center;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .hero-btns {
        left: 50%;
        transform: translateX(-50%);
        justify-content: center;
    }

    .book-container {
        left: 50%;
        transform: translateX(-50%);
    }

    .brands-wrapper {
        position: relative;
        top: auto;
        margin-top: 30px;
    }

    .customization,
    .customization-wrapper {
        max-width: 100%;
        overflow: hidden;
    }

    .prices {
        position: relative;
        top: auto;
        margin-top: 80px;
    }

    .card-btn {
        top: 38%;
    }

    .contacts {
        position: relative;
        top: auto;
        margin-top: 40px;
    }
}

@media (max-width: 1200px) {

    html, body {
        overflow-x: hidden;
    }

    .center-nav {
        display: none;
    }

    .nav-bar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }

    .right-nav {
        margin-left: auto;
        border: none;
        padding: 0;
    }

    .hero {
        position: relative;
        width: 100%;
        min-height: 80vh;
        height: auto;
        padding: 40px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .hero-text {
        position: relative;
        transform: none;
        left: auto;
        top: auto;
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }

    .hero-btns {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .book-container {
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 30px;
    }

    .book {
        transform: rotateY(-20deg) scale(0.85);
    }

    .book-container:hover .book {
        transform: rotateY(0deg) scale(0.85);
    }

    .brands-wrapper {
        position: relative !important;
        top: auto !important;
        margin-top: 30px;
    }

    .customization {
        position: relative !important;
        top: auto !important;
        height: auto;
        padding: 40px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: hidden;
    }

    .customization-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: auto;
        max-width: 100%;
        overflow: hidden;
    }

    .customization-book {
        position: relative !important;
        transform: none !important;
        width: 100%;
        height: auto;
        margin-bottom: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        left: 0 !important;
        top: auto !important;
    }

    .book-inner {
        position: relative;
        left: auto;
        transform: rotateY(-25deg) rotateX(10deg);
        touch-action: none;
    }

    .book-3d,
    .book-inner,
    .face,
    .pages {
        pointer-events: none;
    }

    .book-inner {
        pointer-events: auto;
    }

    .customization-book {
        pointer-events: none;
    }

    .book-inner {
        pointer-events: auto;
    }

    .book-3d {
        transform: scale(0.85);
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .controls {
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: auto !important;
        width: 100%;
        margin-top: 20px;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .book-list {
        position: relative !important;
        left: 50%;
        transform: translateX(-50%);
        margin-top: 20px;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .book-option {
        width: 50px;
        height: 75px;
    }

    .title-toggle,
    .book-title {
        position: relative !important;
        transform: none !important;
        margin-top: 10px;
        text-align: center;
    }

    .book-title {
        left: 0;
        margin-top: 0;
    }

    .prices {
        position: relative;
        top: auto;
        margin-top: 60px;
        flex-direction: column;
        height: auto;
        padding: 20px 0;
    }

    .price-card {
        width: 90%;
    }

    .contacts {
        position: relative;
        top: auto;
        margin-top: 40px;
    }
}

@media (max-width: 480px) {

    html, body {
        overflow-x: hidden;
    }

    .hero-text {
        font-size: 14px;
    }

    .hero-btn {
        font-size: 12px;
    }

    .book {
        width: 120px;
        height: 180px;
    }

    .price-card {
        width: 95%;
    }

    .card-btn {
        top: 40%;
    }
}
