/* Lecaro POS — animated 3D pocket guidebook (pages flip through the chapters) */
.gbook {
  --bw: 220px;
  position: relative; width: var(--bw); aspect-ratio: 3 / 4;
  perspective: 1600px; container-type: inline-size;
  font-family: 'Jakarta', 'Plus Jakarta Sans', system-ui, sans-serif;
}
.gbook-inner {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(8deg) rotateY(-24deg);
  animation: gbFloat 7s ease-in-out infinite;
}
@keyframes gbFloat { 50% { transform: rotateX(4deg) rotateY(-16deg) translateY(-10px); } }

/* back cover + page block */
.gbook-back {
  position: absolute; inset: 0; border-radius: 3cqw 7cqw 7cqw 3cqw;
  background: #0A4F30; transform: translateZ(-7cqw);
  box-shadow: 0 30px 50px -20px rgba(10,40,25,.55);
}
.gbook-block {
  position: absolute; top: 2.5%; bottom: 2.5%; left: 2%; right: 0;
  border-radius: 1cqw 5cqw 5cqw 1cqw;
  background: repeating-linear-gradient(90deg, #FBF9F3 0 .7cqw, #E9E3D0 .7cqw .9cqw);
  transform: translateZ(-3.5cqw);
}
/* right-hand static page (what a flipped page reveals) */
.gbook-page, .gbook-leaf {
  position: absolute; top: 2.5%; bottom: 2.5%; left: 2%; right: 2%;
  border-radius: 1cqw 4cqw 4cqw 1cqw; background: #FBF9F3;
  padding: 10cqw 9cqw; color: #111411; overflow: hidden;
}
.gbook-page { transform: translateZ(-1cqw); }
.gbook-page .n, .gbook-leaf .n { font: 800 22cqw/1 'Bricolage', 'Bricolage Grotesque', system-ui, sans-serif; color: #0F6A41; letter-spacing: -.04em; }
.gbook-page .t, .gbook-leaf .t { margin-top: 4cqw; font: 800 8cqw/1.15 'Bricolage', 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -.02em; }
.gbook-page i, .gbook-leaf i { display: block; height: 2.4cqw; border-radius: 2cqw; background: #E2DCC8; margin-top: 4.2cqw; }
.gbook-page i:nth-of-type(2), .gbook-leaf i:nth-of-type(2) { width: 82%; }
.gbook-page i:nth-of-type(3), .gbook-leaf i:nth-of-type(3) { width: 64%; background: #F2B705; opacity: .55; }
.gbook-page i:nth-of-type(4), .gbook-leaf i:nth-of-type(4) { width: 90%; }

/* flipping leaves */
.gbook-leaf {
  transform-origin: left center; backface-visibility: hidden;
  transform: rotateY(0deg); box-shadow: inset 6cqw 0 8cqw -6cqw rgba(0,0,0,.18);
}
.gbook-leaf.flip { animation: gbFlip 1.1s cubic-bezier(.45,.05,.3,1) forwards; }
@keyframes gbFlip {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(-178deg); box-shadow: inset -6cqw 0 8cqw -6cqw rgba(0,0,0,.3); }
}

/* front cover (opens once, then pages flip) */
.gbook-cover {
  position: absolute; inset: 0; border-radius: 3cqw 7cqw 7cqw 3cqw;
  background:
    radial-gradient(120% 70% at 80% 10%, rgba(242,183,5,.25), transparent 60%),
    linear-gradient(160deg, #13784A 0%, #0A4F30 70%);
  color: #F5F1E4; padding: 11cqw 10cqw; transform-origin: left center;
  transform: translateZ(1cqw); backface-visibility: hidden;
  box-shadow: inset 4cqw 0 0 rgba(0,0,0,.18), 0 20px 40px -18px rgba(10,40,25,.6);
  display: flex; flex-direction: column;
}
.gbook-cover::before { content: ''; position: absolute; left: 6cqw; top: 0; bottom: 0; width: .8cqw; background: rgba(245,241,228,.18); }
.gbook-cover .tag { align-self: flex-start; font: 800 4.6cqw/1 'Jakarta', 'Plus Jakarta Sans', sans-serif; background: #F2B705; color: #111411; padding: 2.4cqw 4cqw; border-radius: 6cqw; letter-spacing: .04em; }
.gbook-cover .ttl { margin-top: auto; font: 800 13cqw/1 'Bricolage', 'Bricolage Grotesque', system-ui, sans-serif; letter-spacing: -.03em; }
.gbook-cover .sub { margin-top: 3.5cqw; font: 600 5cqw/1.3 'Jakarta', 'Plus Jakarta Sans', sans-serif; opacity: .8; }
.gbook-cover .logo { width: 16cqw; height: 16cqw; border-radius: 4cqw; background: #F5F1E4; display: grid; place-items: center; margin-top: 7cqw; }
.gbook-cover .logo img { width: 70%; height: 70%; }
.gbook-cover.open { animation: gbOpen 1.3s cubic-bezier(.5,.05,.25,1) forwards; }
@keyframes gbOpen { to { transform: translateZ(1cqw) rotateY(-165deg); } }
.gbook-cover.close { animation: gbClose 1s cubic-bezier(.5,.05,.25,1) forwards; }
@keyframes gbClose { from { transform: translateZ(1cqw) rotateY(-165deg); } to { transform: translateZ(1cqw) rotateY(0deg); } }

/* shine sweep on the cover */
.gbook-cover::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.22) 50%, transparent 60%);
  background-size: 250% 100%; animation: gbShine 5s ease-in-out infinite;
}
@keyframes gbShine { 0%, 50% { background-position: 150% 0; } 100% { background-position: -60% 0; } }

/* sparkle chips around the book */
.gbook-chip {
  position: absolute; z-index: 3; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 12px; background: #fff; color: #111411; border: 1px solid #E2DCC8;
  font: 700 12.5px/1 'Jakarta', 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow: 0 14px 26px -14px rgba(17,20,17,.4);
  animation: gbChip 5s ease-in-out infinite;
}
.gbook-chip b { color: #0F6A41; }
.gbook-chip.a { top: 6%; right: -22%; }
.gbook-chip.b { bottom: 14%; left: -26%; animation-delay: -2.4s; }
@keyframes gbChip { 50% { translate: 0 -8px; } }

@media (prefers-reduced-motion: reduce) {
  .gbook-inner, .gbook-chip, .gbook-cover::after { animation: none !important; }
}
