/* BestSwapers
   Reference-table aesthetic: paper stock, serif headings, hairline rules,
   tabular monospace figures. Rows, not cards. No hero. */

:root {
  --paper: #f5f2ec;
  --paper-2: #efebe3;
  --ink: #1a1815;
  --ink-2: #55504a;
  --ink-3: #8a837a;
  --rule: #ddd7cc;
  --rule-hard: #c4bcae;
  --accent: #1f5c3d;
  --accent-2: #2d7d54;
  --warn: #8a5a11;
  --bad: #9c2b21;
  --hi: #f9e9c9;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16151a;
    --paper-2: #1d1c22;
    --ink: #e8e4dc;
    --ink-2: #a8a29a;
    --ink-3: #756e66;
    --rule: #2c2a31;
    --rule-hard: #423f48;
    --accent: #6fbf95;
    --accent-2: #8fd6b0;
    --warn: #d9a441;
    --bad: #e0736a;
    --hi: #2a2418;
  }
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(1040px, 100% - 3rem); margin-inline: auto; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: var(--rule-hard); }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0 0 .4rem; letter-spacing: -0.01em; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: .75rem; top: .75rem; background: var(--ink); color: var(--paper); padding: .4rem .7rem; z-index: 10; }

/* ---------- masthead ---------- */

.masthead { border-bottom: 2px solid var(--ink); background: var(--paper); }
.masthead-inner {
  display: flex; align-items: baseline; gap: 1.25rem;
  padding: .85rem 0 .8rem; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-size: 1.32rem; letter-spacing: -0.015em;
  text-decoration: none; white-space: nowrap;
}
.brand em { font-style: italic; }
.masthead-note { margin: 0; font-size: .8rem; color: var(--ink-3); flex: 1 1 18rem; }
.masthead nav { display: flex; gap: 1.1rem; font-size: .82rem; font-family: var(--mono); }
.masthead nav a { text-decoration: none; color: var(--ink-3); }
.masthead nav a:hover { color: var(--ink); }
.masthead nav a.on { color: var(--ink); border-bottom: 2px solid var(--ink); }

/* ---------- toolbar ---------- */

.toolbar { padding: 1.1rem 0 .9rem; display: grid; gap: .35rem; }
.tool { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.tool-key {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); width: 3.2rem; flex: none;
}
.opts { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; }
.opts li + li::before { content: "/"; color: var(--rule-hard); padding: 0 .5rem; }
.opts button {
  font: inherit; font-size: .84rem; background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--ink-3); text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 3px;
}
.opts button:hover { color: var(--ink); text-decoration-color: var(--rule-hard); }
.opts button.on { color: var(--ink); font-weight: 600; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* ---------- table ---------- */

.thead, .row {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr) repeat(6, 2.1rem) 3.1rem 2.4rem;
  gap: 0 .5rem;
  align-items: start;
}

.thead {
  padding: .4rem 0; border-bottom: 1px solid var(--ink);
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3);
}
.th-ax, .th-tot, .th-agt { text-align: center; }
.th-agt { color: var(--accent); }
.th-tot { text-align: right; }

.table { list-style: none; margin: 0 0 2rem; padding: 0; counter-reset: rank; }

.row {
  counter-increment: rank;
  padding: .9rem 0 .95rem;
  border-bottom: 1px solid var(--rule);
}
.row:hover { background: var(--paper-2); }
.row[hidden] { display: none; }
.row.is-caution .ident h2 a { text-decoration-color: var(--warn); }
.row.is-dead { color: var(--ink-3); }
.row.is-dead .ident h2 a { text-decoration-line: line-through; }

.rank::before {
  content: counter(rank);
  font-family: var(--mono); font-size: .82rem; color: var(--ink-3);
}

.ident { min-width: 0; }
.ident h2 { font-size: 1.12rem; margin: -.15rem 0 .2rem; display: flex; align-items: center; gap: .5rem; }
.ident h2 a { text-decoration-color: transparent; }
.row:hover .ident h2 a { text-decoration-color: var(--rule-hard); }

.logo {
  width: 22px; height: 22px; flex: none; border-radius: 3px;
  background: var(--paper-2); object-fit: contain;
}
.mono-tile {
  display: grid; place-items: center;
  font-family: var(--serif); font-size: .82rem; color: var(--ink-2);
  border: 1px solid var(--rule-hard); background: transparent;
}

.blurb { margin: 0 0 .4rem; font-size: .855rem; color: var(--ink-2); max-width: 74ch; }

