/* =====================================================================
   PIXEL CORGI — styles
   ===================================================================== */

:root {
  --peach: #f8a98b;
  --peach-light: #fccbb5;
  --peach-deep: #ee8e6c;
  --ink: #3b2a24;
  --cream: #fff4e8;
  --orange: #e98d3c;
  --sky: #7cc5f0;
  --grass: #7dc24e;
  --gray: #c9c9c9;
  --good: #4f9d3a;
  --bad: #d64545;
  --shadow: 6px 6px 0 var(--ink);
  --font-pixel: "Press Start 2P", monospace;
  --font-body: "Pixelify Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--peach);
  background-image: radial-gradient(var(--peach-deep) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
img, .sprite { image-rendering: pixelated; image-rendering: crisp-edges; }
.hidden { display: none !important; }
.flip { transform: scaleX(-1); }

h1, h2, h3, .btn, .nav__brand, .frames caption, figcaption {
  font-family: var(--font-pixel);
  line-height: 1.4;
}

/* ---------------------------------------------------------------------
   Sprite clips
   Transparent APNG clips rendered from the sheet (64×64 cells, 100 ms per
   frame). --s scales the clip: 3 = 192px box, 96×84 corgi.
   --------------------------------------------------------------------- */
.sprite {
  --s: 3;
  display: inline-block;
  width: calc(64px * var(--s));
  height: calc(64px * var(--s));
  max-width: none; /* clips are sized by --s, never by their container */
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 16px 22px;
  font-size: 13px;
  color: var(--cream);
  background: var(--orange);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: var(--shadow); }
.btn--ghost { background: var(--cream); color: var(--ink); }
.btn--small { padding: 12px 16px; font-size: 11px; }

/* ---------------------------------------------------------------------
   Nav
   --------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--cream);
  border-bottom: 4px solid var(--ink);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
}
.nav__logo { width: 32px; height: 28px; overflow: hidden; }          /* crop the 64×64 cell to the 32×28 corgi */
.nav__logo .sprite { --s: 1; margin: -20px 0 0 -16px; }
.nav__links { display: flex; gap: 20px; margin-left: auto; font-weight: 600; }
.nav__links a { text-decoration: none; }
.nav__links a:hover { text-decoration: underline; text-decoration-thickness: 3px; }
.nav__addr { margin-right: 12px; opacity: .65; }

/* ---------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}
.hero__eyebrow {
  margin: 0 0 16px;
  font-family: var(--font-pixel);
  font-size: 11px;
  color: var(--ink);
  opacity: .8;
}
.hero__title {
  margin: 0;
  font-size: clamp(44px, 10vw, 104px);
  line-height: 1.05;
  color: var(--cream);
  text-shadow: 6px 6px 0 var(--ink);
}
.hero__by {
  margin: 20px 0 0;
  font-family: var(--font-pixel);
  font-size: 12px;
}
.hero__sub {
  max-width: 560px;
  margin: 24px auto 0;
  font-size: 22px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 40px;
}

.hero__deco { position: absolute; inset: 0; pointer-events: none; }
.deco { position: absolute; --s: 3; }
.deco--1 { top: 40px;  left: 6%; }
.deco--2 { top: 60px;  right: 8%; }
.deco--3 { bottom: 40px; left: 4%; }
.deco--4 { bottom: 60px; right: 6%; }
.deco--5 { top: 46%;  left: 0; }
.deco--6 { top: 40%;  right: 0; }

/* ---------------------------------------------------------------------
   Demo scene
   --------------------------------------------------------------------- */
.scene { padding: 0 24px 48px; text-align: center; }
.scene__frame {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  background: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.scene__frame img { width: 800px; max-width: 100%; height: auto; }
.scene__caption { margin: 20px 0 0; font-size: 18px; }

/* ---------------------------------------------------------------------
   Sections
   --------------------------------------------------------------------- */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px;
  border-top: 4px solid var(--ink);
}
.section__title {
  margin: 0 0 20px;
  font-size: clamp(20px, 4vw, 32px);
  color: var(--cream);
  text-shadow: 4px 4px 0 var(--ink);
}
.section__lead { max-width: 720px; margin: 0 0 40px; font-size: 21px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 28px;
}
.card {
  padding: 20px;
  background: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.card__sprite { --s: 2; display: block; margin: -12px 0 0 -24px; }
.card h3 { margin: 4px 0 10px; font-size: 13px; }
.card p { margin: 0; font-size: 18px; }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards--3 .card h3 { margin-top: 0; }
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 4px 6px;
  font-size: 8px;
  vertical-align: middle;
  color: var(--cream);
  background: var(--orange);
  border: 2px solid var(--ink);
}
.steps { max-width: 720px; margin: -16px 0 32px; padding-left: 24px; font-size: 19px; }
.steps li { margin-bottom: 6px; }

.frames {
  margin: 48px auto 0;
  border-collapse: collapse;
  background: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  min-width: min(420px, 100%);
}
.frames caption { padding: 14px; font-size: 12px; background: var(--ink); color: var(--cream); }
.frames th, .frames td { padding: 10px 24px; border-bottom: 3px solid var(--peach-light); text-align: left; }
.frames td:last-child, .frames th:last-child { text-align: right; font-weight: 600; }
.frames tbody tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------------
   GIF gallery
   --------------------------------------------------------------------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.gif {
  margin: 0;
  background: var(--gray); /* same gray as the GIF backgrounds, so they blend */
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gif img { width: 256px; max-width: 100%; margin: 0 auto; }
.gif--tricolor { background: #75bed1; } /* sky color of the tricolor GIF; 192px GIF shown 1:1 */
.gif figcaption { padding: 12px; font-size: 10px; text-align: center; background: var(--cream); border-top: 4px solid var(--ink); }

/* ---------------------------------------------------------------------
   Token gate + downloads
   --------------------------------------------------------------------- */
.section--gate { background: var(--peach-light); max-width: none; }
.section--gate > * { max-width: 1052px; margin-left: auto; margin-right: auto; }

.gate {
  padding: 24px;
  background: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.gate__row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.gate__status { display: flex; align-items: center; gap: 12px; margin-top: 20px; min-height: 48px; }
.gate__status p { margin: 0; font-size: 19px; }
.gate__sprite { --s: 1; flex: none; }
.gate--good .gate__status p { color: var(--good); font-weight: 600; }
.gate--bad  .gate__status p { color: var(--bad); font-weight: 600; }
.gate__status a { font-weight: 600; }
.gate__addr { font-family: var(--font-pixel); font-size: 11px; }

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
  margin-top: 36px;
}
.dl {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.dl__thumb {
  position: relative;
  height: 130px;
  display: grid;
  place-items: center;
  background: var(--gray);
  border-bottom: 4px solid var(--ink);
}
.dl__thumb img { max-height: 100%; object-fit: contain; padding: 8px; }
.dl__lock { font-family: var(--font-pixel); font-size: 26px; color: var(--ink); }
.dl__preview { --s: 1.5; }
.dl__body { padding: 14px; flex: 1; }
.dl__body h3 { margin: 0 0 6px; font-size: 10px; }
.dl__body p { margin: 0; font-size: 16px; opacity: .8; }
.dl__btn { margin: 0 14px 14px; text-align: center; }
.is-locked .dl__btn { pointer-events: none; opacity: .45; }

/* ---------------------------------------------------------------------
   License
   --------------------------------------------------------------------- */
.license { margin: 0 0 24px; padding-left: 24px; font-size: 21px; }
.license li { margin-bottom: 8px; }
.credit { margin: 0; font-size: 19px; }

/* ---------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------- */
.footer {
  margin-top: 24px;
  background: var(--cream);
  border-top: 4px solid var(--ink);
  text-align: center;
  font-size: 16px;
}
.footer p { margin: 0; padding: 20px 24px; }
.footer__track {
  position: relative;
  height: 64px;
  overflow: hidden;
  background: linear-gradient(var(--sky), var(--sky) 70%, var(--grass) 70%);
  border-bottom: 4px solid var(--ink);
}
.runner {
  --s: 1;
  position: absolute;
  bottom: -6px;
  left: 0;
  animation: cross 14s linear infinite;
}
@keyframes cross { from { transform: translateX(-80px); } to { transform: translateX(100vw); } }

/* ---------------------------------------------------------------------
   Wallet picker modal
   --------------------------------------------------------------------- */
.modal {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  background: var(--cream);
  color: var(--ink);
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(59, 42, 36, .6); }
.modal h3 { margin: 0 0 20px; font-size: 13px; }
.modal__list { display: grid; gap: 12px; margin-bottom: 20px; }
.modal__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: var(--peach-light);
  border: 3px solid var(--ink);
  cursor: pointer;
}
.modal__item:hover { background: var(--peach); }
.modal__item img, .modal__glyph { width: 28px; height: 28px; flex: none; }
.modal__glyph { background: var(--ink); box-shadow: inset 0 0 0 4px var(--peach-light), inset 0 0 0 8px var(--ink); }
.modal__item small { margin-left: auto; font-size: 14px; font-weight: 400; opacity: .75; }
.modal__item--link { text-decoration: none; background: var(--cream); }
.modal__group { margin: 8px 0 0; font-family: var(--font-pixel); font-size: 9px; opacity: .7; }

/* ---------------------------------------------------------------------
   Responsive & motion
   --------------------------------------------------------------------- */
@media (max-width: 860px) {
  .deco { --s: 2; }
  .deco--5, .deco--6 { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 18px; }
  .nav { gap: 12px; padding: 10px 16px; }
  .nav__links, .nav__brand span:last-child { display: none; }
  #nav-connect, #nav-disconnect { margin-left: auto; white-space: nowrap; }
  .nav__addr { display: none; }
  .hero { padding: 150px 16px 48px; }
  .deco--1, .deco--2 { --s: 2; top: 8px; }
  .deco--3, .deco--4 { display: none; }
  .section { padding: 56px 16px; }
  .scene { padding: 0 16px 40px; }
  .frames th, .frames td { padding: 8px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .runner { animation-play-state: paused; }
  html { scroll-behavior: auto; }
}
