/* =========================================================
   Charlie's Gnarly Party
   Everything is prefixed .cgp- or scoped under .cgp-scope so
   it cannot collide with GeneratePress or WooCommerce.
   ========================================================= */

:root{
  --cgp-ink:#0C0A11;
  --cgp-ground:#13101A;
  --cgp-surface:#1D1827;
  --cgp-surface-2:#272031;
  --cgp-line:#372F46;
  --cgp-line-soft:#261F33;
  --cgp-chalk:#F4F0FA;
  --cgp-dim:#A8A0BA;
  --cgp-dimmer:#7B7390;
  --cgp-mirror:#9FC4DE;
  --cgp-punch:#FF3366;
  --cgp-punch-hot:#FF5C85;
  --cgp-punch-deep:#AE1C40;
  --cgp-lemon:#FFD23F;
  --cgp-lime:#5FE3A1;

  --cgp-display:"Luckiest Guy","Arial Rounded MT Bold",system-ui,sans-serif;
  --cgp-body:"Figtree","Helvetica Neue",Arial,system-ui,sans-serif;
}

/* ---------- buttons ---------- */
.cgp-btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  border:0;border-radius:999px;cursor:pointer;text-decoration:none;
  font-family:var(--cgp-body);font-weight:800;font-size:16px;line-height:1;
  padding:17px 32px;
  transition:transform .14s ease,box-shadow .14s ease,background .14s ease;
}
.cgp-btn:focus-visible{outline:3px solid var(--cgp-lemon);outline-offset:3px}
.cgp-btn-primary{
  background:var(--cgp-punch);color:#fff;
  box-shadow:0 8px 0 -2px var(--cgp-punch-deep),0 16px 34px rgba(255,51,102,.34);
}
.cgp-btn-primary:hover{
  background:var(--cgp-punch-hot);color:#fff;transform:translateY(-2px);
  box-shadow:0 10px 0 -2px var(--cgp-punch-deep),0 20px 40px rgba(255,51,102,.42);
}
.cgp-btn-primary:active{transform:translateY(3px);box-shadow:0 3px 0 -2px var(--cgp-punch-deep)}
.cgp-btn-buy{padding:19px 42px;font-size:17.5px}
.cgp-btn-buy svg{
  width:17px;height:17px;flex:none;stroke:currentColor;stroke-width:2.6;
  fill:none;stroke-linecap:round;stroke-linejoin:round;transition:transform .16s ease;
}
.cgp-btn-buy:hover svg{transform:translateX(4px)}

/* =========================================================
   THE INTERACTIVE BOOK
   ========================================================= */
.cgp-reader-shell{width:100%;margin-inline:auto;font-family:var(--cgp-body)}

.cgp-reader-head{display:flex;align-items:flex-end;gap:18px;flex-wrap:wrap;margin-bottom:18px}
.cgp-reader-head h2{
  font-family:var(--cgp-display);font-weight:400;margin:0;
  font-size:clamp(20px,2.6vw,27px);line-height:1;color:var(--cgp-chalk);
}
.cgp-reader-note{font-size:13.5px;color:var(--cgp-dimmer);margin-left:auto}
@media(max-width:620px){.cgp-reader-note{display:none}}

.cgp-reader{
  background:linear-gradient(180deg,var(--cgp-surface),#15111D);
  border:1px solid var(--cgp-line);border-radius:22px;
  padding:clamp(14px,2.6vw,30px);
  box-shadow:0 36px 80px rgba(0,0,0,.6);
  position:relative;
}

.cgp-stage{display:flex;align-items:center;justify-content:center;gap:clamp(6px,1.4vw,16px)}

.cgp-book{
  display:flex;flex:0 1 auto;min-width:0;position:relative;
  background:#0E0C14;border-radius:8px;perspective:2400px;
  box-shadow:0 22px 50px rgba(0,0,0,.62),0 0 0 1px rgba(255,255,255,.07);
}
.cgp-leaf{
  position:relative;flex:none;overflow:hidden;background:#0E0C14;
  width:min(392px,calc((100vw - 230px) / 2));aspect-ratio:1000/1429;
}
.cgp-leaf.cgp-left{border-radius:8px 0 0 8px}
.cgp-leaf.cgp-right{border-radius:0 8px 8px 0}
.cgp-leaf img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;max-width:none}
.cgp-book.cgp-single .cgp-leaf{width:min(392px,calc((100vw - 230px) / 2));border-radius:8px}
.cgp-book.cgp-single .cgp-leaf.cgp-right{display:none}
@media(max-width:860px){
  .cgp-book.cgp-single .cgp-leaf{width:min(420px,calc(100vw - 200px))}
}

