@font-face {
  font-family: Bricolage;
  src: url("./assets/bricolage.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "DM Sans";
  src: url("./assets/dm-sans.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #fff7eb;
  --ink: #161318;
  --red: #f52c40;
  --red-dark: #b7192d;
  --acid: #e1fb57;
  --lilac: #cabdff;
  --gold: #ffc557;
  --line: #d7c9c0;
  --muted: #61565b;
  --display: Bricolage, "Arial Black", sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 16px/1.5 var(--body); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); }
button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid #3855dc; outline-offset: 4px; }
.site-header :focus-visible, .contract :focus-visible, .preview :focus-visible, .site-footer :focus-visible { outline-color: var(--acid); }
[hidden] { display: none !important; }
.svg-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.shell { width: min(1160px, calc(100% - 88px)); margin-inline: auto; }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-header { border-bottom: 2px solid var(--ink); }
.header-inner { min-height: 72px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 800 26px/1 var(--display);
  letter-spacing: -.035em;
  text-decoration: none;
  white-space: nowrap;
}
.brand svg { width: 37px; height: 34px; transform: rotate(-12deg); }
.brand-period { color: var(--acid); }
nav { display: flex; align-items: center; gap: 28px; }
.nav-link { text-decoration: none; font-size: .94rem; font-weight: 750; }
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-social { display: inline-grid; min-width: 28px; min-height: 38px; place-items: center; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.18;
  transition: background-color .15s, color .15s, box-shadow .15s, transform .15s;
}
.button svg { height: 22px; width: 22px; flex: none; }
.button-small { min-height: 39px; padding: 7px 13px; font-size: .88rem; }
.button-outline { border: 1px solid var(--paper); }
.button-outline:hover { background: var(--paper); color: var(--ink); }
.button-acid { background: var(--acid); border-color: var(--ink); color: var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.button-acid:hover { background: #edff9c; transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }

.hero {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
  background-color: var(--red);
  background-image: radial-gradient(#14131832 .8px, transparent .8px);
  background-size: 11px 11px;
  overflow: hidden;
}
.hero-inner { min-height: 512px; display: grid; grid-template-columns: 1fr 1.05fr; align-items: center; gap: 28px; }
.hero-copy { padding-block: 54px 60px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(4rem, 7.65vw, 7.35rem); font-weight: 800; line-height: .87; letter-spacing: -.042em; }
.hero h1 span { color: var(--paper); }
.hero p { max-width: 420px; margin-top: 23px; font-size: 1.18rem; font-weight: 650; line-height: 1.45; }
.hero-button { margin-top: 23px; padding-inline: 18px; }
.hero-button svg { width: 28px; height: 26px; }

.hero-art { aspect-ratio: 1.3; width: 100%; position: relative; isolation: isolate; }
.avatar {
  position: absolute;
  display: block;
  padding: 7px;
  border: 2px solid var(--ink);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  color: var(--ink);
  text-decoration: none;
  transition: transform .17s;
}
.avatar-picture { aspect-ratio: 1; position: relative; isolation: isolate; }
.avatar-picture img { width: 100%; height: 100%; border: 1px solid var(--ink); border-radius: 4px; object-fit: cover; }
.avatar-hat { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.avatar span { display: block; padding: 5px 1px 0; font: 800 1rem/1.15 var(--display); letter-spacing: -.02em; }
.avatar-nouns { width: 37%; top: 19%; left: 0; transform: rotate(-16deg); background: var(--lilac); z-index: 2; }
.avatar-nouns:hover, .avatar-nouns:focus-visible { transform: translateY(-8px) rotate(-13deg); z-index: 5; }
.avatar-nouns img, .sample[data-sample="nouns"] img { image-rendering: pixelated; }
.avatar-bonk { width: 35%; top: 34%; right: 1%; transform: rotate(15deg); background: var(--acid); z-index: 3; }
.avatar-bonk span { text-align: right; }
.avatar-bonk:hover, .avatar-bonk:focus-visible { transform: translateY(-8px) rotate(12deg); z-index: 5; }
.avatar-cult { width: 53%; top: 12%; left: 23%; transform: rotate(-5deg); z-index: 4; }
.avatar-cult:hover, .avatar-cult:focus-visible { transform: translateY(-8px) rotate(-3deg); z-index: 6; }

.star { position: absolute; width: 8%; height: auto; pointer-events: none; z-index: 7; }
.star-one { top: 8%; right: 11%; width: 13%; color: var(--acid); filter: drop-shadow(2px 2px var(--ink)); transform: rotate(12deg); }
.star-two { top: 28%; right: 6%; width: 4%; color: var(--paper); }
.star-three { bottom: 16%; left: 12%; width: 8%; color: var(--paper); transform: rotate(-9deg); }
.star-four { bottom: 12%; right: 22%; width: 4.5%; color: var(--acid); }

.contract { background: #1d1820; }
.contract-inner { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px 18px; padding-block: 14px; }
.contract h2 { font-size: 1rem; line-height: 1.25; font-weight: 800; }
.contract-pending { color: var(--acid); font-size: .9rem; }
.contract-details { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.contract-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  flex: 0 1 510px;
  min-width: 0;
  padding: 4px 4px 4px 13px;
  border: 1px solid #514556;
  border-radius: 11px;
  background: #28202b;
}
.contract-field code { font: .84rem/1.45 ui-monospace, monospace; color: var(--paper); overflow-wrap: anywhere; user-select: all; }
.contract-copy { min-width: 87px; min-height: 36px; padding: 6px 9px; gap: 6px; color: var(--ink); background: var(--acid); }
.contract-copy svg { height: 16px; width: 16px; }
.contract-copy:hover, .contract-copy[data-copied] { background: #edfba0; }
.contract-copy:focus-visible { outline-offset: 2px; }
.contract-message { flex-basis: 100%; font-size: .875rem; }
.contract-message:empty { display: none; }

@media (max-width: 780px) {
  .contract-inner { grid-template-columns: minmax(0, 1fr); }
  .contract-field { flex: 0 1 100%; }
}

.studio-section { position: relative; padding: 48px 0 49px; background: var(--paper); color: var(--ink); scroll-margin-top: 12px; }
.studio-section::before { content: ""; position: absolute; inset: 0 0 auto; height: 7px; background: repeating-linear-gradient(125deg, var(--ink) 0 11px, var(--paper) 11px 22px); }
.section-heading { max-width: 960px; margin: 0 auto 25px; }
.section-heading h2, .how h2 { font-size: clamp(2.25rem, 5.1vw, 4.1rem); line-height: .98; letter-spacing: -.045em; font-weight: 800; }
.section-heading p { margin-top: 8px; color: var(--muted); }
.studio { max-width: 960px; margin-inline: auto; display: grid; grid-template-columns: 1.06fr 1fr; border: 2px solid var(--ink); border-radius: 14px; overflow: hidden; box-shadow: 6px 7px var(--ink); }
.controls, .preview { padding: clamp(20px, 3vw, 32px); }
.controls, .preview { min-width: 0; }
.controls h3, fieldset legend, .preview h3 { font: 800 1.25rem/1.1 var(--display); letter-spacing: -.03em; }
.dropzone {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  gap: 12px;
  padding: 13px;
  margin-top: 10px;
  background: #f6e8e2;
  border: 1px dashed #8c696d;
  border-radius: 7px;
}
.dropzone:hover, .dropzone.dragover { background: #f8d8da; border-color: var(--ink); }
.dropzone svg { width: 22px; height: 22px; flex: none; }
.dropzone strong, .dropzone small { display: block; overflow-wrap: anywhere; }
.dropzone small { font-size: .83rem; color: var(--muted); margin-top: 1px; }

.sample-picker, .hat-options { min-width: 0; margin: 19px 0 0; border: 0; padding: 0; }
.sample-picker legend, .hat-options legend { padding: 0; margin-bottom: 8px; }
.sample-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.sample {
  display: grid;
  justify-items: center;
  min-width: 0;
  gap: 3px;
  padding: 4px 2px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-size: .78rem;
  font-weight: 800;
  line-height: 1.22;
  text-align: center;
}
.sample:hover { border-color: #8c696d; }
.sample[aria-pressed="true"] { border-color: var(--ink); background: var(--acid); }
.sample img { aspect-ratio: 1; width: min(52px, 100%); height: auto; object-fit: cover; border: 1px solid var(--ink); border-radius: 5px; }

.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.style {
  display: grid;
  justify-items: center;
  padding: 3px 4px 6px;
  font-size: .84rem;
  font-weight: 750;
  background: #f6e8e2;
  border: 1px solid #e3cdc6;
  border-radius: 7px;
}
.style:hover { border-color: var(--ink); }
.style[aria-pressed="true"] { background: var(--lilac); border-color: var(--ink); }
.style canvas { width: 62px; height: auto; }
.adjustments { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.range-control label { display: flex; justify-content: space-between; gap: 4px; font-weight: 750; font-size: .88rem; }
.range-control output { font-weight: 600; color: var(--muted); }
.range-control input { width: 100%; margin: 6px 0 0; accent-color: var(--red-dark); }
.control-footer { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 9px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.round-toggle { display: inline-flex; align-items: center; gap: 7px; font-weight: 740; font-size: .88rem; cursor: pointer; }
.round-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.reset { display: inline-flex; align-items: center; padding: 0; gap: 4px; background: none; border: 0; font-weight: 750; font-size: .88rem; }
.reset:hover { text-decoration: underline; }
.reset svg { width: 17px; height: 17px; }

.preview { background: var(--ink); color: var(--paper); display: flex; flex-direction: column; }
.preview-heading { display: flex; justify-content: space-between; align-items: center; gap: 7px; margin-bottom: 10px; }
.preview-heading span { color: #d9d2dc; font-size: .83rem; }
.canvas-frame {
  background: repeating-conic-gradient(#e2d9f7 0 25%, #fff7eb 0 50%) 0 0 / 20px 20px;
  border: 1px solid var(--paper);
  border-radius: 7px;
  overflow: hidden;
}
#preview { width: 100%; height: auto; aspect-ratio: 1; cursor: grab; touch-action: none; }
#preview:focus-visible { outline-offset: -5px; outline-color: var(--acid); }
#preview.dragging { cursor: grabbing; }
.preview-hint { margin: 7px 0 11px; color: #d9d2dc; font-size: .83rem; }
.download { width: 100%; background: var(--acid); color: var(--ink); margin-top: auto; min-height: 45px; }
.download:hover { background: #edff9c; }
.download:disabled { opacity: .62; }
.status { margin-top: 7px; color: var(--muted); font-size: .89rem; }
.status:empty { display: none; }
.status[data-error="true"] { color: var(--red-dark); font-weight: 750; }
.privacy { max-width: 960px; margin: 17px auto 0; display: flex; align-items: center; gap: 5px; font-size: .86rem; color: var(--muted); }
.privacy svg { width: 16px; height: 16px; }

.how { max-width: 960px; padding-block: 52px 63px; scroll-margin-top: 15px; }
.how h2 { font-size: clamp(2.1rem, 4vw, 3.35rem); }
.how ol { padding: 0; margin: 25px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; list-style: none; counter-reset: steps; }
.how li { border-top: 1px solid #766c79; padding: 14px 8px 0 42px; position: relative; counter-increment: steps; }
.how li::before { content: counter(steps); position: absolute; left: 0; top: 13px; height: 29px; width: 29px; display: grid; place-items: center; border-radius: 5px; color: var(--ink); background: var(--acid); font: 800 1rem var(--display); }
.how li:nth-child(2)::before { background: var(--lilac); }
.how li:nth-child(3)::before { background: var(--gold); }
.how h3 { font-size: 1.25rem; letter-spacing: -.025em; line-height: 1.18; }
.how p { margin-top: 6px; color: #ded5da; }
.site-footer { border-top: 1px solid #51464f; }
.footer-inner { min-height: 72px; padding-block: 14px; align-items: flex-start; }
.credits { font-size: .875rem; line-height: 1.45; margin-top: 6px; max-width: 420px; }
.credits summary { cursor: pointer; text-align: right; }
.credits p { margin-top: 8px; color: #ded5da; }
.credits a { text-underline-offset: 2px; }

@media (max-width: 960px) {
  .hero-inner { min-height: 410px; gap: 14px; }
  .hero-copy { padding-block: 42px; }
  .hero p { margin-top: 17px; font-size: 1.08rem; }
  .avatar { padding: 5px; box-shadow: 4px 4px 0 var(--ink); }
  .avatar span { font-size: .85rem; }
}

@media (max-width: 690px) {
  .shell { width: calc(100% - 36px); }
  .header-inner { min-height: 60px; }
  .brand { font-size: 22px; gap: 5px; }
  .brand svg { width: 31px; height: 28px; }
  nav { gap: 12px; }
  .hero-inner { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-height: auto; }
  .hero-copy { padding-block: 34px 0; }
  .hero h1 { font-size: clamp(3.8rem, 12vw, 6rem); }
  .hero p { margin-top: 15px; }
  .hero-button { margin-top: 18px; min-height: 47px; }
  .hero-art { width: min(100%, 480px); margin: 0 auto 17px; }
  .studio-section { padding: 34px 0 32px; }
  .section-heading { margin-bottom: 18px; }
  .studio { grid-template-columns: 1fr; box-shadow: 4px 5px var(--ink); border-radius: 11px; }
  .how { padding-block: 39px 43px; }
  .how ol { grid-template-columns: 1fr; gap: 17px; margin-top: 18px; }
  .footer-inner { flex-wrap: wrap; }
  .credits summary { text-align: left; }
}

@media (max-width: 420px) {
  nav .nav-link:not(.nav-social) { display: none; }
  .header-inner { gap: 8px; }
  .header-inner .brand { font-size: clamp(1.05rem, 5.15vw, 1.375rem); }
  .header-inner nav { gap: 7px; }
  .header-inner .button { padding-inline: 10px; }
  .avatar { padding: 4px; border-radius: 7px; }
  .avatar span { font-size: .79rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
