/* ============================================================
   TOKENIST v2 — Crypto news design system
   Serif display (Newsreader) · UI sans (IBM Plex Sans) · Mono numerals (IBM Plex Mono)
   Dual accent: emerald = News/markets, gold = Evergreen/Learn
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* dark (default) */
  --bg:            #0a0d13;
  --bg-2:          #0d1118;
  --surface:       #11151e;
  --surface-2:     #161b26;
  --surface-3:     #1c2230;
  --line:          rgba(255,255,255,.08);
  --line-2:        rgba(255,255,255,.045);
  --line-strong:   rgba(255,255,255,.14);

  --text:          #e8ebf1;
  --text-2:        #aab2c0;
  --text-3:        #6c7689;
  --text-faint:    #4a5365;

  --accent:        #15c08a;   /* emerald — brand / news / markets */
  --accent-soft:   rgba(21,192,138,.13);
  --accent-line:   rgba(21,192,138,.35);
  --accent-ink:    #0a0d13;

  /* scope-proof emerald (NOT remapped by .ev-scope) — for CTAs that must stay green */
  --emerald:       #15c08a;
  --emerald-soft:  rgba(21,192,138,.13);

  --gold:          #e8a82a;   /* evergreen / learn */
  --gold-soft:     rgba(232,168,42,.13);
  --gold-line:     rgba(232,168,42,.35);

  --up:            #18c98a;
  --up-soft:       rgba(24,201,138,.12);
  --down:          #f0566b;
  --down-soft:     rgba(240,86,107,.12);
  --btc:           #f7931a;
  --eth:           #8a92b2;

  --radius:        14px;
  --radius-sm:     9px;
  --radius-xs:     6px;
  --shadow:        0 1px 0 rgba(255,255,255,.02), 0 18px 40px -24px rgba(0,0,0,.7);
  --shadow-lg:     0 24px 60px -28px rgba(0,0,0,.8);

  --maxw:          1320px;
  --gutter:        clamp(16px, 3.2vw, 40px);

  --font-display:  'Newsreader', Georgia, 'Times New Roman', serif;
  --font-ui:       'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono:     'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="light"] {
  --bg:            #f4f6f9;
  --bg-2:          #eef1f6;
  --surface:       #ffffff;
  --surface-2:     #f7f9fc;
  --surface-3:     #eef2f7;
  --line:          rgba(11,18,32,.10);
  --line-2:        rgba(11,18,32,.06);
  --line-strong:   rgba(11,18,32,.16);

  --text:          #0e1626;
  --text-2:        #475063;
  --text-3:        #7c8699;
  --text-faint:    #aab2c0;

  --accent:        #0f9d6f;
  --accent-soft:   rgba(15,157,111,.10);
  --accent-line:   rgba(15,157,111,.30);
  --accent-ink:    #ffffff;

  --emerald:       #0f9d6f;
  --emerald-soft:  rgba(15,157,111,.10);

  --gold:          #b9821a;
  --gold-soft:     rgba(185,130,26,.12);
  --gold-line:     rgba(185,130,26,.30);

  --up:            #0f9d6f;
  --up-soft:       rgba(15,157,111,.10);
  --down:          #e0334b;
  --down-soft:     rgba(224,51,75,.10);

  --shadow:        0 1px 0 rgba(11,18,32,.02), 0 14px 34px -22px rgba(13,30,60,.28);
  --shadow-lg:     0 26px 60px -30px rgba(13,30,60,.32);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.up   { color: var(--up); }
.down { color: var(--down); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 999; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #0c8));
  color: var(--accent-ink); flex-shrink: 0;
  box-shadow: 0 4px 14px -4px var(--accent-line);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -.02em; color: var(--text); }
.brand-name b { color: var(--accent); font-weight: 600; }
/* Production inline logo — wordmark inherits theme color, emblem keeps brand blue */
.brand { color: var(--text); }
.brand-logo { height: 28px; width: auto; display: block; }
.brand img.custom-logo { height: 30px; width: auto; }
.site-footer .brand-logo { height: 26px; }
@media (max-width: 480px){ .brand-logo { height: 24px; } }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 4px; list-style: none; padding: 0; margin-block: 0; }
.nav-links a {
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  padding: 8px 12px; border-radius: 8px; letter-spacing: -.01em;
  transition: color .15s, background .15s; position: relative; display: inline-block;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links li.current-menu-item > a, .nav-links a.is-active { color: var(--text); }
.nav-links li.current-menu-item > a::after, .nav-links a.is-active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
/* dropdowns */
.nav-links li { position: relative; }
.nav-links ul.sub-menu {
  position: absolute; top: 100%; left: 0; min-width: 210px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px; margin: 6px 0 0; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .16s; z-index: 70;
}
.nav-links li:hover > ul.sub-menu { opacity: 1; visibility: visible; transform: none; }
.nav-links ul.sub-menu a { display: block; width: 100%; }
.nav-links ul.sub-menu ul.sub-menu { top: -7px; left: 100%; margin: 0 0 0 6px; }

.nav-spacer { flex: 1; }

/* NOTE: class is .tk-search (NOT .search) — WP adds body.search on search-results
   pages, which would otherwise inherit these styles and break the layout. */
.tk-search {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 0 11px; height: 38px;
  width: min(320px, 30vw); color: var(--text-3);
  transition: border-color .15s, background .15s;
}
.tk-search:hover { border-color: var(--line-strong); }
.tk-search input { border: 0; background: transparent; outline: none; color: var(--text); font-family: inherit; font-size: 13.5px; width: 100%; }
.tk-search input::placeholder { color: var(--text-3); }
.tk-search > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-3); }
.tk-search kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); display: grid; place-items: center; transition: all .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.sun, .moon { display: none; }
[data-theme="dark"] .moon, :root:not([data-theme="light"]) .moon { display: block; }
[data-theme="light"] .sun { display: block; }

