/* Moon Games studio site */

:root {
  color-scheme: dark;
  --bg-950: #060913;
  --bg-900: #0a1020;
  --bg-850: #0d142b;
  --bg-800: #121b3a;
  --ink: #eaefff;
  --muted: #9aa5c9;
  --faint: #7e88ad;
  --accent: #7c68f2;
  --accent-soft: #a5a1fa;
  --lavender: #c7c4fd;
  --moon: #ecd9a9;
  --moon-bright: #f8efdb;
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-950);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg-900); }
::-webkit-scrollbar-thumb {
  background: #262c55;
  border-radius: 999px;
  border: 2px solid var(--bg-900);
}
::-webkit-scrollbar-thumb:hover { background: #35407a; }

a { -webkit-tap-highlight-color: transparent; }

:where(a, button, summary, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

img, svg { max-width: 100%; }

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Starfield canvas ─────────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

/* ── Type ─────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.5rem, 6.5vw, 4.35rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 22px;
  text-wrap: balance;
}

h2 { text-wrap: balance; }

h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1.15;
  margin-top: 14px;
}

h3 { font-size: 1.05rem; }

.text-gradient {
  background-image: linear-gradient(118deg, #efe9ff 0%, #b6b0fc 45%, #7c68f2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.body-copy { color: var(--muted); }
.body-copy p { margin: 16px 0 0; }
p.body-copy { margin: 16px 0 0; }

/* ── Nav ──────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 22, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(165, 161, 250, 0.08);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav.scrolled {
  background: rgba(7, 10, 22, 0.82);
  border-bottom-color: rgba(165, 161, 250, 0.16);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark { width: 30px; height: 30px; }

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  color: var(--ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-links a:hover { color: var(--ink); }

.nav-links .nav-cta {
  color: var(--lavender);
  border: 1px solid rgba(199, 196, 253, 0.28);
  padding: 8px 16px;
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.nav-links .nav-cta:hover {
  border-color: rgba(199, 196, 253, 0.55);
  background: rgba(124, 104, 242, 0.12);
  color: #fff;
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  align-items: center;
  gap: 48px;
  min-height: calc(88vh - 68px);
  padding-top: 72px;
  padding-bottom: 88px;
}

.hero-sub {
  max-width: 34rem;
  margin: 22px 0 0;
  font-size: 1.13rem;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.3s ease,
    border-color 0.3s ease, background 0.3s ease;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #8873f7 0%, #5b48d9 100%);
  box-shadow: 0 14px 40px -14px rgba(124, 104, 242, 0.65);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px -14px rgba(124, 104, 242, 0.85);
}

.btn-ghost {
  color: var(--lavender);
  border: 1px solid rgba(199, 196, 253, 0.3);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(199, 196, 253, 0.6);
  background: rgba(124, 104, 242, 0.1);
}

/* ── Moon scene ───────────────────────────────────────────── */
.moon-scene {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 1;
  margin: 0 auto;
  animation: float 8s ease-in-out infinite;
}

.moon-halo {
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 217, 169, 0.32) 0%, rgba(124, 104, 242, 0.16) 45%, transparent 70%);
  filter: blur(24px);
  animation: pulseGlow 5s ease-in-out infinite;
}

.moon {
  position: relative;
  display: block;
  width: 76%;
  margin: 12% auto 0;
  filter: drop-shadow(0 0 60px rgba(236, 217, 169, 0.35));
}

.orbit-ring {
  position: absolute;
  inset: 2.5%;
  border-radius: 50%;
  border: 1px dashed rgba(199, 196, 253, 0.22);
}

.orbit {
  position: absolute;
  inset: 2.5%;
  animation: orbit 44s linear infinite;
}

.satellite {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 999px;
  background: var(--moon-bright);
  box-shadow: 0 0 12px 3px rgba(236, 217, 169, 0.6);
}

.sparkle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--lavender);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 3.4s ease-in-out infinite;
}

.sparkle.s1 { top: 9%; right: 14%; }
.sparkle.s2 { bottom: 13%; left: 7%; width: 7px; height: 7px; animation-delay: 1.1s; }
.sparkle.s3 { top: 34%; left: -2%; width: 6px; height: 6px; animation-delay: 2.2s; }

/* ── Decorative backdrops ─────────────────────────────────── */
.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  will-change: transform;
}

.blob-indigo {
  top: -180px;
  left: -140px;
  width: 560px;
  height: 560px;
  background: rgba(46, 36, 112, 0.55);
  animation: drift 24s ease-in-out infinite;
}

.blob-violet {
  top: 10%;
  right: -160px;
  width: 480px;
  height: 480px;
  background: rgba(124, 104, 242, 0.22);
  animation: drift 30s ease-in-out infinite reverse;
}

