@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;800&family=Rajdhani:wght@400;500;600;700&display=swap');

/* Hacking Books — single screen hero */

.hacking-books .site-main {
    padding: 0;
}

.hacking-books .site-main > .container {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0;
}

.books-page {
    display: block;
}

.books-hero {
    position: relative;
    min-height: calc(100vh - 72px);
    display: grid;
    align-items: stretch;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #050505;
}

@supports (height: 100dvh) {
    .books-hero {
        min-height: calc(100dvh - 72px);
    }
}

.books-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 40%, rgba(220, 20, 60, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 55% at 88% 35%, rgba(0, 255, 136, 0.08), transparent 50%),
        linear-gradient(180deg, #080808 0%, #0a0a0a 45%, #050505 100%);
}

.books-hero__grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(220, 20, 60, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 20, 60, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 20%, transparent 78%);
    opacity: 0.85;
}

.books-hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.books-hero__glow--left {
    width: 280px;
    height: 280px;
    left: -40px;
    top: 20%;
    background: rgba(220, 20, 60, 0.22);
}

.books-hero__glow--right {
    width: 320px;
    height: 320px;
    right: 8%;
    bottom: 10%;
    background: rgba(0, 255, 136, 0.1);
}

.books-hero__frame {
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(220, 20, 60, 0.28);
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}

.books-hero__frame::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(220, 20, 60, 0.22);
    border-radius: 2px;
}

.books-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
    min-height: calc(100vh - 72px);
    box-sizing: border-box;
}

@supports (height: 100dvh) {
    .books-hero__inner {
        min-height: calc(100dvh - 72px);
    }
}

.books-hero__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
}

.books-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    font-family: "Rajdhani", sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    width: fit-content;
    margin-bottom: 22px;
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.books-hero.is-ready .books-hero__eyebrow {
    opacity: 1;
    transform: translateY(0);
}

.books-hero__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.8);
    animation: booksPulse 2s ease-in-out infinite;
}

@keyframes booksPulse {
    0%, 100% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.75; }
}

.books-hero__title {
    margin: 0;
    font-family: "Orbitron", "Rajdhani", sans-serif;
    font-size: clamp(30px, 3.2vw, 50px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0.5px;
    color: var(--text);
    opacity: 0;
    transform: translateX(-36px);
    transition: opacity 0.75s ease 0.12s, transform 0.75s ease 0.12s;
}

.books-hero.is-ready .books-hero__title {
    opacity: 1;
    transform: translateX(0);
}

.books-hero__subtitle {
    margin: 18px 0 0;
    max-width: 58ch;
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.75s ease 0.24s, transform 0.75s ease 0.24s;
}

.books-hero.is-ready .books-hero__subtitle {
    opacity: 1;
    transform: translateY(0);
}

.books-hero__metrics {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    max-width: 420px;
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.75s ease 0.36s, transform 0.75s ease 0.36s;
}

.books-hero.is-ready .books-hero__metrics {
    opacity: 1;
    transform: translateY(0);
}

.books-metric {
    padding: 12px 10px;
    border: 1px solid rgba(220, 20, 60, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
}

.books-metric__value {
    font-family: "Orbitron", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}

.books-metric__label {
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.books-hero__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
    padding: 10px 0;
    opacity: 0;
    transform: translateX(28px);
    transition: opacity 0.85s ease 0.2s, transform 0.85s ease 0.2s;
}

.books-hero.is-ready .books-hero__media {
    opacity: 1;
    transform: translateX(0);
}

.books-hero__media-shell {
    position: absolute;
    inset: 4% 2%;
    border: 1px solid rgba(220, 20, 60, 0.22);
    border-radius: 16px;
    overflow: hidden;
    pointer-events: none;
}

.books-hero__media-shell::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(0, 255, 136, 0.18);
    border-radius: 12px;
}

.books-hero__media-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(220, 20, 60, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 20, 60, 0.08) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.7;
}

.books-hero__corner {
    position: absolute;
    width: 22px;
    height: 22px;
    border-color: rgba(0, 255, 136, 0.45);
    border-style: solid;
}

.books-hero__corner--tl {
    top: 10px;
    left: 10px;
    border-width: 2px 0 0 2px;
}

.books-hero__corner--tr {
    top: 10px;
    right: 10px;
    border-width: 2px 2px 0 0;
}

