/* ═══════════════════════════════════════════════════════════
   styles.css — Prince of Programming (PopPage1)
   Design system: Pop2's components merged with the warm,
   book-centric character of the original site.
═══════════════════════════════════════════════════════════ */

/* ── 1. Design tokens ──────────────────────────────────── */
:root {
  --pop-gold:      #f59e0b;
  --pop-gold-dk:   #b45309;
  --pop-gold-lt:   #fde68a;
  --pop-navy:      #050d1c;
  --pop-navy-mid:  #0e1a38;
  --pop-blue:      #1d4ed8;
  --pop-lblue:     #3b82f6;
  --pop-purple:    #6d28d9;
  --rf-red:        #b60018;

  --nav-h:       72px;
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-pop:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --radius-card: 16px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}


/* ── 2. Scroll reveal ──────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.62s var(--ease), transform 0.62s var(--ease);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1      { transition-delay: 0.10s; }
.reveal-d2      { transition-delay: 0.22s; }
.reveal-d3      { transition-delay: 0.34s; }
.reveal-d4      { transition-delay: 0.46s; }
.reveal-d5      { transition-delay: 0.58s; }


/* ── 3. Gradient text ──────────────────────────────────── */
.gt-gold {
  background: linear-gradient(135deg, var(--pop-gold-lt) 0%, var(--pop-gold) 50%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gt-blue {
  background: linear-gradient(135deg, #93c5fd 0%, var(--pop-lblue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


/* ── 4. Section label ──────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pop-gold-dk);
  margin-bottom: 14px;
}
.section-label::before {
  content: '';
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  flex-shrink: 0;
}
.dark .section-label { color: var(--pop-gold); }


/* ── 5. Navbar ─────────────────────────────────────────── */
#navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: background 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
#navbar.scrolled {
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
}
.dark #navbar.scrolled {
  background: rgba(5, 13, 28, 0.94);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
  position: relative;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s;
  text-decoration: none;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--pop-gold);
  border-radius: 2px;
  transition: width 0.24s var(--ease);
}
.nav-link:hover            { color: #fff; }
.nav-link:hover::after     { width: 100%; }
#navbar.scrolled .nav-link { color: #4b5563; }
#navbar.scrolled .nav-link:hover { color: #111827; }
#navbar.scrolled .nav-link:hover::after { background: var(--pop-gold-dk); }
.dark #navbar.scrolled .nav-link { color: #9ca3af; }
.dark #navbar.scrolled .nav-link:hover { color: #fff; }
.dark #navbar.scrolled .nav-link:hover::after { background: var(--pop-gold); }

#navBrand                        { color: var(--pop-gold); transition: color 0.32s; text-decoration: none; }
#navbar.scrolled #navBrand       { color: var(--pop-gold-dk); }
.dark #navbar.scrolled #navBrand { color: var(--pop-gold); }

.nav-btn {
  color: rgba(255,255,255,0.82);
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#navbar.scrolled .nav-btn         { color: #4b5563; }
.dark #navbar.scrolled .nav-btn   { color: #9ca3af; }
.nav-btn:hover                    { color: #fff; }
#navbar.scrolled .nav-btn:hover   { color: #111827; }
.dark #navbar.scrolled .nav-btn:hover { color: #fff; }


/* ── 6. Hero ───────────────────────────────────────────── */
.hero-bg {
  background:
    radial-gradient(ellipse 70% 55% at 85% 20%, rgba(109, 40, 217, 0.16) 0%, transparent 65%),
    radial-gradient(ellipse 50% 40% at 15% 65%, rgba(245, 158, 11, 0.09) 0%, transparent 60%),
    linear-gradient(158deg, #050d1c 0%, #0e1a38 40%, #0a0f24 70%, #050d1c 100%);
  position: relative;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.038) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
  pointer-events: none;
}

/* Hero entrance animations */
.h-badge, .h-title, .h-sub, .h-stats, .h-cta, .h-social, .h-scroll {
  opacity: 0;
  transform: translateY(16px);
  animation: hIn 0.65s var(--ease) forwards;
}
.h-badge  { animation-delay: 0.10s; }
.h-title  { animation-delay: 0.24s; }
.h-sub    { animation-delay: 0.38s; }
.h-stats  { animation-delay: 0.52s; }
.h-cta    { animation-delay: 0.66s; }
.h-social { animation-delay: 0.78s; }
.h-scroll { animation-delay: 0.92s; }
@keyframes hIn { to { opacity: 1; transform: none; } }

/* ── 6b. Book cover image ───────────────────────────────── */
.book-cover-img {
  max-width: clamp(220px, 45vw, 360px);
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.55)) drop-shadow(0 6px 14px rgba(0,0,0,0.35));
}

/* ── 6c. 3D Book (legacy, unused) ───────────────────────── */
/*
  Hardcover book viewed from slightly above-right:
    Front  faces +Z → always visible
    Spine  faces -X → visible with rotateY(+28deg)
    Top    faces -Y → visible with rotateX(+8deg)  ← page-stack edge from above
*/
.book-3d-outer {
  perspective: 1400px;
  display: inline-block;
  position: relative;
}

/* Ground shadow cast below the book */
.book-3d-outer::after {
  content: '';
  position: absolute;
  bottom: -24px;
  left: 8%;
  width: 90%;
  height: 28px;
  background: radial-gradient(ellipse at 45% 50%, rgba(0,0,0,0.50) 0%, transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

.book-3d {
  --book-w: clamp(190px, 38vw, 270px);
  --book-h: calc(var(--book-w) * 1.575);
  --depth:  clamp(40px, 8.5vw, 54px);   /* hardcover: ~20% of width */

  position: relative;
  width:  var(--book-w);
  height: var(--book-h);
  transform-style: preserve-3d;
  transform: rotateY(28deg) rotateX(8deg);
  transition: transform 0.55s var(--ease);
}

.book-3d-outer:hover .book-3d {
  transform: rotateY(16deg) rotateX(5deg);
}

/* Front cover — faces viewer, uses full cover image */
.book-3d-front {
  position: absolute;
  inset: 0;
  border-radius: 0 3px 3px 0;
  overflow: hidden;
  background: url('Images/FrontCover.jpg') center / cover no-repeat;
  box-shadow:
    5px 8px 28px rgba(0,0,0,0.55),
    0 24px 60px rgba(0,0,0,0.40),
    0  0  80px rgba(245,158,11,0.12),
    inset -3px 0 10px rgba(0,0,0,0.28);  /* gutter shadow at spine join */
}
/* Specular sheen — simulates light from upper-left on hardcover cloth */
.book-3d-front::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    125deg,
    rgba(255,255,255,0.13) 0%,
    rgba(255,255,255,0.04) 35%,
    transparent 55%,
    rgba(0,0,0,0.07) 100%
  );
  pointer-events: none;
}

/* Spine — left face, pivot at its right edge = left edge of front
   rotateY(-90deg): normal becomes -X (faces left) → visible with parent rotateY(+) */
.book-3d-spine {
  position: absolute;
  top: 0; bottom: 0;
  width: var(--depth);
  left: calc(-1 * var(--depth));
  transform-origin: right center;
  transform: rotateY(-90deg);
  border-radius: 3px 0 0 3px;
  overflow: hidden;
  background: url('Images/FrontCoverSpine.jpg') center / cover no-repeat;
  backface-visibility: hidden;
}
/* Spine receives less light — darken with gradient, deeper shadow on outer edge */
.book-3d-spine::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.50) 0%,
    rgba(0,0,0,0.22) 30%,
    rgba(0,0,0,0.10) 65%,
    rgba(0,0,0,0.28) 100%
  );
  pointer-events: none;
}

