/* ============================================================================
   site.css — MemeBoard, portfolio visual identity D: "Terminal Degen".

   WHY A FOURTH IDENTITY
   ---------------------
   The portfolio has three: A "Editorial Data" (warm paper), B "Studio
   Instrument" (cool, dense), C "Warm Reference" (consumer, soft). All three
   are light-ground and assume a reader who is *reading*. A memecoin trader is
   scanning a live board, usually on a phone, usually at night, and in this
   vertical a bright corporate-white table reads as either a bank or a scam.
   Dark-first IS the trust signal here. So: a fourth identity, but a THIN one —
   tokens and table primitives only, reusing the portfolio's 8pt spacing scale,
   source-line convention and honesty blocks unchanged.

   THE CENTRAL TENSION, AND HOW IT IS RESOLVED
   -------------------------------------------
   Memecoin sites look untrustworthy because they let the chrome be as chaotic
   as the content. Here the split is strict: the CHROME is disciplined — near
   black, hairline rules, tabular numerals, dated source lines, no gradients on
   any data surface. The DEGEN energy is confined to named slots: coin art, one
   electric-lime accent, and badge microcopy. Serious frame, playful contents.

   THE CONTRAST RULE (inherited, load-bearing)
   -------------------------------------------
   Every colour exists twice. The bright token is for fills, tints and strokes.
   Anything carrying WHITE or dark TEXT on top uses the measured `-ink` partner.
   Gradients hide this bug — a gradient button passes at one end and fails at
   the other — so there are no text-bearing gradients in this file at all.
   Measured ratios are written next to each token; re-measure if you change one.

   DIRECTION IS NEVER COLOUR ALONE. Up/down always carries a ▲/▼ glyph and an
   explicit sign, so the board is readable with any colour vision.
   ========================================================================== */

:root {
  /* ---- ground + ink (dark, the default) ---- */
  --bg:          #0B0E14;
  --bg-raise:    #131826;   /* cards, table rows, ad frames */
  --bg-sunk:     #080A10;   /* sticky header, inset wells */
  --line:        #232A3B;
  --line-strong: #33405A;

  --text:      #E8ECF4;     /* 15.8:1 on --bg */
  --text-dim:  #8B94A8;     /*  6.1:1 on --bg — source lines, labels */
  --text-mute: #6E778A;
  --text-faint:#5D667A;

  /* ---- accent ---- */
  --accent:     #C6F432;    /* electric lime: fills, strokes, focus rings */
  --accent-ink: #141A02;    /* text ON --accent — 14.9:1 */
  --accent-text:#C6F432;    /* accent AS text on --bg — 13.4:1 */

  /* ---- direction ---- */
  --up:        #34D399;     /*  8.4:1 on --bg */
  --down:      #F87171;     /*  6.5:1 on --bg */
  --up-ink:    #04261A;     /* text ON a solid --up chip */
  --down-ink:  #3B0A0A;     /* text ON a solid --down chip */
  --up-tint:   rgba(52,211,153,.13);
  --down-tint: rgba(248,113,113,.13);

  /* ---- risk scale (also never colour-only: always paired with a number) ---- */
  --risk-good: #34D399;
  --risk-mid:  #FBBF24;
  --risk-bad:  #F87171;
  --risk-none: #6E778A;

  /* ---- type ---- */
  --font-ui:  "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ---- 8pt spacing scale ---- */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --radius: 10px;
  --radius-sm: 6px;
  --measure: 72ch;
  --wrap: 1200px;
}

