/* Readability (owner, 2026-11-23): the trial of the home page and the topic
   pages, kept and extended to every page, header and footer included. Loaded
   last on every page, after the page's own stylesheets (pages/layout.templ),
   so tokens.css and components.css stay the design's copies.
   (1) repo names bold and a little larger; (2) the gain a row shows in a pale
   green pill; (3) one sans-serif, Geist, for everything but the big titles and
   the section titles (Newsreader), figures in Geist's tabular digits, Geist
   Mono kept for code alone; (4) no text under 13 px, darker greys; (5) white
   cards on a lightly tinted ground, under the pale green veil of the home page
   mockup v4 ("Upstar – nouvel accueil", Home4: #E8F3EC, #F1F7F3 at 240 px,
   #FAFAF8 from 460 px). */

/* Tokens: dark is the default theme, light comes with [data-theme="light"].
   --bg is the ground, --surface the cards. */
:root, [data-theme="dark"] {
  --bg: #0A0B0D;
  --surface: #13161A;
  --border: #262B32;
  --muted: #B1B8C3;
  --faint: #8A919C;
  --veil-top: #0F1E17;
  --veil-mid: #0C1411;
  --gain-bg: rgba(43, 227, 138, 0.14);
  --gain-text: #4BEB9E;
  /* Red text 4.5:1 or more under the veil too (the admin's reason badges). */
  --danger: #F4776C;
}
[data-theme="light"] {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --border: #E5E8E6;
  --muted: #4A515C;
  --faint: #5E6672;
  --veil-top: #E8F3EC;
  --veil-mid: #F1F7F3;
  --gain-bg: #E3F3EA;
  --gain-text: #08703F;
  /* The rise's text a shade darker: 5.6:1 or more on the cards, the ground and
     the pale green fills (it was 4.4:1 on them, the fiche's labels and award
     chips, Explore's current chip). */
  --rise-text: #08703F;
  --danger: #B42318;
}
:root {
  /* (3) Geist for everything; Newsreader stays on the titles that name it. */
  --font-code: "Geist Mono", "Geist Mono Fallback", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-mono: var(--font-sans);
  --font-num: var(--font-sans);
  /* (4) The smallest step of the scale. */
  --fs-12: 13px;
}
code, kbd, pre, samp, .kbd { font-family: var(--font-code); }

/* (5) The ground and its veil. */
html { background: var(--bg); }
body {
  background: linear-gradient(180deg, var(--veil-top) 0, var(--veil-mid) 240px, var(--bg) 460px) no-repeat top / 100% 460px, var(--bg);
}
.f-newcomer, .h-band { background: transparent; }

/* (5) White cards: those of the home page and the ranking itself. */
.h-card, .h-proof__card, .h-mail, .l-card {
  background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--border);
}
.h-card:hover { background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
/* Rankings in a white card: a topic's, Trending's, Emerging's, an archive's, a
   collection's ranking and newcomers, /spotted's list, the member feed's, an AI
   niche page's two lists and /explore's repos (owner, 2026-11-24: the feed's
   rows sat on the ground) (a collection's comparison table has its own frame). */
section.l-rank, section.c-sec[aria-labelledby="cp-rank-title"], section.c-sec[aria-labelledby="cp-nc-title"], .spotted-list,
.m-list, section[aria-labelledby="niche-rising"] .l-table, section[aria-labelledby="niche-emerging"] .l-table, #repo-results .l-table {
  padding: 8px 16px 16px; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--border);
}
.l-rankhead { padding-top: 8px; }
section.c-sec[aria-labelledby="cp-rank-title"], section.c-sec[aria-labelledby="cp-nc-title"] { padding-top: 16px; }
.spotted-list > .spotted-row:first-child { border-top: 0; }
/* On a phone a ranking keeps the whole width: a white band, edge to edge. */
@media (max-width: 719.98px) {
  section.l-rank, section.c-sec[aria-labelledby="cp-rank-title"], section.c-sec[aria-labelledby="cp-nc-title"], .spotted-list,
  .m-list, section[aria-labelledby="niche-rising"] .l-table, section[aria-labelledby="niche-emerging"] .l-table, #repo-results .l-table {
    margin-inline: calc(-1 * clamp(16px, 4vw, 48px)); padding: 4px clamp(16px, 4vw, 48px) 12px; border-radius: 0;
    box-shadow: 0 -1px 0 var(--border), 0 1px 0 var(--border);
  }
}

/* (3) Figures in Geist's tabular digits. */
.num, .f-num, .gain, .stat-value, .badge-score, .health-badge__score, .stat-mini dd,
.l-rank, .l-gained, .l-score, .l-total, .l-how__ex, .l-count, .f-tile__big, .spotted-row__times, .archive-row__gain,
.collection-card__count, .coll-row__big, .h-feat__num, .h-feat__meta, .h-proof__fig, .h-mail__rank, .h-mail__gain,
.h-pick__figs, .h-coll__meta, .todo__n { font-variant-numeric: tabular-nums; }

