/* ===== IVY BookHouse — motion & interaction layer (fx) =====
   Everything here is progressive: without JS (no html.js) content is fully visible.
   prefers-reduced-motion switches every animation off at the bottom of this file. */

/* --- page transition --- */
html.js body{animation:pageIn .55s cubic-bezier(.2,.7,.2,1) backwards}
html.js body.leaving{opacity:0;transform:translateY(-8px);transition:opacity .22s ease,transform .22s ease}
/* opacity only: a transform on body would make it the containing block of fixed elements (the mobile filter drawer) */
@keyframes pageIn{from{opacity:0}to{opacity:1}}

/* --- logo: pops in, then the ivy house sways --- */
.brand img{transform-origin:50% 90%;animation:logoPop .8s cubic-bezier(.3,1.6,.5,1) both,sway 4.5s ease-in-out 1s infinite}
.brand img{animation:logoPop .8s both,brandSway 6s ease-in-out 1s infinite alternate}@keyframes brandSway{from{rotate:-2deg}to{rotate:2deg}}
@keyframes logoPop{from{transform:scale(.3) rotate(-25deg);opacity:0}to{transform:none;opacity:1}}
@keyframes sway{0%,100%{transform:rotate(-3deg)}50%{transform:rotate(3deg)}}
.footer-logo{transform-origin:50% 95%;animation:sway 6s ease-in-out infinite}

/* --- wiggle buttons --- */

@keyframes wiggle{0%,100%{rotate:0deg}20%{rotate:-3deg}40%{rotate:3deg}60%{rotate:-2deg}80%{rotate:1deg}}
.btn:focus-visible,.fx-focus:focus-visible{outline:3px dashed var(--coral);outline-offset:4px}

