/* ===================== RESET & BASE ===================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navH: 56px;
    --max: 1400px;
}

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

body {
    background: #000;
    color: #fff;
    min-height: 100vh;
    font-family: "Space Grotesk", sans-serif;
}

/* ===================== TOP NAVIGATION ===================== */

.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navH);
    display: flex;
    align-items: center;
    z-index: 999;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    transition: opacity 400ms ease, transform 400ms ease;
}

.navInner {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.brand {
    font-family: "Unbounded", sans-serif;
    font-weight: 500;
    letter-spacing: -0.02em;
    font-size: 22px;
    white-space: nowrap;
    transform: translateY(1px);
}

.navLinks {
    display: flex;
    align-items: center;
    gap: 18px;
}

.navLinks a {
    font-family: "IBM Plex Mono", monospace;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 13px;
    color: rgba(255, 255, 255, .78);
    padding: 9px 7px 9px 9px;
    border: 1px solid transparent;
    transform: translateY(1px);
}

.navLinks a:hover {
    color: rgba(255, 255, 255, .95);
    border-color: rgba(255, 255, 255, .18);
}

.navLinks a.is-active {
    color: rgba(255, 255, 255, .95);
    border-color: rgba(255, 255, 255, .22);
}

/* ===================== WAITLIST CTA ===================== */

@property --angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.navLinks a[href="waitlist.html"] {
    color: rgba(255, 255, 255, 0.95);
    position: relative;
    padding: 9px 14px;
    border: 1px solid transparent;
    background:
        linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)) padding-box,
        conic-gradient(from var(--angle), #ff2d9b, #00ff88, #ff2d9b) border-box;
    animation: rotateBorder 3s linear infinite;
}

@keyframes rotateBorder {
    to {
        --angle: 360deg;
    }
}

.navLinks a[href="waitlist.html"]:hover {
    color: #fff;
    background:
        linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)) padding-box,
        conic-gradient(from var(--angle), #ff2d9b, #00ff88, #ff2d9b) border-box;
    box-shadow:
        0 0 10px rgba(255, 45, 155, 0.35),
        0 0 22px rgba(0, 255, 136, 0.2);
}

/* ===================== INTRO SEQUENCE ===================== */

body:not(.nav-ready) .topnav {
    opacity: 0;
    transform: translateY(-100%);
    transition: none;
}

body.nav-ready .topnav {
    opacity: 1;
    transform: translateY(0);
}

/* ===================== EXIT SEQUENCE ===================== */

body.is-exiting .topnav {
    opacity: 0 !important;
    transform: translateY(-100%) !important;
}

/* ===================== PAGE LAYOUT ===================== */

.pageWrap {
    padding-top: calc(var(--navH) + 80px);
    padding-bottom: 140px;
}

.booksHeader {
    max-width: 1100px;
    margin: 0 auto 110px;
    padding: 0 40px;
    text-align: center;
}

.booksHeaderTitle {
    font-family: "Unbounded", sans-serif;
    font-size: clamp(48px, 5vw, 55px);
    font-weight: 400;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.8;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 800ms ease, transform 800ms ease;
}

.booksHeaderTitle.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Two-column grid ── */

.booksGrid {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 88px 56px;
}

.bookCard:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.bookCard {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms ease, transform 700ms ease;
}

.bookCard.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.coverWrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.coverWrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 600ms ease;
}

.coverWrap img.loaded {
    opacity: 1;
}

.bookInfo {
    padding: 20px 0 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bookNum {
    font-family: "IBM Plex Mono", monospace;
    font-size: 13px;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.30);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.bookTitle {
    font-family: "Space Grotesk", sans-serif;
    font-size: 21px;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.90);
    line-height: 1.3;
}

.bookSubtitle {
    font-family: "Space Grotesk", sans-serif;
    font-size: 19px;
    color: rgb(255, 255, 255);
    line-height: 1.55;
    margin-top: 1px;
}

/* ===================== FOOTER ===================== */

footer {
    font-family: "Space Grotesk";
    padding: 90px 0 10px;
    text-align: center;
}

