:root {
    --cream: #FBF3E3;
    --paper: #FFFDF6;
    --ink: #1A160F;
    --body: #4C4536;
    --coral: #FF5C4D;
    --pink: #FF7CC4;
    --blue: #2D5BFF;
    --yellow: #FFCE3A;
    --mint: #22C58A;
    --purple: #7A5CFF;
    --line: var(--ink);
    --radius: 22px;
    --shadow: 6px 6px 0 var(--ink);
    --shadow-sm: 3px 3px 0 var(--ink);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--cream);
    color: var(--ink);
    overflow-x: hidden;
    cursor: none;
    min-height: 100vh
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: .09;
    mix-blend-mode: multiply
}

::selection {
    background: var(--coral);
    color: #fff
}

/* cursor */
.cursor,
.cursor-follow {
    position: fixed;
    top: 0;
    left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference
}

.cursor {
    width: 10px;
    height: 10px;
    background: #fff;
    transform: translate(-50%, -50%)
}

.cursor-follow {
    width: 44px;
    height: 44px;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    transition: transform .18s, width .18s, height .18s
}

.cursor-follow.grow {
    width: 78px;
    height: 78px;
    background: #fff
}

@media (hover:none) {

    .cursor,
    .cursor-follow {
        display: none
    }

    body {
        cursor: auto
    }
}

/* nav */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(20px, 5vw, 64px);
}

.brand {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: -.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink)
}

.brand .dot {
    width: 13px;
    height: 13px;
    background: var(--coral);
    border-radius: 50%;
    display: inline-block;
    animation: bob 2s ease-in-out infinite
}

@keyframes bob {
    50% {
        transform: translateY(-6px)
    }
}

.nav-links {
    display: flex;
    gap: 6px;
    align-items: center
}

.nav-links a {
    text-decoration: none;
    color: var(--ink);
    font-weight: 500;
    font-size: .95rem;
    padding: 8px 16px;
    border-radius: 100px;
    transition: .25s;
    cursor: none
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--ink);
    color: var(--cream)
}

.nav-cta {
    background: var(--blue) !important;
    color: #fff !important;
    border: 1.5px solid var(--blue);
    box-shadow: var(--shadow-sm)
}

/* header */
.cat-hero {
    padding: 130px clamp(20px, 5vw, 64px) 10px;
    max-width: 1300px;
    margin: 0 auto
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: var(--cream);
    padding: 7px 16px;
    border-radius: 100px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 18px
}

.eyebrow .pulse {
    width: 8px;
    height: 8px;
    background: var(--mint);
    border-radius: 50%;
    animation: pulse 1.4s infinite
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .2
    }
}

.cat-hero h1 {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: .98;
    letter-spacing: -.02em
}

.cat-hero h1 em {
    font-style: italic;
    color: var(--coral)
}

.cat-hero p {
    margin-top: 14px;
    color: var(--body);
    font-size: 1.1rem;
    max-width: 560px;
    line-height: 1.55
}

/* shell */
.cat-shell {
    max-width: 1300px;
    margin: 0 auto;
    padding: 34px clamp(20px, 5vw, 64px) 90px;
    display: grid;
    grid-template-columns: 236px 1fr;
    gap: 50px;
    align-items: start
}

.cat-side {
    position: sticky;
    top: 104px
}

.cat-side h4 {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--body);
    margin-bottom: 14px;
    padding-left: 6px
}

.subj-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.subj-btn {
    width: 100%;
    text-align: left;
    font-family: 'Space Grotesk';
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
    background: none;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: none;
    transition: .2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.subj-btn:hover {
    background: var(--paper)
}

.subj-btn.active {
    background: var(--ink);
    color: var(--cream);
    font-weight: 700
}

.subj-btn .cnt {
    font-size: .8rem;
    opacity: .6;
    font-weight: 500
}

.subj-btn .dot2 {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto
}

.cat-side h4 {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--body);
    margin-bottom: 12px;
    padding-left: 6px
}

.series-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--ink);
    color: var(--cream);
    border-radius: 12px;
    padding: 12px 15px;
    font-weight: 700;
    font-size: .92rem;
    line-height: 1.25
}

.series-pill span {
    font-size: .78rem;
    opacity: .65;
    font-weight: 500
}

.cat-main-head {
    margin-bottom: 26px
}

.cat-crumb {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 7px
}

.title-row {
    display: flex;
    align-items: baseline;
    gap: 14px;
    flex-wrap: wrap
}

.cat-main-head h2 {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.9rem;
    letter-spacing: -.01em
}

