/* fill.fun v3: a blank canvas on an easel, on white. */

@font-face { font-family: "Comic Neue"; font-weight: 400; font-display: swap; src: url(fonts/ComicNeue-Regular.woff2) format("woff2"); }
@font-face { font-family: "Comic Neue"; font-weight: 700; font-display: swap; src: url(fonts/ComicNeue-Bold.woff2) format("woff2"); }

:root {
  --ink: #111;
  --soft: #555;
  --wood: #b07030;
  --comic: "Comic Sans MS", "Comic Sans", "Comic Neue", "Chalkboard SE", cursive;
  --pad: clamp(18px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: #fff; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 20px/1.45 var(--comic); overflow-x: hidden; }
p, h1, h2, ul { margin: 0; }
h1, h2 { font-weight: 400; }
ul { padding: 0; list-style: none; }
img { max-width: 100%; }
a { color: inherit; text-decoration-color: var(--wood); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.tagline, .h, .m, .hung-title, .nft-note { text-wrap: balance; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--wood); outline-offset: 3px; }

.link { text-decoration: underline; text-decoration-color: var(--wood); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.link:hover { color: var(--wood); }
.btn { padding: 5px 18px 7px; border: 2px solid var(--ink); background: #fff; font-size: 19px; }
.btn:hover:not(:disabled) { background: var(--ink); color: #fff; }
.btn:disabled { opacity: .5; }

/* ---------- top bar ---------- */

.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1280px; margin: 0 auto; padding: 14px var(--pad); background: #fff;
}
.top-name { font-size: 28px; font-weight: 700; text-decoration: none; line-height: 1; }
.top-nav { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px 22px; font-size: 17px; }
.top-nav a { text-decoration: none; }
.top-nav a:hover { color: var(--wood); }
.chip { padding: 3px 12px 4px; border: 2px solid var(--ink); font-size: 15px; }
.chip:not(:disabled):hover { background: var(--ink); color: #fff; }
.chip:disabled { color: var(--ink); }

/* ---------- the easel ---------- */

.hero { display: flex; flex-direction: column; align-items: center; padding: 10px var(--pad) 70px; text-align: center; }
.easel {
  position: relative;
  width: min(86vw, 420px, calc((100svh - 300px) * .638));
  min-width: 250px;
  transform-origin: 50% 96%;
}
.hero:not(.is-editing) .easel:hover { animation: sway 2.6s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: translateY(-4px) rotate(0deg); } 30% { transform: translateY(-4px) rotate(-1.1deg); } 70% { transform: translateY(-4px) rotate(1.1deg); } }
.easel-art { display: block; width: 100%; height: auto; }
/* the white of the canvas on the easel, in the svg's own units: x 322..678, y 262..628 of a 440 x 690 box from 280, 215 */
.easel-canvas { position: absolute; left: 9.5455%; top: 6.8116%; width: 80.9091%; height: 53.0435%; }
.easel-canvas canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: url(img/cursor-bucket.png) 1 31, pointer; touch-action: manipulation; }
.is-editing .easel-canvas canvas { cursor: crosshair; touch-action: none; }
.is-editing canvas[data-paint="fill"] { cursor: url(img/cursor-bucket.png) 1 31, crosshair; }
.bucket { position: absolute; left: 0; top: 0; width: 40px; height: 40px; image-rendering: pixelated; pointer-events: none; }
.bucket.is-gliding { transition: transform .38s cubic-bezier(.3, .7, .3, 1); }

.tagline { margin-top: 18px; font-size: clamp(30px, 4.6vw, 56px); line-height: 1.1; }
.is-editing .tagline { display: none; }
.is-hanging .mine, .is-hanging [data-hang] { display: none; }
.mine { margin-top: 10px; font-size: clamp(21px, 2.4vw, 30px); min-height: 1.45em; }
.mine-blank { font-weight: 700; }
.caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -.12em; background: var(--ink); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hint { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin-top: 10px; font-size: 18px; }
.hint .arrow { width: 30px; height: 42px; margin-bottom: 6px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.on-touch { display: none; }
@media (hover: none) { .on-touch { display: inline; } .on-mouse { display: none; } }

/* the tray slides out under the easel */
.tray { margin-top: 22px; width: min(100%, 620px); display: flex; flex-direction: column; align-items: center; gap: 14px; animation: tray-in .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes tray-in { from { opacity: 0; transform: translateY(-14px); } }
.tray-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 6px 18px; }
.tray-sep { width: 1px; height: 18px; background: #ccc; align-self: center; }
.tool { font-size: 19px; padding: 2px 0; }
.tool[aria-pressed="true"] { text-decoration: underline; text-decoration-color: var(--wood); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.tool:hover:not(:disabled) { color: var(--wood); }
.tool:disabled { opacity: .3; }
.dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.dot { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); transition: transform .12s; }
.dot:hover { transform: scale(1.12); }
.dot[aria-pressed="true"] { transform: scale(1.2); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--wood); }

.hang { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 6px; animation: tray-in .3s cubic-bezier(.2, .8, .2, 1); }
.hang-line { font-size: clamp(20px, 2.3vw, 26px); }
.hang input { width: min(58vw, 20ch); border: 0; border-bottom: 2px solid var(--ink); padding: 0 2px 2px; font: inherit; font-weight: 700; background: none; color: var(--ink); border-radius: 0; }
.hang input:focus { outline: none; border-bottom-color: var(--wood); }
.hang-by { font-size: 18px; }
.hang-by input { width: 17ch; font-weight: 400; }
.wallet { font-size: 17px; }
.wallet-pick .link { margin: 0 4px; }
.wallet-on [data-wallet-short] { font-weight: 700; }
.wallet-none { color: var(--soft); font-size: 15px; }
.hung-nft { margin-top: 6px; font-size: 17px; color: var(--soft); }
.consent { max-width: 440px; font-size: 15px; line-height: 1.4; color: var(--soft); }
.hang-btns { display: flex; align-items: baseline; gap: 18px; }
.say { min-height: 1.4em; font-size: 17px; color: var(--wood); }
.hung { margin-top: 18px; animation: tray-in .35s cubic-bezier(.2, .8, .2, 1); }
.hung-title { font-size: clamp(20px, 2.2vw, 26px); }
.hung-links { margin-top: 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; font-size: 18px; }

/* splats: img/splats are white blobs with a black outline. the colour is masked to the blob, the art multiplied on top */
.splat {
  --w: calc(var(--s) * 1.6);
  position: absolute; z-index: 5; width: var(--w); height: var(--w); margin: calc(var(--w) / -2) 0 0 calc(var(--w) / -2);
  pointer-events: none; isolation: isolate;
  animation: splat 1.6s forwards;
}
.splat::before, .splat::after { content: ""; position: absolute; inset: 0; rotate: var(--r); }
.splat::before { background: var(--c); -webkit-mask: var(--img) center / contain no-repeat; mask: var(--img) center / contain no-repeat; }
.splat::after { background: var(--img) center / contain no-repeat; mix-blend-mode: multiply; }
@keyframes splat {
  0% { transform: scale(.2); opacity: 1; }
  12% { transform: scale(1.15); }
  22% { transform: scale(1); }
  65% { opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}
.fly { position: fixed; z-index: 40; pointer-events: none; image-rendering: pixelated; }

/* ---------- scroll reveals ---------- */

.js .rise { opacity: 0; transform: translateY(20px); transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .rise.in { opacity: 1; transform: none; }

/* ---------- every section: same rhythm, centered, a small wood label on top ---------- */

.sec { max-width: 1200px; margin: 0 auto; padding: clamp(80px, 11vw, 150px) var(--pad) 0; text-align: center; }
.label { display: inline-block; margin-bottom: 18px; font-size: 16px; font-weight: 700; color: var(--wood); letter-spacing: .02em; }
.label::before { content: ""; display: inline-block; width: 26px; height: 3px; margin: 0 10px 5px 0; background: var(--wood); vertical-align: middle; }
.h { font-size: clamp(32px, 4.6vw, 60px); line-height: 1.08; }

/* ---------- manifesto: a centered poem with paint swipes ---------- */

.manifesto { max-width: 880px; }
.stanza { margin-top: clamp(44px, 6vw, 76px); }
.stanza:first-of-type { margin-top: 10px; }
.m { margin: .3em auto 0; max-width: 24ch; isolation: isolate; }
.m-s { max-width: 34ch; font-size: clamp(20px, 2.2vw, 26px); line-height: 1.35; color: var(--soft); }
.m-m { font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; }
.m-l { font-size: clamp(34px, 5.2vw, 66px); line-height: 1.08; }
.m-xl { margin-top: clamp(56px, 8vw, 100px); font-size: clamp(72px, 13vw, 170px); font-weight: 700; line-height: 1; }
.m-xl a { text-decoration: none; }
.m-xl a:hover { color: var(--wood); }
/* a wood-coloured paint swipe behind the key words, brushed in once the line is on screen */
.swipe { position: relative; white-space: nowrap; }
.swipe::before {
  content: ""; position: absolute; z-index: -1; left: -.14em; right: -.14em; bottom: .02em; height: .5em;
  background: #ecc896; border-radius: 38% 62% 47% 53% / 60% 45% 55% 40%;
  transform: scaleX(0) rotate(-1.4deg); transform-origin: left center;
  transition: transform .7s cubic-bezier(.6, 0, .3, 1) .45s;
}
.in .swipe::before, html:not(.js) .swipe::before { transform: scaleX(1) rotate(-1.4deg); }

/* ---------- every other coin ---------- */

.strikes { display: inline-flex; flex-direction: column; align-items: center; margin-top: 30px; }
.strikes li { margin: 4px 0; font-size: clamp(24px, 3.2vw, 40px); }
.strike { position: relative; display: inline-block; transition: color .3s; transition-delay: calc(var(--i, 0) * 220ms + 420ms); }
.strike::after {
  content: ""; position: absolute; left: -8px; right: -8px; top: 54%; height: 4px; background: var(--ink);
  transform: scaleX(0) rotate(-2deg); transform-origin: left center;
  transition: transform .4s cubic-bezier(.6, 0, .4, 1); transition-delay: calc(var(--i, 0) * 220ms + 200ms);
}
.strikes li.in .strike { color: #aaa; }
.strikes li.in .strike::after { transform: scaleX(1) rotate(-2deg); }
.ours { margin-top: 40px; font-size: clamp(44px, 7vw, 88px); font-weight: 700; line-height: 1; }
.blank-blink { color: var(--wood); animation: blink 1.1s steps(1) infinite; }

/* ---------- it's been done before ---------- */

.cards { margin-top: 44px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 48px 32px; text-align: left; }
.cards button { display: block; width: 100%; text-align: left; }
.frame { display: block; border: 2px solid var(--ink); background: #fff; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.frame img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.cards button:hover .frame { transform: translateY(-5px) rotate(-1deg); }
.card-year { display: block; margin-top: 12px; color: var(--wood); font-weight: 700; font-size: 17px; }
.card-what { display: block; font-size: 18px; line-height: 1.3; }

/* ---------- the comic ---------- */

.comic-pic { position: relative; display: block; width: 100%; max-width: 860px; margin: 40px auto 0; border: 2px solid var(--ink); cursor: zoom-in; }
.comic-pic img { display: block; width: 100%; height: auto; }
.comic-pic.has-panels img { opacity: 0; }
.panel { position: absolute; width: 50%; height: 50%; background-size: 200% 200%; opacity: 0; }
.panel--0 { left: 0; top: 0; background-position: 0 0; }
.panel--1 { left: 50%; top: 0; background-position: 100% 0; }
.panel--2 { left: 0; top: 50%; background-position: 0 100%; }
.panel--3 { left: 50%; top: 50%; background-position: 100% 100%; }
.is-popping .panel { animation: pop .45s cubic-bezier(.2, .9, .3, 1.3) forwards; }
.is-popping .panel--1 { animation-delay: .35s; }
.is-popping .panel--2 { animation-delay: .7s; }
.is-popping .panel--3 { animation-delay: 1.05s; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

/* ---------- nfts ---------- */

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.steps { margin: 50px auto 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; max-width: 900px; counter-reset: none; }
.steps li { position: relative; }
.steps li + li::before {
  /* a dashed path between the easels */
  content: ""; position: absolute; left: -32px; top: 28%; width: 24px; border-top: 3px dashed var(--wood);
}
.step-art { display: block; width: min(130px, 60%); height: auto; margin: 0 auto; }
.step-n { margin-top: 14px; font-size: 15px; font-weight: 700; color: var(--wood); }
.step-t { margin-top: 2px; font-size: clamp(20px, 2vw, 24px); line-height: 1.3; }
.nft-note { margin: 40px auto 0; max-width: 32ch; font-size: clamp(20px, 2.2vw, 26px); }
.nft-live { margin-top: 12px; font-size: 17px; color: var(--wood); font-weight: 700; }

/* ---------- the wall ---------- */

.wall { padding-bottom: 40px; }
.wall-count { margin-top: 14px; font-size: clamp(24px, 3vw, 36px); }
.wall-count [data-count] { font-weight: 700; color: var(--wood); }
.wall-sub { margin-top: 4px; font-size: 18px; color: var(--soft); }
.wall-mock { display: inline-block; margin-top: 10px; padding: 2px 10px; border: 2px solid var(--ink); font-size: 15px; }
.grid {
  margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-flow: dense; gap: 48px; align-items: start; text-align: left;
}
.piece { rotate: var(--tilt); }
.js .piece { opacity: 0; }
.piece.in { animation: piece-in .6s cubic-bezier(.2, .8, .2, 1) var(--d, 0ms) both; }
@keyframes piece-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.piece--big { grid-column: span 2; grid-row: span 2; }
.piece-btn { display: block; width: 100%; text-align: left; }
.piece-canvas { display: block; aspect-ratio: 1; border: 2px solid var(--ink); background: #fff; overflow: hidden; transition: transform .2s; }
.piece-canvas img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.piece-btn:hover .piece-canvas { transform: translateY(-4px); }
.piece-cap { display: block; margin-top: 12px; font-size: 18px; line-height: 1.3; word-break: break-word; }
.piece--big .piece-cap { font-size: 22px; }
.piece-by { display: block; font-size: 16px; color: var(--soft); }
.piece-tag { display: block; margin-top: 2px; font-size: 15px; color: var(--wood); }
.piece-nft { display: inline-block; margin-top: 2px; font-size: 14px; }
.piece--empty .piece-cap { color: #999; }
.piece--empty .piece-btn:hover .piece-canvas { border-color: var(--wood); }
.piece--empty .piece-btn:hover .piece-cap { color: var(--wood); }
.piece--new .piece-canvas { border-color: var(--wood); border-width: 3px; }
.piece--invite .piece-canvas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; border-width: 3px; text-align: center; }
.piece--invite .piece-cap { display: none; }
.invite-big { font-size: clamp(26px, 3.2vw, 42px); line-height: 1.15; text-wrap: balance; }
.invite-small { font-size: 19px; color: var(--wood); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.piece--invite .piece-btn:hover .piece-canvas { border-color: var(--wood); }
.wall-more { display: flex; justify-content: center; margin-top: 40px; }
.wall-more [data-sentinel] { display: block; width: 1px; height: 1px; }

/* ---------- the big view ---------- */

.view {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 16px var(--pad) 28px; border: 0;
  background: #fff; color: var(--ink);
  flex-direction: column; align-items: center; gap: 18px; overflow: auto;
}
.view[open] { display: flex; animation: view-in .25s ease; }
@keyframes view-in { from { opacity: 0; } }
.view::backdrop { background: #fff; }
.view-top { align-self: stretch; display: flex; justify-content: flex-end; font-size: 18px; }
.view-pic { display: flex; justify-content: center; max-width: 100%; }
.view-pic img { display: block; max-width: min(92vw, 940px); max-height: 58dvh; width: auto; height: auto; border: 2px solid var(--ink); }
.view-pic img.is-pixel { image-rendering: pixelated; width: min(58dvh, 92vw, 640px); }
.view-body { max-width: 720px; text-align: center; }
.view-title { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; }
.view-meta { margin-bottom: 8px; font-size: 17px; color: var(--wood); }
.view-by { margin-top: 4px; font-size: 18px; color: var(--soft); }
.view-note { margin-top: 6px; font-size: 16px; color: var(--wood); }
.view-nav { display: flex; gap: 40px; font-size: 19px; }
.view-nav button:disabled { opacity: .25; text-decoration: none; }
.is-viewing { overflow: hidden; }

/* ---------- footer ---------- */

.foot { max-width: 1200px; margin: clamp(80px, 11vw, 150px) auto 0; padding: 60px var(--pad) 50px; text-align: center; border-top: 2px solid var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 26px; font-size: 19px; }
.foot-links [data-ca]:disabled { color: var(--ink); text-decoration: none; }
.disclaimer { max-width: 540px; margin: 22px auto 0; font-size: 15px; line-height: 1.5; color: var(--soft); }
.foot-name { margin-top: 18px; font-size: 17px; }

/* ---------- small screens ---------- */

@media (max-width: 860px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px 18px; }
}
@media (max-width: 640px) {
  .top-nav a[href="#history"] { display: none; }
  .steps { grid-template-columns: 1fr; gap: 34px; max-width: 280px; }
  .steps li + li::before { left: 50%; top: -26px; width: 0; height: 18px; border-top: 0; border-left: 3px dashed var(--wood); }
}
@media (max-width: 560px) {
  body { font-size: 18px; }
  .top { padding-top: 10px; padding-bottom: 10px; }
  .top-name { font-size: 24px; }
  .top-nav { gap: 4px 14px; font-size: 15px; }
  .chip { padding: 2px 8px 3px; font-size: 14px; }
  .hero { padding-bottom: 20px; }
  .tray-row { gap: 6px 14px; }
  .dots { gap: 8px; max-width: 290px; }
  .dot { width: 34px; height: 34px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 18px; margin-top: 36px; }
  .piece-cap { font-size: 16px; }
  .piece--big .piece-cap { font-size: 18px; }
  .card-what { font-size: 16px; }
  .hint .arrow { width: 24px; height: 34px; }
}

section[id] { scroll-margin-top: 64px; }

/* ---------- reduced motion: content animation stays; hover sway, lifts and smooth scrolling go ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero:not(.is-editing) .easel:hover { animation: none; }
  .cards button:hover .frame, .piece-btn:hover .piece-canvas, .dot:hover { transform: none; }
}
