/* Base */

:root {
    --navy: #07111f;
    --cream: #f4e6c3;
    --gold: #d8b26e;
    --dark-gold: #be8e3a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--navy);
    color: var(--cream);
    font-family: Georgia, "Times New Roman", serif;
}

/* Header */

.site-header {
    position: relative;
    z-index: 2;

    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;

    min-height: 138px;
    padding: 4px 20px;

    background: var(--navy);
}

.brand {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;

    color: inherit;
    text-decoration: none;
}

.brand-logo {
    position: relative;
    width: 130px;
    height: 130px;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    filter: brightness(1.12) contrast(1.28);
    transition:
        transform 0.6s ease,
        filter 0.6s ease;
}

.brand-logo:hover {
    transform: scale(1.14);
    filter: brightness(1.12) contrast(1.28) saturate(1.35);
}

.brand-logo img {
    display: block;
    width: 110%;
    height: 110%;
    object-fit: contain;
    transform: translate(-3px, -11px);
}

.brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-text h1 {
    margin: 0;

    font-size: 65px;
    font-weight: 400;
    line-height: 0.85;
    letter-spacing: 10px;

    background: linear-gradient(
        to bottom,
        #fff4cf 0%,
        #e8c98b 38%,
        #be8e3a 82%,
        #f0d59b 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow:
        0 1px 0 rgba(255, 245, 210, 0.25),
        0 3px 8px rgba(0, 0, 0, 0.55);
}

.brand-text p {
    margin: 2px 0 0;

    font-size: 19px;
    line-height: 0.9;
    letter-spacing: 4px;

    background: linear-gradient(
        to bottom,
        #f7e6bd 0%,
        #be8e3a 85%,
        #f0d59b 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
}

.brand-divider {
    display: flex;
    align-items: center;
    width: 260px;
    margin-top: 5px;
}

.brand-divider span {
    flex: 1;
    height: 2px;
    background: var(--dark-gold);
    opacity: 0.75;
}

.brand-divider b {
    margin: 0 12px;
    color: var(--dark-gold);
    font-size: 18px;
    font-weight: 400;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: clamp(24px, 4.2vw, 80px);

    margin-left: auto;
    margin-right: clamp(0px, 4.2vw, 80px);
}

.nav-link {
    position: relative;
    padding: 12px 0;

    color: var(--cream);
    text-decoration: none;
    font-size: 19px;
    letter-spacing: 2px;

    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--dark-gold);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: -10px;
    right: -10px;
    bottom: -7px;

    height: 1px;
    background: var(--dark-gold);
}

.nav-link.active::before {
    content: "◇";
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: -13px;

    transform: translateX(-50%);
    padding: 0 5px;
    background: var(--navy);

    font-size: 12px;
    line-height: 12px;
}

/* Main scene */

.buy-page {
    position: relative;
    isolation: isolate;

    min-height: calc(100svh - 138px);
    padding: 30px 24px 48px;

    background-image: url("images/backgrounds/Фон.png");
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
}

.buy-page::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;

    background:
        radial-gradient(
            ellipse at 62% 45%,
            rgba(3, 9, 15, 0.36),
            transparent 55%
        ),
        linear-gradient(
            to bottom,
            rgba(3, 9, 15, 0.18),
            rgba(3, 9, 15, 0.05) 60%,
            rgba(3, 9, 15, 0.25)
        );
}

/* Page heading */

