@import url('/fonts/fonts.css');

/*
 * MCCA design system.
 *
 * The site is the association's public census of Mongolian YouTube. The
 * layout stays calm and spacious so the data reads easily, and the colour comes
 * from the logo: five inks taken from deel robes and painted ger doors, saffron,
 * magenta, coral, turquoise and cobalt, overprinting like risograph ink.
 *
 * Rules the rest of this file follows:
 *   - Each section of the site owns one of the five brand colours (its "hue"),
 *     set on <body data-hue> by renderNav. The masthead band, key figures and
 *     note rules take that hue, so a reader always knows where they are.
 *   - Coloured text uses the darker "-ink" variants, which pass AA on the paper
 *     and on the tints. The bright inks are for shapes, bars and marks only.
 *   - Coral (--gold, kept for the old name) marks the single thing to notice.
 *   - Sentence case everywhere. No all-caps labels, no pills, no arrows.
 *   - Spectral for display and long-form; Golos Text for interface and numbers.
 *
 * TOKEN NAMES ARE THE OLD ONES where other files use them (--panel, --dim,
 * --accent, --gold), so values changed and names did not.
 */

:root {
  /* brand inks, exactly as in /logo.svg */
  --saffron: #F2A22C;
  --magenta: #D9338A;
  --coral: #E8483B;
  --teal: #1FA6A0;
  --cobalt: #2B4FD6;
  /* text-safe versions */
  --saffron-ink: #9A5B00;
  --magenta-ink: #B0246C;
  --coral-ink: #C0362A;
  --teal-ink: #0B7A74;
  --cobalt-ink: #2B4FD6;
  /* soft tints for the masthead bands */
  --saffron-tint: #FBEBCF;
  --magenta-tint: #F8DDEA;
  --coral-tint: #FADFD9;
  --teal-tint: #D8EFEC;
  --cobalt-tint: #E1E6FA;

  /* palette */
  --bg: #F6F4EF;          /* paper, the logo's own ground */
  --panel: #FFFFFF;
  --panel-2: #ECE8DF;
  --line: #E2DDD2;
  --rule-strong: #BDB6A8;
  --text: #1C2126;
  --muted: #5A5E66;
  --dim: #676B72;
  --accent: #2B4FD6;
  --accent-hover: #1F3BA8;
  --gold: #E8483B;        /* the one mark to notice, now coral */
  --gold-text: #C0362A;
  --ok: #0B7A74;
  --bad: #C0362A;
  --info: #2B4FD6;
  --night: #1A1C2E;       /* dark bands: the signature graphic and the footer */

  /* type */
  --serif: 'Spectral', 'Iowan Old Style', Georgia, serif;
  --sans: 'Golos Text', 'Segoe UI', system-ui, sans-serif;

  /* layout */
  --page: 1280px;
  --gutter: clamp(20px, 4.5vw, 80px);
  --measure: 64ch;
}

/* The section hue. Cobalt unless the page says otherwise. */
body { --hue: var(--cobalt); --hue-ink: var(--cobalt-ink); --hue-tint: var(--cobalt-tint); }
body[data-hue="saffron"] { --hue: var(--saffron); --hue-ink: var(--saffron-ink); --hue-tint: var(--saffron-tint); }
body[data-hue="magenta"] { --hue: var(--magenta); --hue-ink: var(--magenta-ink); --hue-tint: var(--magenta-tint); }
body[data-hue="coral"]   { --hue: var(--coral);   --hue-ink: var(--coral-ink);   --hue-tint: var(--coral-tint); }
body[data-hue="teal"]    { --hue: var(--teal);    --hue-ink: var(--teal-ink);    --hue-tint: var(--teal-tint); }

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* The five-ink stripe across the top of every page, in the logo's order.
   Hard stops, not a gradient. */
body::before {
  content: ""; display: block; height: 6px;
  background: linear-gradient(90deg,
    var(--saffron) 0 20%, var(--magenta) 20% 40%, var(--coral) 40% 60%,
    var(--teal) 60% 80%, var(--cobalt) 80% 100%);
}

/*
 * Full-bleed colour bands without extra markup: every block sits in a centred
 * column, so a band is painted with border-image outset past both edges. That is
 * ink overflow, so it never adds a horizontal scrollbar.
 */
nav.top, header.page, .hero, .masthead {
  border-image: linear-gradient(var(--hue-tint), var(--hue-tint)) fill 0 / 0 / 0 100vmax;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

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

/*
 * Every top-level block shares one centred column with a fluid gutter, so the
 * pages keep their existing flat markup and still sit on a single grid.
 */
nav.top, .subnav, header.page, .note, .caveat, .controls, .wrap, .cards,
.grid-2, h2.section, footer.site, main.home {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------------------------------------------------------------------ masthead */

nav.top {
  display: flex; align-items: baseline; flex-wrap: wrap;
  column-gap: 34px; row-gap: 6px;
  padding-block: 30px 22px;
}
/* Row one: the brand lockup (mark, rule, full name) and sign-in. Row two: the
   section links. The name is long in both languages, so it gets its own row
   rather than squeezing the links. */
nav.top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 22px; padding-block: 26px 0; }
nav.top .brand { display: flex; align-items: center; gap: 18px; text-decoration: none; min-width: 0; }
nav.top .brand img { display: block; height: 40px; width: auto; flex: none; }
.brand-name { display: flex; flex-direction: column; gap: 2px; padding-left: 18px; border-left: 1.5px solid var(--rule-strong); min-width: 0; }
.brand-name b { font: 600 17px/1.2 var(--sans); color: var(--text); }
.brand-name span { font: 400 13.5px/1.2 var(--sans); color: var(--muted); }
/* On the homepage the name is the page title, so the masthead shows the mark only. */
.nav-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; column-gap: 30px; row-gap: 6px; padding-bottom: 14px; }

