/* =====================================================================
   Motion: scroll reveals, hero life, hover effects, counters, progress bar.
   Everything here is progressive: if motion.js does not run (or the visitor
   prefers reduced motion) the site simply shows its normal, static look.
   ===================================================================== */
:root { --ease-out: cubic-bezier(.22, .8, .24, 1); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; scroll-padding-top: 110px; }
  main { animation: pageIn .6s ease both; }
}
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes dropIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes orbA { from { transform: translate(0, 0) scale(1); } to { transform: translate(-70px, 50px) scale(1.18); } }
@keyframes orbB { from { transform: translate(0, 0) scale(1); } to { transform: translate(80px, -40px) scale(1.2); } }
@keyframes dotsDrift { from { background-position: 0 0; } to { background-position: 280px 140px; } }
@keyframes sloganIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ctaPulse { 0% { box-shadow: 0 0 0 0 rgba(13, 101, 200, .5); } 70%, 100% { box-shadow: 0 0 0 12px rgba(13, 101, 200, 0); } }
@keyframes bubblePulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 101, 200, .45), 0 6px 20px rgba(0, 0, 0, .2); }
  70%, 100% { box-shadow: 0 0 0 16px rgba(13, 101, 200, 0), 0 6px 20px rgba(0, 0, 0, .2); }
}

/* ---- Scroll progress bar + back-to-top ---- */
.scroll-progress { position: fixed; top: 0; left: 0; width: 100%; height: 3px; transform: scaleX(0); transform-origin: 0 50%; background: linear-gradient(90deg, #012D62, #0D65C8, #5AA8FF); z-index: 300; pointer-events: none; }
.to-top {
  position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px));
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  background: var(--cedar); color: #fff; box-shadow: 0 8px 22px rgba(1, 45, 98, .28);
  opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
  transition: opacity .3s ease, transform .3s var(--ease-out), background-color .2s ease;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--cedar-dark); transform: translateY(-3px); }
.to-top svg { width: 20px; height: 20px; }

/* ---- Header ---- */
.site-header { transition: box-shadow .3s ease; }
.site-header.is-scrolled { box-shadow: 0 8px 28px rgba(1, 45, 98, .14); }
.brand-mark img { transition: transform .4s var(--ease-out); }
.brand:hover .brand-mark img { transform: scale(1.07) rotate(-2deg); }
.nav-drop a { transition: background .15s ease, padding-left .2s var(--ease-out), color .15s ease; }
.nav-drop a:hover { padding-left: 18px; }
.nav-item:hover > .nav-drop, .nav-item.open > .nav-drop, .nav-item:focus-within > .nav-drop { animation: dropIn .22s var(--ease-out) both; }

/* ---- Buttons ---- */
.btn { position: relative; overflow: hidden; transition: transform .2s var(--ease-out), background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .2s ease; }
.btn::after { content: ''; position: absolute; top: 0; left: -120%; width: 55%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-20deg); transition: left .7s ease; pointer-events: none; }
.btn:hover::after { left: 150%; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(13, 101, 200, .26); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: none; }

