:root {
  --ink: #16123a;
  --ink-2: #251e5e;
  --ink-soft: rgba(22, 18, 58, 0.72);
  --sky-top: #33b0ff;
  --sky-mid: #7fd3ff;
  --sky-low: #dff4ff;
  --paper: #f6fbff;
  --white: #ffffff;
  --gold: #ffc83d;
  --gold-deep: #e39500;
  --green: #3ccf62;
  --green-deep: #1f9a42;
  --purple: #5b21d6;
  --radius: 22px;
  --shadow-chunky: 0 6px 0 var(--ink);
  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; }
h3 { font-size: 1.45rem; font-weight: 600; }
p { margin: 0; }

.wrap { width: min(1160px, 100% - 40px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--white); padding: 10px 16px; border-radius: 10px; font-weight: 800; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.section-ink :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }

/* Buttons: chunky, like the in-game ones */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 1.15rem;
  text-decoration: none; color: var(--white);
  padding: 15px 26px; border-radius: 16px; border: 3px solid var(--ink);
  box-shadow: var(--shadow-chunky);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.btn-play { background: var(--green); color: var(--ink); }
.btn-play:hover { background: #47dc6e; }
.btn-ghost { background: var(--white); color: var(--ink); }
.btn-sm { padding: 9px 18px; font-size: 1rem; box-shadow: 0 4px 0 var(--ink); }
.btn-sm:hover { box-shadow: 0 6px 0 var(--ink); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 251, 255, 0.86);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 2px solid rgba(22, 18, 58, 0.08);
}
.header-row { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 700; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 58%, var(--sky-low) 100%);
  padding: clamp(48px, 7vw, 96px) 0 clamp(64px, 8vw, 112px);
}
.clouds span {
  position: absolute; border-radius: 999px; background: rgba(255, 255, 255, 0.75);
  filter: blur(1px);
}
.clouds span::before, .clouds span::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.clouds span:nth-child(1) { width: 220px; height: 60px; left: 6%; top: 18%; }
.clouds span:nth-child(1)::before { width: 100px; height: 100px; left: 40px; top: -48px; }
.clouds span:nth-child(1)::after { width: 70px; height: 70px; left: 120px; top: -30px; }
.clouds span:nth-child(2) { width: 300px; height: 70px; right: -40px; top: 8%; opacity: 0.8; }
.clouds span:nth-child(2)::before { width: 130px; height: 130px; left: 70px; top: -62px; }
.clouds span:nth-child(2)::after { width: 90px; height: 90px; left: 175px; top: -40px; }
.clouds span:nth-child(3) { width: 180px; height: 50px; left: 38%; bottom: 10%; opacity: 0.7; }
.clouds span:nth-child(3)::before { width: 80px; height: 80px; left: 40px; top: -40px; }
.clouds span:nth-child(3)::after { width: 60px; height: 60px; left: 100px; top: -24px; }

.hero-grid { position: relative; display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 999px;
  padding: 6px 16px; font-weight: 800; font-size: 0.95rem; box-shadow: 0 4px 0 var(--ink);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(60, 207, 98, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(60, 207, 98, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 207, 98, 0); } }
.hero h1 {
  margin-top: 22px;
  font-size: clamp(3.4rem, 8.4vw, 6.4rem); font-weight: 700; color: var(--gold);
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--ink);
  letter-spacing: -0.02em;
}
.lede { margin-top: 20px; font-size: clamp(1.1rem, 1.6vw, 1.3rem); font-weight: 600; max-width: 34ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 30px; }
.facts { list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; font-weight: 700; color: var(--ink-soft); }
.age-note { margin-top: 18px; font-weight: 700; color: var(--ink-soft); max-width: 46ch; }
.age-note a { color: var(--ink); }
.facts strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); margin-right: 4px; }

.hero-art { position: relative; }
.art-card {
  margin: 0; border: 4px solid var(--ink); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 10px 0 var(--ink); transform: rotate(-2deg); background: var(--white);
}
.app-icon {
  position: absolute; width: clamp(96px, 13vw, 150px); right: -14px; bottom: -34px;
  border-radius: 28px; border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); transform: rotate(7deg);
}

/* Sections */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-sky { background: linear-gradient(180deg, #e7f6ff, #cdeeff); }
.section-ink { background: var(--ink); color: var(--white); }
.kicker { font-family: var(--font-display); font-weight: 600; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--purple); margin-bottom: 10px; }
.kicker-light { color: var(--gold); }
.section-lede { margin-top: 16px; font-size: 1.15rem; max-width: 52ch; color: var(--ink-soft); font-weight: 600; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step { background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-chunky); display: flex; flex-direction: column; }
.step img { aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 3px solid var(--ink); }
/* Step 1 reuses the hero art, so frame it on the launch pad instead of the whole scene. */
.step:first-child img { object-position: 22% 80%; }
.step-body { padding: 20px 22px 24px; position: relative; }
.step-num {
  position: absolute; top: -26px; right: 18px; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold); border: 3px solid var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; box-shadow: 0 4px 0 var(--ink);
}
.step h3 { margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-weight: 600; }

