/* ==========================================================================
   POOJA BOOK SHOP — "The Open Book" theme
   One stylesheet, mobile-first. Sections:
    01. Tokens          02. Reset & base       03. Utilities
    04. Buttons, chips & price tags            05. Header & navigation
    06. Preloader, page turn, cursor, toast    07. Hero (open book)
    08. Section scaffolding & dividers         09. Category shelf
    10. Product cards & grids                  11. Why choose us
    12. Stats & bookshelf strip                13. Back-to-school corner
    14. Testimonials                           15. Visit us & maps
    16. Page hero & breadcrumb                 17. Products page (filters)
    18. Product detail & missing page          19. About page
    20. Contact page                           21. Footer
    22. Scroll reveal animations               23. Keyframes
    24. Responsive breakpoints                 25. Reduced motion
   ========================================================================== */

/* ---------- 01. Tokens ---------- */
:root {
    --ink: #1F1B16;
    --paper: #FBF6EC;
    --parchment: #F1E7D3;
    --maroon: #7A1F2B;
    --gold: #C9A24D;
    --forest: #2F4F3E;
    --pencil: #E8A33D;

    --maroon-dark: #5C1520;
    --ink-soft: #4A4239;
    --line: rgba(31, 27, 22, .14);
    --wood: #7B4E32;
    --wood-dark: #5A3722;

    --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Space Mono", "Courier Prime", "Courier New", monospace;
    --font-hand: "Caveat", "Segoe Print", cursive;

    --header-h: 68px;
    --radius: 14px;
    --container: 1240px;
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --ease-book: cubic-bezier(.645, .045, .355, 1);

    --shadow-desk: 0 1px 1px rgba(31, 27, 22, .08), 0 6px 12px -4px rgba(31, 27, 22, .18), 0 18px 30px -16px rgba(31, 27, 22, .35);
    --shadow-lift: 0 2px 2px rgba(31, 27, 22, .08), 0 14px 22px -8px rgba(31, 27, 22, .28), 0 34px 50px -24px rgba(31, 27, 22, .45);

    /* paper grain — inline SVG noise, no external image */
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .12 0 0 0 0 .1 0 0 0 0 .08 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 02. Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--grain), var(--paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; color: var(--ink); }
p { margin: 0 0 1em; }
a { color: var(--maroon); text-underline-offset: 3px; }
a:hover { color: var(--maroon-dark); }
ul, ol { padding: 0; margin: 0; list-style: none; }
address { font-style: normal; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- 03. Utilities ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: 16px; top: -60px; z-index: 10001;
    background: var(--ink); color: var(--paper); padding: .6rem 1rem; border-radius: 8px;
    text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; color: var(--paper); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; margin-top: 2.5rem; }
.center .btn { margin: .3rem; }

.eyebrow {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: .78rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--maroon);
    margin-bottom: .6rem;
}
.eyebrow::before { content: "§ "; color: var(--gold); }
.eyebrow--ink { color: var(--ink); }
.eyebrow--ink::before { color: var(--maroon); }

.text-link {
    font-weight: 800; font-size: .92rem; text-decoration: none; color: var(--maroon);
    background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 2px;
    transition: background-size .3s var(--ease-out);
    padding-bottom: 2px;
}
.text-link:hover { background-size: 100% 2px; }

/* ---------- 04. Buttons, chips & price tags ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .78rem 1.5rem .85rem;
    border: 2px solid var(--maroon);
    border-radius: 999px;
    background: var(--maroon);
    color: var(--paper);
    font-family: var(--font-body);
    font-weight: 800;
    font-size: .98rem;
    letter-spacing: .01em;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 14px -8px rgba(122, 31, 43, .8);
    transition: background-color .25s, color .25s, box-shadow .25s, transform .2s;
}
/* gold "pencil stroke" that draws in from left to right on hover */
.btn::after {
    content: "";
    position: absolute;
    left: 1.3rem; right: 1.3rem; bottom: .38rem;
    height: 3px;
    border-radius: 3px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 6' preserveAspectRatio='none'%3E%3Cpath d='M1 4C20 2 30 5 50 3s35 1 49-1' fill='none' stroke='%23C9A24D' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform .45s var(--ease-out);
    pointer-events: none;
}
.btn:hover, .btn:focus-visible { color: var(--paper); background: var(--maroon-dark); border-color: var(--maroon-dark); box-shadow: 0 10px 20px -10px rgba(122, 31, 43, .9); }
.btn:hover::after, .btn:focus-visible::after { transform: scaleX(1); }
.btn:active { transform: translateY(1px); }
.btn:hover .icon--envelope, .btn:focus-visible .icon--envelope { animation: wiggle .55s ease-in-out; }
.btn .icon { flex-shrink: 0; }