/* Light theme. The dark theme's up/down fail on white, so they are re-measured
   rather than reused — that is the entire reason this block exists. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F7F8FA; --bg-raise: #FFFFFF; --bg-sunk: #EEF1F5;
    --line: #E3E6EC; --line-strong: #CBD2DE;
    --text: #14181F; --text-dim: #5A6372; --text-mute: #79818F; --text-faint: #9AA2B0;
    --accent: #C6F432; --accent-ink: #141A02; --accent-text: #4D7C0F; /* 4.6:1 on white */
    --up: #047857;  /* 4.8:1 on white */
    --down: #B91C1C; /* 5.9:1 on white */
    --up-ink: #FFFFFF; --down-ink: #FFFFFF;
    --up-tint: rgba(4,120,87,.10); --down-tint: rgba(185,28,28,.10);
    --risk-good: #047857; --risk-mid: #B45309; --risk-bad: #B91C1C; --risk-none: #79818F;
  }
}
:root[data-theme="light"] {
  --bg: #F7F8FA; --bg-raise: #FFFFFF; --bg-sunk: #EEF1F5;
  --line: #E3E6EC; --line-strong: #CBD2DE;
  --text: #14181F; --text-dim: #5A6372; --text-mute: #79818F; --text-faint: #9AA2B0;
  --accent: #C6F432; --accent-ink: #141A02; --accent-text: #4D7C0F;
  --up: #047857; --down: #B91C1C; --up-ink: #FFFFFF; --down-ink: #FFFFFF;
  --up-tint: rgba(4,120,87,.10); --down-tint: rgba(185,28,28,.10);
  --risk-good: #047857; --risk-mid: #B45309; --risk-bad: #B91C1C; --risk-none: #79818F;
}

/* ---------------------------------------------------------------- base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
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;
}

/* Numbers are the product. Anything that can hold one gets tabular figures so
   digits never shimmy between refreshes. */
table, td, th, .num, .price, .pct, .stat-value, .mono, time, .tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.mono { font-family: var(--font-mono); }

a { color: var(--accent-text); text-decoration-color: color-mix(in srgb, var(--accent-text) 40%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--s3); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 28px; }
h2 { font-size: 22px; margin-top: var(--s6); }
h3 { font-size: 17px; margin-top: var(--s5); }
p  { margin: 0 0 var(--s4); max-width: var(--measure); }
small { font-size: 12px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s4); }
.prose { max-width: var(--measure); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* -------------------------------------------------------- source lines ---- */
/* Portfolio doctrine: every figure carries a dated source. Small, dim, always
   present — it is what separates this from a hype site. */
.src {
  display: block; font-size: 12px; color: var(--text-dim);
  margin-top: var(--s2); line-height: 1.4;
}
.src a { color: inherit; }
.stale { color: var(--risk-mid); font-style: italic; }

/* ------------------------------------------------------------- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-sunk) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: var(--s3); height: 52px; }
.brand { display: flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; letter-spacing: -0.02em; }
.brand .mark {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent); color: var(--accent-ink); font-size: 15px; font-weight: 800;
}
.site-nav { margin-left: auto; display: flex; gap: var(--s1); align-items: center; }
.site-nav a {
  color: var(--text-dim); text-decoration: none; font-size: 13px; font-weight: 500;
  padding: 6px 9px; border-radius: var(--radius-sm);
}
.site-nav a:hover { color: var(--text); background: var(--bg-raise); }
.site-nav a[aria-current="page"] { color: var(--accent-text); background: var(--bg-raise); }
.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  width: 30px; height: 30px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }

/* --------------------------------------------------------- ticker tape ---- */
.tape {
  border-bottom: 1px solid var(--line); background: var(--bg-sunk);
  overflow: hidden; font-size: 12px;
}
.tape-inner { display: flex; gap: var(--s5); padding: 7px var(--s4); white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.tape-inner::-webkit-scrollbar { display: none; }
.tape-item { display: inline-flex; gap: 6px; align-items: baseline; color: var(--text-dim); }
.tape-item b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------------------- tables ---- */
.board { width: 100%; border-collapse: collapse; }
.board th {
  text-align: right; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-dim); padding: var(--s2) var(--s3);
  border-bottom: 1px solid var(--line); position: sticky; top: 52px; background: var(--bg);
  white-space: nowrap;
}
.board th:first-child, .board th.left { text-align: left; }
.board td { padding: var(--s3); border-bottom: 1px solid var(--line); text-align: right; font-size: 13px; }
.board td:first-child, .board td.left { text-align: left; }
.board tbody tr:hover { background: var(--bg-raise); }

.coin-cell { display: flex; align-items: center; gap: var(--s3); min-width: 0; }
.coin-cell img, .coin-cell .noimg {
  width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--bg-raise);
  object-fit: cover;
}
.coin-cell .noimg { display: grid; place-items: center; font-size: 11px; color: var(--text-dim); font-weight: 700; }
.coin-name { min-width: 0; }
.coin-name a { color: var(--text); text-decoration: none; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coin-name a:hover { color: var(--accent-text); }
.coin-sym { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); text-transform: uppercase; }
.rank { color: var(--text-dim); font-size: 12px; width: 28px; }

