/* =========================================================
   CSS 3D scenes · Glossy motion · Scroll reveals
   ========================================================= */

/* Scene stage behind hero */
.scene-3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  perspective: 900px;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  mix-blend-mode: screen;
  animation: float-orb 10s ease-in-out infinite;
}

.orb-1 {
  width: 320px;
  height: 320px;
  top: 4%;
  right: 4%;
  background: radial-gradient(circle at 35% 30%, rgba(180,160,255,0.45), rgba(91,141,239,0.18) 40%, transparent 70%);
  filter: blur(4px);
  animation-duration: 14s;
}

.orb-2 {
  width: 220px;
  height: 220px;
  bottom: 12%;
  right: 26%;
  background: radial-gradient(circle at 40% 35%, rgba(212,175,55,0.28), rgba(124,58,237,0.15) 45%, transparent 70%);
  filter: blur(6px);
  animation-duration: 11s;
  animation-delay: -2s;
}

.orb-3 {
  width: 160px;
  height: 160px;
  top: 38%;
  left: 48%;
  background: radial-gradient(circle at 40% 30%, rgba(100,200,255,0.3), transparent 70%);
  filter: blur(5px);
  animation-duration: 12s;
  animation-delay: -4s;
}

@keyframes float-orb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(12px, -28px, 40px) scale(1.06); }
}

/* Floating 3D temple / trust emblem — pure CSS */
.emblem-3d {
  position: absolute;
  right: clamp(4%, 8vw, 12%);
  top: 50%;
  width: min(340px, 38vw);
  aspect-ratio: 1;
  transform: translateY(-46%) rotateX(18deg) rotateY(-28deg);
  transform-style: preserve-3d;
  animation: emblem-spin 14s ease-in-out infinite;
  opacity: 0.95;
}

@keyframes emblem-spin {
  0%, 100% { transform: translateY(-46%) rotateX(18deg) rotateY(-28deg) translateZ(0); }
  50% { transform: translateY(-50%) rotateX(22deg) rotateY(-18deg) translateZ(20px); }
}

.emblem-ring,
.emblem-core,
.emblem-base,
.emblem-shine {
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 50%;
  transform-style: preserve-3d;
}

.emblem-ring {
  width: 86%;
  height: 86%;
  border: 3px solid rgba(212, 175, 55, 0.55);
  box-shadow:
    0 0 50px rgba(91, 141, 239, 0.35),
    0 0 80px rgba(124, 58, 237, 0.2),
    inset 0 0 30px rgba(255, 255, 255, 0.08);
  animation: ring-pulse 5s ease-in-out infinite;
}

.emblem-ring::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 248, 231, 0.28);
}

@keyframes ring-pulse {
  0%, 100% { transform: translateZ(20px) scale(1); opacity: 0.85; }
  50% { transform: translateZ(36px) scale(1.04); opacity: 1; }
}

.emblem-core {
  width: 58%;
  height: 58%;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.35), transparent 40%),
    linear-gradient(160deg, #e2c56a, #c4922a 40%, #3d2a6d 90%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.45),
    0 25px 50px rgba(0,0,0,0.4),
    0 0 40px rgba(91, 141, 239, 0.35),
    0 0 0 8px rgba(255,255,255,0.06);
  transform: translateZ(48px);
}

.emblem-core::after {
  content: "ॐ";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Tiro Devanagari Hindi", serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: #fffaf0;
  text-shadow: 0 4px 16px rgba(0,0,0,0.35);
}

.emblem-base {
  width: 70%;
  height: 18%;
  bottom: 6%;
  top: auto;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.45), transparent 70%);
  transform: rotateX(78deg) translateZ(-40px);
  filter: blur(4px);
}

.emblem-shine {
  width: 40%;
  height: 40%;
  top: 18%;
  left: 18%;
  right: auto;
  bottom: auto;
  background: radial-gradient(circle, rgba(255,255,255,0.55), transparent 65%);
  transform: translateZ(60px);
  filter: blur(2px);
  animation: shine-sweep 6s ease-in-out infinite;
}

@keyframes shine-sweep {
  0%, 100% { opacity: 0.35; transform: translateZ(60px) translate(0, 0); }
  50% { opacity: 0.7; transform: translateZ(70px) translate(10px, 8px); }
}

/* Education page — CSS book stack */
.scene-books {
  position: absolute;
  right: 6%;
  bottom: 12%;
  width: min(260px, 34vw);
  height: 200px;
  transform-style: preserve-3d;
  transform: rotateX(12deg) rotateY(-28deg);
  animation: books-float 8s ease-in-out infinite;
}

@keyframes books-float {
  0%, 100% { transform: rotateX(12deg) rotateY(-28deg) translateY(0); }
  50% { transform: rotateX(14deg) rotateY(-22deg) translateY(-14px); }
}