.page-heading {
    position: relative;
    isolation: isolate;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.page-heading h2 {
    margin: 0;

    color: #ffe5ae;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 14px rgba(0, 0, 0, 0.8);
    font-size: 40px;
    font-weight: 400;
    letter-spacing: 6px;
    text-transform: uppercase;
}

.page-heading p {
    margin: 8px 0 0;

    color: #fff0cf;
    text-shadow: 0 2px 3px #000, 0 0 10px rgba(0, 0, 0, 0.9);
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    width: 250px;
    margin: 5px auto 0;
    color: var(--gold);
}

.ornament span {
    flex: 1;
    height: 1px;

    background: linear-gradient(
        to right,
        transparent,
        var(--dark-gold)
    );
}

.ornament span:last-child {
    transform: rotate(180deg);
}

.ornament b {
    font-size: 13px;
    font-weight: 400;
}

.ornament.small {
    width: 140px;
}

/* Book layout */

.book-layout {
    width: min(1040px, 100%);
    margin: 36px auto 0;

    display: grid;
    grid-template-columns: minmax(0, 460px) minmax(0, 380px);
    justify-content: center;
    align-items: center;
    gap: clamp(40px, 5vw, 100px);
}

.book-display {
    position: relative;
    isolation: isolate;
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-cover {
    display: block;
    width: 100%;
    max-width: 460px;
    height: auto;

    filter: drop-shadow(
        12px 18px 18px rgba(0, 0, 0, 0.65)
    );
}

.purchase-panel {
    position: relative;
    isolation: isolate;
    min-width: 0;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.book-number {
    color: #fff0cf;
    text-shadow: 0 2px 3px #000, 0 0 10px rgba(0, 0, 0, 0.9);
    margin: 0;
    font-size: 20px;
}

.purchase-panel h3 {
    margin: 14px 0 0;

    color: #ffe5ae;
    text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95), 0 0 14px rgba(0, 0, 0, 0.8);
    font-size: 36px;
    font-weight: 400;
    line-height: 1.1;
    text-transform: uppercase;
}

.title-ornament {
    margin-top: 16px;
    margin-bottom: 28px;
}

/* Store buttons */

.retailer-list {
    width: min(320px, 100%);
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    gap: 14px;
}

.retailer-button {
    width: 100%;
    min-height: 54px;
    padding: 8px 16px;

    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 10px;

    border: 1px solid var(--dark-gold);
    border-radius: 3px;

    color: var(--cream);
    background: linear-gradient(
        110deg,
        rgba(5, 14, 20, 0.97),
        rgba(8, 19, 25, 0.94)
    );

    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;

    box-shadow:
        0 0 0 3px rgba(5, 12, 18, 0.65),
        0 0 0 4px rgba(166, 124, 62, 0.4),
        0 6px 16px rgba(0, 0, 0, 0.3);
}

.retailer-button:disabled {
    opacity: 1;
    cursor: default;
}

.retailer-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--gold);
    text-shadow: none;
}

.retailer-icon svg {
    display: block;
    width: 29px;
    height: 29px;
}

.amazon {
    font-size: 38px;
    font-weight: bold;
    font-style: italic;
    line-height: 1;
}

.barnes {
    font-size: 20px;
    letter-spacing: -2px;
}

.kobo {
    font-size: 20px;
    letter-spacing: -1px;
}

.retailer-arrow {
    color: var(--gold);
    font-size: 25px;
}

.availability {
    max-width: 320px;
    margin: 22px auto 0;

    color: #fff0cf;
    font-size: 15px;
    line-height: 1.6;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 6px;
}

/* Contact shadow beneath the book */

.book-display::before {
    content: "";
    position: absolute;
    z-index: -1;
    bottom: 10px;
    left: 52%;
    transform: translateX(-50%);
    width: 78%;
    height: 24px;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
}

/* Soft shading behind the headings */

.page-heading::before,
.purchase-panel::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(
        ellipse,
        rgba(3, 9, 15, 0.65) 0%,
        rgba(3, 9, 15, 0.35) 45%,
        transparent 72%
    );
}

.page-heading::before {
    inset: -20px;
    max-width: 540px;
    margin-inline: auto;
}

.purchase-panel::before {
    inset: -35px -45px;
}

/* Larger book and buttons above phone widths */

@media (min-width: 651px) {
    .book-layout {
        position: relative;
        top: 30px;
        width: min(1160px, 100%);
        grid-template-columns: minmax(0, 520px) minmax(0, 420px);
    }

    .book-cover {
        max-width: 520px;
    }

    .retailer-list {
        width: min(370px, 100%);
    }

    .retailer-button {
        min-height: 64px;
        font-size: 16px;
        grid-template-columns: 52px minmax(0, 1fr) 16px;
    }

    .retailer-icon svg {
        width: 34px;
        height: 34px;
    }

    .amazon {
        font-size: 44px;
    }

    .barnes,
    .kobo {
        font-size: 24px;
    }
}
/* Smaller desktops and tablets */

@media (max-width: 1200px) {
    .site-header {
        flex-direction: column;
        gap: 10px;
        padding: 4px 24px 18px;
    }

    .main-nav {
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px 32px;
        margin: 0;
    }

    .buy-page {
        min-height: calc(100svh - 210px);
    }
}

/* Phones */

@media (max-width: 650px) {
    .site-header {
        gap: 10px;
        padding: 10px 16px 18px;
    }

    .brand {
        gap: 14px;
    }

    .brand-logo {
        width: 80px;
        height: 80px;
    }

    .brand-logo img {
        transform: translate(-2px, -7px);
    }

    .brand-text h1 {
        font-size: 40px;
        letter-spacing: 6px;
    }

    .brand-text p {
        font-size: 12px;
        letter-spacing: 2px;
    }

    .brand-divider {
        width: 170px;
    }

    .main-nav {
        gap: 4px 22px;
    }

    .nav-link {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .buy-page {
        padding: 28px 24px 48px;
    }

    .page-heading h2 {
        font-size: 32px;
    }

    .page-heading p {
        font-size: 10px;
        letter-spacing: 2px;
    }

    .book-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
        margin-top: 28px;
    }

    .book-cover {
        max-width: 300px;
    }

    .purchase-panel h3 {
        font-size: 30px;
    }
}
