/* Real-book cover previews. Shared by the homepage and the quiz.
   .rb        = a hardcover lying flat, seen from the front (grids, gallery)
   .rb.rb3    = the same book turned slightly so you see the spine and the page edges (big preview) */
.rb{position:relative;width:100%;aspect-ratio:803.7/1127.4;container-type:inline-size;--t:6.5cqw}
.rb-b{position:absolute;inset:0;transform-style:preserve-3d}
.rb-c{position:absolute;inset:0;border-radius:1.2cqw 2cqw 2cqw 1.2cqw;overflow:hidden;background:#e9e2d6;
  box-shadow:0 0 0 .5px rgba(30,20,10,.22),0 .6cqw 1cqw rgba(30,20,10,.22),0 3cqw 5cqw -1cqw rgba(30,20,10,.28),0 9cqw 14cqw -6cqw rgba(30,20,10,.45)}
.rb-a{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block}
/* printed board: paper grain, hinge groove next to the spine, rounded board edges, soft room light */
.rb-c::before{content:"";position:absolute;inset:0;z-index:3;pointer-events:none;opacity:.5;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .45 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");background-size:140px}
.rb-c::after{content:"";position:absolute;inset:0;z-index:4;pointer-events:none;border-radius:inherit;
  background:
    linear-gradient(90deg,rgba(0,0,0,.30) 0,rgba(0,0,0,.06) 1.6%,rgba(0,0,0,0) 2.6%,rgba(0,0,0,.20) 3.7%,rgba(0,0,0,.05) 4.5%,rgba(255,255,255,.26) 5%,rgba(255,255,255,0) 7.5%),
    linear-gradient(270deg,rgba(0,0,0,.16) 0,rgba(0,0,0,0) 1.3%),
    linear-gradient(180deg,rgba(255,255,255,.14) 0,rgba(255,255,255,0) 1%,rgba(0,0,0,0) 99%,rgba(0,0,0,.14)),
    radial-gradient(130% 95% at 28% 12%,rgba(255,255,255,.13),rgba(255,255,255,0) 55%),
    linear-gradient(180deg,rgba(0,0,0,0) 60%,rgba(0,0,0,.07));
  box-shadow:inset 0 .3cqw .2cqw -.1cqw rgba(255,255,255,.28),inset -.3cqw 0 .3cqw -.15cqw rgba(0,0,0,.18)}
.rb-ph{position:absolute;overflow:hidden;z-index:1;background:#ccc}
.rb-ph img{width:100%;height:100%;object-fit:cover;display:block}
.cv .t.rbn{position:absolute;z-index:2;display:block;box-sizing:border-box;text-align:center;white-space:normal;overflow-wrap:normal;word-break:normal;text-wrap:balance;margin:0}
.rb .rb-sp,.rb .rb-pg{display:none}
/* contact shadow on the table */
.rb::after{content:"";position:absolute;left:4%;right:-2%;bottom:-3.5%;height:7%;z-index:-1;background:radial-gradient(closest-side,rgba(40,28,18,.40),rgba(40,28,18,0));filter:blur(2.2cqw)}

/* --- turned book --- */
.rb3{perspective:340cqw}
.rb3 .rb-b{transform:rotateY(24deg) rotateX(3deg);transform-origin:50% 50%}
.rb3 .rb-c{transform:translateZ(calc(var(--t)/2));box-shadow:0 0 0 .5px rgba(30,20,10,.2)}
.rb3 .rb-sp,.rb3 .rb-pg{display:block;position:absolute;top:0;bottom:0;width:var(--t)}
.rb3 .rb-sp{left:calc(var(--t)/-2);transform:rotateY(-90deg);border-radius:1.5cqw;
  background:linear-gradient(90deg,rgba(0,0,0,.42),rgba(0,0,0,.08) 30%,rgba(255,255,255,.12) 55%,rgba(0,0,0,.30)),var(--sp)}
.rb3 .rb-pg{left:calc(100% - var(--t)/2 - 1.4cqw);top:1.6%;bottom:1.6%;transform:rotateY(90deg);
  background:repeating-linear-gradient(90deg,#f4efe4 0 .35cqw,#e2d9c8 .35cqw .5cqw),#efe8da;box-shadow:inset 0 0 1cqw rgba(0,0,0,.25)}
.rb3::after{left:-4%;right:-10%;bottom:-6%;height:10%;filter:blur(3cqw);background:radial-gradient(closest-side,rgba(40,28,18,.45),rgba(40,28,18,0))}
