@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
  --ink: #24143f;
  --ink-2: #352357;
  --cream: #fff3c4;
  --white: #fffdf0;
  --sky: #4bc8f4;
  --blue: #2985d4;
  --green: #49b87e;
  --grass: #72d37c;
  --orange: #ff9845;
  --red: #e94b3d;
  --yellow: #ffe45d;
  --pixel: 'Press Start 2P', 'Courier New', monospace;
  --line: 4px solid var(--ink);
  --shadow: 7px 7px 0 var(--ink);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--pixel);
  line-height: 1.55;
}

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

.crt {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .14;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.12) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

.hero {
  position: relative;
  min-height: 850px;
  height: 100svh;
  max-height: 1050px;
  overflow: hidden;
  border-bottom: 8px solid var(--ink);
  background: var(--sky);
}

.hero-sky,
.hero-sky::after {
  position: absolute;
  inset: 0;
}

.hero-sky::after {
  content: '';
  background:
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.16) 50%, transparent 51%) 0 0 / 64px 64px,
    linear-gradient(transparent 49%, rgba(255,255,255,.16) 50%, transparent 51%) 0 0 / 64px 64px;
  animation: gridScroll 12s linear infinite;
}

.sun {
  position: absolute;
  top: 12%;
  right: 6%;
  width: 104px;
  height: 104px;
  z-index: 1;
  background: var(--yellow);
  border: var(--line);
  box-shadow: -12px 0 var(--yellow), 12px 0 var(--yellow), 0 -12px var(--yellow), 0 12px var(--yellow), 8px 8px 0 rgba(36,20,63,.22);
  animation: sunPulse 2s steps(2) infinite;
}

.cloud {
  position: absolute;
  z-index: 1;
  width: 136px;
  height: 35px;
  background: var(--white);
  border: var(--line);
  box-shadow: 7px 7px 0 rgba(36,20,63,.18);
  animation: cloudMove 16s linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  bottom: 28px;
  background: var(--white);
  border: var(--line);
  border-bottom: 0;
}

.cloud::before { left: 19px; width: 45px; height: 34px; }
.cloud::after { right: 18px; width: 54px; height: 48px; }
.cloud-a { top: 20%; left: 3%; }
.cloud-b { top: 33%; left: 47%; transform: scale(.72); animation-direction: reverse; animation-duration: 22s; }
.cloud-c { top: 12%; left: 29%; transform: scale(.5); animation-duration: 26s; }

.mountains {
  position: absolute;
  left: -5%;
  width: 110%;
  transform-origin: bottom;
}

.mountains-far {
  bottom: 19%;
  height: 255px;
  z-index: 1;
  background: #91e2c4;
  clip-path: polygon(0 100%,0 75%,8% 35%,16% 74%,26% 22%,38% 76%,50% 34%,61% 77%,72% 16%,85% 70%,94% 29%,100% 62%,100% 100%);
  animation: mountainShift 7s steps(3) infinite;
}

.mountains-near {
  bottom: 14%;
  height: 210px;
  z-index: 2;
  background: var(--green);
  clip-path: polygon(0 100%,0 72%,12% 25%,24% 78%,39% 30%,52% 80%,66% 25%,80% 74%,92% 20%,100% 63%,100% 100%);
}

.hero-ground {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18%;
  border-top: 8px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 0 24px, rgba(68,112,54,.4) 24px 48px) 0 0 / 48px 24px,
    linear-gradient(var(--grass) 0 14px, #4f9e4d 14px 100%);
  animation: groundScroll 1.2s linear infinite;
}

.pixel-star {
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 16px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  animation: starFloat 2.5s steps(3) infinite;
}

.star-a { left: 4%; top: 48%; }
.star-b { left: 55%; top: 38%; background: var(--orange); animation-delay: -.8s; }
.star-c { right: 3%; top: 48%; animation-delay: -1.5s; }

.hero-layout {
  position: relative;
  z-index: 5;
  width: min(1120px, calc(100% - 36px));
  height: 100%;
  min-height: inherit;
  margin: 0 auto;
  padding: 26px 0 0;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  grid-template-rows: auto auto 1fr;
  column-gap: 20px;
}

