/* ============================================================================
   Richest Now — Stylesheet
   Dark editorial aesthetic. Mobile-first. Vanilla CSS, no preprocessor.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,800;1,9..144,400&family=Geist+Mono:wght@400;500&family=Geist:wght@300;400;500;600;700&display=swap');

/* ----------------------------------------------------------------------------
   Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Surface */
  --bg-0: #070707;
  --bg-1: #0e0e0f;
  --bg-2: #161617;
  --bg-3: #1f1f21;
  --bg-elev: #18181a;
  --line: #27272a;
  --line-soft: #1c1c1f;

  /* Text */
  --fg: #f5f5f5;
  --fg-1: #d4d4d8;
  --fg-2: #a1a1aa;
  --fg-3: #71717a;
  --fg-4: #52525b;

  /* Accent */
  --accent: #28f30e;
  --accent-soft: rgba(40, 243, 14, 0.12);
  --accent-glow: rgba(40, 243, 14, 0.25);
  --link: #5d9bff;
  --danger: #ff5d5d;

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 12px;
  --radius-sm: 8px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 120ms;
  --t-med: 240ms;
}

@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;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'ss01', 'cv11';
  /* subtle film grain */
  background-image:
    radial-gradient(at 20% -10%, rgba(40, 243, 14, 0.05) 0%, transparent 50%),
    radial-gradient(at 90% 10%, rgba(93, 155, 255, 0.04) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-optical-sizing: auto;
}

p { margin: 0; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

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

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

/* Custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--fg-4); }

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

.skip-link {
  position: absolute;
  top: -40px; left: 0;
  background: var(--accent);
  color: var(--bg-0);
  padding: 8px 16px;
  font-weight: 600;
  z-index: 1001;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 0; }

/* ----------------------------------------------------------------------------
   Navigation
   ------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 7, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.nav__logo-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-0);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 0 24px var(--accent-glow);
}
.nav__logo-text--accent { color: var(--accent); }

.nav__links { display: none; gap: 28px; }
.nav__link {
  color: var(--fg-2);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  position: relative;
}
.nav__link:hover { color: var(--fg); }
.nav__link::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -22px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease);
}
.nav__link:hover::after { transform: scaleX(1); }

.nav__search {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin-left: auto;
}
.nav__search-label {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--fg-3);
  pointer-events: none;
  display: flex;
}
.nav__search-input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: 999px;
  color: var(--fg);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav__search-input::placeholder { color: var(--fg-3); }
.nav__search-input:focus {
  border-color: var(--fg-3);
  background: var(--bg-2);
}

.nav__search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  z-index: 90;
  max-height: 60vh;
  overflow-y: auto;
}
.nav__search-results[hidden] { display: none; }

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.search-result:last-child { border-bottom: 0; }
.search-result:hover, .search-result[aria-selected="true"] { background: var(--bg-2); }
.search-result__img {
  width: 36px; height: 36px;
  object-fit: cover; border-radius: 50%;
  background: var(--bg-3);
}
.search-result__name { flex: 1; font-weight: 500; font-size: 0.9rem; }
.search-result__worth {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.85rem;
}

@media (min-width: 720px) {
  .nav__links { display: inline-flex; }
}

/* ----------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
  padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--line-soft);
}
.hero__inner {
  max-width: var(--container);
  margin: 0 auto;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero__eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero__title {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  max-width: 14ch;
  margin-bottom: 24px;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--fg-2);
}
.hero__lede {
  max-width: 56ch;
  color: var(--fg-2);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
  line-height: 1.6;
}
.hero__lede strong { color: var(--fg); font-weight: 600; }

/* ----------------------------------------------------------------------------
   Rankings section
   ------------------------------------------------------------------------- */
.rankings {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px var(--gutter) 64px;
}
.rankings__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}
@media (min-width: 720px) {
  .rankings__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}
.rankings__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
}
.rankings__title::after {
  content: '.';
  color: var(--accent);
}
.rankings__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.rankings__filter {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}
.rankings__filter input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--t-fast) var(--ease);
}
.rankings__filter input:focus { border-color: var(--fg-3); }
.rankings__filter input::placeholder { color: var(--fg-3); }

.sort-btn {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--fg-1);
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  white-space: nowrap;
}
.sort-btn:hover { background: var(--bg-2); border-color: var(--fg-4); }
.sort-btn__arrow { color: var(--accent); font-family: var(--font-mono); }

