/* Project pages (one template for every project, lib/project-page.js). Two kits with the looks of the original pages:
   vc (pixachat, my-gym, vistaclair) and ba (body-anatomy-3d-viewer, the ba-* classes). Colours come from the page's
   theme (projects/<id>.yaml → page.theme) as CSS custom properties written by the template:
   --pj-a / --pj-b = accent / accent2 as "r, g, b"; --pj-sec-grad / --pj-band-grad = section / band heading gradients;
   --pj-title-max = largest hero title size; --pj-band-w = width of band sections. */
:root {
  --pj-a: 139, 92, 246;
  --pj-b: 244, 63, 94;
  --pj-grad: linear-gradient(135deg, rgb(var(--pj-a)), rgb(var(--pj-b)));
}
html:not(.js) .scroll-reveal { opacity: 1; transform: none; }

/* ── kit vc ── */

.vc-page-hero {
  position: relative; z-index: 1; min-height: 70vh;
  display: flex; align-items: center;
  padding: 4rem 2rem 2rem; max-width: 1200px; margin: 0 auto;
}
.vc-page-hero-content { flex: 1; animation: fadeInUp 0.8s ease-out; }
.vc-page-hero .vc-title { font-size: clamp(3rem, 7vw, var(--pj-title-max, 5rem)); margin-bottom: 0.75rem; }
.vc-page-hero .vc-tagline { font-size: clamp(1.2rem, 2.5vw, 1.6rem); margin-bottom: 1.5rem; }
.vc-page-hero .vc-description { font-size: 1.15rem; max-width: 600px; margin-bottom: 2.5rem; }
.vc-hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.vc-hero-visual {
  flex: 0 0 clamp(280px, 30vw, 460px);
  animation: fadeInRight 0.8s ease-out 0.2s both;
  display: flex; align-items: center; justify-content: center;
}
.vc-hero-glyph {
  width: clamp(220px, 25vw, 360px); height: clamp(220px, 25vw, 360px);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--pj-a), 0.12), rgba(var(--pj-b), 0.08));
  border: 3px solid rgba(var(--pj-a), 0.3);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 80px rgba(var(--pj-a), 0.15), 0 0 160px rgba(var(--pj-b), 0.08);
}
.sp-hero-icon {
  font-size: clamp(80px, 10vw, 140px);
  color: rgb(var(--pj-a));
  filter: drop-shadow(0 0 24px rgba(var(--pj-a), 0.45));
}
.vc-hero-logo {
  width: clamp(120px, 15vw, 200px);
  height: auto;
  filter: drop-shadow(0 0 20px rgba(var(--pj-a), 0.4));
}
/* the project video (file): vistaclair's demo look */
.vc-demo-video {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 2.5rem auto;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--pj-a), 0.2);
  background: #000;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(var(--pj-a), 0.08);
}
.vc-page-section {
  position: relative; z-index: 1;
  padding: 4rem 2rem; max-width: 1200px; margin: 0 auto;
}
.vc-page-section .section-title {
  background: var(--pj-sec-grad, var(--pj-grad));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.vc-arch-section .section-title {
  background: var(--pj-band-grad, var(--pj-grad));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.vc-feature-icon { color: rgb(var(--pj-a)); }
.vc-arch-section {
  position: relative; z-index: 1;
  padding: 4rem 2rem; max-width: var(--pj-band-w, 900px); margin: 0 auto; text-align: center;
}
.sp-cta-text { color: var(--text-muted); font-size: 1.05rem; max-width: 620px; margin: 1rem auto 2rem; }
.vc-back {
  position: fixed; top: 1rem; left: 1rem; z-index: 1000;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(10, 10, 15, 0.85); backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--pj-a), 0.2); border-radius: var(--radius-md);
  color: var(--text-muted); text-decoration: none; font-size: 0.85rem; font-weight: 500;
  transition: var(--transition);
}
.vc-back:hover { color: rgb(var(--pj-a)); border-color: rgb(var(--pj-a)); transform: translateX(-3px); }
.sp-tech-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 2rem; }
/* ── Media: single frame + carousel (auto when >1 item) ── */
.sp-media-single { max-width: 900px; margin: 2.5rem auto 0; }
.sp-single-frame {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid rgba(var(--pj-a), 0.25);
  background: rgba(5, 5, 10, 0.6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(var(--pj-a), 0.12);
}
.sp-single-frame .sp-car-media { width: 100%; display: block; }
.sp-carousel { max-width: 1000px; margin: 2.5rem auto 0; }
.sp-car-stage {
  position: relative; overflow: hidden; aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--pj-a), 0.25);
  background: rgba(5, 5, 10, 0.6);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 60px rgba(var(--pj-a), 0.12);
}
.sp-car-track { display: flex; height: 100%; transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.sp-car-slide { flex: 0 0 100%; display: flex; align-items: center; justify-content: center; height: 100%; }
.sp-car-slide .sp-car-media { width: 100%; height: 100%; object-fit: contain; }
.sp-car-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 10, 15, 0.7); backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--pj-a), 0.35); color: var(--text-light);
  font-size: 0.95rem; cursor: pointer; transition: var(--transition);
}
.sp-car-arrow:hover { color: rgb(var(--pj-a)); border-color: rgb(var(--pj-a)); box-shadow: 0 0 20px rgba(var(--pj-a), 0.35); }
.sp-car-prev { left: 1rem; }
.sp-car-next { right: 1rem; }
.sp-car-dots { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.1rem; }
.sp-car-dot {
  width: 8px; height: 8px; border-radius: 999px; padding: 0; border: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.18); transition: all 0.3s ease;
}
.sp-car-dot:hover { background: rgba(255, 255, 255, 0.4); }
.sp-car-dot.active {
  width: 24px;
  background: linear-gradient(90deg, rgb(var(--pj-a)), rgb(var(--pj-b)));
  box-shadow: 0 0 12px rgba(var(--pj-a), 0.5);
}
.sp-car-caption {
  text-align: center; color: var(--text-muted); font-size: 0.9rem;
  margin-top: 0.7rem; min-height: 1.5em;
}
.sp-cap-in { animation: spCapIn 0.4s ease; }
@keyframes spCapIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .sp-car-arrow { width: 36px; height: 36px; }
  .sp-car-prev { left: 0.5rem; }
  .sp-car-next { right: 0.5rem; }
}
@media (max-width: 968px) {
  .vc-page-hero { flex-direction: column-reverse; text-align: center; min-height: auto; padding-top: 5rem; }
  .vc-page-hero .vc-description { max-width: 100%; }
  .vc-hero-actions { justify-content: center; }
  .vc-hero-visual { flex: none; margin-bottom: 2rem; }
}
@media (max-width: 640px) {
  .vc-page-section, .vc-arch-section { padding: 3rem 1rem; }
  .vc-hero-actions .btn-primary, .vc-hero-actions .btn-secondary { width: 100%; justify-content: center; }
}