.title-box {
  position: relative;
  grid-column: 1 / -1;
  width: min(720px, 67vw);
  margin: 0 auto;
  padding: 17px 26px 20px;
  color: var(--white);
  background: var(--ink);
  border: 5px solid var(--white);
  outline: 5px solid var(--ink);
  box-shadow: 10px 10px 0 var(--orange);
  text-align: center;
  transform: rotate(-1deg);
}

.title-box p {
  margin: 0 0 9px;
  color: var(--sky);
  font-size: .54rem;
  letter-spacing: 2px;
}

.title-box h1 {
  margin: 0;
  font-size: clamp(2.6rem, 6.4vw, 5.7rem);
  line-height: 1;
  letter-spacing: -5px;
  text-shadow: 6px 6px 0 var(--blue), 10px 10px 0 #0c0820;
}

.title-box h1 span { color: var(--yellow); }

.title-ticker {
  position: absolute;
  left: 16px;
  bottom: -17px;
  padding: 7px 10px 6px;
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--orange);
  font-size: .66rem;
  letter-spacing: 1px;
  transform: rotate(-2deg);
}

.title-lives {
  position: absolute;
  right: 14px;
  bottom: -15px;
  padding: 5px 8px;
  color: var(--red);
  background: var(--white);
  border: 3px solid var(--ink);
  font-size: .58rem;
}

.launch-row {
  grid-column: 1 / -1;
  width: min(840px, 80vw);
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.ca-box {
  min-width: 0;
  height: 70px;
  padding: 9px 10px 9px 17px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  color: var(--white);
  background: var(--ink-2);
  border: 5px solid var(--ink);
  box-shadow: 7px 7px 0 rgba(36,20,63,.28);
}

.ca-label { color: var(--yellow); font-size: .64rem; }
.ca-box code { overflow: hidden; font: .62rem var(--pixel); text-overflow: ellipsis; white-space: nowrap; }

.ca-box button {
  align-self: stretch;
  padding: 0 12px;
  color: var(--ink);
  background: var(--sky);
  border: 3px solid var(--white);
  box-shadow: 3px 3px 0 var(--orange);
  font: .52rem var(--pixel);
  cursor: pointer;
}

.launch-buttons { display: flex; gap: 11px; }

.round-button {
  width: 76px;
  height: 76px;
  display: grid;
  place-content: center;
  gap: 5px;
  color: var(--ink);
  background: var(--white);
  border: 5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 5px 5px 0 var(--orange);
  text-align: center;
  text-decoration: none;
  transition: transform .12s steps(2), box-shadow .12s steps(2);
}

.round-button strong { font-size: .72rem; }
.round-button small { font-size: .36rem; }
.round-button--tg { background: var(--sky); }
.round-button--pump { color: var(--white); background: var(--green); }
.round-button:hover, .round-button:focus-visible { transform: translate(4px,4px); box-shadow: 1px 1px 0 var(--orange); }

.hero-copy {
  align-self: center;
  padding: 35px 0 12vh 24px;
}

.hero-kicker {
  width: fit-content;
  margin-bottom: 18px;
  padding: 9px 11px;
  color: var(--white);
  background: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--orange);
  font-size: .52rem;
}

.hero-kicker i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 7px;
  background: #72ff69;
  animation: blink .9s steps(1) infinite;
}

