/* ==========================================================================
   USDTSO — "Signal" design system
   Editorial financial terminal: warm paper, deep ink, one fluorescent signal.
   No external fonts or assets; everything is self-hosted or system.
   ========================================================================== */

:root {
  /* Palette */
  --paper: #ffffff;
  --paper-2: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f6f6f4;
  --ink: #0b0c0e;
  --ink-2: #16181c;
  --text: #0b0c0e;
  --text-2: #3a3d44;
  --muted: #6e717a;
  --line: rgba(11, 12, 14, 0.1);
  --line-2: rgba(11, 12, 14, 0.18);
  --signal: #00c27a;          /* accent fill on light */
  --signal-ink: #047a4f;      /* accent text on light, AA on paper */
  --signal-glow: #3df5a8;     /* accent on ink */
  --signal-wash: rgba(0, 194, 122, 0.1);
  --pos: #0f8a55;
  --neg: #d6343b;
  --warn: #b4610a;

  /* Type */
  --font-sans: "Inter", ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang TC", "Noto Sans TC", "Hiragino Sans", "Microsoft JhengHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --fs-display: clamp(2.35rem, 1.2rem + 4.6vw, 4.75rem);
  --fs-h1: clamp(1.9rem, 1.2rem + 2.8vw, 3.4rem);
  --fs-h2: clamp(1.45rem, 1.1rem + 1.4vw, 2.15rem);
  --fs-body: 1rem;
  --fs-label: 0.6875rem;

  /* Space & shape */
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(76px, 8vw, 112px);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --shadow-pop: 0 24px 60px -20px rgba(11, 12, 14, 0.28), 0 2px 6px rgba(11, 12, 14, 0.06);
  --header-h: 68px;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #08090b;
  --paper-2: #0e1013;
  --surface: #111317;
  --surface-2: #171a1f;
  --text: #ecebe6;
  --text-2: #b9bac0;
  --muted: #84868f;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --signal: #3df5a8;
  --signal-ink: #3df5a8;
  --signal-wash: rgba(61, 245, 168, 0.1);
  --pos: #3ddc84;
  --neg: #ff6369;
  --warn: #f5a524;
  --shadow-pop: 0 30px 70px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 56px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.025em; line-height: 1.08; text-wrap: balance; }
p, li, summary { text-wrap: pretty; }
strong { font-weight: 650; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 6px; }
button { font: inherit; color: inherit; }
table { width: 100%; border-collapse: collapse; }

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

/* Numbers everywhere read as data */
.stat-val, .result-big, .pair-rate, td, .ticker-price, .ticker-chg, .code-box, .amt-chip, .rebate-pill {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 800;
  font-size: 1.06rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand .logo { display: block; height: 26px; width: auto; color: var(--text); overflow: visible; }
/* Micro-interaction: the cut half of the coin slides back into place on hover */
.brand .logo-sig { transition: transform 0.6s var(--ease); }
/* units are viewBox units: undo the (2, -3) lift of the cut half */
.brand:hover .logo-sig { transform: translate(-28px, 42px); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: auto;
  font-size: 0.9rem;
  font-weight: 550;
}
.nav-links a {
  position: relative;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-2);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--line); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}

.header-actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-btn, .lang-trigger {
  height: 38px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-btn { width: 38px; display: inline-flex; align-items: center; justify-content: center; }
.theme-btn:hover, .lang-trigger:hover { border-color: var(--text); }
.theme-btn:active, .lang-trigger:active { transform: scale(0.96); }
.theme-btn svg { transition: transform 0.5s var(--ease); }
.theme-btn:hover svg { transform: rotate(-25deg); }
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }

.lang-dropdown { position: relative; }
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 0.86rem;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
.lang-trigger::-webkit-details-marker { display: none; }
.lang-caret { color: var(--muted); transition: transform 0.25s var(--ease); }
.lang-dropdown[open] .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  z-index: 60;
  display: grid;
  gap: 2px;
  animation: popIn 0.22s var(--ease);
  transform-origin: top right;
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 550;
  transition: background-color 0.15s ease;
}
.lang-option:hover { background: var(--surface-2); }
.lang-option.active { background: var(--signal-wash); color: var(--signal-ink); }
.lang-fiat { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.04em; }
.lang-option.active .lang-fiat { color: inherit; }

/* --------------------------------------------------------------------------
   Live ticker tape
   -------------------------------------------------------------------------- */
.ticker {
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 90s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; margin: 0; padding: 0; list-style: none; }
.ticker-item a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 22px;
  white-space: nowrap;
  border-right: 1px solid var(--line);
  color: var(--text-2);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.ticker-item a:hover { color: var(--text); background: var(--surface-2); }
