/* ===== Interactive animations & FX ===== */

/* Spotlight that follows cursor on cards */
.sal, .pro-card, .aud-card, .res, .ss, .doubt-card {
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--ry, 0deg)) rotateY(var(--rx, 0deg));
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.sal::before, .pro-card::before, .aud-card::before, .res::before, .ss::before, .doubt-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%),
              rgba(52,242,123,0.18), transparent 55%);
  opacity: 0; transition: opacity .3s ease;
  pointer-events: none; z-index: 0;
}
.sal:hover::before, .pro-card:hover::before, .aud-card:hover::before,
.res:hover::before, .ss:hover::before, .doubt-card:hover::before { opacity: 1; }
.sal > *, .pro-card > *, .aud-card > *, .res > *, .ss > *, .doubt-card > * {
  position: relative; z-index: 1;
}

/* Salary amount — blur-in reveal + shimmer sweep */
.sal .amount {
  background: linear-gradient(110deg, var(--green) 20%, var(--green-soft) 40%, var(--green) 60%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shimmer 3.5s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 200% 0; }
  50% { background-position: 0 0; }
}
.sal.visible .amount { animation-play-state: running; }

/* Animated counters */
.ss .big, .sp-stat .num {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-soft) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  display: inline-block;
}

/* Accent text — subtle gradient shimmer on view */
h1 span, h2 .accent {
  background-size: 200% 100%;
  animation: accent-shimmer 5s ease-in-out infinite;
}
@keyframes accent-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Timeline active progression */
.timeline::before {
  background: linear-gradient(180deg,
    var(--green) 0%,
    var(--green) var(--progress, 0%),
    rgba(52,242,123,0.15) var(--progress, 0%),
    transparent 100%) !important;
  transition: --progress .15s linear;
}
.step-num {
  transition: transform .35s cubic-bezier(.2,.9,.3,1.4), box-shadow .3s;
}
.step.active .step-num {
  transform: scale(1.15);
  box-shadow: 0 0 0 4px var(--bg), 0 0 40px rgba(52,242,123,0.8);
}
.step .step-body { transition: opacity .4s ease, transform .4s ease; opacity: .55; }
.step.active .step-body { opacity: 1; }

/* Hero collage — floating + mouse parallax */
.collage .card {
  will-change: transform;
  transition: transform .5s cubic-bezier(.2,.9,.3,1);
}
.c1 { animation: float1 7s ease-in-out infinite; }
.c2 { animation: float2 8s ease-in-out infinite; }
.c3 { animation: float3 9s ease-in-out infinite; }
@keyframes float1 { 0%,100%{transform:rotate(-8deg) translateY(0)} 50%{transform:rotate(-6deg) translateY(-10px)} }
@keyframes float2 { 0%,100%{transform:rotate(6deg) translateY(0)} 50%{transform:rotate(8deg) translateY(10px)} }
@keyframes float3 { 0%,100%{transform:rotate(-3deg) translateY(0)} 50%{transform:rotate(-1deg) translateY(-8px)} }
.collage.mouse-active .c1,
.collage.mouse-active .c2,
.collage.mouse-active .c3 {
  animation: none;
}
.collage.mouse-active .c1 { transform: rotate(calc(-8deg + var(--px, 0) * 2deg)) translate(calc(var(--px, 0) * -10px), calc(var(--py, 0) * -8px)); }
.collage.mouse-active .c2 { transform: rotate(calc(6deg + var(--px, 0) * -2deg)) translate(calc(var(--px, 0) * 15px), calc(var(--py, 0) * -12px)); }
.collage.mouse-active .c3 { transform: rotate(calc(-3deg + var(--px, 0) * 1.5deg)) translate(calc(var(--px, 0) * 8px), calc(var(--py, 0) * 14px)); }

/* Magnetic CTA */
.btn-primary {
  transform: translate(var(--tx, 0px), var(--ty, 0px)) translateY(0);
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2), box-shadow .25s, background .25s;
}
.btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(120px circle at var(--bmx, 50%) var(--bmy, 50%), rgba(255,255,255,0.25), transparent 60%);
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.btn-primary { position: relative; overflow: hidden; }
.btn-primary:hover::after { opacity: 1; }

/* Examples — video zoom on hover */
.ex video, .ex img {
  transition: transform .5s cubic-bezier(.2,.9,.3,1);
}
.ex:hover video, .ex:hover img { transform: scale(1.08); }