.btn--ghost { background: transparent; color: var(--maroon); box-shadow: none; }
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--maroon); color: var(--paper); }
.btn--ink { background: var(--ink); border-color: var(--ink); box-shadow: 0 6px 14px -8px rgba(0,0,0,.7); }
.btn--ink:hover, .btn--ink:focus-visible { background: #000; border-color: #000; }
.btn--ghost-ink { color: var(--ink); border-color: var(--ink); }
.btn--ghost-ink:hover, .btn--ghost-ink:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--small { padding: .5rem 1rem .55rem; font-size: .88rem; }
.btn--small::after { bottom: .22rem; left: 1rem; right: 1rem; }
.btn--large { padding: 1rem 2rem 1.05rem; font-size: 1.08rem; }
.btn--visit { background: var(--forest); border-color: var(--forest); box-shadow: 0 6px 14px -8px rgba(47, 79, 62, .9); }
.btn--visit:hover, .btn--visit:focus-visible { background: #22392d; border-color: #22392d; }
.btn.is-copied { background: var(--gold); border-color: var(--gold); color: var(--ink); animation: pop .4s var(--ease-out); }

.btn-icon {
    display: inline-grid; place-items: center;
    width: 42px; height: 42px; flex-shrink: 0;
    border: 2px solid var(--line); border-radius: 50%;
    background: var(--paper); color: var(--ink-soft);
    transition: border-color .2s, color .2s, background-color .2s;
}
.btn-icon:hover { border-color: var(--maroon); color: var(--maroon); }
.btn-icon.is-copied { background: var(--gold); border-color: var(--gold); color: var(--ink); animation: pop .4s var(--ease-out); }

/* Category chip — like a sticky note / library index tab */
.chip {
    display: inline-block;
    align-self: flex-start;
    padding: .2rem .6rem .18rem;
    font-family: var(--font-mono);
    font-size: .68rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--maroon);
    background: #F5E1DF;
    border-left: 4px solid var(--maroon);
    border-radius: 2px 6px 6px 2px;
    clip-path: polygon(0 0, 100% 0, 100% 72%, calc(100% - 8px) 100%, 0 100%);
    rotate: -1.5deg;
    transition: rotate .25s, translate .25s;
}
.chip:hover { rotate: 0deg; translate: 0 -2px; color: var(--maroon-dark); }
.chip--forest { color: var(--forest); background: #DDE8E1; border-color: var(--forest); }
.chip--gold   { color: #6E5418; background: #F4EAD0; border-color: var(--gold); }
.chip--pencil { color: #7A4A06; background: #FCE7C6; border-color: var(--pencil); }

/* Price tag with a string hole (CSS only) */
.price-tag {
    position: relative;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    padding: .28rem .8rem .28rem 2.35rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
    white-space: nowrap;
    /* the string */
    background: linear-gradient(155deg, transparent 44%, var(--ink-soft) 45%, var(--ink-soft) 52%, transparent 53%) no-repeat 0 0 / 20px 100%;
}
.price-tag::before { /* the tag */
    content: "";
    position: absolute;
    inset: 0 0 0 16px;
    z-index: -1;
    background: var(--gold);
    border-radius: 0 5px 5px 0;
    clip-path: polygon(13px 0, 100% 0, 100% 100%, 13px 100%, 0 50%);
}
.price-tag::after { /* the hole */
    content: "";
    position: absolute;
    left: 26px; top: 50%;
    width: 7px; height: 7px; margin-top: -3.5px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: inset 0 1px 2px rgba(0,0,0,.45);
}
.price-tag--large { font-size: 1.35rem; padding: .4rem 1.1rem .4rem 2.6rem; }
.price-tag--large::after { left: 28px; width: 9px; height: 9px; margin-top: -4.5px; }

/* ---------- 05. Header & navigation ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(251, 246, 236, .94);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
    backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid transparent;
    transition: box-shadow .3s, border-color .3s;
}
.site-header.is-scrolled {
    border-bottom-color: var(--line);
    box-shadow: 0 1px 0 #fff inset, 0 10px 22px -14px rgba(31, 27, 22, .5);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 1rem; }

.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo__icon { transition: transform .4s var(--ease-out); }
.logo:hover .logo__icon { transform: rotate(-8deg) scale(1.05); }
.logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.logo__name { font-family: var(--font-head); font-weight: 800; font-size: 1.12rem; letter-spacing: .04em; }
.logo__name em { font-style: italic; color: var(--maroon); font-weight: 700; }
.logo__tag { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 3px; }

.nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; padding: 0 10px;
    background: transparent; border: 2px solid var(--line); border-radius: 12px;
}
.nav-toggle__bar { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
    position: absolute;
    top: 100%; left: 0; right: 0;
    padding: .5rem 16px 1.25rem;
    background: var(--grain), var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 26px -18px rgba(31, 27, 22, .5);
    display: none;
}
.site-nav.is-open { display: block; animation: dropIn .3s var(--ease-out); }
.site-nav__list { display: flex; flex-direction: column; margin-bottom: 1rem; }
.site-nav__link {
    position: relative;
    display: inline-block;
    padding: .7rem .2rem;
    font-family: var(--font-head);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}
/* ink-blot underline that grows from the centre */
.site-nav__link::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: .35rem;
    height: 5px;
    border-radius: 50% 40% 55% 45% / 60% 50% 50% 40%;
    background: var(--maroon);
    transform: scale(0, .4);
    transform-origin: center;
    transition: transform .35s var(--ease-out);
}
.site-nav__link:hover, .site-nav__link.is-active { color: var(--maroon); }
.site-nav__link:hover::after, .site-nav__link:focus-visible::after { transform: scale(1, 1); }
.site-nav__link.is-active::after { transform: scale(1, 1); background: var(--gold); }

/* ---------- 06. Preloader, page turn, cursor, toast ---------- */
.preloader {
    position: fixed; inset: 0; z-index: 10000;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4rem;
    background: var(--grain), var(--parchment);
    transition: opacity .45s ease, visibility .45s;
    /* CSS fallback: always fades away by 1.2s even if JS fails */
    animation: preloaderOut .45s ease 1.2s forwards;
}
.preloader.is-done { opacity: 0; visibility: hidden; }
.preloader__book { position: relative; width: 132px; height: 84px; perspective: 600px; }
.preloader__cover {
    position: absolute; left: 0; top: 0; width: 50%; height: 100%;
    background: var(--maroon); border-radius: 8px 2px 2px 8px;
    box-shadow: inset -4px 0 0 rgba(0,0,0,.18);
}
.preloader__cover--right { left: 50%; border-radius: 2px 8px 8px 2px; box-shadow: inset 4px 0 0 rgba(0,0,0,.18); }
.preloader__page {
    position: absolute; left: 50%; top: 5px; width: calc(50% - 6px); height: calc(100% - 10px);
    background: var(--paper);
    border-radius: 0 4px 4px 0;
    transform-origin: left center;
    z-index: 2;
    background-image: repeating-linear-gradient(to bottom, transparent 0 9px, rgba(201,162,77,.45) 9px 10px);
    animation: preloaderFlip 1.1s var(--ease-book) infinite;
}
.preloader__page:nth-child(3) { animation-delay: .18s; }
.preloader__page:nth-child(4) { animation-delay: .36s; }
.preloader__text { font-family: var(--font-head); font-style: italic; font-size: 1.15rem; color: var(--maroon); margin: 0; }

.page-turn {
    position: fixed; inset: 0; z-index: 9990;
    background: var(--grain), var(--paper);
    box-shadow: -30px 0 60px rgba(31, 27, 22, .25);
    pointer-events: none;
    will-change: transform;
    animation: pageTurnOut .6s var(--ease-book) .05s both;
}
.page-turn--skip { animation: none; transform: translateX(110%); }
.page-turn.is-active { animation: pageTurnIn .42s var(--ease-book) both; }

.cursor { display: none; }
.has-cursor .cursor {
    display: block;
    position: fixed; left: 0; top: 0; z-index: 9999;
    width: 30px; height: 30px; margin: -15px 0 0 -15px;
    pointer-events: none;
    will-change: transform;
}
.has-cursor .cursor::before {
    content: ""; position: absolute; inset: 7px;
    border: 2px solid var(--maroon); border-radius: 50%;
    background: rgba(201, 162, 77, .15);
    transition: transform .25s var(--ease-out), opacity .2s;
}
.cursor__pencil { position: absolute; left: 13px; top: -13px; opacity: 0; transform: scale(.4) rotate(-20deg); transition: opacity .2s, transform .25s var(--ease-out); }
.cursor.is-pointer::before { transform: scale(.35); opacity: .9; }
.cursor.is-pointer .cursor__pencil { opacity: 1; transform: scale(1) rotate(0); }
.has-cursor .cursor.is-hidden { opacity: 0; }

.toast {
    position: fixed; left: 50%; bottom: 22px; z-index: 9995;
    max-width: calc(100% - 32px);
    padding: .85rem 1.25rem .85rem 1.1rem;
    background: var(--ink); color: var(--paper);
    border-left: 5px solid var(--gold);
    border-radius: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-lift);
    opacity: 0; visibility: hidden;
    transform: translate(-50%, 140%) rotate(-2deg);
    transition: transform .5s var(--ease-out), opacity .3s, visibility .5s;
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0) rotate(0); }

/* ---------- 07. Hero (open book) ---------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 0 6rem;
    background:
        radial-gradient(ellipse at 50% 35%, rgba(255, 255, 255, .55), transparent 60%),
        var(--grain),
        var(--parchment);
}
.hero__inner { position: relative; z-index: 2; }

.hero__particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.particle {
    position: absolute;
    left: var(--x);
    bottom: -3rem;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: var(--size);
    color: rgba(122, 31, 43, .22);
    will-change: transform;
    animation: floatUp var(--dur) linear var(--delay) infinite;
}
.particle:nth-child(3n) { color: rgba(47, 79, 62, .22); }
.particle:nth-child(4n) { color: rgba(201, 162, 77, .45); }
.particle:nth-child(5n)::before { /* a few tiny paper scraps */
    content: ""; position: absolute; left: -14px; top: 4px; width: 10px; height: 13px;
    background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,.15); transform: rotate(18deg);
}

