/* ==========================================================================
   RetailToken.ai — design system
   Swiss registry: paper, ink, one signal red. Data is the hero.

   No build step, no preprocessor, no dependencies. Edit this file directly.

   Contents
     01  Reset
     02  Tokens — colour
     03  Tokens — type, space, layout
     04  Base elements
     05  Layout primitives
     06  Header / nav / footer
     07  Type components
     08  The registry table
     09  Badges, chips, addresses
     10  Buttons
     11  Cards, stats, key-value, callouts
     12  Prose
     13  Forms & filters
     14  Utilities
     15  Motion
     16  Print
   ========================================================================== */


/* 01  Reset ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

:where(a) { color: inherit; }

:target { scroll-margin-top: 6rem; }


/* 02  Tokens — colour ------------------------------------------------------

   Full light palette lives on bare :root so every colour has a definition
   that does not depend on a media query. Dark mode redefines only what
   changes, twice: once for system preference (guarded so an explicit light
   choice wins) and once for the explicit toggle.
   -------------------------------------------------------------------------- */

:root {
  --paper:         #fbfaf8;
  --paper-2:       #f4f2ed;
  --surface:       #ffffff;
  --surface-sunk:  #f0eee8;

  --ink:           #14130f;
  --ink-2:         #45433c;
  --ink-3:         #77746b;
  --ink-4:         #9c988e;

  --rule:          #e2dfd7;
  --rule-strong:   #c7c2b7;

  --accent:        #c8102e;
  --accent-hover:  #a80c26;
  --accent-ink:    #ffffff;
  --accent-wash:   #fbeef0;

  --ok:            #1f6f43;
  --ok-wash:       #e9f3ed;

  --warn:          #8a5a12;
  --warn-wash:     #f7f0e3;

  --shadow-sm: 0 1px 2px rgb(20 19 15 / 0.04);
  --shadow-md: 0 2px 8px rgb(20 19 15 / 0.06), 0 1px 2px rgb(20 19 15 / 0.04);

  --grain-opacity: 0.035;
  --selection-bg:  #14130f;
  --selection-ink: #fbfaf8;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:         #100f0d;
    --paper-2:       #171613;
    --surface:       #171613;
    --surface-sunk:  #0a0a08;

    --ink:           #f2f0ea;
    --ink-2:         #b9b5ab;
    --ink-3:         #868278;
    --ink-4:         #6a675f;

    --rule:          #2b2926;
    --rule-strong:   #423e38;

    --accent:        #ff4d5e;
    --accent-hover:  #ff6b78;
    --accent-ink:    #100f0d;
    --accent-wash:   #261417;

    --ok:            #57b37f;
    --ok-wash:       #14211a;

    --warn:          #d09a3c;
    --warn-wash:     #241d10;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 2px 10px rgb(0 0 0 / 0.5), 0 1px 2px rgb(0 0 0 / 0.4);

    --grain-opacity: 0.022;
    --selection-bg:  #f2f0ea;
    --selection-ink: #100f0d;

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper:         #100f0d;
  --paper-2:       #171613;
  --surface:       #171613;
  --surface-sunk:  #0a0a08;

  --ink:           #f2f0ea;
  --ink-2:         #b9b5ab;
  --ink-3:         #868278;
  --ink-4:         #6a675f;

  --rule:          #2b2926;
  --rule-strong:   #423e38;

  --accent:        #ff4d5e;
  --accent-hover:  #ff6b78;
  --accent-ink:    #100f0d;
  --accent-wash:   #261417;

  --ok:            #57b37f;
  --ok-wash:       #14211a;

  --warn:          #d09a3c;
  --warn-wash:     #241d10;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-md: 0 2px 10px rgb(0 0 0 / 0.5), 0 1px 2px rgb(0 0 0 / 0.4);

  --grain-opacity: 0.022;
  --selection-bg:  #f2f0ea;
  --selection-ink: #100f0d;

  color-scheme: dark;
}


/* 03  Tokens — type, space, layout ---------------------------------------- */