/* ----------------------------------------------------------------------------
   Rankings table
   ------------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-1);
}
.table-wrap:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.rankings__table thead th {
  background: var(--bg-2);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  cursor: default;
  user-select: none;
  white-space: nowrap;
}

.rankings__table thead th[data-sort-key] {
  cursor: pointer;
  transition: color var(--t-fast) var(--ease);
}
.rankings__table thead th[data-sort-key]:hover { color: var(--fg); }

.rankings__table thead th[data-sort-key]::after {
  content: '↕';
  margin-left: 6px;
  opacity: 0.4;
}
.rankings__table thead th[data-sort-key].is-asc::after  { content: '↑'; opacity: 1; color: var(--accent); }
.rankings__table thead th[data-sort-key].is-desc::after { content: '↓'; opacity: 1; color: var(--accent); }

.rankings__table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--fg-1);
}
.rankings__table tbody tr:last-child td { border-bottom: 0; }
.rankings__table tbody tr {
  transition: background var(--t-fast) var(--ease);
}
.rankings__table tbody tr:hover {
  background: var(--bg-2);
}
.rankings__table .col-rank {
  font-family: var(--font-mono);
  color: var(--fg-3);
  width: 56px;
  text-align: right;
}
.rankings__table .col-photo { width: 60px; padding: 8px 16px; }
.rankings__table .col-photo a {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: .4em;
  overflow: hidden;
  transition: transform var(--t-med) var(--ease);
}
.rankings__table .col-photo a:hover { transform: scale(1.08); }
.rankings__table .col-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--bg-3);
  display: block;
}
.rankings__table .col-name a {
  font-weight: 600;
  color: var(--fg);
  transition: color var(--t-fast) var(--ease);
}
.rankings__table .col-name a:hover { color: var(--accent); }

.rankings__table .col-num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}
.rankings__table .col-emph { color: var(--accent); font-weight: 500; }

.rankings__table .col-source,
.rankings__table .col-country { color: var(--fg-2); }

/* Hide secondary columns on smaller screens */
@media (max-width: 720px) {
  .col-hide-sm { display: none; }
  .rankings__table thead th { padding: 12px 10px; font-size: 0.65rem; }
  .rankings__table tbody td { padding: 12px 10px; font-size: 0.85rem; }
  .rankings__table .col-rank { width: 32px; }
  .rankings__table .col-photo { width: 48px; padding: 8px 10px; }
  .rankings__table .col-photo a { width: 36px; height: 36px; }
}
@media (max-width: 520px) {
  .col-hide-md { display: none; }
}

.rankings__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.rankings__count {
  color: var(--fg-3);
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.pagination {
  display: inline-flex;
  gap: 4px;
}
.pagination button {
  min-width: 36px; height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-2);
  transition: all var(--t-fast) var(--ease);
}
.pagination button:hover:not(:disabled) {
  background: var(--bg-2); color: var(--fg); border-color: var(--fg-4);
}
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination button.is-current {
  background: var(--accent);
  color: var(--bg-0);
  border-color: var(--accent);
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   Profile page
   ------------------------------------------------------------------------- */
.profile {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter);
  display: grid;
  gap: 24px;
}

.profile__header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-1), var(--bg-0));
  position: relative;
  overflow: hidden;
}
.profile__header::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 360px; height: 360px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 60%);
  pointer-events: none;
}

