/* Wicknote — a page from a paper notebook. */

:root {
  --paper: #fbf8ef;
  --paper-2: #f3eedf;
  --paper-3: #ebe4d0;
  --rule: #c7dbee;
  --rule-strong: #a9c6e3;
  --margin: rgba(214, 86, 86, 0.55);
  --graphite: #3a3a3a;
  --graphite-2: #555;
  --graphite-3: #828282;
  --graphite-4: #b3b0a8;
  --sticky: #fff3a6;
  --sticky-pink: #ffdbe3;
  --sticky-blue: #dcecff;
  --sticky-green: #ddf3d3;
  --hl: rgba(255, 236, 90, 0.65);
  --buy: #2f7a46;
  --sell: #b0453c;
  --line: 32px;
  --mx: 76px;              /* where the red margin sits */
  --gutter: 28px;
  --wobble: 255px 14px 225px 14px / 14px 225px 14px 255px;
  --wobble-2: 14px 225px 14px 255px / 255px 14px 225px 14px;
  --wobble-sm: 18px 4px 16px 5px / 5px 16px 4px 18px;
  --font-head: 'Caveat', 'Segoe Print', cursive;
  --font-body: 'Patrick Hand', 'Segoe Print', cursive;
  --font-num: 'Kalam', 'Patrick Hand', cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .3 0 0 0 0 .22 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  --graphite-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .2 0 0 0 0 .2 0 0 0 1.4 -.35'/%3E%3C/filter%3E%3Crect width='120' height='120' fill='%23474747'/%3E%3Crect width='120' height='120' filter='url(%23g)'/%3E%3C/svg%3E");
  --hatch: repeating-linear-gradient(-45deg, rgba(58, 58, 58, 0.16) 0 1.2px, transparent 1.2px 6px);
  --hatch-dense: repeating-linear-gradient(-45deg, rgba(58, 58, 58, 0.26) 0 1.2px, transparent 1.2px 4px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--graphite);
  font-family: var(--font-body);
  font-size: 19px;
  line-height: var(--line);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse 340px 180px at 82% 14%, rgba(120, 110, 90, 0.045), transparent 70%),
    radial-gradient(ellipse 260px 140px at 18% 72%, rgba(120, 110, 90, 0.04), transparent 70%),
    radial-gradient(ellipse 420px 120px at 64% 88%, rgba(150, 140, 120, 0.05), transparent 70%),
    var(--grain),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px) var(--line));
  background-position: 0 0, 0 0, 0 0, 0 0, 0 96px;
  overflow-x: hidden;
  text-shadow: 0 0 0.6px rgba(58, 58, 58, 0.35);
}
::selection { background: var(--hl); }

/* The red margin and the binder holes stay put as the page scrolls. */
.margin-line {
  position: fixed; top: 0; bottom: 0; left: var(--mx); width: 5px; z-index: 0; pointer-events: none;
  border-left: 1.6px solid var(--margin);
  border-right: 1px solid rgba(214, 86, 86, 0.28);
}
.holes {
  position: fixed; top: 0; bottom: 0; left: 0; width: 46px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle at 24px 50%, #ddd5c1 0 10px, rgba(0, 0, 0, 0.18) 10.5px 11.6px, rgba(0,0,0,.05) 12px, transparent 13.5px) 0 0 / 46px 33.33vh repeat-y;
}
.holes::after { /* a slightly torn, uneven page edge */
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,.06) 20%, transparent 40%, rgba(0,0,0,.05) 70%, transparent);
}

#app { position: relative; z-index: 1; overflow-x: clip; }
.wrap { max-width: 1260px; margin: 0 auto; padding: 0 var(--gutter) 0 calc(var(--mx) + 26px); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: rgba(58,58,58,.4); }
a:hover { text-decoration-color: var(--graphite); }
img { max-width: 100%; }
hr { border: 0; height: 2px; margin: 24px 0; background: var(--hatch-dense); border-radius: 2px; }