.hero-copy h2 {
  margin: 0;
  font-size: clamp(2.1rem, 4.5vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: -4px;
  text-shadow: 5px 5px 0 var(--white), 9px 9px 0 rgba(36,20,63,.18);
}

.hero-copy p {
  max-width: 450px;
  margin: 24px 0;
  font-size: .68rem;
  line-height: 1.9;
}

.pixel-button {
  min-height: 50px;
  padding: 14px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font: .61rem/1.35 var(--pixel);
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s steps(2), box-shadow .1s steps(2);
}

.pixel-button:hover, .pixel-button:focus-visible { transform: translate(4px,4px); box-shadow: 2px 2px 0 var(--ink); }
.pixel-button--yellow { color: var(--ink); background: var(--yellow); }
.pixel-button--red { color: var(--white); background: var(--red); }

.text-link {
  margin-left: 20px;
  font-size: .48rem;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.hero-frank {
  position: relative;
  align-self: end;
  height: min(600px, 66vh);
  min-height: 500px;
  display: grid;
  place-items: end center;
}

.hero-frank-art {
  position: relative;
  z-index: 3;
  width: min(590px, 48vw);
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: pixelated;
  filter: drop-shadow(9px 11px 0 rgba(36,20,63,.25));
  animation: frankIdle 1.4s steps(3) infinite;
}

.hero-shadow {
  position: absolute;
  z-index: 1;
  bottom: 2%;
  left: 50%;
  width: 68%;
  height: 30px;
  transform: translateX(-50%);
  background: rgba(36,20,63,.36);
  border: 4px solid var(--ink);
  animation: shadowPulse 1.4s steps(3) infinite;
}

.game-section,
.dex-section {
  padding: 100px max(18px, calc((100% - 1180px) / 2));
}

.section-heading {
  margin-bottom: 38px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
}

.section-heading > div { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 18px; }
.level-chip { padding: 9px 10px; color: var(--white); background: var(--red); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-size: .5rem; }

.section-heading h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1.1;
  letter-spacing: -4px;
  text-shadow: 5px 5px 0 var(--sky);
}

.section-heading p { margin: 0 0 7px; font-size: .58rem; line-height: 1.9; }

.arcade {
  padding: 15px;
  color: var(--white);
  background: #39305c;
  border: 7px solid var(--ink);
  box-shadow: 14px 14px 0 var(--red);
}

.arcade-header,
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.arcade-header { padding: 8px 4px 15px; font-size: .53rem; }
.arcade-led { color: #aaa3ca; }
.arcade-led i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; background: #6dff72; border: 2px solid var(--ink); animation: blink .75s steps(1) infinite; }

.game-hud {
  padding: 11px 15px;
  color: var(--yellow);
  background: var(--ink);
  border: 4px solid #625987;
}

.game-hud > div { min-width: 110px; }
.game-hud small, .game-hud strong { display: block; }
.game-hud small { margin-bottom: 4px; color: #8e87b2; font-size: .4rem; }
.game-hud strong { font-size: .62rem; }

.screen-frame {
  position: relative;
  margin-top: 11px;
  overflow: hidden;
  background: #bdebf0;
  border: 8px solid #0c0820;
  box-shadow: inset 0 0 0 4px #645b88;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  cursor: pointer;
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 17px;
  padding: 20px;
  color: var(--white);
  background: rgba(36,20,63,.88);
  text-align: center;
}

.game-overlay.is-hidden { display: none; }
.game-overlay > span { color: var(--yellow); font-size: .48rem; }
.game-overlay h3 { margin: 0; font-size: clamp(1.7rem, 4.4vw, 4rem); line-height: 1.25; text-shadow: 5px 5px 0 var(--red); }
.game-overlay p { margin: 0; font-size: .45rem; line-height: 2; }

.mobile-controls {
  padding: 18px 14px 8px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
}

.mobile-controls > div { display: flex; gap: 9px; }
.mobile-controls button { width: 68px; height: 62px; color: var(--white); background: var(--ink); border: 4px solid #0c0820; box-shadow: 4px 4px 0 #0c0820; font: .9rem var(--pixel); cursor: pointer; touch-action: none; }
.mobile-controls .jump-button { width: 72px; height: 72px; background: var(--red); border-radius: 50%; }
.mobile-controls button:active, .mobile-controls button.is-pressed { transform: translate(4px,4px); box-shadow: none; }
.mobile-controls p { margin: 0; color: #aaa3ca; text-align: center; font-size: .48rem; line-height: 1.8; }
.mobile-controls p span { color: var(--yellow); font-size: .38rem; }

.asset-note {
  margin-top: 25px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
  font-size: .44rem;
}
.asset-note span { color: #796f8d; }

.dex-section {
  color: var(--white);
  background: var(--blue);
  border-top: 7px solid var(--ink);
  border-bottom: 7px solid var(--ink);
}

.section-heading--light h2 { color: var(--white); text-shadow: 5px 5px 0 var(--red); }

.terminal {
  color: #91ff7b;
  background: #0d1023;
  border: 7px solid var(--ink);
  box-shadow: 14px 14px 0 rgba(36,20,63,.55);
}

.terminal-titlebar {
  padding: 13px 17px;
  display: flex;
  justify-content: space-between;
  color: var(--white);
  background: #39305c;
  border-bottom: 5px solid var(--ink);
  font-size: .5rem;
}

.terminal-titlebar i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; background: var(--yellow); animation: blink .8s steps(1) infinite; }
.terminal-layout { padding: 16px; display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
.chart-panel, .token-panel { background: #13172d; border: 4px solid #4c5077; }
.chart-panel { min-width: 0; padding: 17px; }
.chart-topline { margin-bottom: 12px; display: flex; justify-content: space-between; gap: 20px; }
.chart-topline small, .chart-topline strong { display: block; }
.chart-topline small { margin-bottom: 7px; color: #74799f; font-size: .4rem; }
.chart-topline strong { color: var(--white); font-size: .5rem; }

#dexCanvas {
  display: block;
  width: 100%;
  height: 290px;
  background:
    linear-gradient(rgba(145,255,123,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(145,255,123,.08) 1px, transparent 1px);
  background-size: 31px 31px;
  border: 2px solid #363b62;
  image-rendering: pixelated;
}

.chart-axis { margin-top: 8px; display: flex; justify-content: space-between; color: #6e7397; font-size: .4rem; }
.token-panel { padding: 20px; color: var(--white); text-align: center; }
.token-avatar { width: 90px; height: 90px; margin: 0 auto 13px; overflow: hidden; background: var(--sky); border: 4px solid var(--white); outline: 4px solid var(--ink); }
.token-avatar img { width: 130%; height: 130%; margin: 3% 0 0 -15%; object-fit: contain; image-rendering: pixelated; }
.token-panel h3 { margin: 0; color: var(--yellow); font-size: 1.15rem; }
.token-panel > p { margin: 7px 0 19px; color: #858bb2; font-size: .44rem; }
.token-panel dl { margin: 0; }
.token-panel dl div { padding: 11px 0; display: flex; justify-content: space-between; border-top: 2px dashed #363b62; font-size: .42rem; }
.token-panel dt { color: #777ca2; }
.token-panel dd { margin: 0; color: #91ff7b; }
.token-panel .pixel-button { width: 100%; margin-top: 13px; }

footer {
  min-height: 140px;
  padding: 32px max(18px, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  color: var(--white);
  background: var(--ink);
  font-size: .42rem;
}

.footer-logo { text-decoration: none; font-size: .8rem; text-shadow: 3px 3px 0 var(--red); }
.footer-logo span { color: var(--yellow); }
footer > div { display: flex; gap: 22px; }
footer > div a { color: var(--yellow); }

.toast {
  position: fixed;
  z-index: 1000;
  right: 22px;
  bottom: 22px;
  padding: 15px 17px;
  color: var(--ink);
  background: var(--yellow);
  border: 4px solid var(--ink);
  box-shadow: 6px 6px 0 var(--red);
  font-size: .52rem;
  transform: translateY(140px);
  transition: transform .18s steps(3);
}
.toast.is-visible { transform: translateY(0); }

@keyframes blink { 50% { opacity: 0; } }
@keyframes gridScroll { to { background-position: 64px 0, 0 64px; } }
@keyframes sunPulse { 50% { transform: scale(.95); } }
@keyframes cloudMove { 50% { transform: translateX(75px); } }
@keyframes mountainShift { 50% { transform: scaleY(1.035); } }
@keyframes groundScroll { to { background-position: -48px 0, 0 0; } }
@keyframes starFloat { 50% { transform: translateY(-20px) rotate(90deg); } }
@keyframes frankIdle { 50% { transform: translateY(-8px); } }
@keyframes shadowPulse { 50% { width: 62%; opacity: .72; } }
@media (max-width: 900px) {
  .hero { min-height: 1050px; height: auto; max-height: none; }
  .hero-layout { grid-template-columns: 1fr; grid-template-rows: auto auto auto 470px; }
  .title-box { width: min(720px, 90vw); }
  .launch-row { width: min(760px, 91vw); }
  .hero-copy { padding: 42px 12px 0; text-align: center; }
  .hero-copy h2, .hero-copy p, .hero-kicker { margin-left: auto; margin-right: auto; }
  .hero-frank { grid-row: 4; min-height: 470px; height: 470px; }
  .hero-frank-art { width: min(550px, 77vw); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .terminal-layout { grid-template-columns: 1fr; }
  .token-panel { display: grid; grid-template-columns: 100px 1fr; align-items: center; gap: 10px 18px; text-align: left; }
  .token-avatar { grid-row: 1 / 4; margin: 0; }
  .token-panel h3, .token-panel > p { margin: 0; }
  .token-panel dl, .token-panel .pixel-button { grid-column: 1 / -1; }
}

@media (max-width: 660px) {
  :root { --line: 3px solid var(--ink); }
  .hero { min-height: 980px; }
  .hero-layout { width: calc(100% - 18px); padding-top: 17px; grid-template-rows: auto auto auto 390px; }
  .title-box { width: 93vw; padding: 13px 8px 16px; border-width: 4px; outline-width: 3px; box-shadow: 6px 6px 0 var(--orange); }
  .title-box p { font-size: .39rem; }
  .title-box h1 { font-size: clamp(2.1rem, 12.5vw, 3.7rem); letter-spacing: -4px; text-shadow: 4px 4px 0 var(--blue), 7px 7px 0 #0c0820; }
  .launch-row { width: 94vw; margin-top: 21px; grid-template-columns: 1fr; gap: 13px; }
  .ca-box { height: 58px; padding-left: 10px; gap: 8px; border-width: 4px; }
  .ca-label { font-size: .47rem; }
  .ca-box code { font-size: .42rem; }
  .ca-box button { padding: 0 8px; font-size: .4rem; }
  .launch-buttons { justify-content: center; }
  .round-button { width: 64px; height: 64px; border-width: 4px; }
  .round-button strong { font-size: .6rem; }
  .hero-copy { padding-top: 28px; }
  .hero-copy h2 { font-size: 2.25rem; letter-spacing: -3px; }
  .hero-copy p { margin: 17px auto; font-size: .51rem; }
  .pixel-button { min-height: 46px; padding: 12px; font-size: .48rem; }
  .text-link { display: block; width: fit-content; margin: 19px auto 0; }
  .hero-frank { min-height: 390px; height: 390px; }
  .hero-frank-art { width: min(450px, 94vw); }

  .game-section, .dex-section { padding: 75px 12px; }
  .section-heading > div { gap: 10px; }
  .section-heading h2 { font-size: 2.1rem; letter-spacing: -3px; }
  .section-heading p { font-size: .46rem; }
  .level-chip { padding: 7px; font-size: .38rem; }
  .arcade { padding: 7px; border-width: 5px; box-shadow: 8px 8px 0 var(--red); }
  .arcade-header { font-size: .4rem; }
  .game-hud { padding: 8px 6px; gap: 5px; }
  .game-hud > div { min-width: 0; }
  .game-hud small { font-size: .28rem; }
  .game-hud strong { font-size: .42rem; }
  .screen-frame { border-width: 5px; }
  .mobile-controls { padding: 15px 2px 5px; grid-template-columns: auto 1fr auto; gap: 6px; }
  .mobile-controls button { width: 46px; height: 49px; font-size: .62rem; }
  .mobile-controls .jump-button { width: 54px; height: 54px; }
  .mobile-controls p { font-size: .34rem; }
  .mobile-controls p span { display: none; }
  .asset-note { justify-content: flex-start; font-size: .34rem; }
  .terminal-layout { padding: 8px; }
  .chart-panel, .token-panel { padding: 11px; }
  .chart-topline { flex-direction: column; gap: 9px; }
  #dexCanvas { height: 220px; }
  .token-panel { grid-template-columns: 78px 1fr; }
  .token-avatar { width: 72px; height: 72px; }
  footer { padding: 30px 17px; flex-direction: column; align-items: flex-start; }
  footer > div { flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