/* Groups (Шинжилгээ, Дотоод): a dropdown on wide screens. */
.nav-group { position: relative; }
.nav-group-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 0; padding: 4px 0;
  border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none;
  font: inherit; font-size: 15px; color: var(--muted); cursor: pointer;
}
.nav-group-btn:hover, .nav-group.open .nav-group-btn { color: var(--text); }
.nav-group.active .nav-group-btn { color: var(--text); border-bottom-color: var(--hue); }
.nav-group-btn i { width: 7px; height: 7px; margin-top: -3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .15s; }
.nav-group.open .nav-group-btn i { transform: rotate(225deg); margin-top: 3px; }
.nav-menu {
  display: none; position: absolute; z-index: 40; top: calc(100% + 8px); left: -18px; min-width: 230px;
  padding: 8px 0; background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 18px 40px rgba(26, 28, 46, 0.14);
}
.nav-group.open .nav-menu { display: block; }
nav.top .nav-menu a { display: block; padding: 9px 18px; border: 0; font-size: 15px; color: var(--text); white-space: nowrap; }
nav.top .nav-menu a:hover { background: var(--hue-tint); }
nav.top .nav-menu a.active { border: 0; box-shadow: inset 3px 0 0 var(--hue); font-weight: 500; }
/* The phone menu button, hidden on wide screens. */
.nav-toggle { display: none; min-height: 0; padding: 7px 12px; font-size: 13.5px; border: 1.5px solid var(--rule-strong); border-radius: 2px; background: var(--panel); }
nav.top a:not(.brand) {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  padding-block: 4px;
  border-bottom: 1.5px solid transparent;
}
nav.top a:not(.brand):hover { color: var(--text); }
nav.top a.active { color: var(--text); border-bottom: 3px solid var(--hue); }
/* Internal pages, visible only when signed in: set apart by colour, not weight. */
nav.top a.internal { color: var(--dim); }
nav.top a.internal.active { color: var(--text); border-bottom-color: var(--hue); }
nav.top a.nav-auth { margin-left: auto; font-size: 14px; color: var(--dim); }

/* --------------------------------------------------------------- page header */

header.page { padding-block: clamp(40px, 7vw, 88px) clamp(40px, 5vw, 64px); margin-bottom: 40px; }
header.page h1 {
  margin: 0;
  max-width: 18ch;
  font: 300 clamp(40px, 5.6vw, 72px)/1.04 var(--serif);
  letter-spacing: -0.018em;
  color: var(--text);
}
header.page .sub {
  margin-top: 22px;
  max-width: var(--measure);
  font: 400 clamp(18px, 1.7vw, 21px)/1.6 var(--serif);
  color: var(--muted);
}
header.page .sub strong { color: var(--text); font-weight: 600; }

/* Key figures under a page title. Supporting information, so quieter than the
   title: a light serif figure over a plain sentence-case label. */
.stats {
  display: flex; flex-wrap: wrap;
  column-gap: clamp(28px, 4vw, 56px); row-gap: 20px;
  margin-top: 40px;
}
.stat b {
  display: block;
  font: 400 clamp(28px, 2.8vw, 38px)/1.1 var(--serif);
  color: var(--hue-ink);
  font-variant-numeric: tabular-nums lining-nums;
}
.stat span { display: block; margin-top: 6px; font-size: 14px; color: var(--muted); max-width: 22ch; }

/* ------------------------------------------------------------------- asides */

/* Method notes and caveats: a column of text marked by a gold rule, because a
   caveat IS the thing a reader must not miss. */
.note, .caveat {
  margin-block: 8px 34px;
}
.note, .caveat {
  font-size: 15.5px; line-height: 1.7; color: var(--muted);
}
.note, .caveat { position: relative; }
.note::before, .caveat::before {
  content: ""; position: absolute; left: var(--gutter); top: 4px; bottom: 4px;
  border-left: 4px solid var(--hue);
}
/*
 * Keep the text near a 72-character measure. 60ch, because ch is the width of "0" and
 * 72ch measured ~87 Cyrillic characters per line. The content is set by script as a bare text
 * node mixed with <strong>, so a max-width on child elements never applies and
 * the lines ran to ~150 characters. Instead the right padding absorbs whatever
 * width is left over after the gutter, the rule and 72ch.
 */
.note, .caveat {
  padding-left: calc(var(--gutter) + 22px);
  padding-right: max(var(--gutter),
    calc(min(100vw, var(--page) + 2 * var(--gutter)) - var(--gutter) - 22px - 60ch));
}
.note strong, .caveat strong { color: var(--text); font-weight: 600; }
.note:empty, .caveat:empty { display: none; }