/* Top — page-stack top edge
   Pivot: bottom edge of this element = top edge of front face.
   rotateX(-90deg): normal becomes -Y (faces up) → visible with parent rotateX(+). */
.book-3d-top {
  position: absolute;
  left: 0; right: 0;
  height: var(--depth);
  top: calc(-1 * var(--depth));
  transform-origin: bottom center;
  transform: rotateX(-90deg);
  /* Page-stack texture: cream pages with thin edge lines + lighting */
  background:
    linear-gradient(to right,
      rgba(0,0,0,0.28) 0%,       /* spine side — less light */
      rgba(0,0,0,0.10) 12%,
      rgba(255,255,255,0.06) 55%,
      rgba(0,0,0,0.06) 90%,
      rgba(0,0,0,0.14) 100%      /* fore-edge shadow */
    ),
    repeating-linear-gradient(to bottom,   /* lines run left→right, repeat front→back */
      #f6f3ee 0px,
      #f6f3ee 1.5px,
      #e4e0da 1.5px,
      #e4e0da 2px
    );
  box-shadow: inset 0 -3px 8px rgba(0,0,0,0.18);
  backface-visibility: hidden;
}

/* Scroll bounce */
@keyframes sbounce { 0%,100%{transform:translateY(0);opacity:.5} 50%{transform:translateY(7px);opacity:1} }
.scroll-bounce { animation: sbounce 2.2s ease-in-out infinite; }


