:root {
  --control-paper: #fff1d6;
  --control-edge: #32203f;
  --control-gold: #ffda4d;
  --control-pressed: #f2bb32;
}

.button,
:is(.stories-bottom, .support-title, .document-paper, .support-action-row, .community-strip) .button,
.hero-copy > .button,
.game-pitch > .game-cta,
.support-header .support-back,
.support-action-row > a:not(.button),
.token-stake-link,
.gallery-instagram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 46px;
  padding: 10px clamp(15px, 2vw, 25px);
  border: 1px solid var(--control-edge);
  border-radius: 4px 12px 4px 4px;
  background: var(--control-fill, var(--control-gold));
  color: var(--ink);
  box-shadow: 0 3px 0 var(--control-edge);
  transform: none;
  font: 700 clamp(14px, 1.35vw, 18px)/1.2 var(--body);
  letter-spacing: .055em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.button-cyan,
.button-pink,
.support-back,
.support-action-row > a:not(.button),
.token-stake-link,
.gallery-instagram { --control-fill: var(--control-paper); }

.button:hover,
:is(.stories-bottom, .support-title, .document-paper, .support-action-row, .community-strip) .button:hover,
.hero-copy > .button:hover,
.game-pitch > .game-cta:hover,
.support-back:hover,
.support-action-row > a:not(.button):hover,
.token-stake-link:hover,
.gallery-instagram:hover {
  background: var(--control-gold);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--control-edge);
  transform: translateY(-1px);
  text-decoration: none;
}

.hero-copy > .button {
  min-width: min(224px, 100%);
  min-height: 49px;
  font-size: clamp(15px, 1.38vw, 20px);
}

.hero-copy > .button::before {
  content: '';
  flex: 0 0 19px;
  height: 18px;
  background: currentColor;
  mask: url('assets/diego-mark.svg') center / contain no-repeat;
}

.gallery-instagram::before {
  content: '';
  flex: 0 0 17px;
  height: 17px;
  background: currentColor;
  mask: url('assets/cartoon/iglogo_r.svg') center / contain no-repeat;
}

.button:not(:disabled):active,
.hero-copy > .button:active,
.game-pitch > .game-cta:active {
  background: var(--control-pressed);
  box-shadow: 0 1px 0 var(--control-edge);
  transform: translateY(2px);
}

.campaign-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  color: #d4fffb;
  text-decoration: underline;
  text-underline-offset: .3em;
  text-decoration-thickness: 1px;
}

.reference-home .menu-toggle {
  display: flex;
  flex-direction: row;
  width: auto;
  height: 45px;
  padding: 0 13px;
  gap: 9px;
  border: 1px solid var(--control-edge);
  border-radius: 4px 11px 4px 4px;
  background: var(--control-paper);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--control-edge);
  font: 700 13px/1 var(--body);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.reference-home .menu-toggle:hover,
.reference-home .menu-toggle[aria-expanded='true'] { background: var(--control-gold); }

.reference-home .menu-toggle span { width: auto; height: auto; background: none; }
.reference-home .menu-toggle .menu-lines { width: 15px; height: 9px; position: relative; }
.menu-lines::before, .menu-lines::after {
  content: '';
  position: absolute;
  left: 0;
  height: 2px;
  background: currentColor;
}
.menu-lines::before { top: 0; width: 100%; }
.menu-lines::after { bottom: 0; width: 70%; }

.hero-socials {
  gap: clamp(4px, .5cqw, 10px);
}

.hero-socials > :is(a, button) {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  box-shadow: none;
  touch-action: manipulation;
}

.hero-socials > :is(a, button):hover { filter: none; }

.hero-socials img {
  display: block;
  width: 40px;
  height: 40px;
  pointer-events: none;
}

.hero-socials > :is(a, button):is(:active, .is-pressed) img { filter: brightness(1.22); }