/* --- hero --- */
.hero{isolation:isolate}
.blob{position:absolute;border-radius:50%;filter:blur(2px);z-index:-1;pointer-events:none;will-change:transform}
.blob-1{width:340px;height:340px;right:-80px;top:-60px;background:radial-gradient(circle,#FCD9D2 0,transparent 70%)}
.blob-2{width:420px;height:420px;left:-140px;bottom:-120px;background:radial-gradient(circle,#DCE8D2 0,transparent 70%)}
.blob-3{width:180px;height:180px;left:44%;top:12%;background:radial-gradient(circle,#FCEBC0 0,transparent 70%)}
.sky{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.flake{position:absolute;top:-60px;left:var(--x);width:var(--sz);animation:fall var(--dur) linear var(--delay) infinite;opacity:var(--o,.85)}
.flake>svg{display:block;width:100%;height:auto;animation:drift calc(var(--dur)/3) ease-in-out infinite alternate}
@keyframes fall{to{transform:translateY(calc(var(--h,900px) + 120px)) rotate(var(--rot))}}
@keyframes drift{from{transform:translateX(-18px) rotate(-12deg)}to{transform:translateX(18px) rotate(12deg)}}

.vine{position:absolute;left:0;top:0;width:150px;height:auto;z-index:0;pointer-events:none;opacity:.95}
.vine .stem{fill:none;stroke:#5E7D52;stroke-width:3.5;stroke-linecap:round;stroke-dasharray:700;stroke-dashoffset:700;animation:draw 2.4s .3s ease forwards}
.vine .leaf{fill:#8FA87E;stroke:#5E7D52;stroke-width:1.5;transform-box:fill-box;transform-origin:0% 50%;transform:scale(0);animation:leafIn .6s cubic-bezier(.3,1.6,.5,1) forwards,leafSway 3.5s ease-in-out infinite alternate;animation-delay:calc(.6s + var(--i)*.22s),calc(1.8s + var(--i)*.22s)}
.vine g:nth-of-type(even) .leaf{fill:#A9C097}
.vine .berry{fill:#E8796A;transform-box:fill-box;transform-origin:center;transform:scale(0);animation:leafIn .5s cubic-bezier(.3,1.6,.5,1) forwards;animation-delay:calc(1.4s + var(--i)*.2s)}
@keyframes draw{to{stroke-dashoffset:0}}
@keyframes leafIn{to{transform:scale(1)}}
@keyframes leafSway{from{rotate:-8deg}to{rotate:8deg}}

html.js .hero-text>*{animation:fadeUp .7s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(.9s + var(--i,0)*.12s)}
html.js .hero-text>h1{animation:none}
@keyframes fadeUp{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:none}}
.hero h1 .w{display:inline-block;position:relative}
html.js .hero h1 .w{animation:pop .75s cubic-bezier(.3,1.7,.5,1) both;animation-delay:calc(.15s + var(--i)*.13s)}
@keyframes pop{0%{opacity:0;transform:translateY(46px) scale(.5) rotate(-8deg)}100%{opacity:1;transform:none}}
.underline{position:absolute;left:-2%;bottom:-.22em;width:104%;height:.4em;overflow:visible;pointer-events:none}
.underline path{fill:none;stroke:var(--coral);stroke-width:7;stroke-linecap:round;stroke-dasharray:420;stroke-dashoffset:420;animation:draw 1s cubic-bezier(.6,.1,.3,1) 1.05s forwards}
html:not(.js) .underline path{stroke-dashoffset:0}

.hero-art{perspective:1100px}
.tilt{position:relative;transform-style:preserve-3d;transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg));transition:transform .25s ease-out}
html.js .tilt{animation:coverIn 1.3s cubic-bezier(.2,.8,.2,1) .25s both,coverSway 9s ease-in-out 1.6s infinite alternate}
@keyframes coverSway{0%{transform:rotateY(0) rotateX(0)}30%{transform:rotateY(-9deg) rotateX(3deg) translateY(-6px)}70%{transform:rotateY(8deg) rotateX(-2deg) translateY(-3px)}100%{transform:rotateY(-3deg) rotateX(1deg) translateY(-8px)}}
@property --gx{syntax:'<percentage>';inherits:false;initial-value:30%}@property --gy{syntax:'<percentage>';inherits:false;initial-value:20%}
html.js .glare{animation:glareDrift 9s ease-in-out 1.6s infinite alternate}
@keyframes glareDrift{0%{--gx:30%;--gy:20%}50%{--gx:75%;--gy:45%}100%{--gx:20%;--gy:65%}}
@keyframes coverIn{from{opacity:0;transform:translateX(90px) translateY(30px) rotateY(-70deg) rotateX(12deg) scale(.85)}to{opacity:1;transform:none}}
.hero-cover{transform:rotate(-3deg) translateZ(30px)}
.page-behind{transform:rotate(7deg) translateZ(-20px)}
.glare{position:absolute;inset:0;z-index:3;border-radius:10px 18px 18px 10px;transform:rotate(-3deg) translateZ(31px);pointer-events:none;background:radial-gradient(circle at var(--gx,30%) var(--gy,20%),rgba(255,255,255,.45),transparent 45%);mix-blend-mode:soft-light}

/* --- scroll reveal --- */
html.js [data-reveal]{opacity:0;transform:translateY(34px);transition:opacity .8s cubic-bezier(.2,.7,.2,1) var(--d,0s),transform .8s cubic-bezier(.2,.7,.2,1) var(--d,0s),translate .25s ease,rotate .25s ease,box-shadow .25s ease}
html.js [data-reveal="left"]{transform:translateX(-50px) rotate(-2deg)}
html.js [data-reveal="right"]{transform:translateX(50px) rotate(2deg)}
html.js [data-reveal="zoom"]{transform:scale(.85)}
html.js [data-reveal].in{opacity:1;transform:none}

/* --- crayon scribble dividers --- */
.scribble{display:block;width:min(560px,80%);height:34px;margin:0 auto;overflow:visible}
.scribble path{fill:none;stroke-width:6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1400;stroke-dashoffset:1400;transition:stroke-dashoffset 1.8s cubic-bezier(.5,.1,.3,1)}
html:not(.js) .scribble path,.scribble.in path{stroke-dashoffset:0}
.scribble .s2{stroke-width:3;opacity:.55;transition-delay:.35s}
.divider{padding:6px 0 0}

/* --- counters --- */
.counters{display:grid;grid-template-columns:repeat(4,1fr);gap:20px;margin:0 0 2.6em}
.counter{position:relative;background:#fff;border-radius:var(--r);padding:22px 16px 18px;text-align:center;box-shadow:var(--shadow);overflow:hidden}
.counter b{display:block;font-family:var(--head);font-size:clamp(2.6rem,5vw,3.6rem);line-height:1;color:var(--c,var(--coral))}
.counter span{font-weight:800;color:var(--muted);font-size:.95rem}
.counter::after{content:"";position:absolute;left:18%;right:18%;bottom:10px;height:6px;border-radius:6px;background:var(--c,var(--coral));opacity:.25;transform:scaleX(0);transform-origin:left;transition:transform 1.2s .3s ease}
.counter.in::after,html:not(.js) .counter::after{transform:scaleX(1)}

/* --- feature cards hover --- */
.feature{transition:translate .25s cubic-bezier(.3,1.6,.5,1),rotate .25s,box-shadow .25s}
.feature:hover{background-color:#fffaf0}
.peek:nth-child(odd){transform:none;rotate:-1.5deg}.peek:nth-child(even){transform:none;rotate:1.5deg}
.peek,.gal-item{transition:translate .25s ease,rotate .25s ease}



/* --- sketch -> colour --- */
.colorin-grid{display:grid;grid-template-columns:1fr 1fr;gap:56px;align-items:center}
.colorin{position:relative;max-width:440px;margin:0 auto;--p:0;border-radius:10px 18px 18px 10px;box-shadow:0 25px 50px rgba(60,50,30,.25),-6px 0 0 #C8323C;overflow:hidden;background:#fff}
.colorin img{display:block;width:100%}
.colorin .color{position:absolute;inset:0;height:100%;object-fit:cover;clip-path:polygon(0 0,calc(var(--p)*150%) 0,calc(var(--p)*150% - 50%) 100%,0 100%)}
.colorin .crayon{position:absolute;top:50%;left:calc(var(--p)*150% - 25%);width:70px;transform:translate(-50%,-50%) rotate(28deg);filter:drop-shadow(0 6px 6px rgba(0,0,0,.25));pointer-events:none;opacity:calc(1 - max(0, var(--p) - .92)*12)}
.colorin.smooth .color,.colorin.smooth .crayon{transition:clip-path .9s ease,left .9s ease}
.range{display:flex;align-items:center;gap:12px;max-width:440px;margin:18px auto 0;font-family:var(--head);font-weight:700;color:var(--sage-d)}
.range input{flex:1;accent-color:var(--coral);height:28px;cursor:pointer}

/* --- flipbook --- */
.flip-wrap{display:flex;flex-direction:column;align-items:center}
.flipbook{position:relative;width:min(900px,100%);aspect-ratio:1.426;perspective:2400px;margin:10px auto 0;outline:none}
.fb-inner{position:absolute;inset:0;transition:transform .9s cubic-bezier(.645,.045,.355,1);transform:translateX(var(--shift,0%))}
.leaf{position:absolute;left:50%;top:0;width:50%;height:100%;transform-origin:left center;transform-style:preserve-3d;transition:transform 1.1s cubic-bezier(.645,.045,.355,1);cursor:pointer}
.leaf.flipped{transform:rotateY(-180deg)}
.face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;background:#fff;overflow:hidden;border-radius:0 10px 10px 0;box-shadow:0 14px 30px rgba(60,50,30,.22)}
.face img{width:100%;height:100%;object-fit:cover;display:block}
.face.back{transform:rotateY(180deg);border-radius:10px 0 0 10px}
.face::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(0,0,0,.18),rgba(0,0,0,0) 9%)}
.face.back::after{background:linear-gradient(270deg,rgba(0,0,0,.18),rgba(0,0,0,0) 9%)}
.leaf.cover .face.front{border-radius:6px 14px 14px 6px;box-shadow:0 20px 40px rgba(60,50,30,.3),-6px 0 0 #C8323C}
.leaf.cover .face.front::after{display:none}
.face.end{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:8%;background:repeating-linear-gradient(0deg,#fff 0 26px,#EAF0E4 26px 27px),#fff;font-family:var(--head)}
.face.end h3{font-size:clamp(1rem,2.4vw,1.6rem);color:var(--sage-d)}
.face.end p{font-size:clamp(.72rem,1.4vw,.95rem);font-family:var(--body)}
.face.end .btn{font-size:clamp(.72rem,1.3vw,.95rem);padding:.6em 1em}
.fb-controls{display:flex;align-items:center;gap:16px;margin-top:22px;font-family:var(--head);font-weight:700}
.fb-controls button{width:52px;height:52px;border-radius:50%;border:2px solid var(--coral);background:#fff;color:var(--coral-d);font-size:1.6rem;cursor:pointer;box-shadow:0 4px 0 rgba(201,88,74,.35);transition:transform .15s}
.fb-controls button:hover:not(:disabled){filter:brightness(1.08)}
.fb-controls button:disabled{opacity:.35;cursor:default}
.fb-hint{font-size:.9rem;color:var(--muted);margin-top:8px}

/* --- try colouring --- */
.try-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:44px;align-items:center}
.paper{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:16px;position:relative}
.paper::before{content:"";position:absolute;inset:8px;border:2px dashed var(--sage-l);border-radius:16px;pointer-events:none}
.colour-svg{width:100%;height:auto;display:block;touch-action:manipulation}
.colour-svg .rg{fill:#fff;stroke:#333;stroke-width:3;stroke-linejoin:round;transition:fill .35s ease;cursor:inherit}
.colour-svg .rg:hover{filter:brightness(.97)}
.colour-svg .rg:focus-visible{outline:none;stroke:var(--coral);stroke-width:5}
.colour-svg .rg.just{animation:splash .45s ease}
.colour-svg .deco{fill:none;stroke:#333;stroke-width:3;stroke-linecap:round}
@keyframes splash{50%{filter:brightness(1.15) saturate(1.3)}}
.palette{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 18px}
.palette button{width:46px;height:62px;border:0;padding:0;background:none;cursor:pointer;transition:transform .2s cubic-bezier(.3,1.6,.5,1)}
.palette button svg{width:100%;height:100%;filter:drop-shadow(0 3px 3px rgba(0,0,0,.18))}
.palette button[aria-pressed="true"]{transform:translateY(-12px) rotate(-6deg)}
.palette button:focus-visible{outline:3px dashed var(--coral);outline-offset:3px;border-radius:8px}
.try-actions{display:flex;gap:10px;flex-wrap:wrap}
.btn-sm{padding:8px 16px;font-size:.92rem}

/* --- playful cursor accent (desktop) --- */
.spark{position:fixed;width:8px;height:8px;border-radius:50%;pointer-events:none;z-index:199;animation:spark .7s ease-out forwards}
@keyframes spark{to{transform:translate(var(--dx),var(--dy)) scale(0);opacity:0}}

@media (max-width:980px){.counters{grid-template-columns:1fr 1fr}}
@media (max-width:820px){
 .colorin-grid,.try-grid{grid-template-columns:1fr;gap:28px}
 .vine{width:90px;opacity:.6}
 .blob-3{display:none}
 .colorin{max-width:320px}
}
@media (max-width:560px){
 .counters{gap:12px}.counter{padding:16px 10px 14px}
 .palette button{width:38px;height:52px}
 .fb-controls button{width:46px;height:46px}
}



/* --- spotlight for the other available book(s) on the home page --- */
.spotlight{position:relative;overflow:hidden}
.spotlight.night{background:radial-gradient(circle at 15% 20%,#2b2f6b 0,#1d2050 55%,#171a40 100%);color:#fff}
.spotlight.night{color:#fff}.spotlight.night h2,.spotlight.night .lead{color:#fff}.spotlight.night .hero-line{color:#F2C14E}
.spotlight.night .counter span{color:#f1efe6}.spotlight.night .counter{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}
.spotlight.night .btn-ghost{color:#fff;border-color:#fff;background:transparent}.spotlight.night .btn-ghost:hover{background:#fff;color:#1d2050}
.spotlight .peeks{grid-template-columns:repeat(4,1fr);gap:14px;margin:1em 0 1.4em;max-width:none}
.spotlight .counters{margin:1.2em 0 1.4em;gap:12px}.spotlight .counter b{font-size:clamp(2rem,3.4vw,2.6rem)}.spotlight .counter{padding:16px 8px 14px}
.spot-grid{display:grid;grid-template-columns:minmax(260px,420px) 1fr;gap:56px;align-items:center;position:relative;z-index:1}
.spot-art{perspective:1100px}
.spot-card{display:block;position:relative;border-radius:14px;overflow:hidden;box-shadow:0 30px 60px rgba(0,0,0,.45);transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,-8deg));transition:transform .3s ease-out;transform-style:preserve-3d}
.spot-card img{display:block;width:100%;height:auto}
html.js .spot-card{animation:spotSway 8s ease-in-out infinite alternate}
@keyframes spotSway{from{rotate:y -5deg;translate:0 0}to{rotate:y 5deg;translate:0 -8px}}
.spot-glare{position:absolute;inset:0;background:radial-gradient(circle at var(--gx,30%) var(--gy,20%),rgba(255,255,255,.35),transparent 55%);pointer-events:none;mix-blend-mode:soft-light}
.confetti{position:absolute;inset:0;pointer-events:none;background-image:radial-gradient(circle,#F2C14E 2px,transparent 3px),radial-gradient(circle,#E8796A 2px,transparent 3px),radial-gradient(circle,#8FA87E 2px,transparent 3px),radial-gradient(circle,#fff 1px,transparent 2px);background-size:140px 160px,190px 150px,170px 210px,90px 110px;background-position:0 0,40px 70px,90px 20px,20px 50px;opacity:.55}
html.js .confetti{animation:confettiDrift 18s linear infinite}
@keyframes confettiDrift{to{background-position:0 160px,40px 220px,90px 230px,20px 160px}}
.spotlight .burst{position:absolute;width:6px;height:6px;border-radius:50%;pointer-events:none;z-index:0}
@media (max-width:860px){.spot-grid{grid-template-columns:1fr;gap:28px}.spot-art{max-width:300px;justify-self:center}.spotlight .peeks{grid-template-columns:repeat(2,1fr)}}
/* meadow theme (baby animals): sky-to-grass gradient, floating bubbles, bouncing peeks */
.spotlight.meadow{background:linear-gradient(180deg,#d8eefa 0,#eef8e6 62%,#d7ecc4 100%)}
.spotlight.meadow .hero-line{color:#2f8f8a}
.spotlight.meadow .confetti{background-image:radial-gradient(circle,rgba(255,255,255,.95) 5px,transparent 6px),radial-gradient(circle,rgba(232,121,106,.45) 3px,transparent 4px),radial-gradient(circle,rgba(242,193,78,.6) 3px,transparent 4px),radial-gradient(circle,rgba(143,168,126,.5) 2px,transparent 3px);opacity:.9}
html.js .spotlight.meadow .confetti{animation:bubbleRise 22s linear infinite}
@keyframes bubbleRise{to{background-position:0 -160px,40px -80px,90px -190px,20px -110px}}
.spotlight.meadow .spot-card{transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,8deg))}
html.js .spotlight.meadow .peek.in img{animation:hop 2.6s ease-in-out infinite;animation-delay:var(--d,0s)}
@keyframes hop{0%,80%,100%{transform:translateY(0)}88%{transform:translateY(-10px)}94%{transform:translateY(0)}}
.spotlight.meadow .spot-grid{grid-template-columns:1fr minmax(260px,420px)}.spotlight.meadow .spot-art{order:2}
@media (max-width:860px){.spotlight.meadow .spot-grid{grid-template-columns:1fr}.spotlight.meadow .spot-art{order:-1}}


/* ===== shared animation language for every page (page headers, book heroes, about, contact, 404) ===== */
/* page headers: blobs + floating sky + ivy vine + popping title with crayon underline */
.fx-head{position:relative;overflow:hidden;isolation:isolate;padding:64px 0 34px}
.fx-head .head-grid{position:relative;z-index:1}
.fx-head.has-side .head-grid{display:grid;grid-template-columns:1fr 240px;gap:30px;align-items:center}
.fx-head h1,.book-hero h1{position:relative}
.fx-head h1 .w,.book-hero h1 .w{display:inline-block;position:relative}
html.js .fx-head h1 .w,html.js .book-hero h1 .w{animation:pop .75s cubic-bezier(.3,1.7,.5,1) both;animation-delay:calc(.15s + var(--i)*.11s)}
html.js .fx-head .head-text>:not(h1){animation:fadeUp .7s cubic-bezier(.2,.7,.2,1) .7s both}
html.js .fx-head .head-text>.crumbs{animation-delay:.05s}
.fx-head .blob-1{width:260px;height:260px;top:-90px}
.fx-head .counters{margin:1.4em 0 0}
.counters-2{grid-template-columns:repeat(2,minmax(0,220px))!important}
.flake.rise{top:auto;bottom:-60px;animation-name:rise}
@keyframes rise{to{transform:translateY(calc(-1*var(--h,600px) - 120px)) rotate(var(--rot))}}

/* staggered reveal variants */
html.js [data-reveal="up"]{transform:translateY(46px)}
html.js [data-reveal="pop"]{transform:scale(.55) rotate(-5deg);transition-timing-function:cubic-bezier(.3,1.7,.5,1)}
html.js [data-reveal="pop"].in{transform:none}

/* covers: self-running shine when they scroll into view (fx.js adds .shine-in); .spot-card keeps its own resting angle + slow sway */
.tilt-wrap{perspective:900px}
.tilt-card{position:relative;display:block;transform-style:preserve-3d;transition:transform .3s ease-out}
.tilt-wrap>.tilt-card{transform:rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg))}
.tilt-card.shine-in .tilt-glare{animation:glareSweep 1.8s ease-out .2s both}
@keyframes glareSweep{0%{opacity:0;--gx:0%;--gy:10%}35%{opacity:1}100%{opacity:0;--gx:100%;--gy:80%}}
.tilt-glare{position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:radial-gradient(circle at var(--gx,30%) var(--gy,20%),rgba(255,255,255,.55),transparent 50%);mix-blend-mode:soft-light;opacity:0;transition:opacity .3s}

.cover-link.tilt-card{border-radius:6px 10px 10px 6px}
.cover-btn.tilt-card{border-radius:8px 16px 16px 8px}
.book-card .cover-link:hover img{transform:none}

/* book page heroes, themed like each book's home spotlight */
.book-hero.spotlight{padding:26px 0 70px}
.book-hero .wrap{position:relative;z-index:1}
.hero-crumbs{margin-bottom:18px}
.book-hero.spotlight .details{color:var(--ink)}
.spotlight.snow{background:linear-gradient(180deg,#e6f0f8 0,#f3f6f4 55%,var(--cream,#FDFAF2) 100%)}
.spotlight.snow .hero-line{color:#C8323C}
.spotlight.snow .confetti{background-image:radial-gradient(circle,rgba(255,255,255,.95) 3px,transparent 4px),radial-gradient(circle,rgba(200,50,60,.25) 2px,transparent 3px),radial-gradient(circle,rgba(143,168,126,.35) 2px,transparent 3px),radial-gradient(circle,#fff 1px,transparent 2px)}
.spotlight.night .crumbs,.spotlight.night .crumbs a,.spotlight.night h1,.spotlight.night .book-hero p,.book-hero.night p,.book-hero.night .where{color:#fff}
.book-hero.night .tag{background:rgba(255,255,255,.14);color:#F2C14E}
.book-hero.farm{padding-bottom:170px}
.book-hero .farm-barn{right:3%}
.book-hero .vine{opacity:.75}
@media (max-width:860px){.book-hero.farm{padding-bottom:130px}}

/* about: the ivy-house logo draws itself in, leaves sway around it */
.about-art.draw-in{position:relative;padding:22px}
.logo-draw{position:relative}
.logo-draw img{display:block;position:relative}
html.js .draw-in .logo-draw img{clip-path:circle(0% at 50% 58%);transition:clip-path 1.7s cubic-bezier(.5,.1,.3,1) 1.1s}
html.js .draw-in.in .logo-draw img{clip-path:circle(80% at 50% 58%)}
.house-draw{position:absolute;inset:8% 10%;width:80%;height:84%;pointer-events:none;opacity:0}
.house-draw path{fill:none;stroke:#5E7D52;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:600;stroke-dashoffset:600}
html.js .draw-in.in .house-draw{animation:houseShow 3.2s ease .2s both}
html.js .draw-in.in .house-draw path{animation:draw 1.3s ease .3s forwards}
@keyframes houseShow{0%,55%{opacity:1}100%{opacity:0}}
.sway-leaf{position:absolute;width:38px;z-index:2;transform-origin:0 50%;rotate:var(--r);pointer-events:none}
.sway-leaf path{fill:#8FA87E;stroke:#5E7D52;stroke-width:1.5}.sway-leaf .vein{fill:none}
.sway-leaf:nth-child(even) path:first-child{fill:#A9C097}
html.js .draw-in .sway-leaf{transform:scale(0);transition:transform .6s cubic-bezier(.3,1.6,.5,1) calc(2.2s + var(--i)*.15s)}
html.js .draw-in.in .sway-leaf{transform:scale(1)}
html.js .draw-in.in .sway-leaf path{transform-origin:0 50%;transform-box:fill-box}
html.js .draw-in.in .sway-leaf{animation:leafSway2 3.2s ease-in-out calc(3s + var(--i)*.3s) infinite alternate}
@keyframes leafSway2{from{rotate:calc(var(--r) - 10deg)}to{rotate:calc(var(--r) + 10deg)}}
.prose h2{position:relative}

/* contact: pop-in cards + a gentle envelope */
.envelope{width:100%;max-width:230px;display:block;margin:0 auto;overflow:visible}
.env-back{fill:#F6C9BF}.env-front{fill:#E8796A}.env-flap{fill:#C9584A}
.env-letter rect{fill:#fff;stroke:#eadfcb;stroke-width:2}.env-letter path{fill:none;stroke:#8FA87E;stroke-width:5;stroke-linecap:round}.env-letter .env-heart{fill:#E8796A;stroke:none}
.env-sparkles path{fill:#F2C14E}
.env-flap,.env-flap-open{transform-box:view-box;transform-origin:110px 60px}
html.js .env-float{animation:envBob 4s ease-in-out infinite}
html.js .env-letter{animation:letterUp 7s cubic-bezier(.4,0,.2,1) 1s infinite}
html.js .env-flap{animation:flapOpen 7s cubic-bezier(.4,0,.2,1) 1s infinite}
html.js .env-sparkles path{transform-box:fill-box;transform-origin:center;animation:twinkle 2.4s ease-in-out infinite}
html.js .env-sparkles path:nth-child(2){animation-delay:1.2s}
@keyframes envBob{0%,100%{transform:translateY(0) rotate(-2deg)}50%{transform:translateY(-10px) rotate(2deg)}}
@keyframes flapOpen{0%,8%{transform:scaleY(1)}20%,72%{transform:scaleY(-1)}84%,100%{transform:scaleY(1)}}
@keyframes letterUp{0%,18%{transform:translateY(0)}34%,62%{transform:translateY(-48px)}76%,100%{transform:translateY(0)}}
@keyframes twinkle{0%,100%{transform:scale(.6);opacity:.5}50%{transform:scale(1.2);opacity:1}}
.contact-card{transition:translate .25s cubic-bezier(.3,1.6,.5,1),rotate .25s,box-shadow .25s}
.contact-card:hover{background-color:#fffaf0}

@media (max-width:760px){.fx-head.has-side .head-grid{grid-template-columns:1fr}.fx-head .head-side{max-width:150px;margin:0 auto;order:-1}.fx-head{padding:44px 0 24px}}


/* ===== jungle theme (Wild Animals of India): hanging vines, fireflies, swaying grass, a tiger and a peacock peeking out ===== */
.spotlight.jungle{background:radial-gradient(ellipse at 70% 10%,#2f7a43 0,#1d5a33 45%,#123f24 100%);color:#fff;padding-bottom:150px}
.spotlight.jungle h2,.spotlight.jungle h1,.spotlight.jungle .lead,.book-hero.jungle p,.book-hero.jungle .where,.spotlight.jungle .crumbs,.spotlight.jungle .crumbs a{color:#fff}
.spotlight.jungle .hero-line{color:#F2C14E}
.spotlight.jungle .tag{background:rgba(255,255,255,.14);color:#F2C14E}
.spotlight.jungle .counter span{color:#f1efe6}.spotlight.jungle .counter{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}
.spotlight.jungle .btn-ghost{color:#fff;border-color:#fff;background:transparent}.spotlight.jungle .btn-ghost:hover{background:#fff;color:#123f24}
.spotlight.jungle .badge{background:rgba(255,255,255,.12);color:#fff}
.spotlight.jungle .confetti{display:none}
.jungle-scene{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.jungle-vine{position:absolute;top:-6px;width:70px;transform-origin:50% 0}
.jungle-vine .vine-stem{fill:none;stroke:#0f3a1f;stroke-width:4}
.jungle-vine g path{fill:#4f9c47;stroke:#174a25;stroke-width:1.5}
.jungle-vine g:nth-of-type(odd) path{fill:#6bb357}
.jungle-vine.v1{left:2%;height:280px}.jungle-vine.v2{display:none}.jungle-vine.v3{right:3%;height:240px}
html.js .jungle-vine{animation:vineSway 5s ease-in-out infinite alternate}
html.js .jungle-vine.v2{animation-duration:6.5s;animation-delay:-2s}html.js .jungle-vine.v3{animation-duration:5.8s;animation-delay:-1s}
@keyframes vineSway{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}
.firefly{position:absolute;left:var(--x);top:var(--y);width:6px;height:6px;border-radius:50%;background:#fff6a8;box-shadow:0 0 8px 3px rgba(255,236,120,.75),0 0 18px 6px rgba(255,220,80,.25);opacity:0}
html.js .firefly{animation:fireGlow var(--t) ease-in-out var(--d) infinite,fireDrift calc(var(--t)*1.6) ease-in-out var(--d) infinite alternate}
@keyframes fireGlow{0%,100%{opacity:0}40%,60%{opacity:1}}
@keyframes fireDrift{from{translate:0 0}to{translate:30px -40px}}
.jungle-grass{position:absolute;left:0;right:0;bottom:0;width:100%;height:150px;z-index:2}
.jungle-grass .gb{transform-box:fill-box;transform-origin:50% 100%}
html.js .jungle-grass .g1{animation:grassSway 4.5s ease-in-out infinite alternate}
html.js .jungle-grass .g2{animation:grassSway 3.6s ease-in-out -1s infinite alternate}
html.js .jungle-grass .g3{animation:grassSway 3s ease-in-out -2s infinite alternate}
@keyframes grassSway{from{transform:skewX(-5deg)}to{transform:skewX(5deg)}}
.jungle-peek{position:absolute;bottom:36px;z-index:1;filter:drop-shadow(0 8px 12px rgba(0,0,0,.35))}
.jungle-peek img{display:block;width:100%;height:100%;object-fit:cover}
.jungle-peek.tiger{left:7%;width:150px;height:126px;border-radius:50% 50% 18px 18px;overflow:hidden;border:4px solid #F2C14E}
.jungle-peek.peacock{right:8%;width:96px;height:150px;border-radius:48px 48px 14px 14px;overflow:hidden;border:4px solid #8fd0e8}
html.js .jungle-peek{transform:translateY(110%)}
html.js .jungle-peek.tiger{animation:peekUp 9s cubic-bezier(.3,1.4,.5,1) 1s infinite}
html.js .jungle-peek.peacock{animation:peekUp 9s cubic-bezier(.3,1.4,.5,1) 5.5s infinite}
@keyframes peekUp{0%,8%{transform:translateY(110%)}18%,30%{transform:translateY(0) rotate(-3deg)}36%,44%{transform:translateY(0) rotate(3deg)}54%,100%{transform:translateY(110%)}}
.book-hero.jungle{padding-bottom:170px}
.book-hero .jungle-vine.v2{display:none}
@media (max-width:860px){.jungle-peek.tiger{width:96px;height:82px;left:4%}.jungle-peek.peacock{width:62px;height:98px;right:4%}.jungle-grass{height:110px}.spotlight.jungle,.book-hero.jungle{padding-bottom:120px}.jungle-vine.v2{display:none}.firefly:nth-of-type(n+10){display:none}}
@media (prefers-reduced-motion:reduce){html.js .jungle-peek{transform:none!important}.firefly{opacity:.8!important}.jungle-vine,.jungle-grass .gb,.firefly,.jungle-peek{animation:none!important}}

/* --- reduced motion: everything static, everything visible --- */
/* square covers in a spotlight: a little smaller so they do not tower over the text */
.spot-art.shape-square{max-width:400px;width:100%;justify-self:center}
/* farm theme (farm & pet animals): sunny sky, spinning sun, drifting clouds, rolling hills, bobbing barn, bouncing peeks */
.spotlight.farm{background:linear-gradient(180deg,#bfe6fb 0,#e4f5fb 45%,#fbf6ea 78%,#e6f1cf 100%);padding-bottom:150px}
.spotlight.farm .hero-line{color:#c8473c}
.spotlight.farm .confetti{background-image:radial-gradient(circle,rgba(255,255,255,.9) 3px,transparent 4px),radial-gradient(circle,rgba(242,193,78,.55) 3px,transparent 4px),radial-gradient(circle,rgba(232,121,106,.35) 2px,transparent 3px),radial-gradient(circle,rgba(255,255,255,.8) 1px,transparent 2px);opacity:.8}
html.js .spotlight.farm .confetti{animation:farmPollen 26s linear infinite}
@keyframes farmPollen{to{background-position:140px 0,230px 70px,260px 20px,110px 50px}}
.farm-scene{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.farm-sun{position:absolute;top:34px;right:7%;width:92px;height:92px;border-radius:50%;background:radial-gradient(circle,#ffe58a 0 52%,#F2C14E 53% 60%,transparent 61%);box-shadow:0 0 60px 20px rgba(255,214,90,.45)}
.farm-sun::before{content:"";position:absolute;inset:-26px;border-radius:50%;background:repeating-conic-gradient(rgba(242,193,78,.75) 0 7deg,transparent 7deg 30deg);-webkit-mask:radial-gradient(circle,transparent 0 58%,#000 59% 100%);mask:radial-gradient(circle,transparent 0 58%,#000 59% 100%)}
html.js .farm-sun::before{animation:sunSpin 30s linear infinite}
@keyframes sunSpin{to{transform:rotate(360deg)}}
.farm-cloud{position:absolute;width:150px;height:44px;border-radius:44px;background:#fff;opacity:.92;box-shadow:40px -18px 0 4px #fff,86px -4px 0 -2px #fff}
.farm-cloud.c1{top:70px;left:14%}.farm-cloud.c2{top:150px;left:44%;transform:scale(.7);opacity:.75}
html.js .farm-cloud.c1{animation:cloudGo 60s linear infinite}html.js .farm-cloud.c2{animation:cloudGo 85s linear infinite -40s}
@keyframes cloudGo{from{left:-220px}to{left:110%}}
.farm-hills{position:absolute;left:0;right:0;bottom:0;width:100%;height:170px}
.farm-barn{position:absolute;right:6%;bottom:58px;width:130px;height:auto;transform-origin:50% 100%;filter:drop-shadow(0 8px 6px rgba(0,0,0,.15))}
html.js .farm-barn{animation:barnBob 3.4s ease-in-out infinite}
@keyframes barnBob{0%,100%{transform:translateY(0) rotate(0)}30%{transform:translateY(-8px) rotate(-1.5deg)}60%{transform:translateY(0) rotate(1deg) scaleY(.97)}}
.farm-fence{position:absolute;left:4%;bottom:34px;width:300px;height:46px}
html.js .spotlight.farm .peek.in img{animation:farmBounce 2.2s cubic-bezier(.3,.7,.4,1) infinite;animation-delay:var(--d,0s);transform-origin:50% 100%}
@keyframes farmBounce{0%,100%{transform:translateY(0) scale(1,1)}12%{transform:translateY(0) scale(1.06,.92)}35%{transform:translateY(-14px) scale(.97,1.04)}55%{transform:translateY(0) scale(1.04,.95)}70%{transform:translateY(0) scale(1,1)}}
.spotlight.farm .peek:nth-child(2) img{--d:.3s}.spotlight.farm .peek:nth-child(3) img{--d:.6s}.spotlight.farm .peek:nth-child(4) img{--d:.9s}
@media (max-width:860px){.spotlight.farm{padding-bottom:120px}.farm-sun{width:64px;height:64px;top:18px;right:5%}.farm-barn{width:92px;bottom:46px}.farm-fence{width:180px;bottom:26px}.farm-hills{height:120px}}
/* ===== birds theme (Birds of India): sunset sky, drifting clouds + feathers, parakeets flying across, birds perched on a flowering branch ===== */
.spotlight.birds{background:linear-gradient(180deg,#bfe3e2 0,#f6e0cc 52%,#f5c0aa 100%);color:#24414a;padding-bottom:160px}
.spotlight.birds h1,.spotlight.birds h2{color:#1f5560}
.spotlight.birds .hero-line{color:#C2185B}
.spotlight.birds .tag{background:rgba(255,255,255,.7);color:#C2185B}
.spotlight.birds .counter{background:rgba(255,255,255,.62)}
.spotlight.birds .confetti{display:none}
.bird-scene{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.bird-scene .sky{position:absolute;inset:0}
.flake.feather{animation-name:featherFall}
@keyframes featherFall{0%{transform:translate(0,0) rotate(-25deg)}25%{transform:translate(28px,calc(var(--h,900px)*.25)) rotate(25deg)}50%{transform:translate(-18px,calc(var(--h,900px)*.5)) rotate(-20deg)}75%{transform:translate(24px,calc(var(--h,900px)*.75)) rotate(22deg)}100%{transform:translate(0,calc(var(--h,900px) + 120px)) rotate(-15deg)}}
.bird-sun{position:absolute;right:16%;bottom:70px;width:170px;height:170px;border-radius:50%;background:radial-gradient(circle,#fff3c4 0,#ffd27a 45%,rgba(255,190,110,0) 70%);opacity:.85}
html.js .bird-sun{animation:sunGlow 5s ease-in-out infinite alternate}
@keyframes sunGlow{to{transform:scale(1.12);opacity:1}}
.bird-cloud{position:absolute;height:38px;border-radius:40px;background:rgba(255,255,255,.75);filter:blur(1px)}
.bird-cloud::before,.bird-cloud::after{content:"";position:absolute;background:inherit;border-radius:50%}
.bird-cloud::before{width:60px;height:60px;left:22px;top:-28px}.bird-cloud::after{width:44px;height:44px;left:70px;top:-18px}
.bird-cloud.c1{width:150px;top:12%;left:8%}.bird-cloud.c2{width:120px;top:30%;right:6%;opacity:.7}
html.js .bird-cloud.c1{animation:cloudDrift 26s ease-in-out infinite alternate}html.js .bird-cloud.c2{animation:cloudDrift 32s ease-in-out -8s infinite alternate-reverse}
@keyframes cloudDrift{to{transform:translateX(90px)}}
.bird-far{position:absolute;top:9%;left:38%;width:160px;fill:none;stroke:#4c5a63;stroke-width:3;stroke-linecap:round;opacity:.55}
.bird-far path{transform-box:fill-box;transform-origin:50% 100%}
html.js .bird-far .w1{animation:farFlap .6s ease-in-out infinite alternate}html.js .bird-far .w2{animation:farFlap .5s ease-in-out -.2s infinite alternate}html.js .bird-far .w3{animation:farFlap .55s ease-in-out -.4s infinite alternate}
html.js .bird-far{animation:farGlide 14s ease-in-out infinite alternate}
@keyframes farFlap{to{transform:scaleY(.35)}}
@keyframes farGlide{to{transform:translate(120px,-14px)}}
.bird-fly{position:absolute;top:6%;left:0;width:92px;z-index:1;filter:drop-shadow(0 6px 8px rgba(40,60,40,.25))}
.bird-fly img{display:block;width:100%;height:auto;transform-origin:60% 40%}
.bird-fly.f2{top:22%;width:64px}
html.js .bird-fly{transform:translateX(110vw)}
html.js .bird-fly.f1{animation:flyAcross 16s linear 1s infinite}
html.js .bird-fly.f2{animation:flyAcross 21s linear 7s infinite}
html.js .bird-fly img{animation:flap .34s ease-in-out infinite alternate}
@keyframes flyAcross{0%{transform:translate(110vw,0)}25%{transform:translate(75vw,-18px)}50%{transform:translate(45vw,10px)}75%{transform:translate(15vw,-14px)}100%{transform:translate(-20vw,0)}}
@keyframes flap{from{transform:scaleY(1) rotate(-2deg)}to{transform:scaleY(.82) rotate(3deg)}}
.bird-branch{position:absolute;left:0;right:0;bottom:0;width:100%;height:150px;z-index:2}
.bird-branch .bark{fill:none;stroke:#6b4a32;stroke-width:14;stroke-linecap:round}
.bird-branch .twig{fill:none;stroke:#6b4a32;stroke-width:6;stroke-linecap:round}
.bird-branch .lv path{fill:#6f9a4e;stroke:#3f6a2e;stroke-width:1}
.bird-branch .lv path:nth-child(3n){fill:#8db565}
.bird-branch .fl circle{fill:#e8532c}.bird-branch .fl circle:nth-child(2n){fill:#f08a2c}
.bird-branch .br-sway,.bird-branch .lv,.bird-branch .fl{transform-box:fill-box}
.bird-branch .br-sway.l{transform-origin:0 100%}.bird-branch .br-sway.r{transform-origin:100% 100%}
html.js .bird-branch .lv path{transform-box:fill-box;transform-origin:0 50%}
html.js .bird-branch .fl{transform-origin:50% 100%;animation:flSway 3.8s ease-in-out infinite alternate}
@keyframes flSway{from{transform:rotate(-4deg)}to{transform:rotate(4deg)}}
.bird-perch{position:absolute;bottom:62px;z-index:3;overflow:hidden;border-radius:50% 50% 22px 22px;border:4px solid #fff;box-shadow:0 8px 16px rgba(60,40,30,.28);transform-origin:50% 100%}
.bird-perch img{display:block;width:100%;height:100%;object-fit:cover}
.bird-perch.hornbill{left:5%;width:112px;height:122px;border-color:#F2C14E}
.bird-perch.kingfisher{left:24%;width:86px;height:108px;border-color:#7fc6b8;bottom:70px}
.bird-perch.roller{right:9%;width:104px;height:102px;border-color:#f2a07b;bottom:58px}
html.js .bird-perch{animation:perchHop 4.2s ease-in-out infinite}
html.js .bird-perch.kingfisher{animation-delay:1.4s}html.js .bird-perch.roller{animation-delay:2.6s}
@keyframes perchHop{0%,62%,100%{transform:translateY(0) rotate(0)}68%{transform:translateY(-14px) rotate(-4deg)}74%{transform:translateY(0) rotate(0)}80%{transform:translateY(-7px) rotate(3deg)}86%{transform:translateY(0)}}
.book-hero.birds{padding-bottom:180px}
@media (max-width:860px){.bird-perch.hornbill{width:74px;height:80px;left:3%}.bird-perch.kingfisher{width:58px;height:72px;left:22%;bottom:52px}.bird-perch.roller{width:68px;height:66px;right:5%;bottom:44px}.bird-branch{height:100px}.bird-perch{bottom:44px}.spotlight.birds,.book-hero.birds{padding-bottom:130px}.bird-fly{width:62px}.bird-fly.f2{display:none}.bird-sun{width:110px;height:110px}.bird-far{width:110px}}
@media (prefers-reduced-motion:reduce){html.js .bird-fly{transform:translateX(70vw)!important}html.js .bird-fly.f2{display:none}.bird-fly,.bird-fly img,.bird-perch,.bird-far,.bird-far path,.bird-cloud,.bird-sun,.bird-branch .fl{animation:none!important}}

@media (prefers-reduced-motion:reduce){
  .confetti,.peek img,.farm-sun::before,.farm-cloud,.farm-barn{animation:none!important}.spot-card{transform:none!important}
 *,*::before,*::after{animation:none!important;transition:none!important}
 html.js [data-reveal]{opacity:1!important;transform:none!important}
 .vine .stem,.underline path,.scribble path{stroke-dashoffset:0!important}
 .vine .leaf,.vine .berry{transform:none!important}
 .sky,.spark,.glare{display:none!important}
 .tilt{transform:none!important;animation:none!important}.glare,.tilt-glare,.spot-card{animation:none!important}
 .tilt-card{transform:none!important}
 html.js .draw-in .logo-draw img{clip-path:none!important}
 html.js .draw-in .sway-leaf{transform:none!important}
 .house-draw{display:none!important}
 html.js .fx-head h1 .w,html.js .book-hero h1 .w{opacity:1!important}
}

/* =========================================================================
   Books catalogue: sticky search / filter / sort bar, shop cards, mobile drawer
   ========================================================================= */
.catalogue{padding-top:26px}
.cat-sentinel{height:1px;margin-bottom:-1px}
/* no backdrop-filter here: it would become the containing block of the fixed mobile drawer */
.cat-bar{position:sticky;top:var(--hh,78px);z-index:40;padding:12px 0;background:rgba(251,246,234,.97);transition:box-shadow .25s,background .25s}
main{overflow-x:clip}
.cat-bar.drawer-open{z-index:130} /* lift the bar's stacking context above the site header while the drawer is open */
.cat-bar.stuck{background:rgba(255,253,248,.96);box-shadow:0 10px 24px -14px rgba(70,60,40,.35);border-bottom:2px dashed rgba(143,168,126,.45)}
.cat-inner{display:grid;grid-template-columns:minmax(240px,1fr) auto auto;grid-template-areas:"search selects sort" "chips chips chips";gap:10px 12px;align-items:center}
.cat-panel{display:contents}
.cat-panel-head,.cat-panel-foot,.cat-filter-btn{display:none}
.cat-search{grid-area:search;position:relative;display:block}
.cat-search svg{position:absolute;left:14px;top:50%;width:20px;height:20px;transform:translateY(-50%);fill:none;stroke:var(--sage-d);stroke-width:2.4;stroke-linecap:round;pointer-events:none}
.cat-search input{width:100%;font:600 1rem var(--body);color:var(--ink);background:#fff;border:2px solid var(--sage);border-radius:999px;padding:10px 16px 10px 44px;outline:none;transition:border-color .2s,box-shadow .2s}
.cat-search input::placeholder{color:#9a958a}
.cat-search input:focus{border-color:var(--coral);box-shadow:0 0 0 4px rgba(232,121,106,.18)}
.cat-selects{grid-area:selects;display:flex;gap:8px}
.cat-sort{grid-area:sort}
.cat-select{position:relative;display:inline-flex;align-items:center;gap:6px;background:#fff;border:2px solid var(--sage-l);border-radius:999px;padding:0 12px 0 14px;height:44px;transition:border-color .2s,background .2s}
.cat-select span{font:700 .78rem var(--head);text-transform:uppercase;letter-spacing:.05em;color:var(--sage-d)}
.cat-select select{appearance:none;-webkit-appearance:none;border:0;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235E7D52' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right center/12px 8px;padding:0 20px 0 0;font:700 .95rem var(--body);color:var(--ink);cursor:pointer;outline:none;max-width:190px}
.cat-select:focus-within{border-color:var(--coral);box-shadow:0 0 0 4px rgba(232,121,106,.15)}
.cat-select.on{border-color:var(--sage);background:var(--sage-l)}
.cat-sort{border-color:var(--sage)}
/* category chips: one scrollable row with arrows when it overflows */
.cat-chips-wrap{grid-area:chips;position:relative;min-width:0}
.cat-chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:3px 2px 5px;scroll-snap-type:x proximity;-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 0,#000 calc(100% - 0px),transparent 100%)}
.cat-chips::-webkit-scrollbar{display:none}
.cat-chips-wrap.over:not(.at-end) .cat-chips{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 70px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 70px),transparent)}
.cat-chips-wrap.over:not(.at-start):not(.at-end) .cat-chips{-webkit-mask-image:linear-gradient(90deg,transparent,#000 70px,#000 calc(100% - 70px),transparent);mask-image:linear-gradient(90deg,transparent,#000 70px,#000 calc(100% - 70px),transparent)}
.cat-chips-wrap.over.at-end:not(.at-start) .cat-chips{-webkit-mask-image:linear-gradient(90deg,transparent,#000 70px);mask-image:linear-gradient(90deg,transparent,#000 70px)}
.chip-arrow{display:none;position:absolute;top:50%;transform:translateY(-55%);z-index:2;width:34px;height:34px;border-radius:50%;border:2px solid var(--sage);background:#fff;color:var(--sage-d);font:700 1.3rem/1 var(--head);cursor:pointer;box-shadow:var(--shadow)}
.chip-arrow.l{left:-6px}.chip-arrow.r{right:-6px}
.cat-chips-wrap.over:not(.at-end) .chip-arrow.r,.cat-chips-wrap.over:not(.at-start) .chip-arrow.l{display:block}
.chip{flex:0 0 auto;scroll-snap-align:start;display:inline-flex;align-items:center;gap:6px;font:700 .9rem var(--head);color:var(--sage-d);background:#fff;border:2px solid var(--sage);border-radius:999px;padding:6px 14px;cursor:pointer;transition:background .2s,color .2s,transform .15s,box-shadow .2s;white-space:nowrap}
.chip small{font:800 .72rem var(--body);background:var(--sage-l);color:var(--sage-d);border-radius:999px;padding:1px 7px;transition:inherit}
.chip:hover{background-color:#eef3e8}
.chip:focus-visible{outline:3px solid var(--coral);outline-offset:2px}
.chip[aria-pressed="true"]{background:var(--sage);color:#fff;box-shadow:0 3px 0 var(--sage-d)}
.chip[aria-pressed="true"] small{background:rgba(255,255,255,.25);color:#fff}
.chip-all[aria-pressed="true"]{background:var(--coral);border-color:var(--coral);box-shadow:0 3px 0 var(--coral-d)}
/* status row: count, removable active-filter pills, clear */
.cat-status{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:18px 0 22px;min-height:36px}
.cat-count{margin:0;font:700 1rem var(--head);color:var(--muted)}
.cat-count b{color:var(--coral-d);font-size:1.15rem}
.cat-active{display:flex;flex-wrap:wrap;gap:6px}
.cat-pill{display:inline-flex;align-items:center;gap:6px;border:0;background:var(--sage-l);color:var(--sage-d);font:700 .85rem var(--body);border-radius:999px;padding:5px 8px 5px 12px;cursor:pointer;animation:pillIn .3s cubic-bezier(.3,1.6,.5,1) both}
.cat-pill span{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;background:#fff;font-size:.9rem;line-height:1}
.cat-pill:hover{background:#d9e5cf}
@keyframes pillIn{from{opacity:0;transform:scale(.6)}}
.cat-clear{border:0;background:none;color:var(--coral-d);font:700 .92rem var(--head);text-decoration:underline;text-underline-offset:3px;cursor:pointer;padding:4px 6px}
/* product grid + cards */
.shop-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,232px),1fr));gap:26px 22px;align-items:stretch}
.shop-card{position:relative;display:flex;flex-direction:column;background:#fff;border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden;transition:translate .25s ease,box-shadow .25s ease}
.shop-card[hidden]{display:none}
.shop-card:hover .sc-title{color:var(--coral-d,#c55)}
.sc-cover{display:grid;place-items:center;aspect-ratio:1/1.08;padding:20px 18px 14px;background:radial-gradient(circle at 30% 20%,#fff 0,transparent 55%),linear-gradient(160deg,var(--sage-l),#FDE9E4)}
.shop-card:nth-child(3n+2) .sc-cover{background:radial-gradient(circle at 70% 20%,#fff 0,transparent 55%),linear-gradient(160deg,#FFF1CF,var(--sage-l))}
.shop-card:nth-child(3n) .sc-cover{background:radial-gradient(circle at 30% 80%,#fff 0,transparent 55%),linear-gradient(160deg,#FDE4DF,#FFF6DE)}
.sc-cover img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:6px;box-shadow:0 8px 18px rgba(50,40,20,.22);transform:rotate(-1.5deg);transition:transform .35s cubic-bezier(.3,1.5,.5,1)}

.sc-body{display:flex;flex-direction:column;flex:1;padding:14px 18px 18px}
.sc-cat{align-self:flex-start;font:800 .7rem var(--body);text-transform:uppercase;letter-spacing:.06em;color:var(--sage-d);background:var(--sage-l);border-radius:999px;padding:2px 10px;margin-bottom:8px}
.sc-body h3{font-size:1.08rem;margin:0 0 6px}
.sc-body h3 a{color:inherit;text-decoration:none}
.sc-body h3 a::after{content:"";position:absolute;inset:0;z-index:0}
.sc-meta{display:flex;flex-wrap:wrap;gap:4px 10px;margin:0 0 10px;font-size:.84rem;color:var(--muted);font-weight:700}
.sc-meta span+span::before{content:"·";margin-right:10px;color:var(--sage)}
.sc-price{margin:auto 0 12px;font-family:var(--head)}
.sc-price strong{font-size:1.35rem;color:var(--coral-d)}
.sc-price small{font:600 .75rem var(--body);color:var(--muted)}
.sc-btns{position:relative;z-index:1;display:flex;gap:8px;flex-wrap:wrap}
.sc-btns .btn{flex:1 1 auto;justify-content:center;padding:8px 12px;font-size:.88rem}
.cat-empty{text-align:center;padding:40px 20px 20px;animation:fadeUp .5s both}
.cat-empty img{opacity:.85;animation:emptyWobble 3s ease-in-out infinite}
.cat-empty h2{margin:.4em 0 .2em}
@keyframes emptyWobble{0%,100%{transform:rotate(-6deg)}50%{transform:rotate(6deg) translateY(-6px)}}
.see-all{margin-top:30px}
.related .shop-grid{grid-template-columns:repeat(4,1fr)}
.related .btn-ghost{margin-top:26px}
@media (max-width:1100px){.cat-select select{max-width:130px}.cat-inner{grid-template-columns:minmax(200px,1fr) auto auto}}
@media (max-width:980px){.related .shop-grid{grid-template-columns:repeat(2,1fr)}}
/* mobile: compact bar (search / Filters / Sort) + slide-out drawer */
@media (max-width:860px){
  .cat-inner{grid-template-columns:1fr auto;grid-template-areas:"search search" "filters sort"}
  .cat-filter-btn{grid-area:filters;display:inline-flex;align-items:center;gap:8px;justify-self:start;height:44px;padding:0 18px;border-radius:999px;border:2px solid var(--sage);background:#fff;color:var(--sage-d);font:700 1rem var(--head);cursor:pointer}
  .cat-filter-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
  .cat-badge{display:inline-grid;place-items:center;min-width:22px;height:22px;border-radius:999px;background:var(--coral);color:#fff;font:800 .78rem var(--body);padding:0 6px}
  .cat-badge[hidden]{display:none}
  .cat-panel{display:flex;flex-direction:column;position:fixed;z-index:120;top:0;right:0;bottom:0;width:min(88vw,380px);background:var(--cream);box-shadow:-20px 0 40px rgba(40,30,10,.25);border-radius:24px 0 0 24px;transform:translateX(105%);visibility:hidden;transition:transform .38s cubic-bezier(.2,.8,.2,1),visibility 0s linear .38s;overflow-y:auto;overscroll-behavior:contain}
  .cat-panel.open{transform:none;visibility:visible;transition:transform .38s cubic-bezier(.2,.8,.2,1),visibility 0s}
  .cat-panel-head{display:flex;align-items:center;justify-content:space-between;padding:18px 20px 10px;position:sticky;top:0;background:var(--cream);z-index:1}
  .cat-panel-head strong{font:700 1.4rem var(--head);color:var(--sage-d)}
  .cat-close{width:40px;height:40px;border-radius:50%;border:2px solid var(--sage);background:#fff;color:var(--sage-d);font-size:1.6rem;line-height:1;cursor:pointer}
  .cat-chips-wrap{padding:4px 20px 0}
  .cat-chips-wrap::before{content:"Category";display:block;font:700 .8rem var(--head);text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-bottom:8px}
  .cat-chips{flex-wrap:wrap;overflow:visible;-webkit-mask-image:none!important;mask-image:none!important}
  .chip-arrow{display:none!important}
  .cat-selects{flex-direction:column;gap:12px;padding:20px}
  .cat-selects .cat-select{height:50px;justify-content:space-between}
  .cat-selects .cat-select select{max-width:none;flex:1;text-align:right;text-align-last:right}
  .cat-panel-foot{display:flex;gap:10px;margin-top:auto;padding:14px 20px 20px;position:sticky;bottom:0;background:linear-gradient(transparent,var(--cream) 30%)}
  .cat-panel-foot .btn{flex:1;justify-content:center}
  .cat-panel-foot .cat-done{flex:1.5}
  .cat-backdrop{position:fixed;inset:0;z-index:110;background:rgba(51,51,51,.45);opacity:0;transition:opacity .3s}
  .cat-backdrop.show{opacity:1}
  body.cat-lock{overflow:hidden}
  .shop-grid{grid-template-columns:repeat(2,1fr);gap:16px 14px}
  .sc-body{padding:12px 12px 14px}
  .sc-cover{padding:14px 12px 10px}
}
@media (min-width:861px){.cat-backdrop{display:none}}
@media (max-width:380px){.shop-grid{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){
  .shop-card,.shop-card:hover,.sc-cover img,.shop-card:hover .sc-cover img{transform:none!important;translate:none!important}
  .cat-panel,.cat-backdrop{transition:none!important}
}

/* =========================================================================
   Per-book themes (`.spotlight.tm`): colours come from each cover via inline CSS vars set in _build/themes.py
   ========================================================================= */
.spotlight .wrap{position:relative;z-index:1}
.spotlight.tm{background:var(--tm-bg);color:var(--tm-ink)}
.spotlight.tm h1,.spotlight.tm h2{color:var(--tm-head)}
.spotlight.tm .hero-line{color:var(--tm-accent)}
.spotlight.tm .tag{background:var(--tm-tagbg);color:var(--tm-tagfg)}
.spotlight.tm .lead,.book-hero.tm p,.book-hero.tm .where,.spotlight.tm .crumbs,.spotlight.tm .crumbs a{color:var(--tm-ink)}
.spotlight.tm .badge{background:rgba(255,255,255,.66);color:var(--tm-ink)}
.spotlight.tm .confetti{opacity:.5;background-image:radial-gradient(circle,var(--m1) 2px,transparent 3px),radial-gradient(circle,var(--m2) 2px,transparent 3px),radial-gradient(circle,var(--m3) 2px,transparent 3px),radial-gradient(circle,#fff 1px,transparent 2px)}
.spotlight.tm.dark .confetti{opacity:.4}
.spotlight.tm.dark .badge{background:rgba(255,255,255,.12);color:#fff}
.spotlight.tm.dark .counter span{color:#f1efe6}.spotlight.tm.dark .counter{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}
.spotlight.tm.dark .btn-ghost{color:#fff;border-color:#fff;background:transparent}.spotlight.tm.dark .btn-ghost:hover{background:#fff;color:#222}
.book-hero.tm .details{color:var(--ink)}
.book-hero.tm .details dt{color:var(--muted)}

/* floating motifs (behind the content, around the edges) */
.motifs{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.motifs .mo{position:absolute;left:var(--x);top:var(--y);width:var(--s);height:var(--s);margin:calc(var(--s) / -2) 0 0 calc(var(--s) / -2);rotate:var(--r);opacity:.92;filter:drop-shadow(0 3px 4px rgba(0,0,0,.12))}
.spotlight.tm.dark .motifs .mo{opacity:.85;filter:drop-shadow(0 0 6px rgba(255,220,150,.25))}
.motifs svg,.card-motif svg{width:100%;height:100%;display:block;overflow:visible}
.motifs .a,.card-motif .a{fill:var(--m1)}.motifs .b,.card-motif .b{fill:var(--m2)}.motifs .c,.card-motif .c{fill:var(--m3)}.motifs .d,.card-motif .d{fill:var(--m4)}
.motifs .w,.card-motif .w{fill:#fff}.motifs .k,.card-motif .k{fill:#3a2e2a}.motifs .y,.card-motif .y{fill:#fff3b0}
.motifs .cr,.card-motif .cr{fill:#fbf1df}.motifs .sd,.card-motif .sd{fill:#6b4423}.motifs .bn,.card-motif .bn{fill:#fff8e6}.motifs .sm,.card-motif .sm{fill:rgba(255,255,255,.75)}
.motifs .cone,.card-motif .cone{fill:#e9b56a}.motifs .dn,.card-motif .dn{fill:#e2a65f}.motifs .cl,.card-motif .cl{fill:#fff;opacity:.92}
.motifs .jar,.card-motif .jar{fill:rgba(255,255,255,.45);stroke:#fff;stroke-width:2}
.motifs .bub,.card-motif .bub{fill:rgba(255,255,255,.3);stroke:rgba(255,255,255,.95);stroke-width:2.5}
.motifs .wg,.card-motif .wg{fill:rgba(255,255,255,.6);stroke:var(--m3);stroke-width:1.5}
.motifs .sw2,.card-motif .sw2{fill:#fff;stroke:rgba(0,0,0,.12);stroke-width:1.5}
.motifs .glow,.card-motif .glow{fill:#ffd35c;filter:drop-shadow(0 0 5px #ffcf5a)}.motifs .glow2,.card-motif .glow2{fill:#ff9f8a;filter:drop-shadow(0 0 5px #ff9f8a)}.motifs .glow3,.card-motif .glow3{fill:#9fe3c1;filter:drop-shadow(0 0 5px #9fe3c1)}
.motifs .ln,.card-motif .ln{fill:none;stroke:rgba(0,0,0,.18);stroke-width:2;stroke-linecap:round}
.motifs .ws,.card-motif .ws{fill:none;stroke:#fff;stroke-width:4;stroke-linecap:round;opacity:.8}
.motifs .sa,.card-motif .sa{fill:none;stroke:var(--m1);stroke-width:4.5;stroke-linecap:round}
.motifs .sb,.card-motif .sb{fill:none;stroke:var(--m2);stroke-width:3;stroke-linecap:round}
.motifs .sc,.card-motif .sc{fill:none;stroke:var(--m3);stroke-width:3;stroke-linecap:round}
.motifs .sk,.card-motif .sk{fill:none;stroke:#7a6a5a;stroke-width:2;stroke-linecap:round}
.motifs .sk2,.card-motif .sk2{fill:#f6d7b8}
.motifs .kl,.card-motif .kl{fill:none;stroke:#3a2e2a;stroke-width:2;stroke-linecap:round}
.motifs .tr,.card-motif .tr{fill:none;stroke:#8a6a3e;stroke-width:5;stroke-linecap:round}
.motifs .sw,.card-motif .sw{fill:none;stroke:#fff;stroke-width:3.5;stroke-linecap:round}.motifs .sw path,.card-motif .sw path{stroke:inherit}
.motifs .sw3,.card-motif .sw3{fill:none;stroke:rgba(255,255,255,.9);stroke-width:2.5;stroke-linecap:round}
.motifs .fw,.card-motif .fw{fill:none;stroke:var(--m1);stroke-width:3.5;stroke-linecap:round}
.motifs .sprk,.card-motif .sprk{fill:none;stroke:#fff;stroke-width:2.5;stroke-linecap:round}
.motifs .cc,.card-motif .cc{fill:none;stroke:#fff;stroke-width:9;stroke-linecap:round}
.motifs .cc2,.card-motif .cc2{fill:none;stroke:var(--m1);stroke-width:9;stroke-dasharray:6 7;stroke-linecap:butt}
.motifs .fl,.card-motif .fl{transform-box:fill-box;transform-origin:50% 100%}
.spotlight.snow .motifs .sw{stroke:#b8cde0}
/* gentle, varied movement */
html.js .motifs .m-float{animation:moFloat var(--t) ease-in-out var(--d) infinite alternate}
html.js .motifs .m-sway svg{transform-origin:50% 90%;animation:moSway var(--t) ease-in-out var(--d) infinite alternate}
html.js .motifs .m-spin svg{animation:moSpin calc(var(--t) * 6) linear var(--d) infinite}
html.js .motifs .m-twinkle{animation:moTwinkle calc(var(--t) * .6) ease-in-out var(--d) infinite}
html.js .motifs .m-pop{animation:moPop calc(var(--t) * .7) ease-out var(--d) infinite}
html.js .motifs .m-rise{animation:moRise calc(var(--t) * 2) linear var(--d) infinite}
html.js .motifs .m-swim{animation:moSwim calc(var(--t) * 1.6) ease-in-out var(--d) infinite}
html.js .motifs .m-drift{animation:moDrift calc(var(--t) * 1.4) ease-in-out var(--d) infinite alternate}
html.js .motifs .m-flutter{animation:moFlutter calc(var(--t) * 1.6) ease-in-out var(--d) infinite}
html.js .motifs .fl{animation:moFlick 1.4s ease-in-out infinite alternate}
@keyframes moFloat{from{translate:0 0}to{translate:0 -14px}}
@keyframes moSway{from{transform:rotate(-10deg)}to{transform:rotate(10deg)}}
@keyframes moSpin{to{transform:rotate(360deg)}}
@keyframes moTwinkle{0%,100%{opacity:.35;scale:.7}50%{opacity:1;scale:1.08}}
@keyframes moPop{0%{opacity:0;scale:.3}25%{opacity:1;scale:1}70%{opacity:.85;scale:1.08}100%{opacity:0;scale:1.15}}
@keyframes moRise{0%{translate:0 50px;opacity:0}12%{opacity:.95}85%{opacity:.85}100%{translate:14px -170px;opacity:0}}
@keyframes moSwim{0%,100%{translate:-18px 0}50%{translate:18px -8px}}
@keyframes moDrift{from{translate:-18px 0}to{translate:18px 0}}
@keyframes moFlutter{0%,100%{translate:0 0;rotate:-6deg}25%{translate:10px -12px;rotate:6deg}50%{translate:18px -4px;rotate:-4deg}75%{translate:8px 6px;rotate:5deg}}
@keyframes moFlick{from{transform:scale(1,1)}to{transform:scale(.92,1.12) skewX(3deg)}}
@media (max-width:860px){.motifs .mo{scale:.72}.motifs .mo:nth-child(n+9){display:none}}

/* cover-derived card tints + a small themed motif on each card */
.shop-card.tinted:nth-child(n) .sc-cover{background:radial-gradient(circle at 30% 18%,rgba(255,255,255,.85) 0,transparent 55%),linear-gradient(160deg,var(--t1,#f3ead8),var(--t2,#e8efe0))}
.book-card.tinted{background:linear-gradient(135deg,var(--t1,#fff) 0,#fff 58%)}
.sc-cover,.book-card .tilt-wrap{position:relative}
.card-motif{position:absolute;top:8px;right:8px;width:34px;height:34px;z-index:2;pointer-events:none;filter:drop-shadow(0 2px 3px rgba(0,0,0,.15))}
.book-card .card-motif{top:-10px;right:-6px;width:40px;height:40px}
html.js .card-motif{animation:moFloat 3.4s ease-in-out infinite alternate}
@media (prefers-reduced-motion:reduce){.motifs .mo,.motifs .mo svg,.motifs .fl,.card-motif{animation:none!important;opacity:.9}}