/* ── 7. Hero stat row ──────────────────────────────────── */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.01em;
}
.hero-stat { white-space: nowrap; }
.hero-stat-sep {
  margin: 0 14px;
  color: rgba(255,255,255,0.20);
}
.hero-stat-val {
  font-weight: 800;
  color: rgba(255,255,255,0.85);
}


/* ── 7b. Section chapter number ────────────────────────── */
.section-num {
  display: block;
  font-size: 6rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(245,158,11,0.08);
  letter-spacing: -0.04em;
  margin-bottom: -1.4rem;
  user-select: none;
  pointer-events: none;
}
.dark .section-num { color: rgba(245,158,11,0.07); }


/* ── 8. Buttons ────────────────────────────────────────── */
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d97706, #f59e0b);
  color: #000;
  font-weight: 700;
  font-size: 0.9375rem;
  border: none;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(245,158,11,0.36);
  transition: filter 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}
.btn-gold:hover  { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 6px 22px rgba(245,158,11,0.50); }
.btn-gold:active { transform: none; filter: brightness(0.98); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 10px;
  background: var(--pop-lblue);
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(59,130,246,0.30);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  cursor: pointer;
}
.btn-primary:hover  { background: #2563eb; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,0.42); }
.btn-primary:active { transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid rgba(255,255,255,0.22);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.38); transform: translateY(-1px); }

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8125rem;
  border-radius: 8px;
}


/* ── 9. Content card (warm bordered container) ─────────── */
.content-card {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.25s;
}
.dark .content-card {
  background: #111827;
  border-color: #1f2937;
}
.content-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.dark .content-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.24);
}


