/* SKETCH — SURF's terminal system (white, 2px ink frames, steel-blue accent, mono)
   plus a pencil/caricature layer: wobbly hand-drawn frames, margin scribbles, doodles. */
:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --raised: #f1f4f7;
  --line: #dfe5ea;
  --ink: #0e0e0e;
  --mute: #56626e;
  --dim: #94a0ab;
  --acc: #6d90aa;
  --acc-soft: rgb(109 144 170 / 0.14);
  --ok: #2f8f55;
  --warn: #b7791f;
  --bad: #c2453d;
  --bar: #0e0e0e;
  --paper: #fbfaf6;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --hand: "Patrick Hand", "Comic Sans MS", cursive;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 13px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased; padding-bottom: 28px; overflow-x: hidden;
}
::selection { background: var(--acc); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.acc { color: var(--acc); }
.dim { color: var(--dim); }
.mute { color: var(--mute); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.bold { font-weight: 700; }
.tabular { font-variant-numeric: tabular-nums; }
.pixel { image-rendering: pixelated; }
.u { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: var(--dim); }
.u:hover { color: var(--acc); text-decoration-color: var(--acc); }
.label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.hand { font-family: var(--hand); font-size: 17px; line-height: 1.2; color: var(--acc); }

/* ── nav ── */
.nav { position: sticky; top: 0; z-index: 40; background: rgb(255 255 255 / .95); backdrop-filter: blur(6px); border-bottom: 2px solid var(--ink); }
.nav-row { display: flex; align-items: center; gap: 24px; height: 48px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; }
.nav-links { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex: 1; min-width: 0; }
.nav-links .sep, .foot-links .sep { color: var(--dim); }
.nav-links a.active { color: var(--acc); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-mobile { display: none; gap: 12px; overflow-x: auto; border-top: 1px solid var(--line); padding: 6px 16px; font-size: 12px; white-space: nowrap; }
@media (max-width: 860px) { .nav-links { display: none; } .nav-mobile { display: flex; } }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--ink); padding: 4px 12px; font: 700 12px var(--mono); cursor: pointer; background: #fff; color: var(--ink); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--acc); border-color: var(--acc); }
.btn-acc { background: var(--acc); border-color: var(--acc); color: #fff; padding: 8px 16px; }
.btn-acc:hover { filter: brightness(1.08); }
.btn-line { border-color: var(--ink); padding: 8px 16px; }
.btn-line:hover { background: var(--raised); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--mute); border: 1px solid var(--line); padding: 3px 8px; }
@media (max-width: 520px) { .live-pill span { display: none; } }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.live-dot.on { background: var(--acc); animation: live-dot 1.4s ease-out infinite; }
.live-dot.off { background: var(--bad); }
@keyframes live-dot { 0% { box-shadow: 0 0 0 0 rgb(109 144 170 / .7); } 100% { box-shadow: 0 0 0 6px rgb(109 144 170 / 0); } }

/* ── sketchy frame: border drawn on a layer with the pencil wobble filter, content stays crisp ── */
.sk { position: relative; }
.sk::before {
  content: ""; position: absolute; inset: 0; border: 2px solid var(--ink); pointer-events: none; filter: url(#rough); z-index: 2;
}
.sk.sk-double::after { content: ""; position: absolute; inset: 3px -3px -3px 3px; border: 1.5px solid var(--ink); opacity: .35; pointer-events: none; filter: url(#rough-strong); z-index: 0; }

/* ── window chrome (SURF) ── */
.win { display: flex; flex-direction: column; min-width: 0; background: var(--panel); }
.win-bar { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 8px; background: var(--bar); color: #fff; font-size: 11px; position: relative; z-index: 1; }
.win-dots { display: flex; gap: 3px; flex-shrink: 0; }
.win-dots i { width: 7px; height: 7px; background: #fff; display: block; }
.win-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(255 255 255 / .85); }
.win-title.addr { background: #fff; color: var(--ink); padding: 0 6px; }
.win-right { flex-shrink: 0; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: rgb(255 255 255 / .75); }
.win-right .accent { color: #9fc2dc; }
.win-body { flex: 1; min-width: 0; position: relative; z-index: 1; }

.rule { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 12px; }
.rule .line { height: 1px; flex: 1; background: var(--ink); }
.rule b { flex-shrink: 0; }

/* ── home ── */
.banner { padding-top: 24px; }
.banner svg { width: 100%; height: auto; display: block; }
.hero { display: grid; grid-template-columns: 1fr 360px; gap: 48px; padding-top: 20px; align-items: start; }
@media (max-width: 960px) { .hero { grid-template-columns: 1fr; gap: 28px; } }
.kicker { font-size: 11.5px; color: var(--mute); }
h1.big { font: 800 clamp(36px, 6.5vw, 66px)/1 var(--display); letter-spacing: -.03em; margin: 16px 0 0; }
h1.big .scribble { position: relative; white-space: nowrap; }
h1.big .scribble svg { position: absolute; left: -4%; bottom: -14px; width: 108%; height: 22px; overflow: visible; }
h2.page { font: 800 clamp(28px, 4.4vw, 42px)/1.05 var(--display); letter-spacing: -.02em; margin: 28px 0 6px; }
.lead { margin-top: 20px; color: var(--mute); max-width: 620px; line-height: 1.65; }
.hero-links { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 4px 8px; font-weight: 700; font-size: 14px; }
.hero-links .sep { color: var(--dim); font-weight: 400; }
.hero-cta { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.stat-line { margin-top: 16px; font-size: 11.5px; color: var(--dim); }
.margin-note { position: absolute; transform: rotate(-4deg); font-family: var(--hand); color: var(--acc); font-size: 18px; white-space: nowrap; pointer-events: none; }

.ls { margin-top: 56px; }
.ls-grid { display: grid; grid-template-columns: repeat(5, 1fr); }
.ls-grid a { padding: 16px; border-right: 1px solid var(--ink); position: relative; z-index: 1; }
.ls-grid a:last-child { border-right: 0; }
.ls-grid a:hover { background: var(--raised); }
.ls-grid a:hover .ls-name { color: var(--acc); }
.ls-name { font-size: 14px; font-weight: 700; }
.ls-info { margin-top: 4px; font-size: 11px; color: var(--acc); }
.ls-d { margin-top: 8px; font-size: 12px; color: var(--mute); line-height: 1.6; }
.ls-open { margin-top: 12px; font-size: 11px; color: var(--dim); }
@media (max-width: 960px) { .ls-grid { grid-template-columns: 1fr 1fr; } .ls-grid a { border-right: 0; border-bottom: 1px solid var(--ink); } }
@media (max-width: 560px) { .ls-grid { grid-template-columns: 1fr; } }

/* caricature card (doodle in a window) */
.toon { background: var(--paper); }
.toon svg { display: block; width: 100%; height: auto; }
.toon-cap { padding: 10px 12px; border-top: 1px dashed var(--dim); font-family: var(--hand); font-size: 17px; line-height: 1.25; }

/* ── tables ── */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; font-weight: 400; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; background: #fff; position: sticky; top: 0; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.tbl tr.row { cursor: pointer; }
.tbl tr.row:hover td { background: var(--raised); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.entry-in td { animation: entry-in 1.4s ease-out both; }
@keyframes entry-in { from { background: rgb(109 144 170 / .25); } to { background: transparent; } }
.tok { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok img, .tok .ph { width: 28px; height: 28px; object-fit: cover; border: 1.5px solid var(--ink); background: var(--raised); flex-shrink: 0; }
.tok .ph { display: grid; place-items: center; font-size: 10px; color: var(--dim); }
.tok-name { font-weight: 700; }
.tok-sub { font-size: 11px; color: var(--dim); max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; padding: 1px 6px; border: 1px solid currentColor; }
.badge.finalized { color: var(--ok); }
.badge.confirmed { color: var(--acc); }
.badge.pending { color: var(--mute); }
.badge.error { color: var(--warn); }
.badge.rejected { color: var(--bad); }
.thinking::after { content: ""; display: inline-block; width: 1.5em; text-align: left; animation: dots 1.2s steps(1) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.chip { border: 1px solid var(--line); padding: 3px 9px; cursor: pointer; background: #fff; font: 12px var(--mono); color: var(--mute); }
.chip.on { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.empty { padding: 40px 16px; text-align: center; color: var(--mute); }
.empty .hand { font-size: 20px; }

/* ── coin page ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; font-size: 12px; }
.kv > div { padding: 7px 12px; border-bottom: 1px solid var(--line); min-width: 0; overflow-wrap: anywhere; }
.kv > div:nth-child(odd) { color: var(--mute); }
.kv .src { display: block; font-size: 10.5px; color: var(--dim); }
.checks { list-style: none; margin: 0; padding: 8px 12px; font-size: 12px; }
.checks li { padding: 4px 0; display: flex; gap: 8px; }
.coin-head { display: flex; align-items: center; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.coin-head img, .coin-head .ph { width: 64px; height: 64px; border: 2px solid var(--ink); object-fit: cover; background: var(--raised); }
.coin-head h2 { margin: 0; font: 800 34px/1 var(--display); letter-spacing: -.02em; }
.links { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; margin-top: 6px; }
.mono-addr { font-size: 11.5px; color: var(--mute); overflow-wrap: anywhere; }
.copy { cursor: pointer; border: 1px solid var(--line); background: #fff; font: 11px var(--mono); padding: 1px 6px; color: var(--mute); }
.copy:hover { border-color: var(--ink); color: var(--ink); }

/* ── stat tiles ── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); }
.tile { padding: 14px 16px; border-right: 1px solid var(--line); position: relative; z-index: 1; }
.tile:last-child { border-right: 0; }
.tile .v { font: 700 24px/1.1 var(--display); margin-top: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr 1fr; } .tile:nth-child(2) { border-right: 0; } .tile:nth-child(-n+2) { border-bottom: 1px solid var(--line); } }

/* ── phase placeholder ── */
.soon { display: grid; grid-template-columns: 280px 1fr; gap: 28px; padding: 24px; align-items: center; }
@media (max-width: 760px) { .soon { grid-template-columns: 1fr; } }
.steps { margin: 0; padding-left: 18px; color: var(--mute); line-height: 1.8; }
.note-box { border: 1px dashed var(--acc); background: var(--acc-soft); padding: 10px 12px; font-size: 12px; color: var(--ink); }

.prose { max-width: 760px; color: var(--mute); line-height: 1.75; font-size: 13px; }
.prose h3 { color: var(--ink); font: 700 18px var(--display); margin: 28px 0 6px; }
.prose code { background: var(--raised); padding: 1px 5px; color: var(--ink); }

.section { margin-top: 36px; }

/* ── footer + statusbar ── */
.foot { margin-top: 80px; border-top: 2px solid var(--ink); }
.foot-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 12px; font-size: 12px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px; color: var(--mute); }
.foot-note { font-size: 11px; color: var(--dim); padding-bottom: 24px; margin: 0 auto; }
.statusbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 28px; display: flex; align-items: center; border-top: 2px solid var(--ink); background: #fff; font-size: 11px; }
.sb-brand { height: 100%; display: flex; align-items: center; padding: 0 10px; background: var(--bar); color: #fff; font-weight: 700; }
.sb-cell { height: 100%; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-right: 1px solid var(--ink); white-space: nowrap; }
.sb-cell.dim { border-right: 0; }
.sb-right { margin-left: auto; border-left: 1px solid var(--ink); border-right: 0; color: var(--mute); }
@media (max-width: 640px) { .hide-sm { display: none; } }
@media (max-width: 900px) { .hide-md { display: none; } }

@keyframes wobble { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg); } }
.wobble { animation: wobble 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes draw { from { stroke-dashoffset: var(--len, 600); } to { stroke-dashoffset: 0; } }
.draw { stroke-dasharray: var(--len, 600); animation: draw 2.2s ease-out both; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; } }

.hero-side { position: relative; }
@media (max-width: 960px) { .hero-side { max-width: 340px; } }

/* ── phase 3: live trade panels ── */
.kvt td, .kvt th { padding: 6px 10px; }
.kvt td:first-child { color: var(--mute); }
.kvt .src, .tbl .src { display: block; font-size: 10px; color: var(--dim); }
.chart-wrap { position: relative; padding: 10px 12px 12px; }
.chart { width: 100%; }
.chart .ax { font: 10px var(--mono); fill: var(--dim); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11px; color: var(--mute); margin-bottom: 6px; }
.legend i, .tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tip { position: absolute; z-index: 5; background: #fff; border: 1.5px solid var(--ink); padding: 8px 10px; font-size: 11px; line-height: 1.6; pointer-events: none; min-width: 150px; box-shadow: 3px 3px 0 rgb(14 14 14 / .12); }
.kvt td:first-child { white-space: normal; min-width: 120px; max-width: 190px; }
.kvt th { white-space: nowrap; }
.kvt .src { white-space: normal; }

/* phase 4 */
.meter { display: inline-block; width: calc(100% - 34px); max-width: 160px; height: 8px; background: var(--raised); border: 1px solid var(--line); vertical-align: middle; }
.meter i { display: block; height: 100%; background: var(--ink); }
.num-s { display: inline-block; width: 28px; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.tile .v .unit { font: 400 12px var(--mono); color: var(--dim); margin-left: 2px; }
.checks.ind li, .checks.warnl li { align-items: flex-start; }
.checks.ind a.u { font-size: 11px; margin-left: 2px; }
.tag { flex: none; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; border: 1px solid var(--line); padding: 0 5px; color: var(--mute); height: fit-content; }
.gates { white-space: nowrap; letter-spacing: 1px; }
.gdot { font-size: 11px; }
.tok .src { display: block; font-size: 10.5px; color: var(--dim); }

/* phase 5 */
.art-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 16px; }
.art-grid.wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.art-card { margin: 0; border: 2px solid var(--ink); background: var(--paper); display: flex; flex-direction: column; min-width: 0; }
.art-pic { aspect-ratio: 1 / 1; border-bottom: 2px solid var(--ink); background: #fff; display: grid; place-items: center; overflow: hidden; }
.art-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-fail { padding: 16px; font-size: 11.5px; color: var(--mute); text-align: center; }
.art-card figcaption { padding: 10px 12px; display: grid; gap: 6px; font-size: 12px; }
.art-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.art-cap { font-size: 17px; line-height: 1.2; }
.art-src { font-size: 11px; color: var(--mute); }
.sw { display: flex; gap: 4px; }
.sw i { width: 16px; height: 16px; border: 1px solid var(--ink); display: block; }
@media (max-width: 760px) { .art-grid { grid-template-columns: 1fr; } }

/* launch */
.launch-up { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 16px; }
.drop { border: 2px dashed var(--ink); min-height: 220px; display: grid; place-items: center; text-align: center; padding: 16px; cursor: pointer; background: var(--paper); font-size: 13px; }
.drop.over { background: var(--acc-soft); }
.drop img { max-width: 100%; max-height: 260px; display: block; }
.launch-up textarea, .launch-form input, .launch-form textarea { font: 13px var(--mono); padding: 8px 10px; border: 1.5px solid var(--ink); background: #fff; width: 100%; box-sizing: border-box; resize: vertical; }
.launch-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; padding: 16px; }
.lf-grid { display: grid; gap: 6px; }
.lf-grid .label { margin-top: 6px; }
.launch-form .btn, .launch-up .btn { justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.pick { cursor: pointer; }
.pick.on { outline: 4px solid var(--acc); outline-offset: 3px; }
@media (max-width: 760px) { .launch-up, .launch-form { grid-template-columns: 1fr; } }

/* site bits: CA pill + X link */
.site-bits { display: inline-flex; align-items: center; gap: 8px; }
.ca-pill { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 11px; color: var(--ink); background: #fff; border: 1px solid var(--ink); padding: 3px 8px; cursor: pointer; }
.ca-pill b { font-weight: 700; }
.ca-pill.soon { cursor: default; color: var(--mute); border-color: var(--line); }
.ca-pill .ca-done { color: var(--acc); }
.ca-pill:not(.soon):hover { background: var(--ink); color: #fff; }
.x-link { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--ink); color: var(--ink); background: #fff; }
.x-link:hover { background: var(--ink); color: #fff; }
@media (max-width: 520px) { .ca-pill .ca-addr, .ca-pill.soon span { display: none; } .ca-pill.soon::after { content: 'soon'; } }
/* admin */
.adm-form { display: grid; gap: 10px; padding: 14px; max-width: 640px; }
.adm-form input:not([type=checkbox]) { font: 13px var(--mono); padding: 8px 10px; border: 1.5px solid var(--ink); background: #fff; width: 100%; box-sizing: border-box; }
.adm-toggle { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.adm-toggle input { margin-top: 3px; }
.adm-toggle > span { display: grid; gap: 2px; font-size: 13px; }
