/* Ape vs Alien page. Colours and fonts come from the game itself. CHANGE PER GAME: the fonts and tokens below. */
@font-face {
  font-family: 'Galaxy Monkey';
  src: url('fonts/galaxy-monkey.woff2') format('woff2');
  font-display: swap;
}
@font-face { font-family: 'Roboto'; src: url('fonts/roboto-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('fonts/roboto-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Roboto'; src: url('fonts/roboto-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --sky-top: #02024a;
  --sky-mid: #1f1052;
  --sky-bottom: #55245a;
  --ape: #a97b4f;
  --ape-dark: #5b3b22;
  --alien: #86d61e;
  --alien-dark: #2b5945;
  --vs: #f26b1d;
  --ink: #0a0650;
  --text: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.78);
  --font-display: 'Galaxy Monkey', 'Arial Black', sans-serif;
  --font-body: 'Roboto', 'Segoe UI', Arial, sans-serif;
  --band: #120c46;
  --wrap: 1080px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--sky-top);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* ===== SKY (fixed behind everything) ===== */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 100%);
}
.sparkles { position: absolute; inset: 0; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.sky { overflow: hidden; }
.sparkle {
  position: absolute;
  width: var(--s, 10px);
  height: var(--s, 10px);
  background: #fff;
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  opacity: 0.85;
  animation: twinkle var(--d, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}
@keyframes twinkle {
  from { opacity: 0.25; transform: scale(0.7); }
  to { opacity: 0.95; transform: scale(1); }
}

main, .topbar, .footer { position: relative; z-index: 1; }

/* ===== TOP BAR (stays at the top; gets a dark background once you scroll) ===== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.topbar.scrolled {
  background: rgba(4, 3, 38, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}
.studio-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-soft);
  transition: color 0.2s, background 0.2s;
}
.studio-link:hover, .studio-link:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.08); }
.studio-link img { width: auto; height: 28px; }
.menu { display: flex; gap: 6px; }
.menu a {
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: color 0.2s, background 0.2s;
}
.menu a:hover, .menu a:focus-visible { color: #fff; background: rgba(255, 255, 255, 0.1); }
.menu { align-items: center; }
.menu-cta {
  margin-left: 10px;
  padding: 8px 17px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  background: transparent;
  color: #fff;
  font: 500 15px var(--font-body);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.menu-cta:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.menu-cta:focus-visible { outline: 3px solid #ffd23a; outline-offset: 3px; }
.device[data-get-game] { cursor: pointer; }
.device[data-get-game]:focus-visible { outline: 3px solid #ffd23a; outline-offset: 6px; }

/* "Get the game" pop-up */
.get-dialog {
  margin: auto;
  width: min(440px, calc(100vw - 32px));
  padding: 44px 32px 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #12105a 0%, #2a1452 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.get-dialog::backdrop { background: rgba(2, 1, 25, 0.8); }
.get-dialog .get-icon { width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 20px; }
.get-dialog h2 { font-size: 28px; margin-bottom: 10px; }
.get-dialog p { color: var(--text-soft); font-size: 16px; }
.get-dialog .store-buttons { flex-direction: column; align-items: center; margin-top: 24px; }
.get-dialog .store-badge img { height: 58px; }
.get-dialog .get-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; transform: none; }
section[id] { scroll-margin-top: 70px; }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px 24px 100px;
  overflow-x: clip;
}
/* The flight area reaches a bit below the hero, so the bottom pass can fly under the buttons */
.flight { position: absolute; inset: 0 0 -170px 0; z-index: 1; pointer-events: none; overflow: hidden; }
.ship {
  position: absolute;
  top: 0; left: 0;
  width: clamp(90px, 11vw, 150px);
  will-change: transform;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}
/* Before the script runs (or with reduced motion): park the ships on either side */
.ship-alien { transform: translate(calc(100vw - 100% - 6vw), 14vh); }
.ship-ape { transform: translate(6vw, 74vh); }
/* While flying, the script moves the ships; this resets the parked position */
.hero.chasing .ship { transform: translateX(-300px); }
.laser {
  position: absolute;
  top: 0; left: 0;
  width: 46px;
  height: 4px;
  border-radius: 2px;
  pointer-events: none;
}
.laser-ape { background: #8fd3ff; box-shadow: 0 0 10px #4fb4ff; }
.laser-alien { background: #ffd23a; box-shadow: 0 0 10px #ffb400; }

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1440px;
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(40px, 5vw, 96px);
}
.hero-copy { text-align: left; max-width: 460px; }
.game-logo img {
  width: min(300px, 24vw, 36vh);
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.45));
  animation: logoIn 0.9s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.6) rotate(-4deg); }
  to { opacity: 1; transform: none; }
}
.hook {
  margin-top: 26px;
  font-weight: 700;
  font-size: clamp(20px, 1.7vw, 24px);
  line-height: 1.3;
  text-wrap: balance;
  color: #ffd23a;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}
.pitch {
  margin-top: 12px;
  max-width: 40ch;
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.sub {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--text-soft);
}
.hero-copy .store-buttons { justify-content: flex-start; margin-top: 28px; }

/* Soft light behind the phone so it stands out from the sky */
.hero-device { position: relative; }
.hero-device::before {
  content: '';
  position: absolute;
  inset: -12% -8%;
  background: radial-gradient(closest-side, rgba(120, 90, 255, 0.35), rgba(120, 90, 255, 0) 70%);
  pointer-events: none;
}

/* The game's home screen in a phone, with the ape's ship hovering on it */
.device {
  position: relative;
  border: 12px solid #0b0a1c;
  border-radius: 36px;
  overflow: hidden;
  background: linear-gradient(180deg, #00004a 0%, #24104f 50%, #582853 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 30px 70px rgba(0, 0, 0, 0.5);
}
.device-stars { position: absolute; top: 0; bottom: 0; left: 0; width: 200%; animation: drift 16s linear infinite; }
.device-stars .sparkle { opacity: 0.8; }
.device-screen { position: relative; width: 100%; }
.device-video { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 720; background: #02024a; }
.device-ship {
  position: absolute;
  left: 38.5%;
  top: 54%;
  width: 24.8%;
  transform: translateY(-50%);
  animation: hover 2.8s ease-in-out infinite;
}
@keyframes hover {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(-64%); }
}

/* ===== STORE BADGES ===== */
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}
/* Official Google Play and App Store badges, shown at the same height (Apple and Google ask for this) */
.store-badge {
  display: inline-block;
  border-radius: 9px;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.store-badge img { height: 54px; width: auto; }
.store-badge:hover { transform: translateY(-2px); filter: brightness(1.15); }
.store-badge:active { transform: translateY(1px); }
.store-badge:focus-visible { outline: 3px solid var(--alien); outline-offset: 4px; }
/* Show only the right store on phones (page.js adds the class) */
.is-ios .store-play,
.is-android .store-apple { display: none; }

/* ===== BANDS: full-width darker strips that separate the sections ===== */
.band {
  position: relative;
  background: rgba(2, 1, 30, 0.42);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* ===== HUD NUMBERS ===== */
.hud {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 20px;
  text-align: center;
}
.hud-item strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1;
  color: #ffd23a;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.3);
}
.hud-item span {
  display: block;
  margin-top: 10px;
  font-size: 16px;
  color: var(--text-soft);
}

/* ===== SECTION HEADINGS ===== */
h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
}

/* Corner brackets, like the frames in the game's menus */
.bracket-frame {
  position: relative;
  padding: 14px;
}
.bracket-frame::before,
.bracket-frame::after {
  content: '';
  position: absolute;
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.bracket-frame::before { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.bracket-frame::after { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.bracket-frame > img,
.bracket-frame > video {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* ===== WHAT IS IT ===== */
.intro {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 20px 80px;
  text-align: center;
}
.intro h2 { margin-bottom: 16px; }
.intro p { font-size: 17px; color: var(--text-soft); }

/* ===== TRAILER ===== */
.trailer {
  max-width: 920px;
  margin: 0 auto;
  padding: 90px 20px 100px;
  text-align: center;
}
.trailer h2 { margin-bottom: 28px; }
.trailer video { background: #000; aspect-ratio: 16 / 9; }

/* ===== FEATURES ===== */
.features {
  display: grid;
  gap: 88px;
  padding: 100px max(20px, calc((100% - var(--wrap)) / 2));
}
.feature {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 48px;
  align-items: center;
}
.feature:nth-child(even) { grid-template-columns: 1fr 1.35fr; }
.feature:nth-child(even) .bracket-frame { order: 2; }
.feature-text h2 { margin-bottom: 14px; }
.feature-text p { font-size: 17px; color: var(--text-soft); max-width: 42ch; }

/* ===== MORE BATTLES (full-width band) ===== */
.battles {
  padding: 100px 0 90px;
  text-align: center;
}
.battles-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.battles h2 { margin-bottom: 32px; }
.battle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.battle-grid figure { position: relative; margin: 0; }
.battle-grid img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.battle-grid figcaption {
  position: absolute;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  padding: 5px 18px 4px;
  background: #5b9b30;
  border: 3px solid #8fd05a;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: clamp(14px, 1.5vw, 20px);
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
}
[data-zoom] { cursor: zoom-in; transition: transform 0.2s ease, box-shadow 0.2s ease; }
[data-zoom]:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45); }

/* Full-size screenshot viewer */
.viewer {
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  overflow: visible;
}
.viewer::backdrop { background: rgba(2, 1, 25, 0.88); }
.viewer img {
  width: min(calc(100vw - 180px), 1280px);
  max-height: 84vh;
  object-fit: contain;
  border-radius: 8px;
}
.viewer-btn {
  position: fixed;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: #06052e;
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.viewer-btn:hover { background: #15135a; }
.viewer-btn:focus-visible { outline: 3px solid var(--alien); outline-offset: 3px; }
.viewer-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.viewer-close { top: 18px; right: 18px; }
.viewer-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.viewer-next { right: 18px; top: 50%; transform: translateY(-50%); }
.battle-dots { display: none; }
.battles-more {
  margin-top: 36px;
  font-family: var(--font-display);
  font-size: clamp(18px, 1.8vw, 24px);
  letter-spacing: 0.02em;
  color: #ffd23a;
}
.extras {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 860px;
  margin: 40px auto 0;
}
.extras li {
  padding: 9px 16px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 15px;
}

/* ===== QUESTIONS AND ANSWERS ===== */
.faq { padding: 90px 20px; }
.faq-inner { max-width: 760px; margin: 0 auto; }
.faq h2 { text-align: center; margin-bottom: 32px; }
.faq-item { border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 4px;
  font-weight: 500;
  font-size: 18px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover, .faq-item summary:focus-visible { color: #ffd23a; outline: none; }
.faq-item p { padding: 0 4px 22px; color: var(--text-soft); font-size: 16px; max-width: 62ch; }
.faq-item a { color: var(--alien); }

/* ===== FINAL CALL TO ACTION ===== */
.final {
  text-align: center;
  padding: 100px 20px 120px;
}
.final-ship {
  width: min(260px, 60vw);
  margin: 0 auto 28px;
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.final p { margin-top: 12px; font-size: 17px; color: var(--text-soft); }

/* ===== BACK TO TOP ===== */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 15;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(6, 5, 46, 0.9);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: #15135a; }
.to-top:focus-visible { outline: 3px solid var(--alien); outline-offset: 3px; }
.to-top svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ===== GAME SOCIALS (in the footer) ===== */
.game-socials { margin-bottom: 28px; }
.game-socials p { font-weight: 500; font-size: 15px; color: var(--text-soft); margin-bottom: 14px; }
.game-socials-links { display: flex; justify-content: center; gap: 14px; }
.game-socials-links a {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  transition: background 0.2s, transform 0.2s;
}
.game-socials-links a:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }
.game-socials-links a:focus-visible { outline: 3px solid var(--alien); outline-offset: 3px; }
.game-socials-links svg { width: 22px; height: 22px; fill: currentColor; }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 44px 20px 36px;
  background: rgba(0, 0, 0, 0.22);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin-bottom: 16px;
}
.footer-links a {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.footer-links a:hover, .footer-links a:focus-visible { color: var(--alien); text-decoration: underline; }
.footer .contact { font-size: 14px; color: var(--text-soft); margin-bottom: 10px; }
.footer .contact a { color: var(--alien); }
.footer .copyright { font-size: 12px; color: rgba(255, 255, 255, 0.45); }

/* ===== PHONES ===== */
@media (max-width: 900px) {
  .hero { padding-top: 96px; }
  .hero-inner { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .hero-copy { text-align: center; margin: 0 auto; max-width: 520px; }
  .pitch { margin-left: auto; margin-right: auto; }
  .game-logo img { width: min(280px, 66vw, 34vh); margin: 0 auto; }
  .hero-copy .store-buttons { justify-content: center; }
  .hero-device { max-width: 640px; margin: 0 auto; width: 100%; }
}

@media (max-width: 560px) {
  .studio-link span { display: none; }
  .topbar { padding: 10px 12px; }
  .menu a { display: none; }
  .menu-cta { margin-left: 0; }
  .device { border-width: 6px; border-radius: 18px; }
}

@media (max-width: 760px) {
  .hud { grid-template-columns: repeat(2, 1fr); row-gap: 32px; padding: 44px 20px; }
  .features { gap: 64px; }
  .feature, .feature:nth-child(even) { grid-template-columns: 1fr; gap: 18px; }
  .feature:nth-child(even) .bracket-frame { order: 0; }
  .feature-text { text-align: center; }
  .feature-text p { margin: 0 auto; }
  .topbar { padding: 14px 16px; }
  .store-badge img { height: 56px; }
  .battles { padding: 70px 0 64px; }
  .features { gap: 64px; padding: 70px 20px; }
  .trailer { padding: 70px 20px; }
  .viewer img { width: calc(100vw - 24px); }
  .viewer-prev, .viewer-next { top: auto; bottom: 18px; transform: none; }
  .viewer-prev { left: calc(50% - 60px); }
  .viewer-next { right: calc(50% - 60px); }
  .battles-inner { padding: 0; }
  .battles h2, .extras { padding: 0 20px; }
  .battle-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 20px;
    scroll-padding: 0 20px;
    scrollbar-width: none;
  }
  .battle-grid::-webkit-scrollbar { display: none; }
  .battle-grid figure { flex: 0 0 86%; scroll-snap-align: center; }
  .battle-dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
  .battle-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); transition: background 0.2s, transform 0.2s; }
  .battle-dots span.on { background: #fff; transform: scale(1.2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
