/* =========================================================
   MOJI STUDIOS — /games/ AAA parallax experience
   Scoped under body.games-aaa. Relies on styles.css for
   shared nav/footer/buttons/quest-HUD.
   ========================================================= */

.games-aaa {
  --ga-accent: var(--accent);
  --ga-ink: #1a0f22;
  background: #120a1e;
  color: #fff;
  overflow-x: clip;
}

/* Default state = final visible state (no-JS / reduced-motion friendly) */
.games-aaa [data-reveal] { opacity: 1; transform: none; }

/* Smooth scroll-driven candy background that shifts per chapter */
.ga-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255,255,255,0.18), transparent 60%),
    linear-gradient(180deg, var(--ga-sky-top, #ff9fc6) 0%, var(--ga-sky-bot, #5ec6ff) 100%);
  transition: --ga-sky-top 0.8s linear, --ga-sky-bot 0.8s linear;
}
/* Animatable gradient stops */
@property --ga-sky-top { syntax: '<color>'; inherits: true; initial-value: #ff9fc6; }
@property --ga-sky-bot { syntax: '<color>'; inherits: true; initial-value: #5ec6ff; }
.ga-canvas::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 70% 20%, rgba(255,255,255,0.7), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(255,255,255,0.7), transparent);
  background-size: 100% 100%;
  opacity: 0.5;
}

/* ---------------- HERO ---------------- */
.ga-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
.ga-hero-layers { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.ga-layer { position: absolute; left: 0; right: 0; will-change: transform; }
.ga-layer img, .ga-layer video { image-rendering: pixelated; }

/* Scroll engine writes --sy, mouse engine writes --mx/--my; CSS composes both */
.games-aaa [data-parallax-speed],
.games-aaa [data-mouse-depth] {
  transform: translate3d(var(--mx, 0px), calc(var(--sy, 0px) + var(--my, 0px)), 0);
}

/* Pixel clouds (CSS) */
.ga-cloud {
  position: absolute;
  background:
    radial-gradient(circle at 30% 60%, #fff 18px, transparent 19px),
    radial-gradient(circle at 55% 45%, #fff 26px, transparent 27px),
    radial-gradient(circle at 75% 62%, #fff 20px, transparent 21px);
  width: 220px; height: 90px;
  filter: drop-shadow(0 6px 0 rgba(0,0,0,0.06));
  opacity: 0.95;
}
.ga-cloud-a { top: 16%; left: 8%;  width: 240px; height: 100px; }
.ga-cloud-b { top: 26%; right: 10%; left: auto; width: 180px; height: 74px; }
.ga-cloud-c { top: 44%; left: 22%; width: 140px; height: 58px; opacity: 0.75; }

/* Rolling hills */
.ga-hills { bottom: -2px; height: 38vh; }
.ga-hill {
  position: absolute; bottom: 0; left: -5%; right: -5%;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.ga-hill-back  { height: 30vh; background: #7fd490; bottom: 6vh; opacity: 0.85; }
.ga-hill-mid   { height: 26vh; background: #5bbf7e; bottom: 2vh; }
.ga-hill-front { height: 20vh; background: #46a869; bottom: -2vh; }

.ga-sun {
  top: 12%; left: 50%;
  width: 240px; height: 240px; margin-left: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c2 0%, #ffd84d 55%, #ffb43d 100%);
  box-shadow: 0 0 120px 30px rgba(255,216,77,0.55);
}

.ga-mascot {
  bottom: 6vh; left: 50%;
  width: 180px; margin-left: -90px;
  z-index: 1;
}
.ga-mascot video {
  width: 100%; display: block;
  filter: drop-shadow(0 10px 0 rgba(0,0,0,0.12));
}

/* Hero content */
.ga-hero-content { position: relative; z-index: 2; padding: 6rem 1.5rem 0; max-width: 1100px; }
.ga-kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.22em; text-transform: uppercase;
  background: rgba(26,15,34,0.55); color: #fff;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 999px; padding: 0.45rem 1.1rem;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  margin-bottom: 1.4rem;
}
.ga-hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(3.5rem, 16vw, 11rem);
  line-height: 0.92; letter-spacing: -0.02em;
  margin: 0; color: #fff;
  text-shadow:
    5px 5px 0 var(--ink),
    8px 8px 0 rgba(255,109,181,0.65);
}
.ga-hero-title .ga-line { display: block; overflow: hidden; }
.ga-hero-title .ga-line > span { display: inline-block; }
.ga-hero-sub {
  margin: 1.6rem auto 0; max-width: 620px;
  font-size: 1.15rem; line-height: 1.6;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.ga-hero-cta-row { margin-top: 2rem; display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.ga-scrollcue {
  position: absolute; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.7rem;
  letter-spacing: 0.15em; text-transform: uppercase; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.ga-scrollcue .chev {
  width: 14px; height: 14px;
  border-right: 3px solid #fff; border-bottom: 3px solid #fff;
  transform: rotate(45deg);
  animation: ga-bounce 1.4s ease-in-out infinite;
}
@keyframes ga-bounce { 0%,100% { transform: rotate(45deg) translate(0,0); } 50% { transform: rotate(45deg) translate(4px,4px); } }

/* ---------------- CINEMATIC scroll-scrubbed video intro ---------------- */
.ga-cine { position: relative; height: 300vh; z-index: 1; padding: 0; margin: 0; }
.ga-cine-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #120a1e;
}
.ga-cine-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  background: #120a1e;
  /* Keep the video on its own compositor layer so seek repaints stay cheap */
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}
.ga-cine-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 75% at 50% 42%, rgba(18,10,30,0) 0%, rgba(18,10,30,0.35) 100%),
    linear-gradient(180deg, rgba(18,10,30,0.35) 0%, rgba(18,10,30,0.05) 38%, rgba(18,10,30,0.55) 100%);
}
.ga-cine .ga-hero-content { z-index: 2; will-change: transform, opacity; }
.ga-cine .ga-scrollcue { z-index: 3; }
/* Mobile keeps the tall section + sticky stage so scroll-scrubbing works too.
   Use svh so the section height is stable as the mobile toolbar shows/hides. */
@media (max-width: 720px) {
  .ga-cine { height: 300svh; }
}
@media (prefers-reduced-motion: reduce) {
  /* No scrub for reduced motion — collapse to a single static screen */
  .ga-cine { height: auto; }
  .ga-cine-stage { position: relative; height: 100svh; }
}

/* ---------------- MARQUEE ---------------- */
.ga-marquee {
  position: relative; z-index: 2;
  background: var(--ink); color: #fff;
  border-top: 4px solid var(--ink); border-bottom: 4px solid var(--ink);
  padding: 0.75rem 0; overflow: hidden; white-space: nowrap;
}
.ga-marquee-track { display: inline-block; will-change: transform; }
.ga-marquee-track span {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.15rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0 1.2rem;
}
.ga-marquee-track span:nth-child(even) { color: var(--accent); }
.ga-marquee-track span:nth-child(3n) { color: var(--accent-2); }

/* ---------------- CHAPTERS ---------------- */
.ga-chapter { position: relative; padding: clamp(4rem, 9vw, 9rem) 0; }
.ga-chapter[data-accent="pink"] { --ga-accent: #ff6db5; }
.ga-chapter[data-accent="cyan"] { --ga-accent: #5ec6ff; }
.ga-chapter[data-accent="mint"] { --ga-accent: #7fd490; }

.ga-chapter-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.ga-chapter.is-reversed .ga-chapter-inner { direction: rtl; }
.ga-chapter.is-reversed .ga-chapter-inner > * { direction: ltr; }

/* Sticky visual */
.ga-stage { position: sticky; top: 96px; }
.ga-screen {
  position: relative;
  border: 5px solid var(--ink);
  border-radius: 20px;
  overflow: hidden;
  background: #0a0514;
  box-shadow: 0 16px 0 var(--ink), 0 16px 40px rgba(0,0,0,0.4);
  aspect-ratio: 16 / 11;
}
.ga-screen video, .ga-screen img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; image-rendering: pixelated;
}
.ga-screen-glow {
  position: absolute; inset: -3px; z-index: 2; pointer-events: none;
  border-radius: 20px;
  box-shadow: inset 0 0 60px rgba(255,255,255,0.06);
}
.ga-screen-tag {
  position: absolute; top: 1rem; left: 1rem; z-index: 3;
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: #fff; background: var(--ga-accent);
  border: 3px solid var(--ink); border-radius: 999px;
  padding: 0.4rem 0.85rem; box-shadow: 0 4px 0 var(--ink);
}
.ga-watch {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.8rem; cursor: pointer; border: 0; width: 100%;
  background: linear-gradient(180deg, rgba(10,5,20,0.05), rgba(10,5,20,0.45));
  color: #fff; font-family: var(--font-display); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.9rem;
}
.ga-watch-play {
  width: 74px; height: 74px; border-radius: 50%;
  background: var(--ga-accent); border: 4px solid var(--ink);
  box-shadow: 0 6px 0 var(--ink);
  display: grid; place-items: center; font-size: 1.6rem;
  transition: transform 0.15s ease;
}
.ga-watch:hover .ga-watch-play { transform: scale(1.08) translateY(-2px); }

/* Copy column */
.ga-copy { padding-top: 1rem; }
.ga-chapter-num {
  font-family: var(--font-display); font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ga-accent);
  display: inline-flex; align-items: center; gap: 0.6rem;
  margin-bottom: 1rem;
}
.ga-chapter-num::before {
  content: ""; width: 34px; height: 3px; background: var(--ga-accent); border-radius: 2px;
}
.ga-chapter-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 0.98; margin: 0 0 0.4rem;
  color: #fff;
  text-shadow: 4px 4px 0 var(--ink);
}
.ga-chapter-tagline {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; color: var(--ga-accent); margin: 0 0 1.4rem;
}
.ga-chapter-body { font-size: 1.06rem; line-height: 1.7; color: rgba(255,255,255,0.92); }
.ga-chapter-body a { color: #fff; text-decoration: underline; text-decoration-color: var(--ga-accent); text-underline-offset: 3px; }

/* Stat counters */
.ga-stats { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.8rem 0; }
.ga-stat {
  flex: 1 1 130px;
  background: rgba(255,255,255,0.08);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 0.9rem 1rem; text-align: center;
}
.ga-stat-num {
  font-family: var(--font-display); font-weight: 700; font-size: 2.1rem; line-height: 1;
  color: var(--ga-accent);
}
.ga-stat-label {
  display: block; margin-top: 0.3rem;
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.75); font-weight: 600;
}

/* Feature chips */
.ga-features { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.8rem; padding: 0; list-style: none; }
.ga-features li {
  font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
  background: rgba(255,255,255,0.1); border: 2px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 0.35rem 0.85rem;
}

/* Chunky CTA that depresses */
.ga-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  color: #fff; background: var(--ga-accent);
  border: 4px solid var(--ink); border-radius: 999px;
  padding: 0.8rem 1.6rem; box-shadow: 0 6px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.ga-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); filter: brightness(1.05); }
.ga-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.ga-btn-ghost { background: transparent; color: #fff; }
.ga-cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ---------------- DETAILS (SEO substance) ---------------- */
.ga-details {
  position: relative; z-index: 2;
  background: var(--bg-cream, #fff7e8); color: var(--ink);
  border-top: 5px solid var(--ink);
  padding: clamp(4rem, 8vw, 7rem) 0 5rem;
}
.ga-details-inner { max-width: 920px; margin: 0 auto; padding: 0 1.5rem; }
.ga-details h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.7rem; margin: 2.6rem 0 1rem; color: var(--ink);
}
.ga-details h2:first-of-type { margin-top: 0; }
.ga-details p { line-height: 1.7; font-size: 1.02rem; }
.ga-details a { color: var(--accent); font-weight: 600; }

/* ---------------- FINALE CTA ---------------- */
.ga-finale {
  position: relative; z-index: 2;
  text-align: center; padding: clamp(4rem, 9vw, 8rem) 1.5rem;
  background: var(--ink); color: #fff; overflow: hidden;
}
.ga-finale h2 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.2rem, 7vw, 4.5rem); line-height: 1; margin: 0 0 1.5rem;
  text-shadow: 4px 4px 0 var(--accent);
}
.ga-finale .ga-cta-row { justify-content: center; }

/* ---------------- Reveal animations (progressive enhancement) ---------------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .games-aaa [data-reveal] {
      opacity: 0;
      animation: ga-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
    .games-aaa [data-reveal="line"] > span {
      transform: translateY(110%);
      animation: ga-line-up linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 18%;
    }
  }
}
@keyframes ga-rise { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
@keyframes ga-line-up { to { transform: translateY(0); } }

/* Hero reveal (above the fold — view() entry won't fire here).
   Default = VISIBLE (no-JS / paint-safe). Hidden ONLY when JS confirmed (.ga-js),
   revealed when .ga-ready is added. Critical content never depends on rAF. */
.ga-js .games-aaa .ga-hero-title .ga-line > span { transform: translateY(110%); }
.ga-ready .games-aaa .ga-hero-title .ga-line > span {
  transform: translateY(0);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.ga-js .games-aaa .ga-hero-title .ga-line:nth-child(2) > span { transition-delay: 0.08s; }
.ga-js .games-aaa .ga-hero-content [data-hero-reveal] { opacity: 0; transform: translateY(24px); }
.ga-ready .games-aaa .ga-hero-content [data-hero-reveal] {
  opacity: 1; transform: none;
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.ga-js .games-aaa .ga-hero-content [data-hero-reveal]:nth-of-type(2) { transition-delay: 0.12s; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .ga-chapter-inner { grid-template-columns: 1fr; }
  .ga-chapter.is-reversed .ga-chapter-inner { direction: ltr; }
  .ga-stage { position: relative; top: 0; margin-bottom: 1.5rem; }
}
@media (max-width: 720px) {
  .ga-hero-title { text-shadow: 3px 3px 0 var(--ink), 5px 5px 0 rgba(255,109,181,0.6); }
  .ga-mascot { width: 130px; margin-left: -65px; }
  .ga-marquee-track span { font-size: 0.95rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ga-layer, .ga-marquee-track { transform: none !important; }
  .ga-scrollcue .chev { animation: none; }
  .games-aaa [data-reveal], .games-aaa [data-hero-reveal] { opacity: 1 !important; transform: none !important; }
  .games-aaa .ga-hero-title .ga-line > span { transform: none !important; }
}