.profile__photo img {
  width: clamp(120px, 30vw, 220px);
  height: clamp(120px, 30vw, 220px);
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.profile__intro { display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.profile__rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.profile__name {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.profile__networth {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.profile__networth-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-3);
}
.profile__networth-value {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.profile__source { color: var(--fg-2); font-size: 0.95rem; }

@media (min-width: 720px) {
  .profile__header {
    grid-template-columns: auto 1fr;
    align-items: center;
  }
}

/* Stats grid */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.stats__item {
  background: var(--bg-1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stats__item dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.stats__item dd {
  margin: 0;
  color: var(--fg);
  font-weight: 500;
  font-size: 0.95rem;
}

/* Card */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 28px);
}
.card__title {
  font-size: 1.25rem;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.chart {
  width: 100%;
  height: clamp(280px, 40vw, 420px);
}

.bio {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bio li {
  position: relative;
  padding-left: 22px;
  color: var(--fg-1);
  line-height: 1.6;
}
.bio li::before {
  content: '';
  position: absolute;
  left: 0; top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Assets table */
.assets-table {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
.assets-table thead th {
  background: var(--bg-2);
  color: var(--fg-3);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.assets-table thead th.num { text-align: right; }
.assets-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--fg-1);
}
.assets-table tbody tr:last-child td { border-bottom: 0; }
.assets-table tbody tr:nth-child(even) { background: var(--bg-2); }
.assets-table .num { text-align: right; }

/* ----------------------------------------------------------------------------
   Loading / empty states
   ------------------------------------------------------------------------- */
.skeleton-row td {
  background: linear-gradient(90deg, var(--bg-1), var(--bg-2), var(--bg-1));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  height: 60px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--fg-3);
}

/* ----------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 64px;
  padding: 32px var(--gutter);
  background: var(--bg-1);
}
.footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}
.footer__brand span { color: var(--accent); }
.footer__note {
  color: var(--fg-3);
  font-size: 0.85rem;
}

@media (min-width: 720px) {
  .footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ----------------------------------------------------------------------------
   Echarts custom tooltip styling
   ------------------------------------------------------------------------- */
.chart-tooltip {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}
.chart-tooltip strong { color: var(--accent); }

/* ----------------------------------------------------------------------------
   Donate panel
   ------------------------------------------------------------------------- */
.donate__inner {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.donate__qr {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fff; /* QR codes need white bg */
  padding: 8px;
}
.donate__qr img {
  display: block;
  width: 160px;
  height: 160px;
  image-rendering: pixelated;
}

.donate__info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.donate__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.donate__address {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-1);
  word-break: break-all;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  line-height: 1.6;
}

.donate__copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-2);
  transition: all var(--t-fast) var(--ease);
  align-self: flex-start;
}
.donate__copy:hover {
  background: var(--bg-3);
  border-color: var(--accent);
  color: var(--accent);
}
/* ============================================================================
   Growth features: changes, movers, lists, compare, calculator, share
   ========================================================================= */

/* Change colours */
.up   { color: var(--accent); }
.down { color: var(--danger); }
.flat { color: var(--fg-3); }
.col-sub {
  display: block;
  font-size: 0.72rem;
  opacity: 0.75;
}
.rankings__table td.up, .rankings__table td.down, .rankings__table td.flat { font-family: var(--font-mono); }

/* Profile: today badge, note, breadcrumbs */
.badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.profile__note { color: var(--fg-3); font-size: 0.85rem; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--fg-3);
}
.crumbs a { color: var(--fg-2); }
.crumbs a:hover { color: var(--accent); }

/* Profile: change grid */
.changes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.changes__item {
  background: var(--bg-1);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.changes__item dt {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.changes__item dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
}
.changes__item dd small {
  display: block;
  font-size: 0.75rem;
  opacity: 0.75;
  margin-top: 2px;
}

/* Per-second + calculator */
.persec__lead, .calc__result { color: var(--fg-1); font-size: 1rem; line-height: 1.6; max-width: 70ch; }
.persec__lead strong, .calc__result strong { font-family: var(--font-mono); }
.persec__live { margin-top: 12px; color: var(--fg-2); }
.persec__live strong { font-family: var(--font-mono); font-size: 1.4rem; margin-left: 6px; }
.calc__form { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.calc__form label { color: var(--fg-2); font-size: 0.9rem; }
.calc__form input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 8px 12px;
  width: 180px;
}
.calc__form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Chips (compare, siblings, share) */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg-1);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip span { color: var(--fg-3); font-family: var(--font-mono); font-size: 0.78rem; }

/* Related lists */
.related { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mini-list { margin: 0 0 12px; padding-left: 1.4em; color: var(--fg-3); }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.mini-list li::marker { color: var(--fg-3); }
.mini-list a { color: var(--fg); font-weight: 500; }
.mini-list a:hover { color: var(--accent); }
.mini-list span { font-family: var(--font-mono); color: var(--fg-2); font-size: 0.85rem; }
.more-link { color: var(--link); font-size: 0.9rem; }

/* Share + embed */
.share__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.embed { margin-top: 16px; }
.embed summary { cursor: pointer; color: var(--fg-2); font-size: 0.9rem; }
.embed textarea {
  display: block;
  width: 100%;
  margin: 12px 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--fg-1);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 10px;
  resize: vertical;
}

/* Generic content pages */
.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter);
  display: grid;
  gap: 24px;
}
.page__head { display: grid; gap: 14px; }
.page__title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.page__lede { color: var(--fg-2); max-width: 75ch; font-size: 1.02rem; line-height: 1.65; }
.page__lede strong { color: var(--fg); }
.page__lede a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.page__lede a:hover { color: var(--accent); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head__title { font-size: 1.35rem; letter-spacing: -0.02em; margin-bottom: 16px; }
.section-head .section-head__title { margin-bottom: 0; }
.section-head__more { color: var(--link); font-size: 0.9rem; white-space: nowrap; }

/* Period tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--fg-2);
  font-size: 0.88rem;
}
.tab:hover { color: var(--fg); border-color: var(--fg-3); }
.tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--bg-0); font-weight: 600; }

/* Movers */
.movers-teaser {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px var(--gutter) 0;
}
.movers-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.movers-col {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 8px;
}
.movers-col__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.movers-list { list-style: none; margin: 0; padding: 0; counter-reset: mv; }
.mover { border-top: 1px solid var(--line-soft); }
.mover:first-child { border-top: 0; }
.mover__link { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.movers-list--ranked .mover__link::before {
  counter-increment: mv;
  content: counter(mv);
  font-family: var(--font-mono);
  color: var(--fg-3);
  font-size: 0.8rem;
  width: 22px;
  text-align: right;
}
.mover__img { width: 36px; height: 36px; border-radius: 0.4em; object-fit: cover; background: var(--bg-3); flex: none; }
.mover__name { flex: 1; font-weight: 600; color: var(--fg); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover__link:hover .mover__name { color: var(--accent); }
.mover__chg { font-family: var(--font-mono); text-align: right; white-space: nowrap; }

/* Explore cards (home) */
.explore { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 32px; }
.explore__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.explore__card, .group-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color var(--t-fast) var(--ease), transform var(--t-med) var(--ease);
}
.explore__card:hover, .group-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.explore__card strong { color: var(--fg); }
.explore__card span { color: var(--fg-3); font-size: 0.85rem; }

/* Countries / industries index */
.group-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.group-card { position: relative; }
.group-card__rank { position: absolute; top: 14px; right: 16px; font-family: var(--font-mono); color: var(--fg-4); font-size: 0.8rem; }
.group-card__name { font-weight: 600; color: var(--fg); font-size: 1.05rem; padding-right: 28px; }
.group-card__meta { font-family: var(--font-mono); color: var(--accent); font-size: 0.82rem; }
.group-card__top { color: var(--fg-3); font-size: 0.82rem; }
.siblings { margin-top: 8px; }

/* Compare */
.versus { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.versus__side { display: grid; gap: 10px; justify-items: start; }
.versus__photo img { width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.versus__name { font-size: 1.5rem; letter-spacing: -0.02em; }
.versus__name a:hover { color: var(--accent); }
.versus__worth { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--accent); }
.versus__facts { margin: 0; width: 100%; display: grid; gap: 0; }
.versus__facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.versus__facts dt { color: var(--fg-3); font-size: 0.85rem; }
.versus__facts dd { margin: 0; font-family: var(--font-mono); font-size: 0.9rem; text-align: right; }

/* Footer links */
.footer__inner { flex-wrap: wrap; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.85rem; }
.footer__links a { color: var(--fg-2); }
.footer__links a:hover { color: var(--accent); }

/* Fact grids: draw hairlines on the items instead of showing the grid's
   background through the gaps, so a short last row leaves no grey block. */
.stats, .changes { background: var(--bg-1); gap: 0; }
.stats__item, .changes__item { box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }

/* Mobile: show the section links as a scrollable second row under the bar
   (most search visitors are on phones and had no way to reach them). */
@media (max-width: 719px) {
  .nav__inner { height: auto; padding-top: 12px; padding-bottom: 0; row-gap: 8px; grid-template-columns: auto 1fr; }
  .nav__links {
    display: flex;
    grid-column: 1 / -1;
    order: 3;
    gap: 22px;
    overflow-x: auto;
    padding: 4px 0 10px;
    scrollbar-width: none;
  }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__link { white-space: nowrap; }
  .nav__link::after { bottom: -6px; }
}
