/* Janji Sejati — motion layer (GSAP). Injected by .claude/inject-enhance.py */
:root {
  --js-cream: #FFFBF5;
  --js-gold: #9A7D1A;
  --js-gold-soft: #D5C07A;
  --js-brown: #623816;
}

/* Before JS takes over: cover the page (intro / page transition) */
html[data-fx-cover]::after {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--js-cream);
  z-index: 9998;
}
/* Hide hero bits until the entrance timeline sets them */
html[data-fx="pending"] main section:first-of-type h1,
html[data-fx="pending"] main section:first-of-type img,
html[data-fx="pending"] main h2 {
  opacity: 0;
}

/* Smooth scroll (Lenis) */
html.lenis, html.lenis body { height: auto; }
html.lenis, .lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Gate (intro + page transitions) ---------- */
.js-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: auto;
  overflow: hidden;
}
.js-gate[hidden] { display: none; }
.js-gate__door {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background:
    radial-gradient(120% 80% at 50% 50%, rgba(213, 192, 122, 0.10), transparent 60%),
    var(--js-cream);
  will-change: transform;
}
.js-gate__door--l { left: 0; border-right: 1px solid rgba(154, 125, 26, 0.35); }
.js-gate__door--r { right: 0; border-left: 1px solid rgba(154, 125, 26, 0.35); }
.js-gate__door::before {
  /* thin inner frame, like an invitation card */
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(154, 125, 26, 0.22);
}
.js-gate__door--l::before { right: 10px; border-right: 0; }
.js-gate__door--r::before { left: 10px; border-left: 0; }

.js-gate__center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(68vw, 420px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.js-gate__wreath {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.js-gate__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--js-brown);
}
.js-gate__logo { width: clamp(64px, 16vw, 92px); height: auto; }
.js-gate__welcome {
  font-size: clamp(13px, 3.2vw, 16px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--js-gold);
}
.js-gate__title { font-size: clamp(30px, 8vw, 44px); line-height: 1.1; }
.js-gate__line {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--js-gold), transparent);
  transform-origin: center;
}
.js-gate__skip {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(98, 56, 22, 0.55);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 12px;
}

/* ---------- Scroll progress ---------- */
.js-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: linear-gradient(90deg, var(--js-gold), var(--js-gold-soft), var(--js-gold));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Gold dust + cursor sparkles ---------- */
.js-dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}
.js-spark {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9990;
  pointer-events: none;
  color: var(--js-gold);
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 0 6px rgba(213, 192, 122, 0.8);
  will-change: transform, opacity;
}

/* ---------- Gold buttons: shine sweep ---------- */
main a[class*="bg-[#9A7D1A]"] {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
main a[class*="bg-[#9A7D1A]"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 251, 245, 0.45), transparent);
  transform: skewX(-20deg);
  animation: js-shine 4.5s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
main a[class*="bg-[#9A7D1A]"]:hover::after { animation-duration: 1.2s; }
@keyframes js-shine {
  0%, 70% { left: -60%; }
  100% { left: 130%; }
}

/* Header gets a soft shadow once scrolled */
header.js-scrolled { box-shadow: 0 8px 24px -16px rgba(98, 56, 22, 0.35); }
header { transition: box-shadow 0.3s ease; }

@media (prefers-reduced-motion: reduce) {
  main a[class*="bg-[#9A7D1A]"]::after { animation: none; display: none; }
}

/* Flipbook thumbnails: no frame boxes; the cover is rendered as a small
   3D book (spine, stacked page edges, tilt, corner curl on hover) */
div:has(> div > img[src*="/images/themes/fb-"]) {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  perspective: 1100px;
}
div:has(> div > img[src*="/images/themes/fb-"]) > div[aria-hidden="true"] { display: none !important; }

/* the book */
div:has(> img[src*="/images/themes/fb-"]) {
  width: auto !important;
  height: 92% !important;
  aspect-ratio: 9 / 16;
  flex: none !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 2px 4px 4px 2px !important;
  background: #FBF7F0 !important;
  transform: rotateY(-16deg) rotateX(2deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.2,.7,.2,1), box-shadow .6s ease;
  /* page block peeking out on the right & bottom + cast shadow */
  box-shadow:
    1px 1px 0 #fff, 2px 2px 0 #E9E1D3,
    3px 3px 0 #fff, 4px 4px 0 #E9E1D3,
    5px 5px 0 #fff, 6px 6px 0 #DED3C1,
    10px 14px 18px -4px rgba(98, 56, 22, .30),
    22px 26px 34px -12px rgba(98, 56, 22, .22) !important;
}
/* cover image */
img[src*="/images/themes/fb-"] {
  object-fit: cover !important;
  padding: 0 !important;
  filter: none !important;
  border-radius: 2px 4px 4px 2px;
}
/* spine: hinge crease + light falloff across the cover */
div:has(> img[src*="/images/themes/fb-"])::before {
  content: "";
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg,
      rgba(60, 35, 15, .38) 0%, rgba(60, 35, 15, .12) 2.5%,
      rgba(255, 255, 255, .45) 4%, rgba(255, 255, 255, 0) 7%,
      rgba(60, 35, 15, .10) 8.5%, rgba(60, 35, 15, 0) 13%,
      rgba(255, 255, 255, 0) 70%, rgba(255, 255, 255, .12) 100%);
}
/* corner page curl (revealed on hover) */
div:has(> img[src*="/images/themes/fb-"])::after {
  content: "";
  position: absolute; right: 0; bottom: 0; z-index: 3; pointer-events: none;
  width: 0; height: 0;
  background: linear-gradient(315deg, transparent 50%, #F3ECE0 50%, #FFFDF8 70%, #E6DCCB 100%);
  box-shadow: -3px -3px 6px -2px rgba(98, 56, 22, .25);
  border-radius: 0 0 4px 0;
  transition: width .45s ease, height .45s ease;
}
a:hover div:has(> img[src*="/images/themes/fb-"]),
.group:hover div:has(> img[src*="/images/themes/fb-"]) {
  transform: rotateY(-6deg) rotateX(0deg) translateY(-4px);
  box-shadow:
    1px 1px 0 #fff, 2px 2px 0 #E9E1D3,
    3px 3px 0 #fff, 4px 4px 0 #E9E1D3,
    5px 5px 0 #fff, 6px 6px 0 #DED3C1,
    14px 20px 24px -6px rgba(98, 56, 22, .32),
    28px 34px 44px -14px rgba(98, 56, 22, .22) !important;
}
a:hover div:has(> img[src*="/images/themes/fb-"])::after,
.group:hover div:has(> img[src*="/images/themes/fb-"])::after {
  width: 22%; height: 13%;
}
@media (prefers-reduced-motion: reduce) {
  div:has(> img[src*="/images/themes/fb-"]),
  div:has(> img[src*="/images/themes/fb-"])::after { transition: none; }
}
