/* =========================================================
   EarnDesk design system
   One palette, two themes, two densities.
   Shell pages (home, guides, legal) breathe.
   Tool pages (yields, assets) are dense and colour-coded.
   ========================================================= */

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

:root {
  --bg: #F5F6F9; --surface: #FFFFFF; --surface-2: #EDEFF4; --surface-3: #E3E7EE;
  --fg: #10131A; --muted: #4E5867; --faint: #78828F;
  --line: #DDE1E8; --line-strong: #C3CAD4;
  --accent: #91590A; --accent-fill: #D99400; --accent-soft: #FCF3DE; --accent-line: #E7CB8C;
  --rwa: #1D4ED8; --rwa-bg: #E7EEFD; --rwa-line: #B8CDF7;
  --defi: #0A6F66; --defi-bg: #DDF1EE; --defi-line: #A9DBD3;
  --cefi: #6B26D9; --cefi-bg: #F0E8FD; --cefi-line: #D4BEF8;
  --up: #0F7A52; --down: #B3271E;
  --btn-fg: #FFFFFF;

  --f-disp: "Archivo", system-ui, -apple-system, sans-serif;
  --f-ui: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --f-num: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --maxw-shell: 1080px;
  --maxw-tool: 1340px;
  --radius: 5px;
  --row-h: 11px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0E12; --surface: #14171D; --surface-2: #1A1E26; --surface-3: #222833;
    --fg: #E9ECF1; --muted: #98A1B0; --faint: #6B7484;
    --line: #242A34; --line-strong: #343C49;
    --accent: #F0B429; --accent-fill: #F0B429; --accent-soft: #241C09; --accent-line: #5C4712;
    --rwa: #7FA6FF; --rwa-bg: #111A2D; --rwa-line: #2A3A5E;
    --defi: #3BD9C4; --defi-bg: #0A2220; --defi-line: #1B4A44;
    --cefi: #B79BFF; --cefi-bg: #1B1330; --cefi-line: #382657;
    --up: #34D399; --down: #F87171;
    --btn-fg: #14120A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0C0E12; --surface: #14171D; --surface-2: #1A1E26; --surface-3: #222833;
  --fg: #E9ECF1; --muted: #98A1B0; --faint: #6B7484;
  --line: #242A34; --line-strong: #343C49;
  --accent: #F0B429; --accent-fill: #F0B429; --accent-soft: #241C09; --accent-line: #5C4712;
  --rwa: #7FA6FF; --rwa-bg: #111A2D; --rwa-line: #2A3A5E;
  --defi: #3BD9C4; --defi-bg: #0A2220; --defi-line: #1B4A44;
  --cefi: #B79BFF; --cefi-bg: #1B1330; --cefi-line: #382657;
  --up: #34D399; --down: #F87171;
  --btn-fg: #14120A;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--f-ui); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }

.wrap { max-width: var(--maxw-shell); margin: 0 auto; padding-inline: 20px; }
.wrap-tool { max-width: var(--maxw-tool); margin: 0 auto; padding-inline: 20px; }

/* ---------- preview bar (shown only while figures are placeholders) ---------- */
.preview-bar {
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-line);
  color: var(--fg);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 20px;
  text-align: center;
}
.preview-bar strong { color: var(--accent); }

/* stale figure marker in the table */
.stale-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--faint);
  margin-left: 5px;
  vertical-align: middle;
}

/* ---------- nav ---------- */
.nav { border-bottom: 1px solid var(--line); background: var(--surface); }
.nav-in { display: flex; align-items: center; gap: 24px; padding-block: 12px; }
.logo { font-family: var(--f-disp); font-weight: 800; font-size: 19px;
  letter-spacing: -.025em; color: var(--fg); text-decoration: none; }
.logo b { color: var(--accent-fill); }
.nav-links { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; }
.nav-links a { color: var(--muted); text-decoration: none; padding-block: 4px;
  border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent-fill); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); color: var(--muted); font-size: 14px; line-height: 1; }
.icon-btn:hover { color: var(--fg); }
.nav-cta { font: 600 13px/1 var(--f-ui); background: var(--accent-fill); color: var(--btn-fg);
  border: 0; border-radius: var(--radius); padding: 10px 14px; cursor: pointer;
  text-decoration: none; display: inline-block; }
@media (max-width: 900px) { .nav-links { display: none; } }