/* ── 10. Purchase cards ────────────────────────────────── */
.p-card {
  border-radius: 20px;
  border: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s;
  display: flex;
  flex-direction: column;
}
.dark .p-card       { background: #111827; border-color: #1f2937; }
.p-card:hover       { box-shadow: 0 20px 52px rgba(0,0,0,0.10); transform: translateY(-6px); border-color: rgba(245,158,11,0.35); }
.dark .p-card:hover { border-color: rgba(245,158,11,0.28); box-shadow: 0 20px 52px rgba(0,0,0,0.35); }
.p-card.featured    { border-color: var(--pop-gold); border-width: 2px; }
.dark .p-card.featured { border-color: var(--pop-gold); }


/* ── 11. Resource / link cards ─────────────────────────── */
.r-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px 22px;
  border-radius: var(--radius-card);
  border: 1px solid #e5e7eb;
  background: #fff;
  text-decoration: none;
  transition: border-color 0.24s, box-shadow 0.22s, transform 0.22s;
}
.dark .r-card       { background: #111827; border-color: #1f2937; }
.r-card:hover       { border-color: rgba(245,158,11,0.30); box-shadow: 0 8px 28px rgba(245,158,11,0.07); transform: translateY(-3px); }
.dark .r-card:hover { border-color: rgba(245,158,11,0.25); }


/* ── 12. Badges ────────────────────────────────────────── */
.badge-gold {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(245,158,11,0.12);
  color: var(--pop-gold-dk);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid rgba(245,158,11,0.24);
}
.dark .badge-gold { color: var(--pop-gold); background: rgba(245,158,11,0.10); }


/* ── 13. Dividers ──────────────────────────────────────── */
.hr-fade {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
}
.dark .hr-fade { background: linear-gradient(90deg, transparent, #1f2937 20%, #1f2937 80%, transparent); }

.section-divider {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(245,158,11,0.05) 0%, rgba(109,40,217,0.06) 100%);
  position: relative;
}
.section-divider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ── 14. Mobile drawer ─────────────────────────────────── */
#drawer            { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }
#drawer.open       { pointer-events: all; }
#d-overlay         { position: absolute; inset: 0; background: rgba(0,0,0,0.52); opacity: 0; transition: opacity 0.28s; }
#drawer.open #d-overlay { opacity: 1; }
#d-panel {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(300px, 88vw);
  background: #fff;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.34s var(--ease);
  box-shadow: -6px 0 28px rgba(0,0,0,0.14);
}
.dark #d-panel        { background: #0d1525; }
#drawer.open #d-panel { transform: none; }


/* ── 15. Lightbox ──────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
  cursor: zoom-out;
}
#lightbox.open         { opacity: 1; pointer-events: all; }
#lightbox img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 72px rgba(0,0,0,0.6);
  transform: scale(0.94);
  transition: transform 0.30s var(--ease-pop);
}
#lightbox.open img { transform: scale(1); }


/* ── 16. FAQ accordion ─────────────────────────────────── */
.faq-item {
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.22s;
}
.dark .faq-item       { background: #111827; border-color: #1f2937; }
.faq-item:hover       { border-color: rgba(245,158,11,0.25); }
.dark .faq-item:hover { border-color: rgba(245,158,11,0.20); }

.faq-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  transition: color 0.2s;
}
.dark .faq-btn        { color: #f3f4f6; }
.faq-btn:hover        { color: var(--pop-gold-dk); }
.dark .faq-btn:hover  { color: var(--pop-gold); }

.faq-chevron          { transition: transform 0.28s ease; flex-shrink: 0; color: #9ca3af; }
.faq-chevron.rotate   { transform: rotate(180deg); color: var(--pop-gold); }

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
}
.faq-body.open { max-height: 600px; transition: max-height 0.55s ease-in; }

.faq-body-inner {
  padding: 0 24px 22px;
  color: #4b5563;
  line-height: 1.7;
  font-size: 0.9375rem;
}
.dark .faq-body-inner { color: #9ca3af; }


/* ── 17. Check list items ──────────────────────────────── */
.check-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.9375rem;
  color: #374151;
  line-height: 1.55;
}
.dark .check-item { color: #d1d5db; }
.check-item::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pop-gold);
  flex-shrink: 0;
  margin-top: 7px;
}


/* ── 18. Bullet list ───────────────────────────────────── */
.bullet-list { list-style: none; padding: 0; margin: 0; }
.bullet-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  font-size: 0.9375rem;
  color: #4b5563;
  line-height: 1.6;
  border-bottom: 1px solid #f3f4f6;
}
.dark .bullet-list li { color: #9ca3af; border-bottom-color: #1f2937; }
.bullet-list li:last-child { border-bottom: none; }
.bullet-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pop-gold);
  flex-shrink: 0;
  margin-top: 8px;
}


/* ── 19. Social buttons ────────────────────────────────── */
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: filter 0.18s, transform 0.15s;
  border: none;
}
.social-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