/* Marquee pause on hover */
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Reveal: stagger children of grids */
.results .res, .school-stats .ss, .audience .aud-card, .salary-grid .sal, .pro-cols .pro-card {
  opacity: 0; transform: translateY(30px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.9,.3,1);
}
.results.in .res, .school-stats.in .ss, .audience.in .aud-card, .salary-grid.in .sal, .pro-cols.in .pro-card {
  opacity: 1; transform: none;
}
.results.in .res:nth-child(2), .school-stats.in .ss:nth-child(2),
.audience.in .aud-card:nth-child(2), .salary-grid.in .sal:nth-child(2),
.pro-cols.in .pro-card:nth-child(2) { transition-delay: .08s; }
.results.in .res:nth-child(3), .school-stats.in .ss:nth-child(3),
.audience.in .aud-card:nth-child(3), .salary-grid.in .sal:nth-child(3),
.pro-cols.in .pro-card:nth-child(3) { transition-delay: .16s; }
.results.in .res:nth-child(4), .audience.in .aud-card:nth-child(4),
.salary-grid.in .sal:nth-child(4) { transition-delay: .24s; }

/* Cursor glow orb on hero */
.hero-grid { position: relative; }
.cursor-orb {
  position: fixed; pointer-events: none; z-index: 2;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52,242,123,0.12), transparent 60%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  opacity: 0;
  filter: blur(20px);
  mix-blend-mode: screen;
}
body:hover .cursor-orb { opacity: 1; }
@media (hover: none) { .cursor-orb { display: none; } }

/* ===== Modal popup form ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3,10,6,0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -46%) scale(.96);
  max-width: 520px; width: calc(100% - 32px);
  max-height: calc(100dvh - 40px); overflow-y: auto;
  background: linear-gradient(135deg, var(--panel) 0%, rgba(52,242,123,0.1) 100%);
  border: 1px solid rgba(52,242,123,0.3);
  border-radius: 28px; padding: 44px 32px 32px;
  z-index: 201;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .4s cubic-bezier(.2,.9,.3,1.3);
  box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 80px rgba(52,242,123,0.15);
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal::before {
  content: ""; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(52,242,123,0.3), transparent 70%);
  filter: blur(20px); pointer-events: none;
}
.modal > * { position: relative; z-index: 1; }

.modal h3.m-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(22px, 3vw, 30px); font-weight: 800;
  margin-bottom: 8px;
}
.modal p.m-sub { color: var(--muted); margin-bottom: 24px; font-size: 15px; }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-2);
  color: var(--muted); display: grid; place-items: center;
  cursor: pointer; font-size: 22px; line-height: 1;
  transition: .2s; z-index: 2;
}
.modal-close:hover { color: var(--green); border-color: var(--green); transform: rotate(90deg); }

.modal form { display: grid; gap: 14px; }
.modal .field input[type=text], .modal .field input[type=tel] {
  width: 100%; padding: 14px 16px; border-radius: 12px;
  background: var(--bg-2); border: 1.5px solid var(--border);
  color: var(--text); font-size: 16px; font-family: inherit;
}
.modal .field input:focus { outline: none; border-color: var(--green); }
.modal .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.modal .field .err { color: var(--danger); font-size: 12px; margin-top: 4px; display: none; }
.modal .field.invalid .err { display: block; }
.modal .field.invalid input { border-color: var(--danger); }
.modal .radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal .radio-group label {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border-radius: 12px; background: var(--bg-2); border: 1.5px solid var(--border);
  cursor: pointer; font-size: 14px; margin: 0;
}
.modal .radio-group input { accent-color: var(--green); }
.modal .radio-group label:has(input:checked) { border-color: var(--green); background: rgba(52,242,123,0.08); }
.modal .consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.modal .consent input { margin-top: 2px; accent-color: var(--green); }
.modal .consent a { color: var(--green); text-decoration: underline; }
.modal .btn-primary { justify-content: center; padding: 16px; font-size: 15px; width: 100%; }

.modal-success { text-align: center; padding: 10px 0; }
.modal-success .check {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  display: grid; place-items: center;
  margin: 0 auto 18px; font-size: 38px; color: #031308;
  animation: pop .5s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.modal-success h3 { font-family: 'Montserrat', sans-serif; font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.modal-success p { color: var(--muted); font-size: 15px; }

body.modal-open { overflow: hidden; }

@media (max-width: 560px) {
  .modal { padding: 40px 22px 24px; border-radius: 22px; }
  .modal h3.m-title { font-size: 22px; }
}

/* Respect motion prefs */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .cursor-orb { display: none; }
}

/* Disable heavy FX on small screens */
@media (max-width: 760px) {
  .cursor-orb { display: none; }
  .sal, .pro-card, .aud-card, .res, .ss, .doubt-card { transform: none !important; }
  .collage.mouse-active .c1,
  .collage.mouse-active .c2,
  .collage.mouse-active .c3 { animation: float1 7s ease-in-out infinite, float2 8s ease-in-out infinite, float3 9s ease-in-out infinite; }
  .c2 { animation: float2 8s ease-in-out infinite; }
  .c3 { animation: float3 9s ease-in-out infinite; }
}
