/* RWA: black-and-white notebook-paper meme look, built around the hand-drawn art */
:root {
  --paper: #fbfaf6;
  --ink: #111111;
  --ink-2: #3b3b3b;
  --muted: #6d6d6d;
  --rule: #d9e3ef;      /* faint blue notebook lines */
  --margin: #f1b8b8;    /* red margin line */
  --marker: "Permanent Marker", "Patrick Hand", cursive;
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --serif: "IM Fell English", Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
body { background: var(--paper); color: var(--ink); font-family: var(--body); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img, canvas, svg, video { display: block; max-width: 100%; }

/* notebook paper: faint ruled lines + a red margin */
.paper {
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent calc(clamp(16px, 5vw, 4rem) - 18px), var(--margin) calc(clamp(16px, 5vw, 4rem) - 18px), var(--margin) calc(clamp(16px, 5vw, 4rem) - 16px), transparent calc(clamp(16px, 5vw, 4rem) - 16px)),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
}

/* ---------- Buttons: thick ink outline, hard shadow, slightly crooked ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font-family: var(--marker); font-size: 1rem; letter-spacing: .04em; line-height: 1;
  padding: .85em 1.5em; border: 3px solid var(--ink); border-radius: 10px 14px 9px 13px / 13px 9px 14px 10px;
  box-shadow: 4px 4px 0 var(--ink); cursor: pointer; transform: rotate(-.6deg);
  transition: transform .12s, box-shadow .12s, background .12s;
}
.btn:hover { transform: rotate(0deg) translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:focus-visible, .ca:focus-visible, .social:focus-visible, .seg-btn:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { box-shadow: 6px 6px 0 #9a9a9a; }
.btn-outline { background: #fff; color: var(--ink); }
.btn-outline small, .social small { font-family: var(--mono); font-size: .62em; opacity: .55; letter-spacing: .05em; }
.btn-big { font-size: 1.2rem; }

/* ---------- Topbar: nav + ticker ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--paper); border-bottom: 3px solid var(--ink); }
.nav { position: relative; display: flex; align-items: center; gap: 2rem; padding: .5rem clamp(16px, 3vw, 2rem); }
.brand { margin-right: auto; }
.brand img { width: 58px; height: 58px; transform: rotate(-6deg); transition: transform .2s; }
.brand:hover img { transform: rotate(6deg) scale(1.05); }
.nav-links { display: flex; gap: 1.6rem; font-family: var(--hand); font-size: 1.25rem; }
.nav-links a { border-bottom: 2px solid transparent; }
.nav-links a:hover { border-bottom-color: var(--ink); }
.nav-cta { padding: .65em 1.2em; font-size: .9rem; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.8rem; cursor: pointer; color: var(--ink); }

.ticker { background: var(--ink); color: #fff; overflow-x: auto; scrollbar-width: none; }
.ticker::-webkit-scrollbar { display: none; }
.tk-row { display: flex; align-items: center; gap: 1.6rem; width: max-content; min-width: 100%; padding: .55rem clamp(16px, 3vw, 2rem); font-family: var(--mono); font-size: .8rem; white-space: nowrap; }
.tk-name { font-family: var(--hand); font-size: 1.05rem; }
.tk-name b { font-family: var(--marker); font-weight: 400; margin-right: .3rem; }
.tk-stat i { font-style: normal; font-size: .68rem; letter-spacing: .12em; color: #9a9a9a; margin-right: .2rem; }
.tk-stat b { font-weight: 700; }
.tk-stat em { font-style: normal; margin-left: .3rem; }
.tk-stat em.up { color: #9fe0a8; }
.tk-stat em.down { color: #ff9b9b; }
.tk-note { margin-left: auto; font-family: var(--hand); font-size: 1rem; color: #bdbdbd; }

/* ---------- Section basics ---------- */
section { padding: clamp(3.5rem, 8vw, 6rem) clamp(16px, 5vw, 4rem); }
.title { font-family: var(--marker); font-weight: 400; font-size: clamp(2.4rem, 6.5vw, 4.6rem); line-height: 1; margin-bottom: 1.4rem; text-wrap: balance; }
.title.small { font-size: clamp(2rem, 5vw, 3.4rem); }
/* marker highlight behind a word */
.hl { background: linear-gradient(transparent 55%, #e8e8e8 55% 90%, transparent 90%); padding: 0 .1em; }
.hl-inv { background: var(--ink); color: #fff; padding: 0 .25em; display: inline-block; transform: rotate(-2deg); }
.note { font-family: var(--hand); font-size: 1.3rem; color: var(--muted); margin-bottom: .4rem; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
/* the house and the gold bars in the banner are on fire */
.banner-wrap { position: relative; width: min(100%, 640px); margin-bottom: 1.4rem; }
.banner-wrap .hero-banner { width: 100%; margin: 0; }
.fire { position: absolute; inset: 0; pointer-events: none; }
.flame { position: absolute; left: var(--x); top: var(--y); width: var(--s); aspect-ratio: 40 / 60; transform: translate(-50%, -92%); }
.flame svg { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 100%; animation: flicker 1.1s ease-in-out var(--d) infinite alternate; }
@keyframes flicker {
  0%   { transform: scale(1, 1) skewX(0deg); }
  25%  { transform: scale(.94, 1.08) skewX(-5deg); }
  50%  { transform: scale(1.05, .92) skewX(3deg); }
  75%  { transform: scale(.97, 1.12) skewX(-3deg); }
  100% { transform: scale(1.02, .96) skewX(5deg); }
}
.spark { position: absolute; left: var(--x); top: var(--y); width: 5px; height: 5px; border-radius: 50%; background: #ff9d2e; border: 1px solid #111; opacity: 0; animation: spark 2.2s ease-out var(--d) infinite; }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(10px, -46px) scale(.4); } }
.hero-lede { font-size: clamp(1.1rem, 2.2vw, 1.35rem); line-height: 1.55; max-width: 38ch; margin-bottom: 2rem; }
/* hand-drawn underline scribble under one word */
.scribble { position: relative; font-family: var(--marker); white-space: nowrap; }
.scribble::after { content: ""; position: absolute; left: -4%; right: -4%; bottom: -.2em; height: .45em; background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath d='M2 9 C 25 2, 45 13, 68 7 S 105 3, 118 8' fill='none' stroke='%23111' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.2rem; }
.ca {
  font-family: var(--mono); font-weight: 700; font-size: clamp(.8rem, 2.2vw, .95rem);
  background: #fff; color: var(--ink); border: 2px dashed var(--ink); border-radius: 6px;
  padding: .8em 1.1em; max-width: 100%; word-break: break-all; cursor: pointer; text-align: left;
}
.ca:hover { background: #f1f1f1; }
.ca span { text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 3px; }
.hero-art { position: relative; justify-self: center; width: 100%; max-width: 520px; }
.hero-wojak { width: 100%; animation: breathe 4.5s ease-in-out infinite; transform-origin: 50% 100%; }
/* the *inhales* is literal: a slow breath in and out */
@keyframes breathe { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.035) translateY(-4px); } }
.hero-bill { position: absolute; width: 46%; right: -6%; top: -6%; transform: rotate(14deg); animation: float 6s ease-in-out infinite; filter: drop-shadow(4px 6px 0 rgba(0, 0, 0, .12)); }
@keyframes float { 50% { transform: rotate(8deg) translateY(-14px); } }

/* ---------- Scrawl divider: a hand-drawn line that draws itself ---------- */
.scrawl { padding: .6rem clamp(16px, 5vw, 4rem); background: var(--paper); }
.scrawl svg { width: 100%; height: 34px; overflow: visible; }
.scrawl-path { fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1000; stroke-dashoffset: 1000; transition: stroke-dashoffset 1.6s ease; }
.scrawl.in .scrawl-path { stroke-dashoffset: 0; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.about-copy p:not(.note) { font-size: 1.1rem; line-height: 1.65; max-width: 48ch; margin-bottom: 1rem; color: var(--ink-2); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.tags li { font-family: var(--hand); font-size: 1.2rem; padding: .35rem .9rem; border: 2px solid var(--ink); border-radius: 999px; background: #fff; transform: rotate(var(--r, -1deg)); }
.tags li:nth-child(2) { --r: 1.2deg; } .tags li:nth-child(3) { --r: -.6deg; } .tags li:nth-child(4) { --r: 1.6deg; }
.about-art { justify-self: center; max-width: 520px; }
/* the fire on each asset is its own layer so it can flicker over the static drawing */
.eco { position: relative; }
.eco-base { width: 100%; }
.eco-flame { position: absolute; transform-origin: 50% 100%; animation: eco-flicker 1.3s ease-in-out var(--d) infinite alternate; filter: drop-shadow(0 0 8px rgba(255, 120, 30, .45)); }
@keyframes eco-flicker {
  0%   { transform: scale(1, 1) skewX(0deg); }
  30%  { transform: scale(.97, 1.06) skewX(-2.5deg); }
  60%  { transform: scale(1.03, .95) skewX(2deg); }
  100% { transform: scale(.99, 1.08) skewX(-1.5deg); }
}
.about-art figcaption { font-family: var(--hand); font-size: 1.1rem; color: var(--muted); text-align: center; margin-top: .4rem; }

/* ---------- Certificate of Worthlessness ---------- */
.certificate-wrap { background: var(--ink); display: grid; place-items: center; }
/* 3D spinning coin made from the RWA stamp */
.certificate-wrap { gap: 3rem; }
.coin-stage { text-align: center; perspective: 900px; }
.coin { --size: clamp(170px, 24vw, 260px); position: relative; width: var(--size); height: var(--size); margin: 0 auto; transform-style: preserve-3d; animation: coin-spin 5.5s linear infinite; }
.coin-stage:hover .coin { animation-duration: 1.4s; }
@keyframes coin-spin { from { transform: rotateY(0deg) rotateX(8deg); } to { transform: rotateY(360deg) rotateX(8deg); } }
/* stacked discs give the coin a visible edge when it turns side-on */
.coin-edge { position: absolute; inset: 0; border-radius: 50%; background: #cfcfcf; border: 3px solid #111; transform: translateZ(var(--z)); }
.coin-face { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffffff, #ececec 60%, #d6d6d6); border: 4px solid #111; display: grid; place-items: center; backface-visibility: hidden; box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 8px #111; }
.coin-face img { width: 86%; height: auto; }
.coin-front { transform: translateZ(8px); }
.coin-back { transform: rotateY(180deg) translateZ(8px); }
/* soft shine sweeping across the face */
.coin-face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .7) 48%, transparent 60%); mix-blend-mode: soft-light; pointer-events: none; }
.coin-stage figcaption { font-family: var(--hand); font-size: 1.2rem; color: #bdbdbd; margin-top: 1.6rem; }
.certificate {
  width: min(100%, 900px); background: #fffef9; color: var(--ink); padding: clamp(10px, 1.8vw, 18px);
  box-shadow: 10px 10px 0 #4a4a4a; transform: rotate(-.8deg);
}
.cert-inner { border: 3px double var(--ink); outline: 1px solid var(--ink); outline-offset: -10px; padding: clamp(1.6rem, 4vw, 3rem); text-align: center;
  background: repeating-linear-gradient(45deg, transparent 0 9px, rgba(0, 0, 0, .025) 9px 10px); }
.cert-kicker { font-family: var(--mono); font-size: .8rem; letter-spacing: .2em; color: var(--muted); }
.cert-title { font-family: var(--serif); font-weight: 400; font-style: italic; font-size: clamp(2rem, 5.5vw, 3.6rem); line-height: 1.05; margin: .6rem 0 1.2rem; }
.cert-body { font-family: var(--serif); font-size: clamp(1.05rem, 2.2vw, 1.3rem); line-height: 1.6; max-width: 60ch; margin: 0 auto 1.8rem; }
.cert-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--ink); border: 1px solid var(--ink); margin-bottom: 2rem; }
.cert-grid div { background: #fffef9; padding: .8rem .6rem; display: flex; flex-direction: column; gap: .25rem; }
.cert-grid span { font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cert-grid b { font-family: var(--serif); font-size: 1.15rem; font-weight: 400; }
.cert-foot { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.4rem; }
.cert-sign { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.sig { font-family: var(--marker); font-size: 2.2rem; transform: rotate(-4deg); margin-left: .6rem; }
.cert-sign .line { width: 230px; max-width: 60vw; height: 2px; background: var(--ink); }
.role { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; margin-top: .35rem; color: var(--muted); }
.cert-seal { width: clamp(110px, 18vw, 160px); transform: rotate(10deg); }
.cert-fine { font-family: var(--mono); font-size: .7rem; color: var(--muted); }

/* ---------- How to buy ---------- */
.buy { padding: 0; }
.buy-band { position: relative; height: clamp(180px, 28vw, 320px); overflow: hidden; border-block: 3px solid var(--ink); display: grid; place-items: center; }
.buy-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.buy-title { position: relative; font-family: var(--marker); font-weight: 400; font-size: clamp(2.4rem, 7vw, 5rem); line-height: .95; text-align: center; background: #fff; border: 4px solid var(--ink); padding: .4em .7em; box-shadow: 8px 8px 0 var(--ink); transform: rotate(-2deg); }
.buy-title span { font-family: var(--hand); font-size: .5em; }
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; padding: clamp(3rem, 7vw, 5rem) clamp(16px, 5vw, 4rem); }
.steps li { counter-increment: step; position: relative; background: #fff; border: 3px solid var(--ink); border-radius: 12px 16px 10px 14px; padding: 2.6rem 1.2rem 1.3rem; font-size: 1rem; line-height: 1.55; color: var(--ink-2); box-shadow: 5px 5px 0 var(--ink); }
.steps li::before { content: counter(step); position: absolute; top: -22px; left: 14px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--ink); color: #fff; font-family: var(--marker); font-size: 1.4rem; border-radius: 50%; }
.steps li b { display: block; font-family: var(--hand); font-size: 1.35rem; color: var(--ink); font-weight: 400; margin-bottom: .3rem; }

/* ---------- Chart ---------- */
.chart { text-align: center; }
.chart-frame { width: min(100%, 1000px); margin: 0 auto; aspect-ratio: 16 / 9; max-height: 600px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.chart-frame iframe { width: 100%; height: 100%; border: 0; }
.chart-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; }
.chart-empty img { width: min(40%, 220px); opacity: .85; }
.chart-empty p { font-family: var(--hand); font-size: 1.5rem; }
.chart-empty span { color: var(--muted); }

/* ---------- Join (inverted: white on black) ---------- */
.join { background: var(--ink); color: #fff; text-align: center; }
.join-logo { width: 140px; margin: 0 auto 1.2rem; transform: rotate(-6deg); }
/* "welcome" GIF, taped onto the black page like a photo */
.welcome-gif { position: relative; width: min(100%, 520px); margin: 0 auto 2.4rem; background: #fff; padding: 10px 10px 14px; transform: rotate(-2.5deg); box-shadow: 8px 8px 0 #4a4a4a; }
.welcome-gif img { width: 100%; height: auto; border: 2px solid var(--ink); }
.welcome-gif::before { content: ""; position: absolute; top: -14px; left: 50%; width: 110px; height: 28px; transform: translateX(-50%) rotate(3deg); background: rgba(235, 235, 225, .85); border: 1px solid rgba(0, 0, 0, .15); } /* tape */
.join .hl-inv { background: #fff; color: var(--ink); }
.socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; margin-top: 1rem; }
.social { font-family: var(--marker); font-size: 1rem; letter-spacing: .03em; padding: .9rem 1.4rem; color: #fff; border: 3px solid #fff; border-radius: 10px 14px 9px 13px / 13px 9px 14px 10px; transition: transform .12s, background .12s; }
.social[aria-disabled] { color: #8c8c8c; border-color: #555; }
.social:hover { transform: rotate(-2deg) scale(1.04); }
.social.hot { background: #fff; color: var(--ink); }

/* ---------- PFP generator ---------- */
.pfp { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.pfp > * { max-width: 560px; justify-self: center; width: 100%; }
.pfp-copy > p { line-height: 1.7; margin-bottom: 1.5rem; font-size: 1.05rem; }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 10px; overflow: hidden; margin-bottom: 1.2rem; background: #fff; }
.seg-btn { font-family: var(--hand); font-size: 1.15rem; padding: .45rem 1rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
.seg-btn.active { background: var(--ink); color: #fff; }
.ctrl { display: grid; grid-template-columns: 90px 1fr 44px; align-items: center; gap: .8rem; font-family: var(--mono); font-size: .8rem; font-weight: 700; margin-bottom: .8rem; }
.ctrl input { accent-color: var(--ink); width: 100%; }
.hint { font-family: var(--hand); font-size: 1.05rem !important; color: var(--muted); margin: .4rem 0 1.4rem !important; }
.pfp-btns { display: flex; gap: 1rem; flex-wrap: wrap; }
#pfpCanvas { width: 100%; aspect-ratio: 1; border: 3px solid var(--ink); border-radius: 12px; background: #fff; cursor: grab; touch-action: none; box-shadow: 8px 8px 0 var(--ink); }
#pfpCanvas:active { cursor: grabbing; }

/* ---------- Footer + toast ---------- */
.foot { background: var(--ink); color: #bdbdbd; text-align: center; padding: 2.5rem 16px 3rem; border-top: 3px solid #fff; }
.foot-wordmark { width: min(70%, 380px); margin: 0 auto 1.2rem; filter: invert(1); }
.foot p { font-family: var(--mono); font-size: .75rem; line-height: 1.7; max-width: 70ch; margin: 0 auto; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 140px) rotate(-2deg); background: #fff; color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-family: var(--marker); padding: .7rem 1.3rem; transition: transform .3s; z-index: 100; }
.toast.show { transform: translate(-50%, 0) rotate(-2deg); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.4rem; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero, .about, .pfp { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .banner-wrap { margin-inline: auto; }
  .hero-lede { margin-inline: auto; }
  .hero-ctas { justify-content: center; }
  .hero-art { max-width: 360px; order: -1; }
  .about-copy { text-align: center; }
  .about-copy p:not(.note) { margin-inline: auto; }
  .tags { justify-content: center; }
}
@media (max-width: 720px) {
  .nav { gap: 1rem; }
  .brand img { width: 48px; height: 48px; }
  .nav-cta { display: none; }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--paper); padding: 1rem 16px 1.4rem; border-bottom: 3px solid var(--ink); }
  .nav-links.open { display: flex; }
  .steps { grid-template-columns: 1fr; }
  .cert-foot { flex-direction: column; }
  .certificate { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .spark { display: none; }
  .coin { transform: rotateY(-20deg) rotateX(8deg); }
  .scrawl-path { stroke-dashoffset: 0; }
}