.book {
  position: absolute;
  left: 20%;
  width: 58%;
  height: 18px;
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 8px 18px rgba(0,0,0,0.25);
  transform-origin: left center;
}

.book-1 {
  bottom: 40px;
  background: linear-gradient(90deg, #8b3a2b, #c45c12);
  transform: rotateZ(-6deg) translateZ(10px);
}
.book-2 {
  bottom: 58px;
  background: linear-gradient(90deg, #143528, #2a6b50);
  transform: rotateZ(4deg) translateZ(24px);
  width: 62%;
}
.book-3 {
  bottom: 78px;
  background: linear-gradient(90deg, #b45309, #e8b84a);
  transform: rotateZ(-2deg) translateZ(38px);
}

/* Rural — CSS village silhouette with rising sun */
.scene-village {
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.25));
}

.sun-3d {
  position: absolute;
  right: 14%;
  top: -40px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #fff3c4, #f0c15a 40%, #d97706 70%, transparent 72%);
  box-shadow: 0 0 80px rgba(240, 193, 90, 0.45);
  animation: sun-glow 7s ease-in-out infinite;
}

@keyframes sun-glow {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.12); }
}

.huts {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1.5rem;
  padding: 0 8% 0 40%;
}

.hut {
  width: 70px;
  height: 48px;
  background: linear-gradient(180deg, #5c3a24, #2a1a10);
  position: relative;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
  transform: perspective(300px) rotateY(-15deg);
}

.hut::before {
  content: "";
  position: absolute;
  left: -12px;
  right: -12px;
  top: -28px;
  height: 36px;
  background: linear-gradient(135deg, #8b3a2b, #5c2418);
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.hut::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 22px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.45);
  border-radius: 3px 3px 0 0;
}

.hut:nth-child(2) {
  height: 58px;
  width: 82px;
  transform: perspective(300px) rotateY(-8deg) translateY(-4px);
}

.hut:nth-child(3) {
  height: 42px;
  opacity: 0.85;
}

/* Member — CSS ID badge floating */
.scene-badge {
  position: absolute;
  right: 10%;
  top: 50%;
  width: min(200px, 28vw);
  aspect-ratio: 3/4;
  transform: translateY(-50%) rotateX(10deg) rotateY(-22deg);
  transform-style: preserve-3d;
  animation: badge-float 9s ease-in-out infinite;
}

@keyframes badge-float {
  0%, 100% { transform: translateY(-50%) rotateX(10deg) rotateY(-22deg); }
  50% { transform: translateY(-56%) rotateX(14deg) rotateY(-12deg); }
}

.badge-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.22), transparent 40%),
    linear-gradient(180deg, #2a6b50, #143528);
  border: 1px solid rgba(255,255,255,0.25);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 30px 50px rgba(0,0,0,0.35);
  transform: translateZ(30px);
}

.badge-card::before {
  content: "MEMBER";
  position: absolute;
  top: 18%;
  left: 0;
  right: 0;
  text-align: center;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  font-weight: 800;
  color: rgba(255,248,231,0.8);
}

.badge-card::after {
  content: "";
  position: absolute;
  top: 32%;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff3c4, #e8b84a 50%, #b45309);
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

.badge-lanyard {
  position: absolute;
  top: -18%;
  left: 50%;
  width: 4px;
  height: 22%;
  background: linear-gradient(#e8b84a, #b45309);
  transform: translateX(-50%) translateZ(20px);
  box-shadow: 2px 0 0 rgba(255,255,255,0.15);
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Glossy hover lift for interactive panels */
.lift-3d {
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
  transform-style: preserve-3d;
}

.lift-3d:hover {
  transform: translateY(-6px) rotateX(2deg);
  box-shadow: 0 28px 60px rgba(26, 21, 16, 0.18);
}

/* Subtle page load */
.hero-content > * {
  animation: rise-in 0.9s var(--ease) both;
}

.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.15s; }
.hero-content > *:nth-child(3) { animation-delay: 0.25s; }
.hero-content > *:nth-child(4) { animation-delay: 0.35s; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shine sweep on primary CTA */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 35%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-20deg);
  animation: btn-shine 4.5s ease-in-out infinite;
}

@keyframes btn-shine {
  0%, 70%, 100% { left: -40%; }
  85% { left: 120%; }
}

@media (max-width: 900px) {
  .emblem-3d,
  .scene-books,
  .scene-badge {
    opacity: 0.35;
    right: -4%;
  }

  .scene-village {
    opacity: 0.55;
  }
}

@media (prefers-reduced-motion: reduce) {
  .orb,
  .emblem-3d,
  .emblem-ring,
  .emblem-shine,
  .scene-books,
  .sun-3d,
  .scene-badge,
  .btn-primary::after,
  .hero-content > * {
    animation: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