.ticker-item img { width: 16px; height: 16px; border-radius: 50%; background: #fff; }
.ticker-sym { font-weight: 700; color: var(--text); }
.ticker-chg.pos { color: var(--pos); }
.ticker-chg.neg { color: var(--neg); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
/* main also carries .container, whose padding shorthand would zero the
   vertical padding, so set the sides and ends explicitly here. */
main.container {
  padding-top: clamp(20px, 3vw, 36px);
  padding-bottom: var(--section);
  counter-reset: section;
}
.section { margin-top: var(--section); }
.hero + .section { margin-top: clamp(48px, 6vw, 96px); }

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.breadcrumb a { transition: color 0.2s var(--ease); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span:last-child { color: var(--text); }

/* Section heads: editorial index + rule */
.section-head {
  counter-increment: section;
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(16px, 3vw, 40px);
  align-items: baseline;
  padding-top: 18px;
  margin-bottom: clamp(22px, 3vw, 36px);
  border-top: 1px solid var(--line-2);
}
.section-head::before {
  content: counter(section, decimal-leading-zero);
  grid-row: 1 / span 2;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--signal-ink);
  padding-top: 0.55em;
}
.section-head h2 { font-size: var(--fs-h2); letter-spacing: -0.035em; max-width: 28ch; }
.section-head p { grid-column: 2; margin: 12px 0 0; max-width: 62ch; color: var(--muted); font-size: 1rem; }

/* --------------------------------------------------------------------------
   Hero — the ink panel
   -------------------------------------------------------------------------- */
.hero {
  --hero-text: #f4f2ec;
  --hero-muted: rgba(244, 242, 236, 0.62);
  position: relative;
  z-index: 2;
  isolation: isolate;
  padding: clamp(32px, 5vw, 72px) clamp(20px, 5vw, 64px) clamp(28px, 4vw, 56px);
  border-radius: var(--r-xl);
  background: var(--ink);
  color: var(--hero-text);
}
[data-theme="dark"] .hero { background: #0d0f12; box-shadow: 0 0 0 1px var(--line) inset; }
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
}
/* Fine measurement grid fading out from the top right */
.hero::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 85% 0%, #000 10%, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 80% at 85% 0%, #000 10%, transparent 70%);
}
/* Signal glow, slowly breathing */
.hero::after {
  background:
    radial-gradient(520px 340px at 88% -8%, rgba(61, 245, 168, 0.26), transparent 65%),
    radial-gradient(420px 260px at 6% 112%, rgba(61, 245, 168, 0.08), transparent 70%);
  animation: breathe 9s var(--ease-in-out) infinite alternate;
}
.hero > * { position: relative; }
.hero h1 {
  font-size: var(--fs-h1);
  letter-spacing: -0.04em;
  line-height: 1.02;
  max-width: 20ch;
  margin-bottom: 18px;
}
.hero-display h1 { font-size: var(--fs-display); max-width: 15ch; letter-spacing: -0.045em; line-height: 0.98; }
.hero > p {
  max-width: 60ch;
  color: var(--hero-muted);
  font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 0;
}
.hero > p strong { color: var(--hero-text); }
.hero h1 em { font-style: normal; color: var(--signal-glow); }

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 32px);
  padding: 6px 12px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--signal-glow);
  animation: ping 2.4s var(--ease) infinite;
}

.h1-icon { display: flex; align-items: center; gap: clamp(12px, 2vw, 20px); }
.h1-icon img {
  width: clamp(36px, 4vw, 52px);
  height: clamp(36px, 4vw, 52px);
  flex-shrink: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06), 0 0 30px rgba(61, 245, 168, 0.18);
}

.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 3vw, 36px); }
.hero .btn-outline { color: var(--hero-text); border-color: rgba(255, 255, 255, 0.22); }
.hero .btn-outline:hover { border-color: var(--hero-text); background: rgba(255, 255, 255, 0.06); }
.hero .code-box { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.22); color: var(--hero-text); }
.hero .code-box .btn-copy { background: var(--hero-text); color: var(--ink); }
.hero .calc-box .btn-outline { color: var(--text); border-color: var(--line-2); }
.hero .calc-box .btn-outline:hover { border-color: var(--text); background: var(--surface-2); }

/* --------------------------------------------------------------------------
   Calculator terminal
   -------------------------------------------------------------------------- */
.calc-box {
  margin-top: clamp(28px, 4vw, 48px);
  padding: clamp(16px, 2.4vw, 28px);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .calc-box { box-shadow: 0 0 0 1px var(--line-2), 0 40px 80px -30px rgba(0, 0, 0, 0.8); }
.calc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.calc-grid-swap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto minmax(0, 1fr); }
.swap-col { display: flex; align-items: flex-end; justify-content: center; }
.btn-swap {
  width: 46px;
  height: 46px;
  margin-bottom: 3px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s var(--ease), background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn-swap:hover { background: var(--ink); color: var(--signal-glow); border-color: var(--ink); transform: rotate(180deg); }
[data-theme="dark"] .btn-swap:hover { background: var(--signal); color: var(--ink); border-color: var(--signal); }
.btn-swap:active { transform: rotate(180deg) scale(0.92); }

.field { min-width: 0; }
.field label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.35;
}
.field input, .field select {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.06rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s var(--ease);
}
.field input:hover { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-wash);
}
.field input[type="range"] {
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--signal);
  cursor: pointer;
}

.quick-amounts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.amt-chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.amt-chip:hover { border-color: var(--text); color: var(--text); }
.amt-chip.active { background: var(--text); border-color: var(--text); color: var(--paper); }
.amt-chip:active { transform: scale(0.95); }