.books-hero__corner--bl {
    bottom: 10px;
    left: 10px;
    border-width: 0 0 2px 2px;
}

.books-hero__corner--br {
    bottom: 10px;
    right: 10px;
    border-width: 0 2px 2px 0;
}

.books-hero__float {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid rgba(220, 20, 60, 0.35);
    border-radius: 999px;
    background: rgba(10, 10, 10, 0.72);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    animation: booksFloat 4.5s ease-in-out infinite;
}

.books-hero__float i {
    color: var(--accent);
    font-size: 14px;
}

.books-hero__float--1 {
    top: 14%;
    left: 4%;
    animation-delay: 0s;
}

.books-hero__float--2 {
    top: 22%;
    right: 2%;
    animation-delay: 0.6s;
}

.books-hero__float--3 {
    bottom: 22%;
    left: 6%;
    animation-delay: 1.2s;
}

.books-hero__float--4 {
    bottom: 14%;
    right: 4%;
    animation-delay: 1.8s;
}

@keyframes booksFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.books-hero__media-ring-outer {
    position: absolute;
    width: min(500px, 94%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px dashed rgba(0, 255, 136, 0.16);
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: booksRingSpin 18s linear infinite;
}

@keyframes booksRingSpin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.books-hero__media-ring {
    position: absolute;
    width: min(440px, 86%);
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 136, 0.28);
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.books-hero__media-ring::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    border: 1px dashed rgba(220, 20, 60, 0.28);
}

.books-hero__img {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    height: auto;
    max-height: min(78vh, 700px);
    object-fit: contain;
    object-position: center center;
}

/* Light theme */
body[data-theme="light"] .books-hero__float {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(220, 20, 60, 0.25);
}

body[data-theme="light"] .books-hero__media-shell {
    border-color: rgba(220, 20, 60, 0.16);
}

body[data-theme="light"] .books-hero {
    background: #f4f4f4;
}

body[data-theme="light"] .books-hero__bg {
    background:
        radial-gradient(ellipse 80% 60% at 15% 40%, rgba(220, 20, 60, 0.1), transparent 55%),
        radial-gradient(ellipse 70% 55% at 88% 35%, rgba(0, 173, 93, 0.08), transparent 50%),
        linear-gradient(180deg, #ffffff 0%, #f7f7f7 50%, #efefef 100%);
}

body[data-theme="light"] .books-hero__grid-lines {
    background-image:
        linear-gradient(rgba(220, 20, 60, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220, 20, 60, 0.06) 1px, transparent 1px);
}

body[data-theme="light"] .books-hero__eyebrow {
    color: #111111;
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .books-metric {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(220, 20, 60, 0.22);
}

body[data-theme="light"] .books-metric__label {
    color: rgba(0, 0, 0, 0.58);
}

body[data-theme="light"] .books-hero__frame {
    border-color: rgba(220, 20, 60, 0.22);
}

body[data-theme="light"] .books-hero__frame::before {
    border-color: rgba(220, 20, 60, 0.18);
}

/* Bottom cut line */
.books-hero::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(220, 20, 60, 0.55), rgba(0, 255, 136, 0.45), transparent);
    z-index: 2;
}