:root {
  /* System stacks. No webfont request, no layout shift, no licence, and
     nothing that can 404 in five years' time. */
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  /* Fluid scale, 320px → 1280px viewport. */
  --step--2: clamp(0.6875rem, 0.67rem + 0.09vw, 0.75rem);
  --step--1: clamp(0.8125rem, 0.79rem + 0.11vw, 0.875rem);
  --step-0:  clamp(0.9375rem, 0.91rem + 0.14vw, 1.0625rem);
  --step-1:  clamp(1.0625rem, 1.01rem + 0.28vw, 1.25rem);
  --step-2:  clamp(1.25rem, 1.15rem + 0.5vw, 1.625rem);
  --step-3:  clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
  --step-4:  clamp(1.875rem, 1.5rem + 1.85vw, 3.25rem);
  --step-5:  clamp(2.25rem, 1.6rem + 3.25vw, 4.75rem);

  /* Space, on a 4px rhythm. */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.5rem;
  --s-6:  2rem;
  --s-7:  3rem;
  --s-8:  4rem;
  --s-9:  6rem;
  --s-10: 8rem;

  --measure: 68ch;
  --container: 78rem;
  --gutter: clamp(1.25rem, 0.85rem + 2vw, 3rem);
  --radius: 3px;
  --hairline: 1px;
}


/* 04  Base elements -------------------------------------------------------- */

body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Paper grain. An inline SVG turbulence — no network request, and it gives
   the flat paper just enough tooth to stop it reading as a plain white div. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

::selection { background: var(--selection-bg); color: var(--selection-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.021em;
  text-wrap: balance;
}

p, li { text-wrap: pretty; }

hr {
  border: 0;
  border-top: var(--hairline) solid var(--rule);
  margin: var(--s-7) 0;
}

code, kbd, samp, pre { font-family: var(--font-mono); font-size: 0.92em; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Numerals lock to a grid wherever data is shown. */
table, .tabular, .stat__value, .addr, time, .num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}


/* 05  Layout primitives ---------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: 56rem; }
.container--prose  { max-width: 44rem; }

.section { padding-block: clamp(var(--s-7), 5vw, var(--s-9)); }
.section--tight { padding-block: var(--s-6); }
.section + .section { border-top: var(--hairline) solid var(--rule); }

.stack > * + * { margin-top: var(--flow, var(--s-4)); }
.stack--lg > * + * { margin-top: var(--s-6); }
.stack--sm > * + * { margin-top: var(--s-2); }

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-5) var(--gutter);
}

.grid--cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: var(--gutter);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}

.cluster--between { justify-content: space-between; }

.sidebar-layout {
  display: grid;
  gap: var(--s-7) var(--gutter);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 60rem) {
  .sidebar-layout { grid-template-columns: minmax(0, 1fr) 16rem; }
  .sidebar-layout--left { grid-template-columns: 16rem minmax(0, 1fr); }
}

main { flex: 1 0 auto; }


/* 06  Header / nav / footer ------------------------------------------------ */

.skip-link {
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  transform: translateY(-200%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: var(--hairline) solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  min-height: 3.75rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5ch;
  font-size: var(--step-0);
  font-weight: 650;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark__cross {
  color: var(--accent);
  font-weight: 400;
  font-size: 1.05em;
}
.wordmark__tld {
  color: var(--ink-4);
  font-weight: 450;
  font-size: var(--step--2);
  letter-spacing: 0.04em;
  text-transform: lowercase;
  font-family: var(--font-mono);
}

@media (max-width: 32rem) {
  .wordmark__tld { display: none; }
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(var(--s-3), 1.6vw, var(--s-5));
}

.nav__link {
  font-size: var(--step--1);
  color: var(--ink-2);
  text-decoration: none;
  padding-block: var(--s-2);
  border-bottom: 2px solid transparent;
  transition: color 0.14s ease, border-color 0.14s ease;
  white-space: nowrap;
}
.nav__link:hover { color: var(--ink); }
.nav__link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

@media (max-width: 47.99rem) {
  .nav__link--optional { display: none; }
}

.theme-toggle {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius);
  color: var(--ink-3);
  border: var(--hairline) solid transparent;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--rule); }
.theme-toggle svg { width: 1rem; height: 1rem; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.site-footer {
  border-top: var(--hairline) solid var(--rule);
  padding-block: var(--s-7) var(--s-6);
  font-size: var(--step--1);
  color: var(--ink-3);
  margin-top: var(--s-8);
}

.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; }

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr));
  gap: var(--s-6) var(--gutter);
  margin-bottom: var(--s-7);
}