/* Direction. Colour is reinforcement; the glyph and sign carry the meaning. */
.pct { font-weight: 600; white-space: nowrap; }
.pct.up   { color: var(--up); }
.pct.down { color: var(--down); }
.pct.flat { color: var(--text-dim); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
  border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.chip.up   { background: var(--up-tint);   color: var(--up); }
.chip.down { background: var(--down-tint); color: var(--down); }
.chip.neutral { background: var(--bg-raise); color: var(--text-dim); border: 1px solid var(--line); }
.chip.base     { background: rgba(0,82,255,.16); color: #7FA8FF; }
.chip.robinhood{ background: rgba(198,244,50,.14); color: var(--accent-text); }

/* Sub-cent prices: a subscript zero-count, never nine grey zeros. */
.price sub { font-size: .72em; }

/* -------------------------------------------------------- risk display ---- */
.risk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.risk-good .risk-dot { background: var(--risk-good); }
.risk-mid  .risk-dot { background: var(--risk-mid); }
.risk-bad  .risk-dot { background: var(--risk-bad); }
.risk-none .risk-dot { background: var(--risk-none); }
.risk-none { color: var(--text-dim); }

.checklist { list-style: none; padding: 0; margin: var(--s4) 0; display: grid; gap: var(--s2); }
.checklist li {
  display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3);
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px;
}
.checklist .mark { flex: none; font-weight: 700; width: 1.2em; }
.checklist .pass .mark { color: var(--up); }
.checklist .fail .mark { color: var(--down); }
.checklist .unknown .mark { color: var(--text-dim); }
.checklist .weight { margin-left: auto; color: var(--text-dim); font-size: 11px; }

/* --------------------------------------------------------------- cards ---- */
.card {
  background: var(--bg-raise); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s4);
}
.grid { display: grid; gap: var(--s3); }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }

.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.stat-value { font-size: 18px; font-weight: 600; margin-top: 2px; }

/* ------------------------------------------------------------ spotlight ---- */
.spotlight {
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg-raise); padding: var(--s5); position: relative; overflow: hidden;
}
/* Decorative glow only — it sits BEHIND content, never under text. */
.spotlight::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(198,244,50,.16), transparent 68%);
  pointer-events: none;
}
.spotlight .eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent-text); font-weight: 700;
}

/* ------------------------------------------------------------ sparkline ---- */
.spark { display: block; width: 72px; height: 22px; }
.spark-lg { width: 100%; height: 120px; }

/* ----------------------------------------------------------------- ads ---- */
/* Framed and labelled so an ad can never be mistaken for a table row. */
.ad-slot {
  margin: var(--s5) 0; padding: var(--s3); text-align: center;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius);
  min-height: 100px;
}
.ad-slot::before {
  content: "Advertisement"; display: block; font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--s2);
}
.house-ad {
  display: flex; align-items: center; gap: var(--s3); margin: var(--s5) 0;
  padding: var(--s3) var(--s4); background: var(--bg-raise);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); font-size: 13px; text-decoration: none; color: var(--text);
}
.house-ad:hover { border-color: var(--line-strong); }
.house-ad .tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); flex: none;
}

/* -------------------------------------------------------------- tabs ------ */
.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin: var(--s4) 0; overflow-x: auto; }
.tabs a {
  padding: var(--s2) var(--s3); font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--text-dim); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs a:hover { color: var(--text); }