/* (1) Repo names. */
.l-name, .repo-name, .f-near__name, .collection-card__repo-name, .cp-cmp__name a, .x-hot__name, .archive-row__name,
.w-side__name, .follow-form__repo, .h-feat__repo-name, .h-mail__repo, .x-card__repo, .m-topic__top > span:first-child,
.todo__repos .mono, a.mono[href*="/r/"], .mono > a[href*="/r/"] { font-weight: 600; }
.l-owner, .repo-owner { font-weight: 400; }
.l-name { font-size: 16px; }
.repo-card__title, .newcomer-card__title, .spotted-row__name, .archive-row__name, .h-mail__repo, .h-feat__repo-name, .x-hot__name { font-size: 15px; }
.collection-card__repo-name, .h-feat__repo { font-size: 14px; }
.h-pick__name { font-size: 18px; font-weight: 700; }

/* (2) The gain a row shows, in a pale green pill around the figure alone, so the
   words after it ("stars this week") may wrap in a narrow card. Gains in tables
   and in a row's second line stay as they are. */
.l-gained, .archive-row__gain, .h-pick__gain .num, .h-feat__num, .h-mail__gain {
  justify-self: end; display: inline-block; width: max-content;
}
.l-gained, .archive-row__gain, .h-pick__gain .num, .h-feat__num, .h-mail__gain,
.repo-card__gain .gain, .newcomer-card__gain .gain, .collection-card__gain .gain, .coll-row__big--gain,
.x-card__gain, .m-repo__gain, .m-topic__gain, .c-card__up, .todo__gain {
  padding: 2px 9px; border-radius: 999px; color: var(--gain-text); background: var(--gain-bg);
}
.l-gained { font-size: 15px; font-weight: 600; }
.h-pick__gain .num { margin-right: 4px; font-size: 15px; font-weight: 600; }
.h-feat__gain { align-items: center; }
.h-feat__num { font-size: 18px; line-height: 1.3; font-weight: 600; }
.h-mail__gain, .collection-card__gain .gain { padding: 1px 8px; font-weight: 600; }
.repo-card__gain .gain, .newcomer-card__gain .gain, .coll-row__big--gain, .x-card__gain, .m-repo__gain, .m-topic__gain,
.c-card__up, .todo__gain { font-weight: 600; }

/* (4) Nothing under 13 px (the scale's --fs-12 above); descriptions at 14 px. */
.l-desc, .h-coll__desc { font-size: 14px; }
.kbd, .chip-count, .sponsor__label, .sponsor__attr, .chart-label, .nav-item__count, .type-cue--sm, .facepile__more,
.collection-card__gain .gain-period,
.e-seg__opt--sm, .e-account__login, .e-count, .e-menu__member, .e-footer__title, .e-footer__legal,
.l-meta, .l-badge, .l-thead, .l-count, .l-filter__label, .l-scorenote, .l-reason, .l-note, .l-card__kicker, .l-crit__n,
.l-how__col, .l-how__stars, .l-how__formula, .l-how__min, .l-related__slug,
.h-pick__kicker, .h-pick__spot, .h-feat__kicker, .h-feat__spot, .h-feat__unit, .h-feat__meta, .h-cat__name,
.h-coll__kind, .h-coll__meta, .h-mail__from, .h-mail__desc, .h-mail__more,
.f-label, .f-report, .f-tile__sub, .f-chart__legend, .f-chart__spot span, .f-chart__axis, .f-days__table th, .f-table thead th,
.f-ranks__sub, .f-ranks__review, .f-log__day, .f-chip, .f-near__this, .skill-panel .panel__meta, .skill-panel__note,
.f-awards__note, .f-source,
.c-how__kicker, .c-card__kicker, .c-card__meta, .c-card__rank, .c-card__gain, .cp-weights__label, .cp-weights__legend,
.cp-glance__stats dt, .cp-cmp thead th, .cp-cmp__repo, .cp-cmp__stars .is-rise, .cp-cmp__src, .cp-cmp td::before,
.x-hot__meta, .x-chip__count, .x-card__slug, .x-follow, .x-card__stats, .x-card__top, .x-card__kicker,
.w-fact__vs, .w-move, .w-side__note,
.d-kicker, .d-mail__from, .d-mail__slug, .d-mail__desc, .d-caption,
.m-topic__slug, .m-topic__stats, .m-topic__rank, .m-add__kicker, .m-repo__meta, .m-repo__desc,
.ob-section__title, .quick-follow__lead, .admin-bar__item { font-size: 13px; }
/* Capitals at 13 px need less tracking than they had at 10 to 12. */
.l-thead, .l-card__kicker, .h-cat__name, .h-coll__kind, .f-label, .c-how__kicker, .c-card__kicker, .cp-cmp thead th,
.x-card__kicker, .m-add__kicker, .ob-section__title { letter-spacing: .04em; }
.l-badge { padding: 1px 8px; }
.x-chip__count { opacity: 1; }
/* /spotted's multiples were the bright green (3.4:1 on a white card). */
.spotted-row__times { color: var(--rise-text); }
