/* ============ THEME ============ */
:root {
  --purple: #6D28D9;
  --purple-deep: #4C1D95;
  --purple-soft: #7C3AED;
  --purple-bg: #F5F0FF;
  --yellow: #FACC15;
  --yellow-soft: #FDE68A;
  --ink: #1a1625;
  --ink-soft: #2d2740;
  --cream: #FFFBF2;
  --paper: #FAF7EE;
}

* { -webkit-font-smoothing: antialiased; }

html, body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  overflow-x: hidden;
}

/* Paper grain overlay */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1, 0 0 0 0 0.08, 0 0 0 0 0.18, 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.6;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* All content above grain */
#root { position: relative; z-index: 2; }

/* ============ TYPE ============ */
.font-display { font-family: 'Archivo Black', 'Plus Jakarta Sans', sans-serif; letter-spacing: -0.02em; }
.font-hand { font-family: 'Caveat', cursive; }
.font-marker { font-family: 'Permanent Marker', cursive; }

/* Hand-drawn yellow highlight behind text */
.hl-yellow {
  background-image: linear-gradient(180deg, transparent 55%, var(--yellow) 55%, var(--yellow) 92%, transparent 92%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  padding: 0 0.15em;
}
.hl-yellow-soft {
  background-image: linear-gradient(180deg, transparent 60%, rgba(250,204,21,0.7) 60%, rgba(250,204,21,0.7) 92%, transparent 92%);
  padding: 0 0.15em;
}

/* Wobbly hand-drawn outline button */
.btn-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem 2.2rem;
  background: var(--purple);
  color: white;
  font-family: 'Archivo Black', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  border-radius: 999px;
  box-shadow:
    0 0 0 3px var(--ink),
    0 12px 0 -2px rgba(76,29,149,0.35),
    0 30px 60px -20px rgba(109,40,217,0.6),
    inset 0 -4px 0 rgba(0,0,0,0.2);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), box-shadow 220ms;
  cursor: pointer;
  border: none;
}
.btn-cta:hover {
  transform: translate(-2px, -3px) rotate(-1deg);
  box-shadow:
    0 0 0 3px var(--ink),
    0 16px 0 -2px rgba(76,29,149,0.45),
    0 40px 70px -20px rgba(109,40,217,0.7),
    inset 0 -4px 0 rgba(0,0,0,0.2);
}
.btn-cta:active { transform: translate(0,1px); }
.btn-cta::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px dashed rgba(26,22,37,0.3);
  border-radius: 999px;
  transform: rotate(-1.5deg);
  pointer-events: none;
}

.btn-cta-yellow {
  background: var(--yellow);
  color: var(--ink);
}

/* Pulse glow */
@keyframes pulseGlow {
  0%,100% { box-shadow: 0 0 0 3px var(--ink), 0 12px 0 -2px rgba(76,29,149,0.35), 0 30px 60px -20px rgba(109,40,217,0.6), 0 0 0 0 rgba(250,204,21,0); }
  50%     { box-shadow: 0 0 0 3px var(--ink), 0 12px 0 -2px rgba(76,29,149,0.35), 0 30px 70px -20px rgba(109,40,217,0.9), 0 0 0 16px rgba(250,204,21,0.18); }
}
.pulse-glow { animation: pulseGlow 2.4s ease-in-out infinite; }

/* Sticker badge */
.sticker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.95rem;
  background: var(--yellow);
  color: var(--ink);
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--ink), 0 6px 0 -2px var(--ink);
  transform: rotate(-2deg);
}
.sticker-purple {
  background: var(--purple);
  color: white;
  box-shadow: 0 0 0 2px var(--ink), 0 6px 0 -2px var(--ink);
}

/* Underline scribble svg */
.scribble {
  position: relative;
  display: inline-block;
}
.scribble::after {
  content:"";
  position:absolute;
  left: -4%;
  right: -4%;
  bottom: -0.5em;
  height: 0.5em;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' fill='none'><path d='M3 13 C 70 4, 150 22, 297 8' stroke='%236D28D9' stroke-width='5' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.scribble-yellow::after { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 24' fill='none'><path d='M3 13 C 70 4, 150 22, 297 8' stroke='%23FACC15' stroke-width='6' stroke-linecap='round'/></svg>"); }

/* Hand-drawn card */
.hd-card {
  position: relative;
  background: white;
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow:
    0 0 0 2px var(--ink),
    0 8px 0 -2px var(--ink),
    0 24px 50px -20px rgba(26,22,37,0.25);
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), box-shadow 260ms;
}
.hd-card:hover {
  transform: translate(-3px,-6px) rotate(-0.6deg);
  box-shadow:
    0 0 0 2px var(--ink),
    0 14px 0 -2px var(--ink),
    0 40px 70px -20px rgba(109,40,217,0.5);
}
.hd-card.tilt-l { transform: rotate(-1.3deg); }
.hd-card.tilt-r { transform: rotate(1deg); }
.hd-card.tilt-l:hover { transform: rotate(-1.3deg) translate(-3px,-6px); }
.hd-card.tilt-r:hover { transform: rotate(1deg) translate(-3px,-6px); }

/* Glass card */
.glass {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1.5px solid rgba(255,255,255,0.7);
}

/* Star sparkle */
@keyframes sparkleSpin {
  0% { transform: rotate(0deg) scale(1); opacity: 0.6; }
  50% { transform: rotate(180deg) scale(1.15); opacity: 1; }
  100% { transform: rotate(360deg) scale(1); opacity: 0.6; }
}
.sparkle { animation: sparkleSpin 6s ease-in-out infinite; }