@media (prefers-reduced-motion: no-preference) {
  body:not(.motion-off) .hero-socials img {
    transition: transform 230ms cubic-bezier(.22, .8, .36, 1), filter 180ms ease;
  }

  @media (hover: hover) and (pointer: fine) {
    body:not(.motion-off) .hero-socials > :is(a, button):hover img {
      transform: translateY(-3px) scale(1.07);
      filter: brightness(1.1) drop-shadow(0 5px 5px #200629a6);
    }

    body:not(.motion-off) .hero-socials > :is(a, button):hover:not(:active)::after {
      position: absolute;
      inset: 2px;
      border-radius: 9px;
      background: linear-gradient(115deg, transparent 36%, #fff3bf8c 49%, transparent 62%) 100% 0 / 260% 100%;
      pointer-events: none;
      transform: translateY(-3px) scale(1.07);
      animation: hero-social-sheen 440ms ease-out both;
      content: '';
    }
  }

  body:not(.motion-off) .hero-socials > :is(a, button):is(:active, .is-pressed) img {
    transform: translateY(1px) scale(.91);
    filter: brightness(1.22);
    transition-duration: 90ms;
  }
}

@keyframes hero-social-sheen {
  from { background-position: 100% 0; opacity: 0; }
  30% { opacity: 1; }
  to { background-position: 0 0; opacity: 0; }
}

.reference-footer-socials {
  --social-gap: clamp(4px, .55cqw, 12px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, max(calc(132px + 2 * var(--social-gap)), 14cqw));
  gap: var(--social-gap);
  margin: 0;
}

.reference-footer-socials > :is(a, button) { border-radius: 5px; }
.reference-footer-socials > :is(a, button):hover { background: #2d083935; }

.reference-footer-socials > .social-token-x { position: relative; }

.reference-footer-socials .footer-social-icon--token {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(44px, 4.2cqw, 64px);
  max-width: none;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 #fff5df) drop-shadow(0 0 #fff5df) drop-shadow(0 0 #fff5df);
}

@media (max-width: 760px) {
  .reference-footer-socials { width: min(100%, max(calc(132px + 2 * var(--social-gap)), 30cqw)); }
}

.dialog-close,
.comic-play {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--control-edge);
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--control-edge);
  background: var(--control-paper);
  color: var(--ink);
}

.dialog-close::before,
.dialog-close::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 2px;
  background: currentColor;
  transform: rotate(45deg);
}

.dialog-close::after { transform: rotate(-45deg); }
.dialog-close:hover, .comic-play:hover { background: var(--control-gold); transform: none; }

.stake-wallet-button,
.stake-wallet-list button,
.stake-inline-actions button {
  min-height: 44px;
  border: 1px solid var(--control-edge);
  border-radius: 4px 8px 4px 4px;
  box-shadow: 0 2px 0 var(--control-edge);
}

.stake-wallet-button { padding-inline: 10px; }
.stake-wallet-list button { background: var(--control-paper); }
.stake-wallet-button.is-connected { background: #dcf4ec; }
.stake-wallet-button:enabled:hover,
.stake-wallet-list button:enabled:hover,
.stake-inline-actions button:enabled:hover { background: var(--control-gold); }

.stake-rewards label > span,
.stake-pool-face {
  border-width: 1px;
  border-radius: 5px;
  box-shadow: none;
}

.stake-pool input:checked + span,
.stake-rewards input:checked + span {
  border-color: #63357a;
  background: #f0e3fa;
  box-shadow: inset 0 -3px #63357a;
}

.stake-action:disabled,
.stake-action:disabled:hover,
.stake-inline-actions button:disabled {
  background: #e9decf;
  color: #655669;
  box-shadow: none;
  transform: none;
}

.button:focus-visible,
.reference-home .menu-toggle:focus-visible,
.dialog-close:focus-visible,
.hero-socials > :is(a, button):focus-visible,
.reference-footer-socials > :is(a, button):focus-visible,
.stake-wallet-button:focus-visible {
  outline: 2px solid var(--control-paper);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
}

.hero-socials > :is(a, button):focus-visible { z-index: 1; }