.calc-result {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line-2);
}
.result-big {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.5rem);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1;
  overflow-wrap: anywhere;
}
.result-meta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* Value change feedback */
.tick { animation: tick 0.55s var(--ease); }
@keyframes tick {
  0% { color: var(--signal-ink); transform: translateY(3px); opacity: 0.4; }
  100% { transform: none; opacity: 1; }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary, .btn-outline {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), color 0.3s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-primary {
  background: var(--signal);
  color: #04130c;
  border: 0;
  box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--signal) 90%, transparent);
}
.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.45s var(--ease);
}
.btn-primary:hover { color: var(--signal-glow); }
.btn-primary:hover::before { transform: translateY(0); }
.hero .btn-primary::before, [data-theme="dark"] .btn-primary::before { background: #f4f2ec; }
.hero .btn-primary:hover, [data-theme="dark"] .btn-primary:hover { color: var(--ink); }
.btn-primary:active, .btn-outline:active { transform: scale(0.97); }
.btn-outline {
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
}
.btn-outline:hover { border-color: var(--text); background: var(--surface); }
td .btn-primary, td .btn-outline { min-height: 36px; padding: 0 16px; font-size: 0.84rem; }

/* --------------------------------------------------------------------------
   Cards & grids
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 2.4vw, 28px);
}
.card p:last-child { margin-bottom: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.stat-grid + .card, .stat-grid + .data-note { margin-top: 16px; }
.stat-card { padding: clamp(18px, 2.4vw, 28px); border-left: 1px solid var(--line); min-width: 0; }
.stat-card:first-child { border-left: 0; }
.stat-label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.stat-val {
  font-size: clamp(1.4rem, 1rem + 1.4vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.stat-val.pos { color: var(--pos); }
.stat-val.neg { color: var(--neg); }

/* Numbered steps */
.steps-grid {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.step-card {
  counter-increment: step;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 28px);
  min-height: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.5s var(--ease), background-color 0.3s var(--ease);
}
.step-card::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--signal-ink);
  margin-bottom: auto;
  padding-bottom: 32px;
}
.step-card h3 { font-size: 1.15rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.step-card p { margin: 0; color: var(--muted); font-size: 0.94rem; line-height: 1.55; }
.tool-card { cursor: pointer; }
.tool-card h3 { padding-right: 8px; }
.tool-card h3 span[aria-hidden] {
  position: absolute;
  top: clamp(18px, 2.2vw, 26px);
  right: clamp(20px, 2.4vw, 28px);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-size: 0.95rem;
  transition: transform 0.5s var(--ease), background-color 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.tool-card:hover h3 span[aria-hidden] { transform: rotate(-45deg); background: var(--text); color: var(--paper); border-color: var(--text); }
.tool-card:hover { border-color: var(--text); transform: translateY(-4px); }
.tool-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.tool-card:hover::after { transform: scaleX(1); }

.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.insight-card h2 { font-size: 1.3rem; letter-spacing: -0.025em; margin-bottom: 12px; }
.insight-card p { margin: 0; color: var(--text-2); line-height: 1.7; }

/* Conversion pair tiles */
.pair-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.pair-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 22px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.pair-card:hover { border-color: var(--text); transform: translateY(-2px); }
.pair-card::after {
  content: "↗";
  position: absolute;
  top: 17px;
  right: 20px;
  font-size: 0.95rem;
  color: var(--muted);
  transition: transform 0.4s var(--ease), color 0.25s var(--ease);
}
.pair-card:hover { background: var(--surface-2); }
.pair-card:hover::after { transform: translate(3px, -3px); color: var(--signal-ink); }
.pair-label { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.pair-rate { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; overflow-wrap: anywhere; }

/* CTA band */
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px 32px;
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--r-lg);
  background: var(--signal-wash);
  border: 1px solid color-mix(in srgb, var(--signal) 30%, transparent);
}
.cta-banner h2 { font-size: clamp(1.2rem, 1rem + 0.8vw, 1.6rem); letter-spacing: -0.03em; margin-bottom: 6px; }
.cta-banner p { margin: 0; color: var(--text-2); max-width: 56ch; }
.cta-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

/* Invite code */
.code-box {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border: 1px dashed var(--line-2);
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.btn-copy {
  min-height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn-copy:hover, .btn-copy.copied { background: var(--signal); color: #04130c; }
.btn-copy:active { transform: scale(0.94); }

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
th, td { padding: 16px 20px; text-align: left; vertical-align: middle; }
th {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 1px solid var(--line-2);
}
td { border-bottom: 1px solid var(--line); font-size: 0.94rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color 0.2s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tbody tr td:first-child { transition: box-shadow 0.25s var(--ease); }
tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--signal); }

.ex-badge, .coin-cell { display: inline-flex; align-items: center; gap: 12px; font-weight: 650; color: var(--text); transition: color 0.2s var(--ease); }
.ex-badge:hover, .coin-cell:hover { color: var(--signal-ink); }
.coin-cell .coin-name { color: var(--muted); font-weight: 500; }
.ex-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ex-icon, .coin-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.ex-tag {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.rebate-pill {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--signal-wash);
  color: var(--signal-ink);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}
.pos { color: var(--pos); font-weight: 650; }
.neg { color: var(--neg); font-weight: 650; }

/* Market toolbar */
.market-toolbar { grid-template-columns: auto 1fr auto; }
.market-toolbar::before { grid-row: 1; }
.market-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; grid-column: 3; grid-row: 1; }
.market-search {
  width: 240px;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e717a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 14px 50%;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), width 0.4s var(--ease);
}
.market-search:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-wash); width: 280px; }
.filter-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: 999px; }
.filter-tab {
  padding: 6px 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ease), background-color 0.25s var(--ease);
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active { background: var(--text); color: var(--paper); }

/* FAQ */
.faq-list { padding-top: 0; padding-bottom: 0; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
  font-size: 1.06rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s var(--ease);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 10px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 10px no-repeat;
  transition: transform 0.45s var(--ease), border-color 0.2s var(--ease);
}
.faq-item summary:hover { color: var(--signal-ink); }
.faq-item[open] summary::after { transform: rotate(135deg); border-color: var(--signal); }
.faq-item p { margin: -6px 0 22px; max-width: 72ch; color: var(--text-2); line-height: 1.7; }