.open-book {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    max-width: 1080px;
    margin: 0 auto;
    perspective: 2200px;
}
.open-book::before { /* hard cover peeking out behind the pages */
    content: "";
    position: absolute;
    inset: -10px -10px -14px;
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    border-radius: 18px;
    box-shadow: 0 40px 60px -30px rgba(31, 27, 22, .7), 0 12px 24px -12px rgba(31, 27, 22, .5);
}
.open-book__page {
    position: relative;
    background: var(--grain), var(--paper);
    padding: 2rem 1.4rem 2.6rem;
}
.open-book__page--right {
    order: 1;
    border-radius: 12px 12px 0 0;
    box-shadow: inset 0 -18px 24px -22px rgba(31, 27, 22, .4);
}
.open-book__page--left {
    order: 2;
    border-radius: 0 0 12px 12px;
    text-align: center;
    padding-top: 1.2rem;
}
.open-book__running-head, .open-book__caption {
    font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0;
}
.open-book__art { max-width: 340px; margin: .6rem auto; }
.open-book__folio { position: absolute; bottom: .9rem; left: 1.4rem; font-family: var(--font-head); font-style: italic; color: var(--ink-soft); font-size: .9rem; }
.open-book__folio--right { left: auto; right: 1.4rem; }
.open-book__gutter { display: none; }

.hero__title {
    font-size: clamp(2.3rem, 9vw, 4.4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.01em;
    margin: .2rem 0 .8rem;
    min-height: 2.1em;
}
.typewriter { background: linear-gradient(transparent 68%, rgba(201, 162, 77, .45) 68% 90%, transparent 90%); }
.typewriter__cursor {
    display: inline-block;
    width: .08em; height: .9em;
    margin-left: .06em;
    vertical-align: -.08em;
    background: var(--maroon);
    opacity: 0;
}
.typewriter__cursor.is-typing { opacity: 1; animation: blink .8s steps(1) infinite; }
.typewriter__cursor.is-done { animation: blink .8s steps(1) 3, fadeOut .6s ease 2.4s forwards; opacity: 1; }
.hero__subline { font-family: var(--font-mono); font-size: .85rem; color: var(--maroon); letter-spacing: .03em; margin-bottom: 1rem; }
.hero__lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 34rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.hero__ctas--center { justify-content: center; }

/* the page that flips over on load */
.open-book__flip {
    position: absolute;
    inset: 0;
    z-index: 5;
    transform-style: preserve-3d;
    transform-origin: left center;
    pointer-events: none;
    animation: pageFlip 1.35s var(--ease-book) 1s both, flipHide .35s ease 2.3s forwards;
}
.open-book__flip-front, .open-book__flip-back {
    position: absolute; inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
}
.open-book__flip-front {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
    background:
        linear-gradient(90deg, rgba(0,0,0,.25), transparent 6%),
        var(--grain),
        linear-gradient(135deg, #8B2635, var(--maroon) 55%, var(--maroon-dark));
    border: 2px solid rgba(201, 162, 77, .7);
    outline: 1px solid rgba(201, 162, 77, .45);
    outline-offset: -14px;
    color: var(--gold);
    text-align: center;
}
.open-book__flip-title { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem, 6vw, 3rem); letter-spacing: .08em; line-height: 1.1; }
.open-book__flip-sub { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--paper); opacity: .8; }
.open-book__flip-back {
    transform: rotateY(180deg);
    background: linear-gradient(-90deg, rgba(31,27,22,.18), transparent 10%), var(--grain), var(--paper);
}

.scroll-ribbon {
    position: absolute;
    left: 50%; bottom: 0;
    z-index: 3;
    width: 46px; height: 78px;
    margin-left: -23px;
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 10px;
    background: var(--maroon);
    color: var(--paper);
    text-decoration: none;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    animation: ribbonBounce 2.2s ease-in-out infinite;
}
.scroll-ribbon:hover { color: var(--gold); background: var(--maroon-dark); }
.scroll-ribbon__text { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; writing-mode: vertical-rl; }

/* desk illustration details */
.desk-art__pencil { transform-origin: 280px 200px; animation: pencilRock 5s ease-in-out infinite; }
.desk-art__spark { transform-origin: center; transform-box: fill-box; animation: twinkle 2.6s ease-in-out infinite; }
.desk-art__spark--2 { animation-delay: 1.2s; }

/* ---------- 08. Section scaffolding & dividers ---------- */
.section { position: relative; padding: 4.5rem 0; }
.section--tight { padding: 2.5rem 0 4rem; }
.section-head { text-align: center; max-width: 44rem; margin: 0 auto 2.6rem; }
.section-title { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; }
.section-title::after {
    content: "";
    display: block;
    width: 84px; height: 8px;
    margin: .5rem auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 8'%3E%3Cpath d='M2 5c12-4 22 2 40-1s28-3 40 0' fill='none' stroke='%23C9A24D' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.school-corner .section-title::after, .visit .section-title::after, .missing-page .section-title::after { margin-left: 0; }
.section-lead { color: var(--ink-soft); font-size: 1.05rem; margin: 0; }

/* torn paper edges */
.torn-top, .torn-bottom { position: relative; }
.torn-top { background: var(--grain), var(--parchment); }
.torn-top::before, .torn-bottom::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 22px;
    background: var(--grain), var(--paper);
    pointer-events: none;
}
.torn-top::before {
    top: -1px;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 97% 70%, 94% 40%, 90% 80%, 86% 50%, 82% 75%, 78% 35%, 74% 65%, 70% 45%, 66% 85%, 62% 50%, 58% 70%, 54% 30%, 50% 60%, 46% 40%, 42% 80%, 38% 45%, 34% 70%, 30% 35%, 26% 75%, 22% 50%, 18% 85%, 14% 40%, 10% 65%, 6% 35%, 3% 70%, 0 45%);
}
.torn-bottom::after {
    bottom: -1px;
    clip-path: polygon(0 55%, 3% 30%, 6% 65%, 10% 35%, 14% 60%, 18% 15%, 22% 50%, 26% 25%, 30% 65%, 34% 30%, 38% 55%, 42% 20%, 46% 60%, 50% 40%, 54% 70%, 58% 30%, 62% 50%, 66% 15%, 70% 55%, 74% 35%, 78% 65%, 82% 25%, 86% 50%, 90% 20%, 94% 60%, 97% 30%, 100% 55%, 100% 100%, 0 100%);
}