/* the bound gutter, which is what makes two images read as one book */
.cgp-book:not(.cgp-single)::after{
  content:"";position:absolute;top:0;bottom:0;left:50%;width:56px;
  transform:translateX(-50%);pointer-events:none;z-index:3;
  background:linear-gradient(90deg,rgba(0,0,0,0),rgba(0,0,0,.42) 38%,rgba(0,0,0,.6) 50%,rgba(0,0,0,.42) 62%,rgba(0,0,0,0));
}

/* the leaf that actually rotates on the spine */
.cgp-flipper{
  position:absolute;top:0;bottom:0;left:50%;width:50%;z-index:9;
  pointer-events:none;transform-style:preserve-3d;transform-origin:left center;
}
.cgp-flipper.cgp-rev{left:0;transform-origin:right center}
.cgp-flipper.cgp-run{animation:cgpPageFwd .62s cubic-bezier(.45,.05,.55,.95) forwards}
.cgp-flipper.cgp-rev.cgp-run{animation-name:cgpPageBack}
@keyframes cgpPageFwd{from{transform:rotateY(0)}to{transform:rotateY(-180deg)}}
@keyframes cgpPageBack{from{transform:rotateY(0)}to{transform:rotateY(180deg)}}
.cgp-face{
  position:absolute;inset:0;overflow:hidden;background:#0E0C14;
  backface-visibility:hidden;-webkit-backface-visibility:hidden;
}
.cgp-face img{width:100%;height:100%;object-fit:cover;display:block;max-width:none}
.cgp-face.cgp-bk{transform:rotateY(180deg)}
/* A flat veil, not a gradient: the back face is mirrored by its own
   rotateY(180deg), which flips any gradient drawn on it. */