.cat-main-head span {
    color: var(--body);
    font-size: .95rem
}

.subj-filter {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 26px
}

.chip {
    font-family: 'Space Grotesk';
    font-weight: 600;
    font-size: .9rem;
    cursor: none;
    padding: 8px 16px;
    border-radius: 100px;
    border: 2px solid var(--ink);
    background: var(--paper);
    color: var(--ink);
    transition: .15s;
    box-shadow: 2px 2px 0 var(--ink)
}

.chip:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--ink)
}

.chip.on {
    background: var(--ink);
    color: var(--cream)
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px 26px
}

.book-card {
    cursor: none;
    display: flex;
    flex-direction: column;
    gap: 13px;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    opacity: 0;
    transform: translateY(28px) scale(.94);
    animation: pop .55s cubic-bezier(.34, 1.56, .64, 1) forwards
}

@keyframes pop {
    to {
        opacity: 1;
        transform: none
    }
}

.book-card .cover {
    position: relative;
    aspect-ratio: 1/1.414;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .3s cubic-bezier(.34, 1.4, .64, 1), box-shadow .3s;
    background: var(--line)
}

.book-card:hover .cover {
    transform: translateY(-8px) rotate(-1deg);
    box-shadow: 0 26px 50px rgba(42, 38, 32, .22)
}

.book-card .cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.cover .view {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    background: linear-gradient(to top, rgba(20, 16, 11, .55), transparent 45%);
    opacity: 0;
    transition: .3s
}

.book-card:hover .cover .view {
    opacity: 1
}

.cover .view span {
    background: #fff;
    color: var(--ink);
    font-size: .78rem;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 100px
}

.ph {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 18px;
    color: #fff
}

.ph .ph-sub {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .85;
    background: rgba(255, 255, 255, .18);
    padding: 4px 10px;
    border-radius: 100px;
    margin-bottom: 10px
}

.ph .ph-title {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.35rem;
    line-height: 1.05
}

.ph .ph-note {
    margin-top: auto;
    font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    opacity: .75
}

.book-card .bc-subj {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--coral)
}

.book-card h3 {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.15rem;
    margin: 5px 0 2px;
    line-height: 1.05
}

.book-card .bc-class {
    font-size: .88rem;
    color: var(--body);
    font-weight: 500
}

/* modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px
}

.modal.open {
    display: flex
}

.modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(24, 20, 14, .5);
    backdrop-filter: blur(5px);
    animation: fade .3s
}

@keyframes fade {
    from {
        opacity: 0
    }
}

.modal-card {
    position: relative;
    background: var(--paper);
    border-radius: 24px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    display: grid;
    grid-template-columns: 320px 1fr;
    box-shadow: 0 40px 90px rgba(20, 16, 11, .4);
    animation: rise .45s cubic-bezier(.34, 1.4, .64, 1)
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(40px) scale(.96)
    }
}

.modal-cover {
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: linear-gradient(160deg, var(--cream), #efe7d8)
}

.m-main {
    width: 100%;
    max-width: 250px
}

.m-main img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 20px 44px rgba(20, 16, 11, .32);
    border: 3px solid #fff;
    display: block
}

.m-gallbl {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--body)
}

.m-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center
}

.m-thumbs button {
    width: 46px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2.5px solid transparent;
    cursor: none;
    padding: 0;
    background: #fff;
    box-shadow: 0 4px 10px rgba(20, 16, 11, .18);
    transition: .15s
}

.m-thumbs button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.m-thumbs button:hover {
    transform: translateY(-2px)
}

.m-thumbs button.on {
    border-color: var(--coral)
}

.modal-cover .ph {
    border-radius: 10px;
    box-shadow: 0 20px 44px rgba(20, 16, 11, .32);
    aspect-ratio: 1/1.414;
    width: 100%;
    max-width: 250px
}

.modal-body {
    padding: 40px 40px 44px
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--paper);
    cursor: none;
    font-size: 1.2rem;
    color: var(--ink);
    display: grid;
    place-items: center;
    z-index: 2;
    transition: .2s
}

.modal-close:hover {
    background: var(--ink);
    color: var(--cream);
    transform: rotate(90deg)
}

.modal-body .m-subj {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--coral);
    border: 1px solid var(--line);
    padding: 5px 12px;
    border-radius: 100px;
    margin-bottom: 16px
}

.modal-body h2 {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -.01em
}

.modal-body .m-class {
    font-size: 1rem;
    color: var(--body);
    margin-top: 8px;
    font-weight: 500
}

.modal-body .m-desc {
    margin-top: 18px;
    line-height: 1.6;
    color: var(--body)
}

.m-sec {
    margin-top: 26px
}

.m-sec h4 {
    font-size: .75rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 14px
}

.m-feats {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.m-feats li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--body);
    font-weight: 500
}

.m-feats li .ic {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--mint);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .8rem;
    font-weight: 700
}

.m-author {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px
}

.m-author .av {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--purple);
    color: #fff;
    display: grid;
    place-items: center;
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.2rem
}

.m-author .an {
    font-weight: 700
}

.m-author .ar {
    font-size: .82rem;
    color: var(--coral);
    font-weight: 600;
    margin: 1px 0 6px
}

.m-author .ab {
    font-size: .9rem;
    color: var(--body);
    line-height: 1.5    
}

.btn {
    font-family: 'Space Grotesk';
    font-weight: 700;
    font-size: 1rem;
    cursor: none;
    padding: 14px 28px;
    border-radius: 100px;
    border: 1.5px solid var(--coral);
    text-decoration: none;
    color: #fff;
    background: var(--coral);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--shadow-sm);
    margin-top: 26px
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(42, 38, 32, .16)
}

/* footer */
footer {
    background: var(--ink);
    color: var(--cream);
    padding: 56px clamp(20px, 6vw, 80px) 34px
}