/* ----------------------------------------------------------------- controls */

.controls {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center;
  padding-block: 18px 22px;
}
.controls h3 { font: 400 26px/1.2 var(--serif); letter-spacing: -0.01em; margin: 0; color: var(--text); }

input, select, button {
  font: inherit; font-size: 15px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 9px 12px;
  min-height: 42px;
}
input { flex: 1 1 260px; }
select { padding-right: 30px; cursor: pointer; }
button { cursor: pointer; }
input:hover, select:hover, button:hover { border-color: var(--rule-strong); }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
button[disabled] { opacity: .5; cursor: default; }

/* ------------------------------------------------------------------- tables */

.wrap { overflow-x: auto; padding-block: 0 96px; }
table { border-collapse: collapse; width: 100%; }
th, td {
  text-align: left;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
/* Header text may wrap: the Mongolian headers are far longer than the English
   abbreviations they replaced ("Идэвхгүй хоног" for "Idle d"), and forcing one
   line pushed the 14-column Creators table past a 1280px screen. Units inside
   headers use &nbsp; so "30 хоног" never splits from its number. */
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  vertical-align: bottom;
  white-space: normal;
  padding-block: 10px;
  border-bottom: 2px solid var(--text);
  user-select: none;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--text); }
th[data-dir]::after { content: attr(data-dir); color: var(--accent); margin-left: 5px; font-size: 10px; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: rgba(43, 79, 214, 0.045); }
td { font-size: 15px; }
td.num, th.num { text-align: right; white-space: nowrap; }
th.num { white-space: normal; }
td.num { font-variant-numeric: tabular-nums lining-nums; }
/* Rank order is a real sequence, so the rank earns a typographic voice. */
td.rank {
  width: 56px; text-align: right; padding-right: 18px;
  font: 300 22px/1 var(--serif);
  color: var(--dim);
}
img.av { width: 36px; height: 36px; border-radius: 50%; display: block; background: var(--panel-2); }
.name { font-weight: 500; font-size: 15.5px; }
.name a { color: var(--text); text-decoration: none; }
.name a:hover { color: var(--accent); text-decoration: underline; }
.handle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.missing { color: var(--dim); }
.empty { padding: 56px 0; color: var(--muted); font-size: 15px; }
.shown { color: var(--muted); font-size: 14px; padding: 18px 8px 0; }

/* Status: a small dot and a word, not a coloured pill. The key stays the CSS
   class; the word is the Mongolian label. */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; color: var(--muted); white-space: nowrap;
}
.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--rule-strong); flex: none;
}
.pill.active::before { background: var(--accent); }
.pill.dormant::before { background: var(--rule-strong); }
.pill.emptied::before { background: var(--gold); }
.pill.gone::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule-strong); }
.pill.live { color: var(--bad); }
.pill.live::before { background: var(--bad); }
/* Platform and programme names are words, not states. */
.pill.youtube::before, .pill.kick::before, .pill.twitch::before,
.pill.partner::before, .pill.affiliate::before { display: none; }
.pill.youtube, .pill.kick, .pill.twitch { color: var(--text); font-weight: 500; }

/* Who is behind a channel. Individuals and groups, the membership-eligible
   types, read in full ink; organisations recede. */
.tag { font-size: 14px; color: var(--muted); white-space: nowrap; }
.tag.individual, .tag.group { color: var(--text); }

/* A thin proportion bar under a figure. */
.bar { height: 3px; background: var(--panel-2); overflow: hidden; min-width: 60px; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--accent); }

/* ------------------------------------------------------------ internal ops */

.runbar { margin-top: 26px; font-size: 13.5px; line-height: 1.9; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
/* Never finished: killed mid-run (usually a container restart) or still going.
   Deliberately not red, because it is not a failure the run reported. */
.dot.unfinished { background: var(--rule-strong); }

.cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px clamp(28px, 4vw, 64px);
  padding-block: 24px 64px;
}
.card { position: relative; min-width: 0; }
.card > h3 {
  margin: 0 0 16px; padding-bottom: 12px;
  font: 400 24px/1.25 var(--serif); letter-spacing: -0.005em;
  color: var(--text);
  border-bottom: 3px solid var(--hue);
}

/* Review queue: the decision buttons sit immediately beside the channel name so
   the link and the two actions share one cursor path. */
td.decide { white-space: nowrap; width: 1%; }
td.decide button { min-height: 34px; padding: 5px 12px; font-size: 14px; }
td.decide button + button { margin-left: 6px; }

/* Review queue evidence: sampled video titles lead, the self-description follows
   quieter, because descriptions are marketing and titles are fact. */
.evidence { max-width: 540px; font-size: 14px; line-height: 1.5; }
.evidence .titles { color: var(--text); }
.evidence .desc {
  color: var(--muted); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.evidence .cc, .evidence .why { display: inline-block; margin: 6px 10px 0 0; font-size: 13px; color: var(--dim); }
.evidence .cc { font-weight: 600; }
.rank-score { font-variant-numeric: tabular-nums; }
.rank-score.pos { color: var(--accent); }
.rank-score.neg { color: var(--dim); }

/* --------------------------------------------------------------- analytics */

/* Two charts per row on a desktop, never three: at three a 1,500-point scatter
   is too narrow to read, and the expand button covers the remaining cases. */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
  gap: 88px clamp(40px, 5vw, 80px);
  padding-block: 24px 110px;
}
.grid-2 .card.wide { grid-column: 1 / -1; }