/* ── kit ba (the body-anatomy look) ── */

.ba-page-hero {
  position: relative;
  z-index: 1;
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 4rem 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.ba-page-hero-content {
  flex: 1;
  animation: fadeInUp 0.8s ease-out;
}

.ba-page-hero .ba-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  margin-bottom: 0.75rem;
  background: var(--pj-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ba-page-hero .ba-tagline {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.ba-page-hero .ba-description {
  font-size: 1.15rem;
  max-width: 600px;
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.ba-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(var(--pj-a), 0.15);
  color: rgb(var(--pj-a));
  border: 1px solid rgba(var(--pj-a), 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.ba-hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.ba-hero-visual {
  flex: 0 0 clamp(280px, 30vw, 460px);
  animation: fadeInRight 0.8s ease-out 0.2s both;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ba-hero-glyph {
  width: clamp(220px, 25vw, 360px);
  height: clamp(220px, 25vw, 360px);
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--pj-a), 0.12), rgba(var(--pj-b), 0.08));
  border: 3px solid rgba(var(--pj-a), 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 80px rgba(var(--pj-a), 0.15), 0 0 160px rgba(var(--pj-b), 0.08);
}

.ba-hero-icon {
  font-size: clamp(5rem, 10vw, 8rem);
  color: rgb(var(--pj-a));
  filter: drop-shadow(0 0 20px rgba(var(--pj-a), 0.4));
}

/* Viewer section */

.ba-viewer-section {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.ba-viewer-section .section-title {
  background: var(--pj-band-grad, var(--pj-grad));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ba-viewer-wrapper {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(var(--pj-a), 0.2);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(var(--pj-a), 0.08);
  aspect-ratio: 16 / 10;
}

.ba-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Features section */

.ba-page-section {
  position: relative;
  z-index: 1;
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.ba-page-section .section-title {
  background: var(--pj-sec-grad, var(--pj-grad));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ba-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.ba-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  transition: var(--transition);
}

.ba-feature:hover {
  border-color: rgba(var(--pj-a), 0.4);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(var(--pj-a), 0.1);
}

.ba-feature-icon {
  font-size: 1.8rem;
  color: rgb(var(--pj-a));
  margin-bottom: 1rem;
}

.ba-feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ba-feature-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Back link */

.ba-back {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(var(--pj-a), 0.2);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.ba-back:hover {
  color: rgb(var(--pj-a));
  border-color: rgb(var(--pj-a));
  transform: translateX(-3px);
}

/* Responsive */

@media (max-width: 968px) {
  .ba-page-hero {
    flex-direction: column-reverse;
    text-align: center;
    min-height: auto;
    padding-top: 5rem;
  }
  .ba-page-hero .ba-description { max-width: 100%; }
  .ba-hero-actions { justify-content: center; }
  .ba-hero-visual { flex: none; margin-bottom: 2rem; }
}

@media (max-width: 640px) {
  .ba-page-section { padding: 3rem 1rem; }
  .ba-viewer-section { padding: 3rem 1rem; }
  .ba-viewer-wrapper { aspect-ratio: 4 / 3; }
  .ba-hero-actions .btn-primary,
  .ba-hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ── blocks beyond the original pages (both kits) ── */
.ba-hero-logo { width: clamp(120px, 15vw, 200px); height: auto; filter: drop-shadow(0 0 20px rgba(var(--pj-a), 0.4)); }
.pj-embed {
  margin-top: 2rem; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 10;
  border: 1px solid rgba(var(--pj-a), 0.2);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(var(--pj-a), 0.08);
}
.pj-embed-frame { width: 100%; height: 100%; border: none; display: block; }
.pj-prose { color: var(--text-muted); font-size: 1.05rem; line-height: 1.75; max-width: 760px; }
.pj-prose p + p { margin-top: 1rem; }
.pj-prose a { color: rgb(var(--pj-a)); }
.pj-step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; margin-bottom: 1rem;
  border-radius: 50%; font-weight: 700; color: #fff; background: var(--pj-grad);
}
.pj-links { justify-content: center; margin-top: 1.5rem; }
.pj-faq { max-width: 760px; margin: 2rem auto 0; text-align: left; }
.pj-faq-item {
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08)); border-radius: var(--radius-md);
  background: var(--bg-card, rgba(255, 255, 255, 0.03)); margin-bottom: 0.75rem; padding: 0.9rem 1.2rem;
}
.pj-faq-item summary { cursor: pointer; font-weight: 600; }
.pj-faq-item[open] summary { color: rgb(var(--pj-a)); }
.pj-faq-a { color: var(--text-muted); margin-top: 0.6rem; line-height: 1.65; }
.pj-hidden { display: none; }
/* YouTube: click-to-play facade (no request to YouTube before the click; youtube-nocookie.com after) */
.pj-video { max-width: 960px; margin: 2.5rem auto; }
.pj-yt, .pj-yt-player {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; overflow: hidden;
  border: 1px solid rgba(var(--pj-a), 0.2); border-radius: var(--radius-lg); background: #000;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 60px rgba(var(--pj-a), 0.08);
}
.pj-yt { cursor: pointer; color: inherit; font: inherit; }
.pj-yt img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease, filter 0.3s ease; }
.pj-yt:hover img { transform: scale(1.04); filter: brightness(1.08); }
.pj-yt-ph {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 25% 20%, rgba(var(--pj-a), 0.45), transparent 55%), radial-gradient(circle at 80% 85%, rgba(var(--pj-b), 0.3), transparent 50%), linear-gradient(135deg, #1e1b2e 0%, #14101f 100%);
}
.pj-yt-play {
  position: absolute; left: 50%; top: 50%; width: 4.5rem; height: 3.2rem; margin: -1.6rem 0 0 -2.25rem; border-radius: 0.9rem;
  background: var(--pj-grad); box-shadow: 0 6px 24px rgba(var(--pj-a), 0.35); transition: var(--transition, all 0.35s ease);
}
.pj-yt-play::after {
  content: ''; position: absolute; left: 50%; top: 50%; margin: -0.65rem 0 0 -0.4rem;
  border-style: solid; border-width: 0.65rem 0 0.65rem 1.1rem; border-color: transparent transparent transparent #fff;
}
.pj-yt:hover .pj-yt-play, .pj-yt:focus-visible .pj-yt-play { transform: scale(1.08); }
.pj-yt:focus-visible { outline: 2px solid rgb(var(--pj-a)); outline-offset: 3px; }
.pj-yt-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 640px) { .pj-embed { aspect-ratio: 4 / 3; } }
