/* =====================================================
   NZ Immersive Layer — hero v4 (full-bleed 3D), scroll-story,
   motion/reveal system, world promo.
   Loaded after main.css / modern-2026.css.
   ===================================================== */

/* ---------- HERO V4 — full-bleed immersive ---------- */
.hero-v4 {
  position: relative;
  min-height: clamp(620px, 94vh, 1020px);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 70% at 78% 18%, rgba(124, 92, 224, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 60% at 15% 85%, rgba(245, 166, 35, 0.10), transparent 60%),
    linear-gradient(180deg, #241a52 0%, #1a1240 45%, #0f0a24 100%);
}
.hero-v4 .container { position: relative; z-index: 3; width: 100%; }

#nz-hero-canvas { position: absolute; inset: 0; z-index: 1; }
#nz-hero-canvas canvas { display: block; width: 100% !important; height: 100% !important; }

/* آرام‌کردن پس‌زمینه پشت متن — ستاره‌ها خوانایی را خراب نکنند */
.hero-v4 .h3-content { position: relative; }
.hero-v4 .h3-content::before {
  content: '';
  position: absolute; inset: -40px -60px;
  background: radial-gradient(ellipse at center, rgba(15, 10, 36, 0.72) 0%, rgba(15, 10, 36, 0.35) 55%, transparent 78%);
  z-index: -1; pointer-events: none;
  filter: blur(6px);
}

/* soft fade from dark hero into the light page below */
.hero-v4::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 110px;
  background: linear-gradient(180deg, transparent, var(--bg));
  z-index: 2; pointer-events: none;
}

