:root {
  --sky-900: #0B4FC4;
  --sky-700: #1570EF;
  --sky-500: #4A93F7;
  --sky-300: #9CC4FF;
  --lilac-200: #D9CCFF;
  --lilac-100: #F1EBFF;
  --cloud: #FFFFFF;
  --cloud-shade: #E4ECFA;
  --ink: #0E2350;
  --ship-red: #E8333A;
  --gold: #FFC53D;
  --ocean: #1EC3F0;
  --display: "Fredoka", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--lilac-100);
  overflow-x: clip; /* decorative clouds bleed past the edges */
}
img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.05; }
h2 { font-size: clamp(30px, 4vw, 48px); color: var(--sky-700); }
.label {
  font-family: var(--body); font-weight: 800; font-size: 13px;
  letter-spacing: .2em; color: var(--sky-500); margin: 0 0 8px;
}

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background:
    url("../img/sky.jpg") center / cover no-repeat,
    linear-gradient(#0B4FC4 0%, #1570EF 30%, #4A93F7 60%, #9CC4FF 80%, #D9CCFF 100%);
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center; /* keep title, scene and CTA together on tall/wide screens */
  row-gap: 4px;
  grid-template-columns: minmax(0, 1fr); /* keep the oversized mobile scene from widening the column */
  justify-items: center;
  padding: 28px 16px 210px; /* room for the cloud bank overlap */
}

.hero-clouds { position: absolute; inset: 0; pointer-events: none; }
.cloud { position: absolute; will-change: transform; }
.c1 { width: 26vw; left: -5vw;  top: 6%; }
.c2 { width: 18vw; right: -3vw; top: 4%; }
.c3 { width: 10vw; left: 18vw;  top: 58%; opacity: .9; }
.c4 { width: 34vw; left: -10vw; bottom: -6%; }
.c5 { width: 30vw; right: -8vw; bottom: -4%; }
.c6 { width: 9vw;  right: 13vw; top: 50%; opacity: .9; }
.c7 { width: 15vw; left: 5vw;   top: 68%; }
.c8 { width: 7vw;  left: 24vw;  top: 3%;  opacity: .7; }

.marquee {
  position: absolute; left: 0; right: 0; top: 34%;
  overflow: hidden; pointer-events: none; white-space: nowrap;
}
.marquee-track { display: inline-flex; will-change: transform; }
.marquee span {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(110px, 17vw, 300px); line-height: 1;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 255, 255, .45);
  padding-right: .3em;
}