.meta { margin: 0 0 .3rem; display: flex; flex-wrap: wrap; gap: .3rem; }
.tag {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .02em;
  padding: .06rem .34rem; border: 1px solid var(--rule-hard); color: var(--ink-3);
  white-space: nowrap;
}
.tag.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag.warn, .tag.kyc-risk-based { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.tag.dead, .tag.kyc-required { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.tag.kyc-none { color: var(--accent); border-color: var(--accent); font-weight: 600; }

.meta-line { margin: 0; font-family: var(--mono); font-size: .72rem; color: var(--ink-2); }
.meta-line .k { color: var(--ink-3); }
.meta-line .sep { color: var(--rule-hard); padding: 0 .15rem; }

/* score cells: tint carries the value, the digit states it */
.cell {
  font-family: var(--mono); font-size: .82rem; text-align: center;
  padding: .1rem 0; border: 1px solid transparent;
}
.cell.v0, .cell.v1, .cell.v2, .cell.v3 { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.cell.v4, .cell.v5, .cell.v6 { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.cell.v7, .cell.v8 { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.cell.v9, .cell.v10 { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); font-weight: 600; }

.cells { display: contents; }
/* agent access sits apart from the six scored axes */
.agt {
  font-family: var(--mono); font-size: .82rem; text-align: center; padding: .1rem 0;
  border: 1px solid var(--rule); color: var(--ink-3); margin-left: .4rem;
}
.agt.v8, .agt.v9, .agt.v10 { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.total { font-family: var(--mono); font-size: 1.02rem; text-align: right; letter-spacing: -0.02em; }

.nojs-note, .table-foot { font-size: .78rem; color: var(--ink-3); max-width: 78ch; }
.table-foot { border-top: 1px solid var(--rule); padding-top: .8rem; margin-bottom: 3rem; }
body.js .nojs-note { display: none; }

/* ---------- service sheet + prose ---------- */

.sheet, .prose { padding: 1.75rem 0 3.5rem; max-width: 50rem; }
.crumb { font-family: var(--mono); font-size: .76rem; color: var(--ink-3); margin: 0 0 1.75rem; }

.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 2rem;
  flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 2px solid var(--ink);
}
.sheet-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); display: flex; align-items: center; gap: .6rem; }
.sheet-head .logo { width: 30px; height: 30px; }
.sheet-total { margin: 0; font-family: var(--mono); white-space: nowrap; }
.sheet-total b { font-size: 2rem; font-weight: 500; letter-spacing: -0.03em; }
.sheet-total span { font-size: .7rem; color: var(--ink-3); display: block; text-align: right; }

.callout { padding: .75rem .9rem; margin: 1.5rem 0; font-size: .88rem; border-left: 3px solid; background: var(--paper-2); }
.callout.warn { border-color: var(--warn); }
.callout.bad { border-color: var(--bad); }

.lede { font-family: var(--serif); font-size: 1.14rem; color: var(--ink-2); margin: 1.5rem 0; max-width: 64ch; }

.sheet section { margin-top: 2.5rem; }
.sheet section h2, .prose h2 { font-size: 1.2rem; margin-bottom: .8rem; padding-bottom: .3rem; border-bottom: 1px solid var(--rule); }

.axes { display: grid; gap: .4rem; max-width: 30rem; }
.axis { display: grid; grid-template-columns: 5rem 1fr 1.4rem; align-items: center; gap: .6rem; }
.axis-label { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.axis-track { height: 8px; background: var(--paper-2); border: 1px solid var(--rule); }
.axis-fill { display: block; height: 100%; background: var(--accent); }
.axis-fill.v0, .axis-fill.v1, .axis-fill.v2, .axis-fill.v3 { background: var(--bad); }
.axis-fill.v4, .axis-fill.v5, .axis-fill.v6 { background: var(--warn); }
.axis-num { font-family: var(--mono); font-size: .78rem; text-align: right; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.two-col h2 { border: 0; padding: 0; }
.pros, .cons { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.pros li, .cons li { padding-left: 1.2rem; position: relative; font-size: .88rem; color: var(--ink-2); }
.pros li::before { content: "+"; position: absolute; left: 0; color: var(--accent); font-family: var(--mono); }
.cons li::before { content: "−"; position: absolute; left: 0; color: var(--bad); font-family: var(--mono); }

.fee-line { font-family: var(--mono); font-size: 1.05rem; color: var(--accent); margin: 0 0 .5rem; }

.spec { margin: 0; display: grid; }
.spec div { display: grid; grid-template-columns: 13rem 1fr; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.spec dt { color: var(--ink-3); font-size: .84rem; }
.spec dd { margin: 0; font-family: var(--mono); font-size: .82rem; }

.ext { font-family: var(--mono); font-size: .86rem; }
.onion code { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); word-break: break-all; }
.fine { font-size: .78rem; color: var(--ink-3); }

.prose p { color: var(--ink-2); max-width: 68ch; }
.prose ul { color: var(--ink-2); padding-left: 1.1rem; max-width: 68ch; }
.prose li { margin-bottom: .4rem; }
.prose strong { color: var(--ink); }
.prose code, .colophon code { font-family: var(--mono); font-size: .87em; background: var(--paper-2); padding: .05rem .3rem; }

.weights { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 1rem; }
.weights th, .weights td { text-align: left; padding: .55rem .7rem .55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.weights thead th { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); border-bottom-color: var(--ink); }
.weights tbody th { font-weight: 600; width: 10rem; }
.weights td.w { font-family: var(--mono); color: var(--accent); width: 4rem; }
.weights td { color: var(--ink-2); }

/* ---------- colophon ---------- */

.colophon { border-top: 2px solid var(--ink); padding: 1.5rem 0 2.5rem; margin-top: 1rem; }
.colophon-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.5rem; }
.colophon-grid p { margin: 0; font-size: .78rem; color: var(--ink-3); max-width: 44ch; }
.colophon-grid b { color: var(--ink-2); }
.colophon-foot { font-family: var(--mono); font-size: .68rem; color: var(--ink-3); margin: 1.75rem 0 0; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .thead { display: none; }
  .row { grid-template-columns: 1.6rem minmax(0, 1fr) 3rem; row-gap: .55rem; }
  .ident { grid-column: 2; }
  .total { grid-column: 3; grid-row: 1; }
  .agt { grid-column: 2 / -1; justify-self: start; margin-left: 0; padding: .05rem .35rem; }
  .agt::before { content: "agents "; font-size: .58rem; color: var(--ink-3); text-transform: uppercase; }
  .cells { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: .25rem; }
  .cell { padding: .05rem .35rem; min-width: 2.6rem; }
  .cell::before { content: attr(data-ax) " "; font-size: .58rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
  .two-col { grid-template-columns: 1fr; gap: 1.75rem; }
  .spec div { grid-template-columns: 1fr; gap: .1rem; }
}

@media (max-width: 560px) {
  .wrap { width: min(1040px, 100% - 1.5rem); }
  .masthead-note { display: none; }
  .tool-key { width: auto; }
}

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