h1, h2, h3, .head {
  font-family: var(--font-head); font-weight: 700; line-height: 1.05; margin: 0;
  color: #444;
  background: var(--graphite-tex);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
h1 { font-size: clamp(44px, 6vw, 72px); }
h2 { font-size: clamp(36px, 4.4vw, 52px); }
h3 { font-size: 32px; }
p { margin: 0 0 var(--line); }
.lead { font-size: 22px; color: var(--graphite-2); max-width: 60ch; }
.muted { color: var(--graphite-3); }
.small { font-size: 16px; line-height: 24px; }
.tiny { font-size: 14px; line-height: 20px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
sub { font-size: 0.68em; line-height: 0; vertical-align: -0.28em; margin: 0 1px; }
.buy, .up { color: var(--buy); }
.sell, .down { color: var(--sell); }
.label {
  font-family: var(--font-body); font-size: 14px; line-height: 20px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--graphite-3);
}
.hl { background: linear-gradient(100deg, transparent 2%, var(--hl) 4% 94%, transparent 97%); padding: 0 4px; border-radius: 3px; }
.underline-scribble {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C40 3 80 10 120 6 S180 4 198 7' fill='none' stroke='%23d65656' stroke-width='2' stroke-linecap='round' opacity='.7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 100% 12px; background-position: 0 100%; padding-bottom: 6px;
}

/* ---------- sketched boxes ---------- */
.sk {
  position: relative;
  border: 2px solid var(--graphite-2);
  border-radius: var(--wobble);
  background: rgba(255, 255, 252, 0.55);
}
.sk::before { /* a second, lighter pencil pass */
  content: ''; position: absolute; inset: -4px -2px -2px -5px; pointer-events: none;
  border: 1.3px solid rgba(58, 58, 58, 0.28);
  border-radius: var(--wobble-2);
  transform: rotate(-0.35deg);
}
.sk.alt { border-radius: var(--wobble-2); }
.sk.alt::before { border-radius: var(--wobble); transform: rotate(0.3deg); }
.sk.flat { background: transparent; }
.pad { padding: 20px 24px; }
.pad-sm { padding: 12px 16px; }

.sticky {
  position: relative; background: var(--sticky); padding: 22px 22px 18px;
  box-shadow: 2px 4px 10px rgba(60, 50, 20, 0.14), inset 0 -18px 30px -24px rgba(120, 90, 0, 0.25);
  transform: rotate(-1.1deg);
  border-radius: 2px 2px 16px 2px / 2px 2px 6px 2px;
  background-image: var(--grain);
}
.sticky.pink { background-color: var(--sticky-pink); transform: rotate(0.9deg); }
.sticky.blue { background-color: var(--sticky-blue); transform: rotate(-0.6deg); }
.sticky.green { background-color: var(--sticky-green); transform: rotate(0.7deg); }
.sticky.yellow { background-color: var(--sticky); }
.tape::after {
  content: ''; position: absolute; top: -12px; left: 50%; width: 92px; height: 26px; transform: translateX(-50%) rotate(-3deg);
  background: rgba(235, 228, 205, 0.72);
  border-left: 1px dashed rgba(0,0,0,.08); border-right: 1px dashed rgba(0,0,0,.08);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.scrap { /* a taped-on paper scrap */
  position: relative; background: #fffdf6; padding: 20px 22px;
  box-shadow: 1px 2px 6px rgba(0,0,0,.08);
  clip-path: polygon(0 3%, 6% 0, 18% 2%, 33% 0, 51% 2%, 68% 0, 84% 2%, 100% 0, 99% 34%, 100% 66%, 98% 100%, 80% 98%, 61% 100%, 42% 98%, 22% 100%, 4% 98%, 1% 70%, 0 40%);
  background-image: var(--grain), repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px);
}

/* ---------- drawn in on scroll (js/sketch.js) ---------- */
.sk-pending, .sk-drawing {
  border-color: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
}
.sk-pending::before, .sk-pending::after, .sk-drawing::before, .sk-drawing::after { opacity: 0; }
.sk-pending > :not(.sk-svg), .sk-drawing > :not(.sk-svg) { opacity: 0; transform: translateY(4px); }
.sk-pending.sticky, .sk-drawing.sticky, .sk-pending.scrap, .sk-drawing.scrap { background-image: none !important; }
.sk-drawing.sk-filled { border-color: var(--graphite-2) !important; }
.sk-drawing.sk-filled.sticky, .sk-drawing.sk-filled.scrap { border-color: transparent !important; }
.sk-filled.sticky { background-color: var(--sticky) !important; }
.sk-filled.sticky.pink { background-color: var(--sticky-pink) !important; }
.sk-filled.sticky.blue { background-color: var(--sticky-blue) !important; }
.sk-filled.sticky.green { background-color: var(--sticky-green) !important; }
.sk-filled.scrap { background-color: #fffdf6 !important; }
.sk-filled.sk { background-color: rgba(255, 255, 252, 0.55) !important; }
.sk-filled > :not(.sk-svg) { opacity: 1; transform: none; }
.sk-filled::before, .sk-filled::after { opacity: 1; }
.sk, .sticky, .scrap { transition: border-color .45s, background-color .5s, box-shadow .5s; }
.sk > *, .sticky > *, .scrap > * { transition: opacity .45s ease, transform .45s ease; }
.sk::before, .sticky::after, .tape::after { transition: opacity .5s; }
.sk-svg { position: absolute; pointer-events: none; overflow: visible; z-index: 2; }
.sk-svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.sk-svg .p1 { stroke: #3d3d3d; stroke-width: 2.1; filter: url(#pencil); }
.sk-svg .p2 { stroke: #6a6a6a; stroke-width: 1.1; opacity: .5; }

/* ---------- illustrations (js/illustrations.js) ---------- */
.illo { display: block; width: 100%; height: auto; overflow: visible; }
.illo path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.illo .ink { stroke: #3d3d3d; stroke-width: 2.3; filter: url(#pencil); }
.illo .soft { stroke: #6f6f6f; stroke-width: 1.4; }
.illo .hatch { stroke: #8a8a8a; stroke-width: 1; opacity: .7; }
.illo [class^="wash"] { stroke: none; opacity: .62; transition: opacity .8s ease; }
.illo .wash-y { fill: #ffe873; }
.illo .wash-r { fill: #f7b3a8; }
.illo .wash-b { fill: #cfe3fb; }
.illo.illo-pending [class^="wash"] { opacity: 0; }
.hero-illo { max-width: 300px; margin: -10px auto 0; }
.page-head.illustrated { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 32px; align-items: center; }
.page-head.illustrated .illo { max-width: 250px; justify-self: end; }
.chapter { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.chapter .illo { max-width: 220px; position: sticky; top: 110px; }
.cta-box { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 30px; align-items: center; }

/* ---------- contract address button ---------- */
.ca-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  font: inherit; color: var(--graphite); background: transparent; border: 0; cursor: pointer;
  padding: 12px 20px 11px; margin: 4px 0 18px; text-align: left;
}
.ca-outline { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ca-outline path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: ca-draw 1.1s cubic-bezier(.45,.05,.35,1) .5s forwards; }
.ca-outline .o1 { stroke: #3d3d3d; stroke-width: 2.2; filter: url(#pencil); }
.ca-outline .o2 { stroke: #777; stroke-width: 1.1; opacity: .55; animation-delay: .8s; }
@keyframes ca-draw { to { stroke-dashoffset: 0; } }
.ca-btn > span { opacity: 0; animation: ca-in .5s ease 1.2s forwards; }
@keyframes ca-in { to { opacity: 1; } }
.ca-label { font-family: var(--font-head); font-size: 26px; line-height: 1; padding: 2px 8px 0; border-radius: 6px 3px 8px 4px; background: var(--hl); }
.ca-addr { font-size: 17px; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-copy { position: relative; display: inline-flex; color: var(--graphite-2); }
.ca-done { position: absolute; left: 26px; top: -2px; white-space: nowrap; font-size: 16px; color: var(--buy); opacity: 0; transition: opacity .2s; }
.ca-btn:hover { background-image: var(--hatch); border-radius: 12px 4px 14px 6px; }
.ca-btn:active { transform: translate(1px, 1px); }
.ca-btn:focus-visible { outline: 2px dashed #d65656; outline-offset: 4px; }
.ca-btn.copied .ca-done { opacity: 1; }
.ca-btn.copied .ca-copy svg { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .ca-outline path { animation: none; stroke-dashoffset: 0; } .ca-btn > span { animation: none; opacity: 1; } }

/* ---------- X (Twitter) logo button ---------- */
.socials { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.socials .ca-btn { margin: 0; min-width: 0; flex: 0 1 auto; }
.socials { flex-wrap: wrap; row-gap: 18px; margin-top: 6px; }
.x-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.x-btn {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 9px 18px 9px 10px; color: var(--graphite); text-decoration: none;
  background-color: var(--sticky); background-image: var(--grain);
  border: 2px solid var(--graphite); border-radius: 18px 6px 20px 8px / 8px 20px 6px 18px;
  box-shadow: 4px 5px 0 rgba(58, 58, 58, 0.22), 0 6px 18px rgba(120, 90, 0, 0.18);
  transform: rotate(-1.5deg);
  opacity: 0; animation: x-pop .45s cubic-bezier(.3,1.6,.5,1) .35s forwards, x-nudge 6s ease-in-out 4s infinite;
  transition: transform .15s, box-shadow .15s;
}
.x-btn::after { /* second pencil pass around the note */
  content: ''; position: absolute; inset: -5px -3px -3px -6px; pointer-events: none;
  border: 1.3px solid rgba(58,58,58,.3); border-radius: 8px 20px 6px 22px / 20px 8px 22px 6px; transform: rotate(.8deg);
}
.x-mark { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 auto; background: #fffdf4; border-radius: 10px 4px 12px 6px; }
.x-mark svg { width: 100%; height: 100%; overflow: visible; }
.x-text { display: grid; line-height: 1.05; }
.x-text b { font-family: var(--font-head); font-weight: 700; font-size: 30px; }
.x-text small { font-size: 15px; color: var(--graphite-2); margin-top: 2px; }
.x-go { font-size: 28px; margin-left: 2px; transition: transform .15s; }
a.x-btn:hover { transform: rotate(0deg) translateY(-3px) scale(1.04); box-shadow: 6px 8px 0 rgba(58,58,58,.25), 0 10px 24px rgba(120,90,0,.22); background-image: var(--hatch), var(--grain); animation-play-state: running, paused; }
a.x-btn:hover .x-go { transform: translateX(5px); }
a.x-btn:active { transform: translate(2px, 2px) rotate(-1deg); box-shadow: 1px 2px 0 rgba(58,58,58,.25); }
/* These animate the separate scale/rotate properties, leaving `transform` free for hover. */
@keyframes x-pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }
@keyframes x-nudge { 0%, 86%, 100% { rotate: 0deg; } 89% { rotate: 3.5deg; } 92% { rotate: -2deg; } 95% { rotate: 2deg; } }
.x-note { position: absolute; left: calc(100% + 4px); top: -30px; width: 130px; pointer-events: none; color: #c0453a; }
.x-note svg { width: 70px; height: 46px; overflow: visible; }
.x-note path { fill: none; stroke: #c0453a; stroke-width: 2; stroke-linecap: round; filter: url(#pencil); stroke-dasharray: 1; stroke-dashoffset: 1; animation: ca-draw .7s ease 2.4s forwards; }
.x-note span { display: block; white-space: nowrap; font-family: var(--font-head); font-size: 24px; transform: rotate(-6deg); margin: -64px 0 0 52px; opacity: 0; animation: ca-in .4s ease 3s forwards; }
.x-btn.soon { cursor: help; background-color: #f4eecf; animation: x-pop .45s cubic-bezier(.3,1.6,.5,1) .35s forwards; }
.x-btn.soon ~ .x-note { display: none; }
@media (max-width: 760px) { .x-note { display: none; } }
.x-btn .x-mark path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: ca-draw .9s cubic-bezier(.45,.05,.35,1) forwards; }
.x-btn .xf1 { stroke: #3d3d3d; stroke-width: 2; filter: url(#pencil); animation-delay: .6s; }
.x-btn .xf2 { stroke: #777; stroke-width: 1; opacity: .5; animation-delay: .85s; }
.x-btn .xm { stroke: #2f2f2f; stroke-width: 2.6; filter: url(#pencil); animation-delay: 1.25s; }
.x-btn .xm.thin { stroke-width: 2.8; animation-delay: 1.75s; }
.x-btn .xh { stroke: #8a8a8a; stroke-width: 1; animation-delay: 2.1s; }
a.x-btn:focus-visible { outline: 2px dashed #d65656; outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) {
  .x-btn, .x-btn.soon { animation: none; opacity: 1; }
  .x-btn path, .x-note path { animation: none; stroke-dashoffset: 0; }
  .x-note span { animation: none; opacity: 1; }
}

/* ---------- small menus ---------- */
.more { position: relative; }
.more > button { font: inherit; font-size: 19px; background: none; border: 0; color: inherit; padding: 4px 10px; cursor: pointer; border-radius: 10px 4px 12px 5px; }
.more > button:hover { background-image: var(--hatch); }
.more-menu { position: absolute; top: 40px; right: 0; min-width: 190px; padding: 8px; z-index: 50; background-color: var(--paper); display: none; }
.more.open .more-menu { display: grid; }
.more-menu a { padding: 6px 10px; text-decoration: none; border-radius: 8px; }
.more-menu a:hover, .more-menu a.on { background-image: var(--hatch); }
.panel[hidden] { display: none !important; }
.tabs a { font-size: 19px; padding: 4px 14px; text-decoration: none; color: var(--graphite-3); border-radius: 10px 10px 0 0; }
.tabs a.on { color: var(--graphite); background: var(--sticky); box-shadow: inset 0 0 0 1.5px var(--graphite-2); }
.tabs a:hover, .tabs button:hover { background-image: var(--hatch); }
.doc-body { margin-top: 20px; max-width: 980px; }
.doc-body dl dt { font-family: var(--font-head); font-size: 25px; margin-top: 12px; }
.doc-body dl dd { margin: 0; color: var(--graphite-2); }
.desk-tabs { position: sticky; top: 98px; z-index: 5; background: rgba(251, 248, 239, 0.94); margin-top: 26px; }

/* ---------- buttons & inputs ---------- */
.btn {
  --bg: rgba(255,255,250,.6);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 20px; line-height: 1; color: var(--graphite);
  padding: 11px 20px 10px; min-height: 44px;
  background: var(--bg);
  border: 2px solid var(--graphite);
  border-radius: var(--wobble-sm);
  cursor: pointer; text-decoration: none; position: relative; white-space: nowrap;
  transition: transform .12s ease, background-color .12s;
  box-shadow: 2px 2px 0 rgba(58,58,58,.18);
}
.btn::after { content: ''; position: absolute; inset: -3px -1px -1px -3px; border: 1px solid rgba(58,58,58,.3); border-radius: 4px 16px 5px 18px / 16px 4px 18px 5px; pointer-events: none; }
.btn:hover { background-image: var(--hatch); transform: translate(-1px, -1px) rotate(-0.4deg); }
.btn:active { transform: translate(1px, 1px); box-shadow: none; }
.btn:focus-visible, .chip:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px dashed #d65656; outline-offset: 3px;
}
.btn.primary { --bg: var(--sticky); font-weight: 400; }
.btn.primary:hover { background-image: var(--hatch-dense); }
.btn.ghost { --bg: transparent; box-shadow: none; }
.btn.danger { color: var(--sell); border-color: var(--sell); }
.btn.sm { font-size: 17px; padding: 7px 12px 6px; min-height: 34px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; background-image: none; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(58,58,58,.4); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 17px; line-height: 1;
  padding: 6px 12px; border: 1.6px solid var(--graphite-2); border-radius: var(--wobble-sm); background: transparent; color: var(--graphite); cursor: pointer;
}
.chip:hover { background-image: var(--hatch); }
.chip.on { background-color: var(--sticky); box-shadow: inset 0 0 0 1px rgba(58,58,58,.2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

input, select, textarea {
  font: inherit; font-size: 19px; color: var(--graphite); width: 100%;
  background: transparent; border: 0; border-bottom: 2px solid var(--graphite-2); border-radius: 0 0 4px 6px;
  padding: 6px 4px 4px; outline: none;
}
input.num, .num input { font-family: var(--font-num); }
input:focus, select:focus, textarea:focus { border-bottom-color: var(--graphite); background: linear-gradient(to top, rgba(255,236,90,.25), transparent 60%); }
textarea { border: 2px solid var(--graphite-2); border-radius: var(--wobble-sm); min-height: 96px; resize: vertical; line-height: var(--line); background: repeating-linear-gradient(to bottom, transparent 0 31px, var(--rule) 31px 32px); padding: 2px 10px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M2 2 C6 6 8 9 10 10 C12 8 15 5 18 2' fill='none' stroke='%233a3a3a' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; background-size: 16px; padding-right: 26px; cursor: pointer; }
input[type=range] { border: 0; padding: 0; accent-color: var(--graphite); }
input[type=checkbox] { width: auto; accent-color: var(--graphite); transform: scale(1.25); }
label.field { display: block; margin-bottom: 20px; }
label.field > span:first-child, .field-label { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; color: var(--graphite-2); }
.prefix { display: flex; align-items: baseline; gap: 4px; }
.prefix > b { font-weight: 400; color: var(--graphite-3); }
.err { color: var(--sell); font-size: 16px; }

/* a pencil-drawn toggle */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle i { width: 44px; height: 24px; border: 2px solid var(--graphite-2); border-radius: 14px 12px 13px 14px; position: relative; display: inline-block; }
.toggle i::after { content: ''; position: absolute; top: 2px; left: 3px; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--graphite); background: var(--paper); transition: left .15s; }
.toggle input:checked + i { background: var(--hatch-dense); }
.toggle input:checked + i::after { left: 21px; background: var(--sticky); }
.toggle input:focus-visible + i { outline: 2px dashed #d65656; outline-offset: 3px; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(251, 248, 239, 0.92); backdrop-filter: blur(3px); }
.topbar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 6' preserveAspectRatio='none'%3E%3Cpath d='M0 3 C60 1 120 5 200 3 S340 1 400 3' fill='none' stroke='%23555' stroke-width='1.6'/%3E%3C/svg%3E") 0 0 / 100% 100%; }
.nav { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: inline-flex; align-items: center; text-decoration: none; flex: 0 0 auto; }
.brand svg { height: 42px; width: auto; display: block; }
.navlinks { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a { padding: 4px 10px; text-decoration: none; font-size: 19px; white-space: nowrap; border-radius: 10px 4px 12px 5px; }
.navlinks a:hover { background-image: var(--hatch); }
.navlinks a.on { background: var(--hl); }
.navlinks .in-more { display: none; }
.nav-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.search { position: relative; width: 210px; }
.search input { padding-left: 28px; font-size: 17px; }
.search svg { position: absolute; left: 2px; top: 9px; width: 20px; height: 20px; }
.search .results { position: absolute; top: 46px; left: 0; right: -60px; z-index: 40; padding: 6px; max-height: 360px; overflow: auto; background: var(--paper); }
.search .results a { display: flex; gap: 10px; align-items: center; padding: 6px 8px; text-decoration: none; border-radius: 8px; }
.search .results a:hover, .search .results a.on { background-image: var(--hatch); }
.menu-btn { display: none; }

.ticker { overflow: hidden; white-space: nowrap; border-bottom: 1px dashed var(--graphite-4); height: 32px; }
.ticker-track { display: inline-flex; gap: 28px; animation: marquee 80s linear infinite; padding-left: 20px; font-size: 16px; }
.ticker-track span { display: inline-flex; gap: 6px; align-items: baseline; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- layout ---------- */
.section { padding: calc(var(--line) * 2) 0; }
.section-head { display: grid; grid-template-columns: 70px 1fr; gap: 6px 18px; margin-bottom: var(--line); }
.section-head .idx { font-family: var(--font-head); font-size: 40px; color: var(--graphite-3); line-height: 1; }
.section-head .kicker { grid-column: 2; }
.section-head h2, .section-head p { grid-column: 2; }
.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 16px; }
.right { text-align: right; }
.hide { display: none !important; }
.page-head { padding: 40px 0 28px; }
.crumbs { font-size: 16px; color: var(--graphite-3); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; padding: 48px 0 40px; align-items: start; }
.hero-logo { width: min(520px, 100%); height: auto; display: block; margin: 4px 0 6px -10px; overflow: visible; }
.hero-tag { font-family: var(--font-head); font-size: 34px; margin: -6px 0 18px; color: var(--graphite-2); }
.hero-lines { font-size: 23px; list-style: none; padding: 0; margin: 0 0 26px; }
.hero-lines li::before { content: '– '; color: var(--graphite-3); }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pair-note { display: flex; gap: 10px; align-items: center; padding: 8px 14px; text-decoration: none; font-size: 17px; line-height: 24px; max-width: 560px; }
.badge { display: inline-block; font-size: 14px; line-height: 1; padding: 4px 7px 3px; border: 1.5px solid currentColor; border-radius: 8px 3px 9px 4px; letter-spacing: .06em; text-transform: uppercase; }
.badge.run { color: var(--buy); }
.badge.pause { color: #a06a00; }
.badge.closed { color: var(--graphite-3); }
.eraser { /* a faint eraser mark */
  position: absolute; width: 160px; height: 46px; border-radius: 40%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.75), rgba(255,255,255,0) 70%);
  filter: blur(2px); transform: rotate(-8deg);
}

/* ---------- logo ---------- */
.logo-svg .stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.logo-svg .pass1 { stroke: #3d3d3d; stroke-width: 5.2; filter: url(#pencil); }
.logo-svg .pass2 { stroke: #5a5a5a; stroke-width: 2.4; opacity: .55; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 18px; }
th { text-align: left; font-weight: 400; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite-3); padding: 0 10px; height: 32px; border-bottom: 1.5px solid var(--graphite-2); }
td { padding: 0 10px; height: 32px; border-bottom: 1px dashed rgba(58,58,58,.18); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background-image: var(--hatch); }
td.num, th.num { text-align: right; }
.side { display: inline-flex; align-items: center; gap: 6px; }
.side::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 2px solid currentColor; }
.side.buy::before { background: currentColor; }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: var(--hl); } to { background: transparent; } }

/* ---------- stats ---------- */
.stat { padding: 16px 18px; }
.stat .v { font-family: var(--font-num); font-size: 30px; line-height: 40px; }
.stat .s { font-size: 16px; color: var(--graphite-3); line-height: 22px; }
.stat .d { font-size: 13px; line-height: 18px; color: var(--graphite-3); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }

/* ---------- coin art ---------- */
.coin-img { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50% 46% 52% 48%; border: 2px solid var(--graphite-2); object-fit: cover; background: var(--paper-2); display: block; }
.coin-img.lg { width: 76px; height: 76px; }
.coin-img.sm { width: 26px; height: 26px; border-width: 1.5px; }

/* ---------- maker cards ---------- */
.mcard { display: block; text-decoration: none; padding: 18px 20px 14px; transition: transform .15s; }
.mcard:hover { transform: rotate(-0.5deg) translateY(-2px); background-image: var(--hatch); }
.mcard .top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.mcard .name { font-family: var(--font-head); font-size: 28px; line-height: 1; }
.mcard dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; margin: 0; }
.mcard dt { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--graphite-3); line-height: 22px; }
.mcard dd { margin: 0 0 4px; font-family: var(--font-num); font-size: 19px; line-height: 26px; }

/* ---------- presets ---------- */
.preset { padding: 20px; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.preset h3 { font-size: 34px; display: flex; align-items: center; gap: 10px; }
.preset p { font-size: 17px; line-height: 24px; color: var(--graphite-2); margin: 6px 0 12px; min-height: 72px; }
.preset .facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; }
.preset .facts div { font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--graphite-3); line-height: 16px; }
.preset .facts b { display: block; font-weight: 400; font-family: var(--font-num); font-size: 19px; color: var(--graphite); text-transform: none; letter-spacing: 0; line-height: 26px; }
button.preset.on { background-color: var(--sticky); }
button.preset:hover { background-image: var(--hatch); }

.settings-list { columns: 3 260px; column-gap: 32px; }
.settings-list section { break-inside: avoid; margin-bottom: 24px; }
.settings-list h4 { margin: 0 0 4px; font-weight: 400; font-size: 15px; letter-spacing: .1em; color: var(--graphite-3); }
.settings-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 18px; border-bottom: 1px dashed rgba(58,58,58,.15); }
.settings-list div span:last-child { font-family: var(--font-num); font-size: 16px; color: var(--graphite-2); text-align: right; }

/* ---------- money flow ---------- */
.flow { display: grid; gap: 0; max-width: 760px; }
.flow .node { padding: 16px 20px; }
.flow .arrow { display: grid; grid-template-columns: 60px 1fr; align-items: center; min-height: 70px; padding-left: 30px; font-size: 17px; line-height: 24px; color: var(--graphite-2); }
.flow .arrow svg { width: 26px; height: 64px; }

/* ---------- rules ---------- */
.rule-num { font-family: var(--font-head); font-size: 48px; line-height: 1; color: var(--graphite-3); }

/* ---------- launch wizard ---------- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 26px; list-style: none; padding: 0; }
.steps li button { font: inherit; font-size: 17px; background: none; border: 0; color: var(--graphite-3); cursor: pointer; padding: 4px 8px; display: inline-flex; gap: 6px; align-items: center; }
.steps li button b { font-weight: 400; display: inline-grid; place-items: center; width: 26px; height: 26px; border: 1.6px solid currentColor; border-radius: 50% 45% 55% 48%; font-family: var(--font-num); font-size: 15px; }
.steps li.on button { color: var(--graphite); }
.steps li.on button b { background: var(--sticky); }
.steps li.done button { color: var(--graphite-2); }
.steps li.done button b { background: var(--hatch-dense); }
.summary { position: sticky; top: 90px; }
.summary dl { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; margin: 0; }
.summary dt { color: var(--graphite-3); font-size: 17px; }
.summary dd { margin: 0; text-align: right; font-family: var(--font-num); font-size: 17px; }
.drop { display: grid; place-items: center; text-align: center; width: 150px; height: 150px; cursor: pointer; overflow: hidden; padding: 10px; font-size: 16px; line-height: 22px; }
.drop.over { background-image: var(--hatch-dense); }
.drop img { width: 100%; height: 100%; object-fit: cover; border-radius: 40% 46% 42% 48%; }

/* ---------- desk ---------- */
.desk-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.kv { display: flex; gap: 22px; flex-wrap: wrap; font-size: 17px; }
.kv span b { font-weight: 400; color: var(--graphite-3); margin-right: 6px; }
.engine-box { display: flex; gap: 14px; align-items: flex-start; }
.engine-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--buy); margin-top: 10px; flex: 0 0 auto; animation: pulse 2s infinite; }
.engine-dot.paused { border-color: #a06a00; animation: none; }
@keyframes pulse { 50% { background: var(--buy); } }
.chart-box { height: 380px; position: relative; }
.chart-box .empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--graphite-3); }
.book { font-size: 17px; }
.book .lvl { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1.3fr) 34px minmax(0,1.6fr); gap: 10px; align-items: center; min-height: 32px; padding: 0 8px; border-bottom: 1px dashed rgba(58,58,58,.15); }
.book .lvl > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book .lvl.label > * { white-space: normal; line-height: 16px; }
.book .lvl.now, .book .lvl.empty { display: flex; gap: 12px; }
.book .lvl.now { background: var(--hl); border-radius: 6px; }
.book .bar { height: 10px; border: 1.5px solid currentColor; border-radius: 3px 6px 4px 5px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1.5px solid var(--graphite-2); }
.tabs button { font: inherit; font-size: 19px; background: none; border: 0; padding: 4px 14px; cursor: pointer; color: var(--graphite-3); border-radius: 10px 10px 0 0; }
.tabs button.on { color: var(--graphite); background: var(--sticky); box-shadow: inset 0 0 0 1.5px var(--graphite-2); }
.tabs button sup { font-family: var(--font-num); font-size: 13px; }
.wallet-card { padding: 16px 18px; }
.wallet-card .lines { display: flex; gap: 16px; flex-wrap: wrap; font-size: 16px; }
.setting-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(58,58,58,.15); font-size: 18px; }
.setting-row span:last-child { font-family: var(--font-num); font-size: 17px; }
.editor .field { margin-bottom: 14px; }
.editor .off { display: inline-flex; gap: 6px; align-items: center; font-size: 15px; color: var(--graphite-3); }
.pnl-up { color: var(--buy); }
.pnl-down { color: var(--sell); }

/* ---------- modal & toasts ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(60, 55, 40, 0.32); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background-color: var(--paper); padding: 26px 26px 22px; transform: rotate(-0.3deg); }
.modal h3 { margin-bottom: 10px; }
.modal .x { position: absolute; top: 10px; right: 14px; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { font-size: 17px; line-height: 24px; padding: 14px 16px; animation: slidein .2s; }
.toast.err { background-color: var(--sticky-pink); color: var(--graphite); }
@keyframes slidein { from { transform: translateY(10px) rotate(1deg); opacity: 0; } }
.wallet-list { display: grid; gap: 10px; }

/* ---------- footer ---------- */
.foot { padding: 50px 0 60px; margin-top: 50px; font-size: 17px; }
.foot .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.foot a { display: block; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.demo-banner { font-size: 15px; line-height: 22px; padding: 6px 14px; text-align: center; background: var(--hatch); border-bottom: 1px dashed var(--graphite-4); }

/* ---------- docs ---------- */
.doc { max-width: 820px; }
.doc h2 { margin: 40px 0 10px; }
.doc dl dt { font-family: var(--font-head); font-size: 26px; margin-top: 14px; }
.doc dl dd { margin: 0; color: var(--graphite-2); }
details.faq { border-bottom: 1px dashed rgba(58,58,58,.25); padding: 4px 0; }
details.faq summary { cursor: pointer; font-size: 20px; }

/* ---------- responsive ---------- */
@media (max-width: 1440px) {
  .search { width: 150px; }
  .navlinks a { padding: 4px 7px; }
  #wallet-btn .connect-label.num { display: none; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard { grid-template-columns: 1fr; }
  .g2.split { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 900px) {
  :root { --mx: 30px; --gutter: 16px; }
  .holes { display: none; }
  .wrap { padding-left: calc(var(--mx) + 14px); }
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 28px; }
  .wizard, .g2.split { grid-template-columns: minmax(0, 1fr); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .navlinks { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--paper); padding: 10px calc(var(--mx) + 14px) 18px; border-bottom: 2px solid var(--graphite-2); }
  .navlinks.open { display: flex; }
  .navlinks a { font-size: 22px; padding: 6px 4px; }
  .menu-btn { display: inline-flex; }
  .search { display: none; }
  .nav { gap: 10px; }
  .nav-right { margin-left: auto; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
  .section-head { grid-template-columns: 1fr; }
  .page-head.illustrated, .chapter, .cta-box { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .page-head.illustrated .illo { order: -1; justify-self: start; max-width: 170px; }
  .chapter .illo, .cta-box .illo { position: static; max-width: 170px; }
  .more { display: none; }
  .navlinks .in-more { display: block; }
  .section-head > * { grid-column: 1 !important; }
  .book .lvl { grid-template-columns: 1.2fr .8fr 1fr .5fr; }
  .book .lvl > :nth-child(5) { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 18px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .g4.keep2 { grid-template-columns: 1fr 1fr; }
  .brand svg { height: 34px; }
  .btn { font-size: 18px; padding: 10px 14px 9px; }
  .hero-tag { font-size: 28px; }
  .stat .v { font-size: 24px; }
  .chart-box { height: 300px; }
  .foot .cols { grid-template-columns: 1fr; }
  .preset p { min-height: 0; }
  .connect-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  * { transition: none !important; }
}