.segmented { display: inline-flex; background: var(--bg-raise); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.segmented a {
  padding: 5px 12px; font-size: 13px; font-weight: 600; border-radius: 999px;
  text-decoration: none; color: var(--text-dim);
}
.segmented a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

/* ------------------------------------------------------------ screener ---- */
.filter-rail { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s2); scrollbar-width: none; }
.filter-rail::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-raise); color: var(--text-dim); font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.filter-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.search-input {
  width: 100%; padding: 10px var(--s3); font-size: 15px; font-family: inherit;
  background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
}
.search-input::placeholder { color: var(--text-faint); }

/* --------------------------------------------------------- honesty box ---- */
.notice {
  border: 1px solid var(--line); border-left: 3px solid var(--risk-mid);
  background: var(--bg-raise); border-radius: var(--radius);
  padding: var(--s4); margin: var(--s5) 0; font-size: 13px;
}
.notice strong { color: var(--text); }
.notice p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- footer ---- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: var(--s8);
  padding: var(--s6) 0; font-size: 13px; color: var(--text-dim);
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--text); }
.footer-cols { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--s5); }
.footer-cols h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text); margin: 0 0 var(--s2); }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* ------------------------------------------------------ live behaviour ---- */
/* A changed number pulses once, then settles. Because figures are tabular and
   fixed-width, nothing reflows while it happens. */
@keyframes flash-up   { from { background: var(--up-tint); }   to { background: transparent; } }
@keyframes flash-down { from { background: var(--down-tint); } to { background: transparent; } }
.flash-up   { animation: flash-up   .6s ease-out; }
.flash-down { animation: flash-down .6s ease-out; }

.skeleton {
  background: linear-gradient(90deg, var(--bg-raise), var(--line), var(--bg-raise));
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 4px; color: transparent;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --------------------------------------------------------------- mobile ---- */
/* Measured at 375px. The table IS the hero — no marketing paragraph is allowed
   above it, and a row must never trigger horizontal scroll. */
@media (max-width: 720px) {
  h1 { font-size: 23px; }
  h2 { font-size: 19px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer-cols { grid-template-columns: repeat(2, minmax(0,1fr)); }

  /* THE FOLD BUDGET, measured at 375x812.
     Measured before this block existed: the first table row began at 882px —
     the entire fold was intro copy, a full-height spotlight and a 2x2 stat
     grid, and not one row of the actual board was visible. On a board site
     that is the whole product pushed below the fold. Everything below buys
     that space back. Re-measure if you add anything above the first table. */

  /* The tagline repeats what the h1 and the ticker tape already say. */
  .hide-mobile { display: none !important; }

  /* Spotlight: keep the coin, the price and the score; drop the explanation to
     a link, since the full rule has its own page. */
  .spotlight { padding: var(--s3) var(--s4); }
  .spotlight .stat-value { font-size: 16px; }

  /* Stat cards become one swipeable row instead of a 2x2 block. */
  .signal-strip {
    display: flex !important; gap: var(--s2); overflow-x: auto;
    scrollbar-width: none; padding-bottom: var(--s1);
  }
  .signal-strip::-webkit-scrollbar { display: none; }
  .signal-strip .card { flex: none; min-width: 148px; padding: var(--s3); }
  .signal-strip .stat-value { font-size: 16px; }

  /* Columns that do not survive 375px are hidden here and shown in the
     per-coin page instead — not squeezed until they are unreadable. */
  .board .col-opt { display: none; }
  .board th, .board td { padding: 8px var(--s2); font-size: 13px; }
  .board .rank { display: none; }
  .coin-cell img, .coin-cell .noimg { width: 26px; height: 26px; }
  .spotlight { padding: var(--s4); }
  .site-nav { display: none; }
  .site-nav.mobile-open { display: flex; }
}

@media (max-width: 400px) {
  .wrap { padding: 0 var(--s3); }
  .board th, .board td { padding: 9px 6px; }
}