.grid-2 .card > h3 {
  margin: 0 0 10px; padding: 0 40px 0 0; border: 0;
  font: 400 clamp(22px, 2vw, 27px)/1.25 var(--serif);
  letter-spacing: -0.01em;
  max-width: 34ch;
}
.card .note-sm { margin: 0 0 24px; font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 62ch; }

/* Expand to full screen, quiet until the chart is hovered or focused. */
.expand {
  position: absolute; top: 2px; right: 0;
  width: 32px; height: 32px; min-height: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--panel); color: var(--muted);
  font-size: 15px; line-height: 1;
  opacity: 0; transition: opacity .15s;
}
.card:hover .expand, .expand:focus-visible { opacity: 1; }
.expand:hover { color: var(--accent); border-color: var(--accent); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--rule-strong); stroke-width: 1; }
.chart .tick { fill: var(--dim); font-size: 12px; font-family: var(--sans); }
.chart .tick-x { text-anchor: middle; }
.chart .tick-y { text-anchor: end; }
.chart .axis-title { fill: var(--muted); font-size: 12.5px; font-family: var(--sans); text-anchor: middle; }
.chart circle, .chart rect, .chart path { transition: fill-opacity .12s; }
.chart circle:hover, .chart rect:hover { fill-opacity: 1; }
.chart .ch-mark { cursor: pointer; }
.chart .ch-dot { stroke: var(--bg); stroke-width: 2; }
.chart .ch-dot:hover, .chart .ch-cell:hover, .chart .ch-bar:hover { stroke: var(--text); stroke-width: 1.5; }
.chart .ch-pt:hover { stroke: var(--text); stroke-width: 1.5; fill-opacity: 1; }
.chart .ch-hit { cursor: crosshair; }
.chart .ch-hit:hover { fill: rgba(43, 79, 214, 0.06); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.scale-key { display: flex; align-items: center; gap: 3px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.scale-key i { width: 22px; height: 8px; display: inline-block; }
.scale-key span:first-child { margin-right: 6px; }
.scale-key span:last-child { margin-left: 6px; }

.finding { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.finding b { color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------------ tooltip */

.tip {
  position: fixed; z-index: 60; pointer-events: none;
  max-width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  font-size: 13.5px; line-height: 1.55;
  color: var(--text);
  box-shadow: 0 14px 34px rgba(26, 28, 46, 0.14);
}
/* A pinned tooltip accepts clicks so its link can be followed; a hovering one
   must not, or it would sit between the cursor and the mark underneath. */
.tip.pinned { pointer-events: auto; border-color: var(--accent); }
.tip-body { white-space: pre-line; }
.tip-link { display: inline-block; margin-top: 8px; color: var(--accent); font-size: 13px; text-decoration: none; }
.tip.pinned .tip-link { text-decoration: underline; }
.tip-hint { margin-top: 8px; font-size: 12.5px; color: var(--dim); }

/* ------------------------------------------------------------ expanded view */

.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(246, 244, 239, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.overlay[hidden] { display: none; }
.overlay-panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 32px 36px 34px;
  width: min(1720px, 96vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 24px 60px rgba(26, 28, 46, 0.16);
}
.overlay-panel h3 { margin: 0 0 8px; font: 400 30px/1.2 var(--serif); color: var(--text); padding-right: 48px; }
.overlay-panel .note-sm { margin: 0 0 24px; font-size: 15px; color: var(--muted); max-width: 90ch; }
.overlay-close {
  position: absolute; top: 22px; right: 24px;
  width: 36px; height: 36px; min-height: 0; padding: 0;
  font-size: 15px; color: var(--muted);
}
.overlay-close:hover { color: var(--accent); border-color: var(--accent); }
body.no-scroll { overflow: hidden; }

/* ----------------------------------------------------------------- rankings */

h2.section {
  margin-block: 24px 0;
  padding-block: 64px 8px;
  font: 300 clamp(32px, 3.4vw, 44px)/1.1 var(--serif);
  letter-spacing: -0.015em;
  color: var(--text);
}
ol.leaders { margin: 0; padding: 0; list-style: none; counter-reset: leader; }
ol.leaders li {
  counter-increment: leader;
  display: grid; grid-template-columns: 30px 1fr auto; align-items: baseline; gap: 10px;
  padding-block: 9px; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
ol.leaders li::before { content: counter(leader); font: 300 18px/1 var(--serif); color: var(--dim); }
ol.leaders a { color: var(--text); text-decoration: none; }
ol.leaders a:hover { color: var(--accent); text-decoration: underline; }
ol.leaders span { color: var(--muted); }

/* ------------------------------------------------------------------- footer */

/* The rule sits on the inner block, not the footer: a border on the footer
   spans its padding and ran edge to edge, out of line with every other rule. */
footer.site {
  margin-top: 64px; padding-block: 64px 72px;
  border-image: linear-gradient(var(--night), var(--night)) fill 0 / 0 / 0 100vmax;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px;
  font-size: 14px; line-height: 1.7; color: #B8BBC8;
}
footer.site p { margin: 0; max-width: 60ch; }
footer.site .mark { display: block; margin-bottom: 18px; line-height: 0; }
footer.site .mark img { height: 40px; width: auto; }
footer.site a { color: #fff; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer-name { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px !important; }
.footer-name b { font: 600 17px/1.3 var(--sans); color: #fff; }
.footer-name span { color: #B8BBC8; }
footer.site nav a { color: #D9DBE4; text-decoration: none; }
footer.site nav a:hover { color: #fff; text-decoration: underline; }

/* ------------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  nav.top { column-gap: 20px; padding-block: 20px 12px; }
  nav.top .brand { gap: 12px; }
  nav.top .brand img { height: 30px; }
  .brand-name { padding-left: 12px; }
  .brand-name b { font-size: 13.5px; }
  .brand-name span { font-size: 11.5px; }
  /* The full menu sits behind the Цэс button; groups become indented lists. */
  .nav-toggle { display: inline-block; }
  .nav-links { display: none; flex-direction: column; align-items: stretch; row-gap: 0; padding-bottom: 12px; }
  nav.top.menu-open .nav-links { display: flex; }
  nav.top .nav-links > a { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
  nav.top .nav-links > a.active { border-bottom: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--hue); padding-left: 12px; }
  .nav-group { border-bottom: 1px solid var(--line); }
  .nav-group-btn { width: 100%; justify-content: space-between; padding: 11px 0; border-bottom: 0; font-size: 16px; }
  .nav-group.active .nav-group-btn { border-bottom: 0; }
  .nav-menu { position: static; min-width: 0; padding: 0 0 8px; border: 0; box-shadow: none; background: none; }
  nav.top .nav-menu a { padding: 8px 0 8px 16px; font-size: 15px; white-space: normal; }
}
@media (max-width: 520px) {
  /* One column on a phone: logo and name, then the join button and sign-in,
     then the section links. Side by side, the button sat on top of the name. */
  nav.top { grid-template-columns: minmax(0, 1fr); row-gap: 14px; }
  .nav-actions { gap: 16px; }
  nav.top a.nav-join { padding: 7px 12px; font-size: 13.5px; }
  /* The English name returns in the footer; on a phone the masthead keeps the Mongolian one. */
  .brand-name span { display: none; }
  .brand-name b { font-size: 13px; }
  nav.top a.nav-auth { margin-left: 0; }
  header.page { padding-block: 32px 24px; }
  .stats { margin-top: 28px; }
  th, td { padding: 12px 6px; }
  td.rank { width: 40px; padding-right: 10px; font-size: 18px; }
  .grid-2 { gap: 64px; }
  .grid-2 .card.wide { grid-column: auto; }
}

/* Handle and categories under a channel name, spaced rather than dot-joined. */
.handle > span + span { margin-left: 14px; }

/* ===================================================================== home */

/* The masthead statement. The largest type on the site, and the only place it
   is this large: everything else defers to it. */
.hero { padding-block: clamp(56px, 10vw, 140px) clamp(56px, 8vw, 120px); }
.hero h1 {
  /* 19ch, measured rather than guessed: a ch is the width of "0" in Spectral,
     narrower than Cyrillic letters at this size, so 12ch and then 16ch both
     still broke the title into four lines. */
  margin: 0; max-width: 19ch;
  font: 300 clamp(48px, 8.2vw, 116px)/0.98 var(--serif);
  letter-spacing: -0.028em;
  color: var(--text);
}
.hero .standfirst {
  margin: 38px 0 0; max-width: 58ch;
  font: 400 clamp(19px, 1.9vw, 24px)/1.55 var(--serif);
  color: var(--muted);
}

/* The signature graphic: concentration of attention. */
/* On a dark band: the one place the site turns the lights down, so the finding
   it carries is the most prominent thing on the homepage. */
.signature {
  padding-block: 96px 88px; color: #F3F1EC;
  border-image: linear-gradient(var(--night), var(--night)) fill 0 / 0 / 0 100vmax;
}
.signature .caption { color: #B8BBC8; }
.statement {
  margin: 0 0 48px; max-width: 26ch;
  font: 300 clamp(30px, 3.6vw, 48px)/1.15 var(--serif);
  letter-spacing: -0.015em;
}
.concentration svg { display: block; overflow: visible; }
.s-row { font: 500 14px var(--sans); fill: #B8BBC8; }
.s-big { font: 400 32px var(--serif); fill: #fff; font-variant-numeric: lining-nums; }
.s-small { font: 400 14px var(--sans); fill: #B8BBC8; }
@media (max-width: 620px) { .s-big { font-size: 24px; } }
.caption { margin: 18px 0 0; max-width: 64ch; font-size: 14px; line-height: 1.6; color: var(--muted); }

/* Two leaderboards. Rank order is a real sequence, so rank numerals are set in
   the display face; long channel names truncate rather than push the figures
   out of their column. */
.boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
  gap: 48px clamp(40px, 6vw, 96px);
  padding-block: 104px 24px;
}
.board-col h2 {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin: 0 0 6px; padding-bottom: 16px;
  font: 400 clamp(22px, 2vw, 28px)/1.25 var(--serif);
  letter-spacing: -0.008em;
  border-bottom: 3px solid var(--coral);
}
.board-col + .board-col h2 { border-bottom-color: var(--teal); }
.board-unit { font: 400 13px var(--sans); color: var(--dim); letter-spacing: 0; white-space: nowrap; }
ol.board { list-style: none; margin: 0; padding: 0; }
ol.board li {
  display: grid; grid-template-columns: 40px 40px minmax(0, 1fr) auto;
  align-items: center; gap: 16px;
  padding-block: 13px;
  border-bottom: 1px solid var(--line);
}
.b-rank { font: 400 26px/1 var(--serif); color: var(--dim); text-align: right; }
/* The podium takes the brand inks. */
ol.board li:nth-child(1) .b-rank { color: var(--coral-ink); }
ol.board li:nth-child(2) .b-rank { color: var(--saffron-ink); }
ol.board li:nth-child(3) .b-rank { color: var(--teal-ink); }
ol.board .av { width: 40px; height: 40px; border-radius: 50%; background: var(--panel-2); display: block; }
.b-who { min-width: 0; display: flex; flex-direction: column; }
.b-who a {
  color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.b-who a:hover { color: var(--accent); text-decoration: underline; }
.b-cat { font-size: 13px; color: var(--muted); margin-top: 1px; }
.b-val { text-align: right; white-space: nowrap; font-size: 17px; font-variant-numeric: tabular-nums lining-nums; }
.b-unit { display: block; font-size: 12px; color: var(--dim); }
.board-more { grid-column: 1 / -1; margin: 4px 0 0; font-size: 15px; }

/* The analysis index. Not numbered: the seven studies are not a sequence. */
.index { padding-block: 120px 56px; }
.index h2 { margin: 0; font: 300 clamp(36px, 4.4vw, 56px)/1.05 var(--serif); letter-spacing: -0.02em; }
.index-lead { margin: 18px 0 48px; max-width: 56ch; font: 400 19px/1.6 var(--serif); color: var(--muted); }
.index-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  column-gap: clamp(32px, 5vw, 72px);
}
.index-list a { display: block; padding-block: 24px 28px; border-top: 4px solid var(--c, var(--cobalt)); text-decoration: none; }
.index-list li:nth-child(5n+1) a { --c: var(--saffron); }
.index-list li:nth-child(5n+2) a { --c: var(--magenta); }
.index-list li:nth-child(5n+3) a { --c: var(--coral); }
.index-list li:nth-child(5n+4) a { --c: var(--teal); }
.index-list li:nth-child(5n+5) a { --c: var(--cobalt); }
.index-title { display: block; font: 400 25px/1.25 var(--serif); color: var(--text); letter-spacing: -0.008em; }
.index-blurb { display: block; margin-top: 8px; max-width: 44ch; font-size: 15px; line-height: 1.55; color: var(--muted); }
.index-list a:hover .index-title { text-decoration: underline; text-decoration-color: var(--c); text-decoration-thickness: 3px; text-underline-offset: 6px; }

@media (max-width: 760px) {
  .hero { padding-block: 40px 36px; }
  .signature { padding-block: 48px 24px; }
  .boards { padding-block: 64px 16px; }
  ol.board li { grid-template-columns: 30px 34px minmax(0, 1fr) auto; gap: 12px; }
  ol.board .av { width: 34px; height: 34px; }
  .b-rank { font-size: 21px; }
  .index { padding-block: 72px 32px; }
}

/* ========================================================= analysis hub */
.index-hub { padding-block: 56px 24px; }
.index-hub + .index-hub { padding-top: 88px; }
main.home > .index-hub:last-child { padding-bottom: 96px; }

/* ================================================================ prose */
/* Long-form pages (Арга зүй). Section headings sit in a left column and the
   text in a measured right column, so the page scans by topic and reads as a
   document rather than a web form. */
main.prose {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding: 0 var(--gutter) 96px;
}
main.prose section {
  display: grid; grid-template-columns: minmax(200px, 4fr) minmax(0, 8fr);
  gap: 16px clamp(32px, 5vw, 80px);
  padding-block: 52px;
  border-top: 1px solid var(--rule-strong);
}
/* The masthead band already separates the first section. */
main.prose section:first-child { border-top: 0; padding-top: 12px; }
main.prose h2 {
  margin: 0;
  font: 300 clamp(26px, 2.6vw, 34px)/1.15 var(--serif);
  letter-spacing: -0.012em;
}
main.prose p { margin: 0 0 20px; max-width: 64ch; font: 400 19px/1.72 var(--serif); color: var(--text); }
main.prose p:last-child { margin-bottom: 0; }
main.prose dl { margin: 0; max-width: 64ch; }
main.prose dt { font: 600 16px/1.4 var(--sans); color: var(--text); margin-top: 26px; }
main.prose dt:first-child { margin-top: 4px; }
main.prose dd { margin: 6px 0 0; font: 400 18px/1.65 var(--serif); color: var(--muted); }
@media (max-width: 760px) {
  main.prose section { grid-template-columns: 1fr; padding-block: 36px; }
}

/* ============================================================ benchmark */
/* One channel against its peers (benchmark.html). */
.wrap-col {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.bm-search { position: relative; margin-top: 36px; max-width: 620px; }
.bm-label { display: block; margin-bottom: 8px; font-size: 15px; color: var(--muted); }
.bm-search input { width: 100%; min-height: 54px; font-size: 18px; padding: 12px 16px; border-color: var(--rule-strong); }
.bm-results {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px);
  margin: 0; padding: 6px 0; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 18px 40px rgba(26, 28, 46, 0.14);
}
.bm-results a {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 16px; color: var(--text); text-decoration: none;
}
.bm-results a:hover, .bm-results a:focus-visible { background: var(--hue-tint); }
.bm-results b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-results small { color: var(--muted); font-size: 13px; }
.bm-results .n { color: var(--muted); font-size: 14px; }
.bm-results .none { padding: 12px 16px; color: var(--muted); }
.bm-status { color: var(--muted); font-size: 16px; }
.bm-status:empty { display: none; }

.bm-channel { display: flex; gap: 20px; align-items: center; }
.bm-channel .av { width: 72px; height: 72px; }
.bm-channel h2 { margin: 0; font: 400 clamp(28px, 3vw, 40px)/1.1 var(--serif); }
.bm-channel h2 a { color: var(--text); text-decoration: none; }
.bm-channel h2 a:hover { text-decoration: underline; }
.bm-channel p { margin: 6px 0 0; color: var(--muted); }
.bm-channel p span { margin-left: 18px; }
.bm-peers { margin: 24px 0 0; max-width: 72ch; font-size: 16px; line-height: 1.65; color: var(--muted); }
.bm-peers b { color: var(--text); font-weight: 600; }
.bm-sample { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; font-size: 14px; }
.bm-sample a { color: var(--muted); }

.bm-highlights { margin-top: 48px; display: grid; gap: 14px; max-width: 76ch; }
.bm-highlights p {
  margin: 0; padding: 14px 20px; border-left: 4px solid var(--hue);
  background: var(--panel); font: 400 19px/1.55 var(--serif); color: var(--muted);
}
.bm-highlights b { color: var(--text); font-weight: 600; }

.bm-h2 { margin: 88px 0 10px; font: 400 clamp(26px, 2.6vw, 34px)/1.15 var(--serif); letter-spacing: -0.01em; }
.bm-lead { margin: 0 0 24px; max-width: 70ch; color: var(--muted); font-size: 15.5px; line-height: 1.6; }

.bm-card { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text); }
.bm-metric {
  display: grid; align-items: center;
  grid-template-columns: minmax(200px, 1.3fr) minmax(150px, .8fr) minmax(180px, 1.4fr) minmax(170px, 1fr);
  gap: 12px 32px; padding-block: 20px; border-bottom: 1px solid var(--line);
}
.bm-name b { display: block; font-weight: 500; font-size: 16px; }
.bm-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; }
.bm-me { display: block; font: 400 30px/1.05 var(--serif); font-variant-numeric: lining-nums; }
.bm-med { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.bm-track {
  position: relative; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg, var(--panel-2), #D6D0C3);
}
.bm-mid { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 2px; background: var(--rule-strong); }
.bm-dot {
  position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--cobalt); box-shadow: 0 0 0 3px var(--bg);
}
.bm-metric.good .bm-dot { background: var(--teal); }
.bm-metric.low .bm-dot { background: var(--coral); }
.bm-pct { font-size: 14.5px; color: var(--muted); }
.bm-metric.good .bm-pct { color: var(--teal-ink); font-weight: 500; }
.bm-metric.low .bm-pct { color: var(--coral-ink); font-weight: 500; }

#out .grid-2 { padding-block: 88px 0; }
.bm-table { padding-bottom: 0; padding-inline: 0; }
.nw { white-space: nowrap; }
.bm-table td.bm-title { max-width: 520px; }
.bm-table td.bm-title a { color: var(--text); text-decoration: none; }
.bm-table td.bm-title a:hover { text-decoration: underline; }
.bm-ratio { font-weight: 500; }
.bm-ratio.up { color: var(--teal-ink); }
.bm-ratio.down { color: var(--coral-ink); }

.bm-breakouts { list-style: none; margin: 0; padding: 0; counter-reset: b; border-top: 2px solid var(--text); }
.bm-breakouts li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px;
  padding-block: 16px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.bm-breakouts li > a { flex-basis: 100%; color: var(--text); font-size: 16px; font-weight: 500; text-decoration: none; }
.bm-breakouts li > a:hover { text-decoration: underline; }
.bm-breakouts b { color: var(--teal-ink); font-weight: 500; }
.bm-breakouts .none { display: block; }
#out > .note { margin-top: 88px; }
.bm-summary { display: grid; gap: 10px; max-width: 76ch; margin: 0 0 28px; }
.bm-summary:empty { display: none; }
.bm-summary p { margin: 0; padding: 12px 18px; border-left: 4px solid var(--hue); background: var(--panel); font: 400 18px/1.55 var(--serif); color: var(--muted); }
.bm-summary b { color: var(--text); font-weight: 600; }
.bm-bars { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--text); }
.bm-bars li {
  display: grid; grid-template-columns: minmax(150px, 1fr) minmax(200px, 3fr) 90px minmax(110px, 1fr);
  gap: 8px 24px; align-items: center; padding-block: 14px; border-bottom: 1px solid var(--line);
}
.bm-bar-label { font-weight: 500; }
.bm-bar-track { position: relative; height: 22px; background: var(--panel-2); border-radius: 2px; }
.bm-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cobalt); border-radius: 2px; }
.bm-bars li.up .bm-bar-fill { background: var(--teal); }
.bm-bars li.down .bm-bar-fill { background: var(--coral); }
.bm-bar-base { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text); z-index: 1; }
.bm-bar-val { text-align: right; font: 400 22px/1 var(--serif); font-variant-numeric: lining-nums; }
.bm-bars li.thin .bm-bar-val { font: 400 13px var(--sans); color: var(--dim); }
.bm-bar-mine { font-size: 14px; color: var(--muted); }
.bm-caveat { margin: 18px 0 0; max-width: 72ch; font-size: 14px; line-height: 1.6; color: var(--dim); }
@media (max-width: 760px) {
  .bm-bars li { grid-template-columns: 1fr auto; }
  .bm-bar-track { grid-column: 1 / -1; grid-row: 2; }
  .bm-bar-mine { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .bm-metric { grid-template-columns: 1fr auto; }
  .bm-track, .bm-pct { grid-column: 1 / -1; }
}

/* ============================================================ forms */
/* The association's public forms (join, contact). One look for all of them. */
.form { max-width: 640px; }
.form .field { margin: 0 0 22px; }
.form label, .form legend { display: block; margin: 0 0 8px; font-size: 15px; color: var(--text); font-weight: 500; }
.form .hint { display: block; margin: -2px 0 8px; font-size: 13.5px; color: var(--muted); font-weight: 400; }
.form input[type=text], .form input[type=email], .form select, .form textarea {
  width: 100%; min-height: 50px; font-size: 16px; padding: 11px 14px; border-color: var(--rule-strong);
}
.form textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.form fieldset { border: 0; margin: 0 0 22px; padding: 0; }
.form .choice { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.form .choice label, .form .consent label { display: inline-flex; align-items: flex-start; gap: 10px; margin: 0; font-weight: 400; cursor: pointer; }
.form .choice input, .form .consent input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.form .consent { margin: 8px 0 24px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.form button[type=submit] { padding: 13px 26px; font: 500 16px/1 var(--sans); color: #fff; background: var(--accent); border: 0; border-radius: 2px; min-height: 0; }
.form button[type=submit]:hover { background: var(--accent-hover); }
.form button[disabled] { opacity: .6; cursor: default; }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 22px 0 0; padding: 12px 18px; border-left: 4px solid var(--hue); background: var(--panel); font-size: 16px; line-height: 1.55; }
.form-msg.error { border-left-color: var(--bad); }
.form-msg[hidden] { display: none !important; }

/* A bullet list inside prose pages, for what an association offers. */
main.prose ul.points { margin: 0; padding: 0; list-style: none; max-width: 64ch; }
main.prose ul.points li { position: relative; padding: 0 0 14px 22px; font: 400 18px/1.65 var(--serif); color: var(--text); }
main.prose ul.points li::before { content: ""; position: absolute; left: 0; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); }
main.prose .cta { display: inline-block; margin-top: 8px; padding: 13px 24px; background: var(--accent); color: #fff; text-decoration: none; font: 500 16px/1 var(--sans); border-radius: 2px; }
main.prose .cta:hover { background: var(--accent-hover); color: #fff; }

/* Membership invitation band on the homepage. */
.join-band { padding-block: 72px; border-image: linear-gradient(var(--coral-tint), var(--coral-tint)) fill 0 / 0 / 0 100vmax; }
.join-band h2 { margin: 0 0 14px; max-width: 24ch; font: 300 clamp(30px, 3.4vw, 44px)/1.12 var(--serif); letter-spacing: -0.015em; }
.join-band p { margin: 0 0 26px; max-width: 58ch; font: 400 19px/1.6 var(--serif); color: var(--muted); }
.join-band a.cta { display: inline-block; padding: 14px 26px; background: var(--text); color: #fff; text-decoration: none; font: 500 16px/1 var(--sans); border-radius: 2px; }
.join-band a.cta:hover { background: var(--accent); }
.join-band a.more { margin-left: 22px; font-size: 16px; }

/* Masthead call to action. */
.nav-actions { display: flex; align-items: center; gap: 22px; }
nav.top .nav-actions a.nav-auth { margin-left: 0; }
nav.top a.nav-join { padding: 9px 16px; border: 1.5px solid var(--text); border-radius: 2px; font-size: 14px; color: var(--text); text-decoration: none; }
nav.top a.nav-join:hover { background: var(--text); color: #fff; }

/* A channel or streamer photo beside its name in a table cell. */
.who { display: flex; align-items: center; gap: 12px; }
.who .av { width: 36px; height: 36px; flex: none; border-radius: 50%; display: block; background: var(--panel-2); }

/* Dense line series: invisible hit targets that appear under the cursor. */
.chart .ch-dot.dense { stroke: none; }
.chart .ch-dot.dense:hover { fill-opacity: 1; stroke: var(--bg); stroke-width: 2; }