/* Islands */
.islands-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.ladder { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; display: grid; gap: 10px; }
.ladder::before { content: ""; position: absolute; left: 10px; top: 16px; bottom: 16px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--purple), var(--gold), var(--green)); }
.ladder li {
  position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 14px; padding: 10px 16px 10px 52px;
  box-shadow: 0 4px 0 var(--ink); font-weight: 800;
}
.ladder li::before {
  content: ""; position: absolute; left: -30px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  border-radius: 50%; background: var(--white); border: 3px solid var(--ink);
}
.ladder li::after {
  content: ""; position: absolute; left: 12px; top: 50%; width: 26px; height: 18px; margin-top: -9px;
  border-radius: 50% 50% 40% 40% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 50% 30%, var(--e) 0 35%, transparent 36%), var(--c);
  border: 2px solid var(--ink);
}
.isle { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.req { font-size: 0.95rem; color: var(--ink-soft); white-space: nowrap; }

/* Pets */
.rarity { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.rarity li {
  display: grid; gap: 4px; text-align: center; padding: 18px 10px 16px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink);
  border-top: 12px solid var(--r);
}
.r-name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; }
.r-odds { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; }
.r-mult { font-size: 0.9rem; font-weight: 700; color: var(--ink-soft); }

.fuse { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 40px; }
.tier {
  display: grid; gap: 2px; text-align: center; min-width: 132px; padding: 14px 18px;
  border: 3px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink);
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
}
.tier small { font-family: var(--font-body); font-size: 0.9rem; font-weight: 700; }
.tier-normal { background: var(--white); }
.tier-gold { background: linear-gradient(160deg, #ffe27a, var(--gold) 55%, var(--gold-deep)); }
.tier-rainbow { background: linear-gradient(120deg, #ff6b9a, #ffb84d, #fff06a, #6bf08e, #5cc8ff, #b07bff); }
.fuse-arrow { font-weight: 800; color: var(--ink-soft); }
.note { margin-top: 18px; font-weight: 700; color: var(--ink-soft); }

.golden {
  margin-top: 48px; display: flex; align-items: center; gap: 26px;
  background: linear-gradient(135deg, #2a1f63, var(--ink)); color: var(--white);
  border: 3px solid var(--ink); border-radius: var(--radius); padding: 26px 30px; box-shadow: 0 8px 0 var(--gold-deep);
}
.golden h3 { color: var(--gold); font-size: 1.7rem; margin-bottom: 6px; }
.golden p { max-width: 62ch; font-weight: 600; color: rgba(255, 255, 255, 0.88); }
.golden-egg {
  flex: none; width: 72px; height: 92px; border-radius: 50% 50% 46% 46% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #fff6c8 0 12%, var(--gold) 40%, var(--gold-deep) 100%);
  border: 3px solid #fff1b0; box-shadow: 0 0 34px rgba(255, 200, 61, 0.7);
  animation: wobble 3.2s ease-in-out infinite;
}
@keyframes wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg); } }

/* Trailer */
.video-frame { margin-top: 32px; border: 4px solid var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 0 rgba(255, 255, 255, 0.18); background: #000; }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; }
.video-frame video:focus-visible { outline-offset: -6px; }
.caption { margin-top: 14px; color: rgba(255, 255, 255, 0.72); font-weight: 600; }

/* Codes */
.codes { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.code-card {
  display: grid; gap: 10px; align-content: start; padding: 22px;
  background: var(--white); border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow-chunky);
}
.code-card code { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; letter-spacing: 0.04em; color: var(--purple); }
.code-card span { font-weight: 700; color: var(--ink-soft); }
.copy {
  justify-self: start; font: inherit; font-weight: 800; cursor: pointer;
  padding: 8px 18px; border-radius: 12px; border: 3px solid var(--ink); background: var(--gold);
  box-shadow: 0 4px 0 var(--ink); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.copy:hover { transform: translateY(-1px); box-shadow: 0 5px 0 var(--ink); }
.copy:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.copy.copied { background: var(--green); color: var(--ink); }

/* Studio */
.studio-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 5vw, 56px); align-items: center; }
.studio-mark { width: clamp(90px, 14vw, 140px); border-radius: 28px; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14); }
.studio p:not(.kicker) { margin: 14px 0 26px; font-size: 1.15rem; max-width: 56ch; color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.studio .btn { box-shadow: 0 6px 0 #000; border-color: #000; }

/* Footer */
.site-footer { background: #0e0b27; color: rgba(255, 255, 255, 0.7); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 0.95rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 32px; }
.legal { max-width: 70ch; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .islands-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 620px; }
  .steps { grid-template-columns: 1fr; max-width: 620px; }
  .rarity { grid-template-columns: repeat(3, 1fr); }
  .codes { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .header-row { justify-content: space-between; }
  body { font-size: 17px; }
  .app-icon { right: 6px; bottom: -28px; }
  .rarity { grid-template-columns: repeat(2, 1fr); }
  .golden { flex-direction: column; align-items: flex-start; }
  .studio-grid { grid-template-columns: 1fr; }
  .fuse-arrow { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