.colophon {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.colophonTitle,
.colophonSubtitle,
.colophonAuthor,
.colophonPoem,
.colophonMeta,
.colophonCopyright {
    color: #ffffff;
}

.colophonTitle {
    font-family: "Space Grotesk";
    font-size: 32px;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.colophonSubtitle {
    font-family: "Space Grotesk";
    font-size: 28px;
    margin-bottom: 50px;
    letter-spacing: 0.12em;
}

.colophonAuthor {
    font-size: 28px;
    margin-bottom: 100px;
    letter-spacing: 0.12em;
}

.colophonPoem {
    font-size: 20px;
    line-height: 2.0;
    max-width: 520px;
    margin-bottom: 120px;
}

.colophonMeta {
    font-size: 14px;
    line-height: 1.9;
    padding-bottom: 100px;
}

.colophonCopyright {
    font-size: 13px;
    opacity: 0.5;
}

/* ===================== RESPONSIVE ===================== */


/* ===================== MENU TOGGLE ===================== */

.menuToggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .28);
    color: rgba(255, 255, 255, .82);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    /* letter-spacing adds .18em of space after the last character,
       shifting text visually right of centre. Compensate with padding-left. */
    padding: 7px 0 7px .3em;
    width: 60px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 200ms ease, color 200ms ease;
    flex-shrink: 0;
}

.menuToggle:hover {
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
}

/* ===================== FULL-SCREEN NAV PANEL ===================== */

.navPanel {
    position: fixed;
    inset: 0;
    z-index: 1002;
    background: rgba(3, 3, 3, .97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    transition: opacity 500ms ease;
    pointer-events: none;
}

.navPanel.is-open {
    opacity: 1;
    pointer-events: auto;
}

.navPanelClose {
    position: absolute;
    top: calc(var(--navH) / 2);
    right: 28px;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .28);
    color: rgba(255, 255, 255, .72);
    font-family: "IBM Plex Mono", monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 7px 0 7px .3em;
    width: 60px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 180ms ease, color 180ms ease;
}

.navPanelClose:hover {
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
}

.navPanelLinks {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: var(--navH) 0;
    box-sizing: border-box;
}

.navPanelLinks a {
    display: inline-block;
    text-decoration: none;
    font-family: "IBM Plex Mono", monospace;
    font-size: clamp(14px, 3.8vw, 20px);
    letter-spacing: .22em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .65);
    -webkit-tap-highlight-color: transparent;
    transition: color 160ms ease;
    padding: 6px 20px;
    cursor: pointer;
}

.navPanelLinks a:hover,
.navPanelLinks a.is-active {
    color: #fff;
}

/* ===================== RESPONSIVE ≤ 900px ===================== */

@media (max-width: 900px) {
    .navLinks {
        display: none;
    }

    .menuToggle {
        display: flex;
        margin-left: auto;
    }

    .navPanelClose {
        right: 20px;
    }

    .navInner {
        padding: 0 20px;
    }
}

/* ===================== RESPONSIVE ≤ 640px ===================== */

@media (max-width: 640px) {
    :root {
        --navH: 56px;
    }

    .brand {
        font-size: 19px;
    }

    .navInner {
        padding: 0 20px;
    }

    .navPanelClose {
        right: 20px;
    }
}

@media (max-width: 780px) {
    .booksGrid {
        grid-template-columns: 1fr;
        gap: 60px;
        padding: 0 20px;
    }

    .bookCard:last-child:nth-child(odd) {
        grid-column: auto;
        max-width: none;
        margin: 0;
    }

    .booksHeader {
        padding: 0 20px;
        margin-bottom: 48px;
    }

    .pageWrap {
        padding-top: calc(var(--navH) + 40px);
    }
}

/* ===================== SCROLL HINT ARROW ===================== */

.scrollHint {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    opacity: 1;
    transition: opacity 600ms ease;
    pointer-events: none;
    animation: scrollBounce 1.8s ease-in-out infinite;
}

.scrollHint.is-hidden {
    opacity: 0;
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(6px);
    }
}

/* ===================== MOBILE LINE BREAKS ===================== */

br.mobile-br {
    display: none;
}

@media (max-width: 780px) {
    br.mobile-br {
        display: block;
    }
}