/* language switcher */
.lang-switcher { position: relative; }
.lang-switcher__current {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text-2); font-size: 12.5px; font-weight: 600; font-family: var(--font-mono);
}
.lang-switcher__current:hover { color: var(--text); border-color: var(--line-strong); }
.lang-switcher__chevron { width: 13px; height: 13px; transition: transform .2s; }
.lang-switcher.open .lang-switcher__chevron { transform: rotate(180deg); }
.lang-switcher__list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; max-height: 320px; overflow-y: auto;
  list-style: none; margin: 0; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: all .16s; z-index: 80;
}
.lang-switcher.open .lang-switcher__list { opacity: 1; visibility: visible; transform: none; }
.lang-switcher__list a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; font-size: 12.5px; color: var(--text-2); }
.lang-switcher__list a:hover { background: var(--surface-2); color: var(--text); }
.lang-switcher__list img { width: 18px; height: auto; border-radius: 2px; }

.nav-burger { display: none; }

/* mobile menu panel */
.mobile-menu { display: none; }
body.nav-open { overflow: hidden; }
.mobile-menu.is-open { display: block; position: fixed; inset: 62px 0 0; z-index: 55; background: var(--bg); overflow-y: auto; padding: 18px var(--gutter) 60px; }
.mobile-menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-menu > ul > li { border-bottom: 1px solid var(--line-2); }
.mobile-menu a { display: block; padding: 13px 0; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.mobile-menu ul.sub-menu a { padding: 9px 0 9px 16px; font-size: 15px; color: var(--text-2); font-family: var(--font-ui); }

/* ---------- Global stats strip ---------- */
.stats-strip { border-bottom: 1px solid var(--line); background: var(--bg-2); font-family: var(--font-mono); }
.stats-inner { display: flex; align-items: stretch; height: 40px; overflow: hidden; }
.stat { display: flex; align-items: center; gap: 7px; padding-inline: 16px; border-right: 1px solid var(--line-2); white-space: nowrap; flex-shrink: 0; }
.stat:first-child { padding-left: 0; }
.stat-k { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); font-family: var(--font-ui); font-weight: 600; }
.stat-v { font-size: 12.5px; color: var(--text); font-weight: 500; }
.stat-d { font-size: 11.5px; }
.ticker { flex: 1; overflow: hidden; position: relative; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ticker-track { display: inline-flex; align-items: center; gap: 26px; height: 40px; padding-left: 20px; white-space: nowrap; will-change: transform; animation: ticker 64s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.tk b { font-family: var(--font-ui); font-weight: 600; font-size: 11.5px; color: var(--text-2); letter-spacing: .02em; }
.tk .px { color: var(--text); }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 7px; }
.eyebrow.gold { color: var(--gold); }
.eyebrow.muted { color: var(--text-3); }
.serif { font-family: var(--font-display); letter-spacing: -.015em; }
h1,h2,h3,h4 { margin: 0; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 26px); font-weight: 600; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.section-head .bar { width: 4px; height: 18px; border-radius: 2px; background: var(--accent); display: inline-block; }
.section-head .bar.gold { background: var(--gold); }
.see-all { font-size: 12.5px; font-weight: 600; color: var(--text-3); display: inline-flex; align-items: center; gap: 5px; transition: color .15s, gap .15s; }
.see-all:hover { color: var(--accent); gap: 8px; }
.see-all svg { width: 13px; height: 13px; }

/* ============================================================
   CHIPS / BADGES / PILLS
   ============================================================ */
.coin-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; background: var(--surface-2); border: 1px solid var(--line); border-radius: 7px; padding: 3px 8px 3px 5px; line-height: 1; }
.coin-chip .sym { color: var(--text-2); font-weight: 600; letter-spacing: .02em; }
.coin-dot { width: 14px; height: 14px; border-radius: 50%; display: grid; place-items: center; font-size: 8px; color: #fff; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.coin-dot img { width: 100%; height: 100%; object-fit: cover; }
.pct { font-family: var(--font-mono); font-weight: 600; font-size: 11.5px; }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.tag-cat { color: var(--accent); }
.tag-cat.gold { color: var(--gold); }
.sentiment { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 7px; line-height: 1; }
.sentiment.bear { color: var(--down); background: var(--down-soft); }
.sentiment.bull { color: var(--up); background: var(--up-soft); }
.dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 0 var(--up); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 60%, transparent); } 70% { box-shadow: 0 0 0 6px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; padding: 0 16px; height: 40px; border-radius: 10px; border: 1px solid transparent; transition: all .15s; white-space: nowrap; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-3); }
.btn-block { width: 100%; }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); position: relative; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