.footer-grid h3 {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-4);
  font-weight: 600;
  margin-bottom: var(--s-3);
}

.footer-grid ul { list-style: none; padding: 0; }
.footer-grid li + li { margin-top: var(--s-2); }

.footer-legal {
  border-top: var(--hairline) solid var(--rule);
  padding-top: var(--s-5);
  font-size: var(--step--2);
  color: var(--ink-4);
  max-width: var(--measure);
}
.footer-legal p + p { margin-top: var(--s-3); }


/* 07  Type components ------------------------------------------------------ */

.eyebrow {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 600;
  color: var(--ink-4);
  display: block;
}

.eyebrow--accent { color: var(--accent); }

.display {
  font-size: var(--step-5);
  line-height: 0.98;
  letter-spacing: -0.034em;
  font-weight: 600;
  max-width: 18ch;
}

.title {
  font-size: var(--step-4);
  line-height: 1.05;
  letter-spacing: -0.028em;
  max-width: 22ch;
}

.heading {
  font-size: var(--step-2);
  letter-spacing: -0.018em;
  max-width: 34ch;
}

.subheading {
  font-size: var(--step-1);
  letter-spacing: -0.012em;
  font-weight: 600;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 46ch;
}

.meta {
  font-size: var(--step--1);
  color: var(--ink-3);
}

.micro {
  font-size: var(--step--2);
  color: var(--ink-4);
  letter-spacing: 0.01em;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: var(--hairline) solid var(--rule-strong);
  margin-bottom: var(--s-5);
}
.section-label__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

a.inline-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 0.14s ease, color 0.14s ease;
}
a.inline-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45ch;
  text-decoration: none;
  font-weight: 550;
  color: var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: color 0.14s ease, border-color 0.14s ease, gap 0.14s ease;
}
.link-arrow:hover { color: var(--accent); border-color: var(--accent); gap: 0.9ch; }


/* 08  The registry table --------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-block: var(--hairline) solid var(--rule-strong);
  scrollbar-width: thin;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  min-width: 44rem;
}

.table thead th {
  text-align: left;
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  color: var(--ink-4);
  padding: var(--s-3) var(--s-4);
  white-space: nowrap;
  border-bottom: var(--hairline) solid var(--rule-strong);
  background: var(--paper);
  position: sticky;
  top: 3.75rem;
  z-index: 2;
}

.table th[aria-sort] { cursor: pointer; user-select: none; }
.table th[aria-sort]:hover { color: var(--ink-2); }

.table th[aria-sort]::after {
  content: "";
  display: inline-block;
  width: 0.55em;
  margin-left: 0.5ch;
  opacity: 0;
  transition: opacity 0.14s ease;
}
.table th[aria-sort="ascending"]::after  { content: "↑"; opacity: 1; }
.table th[aria-sort="descending"]::after { content: "↓"; opacity: 1; }

.table tbody tr {
  border-bottom: var(--hairline) solid var(--rule);
  transition: background-color 0.12s ease;
}
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-sunk); }

.table td { padding: var(--s-4); vertical-align: baseline; }

.table__name {
  font-weight: 550;
  color: var(--ink);
  text-decoration: none;
  font-size: var(--step-0);
}
.table__name:hover { color: var(--accent); }

.table__sub {
  display: block;
  font-size: var(--step--2);
  color: var(--ink-4);
  margin-top: 2px;
  font-weight: 400;
}

.table td.is-numeric { text-align: right; }
.table td.is-tight { width: 1%; white-space: nowrap; }

.table__empty {
  padding: var(--s-8) var(--s-4);
  text-align: center;
  color: var(--ink-3);
}


/* 09  Badges, chips, addresses --------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
  font-size: var(--step--2);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2em 0.55em;
  border-radius: var(--radius);
  border: var(--hairline) solid var(--rule-strong);
  color: var(--ink-3);
  white-space: nowrap;
  line-height: 1.4;
}

/* Status carries the meaning of this site, so it gets the only real colour.
   Dead is the accent; everything else is quieter by degrees. */