.cgp-face::after{content:"";position:absolute;inset:0;opacity:0;background:#000}
.cgp-flipper.cgp-run .cgp-face::after{animation:cgpFold .62s ease-in-out forwards}
@keyframes cgpFold{0%{opacity:0}50%{opacity:.42}100%{opacity:0}}

/* cover and end pages, where there is no leaf to rotate */
.cgp-leaf.cgp-soft{animation:cgpSoft .4s cubic-bezier(.2,.7,.3,1)}
@keyframes cgpSoft{from{opacity:0;transform:scale(.965)}to{opacity:1;transform:none}}
.cgp-leaf.cgp-slide{animation:cgpSlideFwd .34s cubic-bezier(.25,.8,.3,1)}
@keyframes cgpSlideFwd{from{opacity:.25;transform:translateX(26%)}to{opacity:1;transform:none}}
.cgp-book.cgp-back .cgp-leaf.cgp-slide{animation-name:cgpSlideBack}
@keyframes cgpSlideBack{from{opacity:.25;transform:translateX(-26%)}to{opacity:1;transform:none}}

.cgp-nav{
  flex:none;width:50px;height:50px;border-radius:50%;padding:0;
  background:var(--cgp-surface-2);border:1px solid var(--cgp-line);
  color:var(--cgp-chalk);cursor:pointer;display:grid;place-items:center;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.cgp-nav:hover:not(:disabled){background:var(--cgp-punch);border-color:var(--cgp-punch);transform:scale(1.08)}
.cgp-nav:disabled{opacity:.25;cursor:default}
.cgp-nav:focus-visible{outline:3px solid var(--cgp-lemon);outline-offset:3px}
.cgp-nav svg{width:20px;height:20px;stroke:currentColor;stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round}

.cgp-reader-foot{display:flex;align-items:center;gap:16px;margin-top:20px}
.cgp-progress{flex:1;height:6px;border-radius:99px;background:var(--cgp-line-soft);overflow:hidden}
.cgp-progress span{
  display:block;height:100%;width:6%;border-radius:99px;
  background:linear-gradient(90deg,var(--cgp-punch),var(--cgp-lemon));
  transition:width .35s ease;
}

.cgp-cta{
  margin-top:24px;padding-top:24px;
  border-top:1px solid var(--cgp-line-soft);
  display:flex;justify-content:center;
}

/* the end of book card */
.cgp-endcard{
  position:absolute;inset:0;z-index:20;border-radius:22px;
  background:linear-gradient(180deg,rgba(19,16,26,.975),rgba(12,10,17,.995));
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;padding:clamp(24px,4vw,48px);gap:15px;overflow-y:auto;
  animation:cgpRise .42s cubic-bezier(.2,.8,.2,1);
}
@keyframes cgpRise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
.cgp-endcard h3{
  font-family:var(--cgp-display);font-weight:400;margin:0;color:var(--cgp-chalk);
  font-size:clamp(27px,4.4vw,46px);line-height:1.02;max-width:15ch;
}
.cgp-endcard p{margin:0;color:var(--cgp-dim);max-width:42ch;font-size:16px;line-height:1.55}
.cgp-restart{
  background:none;border:0;color:var(--cgp-dimmer);font-size:14.5px;
  cursor:pointer;text-decoration:underline;padding:10px;font-weight:600;font-family:var(--cgp-body);
}
.cgp-restart:hover{color:var(--cgp-chalk)}

/* phones: the arrows move onto the page edges so the book gets full width */
@media(max-width:760px){
  .cgp-stage{position:relative;gap:0}
  .cgp-book{width:100%}
  .cgp-book.cgp-single .cgp-leaf{width:100%}
  .cgp-nav{
    position:absolute;top:50%;transform:translateY(-50%);z-index:6;
    width:42px;height:42px;
    background:rgba(20,16,28,.74);border-color:rgba(255,255,255,.2);
  }
  .cgp-nav:hover:not(:disabled){transform:translateY(-50%) scale(1.06)}
  [data-cgp-prev]{left:8px}
  [data-cgp-next]{right:8px}
  .cgp-endcard{gap:11px;padding:22px 18px}
  .cgp-endcard h3{font-size:25px}
  .cgp-cta .cgp-btn{width:100%}
  .cgp-btn-buy{padding:18px 30px}
}

@media(prefers-reduced-motion:reduce){
  .cgp-reader *{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

/* =========================================================
   OPTIONAL GLOBAL SKIN
   Only applies inside a .cgp-scope wrapper, so turning the
   skin on cannot repaint pages you have not opted in.
   ========================================================= */
.cgp-scope{
  background:var(--cgp-ink);
  color:var(--cgp-chalk);
  font-family:var(--cgp-body);
  font-size:17px;
  line-height:1.6;
}
.cgp-scope h1,.cgp-scope h2,.cgp-scope h3{
  font-family:var(--cgp-display);font-weight:400;
  line-height:.94;letter-spacing:.012em;color:var(--cgp-chalk);text-wrap:balance;
}
.cgp-scope h1{font-size:clamp(40px,7.6vw,80px)}
.cgp-scope h2{font-size:clamp(29px,4.8vw,50px)}
.cgp-scope a{color:var(--cgp-mirror)}
.cgp-scope .price,.cgp-scope .woocommerce-Price-amount{color:var(--cgp-chalk);font-weight:800}
.cgp-scope .button,
.cgp-scope .woocommerce a.button,
.cgp-scope .woocommerce button.button,
.cgp-scope .woocommerce input.button,
.cgp-scope .wc-block-components-button{
  background:var(--cgp-punch);color:#fff;border:0;border-radius:999px;
  font-family:var(--cgp-body);font-weight:800;padding:16px 30px;
  box-shadow:0 8px 0 -2px var(--cgp-punch-deep);
}
.cgp-scope .button:hover,
.cgp-scope .woocommerce a.button:hover,
.cgp-scope .woocommerce button.button:hover{
  background:var(--cgp-punch-hot);color:#fff;
}