/* Notes */
.data-note {
  display: flex;
  gap: 10px;
  margin: 16px 0 0;
  max-width: 90ch;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--muted);
}
.data-note::before {
  content: "i";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.stale-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  color: var(--warn);
  font-size: 0.88rem;
  font-weight: 550;
}
.stale-notice::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex-shrink: 0; animation: blink 1.6s steps(2) infinite; }

/* 404 */
.notfound { display: grid; place-items: center; text-align: center; min-height: 58vh; padding: 40px 0; }
.notfound-code {
  font-size: clamp(6rem, 3rem + 16vw, 14rem);
  font-weight: 800;
  letter-spacing: -0.07em;
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--line-2);
  margin-bottom: 12px;
  user-select: none;
}
.notfound h1 { font-size: var(--fs-h2); margin-bottom: 12px; }
.notfound p { color: var(--muted); margin-bottom: 28px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 7vw, 96px) 0 28px;
  background: var(--ink);
  color: rgba(244, 242, 236, 0.66);
  font-size: 0.88rem;
}
[data-theme="dark"] .site-footer { background: #050607; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 40px; }
.footer-top { display: grid; grid-template-columns: 1.2fr 2fr; gap: clamp(32px, 5vw, 80px); }
.footer-tagline { font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.15; color: #f4f2ec; max-width: 18ch; margin: 0; }
.footer-tagline em { font-style: normal; color: var(--signal-glow); }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 28px; }
.footer-col .footer-h {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(244, 242, 236, 0.4);
}
.footer-col a { display: block; width: fit-content; padding: 6px 0; color: rgba(244, 242, 236, 0.78); transition: color 0.2s var(--ease), transform 0.3s var(--ease); }
.footer-col a:hover { color: var(--signal-glow); transform: translateX(3px); }
.footer-notes { display: grid; gap: 10px; padding-top: 28px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-note { margin: 0; max-width: 110ch; line-height: 1.65; font-size: 0.8rem; color: rgba(244, 242, 236, 0.5); }
.footer-wordmark { display: block; width: 100%; height: auto; margin: 8px 0 -4px; overflow: visible; user-select: none; }
.footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(244, 242, 236, 0.42);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #f4f2ec;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translate(-50%, 16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
[data-theme="dark"] .toast { background: #f4f2ec; color: var(--ink); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* --------------------------------------------------------------------------
   Custom select
   -------------------------------------------------------------------------- */
.csel { position: relative; }
.csel-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
  clip: rect(0 0 0 0);
  overflow: hidden;
}
.csel-trigger {
  width: 100%;
  height: 52px;
  padding: 0 14px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.csel-trigger:hover { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.csel-trigger:focus-visible, .csel.open .csel-trigger { outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px var(--signal-wash); }
.csel-value { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.csel-main { white-space: nowrap; letter-spacing: -0.01em; }
.csel-sub { font-size: 0.82rem; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csel-caret { flex-shrink: 0; color: var(--muted); transition: transform 0.3s var(--ease); }
.csel.open .csel-caret { transform: rotate(180deg); color: var(--signal-ink); }
.csel-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--text);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
}
.csel-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; object-fit: cover; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.csel-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  min-width: 240px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  z-index: 70;
  animation: popIn 0.22s var(--ease);
  transform-origin: top center;
}
.csel-panel[hidden] { display: none; }
.csel.drop-up .csel-panel { top: auto; bottom: calc(100% + 8px); transform-origin: bottom center; }
.csel-search-wrap { position: relative; padding: 2px 2px 6px; }
.csel-search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-62%); color: var(--muted); pointer-events: none; }
.field .csel-search {
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 0.9rem;
  font-weight: 500;
}
.field .csel-search:focus { box-shadow: none; border-color: var(--signal); background: var(--surface); }
.csel-list { list-style: none; margin: 0; padding: 0; max-height: 296px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.csel-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
  scroll-margin: 6px;
  transition: background-color 0.12s ease;
}
.csel-option[hidden] { display: none; }
.csel-option .csel-sub { font-size: 0.8rem; }
.csel-option.active { background: var(--surface-2); }
.csel-option[aria-selected="true"] { color: var(--signal-ink); }
.csel-option[aria-selected="true"]::after {
  content: "";
  margin-left: auto;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.csel-empty { padding: 16px 10px; font-size: 0.86rem; color: var(--muted); text-align: center; }
.csel-empty[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Entrance & scroll reveal (reveal only when JS has opted in)
   -------------------------------------------------------------------------- */
.js-reveal .reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
/* Entrance: motion only, never opacity 0 on the headline, so it still
   counts as the Largest Contentful Paint from the first frame. */
.hero { animation: heroIn 1s var(--ease) both; }
.hero > h1 { animation: rise 1s var(--ease) both; }
.hero > :not(h1) { animation: fadeUp 0.9s var(--ease) both; }
.hero > *:nth-child(2) { animation-delay: 0.06s; }
.hero > *:nth-child(3) { animation-delay: 0.14s; }
.hero > *:nth-child(4) { animation-delay: 0.22s; }
.hero > *:nth-child(5) { animation-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Keyframes
   -------------------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes heroIn { from { transform: scale(0.985); } to { transform: none; } }
@keyframes rise { from { transform: translateY(0.35em); clip-path: inset(-20% -10% 30% -10%); } to { transform: none; clip-path: inset(-20% -10% -20% -10%); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes breathe { from { opacity: 0.72; } to { opacity: 1; } }
@keyframes ping {
  0% { box-shadow: 0 0 0 0 rgba(61, 245, 168, 0.55); }
  70%, 100% { box-shadow: 0 0 0 9px rgba(61, 245, 168, 0); }
}
@keyframes blink { 50% { opacity: 0.25; } }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1020px) {
  .header-inner { gap: 18px; }
  .nav-links { font-size: 0.86rem; }
  .nav-links a { padding: 8px 9px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card:nth-child(3) { border-left: 0; }
  .stat-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .footer-top { grid-template-columns: 1fr; }
  .market-toolbar { grid-template-columns: auto 1fr; }
  .market-controls { grid-column: 2; grid-row: auto; justify-content: flex-start; margin-top: 16px; }
}
@media (max-width: 1080px) {
  .header-inner { flex-wrap: wrap; height: auto; padding-top: 12px; gap: 6px 16px; }
  .brand { margin-right: auto; }
  .nav-links {
    order: 3;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 var(--gutter) 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - var(--gutter)), transparent);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a.active::after { bottom: 3px; }
}
@media (max-width: 860px) {
  :root { --header-h: 60px; }
  .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-grid-swap { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .calc-grid-swap > .field:first-child { grid-column: 1 / -1; }
  .insight-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hero { border-radius: var(--r-lg); }
  .section-head { grid-template-columns: 1fr; }
  .section-head::before { grid-row: auto; padding: 0 0 10px; }
  .section-head p { grid-column: 1; }
  .market-toolbar { grid-template-columns: 1fr; }
  .market-controls { grid-column: 1; }
  .market-search, .market-search:focus { width: 100%; }
  .filter-tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .calc-grid { grid-template-columns: 1fr !important; }
  .calc-grid-swap { grid-template-columns: 1fr !important; }
  .calc-grid-swap .swap-col { justify-content: center; margin: -6px 0; }
  .btn-swap { transform: rotate(90deg); margin-bottom: 0; }
  .btn-swap:hover { transform: rotate(270deg); }
  .calc-result { flex-direction: column; align-items: stretch; }
  .calc-result .btn-primary, .calc-result .btn-outline { width: 100%; }
  .stat-card { padding: 16px; }
  th, td { padding: 13px 14px; }
  .market-col-ex { display: none; }
  .cta-banner { flex-direction: column; align-items: flex-start; }
  .hero-actions > * { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .ticker-track { animation: none; }
  .js-reveal .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .ticker, .site-footer, .btn-primary, .toast { display: none !important; }
  .hero { background: none; color: #000; }
}

/* Calculator grid variants */
.calc-grid-auto { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.calc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Numeric columns align on the right */
th.num, td.num { text-align: right; }

/* Home hero: headline left, live facts right */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 0;
  margin: clamp(24px, 3vw, 36px) 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.hero-stats div { padding: 16px 28px 0 0; margin-right: 28px; border-right: 1px solid rgba(255, 255, 255, 0.12); }
.hero-stats div:last-child { border-right: 0; margin-right: 0; }
.hero-stats dt {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--hero-muted);
}
.hero-stats dd {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--hero-text);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1081px) {
  .hero-display, .hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 56px;
    align-items: end;
  }
  .hero-display > .hero-status, .hero-display > h1, .hero-display > p,
  .hero-split > h1, .hero-split > p { grid-column: 1; }
  .hero-display > .hero-stats, .hero-split > .hero-stats {
    grid-column: 2;
    grid-row: 2 / span 2;
    align-self: end;
    grid-template-columns: repeat(2, auto);
    margin: 0;
    border-top: 0;
    row-gap: 28px;
  }
  .hero-display > .hero-stats div, .hero-split > .hero-stats div { padding: 0 32px 0 0; margin-right: 32px; }
  .hero-display > .hero-stats div:nth-child(2n), .hero-split > .hero-stats div:nth-child(2n) { border-right: 0; margin-right: 0; padding-right: 0; }
  .hero-display > .calc-box, .hero-split > .calc-box, .hero-split > .hero-actions { grid-column: 1 / -1; }
  .hero-display h1 { max-width: 16ch; }
  .hero-display > .hero-status { justify-self: start; }
}
@media (max-width: 640px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .hero-stats div:nth-child(2n) { border-right: 0; margin-right: 0; }
}

/* Light theme on a white page: tool/step cards sit on a faint tint so the
   grid reads as objects rather than outlines; hover lifts them to white. */
:root:not([data-theme="dark"]) .step-card { background: var(--surface-2); border-color: transparent; }
:root:not([data-theme="dark"]) .tool-card:hover { background: var(--surface); border-color: var(--text); }
:root:not([data-theme="dark"]) .stat-grid { background: var(--surface-2); border-color: transparent; }
:root:not([data-theme="dark"]) .stat-card { border-color: rgba(11, 12, 14, 0.07); }

@media (max-width: 1080px) {
  /* The converter is the primary task: keep it above the facts on smaller screens. */
  .hero-display, .hero-split { display: flex; flex-direction: column; }
  .hero-split > .hero-stats { order: 10; margin-top: clamp(24px, 4vw, 36px); border-top: 0; }
  .hero-display > .hero-status { align-self: flex-start; }
  .hero-display > .hero-stats { order: 10; margin-top: clamp(24px, 4vw, 36px); border-top: 0; }
}
@media (max-width: 640px) {
  .hero-status { border-radius: 12px; line-height: 1.5; }
  .hero-stats dd { font-size: 1.5rem; }
}

@media (max-width: 640px) {
  .pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pair-card { padding: 16px; gap: 12px; }
  .pair-card::after { top: 14px; right: 14px; }
  .pair-rate { font-size: 1.12rem; }
}

.stat-sub { margin-left: 0.35em; font-size: 0.55em; font-weight: 600; letter-spacing: -0.01em; color: var(--muted); white-space: nowrap; }

/* Scroll affordance for wide tables: soft shadows appear on the side that has
   more content (pure CSS, background-attachment trick). */
.table-wrap {
  background:
    linear-gradient(90deg, var(--surface) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(11, 12, 14, 0.14), transparent) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(11, 12, 14, 0.14), transparent) right / 14px 100% no-repeat scroll,
    var(--surface);
}
[data-theme="dark"] .table-wrap {
  background:
    linear-gradient(90deg, var(--surface) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(270deg, var(--surface) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.6), transparent) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.6), transparent) right / 14px 100% no-repeat scroll,
    var(--surface);
}
@media (max-width: 640px) {
  /* Market list: the coin cell already links to the pair page, so the
     separate "Buy guide" column is dropped to avoid sideways scrolling. */
  .market-col-action { display: none; }
  td .ex-tag { display: none; }
  .ex-badge, .coin-cell { gap: 10px; }
  .coin-cell .coin-name { display: none; }
}

.hero-stats dd.up { color: var(--signal-glow); }
.hero-stats dd.down { color: #ff6369; }
.hero-split > .hero-stats { grid-row: 1 / span 2; }
.hero-split .hero-stats dd { font-size: clamp(1.35rem, 1.05rem + 1vw, 2rem); }
@media (max-width: 640px) {
  th, td { padding: 12px 8px; }
  th:first-child, td:first-child { padding-left: 14px; }
  th:last-child, td:last-child { padding-right: 14px; }
  td { font-size: 0.86rem; }
  th { font-size: 0.62rem; letter-spacing: 0.06em; }
  .coin-icon, .ex-icon { width: 22px; height: 22px; }
}

/* ==========================================================================
   Editorial: academy hub, articles, trust pages
   ========================================================================== */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--paper);
  font-weight: 650;
  font-size: 0.9rem;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 12px; }
.ticker:focus-within .ticker-track { animation-play-state: paused; }

.article-head { max-width: 860px; padding: clamp(16px, 3vw, 40px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line-2); }
.article-kicker {
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--signal-ink);
}
.article-head h1 { font-size: var(--fs-h1); letter-spacing: -0.04em; line-height: 1.04; max-width: 22ch; }
.article-lead { margin: 22px 0 0; max-width: 62ch; font-size: clamp(1.06rem, 1rem + 0.35vw, 1.25rem); line-height: 1.6; color: var(--text-2); }
.article-meta { margin: 18px 0 0; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  grid-template-areas: "body toc";
  gap: clamp(32px, 6vw, 96px);
  margin-top: clamp(32px, 4vw, 56px);
  align-items: start;
}
.article-toc { grid-area: toc; position: sticky; top: calc(var(--header-h) + 64px); font-size: 0.88rem; }
.article-toc p { margin: 0 0 12px; font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.article-toc ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line-2); display: grid; gap: 10px; }
.article-toc a { color: var(--text-2); line-height: 1.4; transition: color 0.2s var(--ease); }
.article-toc a:hover { color: var(--signal-ink); }