.foot-in {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    align-items: center
}

.foot-brand {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 1.8rem
}

.foot-brand span {
    color: var(--coral)
}

.foot-in a {
    color: var(--cream);
    text-decoration: none;
    font-weight: 500
}

.foot-in a:hover {
    color: var(--yellow)
}

.foot-note {
    color: #8a8375;
    font-size: .88rem;
    width: 100%;
    text-align: center;
    margin-top: 24px;
    border-top: 1px solid #3a352c;
    padding-top: 20px
}

footer { padding: 70px clamp(20px, 6vw, 80px) 40px; margin-top: 60px }
.foot-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto 50px }
.foot-description { margin-top: 14px; color: #8a8375; max-width: 300px; line-height: 1.6 }
.foot-cols { display: flex; gap: 70px; flex-wrap: wrap }
.foot-col h4 { font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: #8a8375; margin-bottom: 16px }
.foot-col a { display: block; color: var(--cream); text-decoration: none; margin-bottom: 10px; font-weight: 500; transition: .2s }
.foot-col a:hover { color: var(--yellow); transform: translateX(4px) }
.foot-bottom { border-top: 1px solid #333; padding-top: 24px; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #8a8375; font-size: .9rem }

/* responsive */
@media(max-width:820px) {
    .cat-shell {
        grid-template-columns: 1fr;
        gap: 24px
    }

    .cat-side {
        position: static
    }

    .subj-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 6px
    }

    .subj-btn {
        white-space: nowrap;
        background: var(--paper)
    }

    .subj-btn .cnt {
        display: none
    }

    .modal-card {
        grid-template-columns: 1fr;
        max-height: 88vh
    }

    .modal-cover {
        padding: 28px 28px 0
    }

    .modal-cover img,
    .modal-cover .ph {
        max-width: 180px
    }

    .modal-body {
        padding: 28px
    }

    .nav-links a:not(.nav-cta) {
        display: none
    }
}

/* ---------- mobile nav dropdown ---------- */
@media(max-width:900px) {
    nav {
        position: fixed
    }

    .nav-links a:not(.nav-cta) {
        display: none
    }

    .menu-btn {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        border: 2px solid var(--ink);
        border-radius: 12px;
        background: var(--paper);
        cursor: none;
        box-shadow: 2px 2px 0 var(--ink);
        margin-left: 8px
    }

    .menu-btn span {
        width: 18px;
        height: 2px;
        background: var(--ink);
        position: relative;
        display: block
    }

    .menu-btn span::before,
    .menu-btn span::after {
        content: "";
        position: absolute;
        left: 0;
        width: 18px;
        height: 2px;
        background: var(--ink)
    }

    .menu-btn span::before {
        top: -6px
    }

    .menu-btn span::after {
        top: 6px
    }

    nav.open .nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: calc(100% + 10px);
        right: 16px;
        min-width: 210px;
        background: var(--paper);
        border: 2.5px solid var(--ink);
        border-radius: 16px;
        padding: 10px;
        box-shadow: 6px 6px 0 var(--ink);
        z-index: 1001;
        gap: 4px
    }

    nav.open .nav-links a {
        display: block !important;
        text-align: left
    }
}

@media(min-width:901px) {
    .menu-btn {
        display: none !important
    }
}
