:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7fbfd;
  color: #17324a;
  --ink: #17324a;
  --deep-blue: #24506d;
  --sky: #78c8f5;
  --mint: #52c7a5;
  --sun: #ffe27a;
  --paper: #fff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #f7fbfd;
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid #17324a;
  outline-offset: 3px;
}

.site-header {
  position: absolute;
  z-index: 10;
  top: 0;
  left: 50%;
  display: flex;
  width: min(1120px, 100%);
  align-items: center;
  justify-content: space-between;
  padding: max(14px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  transform: translateX(-50%);
}

.brand {
  display: flex;
  align-items: center;
  color: var(--ink);
  font-size: clamp(0.82rem, 2vw, 1rem);
  font-weight: 900;
  letter-spacing: 0.055em;
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.hero {
  position: relative;
  display: grid;
  min-height: min(780px, 100vh);
  min-height: min(780px, 100svh);
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  align-items: center;
  gap: clamp(20px, 5vw, 72px);
  overflow: hidden;
  padding: max(112px, calc(env(safe-area-inset-top) + 88px)) max(28px, env(safe-area-inset-right)) 72px max(28px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 72% 24%, rgb(255 255 255 / 50%) 0 13%, transparent 13.3%),
    linear-gradient(155deg, #a7e0fa 0%, var(--sky) 55%, #68bddf 100%);
}

.hero::after {
  position: absolute;
  right: -5%;
  bottom: -105px;
  left: -5%;
  height: 190px;
  border-radius: 50% 50% 0 0;
  background: #4eaa91;
  content: "";
}

.hero__copy,
.hero__art {
  position: relative;
  z-index: 2;
}

.hero__copy {
  width: min(620px, 100%);
  justify-self: end;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--deep-blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  text-wrap: balance;
}

h1 {
  max-width: 680px;
  margin: 0;
  color: #fff;
  font-size: clamp(3.3rem, 9vw, 7.4rem);
  font-weight: 950;
  letter-spacing: -0.065em;
  line-height: 0.84;
  text-shadow: 0 6px 0 rgb(36 80 109 / 38%);
}

.hero__subtitle {
  max-width: 600px;
  margin: 28px 0 8px;
  color: var(--ink);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.18;
}

.offline-promise {
  margin: 0 0 28px;
  color: #24506d;
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 650;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.primary-action,
.secondary-action {
  display: inline-grid;
  min-height: 56px;
  place-items: center;
  border-radius: 14px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary-action {
  padding: 14px 24px;
  border: 3px solid #fff;
  background: var(--sun);
  color: #10243a;
  font-size: clamp(0.92rem, 2vw, 1.08rem);
  box-shadow: 0 7px 0 #c89531, 0 14px 28px rgb(36 80 109 / 22%);
}

.primary-action:hover {
  background: #ffeb99;
  transform: translateY(-1px);
}

.primary-action:active {
  box-shadow: 0 3px 0 #c89531;
  transform: translateY(4px);
}

.standalone-play {
  width: min(100%, 380px);
  min-height: 64px;
  padding: 16px 30px;
  font-size: clamp(1rem, 2.5vw, 1.22rem);
}

.secondary-action {
  min-width: 112px;
  padding: 14px 22px;
  border: 2px solid rgb(255 255 255 / 82%);
  background: rgb(36 80 109 / 18%);
  color: #fff;
}

.installed-status {
  display: inline-flex;
  margin: 16px 0 0;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgb(255 255 255 / 75%);
  color: #1b5f4c;
  font-size: 0.84rem;
  font-weight: 900;
}

.installation-complete {
  max-width: 560px;
  margin: 18px 0 0;
  padding: 13px 16px;
  border: 2px solid rgb(255 255 255 / 72%);
  border-radius: 14px;
  background: rgb(255 255 255 / 78%);
  color: #1b5f4c;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.45;
}

[hidden] {
  display: none !important;
}

.hero__art {
  display: grid;
  min-height: 430px;
  place-items: center;
}

.hero__art > img {
  position: relative;
  z-index: 3;
  width: min(360px, 72vw);
  height: auto;
  image-rendering: auto;
  filter: drop-shadow(0 24px 18px rgb(35 68 88 / 24%));
}

.hero__ground {
  position: absolute;
  z-index: 1;
  bottom: 55px;
  width: min(480px, 92%);
  height: 88px;
  border: 9px solid #4eaa91;
  border-radius: 50%;
  background: #68bf83;
  box-shadow: inset 0 -22px 0 #477c54;
}

.hero__sun {
  position: absolute;
  top: 20px;
  right: 7%;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #ffe59a;
  box-shadow: 0 0 60px rgb(255 229 154 / 65%);
}

.hero__cloud {
  position: absolute;
  width: 120px;
  height: 32px;
  border-radius: 999px;
  background: rgb(255 255 255 / 68%);
}

.hero__cloud::before,
.hero__cloud::after {
  position: absolute;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
  content: "";
}

.hero__cloud::before {
  left: 19px;
  width: 54px;
  height: 54px;
}

.hero__cloud::after {
  right: 17px;
  width: 42px;
  height: 42px;
}

.hero__cloud--one {
  top: 104px;
  left: 2%;
}

.hero__cloud--two {
  top: 165px;
  right: -4%;
  transform: scale(0.7);
}

.content-section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(72px, 9vw, 120px) 0;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  align-items: end;
  gap: clamp(32px, 7vw, 100px);
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.1rem, 5vw, 4.1rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.intro > p {
  margin: 0;
  color: #4a6274;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.65;
}

.character-grid,
.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 38px;
}

.character-card {
  min-width: 0;
  padding: 26px 22px;
  border: 1px solid #d9e8ee;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 18px 42px rgb(46 84 105 / 8%);
}

.character-card--hero {
  background: #e6f7ff;
}

.character-card img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.character-card h3,
.level-card h3 {
  margin: 18px 0 8px;
  font-size: 1.32rem;
}

.character-card p,
.level-card p {
  margin: 0;
  color: #587080;
  line-height: 1.55;
}

.levels-section {
  background: #eaf7f4;
}

.level-card {
  position: relative;
  min-height: 370px;
  overflow: hidden;
  padding: 28px 24px 150px;
  border-radius: 24px;
  color: #fff;
  box-shadow: 0 20px 45px rgb(42 84 82 / 13%);
}

.level-card h3,
.level-card p {
  position: relative;
  z-index: 2;
}

.level-card h3 {
  font-size: 1.45rem;
}

.level-card p {
  color: rgb(255 255 255 / 86%);
}

.level-card img {
  position: absolute;
  z-index: 2;
  right: 14px;
  bottom: 12px;
  width: 45%;
  height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 11px 7px rgb(0 0 0 / 22%));
}

.level-card::after {
  position: absolute;
  right: -25%;
  bottom: -78px;
  width: 145%;
  height: 160px;
  border-radius: 50%;
  background: rgb(16 36 58 / 24%);
  content: "";
}

.level-number {
  position: relative;
  z-index: 2;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.level-card--meadow {
  background: linear-gradient(155deg, #78c8f5 0%, #43aa82 100%);
}

.level-card--cliffs {
  background: linear-gradient(155deg, #5aa8ce 0%, #6f432a 100%);
}

.level-card--volcano {
  background: linear-gradient(155deg, #7c3031 0%, #2b1b26 100%);
}

.level-card--jungle {
  background:
    linear-gradient(rgb(18 58 40 / 38%), rgb(18 58 40 / 68%)),
    url("../assets/images/level4/jungle-background.png") center / cover;
}

.final-cta {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
}

.final-cta img {
  object-fit: contain;
}

.final-cta p {
  margin: 10px 0 0;
  color: #587080;
  font-size: 1.1rem;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 30px max(24px, env(safe-area-inset-right)) max(30px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: #10243a;
  color: #fff;
  font-size: 0.9rem;
}

footer span {
  font-weight: 900;
}

footer strong {
  color: #d9f3ff;
}

footer a {
  color: var(--sun);
  font-weight: 900;
}

.pwa-update--landing {
  position: fixed;
  z-index: 30;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  max-width: min(410px, calc(100vw - 28px));
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #10243a;
  color: #fff;
  box-shadow: 0 18px 45px rgb(0 0 0 / 30%);
  font-size: 0.86rem;
  font-weight: 750;
}

.pwa-update--landing button {
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 9px;
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 900px) {
  .hero {
    min-height: 0;
    grid-template-columns: 1fr;
    padding-bottom: 42px;
  }

  .hero__copy {
    justify-self: start;
  }

  .hero__art {
    min-height: 300px;
  }

  .hero__art > img {
    width: min(280px, 70vw);
  }

  .hero__ground {
    bottom: 10px;
  }

  .character-grid,
  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .final-cta {
    grid-template-columns: auto 1fr;
  }

  .final-cta .primary-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .hero {
    padding-right: 20px;
    padding-left: 20px;
  }

  h1 {
    font-size: clamp(3.15rem, 17vw, 5rem);
  }

  .hero__actions,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .intro,
  .character-grid,
  .level-grid {
    grid-template-columns: 1fr;
  }

  .content-section {
    width: min(100% - 32px, 1120px);
  }

  .level-card {
    min-height: 330px;
  }

  .final-cta {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .final-cta img {
    margin: 0 auto;
  }

  footer {
    flex-direction: column;
    text-align: center;
  }

}

@media (orientation: landscape) and (max-height: 540px) {
  .hero {
    min-height: 620px;
    grid-template-columns: 1fr 0.75fr;
  }

  .hero__art {
    min-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