@keyframes float {
  0%,100% { transform: translateY(0) rotate(var(--r,0deg)); }
  50%     { transform: translateY(-14px) rotate(var(--r,0deg)); }
}
.floaty { animation: float 6s ease-in-out infinite; }
.floaty-slow { animation: float 9s ease-in-out infinite; }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-track { animation: marquee 38s linear infinite; }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 700ms cubic-bezier(.2,.8,.2,1), transform 700ms cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }

/* Book mockup */
.book-shadow {
  filter: drop-shadow(0 30px 40px rgba(76,29,149,0.45)) drop-shadow(0 60px 80px rgba(26,22,37,0.3));
}

/* Tape */
.tape {
  position: absolute;
  width: 90px; height: 26px;
  background: rgba(250,204,21,0.85);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05), 0 4px 10px -4px rgba(0,0,0,0.2);
  transform: rotate(-6deg);
  border-radius: 2px;
}
.tape::before, .tape::after {
  content:"";
  position:absolute; top:0; bottom:0; width:6px;
  background: linear-gradient(transparent, rgba(255,255,255,0.4), transparent);
}
.tape::before{left:0;} .tape::after{right:0;}
.tape-purple { background: rgba(124,58,237,0.85); }

/* Section divider scribble */
.divider-scribble {
  height: 60px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 60' fill='none'><path d='M0 30 Q 100 5, 200 30 T 400 30 T 600 30 T 800 30 T 1000 30 T 1200 30' stroke='%236D28D9' stroke-width='2.5' stroke-linecap='round' opacity='0.4'/></svg>");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

/* Gallery card */
.page-card {
  position: relative;
  width: 280px;
  height: 437px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  background: white;
  box-shadow:
    0 0 0 1px rgba(26,22,37,0.1),
    0 30px 50px -20px rgba(26,22,37,0.35),
    0 60px 80px -40px rgba(109,40,217,0.3);
  transition: transform 400ms cubic-bezier(.2,.8,.2,1), box-shadow 400ms;
}
.page-card img { width: 100%; height: 100%; object-fit: cover; display:block; }
.page-card:hover {
  transform: translateY(-12px) scale(1.04) !important;
  box-shadow:
    0 0 0 1px rgba(26,22,37,0.15),
    0 50px 70px -20px rgba(26,22,37,0.4),
    0 80px 100px -40px rgba(109,40,217,0.5);
}

/* Category chip */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: white;
  box-shadow: 0 0 0 2px var(--ink), 0 4px 0 -2px var(--ink);
  transition: transform 200ms;
}
.chip:hover { transform: translateY(-2px) rotate(-1deg); }
.chip-purple { background: var(--purple); color: white; }
.chip-yellow { background: var(--yellow); color: var(--ink); }

/* FAQ */
details.faq {
  border-radius: 18px;
  background: white;
  box-shadow: 0 0 0 2px var(--ink), 0 6px 0 -2px var(--ink);
  overflow: hidden;
  transition: transform 200ms;
}
details.faq[open] { background: #FFFBEA; }
details.faq summary {
  cursor: pointer;
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 1.05rem;
  list-style: none;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  font-family: 'Archivo Black';
  font-size: 1.6rem;
  color: var(--purple);
  transition: transform 200ms;
}
details.faq[open] summary::after { content: "−"; }
details.faq .ans { padding: 0 1.4rem 1.3rem; color: #4a4458; line-height: 1.55; }

/* Loading overlay */
#__loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 600ms 200ms, visibility 0s 800ms;
}
#__loader.hide { opacity: 0; visibility: hidden; }
.loader-mark {
  font-family: 'Archivo Black';
  font-size: 3rem;
  color: var(--purple);
  position: relative;
}
.loader-mark span {
  background: var(--yellow);
  padding: 0 0.2em;
  display: inline-block;
  transform: rotate(-2deg);
}
.loader-bar {
  width: 220px; height: 6px; margin-top: 1.2rem;
  background: rgba(109,40,217,0.15);
  border-radius: 99px; overflow: hidden;
}
.loader-bar i {
  display:block; height: 100%;
  width: 30%;
  background: var(--purple);
  border-radius: 99px;
  animation: loaderSlide 1.1s ease-in-out infinite;
}
@keyframes loaderSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* Pricing */
.price-card {
  background: linear-gradient(160deg, #ffffff 0%, #FAF5FF 100%);
  border-radius: 32px;
  padding: 3rem;
  position: relative;
  box-shadow:
    0 0 0 3px var(--ink),
    0 18px 0 -3px var(--ink),
    0 60px 100px -30px rgba(109,40,217,0.5);
  overflow: hidden;
}
.price-card::before {
  content:"";
  position: absolute;
  inset: -2px;
  background: linear-gradient(120deg, transparent 30%, rgba(250,204,21,0.4), transparent 70%);
  animation: priceShine 4s ease-in-out infinite;
  pointer-events: none;
  border-radius: 32px;
}
@keyframes priceShine {
  0%,100% { transform: translateX(-50%); opacity: 0; }
  50% { transform: translateX(50%); opacity: 1; }
}

/* Mouse parallax helpers — applied via JS transform */
.parallax-layer { transition: transform 400ms cubic-bezier(.2,.8,.2,1); will-change: transform; }

/* Scrollbar slimmer */
.gallery-scroll::-webkit-scrollbar { height: 10px; }
.gallery-scroll::-webkit-scrollbar-track { background: transparent; }
.gallery-scroll::-webkit-scrollbar-thumb { background: rgba(109,40,217,0.35); border-radius: 99px; }

/* Tilt 3D on hover for page cards */
.tilt-3d { transform-style: preserve-3d; perspective: 1000px; }