@media (max-width: 980px) {
    .books-hero__inner {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 28px 20px 20px;
        text-align: center;
    }

    .books-hero__copy {
        align-items: center;
    }

    .books-hero__eyebrow {
        margin-left: auto;
        margin-right: auto;
    }

    .books-hero__subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .books-hero__metrics {
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: min(100%, 420px);
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .books-hero__float {
        display: none;
    }

    .books-hero__media {
        order: -1;
        min-height: 320px;
        padding: 0;
    }

    .books-hero__media-ring {
        width: min(360px, 84%);
        top: 50%;
    }

    .books-hero__img {
        width: min(100%, 460px);
        max-height: 50vh;
    }
}

@media (max-width: 560px) {
    .books-hero__frame {
        inset: 8px;
    }

    .books-hero__metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 100%;
        width: 100%;
        gap: 8px;
    }

    .books-metric {
        padding: 10px 6px;
    }

    .books-metric__value {
        font-size: clamp(14px, 4.2vw, 18px);
    }

    .books-metric__label {
        font-size: 9px;
        letter-spacing: 0.4px;
    }

    .books-hero__title {
        font-size: clamp(24px, 7vw, 32px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .books-hero__eyebrow,
    .books-hero__title,
    .books-hero__subtitle,
    .books-hero__metrics,
    .books-hero__media {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .books-hero__dot {
        animation: none;
    }

    .books-hero__float,
    .books-hero__media-ring-outer {
        animation: none;
    }
}

/* Books library + filters */
.books-library {
    padding: 40px 24px 64px;
    background: var(--bg);
    border-top: 1px solid rgba(220, 20, 60, 0.2);
}

.books-library__intro {
    max-width: 1400px;
    margin: 0 auto 32px;
    padding: 0 4px;
}

.books-library__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
}

.books-library__intro-icon {
    width: 20px;
    height: 20px;
}

.books-library__heading {
    margin: 0 0 10px;
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(32px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
}

.books-library__desc {
    margin: 0;
    max-width: 720px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.books-library__wrap {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(380px, 420px) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.books-filters {
    position: sticky;
    top: 88px;
    padding: 28px 24px;
    border: 1px solid rgba(220, 20, 60, 0.35);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    min-height: 620px;
    overflow: visible;
}

.books-filters__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px dashed rgba(220, 20, 60, 0.25);
}

.books-filters__title {
    margin: 0;
    font-family: "Rajdhani", sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.books-filters__icon {
    display: block;
    flex-shrink: 0;
    fill: currentColor;
}

.books-filters__icon--title {
    width: 28px;
    height: 28px;
    color: var(--accent);
}

.books-filters__icon--label {
    width: 18px;
    height: 18px;
    color: var(--accent);
}

.books-filters__icon--field {
    width: 22px;
    height: 22px;
    color: var(--muted);
}

.books-filters__icon--chip {
    width: 16px;
    height: 16px;
    color: var(--accent);
    opacity: 0.9;
}

.books-filters__icon--dropdown {
    width: 20px;
    height: 20px;
    color: var(--accent);
}

.books-filters__icon--chevron {
    width: 20px;
    height: 20px;
    color: var(--muted);
    transition: transform 180ms ease, color 180ms ease;
}

.books-filters__icon--option {
    width: 18px;
    height: 18px;
    color: var(--accent);
    opacity: 0;
    flex-shrink: 0;
    transition: opacity 140ms ease;
}

.books-filters__clear {
    border: 1px solid rgba(220, 20, 60, 0.35);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.books-filters__clear .books-filters__icon {
    width: 18px;
    height: 18px;
}

.books-filters__clear:hover {
    background: rgba(220, 20, 60, 0.12);
}

.books-filters__group {
    margin-bottom: 24px;
}

.books-filters__group:last-child {
    margin-bottom: 0;
}

.books-filters__label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--muted);
}

.books-filters__search {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    min-height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.books-filters__search:focus-within {
    border-color: rgba(220, 20, 60, 0.5);
    box-shadow: inset 3px 0 0 var(--accent);
}

.books-filters__search i {
    display: none;
}

.books-filters__dropdown-btn {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    text-align: left;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    color: var(--text);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.books-filters__dropdown-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(220, 20, 60, 0.28);
    border-radius: 4px;
    background: rgba(220, 20, 60, 0.1);
}

.books-filters__dropdown-btn-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.books-filters__dropdown-btn-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
}

.books-filters__dropdown-btn:hover,
.books-filters__dropdown.is-open .books-filters__dropdown-btn {
    border-color: rgba(220, 20, 60, 0.5);
    box-shadow: inset 3px 0 0 var(--accent);
}

.books-filters__dropdown.is-open .books-filters__icon--chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.books-filters__dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    top: auto;
    left: 0;
    right: 0;
    z-index: 40;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid rgba(220, 20, 60, 0.4);
    border-radius: 4px;
    background: #141414;
    max-height: calc(6 * 46px + 12px);
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 20, 60, 0.55) rgba(255, 255, 255, 0.06);
}

.books-filters__dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.books-filters__dropdown-menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
}

.books-filters__dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(220, 20, 60, 0.55);
    border-radius: 4px;
}

.books-filters__dropdown-menu[hidden] {
    display: none;
}

.books-filters__dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 3px;
    cursor: pointer;
    color: #f2f2f2;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    border: 1px solid transparent;
    transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.books-filters__dropdown-item-text {
    min-width: 0;
    flex: 1;
}

.books-filters__dropdown-item:hover {
    background: rgba(220, 20, 60, 0.12);
    border-color: rgba(220, 20, 60, 0.2);
}

