:root {
  --pink: #ff5fa2;
  --pink-dark: #dd347e;
  --beige: #f3e7c9;
  --paper: #fffdf8;
  --ink: #141414;
  --green: #14f195;
  --purple: #9945ff;
  --yellow: #ffd84d;
  --red: #ff3b55;
  --shadow: 6px 6px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--beige);
}

body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, rgb(255 255 255 / 42%) 0 2px, transparent 3px),
    var(--beige);
  background-size: 28px 28px;
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", Chalkboard, cursive;
  line-height: 1.45;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button,
.button,
.nav-link {
  min-height: 44px;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--green);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.15;
  padding: 12px 20px;
  text-align: center;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--yellow);
}

button:active,
.button:active {
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(3px, 3px);
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.62;
}

:focus-visible {
  outline: 4px solid var(--purple);
  outline-offset: 4px;
}

.skip-link {
  left: 12px;
  position: fixed;
  top: -100px;
  z-index: 20;
}

.skip-link:focus {
  top: 12px;
}

.marquee {
  overflow: hidden;
  background: var(--ink);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  white-space: nowrap;
}

.marquee span {
  display: inline-block;
  padding: 7px 24px;
}

.site-header {
  border-bottom: 4px solid var(--ink);
  background: var(--pink);
}

.nav-wrap {
  display: flex;
  width: min(1040px, 100%);
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
}

.brand-link {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.brand-link img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  background: white;
  object-fit: cover;
}

.nav-links {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--ink);
  background: white;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 800;
  padding: 8px 13px;
  text-decoration: none;
}

.nav-link[aria-current="page"],
.nav-link:hover {
  background: var(--green);
}

.home-hero,
.page-hero {
  border-bottom: 4px solid var(--ink);
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: var(--ink);
}

.home-hero-inner,
.page-hero-inner {
  display: grid;
  width: min(1040px, 100%);
  margin: 0 auto;
  align-items: center;
  gap: clamp(20px, 5vw, 64px);
  padding: clamp(34px, 7vw, 72px) 20px;
}

.home-hero-inner {
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
}

.page-hero-inner {
  grid-template-columns: minmax(0, 1fr) minmax(150px, 260px);
  padding-block: clamp(28px, 5vw, 50px);
}

.hero-art {
  width: min(100%, 440px);
  justify-self: center;
  border: 4px solid var(--ink);
  background: white;
  filter: drop-shadow(9px 9px 0 var(--ink));
}

.page-hero .hero-art {
  max-height: 260px;
  object-fit: contain;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(50px, 10vw, 104px);
  letter-spacing: -3px;
  line-height: 0.92;
  text-shadow: 5px 5px 0 white;
}

.page-hero h1 {
  font-size: clamp(42px, 8vw, 78px);
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 5vw, 46px);
  letter-spacing: -1px;
  line-height: 1.05;
  text-decoration: underline wavy var(--pink);
  text-decoration-thickness: 3px;
  text-underline-offset: 8px;
}

h3 {
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.1;
}

p {
  font-size: 18px;
}

.tagline,
.lede {
  max-width: 680px;
  font-size: clamp(18px, 2.7vw, 25px);
}

.tagline {
  margin: 18px 0 24px;
}

.lede {
  margin: 14px 0 0;
}

.eyebrow,
.status-label,
.tiny-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  border: 3px solid var(--ink);
  background: var(--green);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  padding: 6px 10px;
  font-size: 13px;
}

.hero-actions,
.form-actions,
.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button.alt,
button.alt {
  background: white;
}

.mint-card {
  display: inline-block;
  max-width: 100%;
  margin-top: 22px;
  border: 3px dashed var(--green);
  background: var(--ink);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  padding: 11px 14px;
}

main section,
.section {
  width: min(940px, 100%);
  margin: 0 auto;
  padding: 42px 20px;
}

.narrow {
  width: min(760px, 100%);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 18px;
}

.card,
.panel {
  min-width: 0;
  border: 4px solid var(--ink);
  background: white;
  box-shadow: var(--shadow);
  padding: 20px;
}

.card strong,
.big-number {
  display: block;
  margin-bottom: 6px;
  color: var(--purple);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 900;
  line-height: 1.05;
}

.rule-card strong {
  color: var(--pink-dark);
  font-size: clamp(27px, 5vw, 40px);
}

.panel + .panel,
.panel + section,
section + .panel {
  margin-top: 26px;
}

.dry-run-banner,
.notice {
  width: min(940px, calc(100% - 40px));
  margin: 22px auto 0;
  border: 4px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 900;
}

.dry-run-banner {
  background: var(--yellow);
}

.notice {
  background: white;
}

.hidden {
  display: none !important;
}

.slop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  align-items: start;
  gap: 24px;
}

label,
legend {
  font-weight: 900;
}

textarea,
input[type="text"],
input[type="file"] {
  width: 100%;
  border: 4px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  padding: 12px;
}

textarea {
  min-height: 170px;
  margin-top: 8px;
  resize: vertical;
}

input[type="file"] {
  min-height: 52px;
  margin-top: 8px;
}

input[type="file"]::file-selector-button {
  min-height: 36px;
  margin-right: 10px;
  border: 3px solid var(--ink);
  background: var(--pink);
  font: inherit;
  font-weight: 800;
}