.badge--dead {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  background: var(--accent-wash);
}

.badge--dormant {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 38%, transparent);
  background: var(--warn-wash);
}

.badge--absorbed {
  color: var(--ink-2);
  border-color: var(--rule-strong);
  background: var(--surface-sunk);
}

.badge--alive {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 38%, transparent);
  background: var(--ok-wash);
}

.badge--primary {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  background: var(--ok-wash);
  font-size: 0.85em;
}

.badge--chain {
  font-family: var(--font-mono);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

/* The on-chain column: supply and recent trades, sitting next to a status
   that says the project is over. The gap between them is the point. */
.onchain {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  white-space: nowrap;
}

.dot--cold { background: var(--ink-4); }

/* Citations. Every claim on this site traces to one of these, so they are
   given the weight of content rather than tucked away as small print. */
.sources {
  list-style: none;
  padding: 0;
  counter-reset: src;
  border-top: var(--hairline) solid var(--rule-strong);
}

.source {
  counter-increment: src;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0 var(--s-2);
  padding: var(--s-4) 0;
  border-bottom: var(--hairline) solid var(--rule);
}

.source::before {
  content: counter(src, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--ink-4);
  padding-top: 0.15em;
}

.source__link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.2em;
  font-size: var(--step--1);
}
.source__link:hover { color: var(--accent); text-decoration-color: var(--accent); }

.source__meta {
  grid-column: 2;
  font-size: var(--step--2);
  color: var(--ink-4);
  margin-top: var(--s-1);
  display: flex;
  align-items: center;
  gap: 0.5ch;
  flex-wrap: wrap;
}

/* The headline figure on an entry page: a single number doing the arguing. */
.verdict {
  border: var(--hairline) solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s-5) var(--s-6);
  background: var(--surface);
}

.verdict__figure {
  font-size: var(--step-4);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: block;
}

.verdict__caption {
  display: block;
  margin-top: var(--s-3);
  color: var(--ink-2);
  font-size: var(--step--1);
  max-width: 46ch;
}

/* Timeline on an entry page. Born, announced, died — in order, with the
   gaps visible, because the gaps are usually the story. */
.timeline {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0;
}

.timeline__item {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: var(--s-4);
  padding-bottom: var(--s-5);
  position: relative;
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__item::before {
  content: "";
  grid-column: 1;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rule-strong);
  margin-top: 0.42em;
  z-index: 1;
}
.timeline__item--end::before { background: var(--accent); }

.timeline__item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 4px; top: 1.1em; bottom: -0.2em;
  width: 1px;
  background: var(--rule);
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--ink-4);
  display: block;
  letter-spacing: 0.02em;
}

.timeline__label { color: var(--ink); font-size: var(--step--1); }

.addr {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  white-space: nowrap;
}

.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: 2px;
  color: var(--ink-4);
  opacity: 0;
  transition: opacity 0.14s ease, color 0.14s ease;
  flex: none;
}
.addr:hover .copy-btn,
.copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--ink); }
.copy-btn svg { width: 0.85em; height: 0.85em; }
.copy-btn[data-copied="true"] { color: var(--ok); opacity: 1; }
.copy-btn .icon-check { display: none; }
.copy-btn[data-copied="true"] .icon-check { display: block; }
.copy-btn[data-copied="true"] .icon-copy { display: none; }

@media (hover: none) {
  .copy-btn { opacity: 1; }
}