/* --- typography overrides on dark --- */
.hero-v4 .h3-content { max-width: 640px; }
.hero-v4 .h3-eyebrow {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #FFD96E;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero-v4 .h3-title { color: #fff; text-shadow: 0 4px 40px rgba(15, 10, 36, 0.6); }
.hero-v4 .h3-mark {
  background: linear-gradient(120deg, #b9a6ff, #7c5ce0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-v4 .h3-mark.gold {
  background: linear-gradient(120deg, #FFD96E, #F5A623);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-v4 .h3-sub { color: rgba(244, 241, 251, 0.78); }

.hero-v4 .h3-watch { color: rgba(244, 241, 251, 0.9); }
.hero-v4 .h3-watch:hover { color: #fff; }
.hero-v4 .h3-watch-orb { background: rgba(255, 255, 255, 0.12); color: #FFD96E; }

.hero-v4 .h3-proof li {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 10px 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.hero-v4 .h3-proof strong { color: #fff; }
.hero-v4 .h3-proof .hp-label { color: rgba(244, 241, 251, 0.6); }
.hero-v4 .h3-proof .hp-icon { color: #FFD96E; }

/* --- world CTA chip in hero --- */
.nz-world-cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 1.1rem;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(124, 92, 224, 0.18);
  border: 1px solid rgba(185, 166, 255, 0.35);
  color: #d9ccff !important;
  font-weight: 700; font-size: 0.92rem;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.2s, background 0.25s, box-shadow 0.25s;
}
.nz-world-cta:hover {
  transform: translateY(-2px);
  background: rgba(124, 92, 224, 0.32);
  box-shadow: 0 10px 30px rgba(124, 92, 224, 0.35);
}
.nz-world-cta .nzw-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #FFD96E;
  box-shadow: 0 0 12px 2px rgba(255, 217, 110, 0.8);
  animation: nzPulse 1.8s ease-in-out infinite;
}
@keyframes nzPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: 0.7; } }

/* --- scroll cue --- */
.nz-scroll-cue {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  color: rgba(244, 241, 251, 0.55);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em;
  pointer-events: none;
  animation: nzCueFloat 2.4s ease-in-out infinite;
}
.nz-scroll-cue .nzc-mouse {
  width: 22px; height: 34px; border-radius: 12px;
  border: 2px solid rgba(244, 241, 251, 0.4);
  position: relative;
}
.nz-scroll-cue .nzc-mouse::after {
  content: ''; position: absolute; left: 50%; top: 6px;
  width: 3px; height: 7px; border-radius: 3px;
  background: #FFD96E; transform: translateX(-50%);
  animation: nzCueDrop 1.8s ease-in-out infinite;
}
@keyframes nzCueFloat { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }
@keyframes nzCueDrop { 0% { opacity: 0; top: 5px; } 35% { opacity: 1; } 100% { opacity: 0; top: 17px; } }

/* WebGL unavailable → decorative CSS orbs keep the hero alive */
.hero-v4 .nz-no3d-orb { display: none; }
.hero-v4.nz-no3d .nz-no3d-orb {
  display: block; position: absolute; border-radius: 50%;
  filter: blur(70px); z-index: 1; pointer-events: none;
}
.hero-v4.nz-no3d .nz-no3d-orb.o1 { width: 420px; height: 420px; background: rgba(124,92,224,0.5); top: -80px; left: 8%; }
.hero-v4.nz-no3d .nz-no3d-orb.o2 { width: 340px; height: 340px; background: rgba(245,166,35,0.28); bottom: -60px; left: 30%; }

/* =====================================================
   HERO PHOTO — framed portrait of the academy robot
   ===================================================== */
.hero-v4 .h3-visual { position: relative; z-index: 3; }
.nz-hero-photo {
  position: relative;
  max-width: 520px;
  margin-inline-start: auto;
  border-radius: 30px;
  animation: nzhpFloat 6s ease-in-out infinite;
}
.nz-hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 30px 80px rgba(10, 6, 30, 0.55),
    0 8px 28px rgba(124, 92, 224, 0.25);
  position: relative;
  z-index: 2;
}
/* animated conic ring behind the photo */
.nz-hero-photo .nzhp-ring {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 33px;
  background: conic-gradient(from var(--nzhp-a, 0deg),
    rgba(124, 92, 224, 0.95), rgba(255, 217, 110, 0.9),
    rgba(66, 200, 255, 0.85), rgba(124, 92, 224, 0.95));
  z-index: 1;
  animation: nzhpSpin 9s linear infinite;
  filter: saturate(1.15);
}
@property --nzhp-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes nzhpSpin { to { --nzhp-a: 360deg; } }
/* soft ambient glow */
.nz-hero-photo .nzhp-glow {
  position: absolute; inset: -12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124, 92, 224, 0.4), transparent 70%);
  filter: blur(46px);
  z-index: 0;
  pointer-events: none;
}
@keyframes nzhpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* floating glass badges */
.nzhp-badge {
  position: absolute; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  background: rgba(22, 15, 48, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(10, 6, 30, 0.45);
  white-space: nowrap;
}
.nzhp-badge .nzhp-badge-icon { font-size: 1.35rem; line-height: 1; }
.nzhp-badge .nzhp-badge-text { display: flex; flex-direction: column; gap: 1px; }
.nzhp-badge strong { color: #fff; font-size: 0.86rem; font-weight: 800; }
.nzhp-badge small { color: rgba(244, 241, 251, 0.65); font-size: 0.7rem; font-weight: 600; }
.nzhp-b1 { top: 8%; inset-inline-start: -8%; animation: nzhpFloat 5s ease-in-out infinite 0.6s; }
.nzhp-b2 { bottom: 7%; inset-inline-end: -6%; animation: nzhpFloat 5.6s ease-in-out infinite 1.2s; }

@media (prefers-reduced-motion: reduce) {
  .nz-hero-photo, .nzhp-badge, .nz-hero-photo .nzhp-ring { animation: none; }
}

@media (max-width: 1024px) {
  .hero-v4 { min-height: clamp(560px, 88vh, 900px); align-items: flex-start; padding-top: 6.5rem; }
  .hero-v4 .h3-grid { grid-template-columns: 1fr; }
  /* on mobile the robot floats in the lower free half, text on top */
  .hero-v4 .h3-content { max-width: 100%; }
  .nz-hero-photo { max-width: 440px; margin: 1.8rem auto 0; }
  .nzhp-b1 { inset-inline-start: -2%; }
  .nzhp-b2 { inset-inline-end: -2%; }
}
@media (max-width: 480px) {
  .nz-hero-photo { max-width: 100%; }
  .nzhp-badge { padding: 8px 12px; }
  .nzhp-badge strong { font-size: 0.78rem; }
  .nzhp-b1 { top: 5%; inset-inline-start: 3%; }
  .nzhp-b2 { bottom: 4%; inset-inline-end: 3%; }
}

/* =====================================================
   MOTION / REVEAL SYSTEM  (data-nzr)
   ===================================================== */
[data-nzr] {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--nzr-delay, 0s);
  will-change: opacity, transform;
}
[data-nzr="left"]  { transform: translateX(-40px); }
[data-nzr="right"] { transform: translateX(40px); }
[data-nzr="zoom"]  { transform: scale(0.88); }
[data-nzr].nzr-in  { opacity: 1; transform: none; }

/* stagger children */
[data-nzr-stagger] > * {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-nzr-stagger].nzr-in > * { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-nzr], [data-nzr-stagger] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* =====================================================
   SCROLL STORY — sticky 3D journey  (#nz-story)
   ===================================================== */
.nz-story {
  position: relative;
  background: linear-gradient(180deg, #0f0a24 0%, #1a1240 50%, #0f0a24 100%);
}
.nz-story .nzs-track { height: 420vh; position: relative; }
.nz-story .nzs-stage {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
#nz-story-canvas { position: absolute; inset: 0; z-index: 1; }
#nz-story-canvas canvas { display: block; width: 100% !important; height: 100% !important; }

/* soft edges into the light sections above/below */
.nz-story::before, .nz-story::after {
  content: ''; position: absolute; left: 0; right: 0; height: 110px; z-index: 5; pointer-events: none;
}
.nz-story::before { top: -1px; background: linear-gradient(180deg, var(--bg), transparent); }
.nz-story::after { bottom: -1px; background: linear-gradient(0deg, var(--bg), transparent); }

/* story head (inside stage, fades out early) */
.nzs-head {
  position: absolute; top: 12vh; left: 0; right: 0; z-index: 3;
  text-align: center; color: #fff; padding: 0 20px;
}
.nzs-head .eyebrow {
  color: #FFD96E; background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.14);
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; margin-bottom: 1rem;
}
.nzs-head h2 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.6rem); margin: 0; }

/* station cards */
.nzs-card {
  position: absolute; z-index: 3;
  bottom: 10vh; right: 6vw;
  max-width: 400px; width: min(86vw, 400px);
  background: rgba(20, 13, 46, 0.55);
  border: 1px solid rgba(185, 166, 255, 0.22);
  border-radius: 20px;
  padding: 1.5rem 1.6rem;
  color: #fff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(5, 3, 15, 0.5);
  opacity: 0; transform: translateY(34px);
  transition: opacity 0.55s cubic-bezier(0.22,1,0.36,1), transform 0.55s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}
.nzs-card.on { opacity: 1; transform: none; pointer-events: auto; }
.nzs-card .nzsc-step {
  display: inline-block; font-size: 0.72rem; font-weight: 800; color: #FFD96E;
  background: rgba(255, 217, 110, 0.12); border: 1px solid rgba(255, 217, 110, 0.3);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 0.8rem;
}
.nzs-card h3 { color: #fff; font-size: 1.35rem; margin: 0 0 0.5rem; }
.nzs-card p { color: rgba(244, 241, 251, 0.75); font-size: 0.92rem; line-height: 1.9; margin: 0; }
.nzs-card .btn { margin-top: 1rem; }
@media (max-width: 700px) {
  .nzs-card { right: 50%; transform: translate(50%, 34px); bottom: 8vh; padding: 1.2rem 1.3rem; }
  .nzs-card.on { transform: translate(50%, 0); }
}

/* progress dots (left side, vertical) */
.nzs-dots {
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
  z-index: 3; display: flex; flex-direction: column; gap: 12px;
}
.nzs-dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(244, 241, 251, 0.25);
  transition: background 0.3s, transform 0.3s, box-shadow 0.3s;
}
.nzs-dots span.on {
  background: #FFD96E; transform: scale(1.35);
  box-shadow: 0 0 14px 2px rgba(255, 217, 110, 0.6);
}
@media (max-width: 700px) { .nzs-dots { left: 14px; } }

/* reduced motion / no webgl: story collapses to a simple dark band */
.nz-story.nz-flat .nzs-track { height: auto; }
.nz-story.nz-flat .nzs-stage { position: relative; height: auto; padding: 5rem 0; }
.nz-story.nz-flat .nzs-head { position: relative; top: 0; margin-bottom: 2.5rem; }
.nz-story.nz-flat .nzs-card {
  position: relative; inset: auto; opacity: 1; transform: none;
  margin: 1.2rem auto; pointer-events: auto;
}
.nz-story.nz-flat .nzs-dots, .nz-story.nz-flat #nz-story-canvas { display: none; }

/* =====================================================
   WORLD PROMO BAND (homepage, links to world.html)
   ===================================================== */
.nz-world-band { padding: 0 0 4rem; background: var(--bg); }
.nz-world-band .nzw-card {
  position: relative; overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(ellipse 80% 90% at 85% 15%, rgba(124, 92, 224, 0.45), transparent 55%),
    radial-gradient(ellipse 60% 80% at 10% 90%, rgba(245, 166, 35, 0.16), transparent 60%),
    linear-gradient(135deg, #241a52, #0f0a24);
  padding: clamp(2.2rem, 5vw, 3.8rem);
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 2rem; align-items: center;
  box-shadow: 0 30px 80px rgba(26, 18, 64, 0.35);
}
@media (max-width: 860px) { .nz-world-band .nzw-card { grid-template-columns: 1fr; } }
.nzw-card h2 { color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.3rem); margin: 0 0 0.8rem; }
.nzw-card p { color: rgba(244, 241, 251, 0.75); line-height: 2; margin: 0 0 1.4rem; }
.nzw-keys { display: flex; gap: 8px; align-items: center; color: rgba(244,241,251,0.55); font-size: 0.8rem; margin-top: 1rem; }
.nzw-keys kbd {
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.18);
  border-bottom-width: 3px; border-radius: 8px; padding: 4px 9px;
  font-family: inherit; font-size: 0.78rem; color: #fff;
}
.nzw-visual { position: relative; min-height: 200px; }
.nzw-visual .nzw-orbit {
  position: absolute; inset: 0; margin: auto;
  width: min(260px, 80%); aspect-ratio: 1; border-radius: 50%;
  border: 1px dashed rgba(185, 166, 255, 0.35);
  animation: nzSpin 22s linear infinite;
}
.nzw-visual .nzw-orbit i {
  position: absolute; top: -13px; left: 50%;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #FFD96E, #F5A623);
  box-shadow: 0 0 24px 4px rgba(255, 217, 110, 0.55);
  font-style: normal; display: grid; place-items: center; font-size: 13px;
}
.nzw-visual .nzw-robot {
  position: absolute; inset: 0; margin: auto;
  width: 110px; height: 110px; border-radius: 34px;
  background: linear-gradient(160deg, #f4f1fb, #d9ccff);
  display: grid; place-items: center; font-size: 52px;
  box-shadow: 0 20px 50px rgba(5, 3, 15, 0.5), inset 0 -6px 18px rgba(124, 92, 224, 0.3);
  animation: nzBob 3.4s ease-in-out infinite;
}
@keyframes nzSpin { to { transform: rotate(360deg); } }
@keyframes nzBob { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .nzw-visual .nzw-orbit, .nzw-visual .nzw-robot, .nz-world-cta .nzw-dot, .nz-scroll-cue { animation: none; }
}

/* =====================================================
   COURSE PAGE 3D VIEWER  (#nz-course-3d)
   ===================================================== */
.nz-course-3d {
  position: relative; width: 100%; aspect-ratio: 16 / 10;
  border-radius: 24px; overflow: hidden;
  background:
    radial-gradient(ellipse 80% 70% at 70% 20%, rgba(124, 92, 224, 0.4), transparent 60%),
    linear-gradient(160deg, #241a52, #0f0a24);
  box-shadow: 0 24px 60px rgba(26, 18, 64, 0.3);
  cursor: grab;
}
.nz-course-3d:active { cursor: grabbing; }
.nz-course-3d canvas { display: block; width: 100% !important; height: 100% !important; }
.nz-course-3d .nzc3-hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 2; color: rgba(244, 241, 251, 0.6); font-size: 0.72rem; font-weight: 600;
  background: rgba(15, 10, 36, 0.5); border: 1px solid rgba(255,255,255,0.12);
  padding: 5px 14px; border-radius: 999px; pointer-events: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