.image-field {
  display: block;
}

.image-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.image-picker {
  display: flex;
  min-height: 52px;
  margin-top: 8px;
  align-items: center;
  justify-content: center;
  border: 4px dashed var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.image-field:focus-within .image-picker {
  outline: 4px solid var(--purple);
  outline-offset: 4px;
}

.is-dragging .image-picker {
  border-style: solid;
  background: var(--yellow);
}

.file-hint {
  margin: 6px 0 0;
  color: #555;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.image-preview {
  position: relative;
  width: 160px;
  max-width: 100%;
  margin-top: 12px;
  border: 4px solid var(--ink);
  background: var(--pink);
}

.image-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

button.image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border-width: 3px;
  background: white;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 27px;
  line-height: 1;
  padding: 0;
}

.field + .field {
  margin-top: 20px;
}

.field-help,
.small-copy {
  color: #454545;
  font-size: 14px;
}

.field-help {
  margin: 7px 0 0;
}

.form-actions {
  margin-top: 24px;
}

.form-actions > button {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 190px;
}

.status-panel {
  position: sticky;
  top: 18px;
  background: var(--paper);
}

.status-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-orb {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #bbb;
}

.status-panel[data-state="quoting"] .status-orb,
.status-panel[data-state="verifying"] .status-orb,
.status-panel[data-state="rendering"] .status-orb {
  background: var(--yellow);
  animation: throb 0.8s steps(2, end) infinite;
}

.status-panel[data-state="awaiting-signature"] .status-orb {
  background: var(--purple);
}

.status-panel[data-state="done"] .status-orb {
  background: var(--green);
}

.status-panel[data-state="ready"] .status-orb {
  background: var(--green);
}

.status-panel[data-state="refused"] .status-orb,
.status-panel[data-state="error"] .status-orb {
  background: var(--red);
}

@keyframes throb {
  50% { transform: scale(0.66); }
}

.status-copy {
  min-height: 58px;
  margin-bottom: 0;
}

.quote-paper {
  margin-top: 18px;
  border: 3px dashed var(--ink);
  background: white;
  padding: 14px;
}

.quote-paper dl,
.details-list {
  margin: 0;
}

.quote-paper div,
.details-list div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
}

dt {
  font-weight: 900;
}

dd {
  margin: 0;
  text-align: right;
}

.result-card {
  margin-top: 26px;
}

.result-card img {
  width: 100%;
  border: 4px solid var(--ink);
  background: var(--pink);
}

.caption {
  font-size: clamp(20px, 4vw, 29px);
  font-weight: 900;
}

.receipt,
.wallet-address {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  margin-bottom: 28px;
}

.summary-card {
  border: 4px solid var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 16px;
}

.summary-card:nth-child(2n) {
  background: var(--green);
}

.table-wrap {
  border: 4px solid var(--ink);
  background: white;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

caption {
  padding: 14px;
  font-size: 20px;
  font-weight: 900;
  text-align: left;
}

th,
td {
  border-top: 3px solid var(--ink);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

thead th {
  background: var(--pink);
}

.tx-link {
  color: #4c1592;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 900;
}

.wallet-list {
  display: grid;
  gap: 14px;
}

.wallet-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 3px solid var(--ink);
  background: var(--paper);
  padding: 12px;
}

.wallet-name {
  font-weight: 900;
}

.copy-button {
  min-width: 78px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 9px 12px;
}

.machine-aside {
  width: min(100%, 330px);
  margin-inline: auto;
  filter: drop-shadow(8px 8px 0 var(--ink));
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.65fr);
  align-items: center;
  gap: 34px;
}

.footer {
  margin-top: 48px;
  border-top: 4px solid var(--ink);
  background: var(--ink);
  color: #ddd;
  padding: 28px 20px;
  text-align: center;
}

.footer p {
  width: min(780px, 100%);
  margin: 0 auto;
  font-size: 14px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 720px) {
  .home-hero-inner,
  .page-hero-inner,
  .slop-layout,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .mint-card {
    text-align: left;
  }

  .hero-art {
    width: min(82vw, 360px);
    grid-row: 1;
  }

  .page-hero .hero-art {
    width: min(54vw, 230px);
  }

  .status-panel {
    position: static;
  }

  .wallet-row {
    grid-template-columns: 1fr auto;
  }

  .wallet-address {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 600px) {
  .nav-wrap {
    flex-wrap: wrap;
    justify-content: center;
    padding-inline: 16px;
  }

  .nav-links {
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .nav-link {
    padding-inline: 4px;
    font-size: 14px;
  }

  main section,
  .section {
    padding-inline: 16px;
  }

  .dry-run-banner,
  .notice {
    width: calc(100% - 32px);
  }

  .panel,
  .card {
    padding: 16px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  tbody tr {
    border-top: 4px solid var(--ink);
    padding: 8px 12px;
  }

  tbody td {
    display: grid;
    grid-template-columns: minmax(76px, 0.38fr) minmax(0, 1fr);
    gap: 10px;
    border: 0;
    padding: 6px 0;
  }

  tbody td::before {
    content: attr(data-label);
    font-weight: 900;
  }
}

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