.story { display: flex; flex-direction: column; gap: 10px; }
.story .thumb { aspect-ratio: 16/10; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-3); position: relative; }
.story .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.story:hover .thumb img { transform: scale(1.04); }
.story h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.015em; line-height: 1.18; }
.story h3 a { transition: color .15s; }
.story:hover h3 a, .headline-link:hover { color: var(--accent); }
.story .meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.story .meta .mono { font-size: 11px; }
.story p { color: var(--text-2); font-size: 13.5px; line-height: 1.5; margin: 0; }

.thumb .img-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-faint); }
.img-ph { background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 55%), repeating-linear-gradient(135deg, var(--surface-2), var(--surface-2) 11px, var(--surface-3) 11px, var(--surface-3) 22px); }
.img-ph svg { width: 28px; height: 28px; opacity: .5; }

.hr { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ============================================================
   SPARKLINE
   ============================================================ */
.spark { display: block; }
.spark .area { opacity: .14; }

/* ============================================================
   MARKET TABLE
   ============================================================ */
.mtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mtable th { text-align: right; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 9px 14px; white-space: nowrap; border-bottom: 1px solid var(--line); font-family: var(--font-ui); }
.mtable th:nth-child(1), .mtable th:nth-child(2) { text-align: left; }
.mtable td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); text-align: right; white-space: nowrap; }
.mtable td:nth-child(1), .mtable td:nth-child(2) { text-align: left; }
.mtable tbody tr { transition: background .12s; }
.mtable tbody tr:hover { background: var(--surface-2); }
.mtable .num { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.mtable .coin-id { display: flex; align-items: center; gap: 10px; }
.mtable .coin-id .nm { font-weight: 600; }
.mtable .coin-id .sy { color: var(--text-3); font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; }
.rank { color: var(--text-faint); font-family: var(--font-mono); font-size: 12px; width: 24px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 64px; }
.footer-top { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 32px; padding: 48px 0 40px; }
.footer-col h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: 14px; font-weight: 700; }
.footer-col a { display: block; font-size: 13.5px; color: var(--text-2); padding: 5px 0; transition: color .15s; }
.footer-col a:hover { color: var(--accent); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-about p { color: var(--text-2); font-size: 13.5px; max-width: 34ch; margin: 14px 0 18px; }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); transition: all .15s; }
.footer-social a:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.footer-social svg { width: 16px; height: 16px; }
.footer-disclaimer { border-top: 1px solid var(--line); padding: 22px 0 4px; }
.footer-disclaimer p { color: var(--text-3); font-size: 11.5px; line-height: 1.6; margin: 0 0 12px; max-width: none; }
.footer-disclaimer strong { color: var(--text-2); }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-bottom p { color: var(--text-3); font-size: 12.5px; margin: 0; }
.footer-bottom .links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-bottom .links a { color: var(--text-3); font-size: 12.5px; transition: color .15s; }
.footer-bottom .links a:hover { color: var(--text); }

/* ============================================================
   MISC / GRIDS
   ============================================================ */
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }

/* pagination */
.tk-pagination { display: flex; justify-content: center; gap: 6px; margin: 40px 0; flex-wrap: wrap; }
.tk-pagination .nav-links { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; width: 100%; }
.tk-pagination .screen-reader-text { position: absolute; left: -9999px; }
.tk-pagination a, .tk-pagination span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-size: 13.5px; font-weight: 600; font-family: var(--font-mono); transition: all .15s; }
.tk-pagination a:hover { color: var(--text); border-color: var(--line-strong); }
.tk-pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tk-pagination .dots { border: 0; background: transparent; }

/* reveal */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(10px); animation: reveal .6s cubic-bezier(.2,.7,.3,1) forwards; }
  @keyframes reveal { to { opacity: 1; transform: none; } }
}

/* ============================================================
   RESPONSIVE (global)
   ============================================================ */
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-burger { display: grid; }
}
@media (max-width: 760px) {
  .tk-search { display: none; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: 1fr; }
}