.prose { grid-area: body; max-width: 68ch; font-size: 1.06rem; line-height: 1.75; color: var(--text-2); }
.prose-block + .prose-block { margin-top: clamp(36px, 4vw, 52px); }
.prose-block { scroll-margin-top: calc(var(--header-h) + 72px); }
.prose h2 { margin: 0 0 16px; font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem); letter-spacing: -0.03em; color: var(--text); }
.prose p { margin: 0 0 16px; }
.prose ul { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 10px; }
.prose ul li { position: relative; padding-left: 22px; }
.prose ul li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.prose a { color: var(--signal-ink); text-decoration: underline; text-underline-offset: 3px; }

.steps { counter-reset: st; list-style: none; margin: 4px 0 16px; padding: 0; display: grid; gap: 4px; }
.steps li {
  counter-increment: st;
  position: relative;
  padding: 14px 0 14px 56px;
  border-top: 1px solid var(--line);
  color: var(--text);
}
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before {
  content: counter(st, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 13px;
  width: 38px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--text);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.callout { margin: 20px 0 0; padding: 16px 18px 16px 20px; border-radius: var(--r-md); border-left: 3px solid; font-size: 0.98rem; line-height: 1.6; }
.callout strong { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.09em; text-transform: uppercase; }
.callout p { margin: 0; color: var(--text); }
.callout.tip { background: var(--signal-wash); border-color: var(--signal); }
.callout.tip strong { color: var(--signal-ink); }
.callout.warn { background: color-mix(in srgb, var(--warn) 9%, transparent); border-color: var(--warn); }
.callout.warn strong { color: var(--warn); }

.next-article {
  display: grid;
  gap: 6px;
  margin-top: clamp(40px, 5vw, 64px);
  padding: 22px 26px;
  border-radius: var(--r-lg);
  background: var(--ink);
  color: #f4f2ec;
  transition: transform 0.4s var(--ease);
}
.next-article span { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: 0.09em; text-transform: uppercase; color: rgba(244, 242, 236, 0.6); }
.next-article strong { font-size: 1.2rem; letter-spacing: -0.02em; line-height: 1.3; }
.next-article strong::after { content: "  →"; color: var(--signal-glow); transition: margin 0.3s var(--ease); }
.next-article:hover { transform: translateY(-3px); }
[data-theme="dark"] .next-article { background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2); }
.prose .next-article { text-decoration: none; }