.books-filters__dropdown-item.is-selected {
    background: rgba(220, 20, 60, 0.2);
    border-color: rgba(220, 20, 60, 0.35);
    color: #ffffff;
    font-weight: 600;
}

.books-filters__dropdown-item.is-selected .books-filters__icon--option {
    opacity: 1;
}

.books-filters__input,
.books-filters__select {
    width: 100%;
    outline: none;
    color: var(--text);
    font: inherit;
    font-size: 16px;
}

.books-filters__input {
    border: 0;
    background: transparent;
    padding: 14px 0;
    flex: 1;
    min-width: 0;
}

.books-filters__dropdown {
    position: relative;
}

.books-filters__select--native {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
    white-space: nowrap;
}

.books-filters__options {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
}

.books-filter-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    min-height: 48px;
    border: 1px solid rgba(220, 20, 60, 0.32);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    flex: 1 1 calc(33.333% - 12px);
    min-width: 0;
}

.books-filter-chip:has(input:checked) {
    background: rgba(220, 20, 60, 0.16);
    border-color: rgba(220, 20, 60, 0.55);
    box-shadow: inset 0 0 0 1px rgba(220, 20, 60, 0.25);
}

.books-filter-chip:has(input:checked) .books-filters__icon--chip {
    color: var(--accent);
    opacity: 1;
}

.books-filter-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.books-library__main {
    min-width: 0;
}

.books-library__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px 18px;
    border: 1px solid rgba(220, 20, 60, 0.22);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.books-library__toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(220, 20, 60, 0.35);
    border-radius: 4px;
    background: rgba(220, 20, 60, 0.08);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.books-library__toolbar-icon,
.books-library__count-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.books-library__count {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: "Rajdhani", sans-serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text);
}

.books-library__count-icon {
    color: var(--accent);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.book-card {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: border-color 160ms ease, transform 160ms ease;
}

.book-card:hover {
    border-color: rgba(220, 20, 60, 0.45);
    transform: translateY(-3px);
}

.book-card.is-hidden {
    display: none;
}

.book-card__cover {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    width: 100%;
    background: linear-gradient(145deg, rgba(220, 20, 60, 0.2), rgba(220, 20, 60, 0.05));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

.book-card__cover-icon {
    width: 64px;
    height: 64px;
    opacity: 0.9;
    animation: bookCardIconFloat 3.2s ease-in-out infinite;
}

@keyframes bookCardIconFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.05); }
}

.book-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    flex: 1;
}

.book-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.book-card__author {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--muted);
}

.book-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 6px;
}

.book-card__tag,
.book-card__lang,
.book-card__price,
.book-card__level {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.book-card__tag {
    border: 1px solid rgba(220, 20, 60, 0.32);
    background: rgba(220, 20, 60, 0.1);
    color: var(--text);
}

.book-card__lang,
.book-card__level {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
}

.book-card__price--free {
    border-color: rgba(0, 255, 136, 0.35);
    background: rgba(0, 255, 136, 0.1);
    color: #00ff88;
}

.book-card__price--paid {
    border-color: rgba(220, 20, 60, 0.35);
    background: rgba(220, 20, 60, 0.1);
    color: var(--accent);
}

.book-card__download {
    display: block;
    width: 100%;
    margin-top: 14px;
    text-decoration: none;
}

.books-btn-3d--card {
    min-width: 100%;
    min-height: 3.5em;
}

.books-btn-3d--card .books-btn-3d__top {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.book-card__download-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* Book detail placeholder page */
.book-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 56px;
}

.book-detail__back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
}

.book-detail__back svg {
    width: 20px;
    height: 20px;
}