/* 10  Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6ch;
  font-size: var(--step--1);
  font-weight: 550;
  letter-spacing: 0.005em;
  padding: 0.68em 1.2em;
  border-radius: var(--radius);
  border: var(--hairline) solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.14s ease, border-color 0.14s ease,
              color 0.14s ease, transform 0.08s ease;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn--ghost:hover {
  background: var(--surface-sunk);
  border-color: var(--ink-3);
  color: var(--ink);
}

.btn--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn--sm { font-size: var(--step--2); padding: 0.5em 0.85em; }

.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.btn__spinner {
  width: 0.85em;
  height: 0.85em;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }


/* 11  Cards, stats, key-value, callouts ------------------------------------ */

.card {
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-5);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: border-color 0.14s ease;
}

a.card { text-decoration: none; }
a.card:hover { border-color: var(--ink-3); }

.card__title { font-size: var(--step-1); letter-spacing: -0.012em; }
.card__body { color: var(--ink-2); font-size: var(--step--1); flex: 1; }
.card__foot { margin-top: auto; padding-top: var(--s-2); }

.card--flush { background: transparent; border: 0; padding: 0; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(9rem, 100%), 1fr));
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.stat {
  padding: var(--s-4) var(--s-5);
  border-right: var(--hairline) solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.stat:last-child { border-right: 0; }

.stat__label {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-4);
  font-weight: 600;
}

.stat__value {
  font-size: var(--step-2);
  font-weight: 550;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat__value--mono { font-family: var(--font-mono); font-size: var(--step-0); }

.stat__note { font-size: var(--step--2); color: var(--ink-4); }

.kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: var(--hairline) solid var(--rule);
}

@media (min-width: 40rem) {
  .kv { grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr); }
}

.kv > dt {
  padding: var(--s-3) 0;
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  color: var(--ink-4);
  border-bottom: var(--hairline) solid var(--rule);
}

.kv > dd {
  padding: var(--s-3) 0;
  margin: 0;
  border-bottom: var(--hairline) solid var(--rule);
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 39.99rem) {
  .kv > dt { border-bottom: 0; padding-bottom: 0; }
}

.notice {
  border: var(--hairline) solid var(--rule-strong);
  border-left: 2px solid var(--ink-3);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: var(--s-4) var(--s-5);
  background: var(--surface-sunk);
  font-size: var(--step--1);
  color: var(--ink-2);
}
.notice > * + * { margin-top: var(--s-3); }
.notice strong { color: var(--ink); }

.notice--accent { border-left-color: var(--accent); background: var(--accent-wash); }

.notice__title {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--ink);
}

.pill-note {
  display: inline-flex;
  align-items: center;
  gap: 0.6ch;
  font-size: var(--step--2);
  color: var(--ink-3);
  border: var(--hairline) solid var(--rule);
  border-radius: 100px;
  padding: 0.3em 0.85em;
}

.dot {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--ink-4);
  flex: none;
}
.dot--live { background: var(--ok); }
.dot--pending { background: var(--accent); }


/* 12  Prose ---------------------------------------------------------------- */

.prose {
  max-width: var(--measure);
  color: var(--ink-2);
}

.prose > * + * { margin-top: var(--s-4); }

.prose h2 {
  font-size: var(--step-2);
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-top: var(--s-7);
  padding-top: var(--s-5);
  border-top: var(--hairline) solid var(--rule);
}

.prose h3 {
  font-size: var(--step-1);
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: var(--s-6);
}

.prose h4 {
  font-size: var(--step-0);
  color: var(--ink);
  margin-top: var(--s-5);
}

.prose > h2:first-child,
.prose > h3:first-child { margin-top: 0; border-top: 0; padding-top: 0; }

.prose ul, .prose ol { padding-left: 1.35em; }
.prose li + li { margin-top: var(--s-2); }
.prose li::marker { color: var(--ink-4); }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 0.2em;
}
.prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }

.prose blockquote {
  border-left: 2px solid var(--rule-strong);
  padding-left: var(--s-5);
  color: var(--ink-3);
  font-style: normal;
}

.prose code {
  background: var(--surface-sunk);
  border: var(--hairline) solid var(--rule);
  border-radius: 2px;
  padding: 0.1em 0.35em;
  color: var(--ink);
}