.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.related-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 120px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.25s var(--ease), transform 0.4s var(--ease);
}
.related-card:hover { border-color: var(--text); transform: translateY(-2px); }
.related-kind { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--signal-ink); }
.related-card strong { font-size: 1.02rem; line-height: 1.35; letter-spacing: -0.015em; }

.learn-grid { list-style: none; margin: clamp(32px, 4vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; counter-reset: none; }
.learn-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 240px;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.5s var(--ease);
}
[data-theme="dark"] .learn-card { background: var(--surface); border-color: var(--line); }
.learn-card:hover { background: var(--surface); border-color: var(--text); transform: translateY(-4px); }
.learn-index { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; color: var(--signal-ink); margin-bottom: auto; padding-bottom: 24px; }
.learn-card strong { font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.025em; color: var(--text); }
.learn-desc { font-size: 0.92rem; line-height: 1.55; color: var(--muted); }
.learn-min { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.learn-grid-compact { margin-top: 0; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.learn-grid-compact .learn-card { min-height: 200px; }
.section-more { margin: 20px 0 0; }

.hero-warn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 24px;
  padding: 14px 18px;
  max-width: 820px;
  border: 1px solid rgba(245, 165, 36, 0.4);
  border-radius: var(--r-md);
  background: rgba(245, 165, 36, 0.08);
  color: #f5c46b;
  font-size: 0.92rem;
  line-height: 1.55;
}
.hero-warn p { margin: 0; flex: 1 1 380px; }
.hero-warn a { font-weight: 650; color: #f4f2ec; white-space: nowrap; }

.consent {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 120;
  width: min(680px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 16px 24px;
  padding: 16px 18px 16px 22px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
}
.consent.show { opacity: 1; transform: translate(-50%, 0); }
.consent p { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--text-2); }
.consent p a { color: var(--signal-ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.consent-actions { display: flex; gap: 8px; flex-shrink: 0; }
.consent .btn-primary, .consent .btn-outline { min-height: 38px; padding: 0 16px; font-size: 0.86rem; }

@media (max-width: 1020px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "body"; }
  .article-toc { display: none; }
  .learn-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .learn-grid-compact { grid-template-columns: 1fr; }
  .learn-card, .learn-grid-compact .learn-card { min-height: 0; }
  .learn-index { padding-bottom: 8px; }
  .prose { font-size: 1rem; }
  .steps li { padding-left: 50px; }
  .consent { flex-direction: column; align-items: stretch; bottom: 12px; }
  .consent-actions > * { flex: 1; }
}

/* Real screenshots inside articles */
.shot { margin: 24px 0 8px; }
.shot a { display: block; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line-2); background: var(--surface-2); box-shadow: 0 18px 40px -24px rgba(11, 12, 14, 0.35); transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease); }
.shot a:hover { transform: translateY(-2px); box-shadow: 0 26px 50px -24px rgba(11, 12, 14, 0.45); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { display: grid; gap: 4px; margin-top: 10px; font-size: 0.9rem; line-height: 1.55; color: var(--text-2); }
.shot figcaption small { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
@media (min-width: 1200px) { .prose .shot { margin-right: -120px; } }

/* --------------------------------------------------------------------------
   Mobile navigation: the primary nav folds into a sheet behind a menu button
   -------------------------------------------------------------------------- */
.menu-btn { display: none; }
@media (max-width: 860px) {
  .header-inner { flex-wrap: nowrap; height: var(--header-h); padding-top: 0; gap: 8px; }
  .brand { margin-right: auto; }
  .header-actions { order: 2; }
  .menu-btn {
    order: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: -4px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .menu-btn:active { background: var(--line); }
  .menu-icon { position: relative; width: 20px; height: 14px; }
  .menu-icon span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.35s var(--ease), opacity 0.2s var(--ease), top 0.35s var(--ease);
  }
  .menu-icon span:nth-child(1) { top: 0; }
  .menu-icon span:nth-child(2) { top: 6px; }
  .menu-icon span:nth-child(3) { top: 12px; }
  .menu-open .menu-icon span:nth-child(1) { top: 6px; transform: rotate(45deg); }
  .menu-open .menu-icon span:nth-child(2) { opacity: 0; transform: scaleX(0.2); }
  .menu-open .menu-icon span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    height: calc(100dvh - var(--header-h));
    width: auto;
    margin: 0;
    padding: 8px var(--gutter) calc(24px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-mask-image: none;
    mask-image: none;
    background: var(--paper);
    border-top: 1px solid var(--line);
    font-size: 1.12rem;
    font-weight: 600;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), visibility 0s linear 0.35s;
  }
  .menu-open .nav-links {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.25s var(--ease), transform 0.35s var(--ease), visibility 0s;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 56px;
    padding: 0 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    letter-spacing: -0.01em;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease);
  }
  .menu-open .nav-links a { opacity: 1; transform: none; }
  .menu-open .nav-links a:nth-child(2) { transition-delay: 0.03s; }
  .menu-open .nav-links a:nth-child(3) { transition-delay: 0.06s; }
  .menu-open .nav-links a:nth-child(4) { transition-delay: 0.09s; }
  .menu-open .nav-links a:nth-child(5) { transition-delay: 0.12s; }
  .nav-links a:hover { background: transparent; }
  .nav-links a::before {
    content: "";
    order: 2;
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--text-2);
    border-right: 2px solid var(--text-2);
    transform: rotate(45deg);
  }
  .nav-links a.active::after {
    position: static;
    order: 1;
    margin: 0 0 0 10px;
    width: 6px;
    height: 6px;
  }
  html.menu-lock, html.menu-lock body { overflow: hidden; }
}
@media (max-width: 420px) {
  .lang-trigger > span { display: none; }
  .lang-trigger { padding: 0 10px; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) {
  .nav-links, .nav-links a, .menu-icon span { transition: none !important; }
}
@media (max-width: 860px) {
  .site-header.menu-open { background: var(--paper); border-bottom-color: var(--line); }
}
@media (max-width: 860px) {
  .nav-links { z-index: 10; padding-top: 12px; }
}

/* --------------------------------------------------------------------------
   Exchange sign-up guide
   -------------------------------------------------------------------------- */
.guide .article-layout { margin-top: clamp(16px, 2vw, 24px); }
.invite-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin: 22px 0 4px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--signal) 45%, var(--line-2));
  border-radius: var(--r-md, 14px);
  background: color-mix(in srgb, var(--signal) 7%, var(--surface));
}
.invite-box-text { display: grid; gap: 4px; min-width: 0; flex: 1 1 240px; }
.invite-box-text strong { color: var(--text); font-size: 1rem; }
.invite-box-text span { font-size: 0.9rem; line-height: 1.5; }
.invite-box-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.prose .invite-box .btn-primary { text-decoration: none; }
.guide-prose .faq-list { margin-top: 16px; }
@media (max-width: 640px) {
  .invite-box { padding: 16px; }
  .invite-box-actions, .invite-box-actions .btn-primary { width: 100%; justify-content: center; }
}