/* ---- Hero ---- */
.page-hero { position: relative; overflow: hidden; isolation: isolate; background-image: radial-gradient(rgba(255, 255, 255, .08) 1.3px, transparent 1.4px); background-size: 28px 28px; }
.page-hero::before, .page-hero::after { content: ''; position: absolute; border-radius: 50%; filter: blur(64px); opacity: .55; z-index: -1; pointer-events: none; }
.page-hero::before { width: 440px; height: 440px; right: -90px; top: -150px; background: radial-gradient(circle, #0D65C8, transparent 70%); }
.page-hero::after { width: 380px; height: 380px; left: -110px; bottom: -170px; background: radial-gradient(circle, #2F8CFF, transparent 70%); }
@media (prefers-reduced-motion: no-preference) {
  .page-hero { animation: dotsDrift 40s linear infinite; }
  .page-hero::before { animation: orbA 14s ease-in-out infinite alternate; }
  .page-hero::after { animation: orbB 17s ease-in-out infinite alternate; }
  .js-motion .brand-slogan span { display: inline-block; animation: sloganIn .7s var(--ease-out) both; }
  .js-motion .brand-slogan .s1 { animation-delay: .5s; }
  .js-motion .brand-slogan .s2 { animation-delay: .8s; }
  .js-motion .brand-slogan .s3 { animation-delay: 1.1s; }
  .js-motion:not(.hero-ready) .page-hero h1, .js-motion:not(.hero-ready) .page-hero p, .js-motion:not(.hero-ready) .page-hero .hero-actions { opacity: 0; }
  .hero-ready .page-hero h1 { animation: riseIn .85s var(--ease-out) .05s both; }
  .hero-ready .page-hero p { animation: riseIn .85s var(--ease-out) .22s both; }
  .hero-ready .page-hero .hero-actions { animation: riseIn .85s var(--ease-out) .4s both; }
  .home-graduates img { animation: floaty 7s ease-in-out infinite; }
  .nav-cta-group .btn-primary { animation: ctaPulse 3.2s ease-out 2s infinite; }
  #chat-widget-bubble { animation: bubblePulse 3s ease-out 3s infinite; }
}

/* ---- Scroll reveal (classes added by motion.js) ---- */
.js-motion .reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease-out) var(--d, 0s), transform .8s var(--ease-out) var(--d, 0s); will-change: opacity, transform; }
.js-motion .reveal.rv-zoom { transform: scale(.94) translateY(18px); }
.js-motion .reveal.rv-left { transform: translateX(-30px); }
.js-motion .reveal.is-visible { opacity: 1; transform: none; }

/* Heading accent that draws itself in */
.prose h2 { position: relative; padding-bottom: 12px; }
.prose h2::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 64px; border-radius: 3px; background: linear-gradient(90deg, #0D65C8, #5AA8FF); transition: width .9s var(--ease-out) .25s; }
.js-motion .prose h2.reveal:not(.is-visible)::after { width: 0; }

/* ---- Cards, metrics, videos ---- */
.card, .video-card { transition: transform .3s var(--ease-out), box-shadow .3s ease, border-color .3s ease; }
.card:hover, .video-card:hover { transform: translateY(-6px); box-shadow: 0 20px 44px rgba(1, 45, 98, .15); }
.info-card { transition: transform .3s var(--ease-out), box-shadow .3s ease, border-top-color .3s ease; }
.info-card:hover { border-top-color: #5AA8FF; }
.metric { transition: transform .3s var(--ease-out), border-color .3s ease; }
.metric:hover { transform: translateX(4px); border-left-color: #5AA8FF; }
.metric .num, .hero-stat .num, .target-line span { font-variant-numeric: tabular-nums; }
.step-num { transition: transform .3s var(--ease-out); }
.step-item:hover .step-num { transform: scale(1.12) rotate(-4deg); }

/* ---- Footer ---- */
.site-footer li a { display: inline-flex; transition: transform .2s var(--ease-out), color .15s ease; }
.site-footer li a:hover { transform: translateX(5px); }
.footer-social a { transition: background .15s ease, color .15s ease, transform .25s var(--ease-out), box-shadow .25s ease; }
.footer-social a:hover { transform: translateY(-4px) rotate(8deg); box-shadow: 0 8px 16px rgba(1, 45, 98, .25); }

/* ---- Respect reduced-motion preferences ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js-motion .reveal { opacity: 1 !important; transform: none !important; }
  .card:hover, .video-card:hover, .btn:hover, .metric:hover { transform: none; }
}
@media (max-width: 640px) {
  .page-hero::before, .page-hero::after { filter: blur(48px); opacity: .45; }
  .card:hover, .video-card:hover { transform: none; }
}