.blob-gold {
  bottom: -220px;
  right: -140px;
  width: 460px;
  height: 460px;
  background: rgba(236, 217, 169, 0.1);
}

.grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(124, 104, 242, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124, 104, 242, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 5%, transparent 75%);
  mask-image: radial-gradient(ellipse 75% 60% at 50% 0%, #000 5%, transparent 75%);
}

/* ── Sections ─────────────────────────────────────────────── */
.section {
  position: relative;
  padding: 104px 0;
}

.studio-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 60px;
  align-items: center;
}

.studio-copy { max-width: 42rem; }

.studio-copy .body-copy p {
  font-size: 1.08rem;
  line-height: 1.75;
}

/* ── Meteor scene ─────────────────────────────────────────── */
.meteor-scene {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1;
  margin: 0 auto;
  animation: meteorFloat 7s ease-in-out infinite;
}

.meteor-halo {
  position: absolute;
  inset: -10%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 62%, rgba(247, 201, 75, 0.22) 0%, rgba(224, 80, 58, 0.14) 45%, transparent 72%);
  filter: blur(26px);
  animation: pulseGlow 4.5s ease-in-out infinite;
}

.meteor {
  position: relative;
  display: block;
  width: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 42px rgba(242, 140, 51, 0.26));
}

.meteor .flame {
  transform-box: fill-box;
  transform-origin: 10% 50%;
}

.meteor .flame-outer { animation: flick 1.15s ease-in-out infinite alternate; }
.meteor .flame-mid { animation: flick 0.85s ease-in-out 0.2s infinite alternate-reverse; }
.meteor .flame-core { animation: flick 0.7s ease-in-out 0.1s infinite alternate; }
.meteor .flame-glow { animation: flick 0.6s ease-in-out infinite alternate-reverse; }

.meteor .flame-bit {
  transform-box: fill-box;
  transform-origin: center;
}

.meteor .b1 { animation: bitFlick 1.3s ease-in-out infinite; }
.meteor .b2 { animation: bitFlick 1.1s ease-in-out 0.4s infinite; }
.meteor .b3 { animation: bitFlick 1.5s ease-in-out 0.7s infinite; }

.meteor .ember {
  transform-box: fill-box;
  transform-origin: center;
}

.meteor .e1 { animation: emberFly 2.4s linear infinite; }
.meteor .e2 { animation: emberFly 3s linear 0.8s infinite; }
.meteor .e3 { animation: emberFly 2.7s linear 1.5s infinite; }

.meteor-scene .sparkle.s1 { top: 7%; right: 5%; }
.meteor-scene .sparkle.s2 { bottom: 10%; left: 46%; }
.meteor-scene .sparkle.s3 { top: 38%; left: 5%; }

/* ── In the works ─────────────────────────────────────────── */
.works-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid rgba(165, 161, 250, 0.16);
  background: linear-gradient(135deg, rgba(18, 27, 58, 0.85) 0%, rgba(10, 16, 32, 0.85) 100%);
  box-shadow: 0 0 0 1px rgba(165, 161, 250, 0.05), 0 30px 90px -40px rgba(124, 104, 242, 0.5);
  padding: clamp(28px, 5vw, 56px);
}

.works-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 48px;
  align-items: center;
}

.works-inner .body-copy { max-width: 34rem; }

.beta-box {
  border: 1px solid rgba(165, 161, 250, 0.16);
  background: rgba(6, 9, 19, 0.55);
  border-radius: 18px;
  padding: 30px 28px;
}

.beta-box h3 { font-size: 1.15rem; }

.beta-box p {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

.beta-box .field { margin: 20px 0 16px; }

.beta-box .btn {
  width: 100%;
  justify-content: center;
  border: 0;
  cursor: pointer;
}

.beta-box .form-note { margin-top: 14px; text-align: center; }

.beta-success { text-align: center; padding: 10px 0 6px; }

.beta-success h3 { margin-top: 14px; }

.beta-success p { color: var(--muted); }

/* ── Contact ──────────────────────────────────────────────── */
.anchor-alias {
  position: absolute;
  top: 0;
}

.contact-head { max-width: 36rem; }
.contact-lede { margin-top: 14px; }

.contact-form {
  max-width: 620px;
  margin-top: 38px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--lavender);
}

.field input,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: rgba(6, 9, 19, 0.6);
  border: 1px solid rgba(165, 161, 250, 0.2);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(165, 161, 250, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 104, 242, 0.18);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin-top: 6px;
}

.form-actions .btn { border: 0; cursor: pointer; }

.form-note {
  margin: 0;
  font-size: 0.88rem;
  color: var(--faint);
}

