:root {
    --ink: #172033;
    --muted: #657186;
    --brand: #b51f2a;
    --brand-dark: #861722;
    --gold: #d99a2b;
    --paper: #f7f3ec;
    --line: #e7dfd2;
    --white: #ffffff;
    --shadow: 0 18px 45px rgba(23, 32, 51, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Inter, Arial, sans-serif;
    background: #fffaf3;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
}

.announcement {
    background: var(--brand-dark);
    color: var(--white);
    font-size: 13px;
    padding: 10px 18px;
    text-align: center;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 250, 243, .95);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.header-inner,
.section-inner {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 26px;
    align-items: center;
    min-height: 86px;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    font-weight: 800;
    letter-spacing: .4px;
}

.brand-mark {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    color: var(--white);
    background: var(--brand);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(181, 31, 42, .25);
}

.brand small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.nav {
    display: flex;
    justify-content: center;
    gap: 24px;
    color: #293449;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search {
    width: 190px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
}

.btn {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 6px;
    background: var(--brand);
    color: var(--white);
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(181, 31, 42, .18);
}

.hero {
    min-height: 560px;
    display: grid;
    align-items: center;
    color: var(--white);
    background:
        linear-gradient(90deg, rgba(23, 32, 51, .92), rgba(23, 32, 51, .58), rgba(23, 32, 51, .22)),
        url('https://images.unsplash.com/photo-1526243741027-444d633d7365?auto=format&fit=crop&w=1800&q=82') center/cover;
}

.hero-content {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 78px 0 96px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    color: #ffe6b9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(42px, 6vw, 76px);
    line-height: .98;
    letter-spacing: 0;
}

.hero p {
    max-width: 590px;
    margin: 24px 0 32px;
    color: rgba(255, 255, 255, .86);
    font-size: 18px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.btn.secondary {
    background: var(--white);
    color: var(--brand-dark);
    box-shadow: none;
}

.stats {
    margin-top: -58px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.stat {
    min-height: 116px;
    padding: 24px;
    border-right: 1px solid var(--line);
}

.stat:last-child {
    border-right: 0;
}

.stat strong {
    display: block;
    color: var(--brand);
    font-size: 28px;
    line-height: 1;
}

.stat span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
}

section {
    padding: 76px 0;
}

.section-head {
    display: flex;
    gap: 20px;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 28px;
}

h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: 0;
}

.section-head p {
    max-width: 540px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.view-link {
    color: var(--brand);
    font-weight: 800;
}

.subjects {
    background: var(--paper);
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.subject {
    position: relative;
    overflow: hidden;
    min-height: 92px;
    display: flex;
    align-items: end;
    padding: 18px;
    border: 1px solid #e1d6c6;
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(181, 31, 42, .08), rgba(217, 154, 43, .14)),
        var(--white);
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    box-shadow: 0 10px 24px rgba(23, 32, 51, .04);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, color .22s ease, background .22s ease;
}

.subject::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(181, 31, 42, .16), rgba(217, 154, 43, .2)),
        radial-gradient(circle at top right, rgba(255, 255, 255, .9), transparent 42%);
    opacity: 0;
    transition: opacity .22s ease;
}

.subject:hover,
.subject:focus-visible {
    border-color: rgba(181, 31, 42, .5);
    color: var(--brand);
    box-shadow: 0 18px 38px rgba(23, 32, 51, .14);
    transform: translateY(-4px);
}

.subject:hover::before,
.subject:focus-visible::before {
    opacity: 1;
}

.subject:focus-visible {
    outline: 3px solid rgba(217, 154, 43, .36);
    outline-offset: 3px;
}

.subject[hidden] {
    display: none;
}

.subject-empty {
    margin: 22px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.subject-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 28px;
}

.subject-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 330px) 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.subject-search {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
    outline: 0;
}

.subject-search:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217, 154, 43, .18);
}

.subject-all-link {
    justify-self: end;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

.book-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 14px 34px rgba(23, 32, 51, .07);
}

.book-cover {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #eee4d7;
}

.book-cover img {
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.book-card:hover img {
    transform: scale(1.06);
}

.tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--gold);
    color: #2c1904;
    font-size: 11px;
    font-weight: 800;
}

.book-body {
    padding: 18px;
}

.book-title {
    min-height: 58px;
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.35;
}

.book-author {
    min-height: 36px;
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.price {
    display: block;
    margin-top: 16px;
    color: var(--brand);
    font-size: 18px;
    font-weight: 800;
}

.feature-band {
    background:
        linear-gradient(rgba(23, 32, 51, .86), rgba(23, 32, 51, .86)),
        url('https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=1800&q=82') center/cover;
    color: var(--white);
}

.feature-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.feature-layout p {
    color: rgba(255, 255, 255, .78);
    line-height: 1.75;
}

.feature-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.feature-list span {
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    font-weight: 700;
}

.publishers {
    padding-top: 0;
}

.publisher-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
}

.publisher {
    display: grid;
    min-height: 82px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--muted);
    font-weight: 800;
}

.site-footer {
    padding: 54px 0 22px;
    background: #161d2b;
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.25fr) minmax(150px, .7fr) minmax(280px, 1.2fr) minmax(250px, 1fr);
    gap: 48px;
    align-items: start;
}

.site-footer h3,
.site-footer h4 {
    margin: 0 0 14px;
    color: var(--white);
    line-height: 1.25;
}

.site-footer p,
.site-footer li,
.footer-contact address {
    color: rgba(255, 255, 255, .72);
    line-height: 1.7;
}

.footer-about p,
.footer-newsletter p {
    max-width: 330px;
}

.site-footer ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.site-footer a {
    color: inherit;
}

.site-footer a:hover {
    color: var(--white);
}

.footer-contact address {
    display: grid;
    gap: 6px;
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    font-size: inherit;
    font-style: normal;
    font-weight: 400;
}

.footer-contact strong,
.footer-contact span {
    display: block;
}

.footer-contact strong {
    color: rgba(255, 255, 255, .84);
    font: inherit;
}

.newsletter {
    display: flex;
    gap: 8px;
    align-items: center;
}

.newsletter input {
    min-width: 0;
    flex: 1 1 150px;
    height: 42px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
}

.newsletter .btn {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 20px;
}

.copyright {
    margin-top: 34px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .58);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 16px 0;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 14px 18px;
    }

    .header-actions {
        align-items: stretch;
    }

    .search {
        flex: 1;
        width: auto;
    }

    .stats-grid,
    .subject-grid,
    .book-grid,
    .publisher-row,
    .footer-grid,
    .feature-layout {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .announcement {
        font-size: 12px;
    }

    .hero {
        min-height: 520px;
        background-position: 58% center;
    }

    .hero-content {
        padding: 58px 0 86px;
    }

    .hero p {
        font-size: 16px;
    }

            .section-head,
            .hero-actions,
            .newsletter,
            .subject-controls {
                align-items: stretch;
                flex-direction: column;
            }

            .subject-toolbar {
                grid-template-columns: 1fr auto;
            }

            .stats-grid,
    .subject-grid,
    .book-grid,
    .publisher-row,
    .footer-grid,
    .feature-layout {
        grid-template-columns: 1fr;
    }

    .stat {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .stat:last-child {
        border-bottom: 0;
    }

    section {
        padding: 54px 0;
    }
}