/* ---------- shell typography (spacious) ---------- */
.hero { padding-block: 44px 30px; border-bottom: 1px solid var(--line); }
.eyebrow { font-family: var(--f-num); font-size: 11px; font-weight: 500; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
h1 { font-family: var(--f-disp); font-size: clamp(30px, 4.4vw, 44px); line-height: 1.07;
  letter-spacing: -.03em; font-weight: 700; margin: 0 0 16px; max-width: 20ch; text-wrap: balance; }
.lede { font-size: 16.5px; line-height: 1.6; color: var(--muted); max-width: 64ch; margin: 0 0 24px; }

.prose { max-width: 68ch; padding-block: 36px 56px; }
.prose h2 { font-family: var(--f-disp); font-size: 23px; font-weight: 700; letter-spacing: -.02em;
  margin: 36px 0 12px; text-wrap: balance; }
.prose h3 { font-family: var(--f-ui); font-size: 16px; font-weight: 700; margin: 26px 0 8px; }
.prose p, .prose li { font-size: 15.5px; line-height: 1.68; color: var(--fg); }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 7px; }
.prose strong { font-weight: 700; }

/* ---------- signup ---------- */
.signup { display: flex; gap: 8px; flex-wrap: wrap; max-width: 440px; }
.signup input { flex: 1 1 195px; min-width: 0; font: 400 14px/1 var(--f-ui); color: var(--fg);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 11px 13px; }
.signup button { font: 600 14px/1 var(--f-ui); background: var(--accent-fill); color: var(--btn-fg);
  border: 0; border-radius: var(--radius); padding: 11px 18px; cursor: pointer; }