.form-note a {
  color: var(--accent-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(165, 161, 250, 0.35);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.form-note a:hover {
  color: var(--lavender);
  border-color: rgba(199, 196, 253, 0.6);
}

.form-success {
  max-width: 620px;
  margin-top: 38px;
  padding: 40px 32px;
  text-align: center;
  border: 1px solid rgba(165, 161, 250, 0.2);
  border-radius: 18px;
  background: rgba(13, 20, 43, 0.55);
  box-shadow: 0 30px 80px -40px rgba(124, 104, 242, 0.5);
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  color: var(--moon);
  background: rgba(236, 217, 169, 0.1);
  border: 1px solid rgba(236, 217, 169, 0.35);
}

.success-icon svg { width: 24px; height: 24px; }

.form-success h3 {
  margin-top: 16px;
  font-size: 1.25rem;
}

.form-success p {
  margin: 10px 0 0;
  color: var(--muted);
}

.form-success .form-note { margin-top: 16px; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
  border-top: 1px solid rgba(165, 161, 250, 0.1);
  background: rgba(6, 9, 19, 0.7);
  padding: 48px 0 30px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.footer-address h4 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer-address address {
  font-style: normal;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.footer-links a:hover { color: var(--ink); }

.footer-base {
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(165, 161, 250, 0.08);
}

.footer-base p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--faint);
}

/* ── Legal pages ──────────────────────────────────────────── */
.page-head {
  position: relative;
  overflow: hidden;
  padding: 84px 0 56px;
}

.page-head .updated {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--faint);
}

.prose-legal {
  max-width: 46rem;
  padding-bottom: 110px;
  color: var(--muted);
  line-height: 1.75;
}

.prose-legal h2 {
  font-size: 1.3rem;
  margin-top: 44px;
  margin-bottom: 12px;
  scroll-margin-top: 96px;
}

.prose-legal p { margin: 0 0 16px; }

.prose-legal ul {
  margin: 8px 0 20px;
  padding-left: 20px;
}

.prose-legal li { margin-bottom: 7px; }

.prose-legal a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose-legal a:hover { color: var(--lavender); }

.prose-legal strong { color: var(--ink); font-weight: 600; }

.prose-legal address {
  font-style: normal;
  line-height: 1.7;
}

/* ── Reveal on scroll ─────────────────────────────────────── */
.reveal { opacity: 0; }

.reveal.in-view {
  animation: fadeUp 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

.reveal.d-1.in-view { animation-delay: 0.08s; }
.reveal.d-2.in-view { animation-delay: 0.16s; }
.reveal.d-3.in-view { animation-delay: 0.24s; }
.reveal.d-4.in-view { animation-delay: 0.32s; }

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.05); }
}

@keyframes orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(4%, -4%, 0) scale(1.08); }
  66% { transform: translate3d(-4%, 4%, 0) scale(0.95); }
}

@keyframes meteorFloat {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-9px, 9px); }
}

@keyframes flick {
  from { transform: scale(1, 1); }
  to { transform: scale(1.04, 0.95) rotate(0.9deg); }
}

@keyframes bitFlick {
  0%, 100% { opacity: 0.45; transform: translate(0, 0) scale(0.92); }
  50% { opacity: 1; transform: translate(3px, -2px) scale(1.06); }
}

@keyframes emberFly {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 0.95; }
  100% { transform: translate(30px, -8px); opacity: 0; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 920px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    min-height: 0;
    padding-top: 44px;
    padding-bottom: 48px;
  }

  .moon-scene {
    width: min(50vw, 240px);
    margin-top: 0;
  }

  .moon-scene .moon {
    width: 86%;
    margin-top: 7%;
  }

  .studio-grid { grid-template-columns: 1fr; gap: 30px; }

  .meteor-scene {
    order: 1;
    width: min(56vw, 260px);
  }

  .works-inner { grid-template-columns: 1fr; gap: 26px; }
  .section { padding: 60px 0; }
  .footer-inner { flex-direction: column; gap: 24px; }
}

@media (max-width: 560px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.88rem; }
  .nav-links .nav-cta { padding: 7px 14px; }
  .hero-actions { gap: 12px; margin-top: 26px; }
  .hero-actions .btn { padding: 12px 20px; font-size: 0.9rem; }
  .hero-sub { font-size: 1.05rem; margin-top: 16px; }
  .section { padding: 52px 0; }
  .studio-copy .body-copy p { font-size: 1.02rem; }
  .contact-form { margin-top: 28px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-success { padding: 32px 22px; }
  .works-card { border-radius: 20px; }
  .beta-box { padding: 24px 20px; }
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; }
  .satellite { display: none; }
}