.prose strong { color: var(--ink); font-weight: 600; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}
.prose th {
  text-align: left;
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  padding: var(--s-2) var(--s-3) var(--s-2) 0;
  border-bottom: var(--hairline) solid var(--rule-strong);
}
.prose td {
  padding: var(--s-3) var(--s-3) var(--s-3) 0;
  border-bottom: var(--hairline) solid var(--rule);
  vertical-align: top;
}

.pre {
  background: var(--surface-sunk);
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-4);
  overflow-x: auto;
  font-size: var(--step--2);
  line-height: 1.65;
  color: var(--ink-2);
  scrollbar-width: thin;
}
.pre code { background: none; border: 0; padding: 0; color: inherit; }

.toc {
  border: var(--hairline) solid var(--rule);
  border-radius: var(--radius);
  padding: var(--s-4) var(--s-5);
  font-size: var(--step--1);
}
.toc ol { list-style: none; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc li + li { margin-top: var(--s-2); }
.toc a { text-decoration: none; color: var(--ink-2); }
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--ink-4);
  margin-right: 1ch;
}
.toc a:hover { color: var(--accent); }

@media (min-width: 60rem) {
  .toc--sticky { position: sticky; top: 5rem; }
}


/* 13  Forms & filters ------------------------------------------------------ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
  padding-block: var(--s-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.field__label {
  font-size: var(--step--2);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
  color: var(--ink-4);
}

.input, .select {
  font-size: var(--step--1);
  padding: 0.5em 0.75em;
  border: var(--hairline) solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  transition: border-color 0.14s ease;
}
.input:hover, .select:hover { border-color: var(--ink-4); }
.input::placeholder { color: var(--ink-4); }

.search-field { flex: 1 1 14rem; }

.chip-group { display: flex; flex-wrap: wrap; gap: var(--s-2); }

.chip {
  font-size: var(--step--2);
  padding: 0.35em 0.8em;
  border: var(--hairline) solid var(--rule-strong);
  border-radius: 100px;
  color: var(--ink-2);
  background: transparent;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.result-count {
  font-size: var(--step--2);
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}


/* 14  Utilities ------------------------------------------------------------ */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-muted  { color: var(--ink-3); }
.text-subtle { color: var(--ink-4); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.full { width: 100%; }
.hide { display: none !important; }

.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.mt-6 { margin-top: var(--s-6); }
.mt-7 { margin-top: var(--s-7); }

.rule-top { border-top: var(--hairline) solid var(--rule); padding-top: var(--s-5); }


/* 15  Motion --------------------------------------------------------------- */

@view-transition { navigation: auto; }

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.16s;
  animation-timing-function: ease;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  @view-transition { navigation: none; }
}


/* 16  Print ----------------------------------------------------------------

   A registry ought to print like a public record. Hairlines survive, the
   chrome does not, and every link resolves to a readable URL.
   -------------------------------------------------------------------------- */

@media print {
  :root {
    --paper: #fff; --surface: #fff; --surface-sunk: #fff;
    --ink: #000; --ink-2: #222; --ink-3: #444; --ink-4: #666;
    --rule: #ccc; --rule-strong: #888;
    --accent: #000; --grain-opacity: 0;
  }

  body { font-size: 10.5pt; line-height: 1.45; }
  body::before { display: none; }

  .site-header, .site-footer, .theme-toggle, .skip-link,
  .filters, .copy-btn, .btn, .nav { display: none !important; }

  main { padding: 0; }
  .section { padding-block: 0.5cm; break-inside: avoid; }
  .container { max-width: none; padding: 0; }

  .table { min-width: 0; font-size: 9pt; }
  .table thead th { position: static; }
  .table-wrap { overflow: visible; border: 0; }
  .table tbody tr { break-inside: avoid; }

  .card, .stat-row, .notice { break-inside: avoid; border-color: #ccc; }

  h1, h2, h3 { break-after: avoid; }

  .prose a::after,
  .table__name::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #666;
    word-break: break-all;
  }

  a[href^="/"]::after { content: " (retailtoken.ai" attr(href) ")"; }
  a[href^="#"]::after { content: none; }
}
