/* SAIYO — avatar animation system + video hero.
   Works alongside style.css. Avatars: assets/images/avatar/saiyo-{wave,point,think,joy,fly,present}.webp */

:root {
  --saiyo-glow: 0 18px 50px -12px rgba(31, 92, 255, .35);
}

/* ---------- floating / bobbing ---------- */
@keyframes saiyo-bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50%      { transform: translateY(-16px) rotate(1.2deg); }
}
@keyframes saiyo-bob-soft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}
@keyframes saiyo-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33%      { transform: translate(10px, -14px) rotate(2deg); }
  66%      { transform: translate(-8px, -6px) rotate(-2deg); }
}
.saiyo-float  { animation: saiyo-bob 4.2s ease-in-out infinite; will-change: transform; }
.saiyo-float-soft { animation: saiyo-bob-soft 5.5s ease-in-out infinite; will-change: transform; }
.saiyo-drift  { animation: saiyo-drift 9s ease-in-out infinite; will-change: transform; }

/* ---------- mouse parallax tilt (JS sets --rx / --ry) ---------- */
.saiyo-tilt {
  --rx: 0deg; --ry: 0deg;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .25s ease-out;
  transform-style: preserve-3d;
}

/* ---------- entrance pop ---------- */
@keyframes saiyo-pop {
  0%   { opacity: 0; transform: scale(.6) translateY(30px); }
  60%  { opacity: 1; transform: scale(1.06) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.saiyo-pop { animation: saiyo-pop .7s cubic-bezier(.2, .9, .3, 1.2) both; }

/* ---------- glow disc behind avatars ---------- */
.saiyo-stage { position: relative; display: inline-block; }
.saiyo-stage::before {
  content: ""; position: absolute; inset: 6% 4% -4% 4%; z-index: -1;
  background: radial-gradient(closest-side, rgba(31,92,255,.22), rgba(6,182,212,.10), transparent 72%);
  filter: blur(6px); border-radius: 50%;
}

/* ---------- hero video ---------- */
.hero-video { position: relative; max-width: 880px; margin: 34px auto 0; }
.hero-video video {
  width: 100%; height: auto; display: block; border-radius: 22px;
  box-shadow: var(--saiyo-glow); border: 1px solid rgba(31,92,255,.18);
  background: #0a1428;
}
.hero-video__toggle {
  position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(10,20,40,.72); color: #fff; backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px rgba(0,0,0,.35); transition: transform .18s, width .25s, height .25s, background .25s;
}
.hero-video__toggle svg { width: 38px; height: 38px; fill: currentColor; }
.hero-video__toggle .ic-pause { display: none; }
.hero-video__toggle:hover { transform: translate(-50%, -50%) scale(1.08); background: rgba(31,92,255,.85); }
.hero-video.is-playing .hero-video__toggle {
  left: auto; top: auto; right: 14px; bottom: 14px; transform: none;
  width: 46px; height: 46px; opacity: .85;
}
.hero-video.is-playing .hero-video__toggle:hover { transform: scale(1.1); opacity: 1; }
.hero-video.is-playing .hero-video__toggle svg { width: 20px; height: 20px; }
.hero-video.is-playing .hero-video__toggle .ic-play { display: none; }
.hero-video.is-playing .hero-video__toggle .ic-pause { display: block; }
.hero--video-center { text-align: center; }
.hero--video-center .hero__sub { max-width: 640px; margin: 0 auto; }
.hero--video-center .btn-row { justify-content: center; }
.hero__avatar-row {
  display: flex; align-items: flex-end; justify-content: center; gap: 6px;
  margin-top: -58px; position: relative; z-index: 2; pointer-events: none;
}
.hero__avatar-row img { width: 120px; height: auto; filter: drop-shadow(0 12px 22px rgba(31,92,255,.35)); }

/* ---------- marquee band ---------- */
.saiyo-marquee {
  overflow: hidden; white-space: nowrap; border-block: 1px solid rgba(31,92,255,.14);
  background: linear-gradient(90deg, rgba(31,92,255,.06), rgba(6,182,212,.06));
  padding: 14px 0; margin: 0;
}
.saiyo-marquee__track { display: inline-block; animation: saiyo-scroll 26s linear infinite; }
.saiyo-marquee span { font-family: 'Space Grotesk'; font-weight: 600; font-size: 15px; letter-spacing: .14em; color: #27407a; margin: 0 26px; text-transform: uppercase; }
@keyframes saiyo-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- avatar feature rows ---------- */
.saiyo-feature { display: flex; align-items: center; gap: 34px; }
.saiyo-feature img.saiyo-pose { width: 190px; height: auto; flex: 0 0 auto; }
.saiyo-feature--flip { flex-direction: row-reverse; }
/* Professional callout card (replaces avatar feature blocks) */
.feature-callout {
  background: var(--grad-soft); border: 1px solid rgba(31,92,255,.14);
  border-radius: 18px; padding: 26px 30px; position: relative; overflow: hidden;
}
.feature-callout::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--grad);
}
@media (max-width: 720px) {
  .saiyo-feature, .saiyo-feature--flip { flex-direction: column; text-align: center; }
  .saiyo-feature img.saiyo-pose { width: 150px; }
  .hero__avatar-row img { width: 88px; }
}

/* ---------- CTA band ---------- */
.saiyo-cta {
  position: relative; overflow: hidden; border-radius: 26px;
  background: linear-gradient(120deg, #0b1f4d, #123a8f 60%, #0a6d8f);
  color: #fff; padding: 54px 40px; text-align: center;
  box-shadow: var(--saiyo-glow);
}
.saiyo-cta::before {
  content: ""; position: absolute; inset: -40%; z-index: 0;
  background: radial-gradient(closest-side, rgba(6,182,212,.20), transparent 70%);
  animation: saiyo-drift 9s ease-in-out infinite alternate;
}
.saiyo-cta > * { position: relative; z-index: 1; }
.saiyo-cta h2 { color: #fff; margin: 0 0 10px; }
.saiyo-cta p { color: #c9d8f7; max-width: 560px; margin: 0 auto 24px; }
.saiyo-cta .btn--primary { background: #fff; color: #0b1f4d; }

/* ---------- professional motion system ---------- */
@keyframes rise-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* Hero entrance (staggered, runs on page load) */
.hero--video-center .hero__inner > *:not(.hero-video) { animation: rise-in .8s cubic-bezier(.16,1,.3,1) both; }
.hero--video-center .hero__inner > *:nth-child(1) { animation-delay: .05s; }
.hero--video-center .hero__inner > *:nth-child(2) { animation-delay: .15s; }
.hero--video-center .hero__inner > *:nth-child(3) { animation-delay: .25s; }
.hero--video-center .hero__inner > *:nth-child(4) { animation-delay: .35s; }
.hero--video-center .hero__inner > *:nth-child(6) { animation-delay: .5s; }

/* Cards: hover lift */
.card { transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-6px); box-shadow: 0 22px 44px -18px rgba(11,31,77,.28); border-color: rgba(31,92,255,.35); }

/* Buttons: hover lift */
.btn { transition: transform .2s, box-shadow .25s, background .2s, color .2s; }
.btn:hover { transform: translateY(-2px); text-decoration: none; }
.btn--primary:hover { box-shadow: 0 14px 28px -10px rgba(31,92,255,.65); }

/* Gradient headline text: slow sheen */
.grad {
  background-size: 200% auto;
  animation: grad-sheen 7s linear infinite;
}
@keyframes grad-sheen { to { background-position: 200% center; } }

/* "Learn more" links: animated underline */
.more { position: relative; }
.more::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .28s cubic-bezier(.16,1,.3,1);
}
.more:hover::after { transform: scaleX(1); }

/* Header: shadow once scrolled (JS toggles .scrolled) */
.site-header { transition: box-shadow .3s, background .3s; }
.site-header.scrolled { box-shadow: 0 8px 28px -12px rgba(11,31,77,.25); }

/* Smooth anchor scrolling */
html { scroll-behavior: smooth; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .saiyo-float, .saiyo-float-soft, .saiyo-drift, .saiyo-pop,
  .saiyo-marquee__track, .grad, .saiyo-cta::before,
  .hero--video-center .hero__inner > * { animation: none !important; }
  .card:hover, .btn:hover { transform: none; }
}