.hero-title { position: relative; z-index: 3; text-align: center; color: #fff; }
.hero-logo { margin: 0 auto 10px; width: 72px; height: auto; }
.hero-title h1 { font-size: clamp(34px, 4.4vw, 64px); font-weight: 600; text-shadow: 0 4px 24px rgba(11, 79, 196, .35); }
.hero-title p { font-weight: 600; font-size: clamp(16px, 1.5vw, 21px); opacity: .9; margin: 10px 0 0; }

/* Scene: every layer is placed in % of this box (A2 mockup proportions) */
.scene {
  position: relative; z-index: 2;
  /* Height-capped so title, scene and CTA all fit in one screen */
  width: min(1300px, 94vw, (100svh - 400px) * 1.65);
  aspect-ratio: 1400 / 740;
  margin-bottom: 4%;
  align-self: center;
}
.scene-bob { position: absolute; inset: 0; }
.scene::before { /* soft light behind the island */
  content: ""; position: absolute; left: 5%; right: 5%; top: 15%; bottom: -15%;
  background: radial-gradient(closest-side, rgba(255,255,255,.5), transparent);
}
.l { position: absolute; height: auto; user-select: none; -webkit-user-drag: none; }
.island     { left: 11.8%; top: 52%; width: 74%; }
.flag       { left: 15%;   top: 37%; width: 12%; }
.cabinet    { left: 47%;   top: 0%;  width: 28%; cursor: pointer; }
.crate-r    { left: 67%;   top: 54%; width: 11%; }
.mascot     { left: 26%;   top: 14%; width: 25%; cursor: pointer; transform-origin: 50% 90%; }
.crate-l    { left: 20%;   top: 55%; width: 9.6%; }
.cannonball { left: 3%;    top: 24%; width: 8.5%; }
.coin       { left: 85%;   top: 32%; width: 8%; }
.s1 { left: 76%; top: 30%; width: 4.2%; }
.s2 { left: 6%;  top: 55%; width: 4.8%; }
.s3 { left: 19%; top: 26%; width: 3.4%; }
.s4 { left: 80%; top: 50%; width: 3.6%; }

/* Glows and trails around the floating objects */
.cabinet { filter: drop-shadow(0 0 28px rgba(30,195,240,.35)); }
.coin { filter: drop-shadow(0 0 16px rgba(255,197,61,.75)); }
.spark { filter: drop-shadow(0 0 10px rgba(255,255,255,.95)); }
.cannonball { isolation: isolate; }
.cannonball img { width: 100%; filter: drop-shadow(0 0 14px rgba(255,197,61,.5)); }
.cannonball .trail {
  position: absolute; right: 45%; top: 42%; width: 150%; height: 34%; z-index: -1;
  border-radius: 999px; transform: rotate(-32deg); transform-origin: right center;
  background: linear-gradient(to left, rgba(255,225,150,.95), rgba(255,170,90,.35) 50%, transparent);
  filter: blur(5px);
}

.scene3d {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; transition: opacity .6s;
  pointer-events: none; /* clicks are raycast from the scene so 2D layers stay clickable */
}

.hero-cta { position: relative; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn-play {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-weight: 600; font-size: 22px; color: #fff; text-decoration: none;
  padding: 16px 40px; border-radius: 999px;
  background: linear-gradient(#F2545A, var(--ship-red));
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.15), inset 0 2px 0 rgba(255,197,61,.55), 0 10px 30px rgba(232,51,58,.4);
  transition: transform .15s;
}
.btn-play:hover { transform: translateY(-2px) scale(1.03); }
.link-games { color: #fff; font-weight: 800; font-size: 15px; text-decoration: none; opacity: .9; }

.side-nav {
  position: absolute; z-index: 7; left: 40px; bottom: 170px; /* above and clear of the cloud bank */
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.side-nav a { color: #fff; font-weight: 800; text-decoration: none; position: relative; }
.side-nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 6px; height: 6px;
  margin-top: -3px; border-radius: 50%; background: #fff;
}
.purr {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border: 0; border-radius: 999px;
  background: #fff; color: var(--sky-700); font: 800 13px var(--body); cursor: pointer;
}
.purr-knob {
  width: 26px; height: 26px; border-radius: 50%; background: var(--sky-700);
  display: grid; place-items: center; font-size: 13px; transition: transform .25s;
}
.purr[aria-pressed="false"] { background: rgba(255,255,255,.55); }
.purr[aria-pressed="false"] .purr-knob { background: #8aa6d6; filter: grayscale(1); }

.menu-btn { display: none; }

.wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 90px; z-index: 6; fill: var(--lilac-100); }

/* Cloud bank between hero and sections */
.cloud-bank {
  --h: clamp(130px, 17vw, 260px);
  position: relative; z-index: 6; height: var(--h); margin-top: calc(var(--h) * -0.62);
  pointer-events: none; overflow-x: clip;
}
.cloud-bank::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42%; background: var(--lilac-100); }
.cloud-bank img { position: absolute; bottom: 18%; max-width: none; }
.b1 { left: -8%; width: 32%; }
.b2 { left: 17%; width: 24%; bottom: 24%; }
.b3 { left: 34%; width: 34%; }
.b4 { left: 60%; width: 24%; bottom: 26%; }
.b5 { left: 76%; width: 34%; }
.b6 { left: 47%; width: 13%; bottom: 52%; opacity: .9; }

/* Decorative clouds drifting in section margins */
.deco {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; transform: translateX(-50%);
  overflow: hidden; pointer-events: none; z-index: -1;
}
.d-cloud { position: absolute; max-width: none; opacity: .85; animation: drift 16s ease-in-out infinite alternate; }
.dl  { left: -9vw;  top: 22%;   width: 22vw; }
.dr  { right: -11vw; top: 52%;  width: 26vw; animation-duration: 20s; }
.dl2 { left: 3vw;   bottom: 2%; width: 11vw; animation-duration: 12s; }
.dl3 { left: -11vw; bottom: 4%; width: 28vw; }
.dr2 { right: -3vw; top: 6%;    width: 14vw; animation-duration: 13s; }
@keyframes drift { to { transform: translateX(36px); } }
@keyframes twinkle { 50% { transform: scale(.7) rotate(15deg); opacity: .6; } }

/* ================= SECTIONS ================= */
.section { max-width: 1200px; margin: 0 auto; padding: 80px 24px; }
.section { position: relative; }
.games { text-align: center; }
.games h2 { margin-bottom: 48px; }
.cards { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; align-items: stretch; padding-bottom: 60px; }
.card {
  position: relative; isolation: isolate; border-radius: 32px; padding: 18px;
  text-align: left;
}
/* Card surface lives on ::before so the cloud (z -2) can sit behind it inside the card's stacking context */
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: #fff; box-shadow: 0 18px 40px rgba(21, 112, 239, .14), 0 3px 0 var(--cloud-shade);
}
.card-cloud {
  position: absolute; left: -14%; width: 128%; max-width: none; bottom: -64px; z-index: -2;
  pointer-events: none;
}
.card-spark {
  position: absolute; top: -20px; right: -16px; width: 46px;
  filter: drop-shadow(0 0 10px rgba(255,140,198,.8)); animation: twinkle 2.2s ease-in-out infinite;
}
.card-art { border-radius: 22px; overflow: hidden; background: var(--ocean); aspect-ratio: 6 / 5; }
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 6px 6px; }
.card h3 { font-size: 28px; color: var(--sky-700); }
.card p { line-height: 1.55; margin: 10px 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chips span {
  font-weight: 800; font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--lilac-100); color: var(--sky-700);
}
.card-privacy { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 800; color: #8f86b8; }
.store-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.play-badge {
  display: inline-flex; flex-direction: column; padding: 8px 18px; border-radius: 10px;
  background: #000; color: #fff; text-decoration: none; font: 600 20px/1 var(--body);
}
.play-badge.is-soon { opacity: .55; cursor: default; }
.play-badge small { font-size: 10px; letter-spacing: .05em; margin-bottom: 3px; }

.card-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 320px;
}
.card-soon::before { background: rgba(255,255,255,.6); backdrop-filter: blur(6px); }
.soon-cat { width: 120px; filter: brightness(0) invert(60%) sepia(40%) hue-rotate(200deg) saturate(250%); opacity: .55; }
.zz { font-family: var(--display); font-weight: 700; font-size: 22px; color: #a99be8; margin: -70px 0 40px 130px; }
.card-soon h3 { color: #9a8ed6; font-size: 22px; margin-top: 18px; }
.card-soon p { color: #8f86b8; margin: 8px 0 0; }

.about { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-text p { font-size: 18px; line-height: 1.65; color: #4b4f8a; }
.about-text h2 { margin-bottom: 18px; }
.about-art { position: relative; }
.sleepy { width: min(460px, 100%); margin: 0 auto; }
.snore { position: absolute; right: 16%; top: 0; font: 700 30px var(--display); color: #9a8ed6; }
.snore i { display: inline-block; font-style: normal; animation: snore 2.4s ease-in-out infinite; }
.snore i:nth-child(2) { font-size: 1.3em; animation-delay: .4s; }
.snore i:nth-child(3) { font-size: 1.7em; animation-delay: .8s; }
@keyframes snore { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(-10px); opacity: 1; } }
.a-spark { position: absolute; filter: drop-shadow(0 0 10px rgba(255,255,255,.95)); animation: twinkle 2.6s ease-in-out infinite; }
.as1 { left: 4%;  top: 32%; width: 46px; }
.as2 { right: 4%; top: 18%; width: 40px; animation-delay: .6s; }
.as3 { right: 2%; top: 64%; width: 30px; animation-delay: 1.1s; }
.as4 { left: 14%; bottom: 8%; width: 32px; animation-delay: 1.6s; }

.contact {
  position: relative; text-align: center; color: #fff;
  background: linear-gradient(var(--sky-700), var(--sky-500));
  padding: 130px 16px 40px; margin-top: 40px; overflow: hidden;
}
.foot-cloud { position: absolute; bottom: -40px; max-width: none; pointer-events: none; }
.fl { left: -7vw; width: 26vw; }
.fr { right: -9vw; width: 30vw; }
.footer { position: relative; z-index: 1; }
.contact .label { color: rgba(255,255,255,.75); }
.contact h2 { color: #fff; }
.contact > p { font-size: 18px; opacity: .9; }
.wave-top { top: -1px; bottom: auto; }
.email-pill {
  display: inline-block; margin: 14px 0 50px; padding: 16px 30px; border-radius: 999px;
  background: #fff; color: var(--sky-700); font: 800 19px var(--body); text-decoration: none;
  box-shadow: 0 10px 30px rgba(11,79,196,.3);
}
.footer img { margin: 0 auto 10px; }
.footer p { font-size: 14px; opacity: .85; }

/* ================= MOBILE ================= */
@media (max-width: 760px) {
  .hero { padding-top: 76px; padding-bottom: 130px; } /* clear the menu button and cloud bank */
  .c6, .c7, .c8 { display: none; }
  .cloud-bank img { width: 55%; }
  .b1 { left: -20%; } .b2 { display: none; } .b3 { left: 22%; } .b4 { display: none; } .b5 { left: 62%; } .b6 { display: none; }
  .dl, .dr { width: 45vw; } .dl3 { width: 60vw; } .dr2 { width: 30vw; }
  .fl { width: 50vw; } .fr { width: 56vw; }
  .card-cloud { bottom: -48px; }
  .marquee { top: 40%; }
  .scene { width: 135vw; }  /* let the island bleed past the edges */
  .s3, .s4, .coin { display: none; }
  .btn-play { font-size: 19px; padding: 15px 30px; }
  /* Keep clouds away from the white title text */
  .c1 { width: 50vw; left: -18vw; top: 26%; } .c2, .c3 { display: none; }
  .c4 { width: 70vw; } .c5 { width: 60vw; }

  .menu-btn {
    display: grid; place-items: center; position: absolute; z-index: 7; top: 16px; right: 16px;
    width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.25);
    backdrop-filter: blur(6px); cursor: pointer;
  }
  .menu-btn img { width: 30px; }
  .side-nav {
    position: fixed; inset: 0; left: 0; bottom: 0; justify-content: center; align-items: center;
    gap: 22px; background: rgba(21,112,239,.96); font-size: 26px;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .side-nav.open { opacity: 1; pointer-events: auto; }
  .side-nav a.active::before { display: none; }
  .hero-logo { display: none; }

  .cards { grid-template-columns: 1fr; gap: 40px; }
  .card-soon { min-height: 220px; }
  .about { grid-template-columns: 1fr; }
  .about-art { order: -1; }
  .sleepy { width: 70%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .d-cloud, .card-spark, .snore i, .a-spark { animation: none; }
}