.book-detail__card {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    padding: 24px;
    border: 1px solid rgba(220, 20, 60, 0.28);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.book-detail__cover {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border: 1px solid rgba(220, 20, 60, 0.22);
    border-radius: 4px;
    background: linear-gradient(145deg, rgba(220, 20, 60, 0.2), rgba(220, 20, 60, 0.05));
    color: var(--accent);
}

.book-detail__cover svg {
    width: 72px;
    height: 72px;
}

.book-detail__eyebrow {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
}

.book-detail__title {
    margin: 0 0 10px;
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(28px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
}

.book-detail__author {
    margin: 0 0 16px;
    font-size: 16px;
    color: var(--muted);
}

.book-detail__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.book-detail__meta span {
    padding: 5px 10px;
    border: 1px solid rgba(220, 20, 60, 0.28);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.book-detail__note {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--muted);
}

@media (max-width: 720px) {
    .book-detail__card {
        grid-template-columns: 1fr;
    }
}

/* Books pagination — 3D prev/next */
.books-pagination {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 24px;
    margin-top: 28px;
    padding-top: 8px;
}

.books-pagination[hidden] {
    display: none;
}

.books-pagination__info {
    margin: 0;
    min-width: 140px;
    text-align: center;
    font-family: "Rajdhani", sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
    white-space: nowrap;
}

.books-btn-3d {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    border: 0;
    padding: 0 8px;
    min-width: 4.25em;
    min-height: 4.25em;
    box-sizing: border-box;
    background: transparent;
    font: inherit;
    cursor: pointer;
    border-radius: 4px;
}

.books-btn-3d:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.books-btn-3d__top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    padding: 10px 18px;
    transform: translateY(0);
    color: #ffffff;
    background-image: linear-gradient(145deg, #dc143c, #8b0000);
    border-radius: 4px;
    transition: transform 0.25s ease, border-radius 0.25s ease, background 0.25s ease;
}

.books-btn-3d__top svg {
    width: 28px;
    height: 28px;
    display: block;
}

.books-btn-3d:not(:disabled):active .books-btn-3d__top {
    border-radius: 3px;
    transform: translateY(2px);
    background-image: linear-gradient(145deg, #8b0000, #dc143c);
}

.books-btn-3d__bottom {
    position: absolute;
    z-index: 1;
    bottom: 4px;
    left: 4px;
    border-radius: 4px;
    padding-top: 6px;
    width: calc(100% - 8px);
    height: calc(100% - 10px);
    background-image: linear-gradient(145deg, #a01030, #6d0000);
    transition: border-radius 0.2s ease, padding-top 0.2s ease;
}

.books-btn-3d__base {
    position: absolute;
    z-index: 0;
    top: 4px;
    left: 0;
    border-radius: 4px;
    width: 100%;
    height: calc(100% - 4px);
    background-color: rgba(0, 0, 0, 0.2);
    transition: border-radius 0.2s ease;
}

.books-btn-3d:not(:disabled):active .books-btn-3d__bottom {
    border-radius: 3px;
    padding-top: 0;
}

.books-btn-3d:not(:disabled):active .books-btn-3d__base {
    border-radius: 3px;
}

.books-library__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 12px 0 0;
    padding: 48px 28px 40px;
    min-height: 420px;
    border: 1px solid rgba(220, 20, 60, 0.28);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(220, 20, 60, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.books-library__empty[hidden] {
    display: none !important;
}

.books-empty__scene {
    position: relative;
    width: 220px;
    height: 220px;
    margin-bottom: 28px;
    perspective: 900px;
}

.books-empty__ring {
    position: absolute;
    inset: 50%;
    border: 1px solid rgba(220, 20, 60, 0.35);
    border-radius: 4px;
    transform: translate(-50%, -50%);
    animation: booksEmptyRing 4s ease-in-out infinite;
}

.books-empty__ring--1 {
    width: 200px;
    height: 200px;
    animation-delay: 0s;
}

.books-empty__ring--2 {
    width: 170px;
    height: 170px;
    animation-delay: 0.4s;
    opacity: 0.7;
}

.books-empty__ring--3 {
    width: 140px;
    height: 140px;
    animation-delay: 0.8s;
    opacity: 0.45;
}

@keyframes booksEmptyRing {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
    50% { transform: translate(-50%, -50%) rotate(6deg) scale(1.04); }
}

.books-empty__svg {
    position: relative;
    z-index: 2;
    width: 200px;
    height: 200px;
    color: var(--accent);
    transform-style: preserve-3d;
    animation: booksEmptySceneFloat 3.6s ease-in-out infinite;
}

@keyframes booksEmptySceneFloat {
    0%, 100% { transform: translateY(0) rotateX(10deg) rotateY(-8deg); }
    50% { transform: translateY(-12px) rotateX(14deg) rotateY(10deg); }
}

.books-empty__book--back {
    transform-origin: center;
    animation: booksEmptyBookBack 3.6s ease-in-out infinite;
}

.books-empty__book--mid {
    transform-origin: center;
    animation: booksEmptyBookMid 3.6s ease-in-out infinite;
}

.books-empty__book--front {
    transform-origin: center;
    animation: booksEmptyBookFront 3.6s ease-in-out infinite;
}

@keyframes booksEmptyBookBack {
    0%, 100% { transform: translate(0, 6px); }
    50% { transform: translate(-4px, 0); }
}

@keyframes booksEmptyBookMid {
    0%, 100% { transform: translate(0, 3px); }
    50% { transform: translate(2px, -4px); }
}

@keyframes booksEmptyBookFront {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(4px, -8px); }
}

.books-empty__search {
    transform-origin: 142px 126px;
    animation: booksEmptySearch 2.8s ease-in-out infinite;
}

@keyframes booksEmptySearch {
    0%, 100% { transform: rotate(0deg) translate(0, 0); }
    50% { transform: rotate(-12deg) translate(-4px, -6px); }
}

.books-empty__title {
    margin: 0 0 10px;
    font-family: "Rajdhani", sans-serif;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text);
}

.books-empty__text {
    margin: 0 0 22px;
    max-width: 520px;
    font-size: 16px;
    line-height: 1.6;
    color: var(--muted);
}

.books-empty__action {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid rgba(220, 20, 60, 0.45);
    border-radius: 4px;
    background: rgba(220, 20, 60, 0.12);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
}

.books-empty__action:hover {
    background: rgba(220, 20, 60, 0.2);
    border-color: rgba(220, 20, 60, 0.6);
}

.books-empty__action-icon {
    width: 18px;
    height: 18px;
}

body[data-theme="light"] .books-filters,
body[data-theme="light"] .book-card {
    background: rgba(255, 255, 255, 0.88);
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .books-filters__search {
    border-color: rgba(0, 0, 0, 0.12);
    background: rgba(0, 0, 0, 0.03);
}

body[data-theme="light"] .books-filters__dropdown-btn {
    border-color: rgba(0, 0, 0, 0.12);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.01) 100%);
}

body[data-theme="light"] .books-filters__dropdown-btn-icon {
    background: rgba(220, 20, 60, 0.08);
    border-color: rgba(220, 20, 60, 0.22);
}

body[data-theme="light"] .books-filters__dropdown-btn-chevron {
    background: rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .books-filters__dropdown-menu {
    background: #ffffff;
    border-color: rgba(220, 20, 60, 0.25);
    scrollbar-color: rgba(220, 20, 60, 0.45) rgba(0, 0, 0, 0.06);
}

body[data-theme="light"] .books-filters__dropdown-item {
    color: #111111;
}

body[data-theme="light"] .books-filters__dropdown-item.is-selected {
    color: #111111;
    background: rgba(220, 20, 60, 0.12);
}

body[data-theme="light"] .books-filter-chip {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(220, 20, 60, 0.22);
}

body[data-theme="light"] .book-card__lang,
body[data-theme="light"] .book-card__level {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.04);
}

body[data-theme="light"] .book-card__price--free {
    color: #00884a;
}

body[data-theme="light"] .books-library__empty {
    background: linear-gradient(180deg, rgba(220, 20, 60, 0.05) 0%, rgba(0, 0, 0, 0.02) 100%);
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .books-library__toolbar {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .books-btn-3d__base {
    background-color: rgba(0, 0, 0, 0.08);
}

@media (max-width: 980px) {
    .books-library {
        padding: 28px 16px 48px;
    }

    .books-library__wrap {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .books-filters {
        position: static;
        display: none;
        min-height: auto;
        width: 100%;
        padding: 24px 18px;
    }

    .books-filters.is-open {
        display: block;
    }

    .books-filter-chip {
        flex: 1 1 calc(33.333% - 8px);
        padding: 11px 10px;
        font-size: 13px;
    }

    .books-library__toggle {
        display: inline-flex;
    }

    .books-library__intro {
        margin-bottom: 24px;
    }

    .books-library__heading {
        font-size: 28px;
    }

    .books-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .books-library__empty {
        min-height: 360px;
        padding: 36px 20px 32px;
    }

    .books-empty__scene {
        width: 180px;
        height: 180px;
    }

    .books-empty__svg {
        width: 170px;
        height: 170px;
    }
}

@media (max-width: 560px) {
    .books-grid {
        grid-template-columns: 1fr;
    }

    .books-library__count {
        font-size: 18px;
    }
}