/* bookmark ribbon divider */
.ribbon-divider { position: relative; height: 2px; max-width: var(--container); margin: 0 auto; background: linear-gradient(90deg, transparent, var(--line) 15%, var(--line) 85%, transparent); }
.ribbon-divider span {
    position: absolute; left: 50%; top: -1px;
    width: 30px; height: 54px; margin-left: -15px;
    background: linear-gradient(90deg, var(--maroon-dark), var(--maroon) 40%, var(--maroon-dark));
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
    box-shadow: 0 4px 8px rgba(0,0,0,.2);
}
.ribbon-divider span::after { content: ""; position: absolute; left: 6px; right: 6px; top: 0; bottom: 14px; border-left: 1px dashed rgba(201,162,77,.8); border-right: 1px dashed rgba(201,162,77,.8); }
.ribbon-divider--inline { margin: 3.5rem auto; }

/* ---------- 09. Category shelf ---------- */
.shelf { position: relative; }
.shelf__books {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: end;
    padding: 0 6px;
}
.spine-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-height: 300px;
    padding: 2.2rem 1rem 2.4rem;
    color: var(--paper);
    text-decoration: none;
    border-radius: 6px 6px 3px 3px;
    background:
        linear-gradient(90deg, rgba(0,0,0,.28), rgba(255,255,255,.12) 12%, rgba(255,255,255,0) 30%, rgba(0,0,0,.08) 75%, rgba(0,0,0,.3)),
        var(--grain),
        var(--tone, var(--maroon));
    box-shadow: var(--shadow-desk);
    transform-origin: bottom center;
    transition: translate .4s var(--ease-out), rotate .4s var(--ease-out), box-shadow .4s;
}
.spine-tile:nth-child(1) { min-height: 330px; }
.spine-tile:nth-child(2) { min-height: 300px; }
.spine-tile:nth-child(3) { min-height: 318px; }
.spine-tile:nth-child(4) { min-height: 292px; }
.spine-tile--maroon { --tone: var(--maroon); }
.spine-tile--forest { --tone: var(--forest); }
.spine-tile--gold   { --tone: #A8842F; }
.spine-tile--pencil { --tone: #C9781B; }
.spine-tile:hover, .spine-tile:focus-visible { color: var(--paper); translate: 0 -14px; rotate: -1.5deg; box-shadow: var(--shadow-lift); }
.spine-tile__band {
    position: absolute; left: 0; right: 0; top: 14px; height: 10px;
    border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
}
.spine-tile__band--bottom { top: auto; bottom: 14px; }
.spine-tile__count { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.spine-tile__name { font-family: var(--font-head); font-weight: 800; font-size: 1.45rem; line-height: 1.1; color: #fff; }
.spine-tile__blurb { font-size: .86rem; line-height: 1.45; opacity: .92; }
.spine-tile__cta { margin-top: auto; font-family: var(--font-mono); font-size: .8rem; font-weight: 700; color: var(--paper); border-top: 1px dashed rgba(251,246,236,.5); padding-top: .6rem; }
.spine-tile__cta span { display: inline-block; transition: transform .3s; }
.spine-tile:hover .spine-tile__cta span { transform: translateX(6px); }
.shelf__plank {
    height: 22px;
    margin-top: -2px;
    border-radius: 4px;
    background:
        repeating-linear-gradient(90deg, rgba(0,0,0,.05) 0 2px, transparent 2px 40px),
        linear-gradient(var(--wood), var(--wood-dark));
    box-shadow: 0 14px 18px -10px rgba(31,27,22,.55), inset 0 2px 0 rgba(255,255,255,.18);
}

/* ---------- 10. Product cards & grids ---------- */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem 1.5rem;
}
.book-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--grain), #FFFCF5;
    border-radius: 6px 14px 14px 6px;
    box-shadow: var(--shadow-desk);
    transition: box-shadow .35s;
}
.book-card:hover { box-shadow: var(--shadow-lift); }
.book-card__cover {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    margin: 12px 18px 0 12px;
    border-radius: 3px 10px 10px 3px;
    background: var(--parchment);
    /* page edges on the right + desk shadow */
    box-shadow: 3px 0 0 -1px #FFF8EA, 6px 1px 0 -2px #E9DDC4, 9px 2px 0 -3px #D8C9AB, 0 12px 18px -10px rgba(31,27,22,.6);
    transform: perspective(900px) rotateY(0);
    transform-origin: left center;
    transition: transform .5s var(--ease-out), box-shadow .5s;
}
.book-card__img { width: 100%; height: 100%; object-fit: cover; }
.book-card__spine, .detail__frame .book-card__spine {
    position: absolute; left: 0; top: 0; bottom: 0; width: 16px; z-index: 2;
    background: linear-gradient(90deg, rgba(0,0,0,.45), rgba(255,255,255,.25) 45%, rgba(0,0,0,.15) 70%, rgba(0,0,0,.35));
    pointer-events: none;
}
.book-card__ribbon {
    position: absolute; top: 0; right: 18px; z-index: 3;
    width: 22px; height: 64px;
    background: linear-gradient(90deg, #B08A35, var(--gold) 45%, #B08A35);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    transform: translateY(-100%);
    transition: transform .45s var(--ease-out);
}
.book-card:hover .book-card__cover, .book-card:focus-within .book-card__cover {
    transform: perspective(900px) rotateY(-8deg);
    box-shadow: 3px 0 0 -1px #FFF8EA, 6px 1px 0 -2px #E9DDC4, 9px 2px 0 -3px #D8C9AB, 14px 22px 26px -12px rgba(31,27,22,.65);
}
.book-card:hover .book-card__ribbon, .book-card:focus-within .book-card__ribbon { transform: translateY(0); }
.book-card__body { display: flex; flex-direction: column; gap: .45rem; flex: 1; padding: 1.1rem 1.1rem 1.2rem; }
.book-card__title { font-size: 1.1rem; margin: .2rem 0 0; }
.book-card__title a { color: var(--ink); text-decoration: none; }
.book-card__title a:hover { color: var(--maroon); }
.book-card__desc { font-size: .9rem; color: var(--ink-soft); margin: 0; }
.book-card__foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: auto; padding-top: .6rem; }
.book-card__actions { display: flex; align-items: center; gap: .6rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.book-card__actions .btn { flex: 1; padding-top: .62rem; padding-bottom: .68rem; }

/* ---------- 11. Why choose us ---------- */
.why { padding-top: 5rem; }
.why__list { display: grid; grid-template-columns: 1fr; gap: 1.4rem; counter-reset: why; }
.why__item {
    position: relative;
    padding: 1.8rem 1.4rem 1.4rem;
    background: var(--grain), #FFFCF5;
    border-radius: 4px;
    box-shadow: var(--shadow-desk);
    counter-increment: why;
    /* faint ruled lines like a notebook page */
    background-image: var(--grain), repeating-linear-gradient(to bottom, transparent 0 27px, rgba(47, 79, 62, .08) 27px 28px);
    transition: translate .35s var(--ease-out), box-shadow .35s;
}
.why__item::before {
    content: counter(why, lower-roman) ".";
    position: absolute; top: 1rem; right: 1.2rem;
    font-family: var(--font-head); font-style: italic; color: var(--gold); font-size: 1.4rem;
}
.why__item:hover { translate: 0 -6px; box-shadow: var(--shadow-lift); }
.why__icon { width: 48px; height: 48px; color: var(--maroon); margin-bottom: .8rem; }
.why__item:nth-child(2) .why__icon { color: var(--forest); }
.why__item:nth-child(3) .why__icon { color: #A8842F; }
.why__item:nth-child(4) .why__icon { color: #C9781B; }
.why__item h3 { font-size: 1.15rem; }
.why__item p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ---------- 12. Stats & bookshelf strip ---------- */
.stats { position: relative; padding: 0 0 3.5rem; background: var(--grain), var(--parchment); overflow: hidden; }
.bookshelf-strip { position: relative; padding-top: 1rem; margin-bottom: 2.4rem; }
.bookshelf-strip::after {
    content: ""; display: block; height: 16px;
    background: linear-gradient(var(--wood), var(--wood-dark));
    box-shadow: 0 10px 14px -8px rgba(31,27,22,.5);
}
.bookshelf-strip__row { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 128px; padding: 0 12px; }
.mini-spine {
    flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center;
    width: 38px;
    height: var(--h);
    padding: .5rem 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-mono);
    font-size: .62rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--paper);
    border-radius: 3px 3px 1px 1px;
    background: linear-gradient(90deg, rgba(0,0,0,.25), rgba(255,255,255,.14) 30%, rgba(0,0,0,.2)), var(--tone, var(--maroon));
    white-space: nowrap;
    overflow: hidden;
}
.mini-spine:nth-child(3n) { width: 46px; }
.mini-spine:nth-child(4n) { width: 32px; }
.mini-spine--maroon { --tone: var(--maroon); }
.mini-spine--forest { --tone: var(--forest); }
.mini-spine--gold   { --tone: #A8842F; }
.mini-spine--pencil { --tone: #C9781B; }
.mini-spine--ink    { --tone: #3A332B; }
.stats__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1rem; text-align: center; }
.stat__num { display: block; font-family: var(--font-head); font-weight: 800; font-size: clamp(2.2rem, 7vw, 3.4rem); color: var(--maroon); line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { display: block; margin-top: .4rem; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- 13. Back-to-school corner ---------- */
.school-corner { padding: 4rem 0; }
.school-corner__inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2.2rem 1.4rem 2.2rem 2.4rem;
    border-radius: 18px;
    color: var(--ink);
    background:
        linear-gradient(90deg, transparent 22px, rgba(122, 31, 43, .45) 22px 24px, transparent 24px),
        repeating-linear-gradient(to bottom, transparent 0 31px, rgba(31, 27, 22, .12) 31px 32px),
        var(--grain),
        var(--pencil);
    box-shadow: var(--shadow-lift);
    overflow: hidden;
}
.school-corner__inner::before { /* notebook punch holes */
    content: ""; position: absolute; left: 6px; top: 24px; bottom: 24px; width: 10px;
    background: radial-gradient(circle, var(--paper) 4px, transparent 5px) 0 0 / 10px 40px repeat-y;
}
.school-corner p { color: #2B241C; }
.combo-list { display: grid; gap: .6rem; margin: 1rem 0 0; }
.combo-list li {
    padding: .6rem .9rem;
    background: rgba(251, 246, 236, .75);
    border-radius: 8px;
    border-left: 4px solid var(--maroon);
}
.combo-list strong { display: block; font-family: var(--font-head); }
.combo-list span { font-size: .9rem; color: var(--ink-soft); }
.school-corner__art { display: flex; align-items: center; justify-content: center; }
.school-corner__svg { width: 100%; max-width: 260px; }
.school-corner__pencil { transform-origin: 140px 120px; animation: pencilWrite 3.2s ease-in-out infinite; }

/* ---------- 14. Testimonials ---------- */
.notes { display: grid; grid-template-columns: 1fr; gap: 2.6rem 2rem; padding-top: 1rem; }
.note {
    position: relative;
    margin: 0;
    padding: 2.2rem 1.6rem 1.4rem;
    background: var(--grain), #FFF8DC;
    box-shadow: 0 2px 2px rgba(31,27,22,.08), 0 18px 24px -14px rgba(31,27,22,.4);
    rotate: -1.6deg;
    transition: rotate .35s var(--ease-out), translate .35s var(--ease-out);
}
.note:nth-child(2) { rotate: 1.4deg; background: var(--grain), #FDF2E9; }
.note:nth-child(3) { rotate: -.8deg; background: var(--grain), #F0F5EC; }
.note:hover { rotate: 0deg; translate: 0 -6px; }
.note__tape {
    position: absolute; top: -14px; left: 50%;
    width: 112px; height: 30px; margin-left: -56px;
    background: rgba(201, 162, 77, .45);
    border-left: 1px dashed rgba(255,255,255,.6);
    border-right: 1px dashed rgba(255,255,255,.6);
    clip-path: polygon(3% 0, 97% 8%, 100% 30%, 96% 55%, 100% 80%, 96% 100%, 4% 94%, 0 70%, 4% 45%, 0 20%);
    transform: rotate(-3deg);
}
.note__quote { margin: 0 0 1rem; font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.3; color: #2B241C; }
.note__by { display: flex; flex-direction: column; font-size: .9rem; }
.note__by strong { font-family: var(--font-head); font-size: 1.05rem; }
.note__by span { font-family: var(--font-mono); font-size: .72rem; color: var(--ink-soft); }

/* ---------- 15. Visit us & maps ---------- */
.visit { padding-top: 5rem; }
.visit__grid { display: grid; grid-template-columns: 1fr; gap: 2.4rem; align-items: center; }
.visit__address { font-size: 1.05rem; line-height: 1.7; margin-bottom: .6rem; }
.visit__note { font-family: var(--font-hand); font-size: 1.35rem; color: var(--maroon); margin-bottom: 1.2rem; }
.visit__subhead { font-size: 1.15rem; margin-top: 1rem; }
.visit__email a { font-weight: 700; word-break: break-word; }
.hours { display: grid; gap: .35rem; margin-bottom: 1rem; }
.hours li { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: .35rem; border-bottom: 1px dotted var(--line); flex-wrap: wrap; }
.hours .mono { font-size: .88rem; color: var(--maroon); font-weight: 700; }
.map-frame {
    position: relative;
    padding: 10px;
    background: #FFFCF5;
    border-radius: 6px;
    box-shadow: var(--shadow-lift);
    rotate: .6deg;
}
.map-frame iframe { width: 100%; height: 340px; border: 0; border-radius: 3px; filter: sepia(.18) saturate(.9); }

/* ---------- 16. Page hero & breadcrumb ---------- */
.page-hero {
    padding: 2.4rem 0 3.6rem;
    background:
        radial-gradient(ellipse at 80% 0%, rgba(201, 162, 77, .18), transparent 55%),
        var(--grain),
        var(--parchment);
}
.page-hero__title { font-size: clamp(2.2rem, 7vw, 3.8rem); font-weight: 800; margin: 1rem 0 .4rem; }
.page-hero__lead { font-size: 1.08rem; color: var(--ink-soft); max-width: 40rem; margin: 0; }

/* breadcrumb styled like a reading ribbon */
.breadcrumb ol {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .2rem;
    padding: .38rem 2rem .42rem .9rem;
    background: linear-gradient(180deg, #8B2635, var(--maroon));
    color: var(--paper);
    font-family: var(--font-mono);
    font-size: .74rem;
    letter-spacing: .04em;
    clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%);
    box-shadow: 0 4px 10px -6px rgba(0,0,0,.4);
}
.breadcrumb li { display: inline; }
.breadcrumb li + li::before { content: "›"; margin: 0 .35rem; color: var(--gold); }
.breadcrumb a { color: var(--paper); text-decoration: none; border-bottom: 1px dashed rgba(251,246,236,.45); }
.breadcrumb a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.breadcrumb [aria-current] { color: #F6D9A3; }

/* ---------- 17. Products page (filters) ---------- */
.filter-bar {
    position: sticky;
    top: var(--header-h);
    z-index: 50;
    margin-bottom: 1.6rem;
    padding: .8rem 0 .9rem;
    background: rgba(251, 246, 236, .95);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-bottom: 2px solid var(--parchment);
}
.filter-bar__inner { display: flex; flex-direction: column; gap: .8rem; }
.index-tabs {
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    padding: 8px 2px 0;
    scrollbar-width: none;
    border-bottom: 2px solid var(--ink);
}
.index-tabs::-webkit-scrollbar { display: none; }
.index-tab {
    flex: 0 0 auto;
    position: relative;
    padding: .45rem .95rem .4rem;
    font-family: var(--font-mono);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    background: var(--parchment);
    border: 2px solid var(--ink);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    border-top: 5px solid var(--tab, var(--ink));
    transform-origin: bottom left;
    transition: transform .3s var(--ease-out), background-color .2s, box-shadow .3s;
}
.index-tab--maroon { --tab: var(--maroon); }
.index-tab--forest { --tab: var(--forest); }
.index-tab--gold   { --tab: var(--gold); }
.index-tab--pencil { --tab: var(--pencil); }
.index-tab:hover { transform: translateY(-4px) rotate(-2.5deg); background: #FFF8DC; box-shadow: 4px -4px 10px -6px rgba(31,27,22,.45); color: var(--ink); }
.index-tab.is-active { background: var(--paper); color: var(--maroon); transform: translateY(-4px); box-shadow: 0 -4px 10px -6px rgba(31,27,22,.4); }
.filter-bar__tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.search-box {
    flex: 1 1 220px;
    display: flex; align-items: center; gap: .4rem;
    padding: 0 .9rem;
    background: #FFFCF5;
    border: 2px solid var(--line);
    border-radius: 999px;
    transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,77,.25); }
.search-box .icon { color: var(--ink-soft); }
.search-box input { flex: 1; min-width: 0; padding: .62rem 0; border: 0; background: transparent; outline: none; }
.sort-box { display: flex; align-items: center; gap: .5rem; }
.sort-box__label { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.sort-box select {
    padding: .58rem 2.2rem .58rem .9rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: #FFFCF5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A1F2B' stroke-width='2'/%3E%3C/svg%3E") no-repeat right .9rem center;
    -webkit-appearance: none; appearance: none;
    font-weight: 700;
}
.sort-box select:focus-visible { border-color: var(--gold); }
.result-count { font-size: .8rem; color: var(--ink-soft); margin: 0 0 1.4rem; }

.empty-state { max-width: 34rem; margin: 1rem auto 0; text-align: center; }
.empty-state .empty-shelf { width: 100%; max-width: 300px; margin: 0 auto 1.2rem; }
.empty-state h2 { font-size: 1.6rem; }
.empty-state p { color: var(--ink-soft); }

/* ---------- 18. Product detail & missing page ---------- */
.detail { display: grid; grid-template-columns: 1fr; gap: 2.4rem; margin-top: 1.8rem; }
.detail__media { perspective: 1200px; }
.detail__frame {
    position: relative;
    max-width: 460px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 4px 14px 14px 4px;
    background: var(--parchment);
    box-shadow: 4px 0 0 -1px #FFF8EA, 8px 1px 0 -2px #E9DDC4, 12px 2px 0 -3px #D8C9AB, 0 30px 40px -20px rgba(31,27,22,.6);
    cursor: zoom-in;
}
.detail__frame .book-card__spine { width: 22px; }
.zoom__img { width: 100%; height: 100%; object-fit: cover; transform-origin: var(--zx, 50%) var(--zy, 50%); transition: transform .45s var(--ease-out); }
.zoom:hover .zoom__img { transform: scale(1.12); }
.zoom.is-zooming .zoom__img { transform: scale(1.7); }
.detail__title { font-size: clamp(1.8rem, 5vw, 2.7rem); font-weight: 800; margin: .8rem 0 1rem; }
.detail__price-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.badge-available {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .3rem .8rem;
    border-radius: 999px;
    background: #DDE8E1;
    color: var(--forest);
    font-weight: 800;
    font-size: .86rem;
}
.badge-available__dot { width: 9px; height: 9px; border-radius: 50%; background: #3F8F5F; box-shadow: 0 0 0 0 rgba(63,143,95,.6); animation: pulse 1.8s infinite; }
.detail__desc { font-size: 1.04rem; color: var(--ink-soft); }
.detail__subhead { font-size: 1.1rem; margin-top: 1.4rem; }
.highlights { margin: 0 0 1.6rem; display: grid; gap: .5rem; }
.highlights__row { display: flex; align-items: baseline; gap: .6rem; }
.highlights__row::after { content: ""; flex: 1 1 auto; order: 1; border-bottom: 2px dotted rgba(31,27,22,.25); min-width: 20px; }
.highlights dt { order: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--maroon); flex-shrink: 0; }
.highlights dd { order: 2; margin: 0; font-weight: 700; text-align: right; max-width: 65%; }
.detail__actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.detail__help { margin-top: 1.1rem; font-size: .9rem; color: var(--ink-soft); }
.detail__help a { word-break: break-word; }

.missing-page__inner { max-width: 38rem; margin: 0 auto; text-align: center; }
.missing-page .section-title::after { margin-left: auto; }
.missing-page__book {
    position: relative;
    width: 150px; height: 190px;
    margin: 0 auto 2rem;
    background: var(--grain), var(--paper);
    border-radius: 4px 12px 12px 4px;
    box-shadow: -14px 0 0 var(--maroon), var(--shadow-lift);
    display: flex; align-items: flex-end; justify-content: center; padding-bottom: 1rem;
    rotate: -4deg;
}
.missing-page__torn {
    position: absolute; left: 0; right: 0; top: 0; height: 55%;
    background: var(--parchment);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 88% 85%, 76% 65%, 62% 90%, 50% 70%, 36% 95%, 24% 72%, 12% 88%, 0 70%);
    opacity: .9;
}

/* ---------- 19. About page ---------- */
.chapters__inner { max-width: 880px; }
.chapter__label { font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--maroon); margin-bottom: .2rem; }
.chapter__label::before { content: "— "; color: var(--gold); }
.chapter__title { font-size: clamp(2rem, 6vw, 3rem); font-style: italic; font-weight: 700; margin-bottom: 1.2rem; }
.chapter__body { font-size: 1.06rem; }
.chapter__body--split { display: grid; grid-template-columns: 1fr; gap: 1.6rem; align-items: center; }
.chapter__art { max-width: 320px; margin: 0 auto; }
.dropcap::first-letter {
    float: left;
    font-family: var(--font-head);
    font-weight: 800;
    font-size: 4.2rem;
    line-height: .8;
    padding: .35rem .5rem 0 0;
    color: var(--maroon);
}
.offer-list { display: grid; gap: .8rem; margin: 0 0 1.2rem; }
.offer-list li { padding-left: 1.6rem; position: relative; }
.offer-list li::before { content: "✎"; position: absolute; left: 0; top: 0; color: var(--gold); font-weight: 700; }
.pull-quote {
    margin: 0 0 1.4rem;
    padding: 1rem 0 1rem 1.4rem;
    border-left: 5px solid var(--gold);
    font-family: var(--font-head);
    font-style: italic;
    font-size: clamp(1.3rem, 3.5vw, 1.8rem);
    line-height: 1.35;
    color: var(--maroon);
}

.timeline { display: grid; grid-template-columns: 1fr; gap: 1.2rem; counter-reset: none; }
.timeline__item {
    position: relative;
    padding: 1.4rem 1.3rem 1.2rem;
    background: var(--grain), #FFFCF5;
    box-shadow: var(--shadow-desk);
    border-radius: 3px;
    /* folded page corner */
    clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
}
.timeline__item::after {
    content: ""; position: absolute; top: 0; right: 0; width: 26px; height: 26px;
    background: linear-gradient(225deg, transparent 50%, #E9DDC4 50%);
    box-shadow: -2px 2px 4px rgba(0,0,0,.12);
}
.timeline__page {
    display: inline-block;
    font-size: .78rem; font-weight: 700;
    color: var(--paper);
    background: var(--maroon);
    padding: .1rem .55rem;
    border-radius: 3px;
    margin-bottom: .6rem;
}
.timeline__item h3 { font-size: 1.15rem; }
.timeline__item p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- 20. Contact page ---------- */
.index-cards { display: grid; grid-template-columns: 1fr; gap: 1.4rem; margin-bottom: 3rem; }
.index-card {
    position: relative;
    padding: 1.5rem 1.4rem 1.3rem;
    background:
        linear-gradient(to bottom, transparent 62px, rgba(122, 31, 43, .55) 62px 64px, transparent 64px),
        repeating-linear-gradient(to bottom, transparent 0 25px, rgba(47, 79, 62, .14) 25px 26px),
        #FFFEF8;
    box-shadow: var(--shadow-desk);
    border-radius: 3px;
    transition: translate .35s var(--ease-out), rotate .35s var(--ease-out), box-shadow .35s;
}
.index-card:hover { translate: 0 -6px; rotate: -.8deg; box-shadow: var(--shadow-lift); }
.index-card__title { font-size: 1.2rem; margin-bottom: 1.4rem; }
.index-card__title .mono { font-size: .8rem; color: var(--gold); margin-right: .3rem; }
.index-card address, .index-card p { line-height: 1.65; }
.index-card p a { font-weight: 700; word-break: break-word; }

.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2.6rem; align-items: start; }
.letter {
    position: relative;
    padding: 2rem 1.3rem 1.8rem;
    background: var(--grain), #FFFCF5;
    border-radius: 6px;
    box-shadow: var(--shadow-lift);
}
.letter::before { /* a little stamp */
    content: "✉";
    position: absolute; top: 14px; right: 14px;
    width: 52px; height: 60px;
    display: grid; place-items: center;
    font-size: 1.6rem;
    color: var(--maroon);
    background: #FBEFD6;
    outline: 2px dashed rgba(122,31,43,.4);
    outline-offset: -6px;
    rotate: 6deg;
}
.letter__title { font-size: 1.7rem; padding-right: 60px; }
.letter__lead { color: var(--ink-soft); padding-right: 50px; }
.contact-form { display: grid; gap: 1.1rem; margin-top: 1.2rem; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.field label { display: block; font-family: var(--font-mono); font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .3rem; }
.field label span[aria-hidden] { color: var(--maroon); }
.field__optional { text-transform: none; letter-spacing: 0; color: var(--ink-soft); font-weight: 400; }
.field input, .field textarea {
    width: 100%;
    padding: .65rem .2rem;
    border: 0;
    border-bottom: 2px solid rgba(31,27,22,.3);
    background: transparent;
    border-radius: 0;
    transition: border-color .2s, background-color .2s;
}
.field textarea {
    resize: vertical;
    line-height: 28px;
    padding: 0 .2rem;
    background: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(31,27,22,.16) 27px 28px);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); background-color: rgba(201,162,77,.08); }
.field.has-error input, .field.has-error textarea { border-color: #B3261E; }
.field__error { color: #B3261E; font-size: .86rem; font-weight: 700; margin: .35rem 0 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .4rem; }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 1rem 1.1rem; border-radius: 8px; margin: 1rem 0; border-left: 5px solid; }
.alert p { margin: .8rem 0 0; }
.alert--success { background: #E3EFE7; border-color: var(--forest); color: #1E3A2B; }
.alert--error { background: #F8E3E1; border-color: #B3261E; color: #6E1712; }

.contact-map { position: relative; }
.find-us-note {
    position: relative;
    z-index: 2;
    max-width: 300px;
    margin: 0 auto -1.4rem;
    padding: 1.4rem 1.2rem 1rem;
    background: var(--grain), #FFF2B8;
    box-shadow: 0 12px 20px -12px rgba(31,27,22,.45);
    rotate: -2.5deg;
    text-align: center;
}
.find-us-note__label { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--maroon); margin: 0 0 .2rem; }
.find-us-note__text { font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.2; margin: 0; }
.contact-map .map-frame iframe { height: 420px; }

/* ---------- 21. Footer ---------- */
.site-footer {
    position: relative;
    margin-top: 2rem;
    padding-top: 4rem;
    color: #E8DFCC;
    background: var(--grain), var(--ink);
}
.site-footer::before {
    content: "";
    position: absolute; left: 0; right: 0; top: -1px; height: 20px;
    background: var(--grain), var(--paper);
    clip-path: polygon(0 0, 100% 0, 100% 40%, 96% 75%, 92% 35%, 88% 70%, 84% 45%, 80% 85%, 76% 40%, 72% 60%, 68% 30%, 64% 75%, 60% 45%, 56% 80%, 52% 35%, 48% 65%, 44% 40%, 40% 85%, 36% 50%, 32% 70%, 28% 30%, 24% 65%, 20% 45%, 16% 80%, 12% 40%, 8% 70%, 4% 35%, 0 60%);
}
.site-footer a { color: #F3E9D2; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer__grid { display: grid; grid-template-columns: 1fr; gap: 2.2rem; padding-bottom: 2.6rem; }
.site-footer__brand { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; letter-spacing: .06em; color: var(--paper); margin-bottom: .1rem; }
.site-footer__tagline { font-family: var(--font-head); font-style: italic; color: var(--gold); }
.site-footer__about p:last-child { font-size: .94rem; opacity: .85; }
.site-footer__heading { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 1rem; }
.site-footer__list { display: grid; gap: .45rem; }
.site-footer__list a { display: inline-block; transition: transform .25s; }
.site-footer__list a:hover { transform: translateX(4px); }
.site-footer__address { line-height: 1.7; font-size: .94rem; margin-bottom: 1rem; }
.site-footer__address a { color: var(--gold); word-break: break-word; }
.site-footer__hours { display: grid; gap: .25rem; font-size: .88rem; }
.site-footer__hours li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem; }
.site-footer__hours .mono { color: var(--gold); font-size: .8rem; }
.site-footer__bottom { border-top: 1px solid rgba(232, 223, 204, .15); padding: 1.2rem 0; font-size: .85rem; }
.site-footer__bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.site-footer__bottom p { margin: 0; opacity: .8; }

/* ---------- 22. Scroll reveal animations ---------- */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.js .reveal.is-visible { opacity: 1; transform: none; }
.js .reveal-card { opacity: 0; }
.js .reveal-card.is-visible { animation: liftOff .85s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }
.js .bookshelf-strip .mini-spine { translate: 110vw 0; }
.js .bookshelf-strip.is-visible .mini-spine { translate: 0 0; transition: translate 1.1s var(--ease-out) calc(var(--i) * 55ms); }

/* ---------- 23. Keyframes ---------- */
@keyframes liftOff {
    from { opacity: 0; transform: perspective(900px) translateY(46px) rotateX(8deg); }
    to   { opacity: 1; transform: none; }
}
@keyframes pageFlip {
    from { transform: rotateY(0deg); }
    to   { transform: rotateY(-180deg); }
}
@keyframes flipHide { to { opacity: 0; visibility: hidden; } }
@keyframes floatUp {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translate3d(40px, -115vh, 0) rotate(220deg); opacity: 0; }
}
@keyframes ribbonBounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-14deg); }
    40% { transform: rotate(12deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(5deg); }
}
@keyframes pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}
@keyframes preloaderFlip {
    0%   { transform: rotateY(0deg); }
    55%, 100% { transform: rotateY(-180deg); }
}
@keyframes preloaderOut { to { opacity: 0; visibility: hidden; } }
@keyframes pageTurnIn {
    from { transform: translateX(105%); }
    to   { transform: translateX(0); }
}
@keyframes pageTurnOut {
    from { transform: translateX(0); }
    to   { transform: translateX(-110%); }
}
@keyframes dropIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: none; }
}
@keyframes pencilRock {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(-4deg) translateY(-3px); }
}
@keyframes pencilWrite {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-6px, 4px) rotate(-3deg); }
    50% { transform: translate(4px, 2px) rotate(2deg); }
    75% { transform: translate(-3px, -2px) rotate(-1deg); }
}
@keyframes twinkle {
    0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
    50%      { transform: scale(.7) rotate(25deg); opacity: .6; }
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(63,143,95,.55); }
    70%  { box-shadow: 0 0 0 9px rgba(63,143,95,0); }
    100% { box-shadow: 0 0 0 0 rgba(63,143,95,0); }
}

/* ---------- 24. Responsive breakpoints ---------- */
@media (min-width: 600px) {
    .container { padding: 0 24px; }
    .product-grid { grid-template-columns: repeat(2, 1fr); }
    .why__list { grid-template-columns: repeat(2, 1fr); }
    .stats__grid { grid-template-columns: repeat(4, 1fr); }
    .field-row { grid-template-columns: 1fr 1fr; }
    .index-cards { grid-template-columns: repeat(3, 1fr); }
    .timeline { grid-template-columns: repeat(2, 1fr); }
    .site-footer__grid { grid-template-columns: repeat(2, 1fr); }
    .letter { padding: 2.4rem 2.2rem 2rem; }
}

@media (min-width: 768px) {
    .hero { padding: 3.5rem 0 7rem; }
    .open-book__page { padding: 2.6rem 2.4rem 3rem; }
    .shelf__books { grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 14px; }
    .spine-tile { padding: 2.6rem 1.2rem 2.6rem; }
    .notes { grid-template-columns: repeat(3, 1fr); }
    .school-corner__inner { grid-template-columns: 1.4fr 1fr; padding: 3rem 3rem 3rem 3.6rem; }
    .chapter__body--split { grid-template-columns: 1.4fr 1fr; }
}

@media (min-width: 900px) {
    :root { --header-h: 78px; }
    .nav-toggle { display: none; }
    .site-nav {
        position: static;
        display: flex !important;
        align-items: center;
        gap: 1.6rem;
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
        animation: none !important;
    }
    .site-nav__list { flex-direction: row; gap: 1.6rem; margin: 0; }
    .site-nav__link { font-family: var(--font-body); font-size: 1rem; font-weight: 800; padding: .4rem .1rem; }
    .site-nav__link::after { bottom: -.15rem; }
    .logo__name { font-size: 1.3rem; }

    /* two-page spread */
    .open-book { grid-template-columns: 1fr 1fr; }
    .open-book__page { min-height: 470px; display: flex; flex-direction: column; justify-content: center; }
    .open-book__page--left {
        order: 0;
        border-radius: 12px 0 0 12px;
        background: linear-gradient(-90deg, rgba(31,27,22,.16), transparent 12%), var(--grain), var(--paper);
    }
    .open-book__page--right {
        order: 1;
        border-radius: 0 12px 12px 0;
        background: linear-gradient(90deg, rgba(31,27,22,.16), transparent 12%), var(--grain), var(--paper);
        box-shadow: none;
    }
    .open-book__gutter {
        display: block;
        position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; z-index: 3;
        background: rgba(31,27,22,.18);
    }
    .open-book__flip { left: 50%; right: 0; inset-inline-start: 50%; }
    .open-book__flip-front { border-radius: 0 12px 12px 0; }
    .open-book__flip-back { border-radius: 12px 0 0 12px; }
    .hero__title { font-size: clamp(2.8rem, 5vw, 4.4rem); }

    .detail { grid-template-columns: 5fr 6fr; gap: 3.5rem; align-items: start; }
    .detail__media { position: sticky; top: calc(var(--header-h) + 24px); }
    .visit__grid { grid-template-columns: 1fr 1.3fr; gap: 3.5rem; }
    .contact-grid { grid-template-columns: 1.15fr 1fr; gap: 3rem; }
    .contact-map { position: sticky; top: calc(var(--header-h) + 24px); }
}

@media (min-width: 1024px) {
    .filter-bar__inner { flex-direction: row; align-items: flex-end; justify-content: space-between; }
    .index-tabs { flex: 1 1 auto; }
    .filter-bar__tools { flex: 0 1 auto; flex-wrap: nowrap; padding-bottom: 2px; }
    .search-box { flex: 0 1 240px; }
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 2.6rem 2rem; }
    .why__list { grid-template-columns: repeat(4, 1fr); }
    .timeline { grid-template-columns: repeat(5, 1fr); }
    .site-footer__grid { grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: 2.6rem; }
    .section { padding: 5.5rem 0; }
    .section--tight { padding: 2.8rem 0 4.5rem; }
    .spine-tile__name { font-size: 1.7rem; }
}

@media (min-width: 1100px) {
    .product-grid--four { grid-template-columns: repeat(4, 1fr); gap: 2.6rem 1.8rem; }
}

@media (min-width: 1440px) {
    :root { --container: 1320px; }
    .open-book { max-width: 1160px; }
    .open-book__page { min-height: 520px; }
}

/* ---------- 25. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0s !important;
        transition-duration: .001ms !important;
        transition-delay: 0s !important;
    }
    .particle, .open-book__flip, .page-turn, .preloader, .scroll-ribbon { animation: none !important; }
    .hero__particles, .open-book__flip, .page-turn, .preloader { display: none !important; }
    .js .reveal, .js .reveal-card { opacity: 1; transform: none; }
    .js .bookshelf-strip .mini-spine { translate: 0 0; }
    .typewriter__cursor { display: none; }
}