/* Coin pages: introduction, per-exchange quotes, recorded range */
.coin-intro p { margin: 0; color: var(--text-2); line-height: 1.75; max-width: 72ch; }
.coin-intro p + p { margin-top: 12px; }
.venue-table td.muted { color: var(--text-2); font-size: 0.9rem; }
.stat-grid.stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .stat-grid.stat-grid-3 { grid-template-columns: 1fr; } .stat-grid-3 .stat-card + .stat-card { border-left: 0; border-top: 1px solid var(--line); } }
.aff-note { flex-basis: 100%; margin: 4px 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--text-2); }
.hero .aff-note { color: var(--hero-text); opacity: 0.7; margin-top: 14px; }
.source-list { padding-left: 1.2em; }
.source-list a { word-break: break-word; }

/* --------------------------------------------------------------------------
   Design pass, 2026-11-28
   -------------------------------------------------------------------------- */
/* Footer: four link columns side by side on desktop. */
.footer-cols { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }

/* Affiliate note: a quiet footnote, never body-sized. */
.aff-note { font-size: 0.78rem !important; line-height: 1.5; }
.hero .aff-note { margin: 14px 0 0; max-width: 52ch; }

/* Buttons inside article prose keep their own colours. */
.prose .btn-primary, .prose .btn-primary:hover { color: #04130c; text-decoration: none; }
.prose .btn-outline { text-decoration: none; }

/* Small UI screenshots (sign-up forms) stay at their natural size. */
.shot.shot-narrow { max-width: 440px; }
@media (min-width: 1200px) { .prose .shot.shot-narrow { margin-right: 0; } }

/* Sources read as footnotes. */
#primary-sources h2 { font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--text-2); }
#primary-sources .source-list { margin: 8px 0 0; font-size: 0.9rem; }

/* Long local-currency prices stay on one line. */
.pair-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.pair-rate { overflow-wrap: normal; white-space: nowrap; font-size: clamp(1rem, 1.5vw, 1.3rem); }
@media (max-width: 640px) { .pair-rate { white-space: normal; overflow-wrap: anywhere; font-size: 1rem; } }

/* Mobile: cards size to their content; wide tables hint that they scroll. */
@media (max-width: 640px) {
  .step-card, .tool-card { min-height: 0; }
  .step-card::before { margin-bottom: 0; padding-bottom: 14px; }
  .table-wrap {
    background:
      linear-gradient(90deg, var(--surface) 30%, transparent) left / 24px 100% no-repeat local,
      linear-gradient(270deg, var(--surface) 30%, transparent) right / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,.14), transparent) left / 10px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,.14), transparent) right / 10px 100% no-repeat scroll,
      var(--surface);
  }
}