.signup-note { font-size: 12px; color: var(--faint); margin-top: 9px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: 16px 18px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-k { font-family: var(--f-num); font-size: 10.5px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.stat-v { font-family: var(--f-num); font-size: clamp(18px, 2.1vw, 25px); font-weight: 500;
  letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-s { font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 780px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- sections ---------- */
.blk { padding-block: 40px; border-bottom: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-head h2 { font-family: var(--f-ui); font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .11em; margin: 0; }
.sec-head .sub { font-size: 12.5px; color: var(--faint); }
.sec-head .more { margin-left: auto; font-size: 13px; font-weight: 600;
  color: var(--accent); text-decoration: none; }

/* ---------- panels ---------- */
.panels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1040px) {
  .panels { grid-template-columns: 1fr 1fr; }
  .panels > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 660px) {
  .panels { grid-template-columns: 1fr; }
  .panels > :last-child { grid-column: auto; }
}
.panel { border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; }
.panel-head { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.panel-head.up { color: var(--up); }
.panel-head.down { color: var(--down); }
.panel-head.exp { color: var(--accent); }
.prow { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow .nm { font-weight: 600; font-size: 13px; line-height: 1.3; }
.prow .nm a { color: var(--fg); text-decoration: none; }
.prow .nm a:hover { color: var(--accent); }
.prow .tk { font-family: var(--f-num); font-size: 10.5px; color: var(--faint); }
.prow .vals { margin-left: auto; text-align: right; font-family: var(--f-num);
  font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.prow .delta { font-size: 11px; }
.up-t { color: var(--up); }
.down-t { color: var(--down); }

/* ---------- tables (dense) ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 940px; }
thead th { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--faint); text-align: left; padding: 11px 13px;
  border-bottom: 1px solid var(--line-strong); background: var(--surface-2); white-space: nowrap; }
thead th.num { text-align: right; }
thead th[data-sort] { cursor: pointer; user-select: none; }
thead th[data-sort]:hover { color: var(--fg); }
thead th .arr { opacity: .45; font-size: 9px; }
tbody td { padding: var(--row-h) 13px; border-bottom: 1px solid var(--line);
  font-size: 13px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num { text-align: right; font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.a-name { font-weight: 600; display: block; line-height: 1.35; }
.a-name a { color: var(--fg); text-decoration: none; }
.a-name a:hover { color: var(--accent); }
.a-tick { font-family: var(--f-num); font-size: 11px; color: var(--faint); }
.a-sub { font-size: 11.5px; color: var(--faint); }
.apy { font-weight: 600; font-size: 14px; }
.dim { color: var(--faint); }

/* chips */
.chip { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 3px;
  white-space: nowrap; border: 1px solid; }
.chip.RWA { color: var(--rwa); background: var(--rwa-bg); border-color: var(--rwa-line); }
.chip.DeFi { color: var(--defi); background: var(--defi-bg); border-color: var(--defi-line); }
.chip.CeFi { color: var(--cefi); background: var(--cefi-bg); border-color: var(--cefi-line); }
.badge-feat { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 2px 5px; border-radius: 3px; margin-left: 7px; white-space: nowrap; }
tr.feat td { background: var(--accent-soft); }
tr.feat:hover td { background: var(--accent-soft); }
tr.feat td:first-child { box-shadow: inset 3px 0 0 var(--accent-fill); }

/* term + countdown */
.term { font-family: var(--f-num); font-size: 11.5px; line-height: 1.4; white-space: nowrap; }
.term .lbl { display: block; font-family: var(--f-ui); font-size: 10px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.term.fixed .lbl { color: var(--rwa); }
.term.promo .lbl { color: var(--accent); }
.cd { color: var(--muted); }
.cd.soon { color: var(--down); font-weight: 600; }

/* earn button */
.earn { display: inline-flex; align-items: center; gap: 5px; font: 600 12px/1 var(--f-ui);
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius); padding: 8px 11px; cursor: pointer;
  white-space: nowrap; text-decoration: none; }
.earn:hover { background: var(--accent-fill); color: var(--btn-fg); border-color: var(--accent-fill); }
.earn .ref { font-family: var(--f-num); font-size: 8.5px; opacity: .7; letter-spacing: .05em; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 16px; }
.pillgroup { display: flex; border: 1px solid var(--line-strong);
  border-radius: var(--radius); overflow: hidden; }
.pillgroup button { font: 600 12.5px/1 var(--f-ui); color: var(--muted); background: var(--surface);
  border: 0; border-right: 1px solid var(--line); padding: 9px 13px; cursor: pointer; }
.pillgroup button:last-child { border-right: 0; }
.pillgroup button[aria-pressed="true"] { background: var(--accent-fill); color: var(--btn-fg); }
select, .search { font: 400 12.5px/1 var(--f-ui); color: var(--fg); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 11px; }
.search { min-width: 170px; }
.count { font-size: 12.5px; color: var(--faint); margin-left: auto;
  font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .count { margin-left: 0; } }

/* ---------- categories ---------- */
.cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 900px) { .cats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .cats { grid-template-columns: 1fr; } }
.cat { display: block; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 14px; text-decoration: none; color: inherit; }
.cat:hover { border-color: var(--accent-fill); background: var(--surface-2); }
.cat .cn { font-weight: 600; font-size: 14px; color: var(--fg); }
.cat .cm { font-family: var(--f-num); font-size: 11.5px; color: var(--muted);
  margin-top: 5px; font-variant-numeric: tabular-nums; }

/* ---------- news ---------- */
.news { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 26px; }
@media (max-width: 800px) { .news { grid-template-columns: 1fr; } }
.news-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-meta { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 6px; display: flex; gap: 9px; }
.news-meta .src { color: var(--accent); }
.news-item h3 { margin: 0 0 5px; font-size: 15px; line-height: 1.35;
  font-weight: 600; text-wrap: balance; }
.news-item p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ---------- disclosure ---------- */
.disclose { border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--radius); padding: 13px 15px; font-size: 12.5px;
  line-height: 1.55; color: var(--fg); }
.disclose b { color: var(--accent); }
.disclose a { color: var(--accent); font-weight: 600; }

/* ---------- asset page ---------- */
.facts { border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; margin: 22px 0; }
.facts dl { margin: 0; display: grid; grid-template-columns: minmax(150px, auto) 1fr; }
.facts dt { padding: 11px 15px; font-size: 12.5px; color: var(--muted);
  border-bottom: 1px solid var(--line); }
.facts dd { padding: 11px 15px; margin: 0; font-size: 13.5px;
  border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.facts dl > :nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 520px) {
  .facts dl { grid-template-columns: 1fr; }
  .facts dt { padding-bottom: 0; border-bottom: 0; }
}

/* ---------- footer ---------- */
.site-foot { padding-block: 32px 44px; background: var(--surface); border-top: 1px solid var(--line); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 32px; }
.foot-col { min-width: 140px; }
.foot-col h4 { font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.foot-col a { display: block; font-size: 13px; color: var(--muted);
  text-decoration: none; padding-block: 5px; }
.foot-col a:hover { color: var(--fg); }
.foot-col a.hi { color: var(--accent); font-weight: 600; }
.foot-legal { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line);
  font-size: 11.5px; line-height: 1.6; color: var(--faint); max-width: 90ch; }

/* ---------- misc ---------- */
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface);
  padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