/* 404: more ways out. */
.notfound-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 4px; }
@media (max-width: 640px) { .pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Audit 2026-11-28: every link at least 24px tall (WCAG 2.5.8). */
.breadcrumb a, .article-toc a, .source-list a, .footer-col a, .ex-badge, .coin-cell, .hero-warn a, .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.article-toc li + li { margin-top: 2px; }

/* Exchanges overview */
.ex-hub-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.ex-hub-card { display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 2.4vw, 28px); }
.ex-hub-head { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--text); text-decoration: none; }
.ex-hub-head img { width: 40px; height: 40px; border-radius: 50%; }
.ex-hub-head h2 { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0; }
.ex-hub-head .rebate-pill { margin-left: auto; }
.ex-hub-card > p { margin: 0; color: var(--text-2); line-height: 1.6; flex: 1; }
.ex-hub-facts { display: grid; gap: 8px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.ex-hub-facts div { display: grid; gap: 2px; font-size: 0.95rem; }
.ex-hub-facts dt { color: var(--text-2); font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ex-hub-facts dd { white-space: nowrap; }
.ex-hub-facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-hub-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-hub-actions > * { flex: 1 1 auto; justify-content: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Comparison pages */
.compare-table th[scope="row"] { font-weight: 600; color: var(--text-2); white-space: nowrap; }
.compare-table td .btn-outline, .compare-table td .btn-primary { white-space: nowrap; }
.compare-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "body"; }
.compare-table-section { margin-top: clamp(20px, 3vw, 32px); }
