/* /leaderboard and /proofs/category/:slug. Each section is one or two screens
   at 1440x900; the chase sizes to its rows, never to a fixed height. */

@layer components {
/* Hero: the score to beat, inside the seal */
.ar-hero--div h1 { font-size: clamp(40px, 4.7vw, 68px); line-height: 1; }
.ar-crumb { font-size: 16px; color: var(--ink-2); margin-bottom: 18px; }
.ar-crumb a { color: var(--ink-2); text-decoration: none; transition: color .15s; }
.ar-crumb a:hover { color: var(--ink); }
.ar-crumb b { color: var(--ink); font-weight: 600; }
.ar-hero--div .ar-hero__lead { max-width: 40ch; }
.ar-join { margin-top: 30px; max-width: 520px; }
.ar-target { grid-column: 7 / 13; position: relative; isolation: isolate; aspect-ratio: 1; justify-self: end;
  width: min(100%, 620px, calc(100svh - var(--nav-height) - 136px)); }
.ar-target__ring { position: absolute; inset: 0; border-radius: 50%; background: var(--accent-soft); z-index: -1; }
.ar-target__disc { position: absolute; inset: 6%; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 12%; }
.ar-target__n { font-size: clamp(110px, 15vw, 220px); font-weight: 800; letter-spacing: -.07em; line-height: .8; }
.ar-target__t { font-size: 18px; font-weight: 600; margin-top: 18px; }
.ar-target__s { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; margin-top: 8px; }
.ar-target__s .ar-logo { --ls: 24px; }
@media (max-width: 900px) {
  .ar-target { grid-column: 1 / -1; justify-self: center; width: min(380px, 30svh); }
  .ar-target__n { font-size: min(17vw, 13svh); }
  .ar-target__t { margin-top: 6px; font-size: 16px; }
  .ar-target__s { font-size: 14px; margin-top: 2px; }
}
@media (max-width: 639px) {
  .ar-join { margin-top: 20px; }
  .ar-target { width: min(240px, 26svh); }
  .ar-target__t, .ar-target__s .ar-logo { display: none; }
  .ar-hero--div .ar-hero__grid { row-gap: 16px; }
  .ar-hero--div .ar-target { width: min(180px, 21svh); }
}

/* The division switch: real links, one per division */
.ar-divs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ar-divs a { display: inline-flex; align-items: baseline; gap: 8px; background: var(--paper-2); border-radius: var(--ar-r);
  padding: 8px 13px; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; transition: background .15s, transform .14s var(--ease); }
.ar-divs a span { color: var(--ink-2); font-weight: 400; }
.ar-divs a:hover { background: var(--rule); }
.ar-divs a:active { transform: scale(.96); }
.ar-divs a[aria-current] { background: var(--accent); color: var(--accent-ink); }
.ar-divs a[aria-current] span { color: inherit; }
@media (max-width: 639px) { .ar-divs { gap: 6px; margin-bottom: 14px; } .ar-divs a { padding: 5px 9px; font-size: 14px; } }

/* The podium: a place numeral leads each step, the score is the medal on its top edge */
.ar-page > .ar-podium { height: 100svh; min-height: 760px; overflow: clip; }
.ar-podium .wrap { height: 100%; display: flex; flex-direction: column; }
.ar-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 8px 32px; margin-bottom: 18px; }
.ar-head p { color: var(--ink-2); font-size: 17px; max-width: 36em; text-align: right; }
.ar-route { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 15px; overflow-wrap: anywhere; }
.ar-mark { width: 18px; height: 18px; flex: none; }
.ar-steps { --who: 190px; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; align-items: end; }
.ar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; --md: 100px; }
.ar-c1 { order: 2; --k: 1; --md: 128px; --bg: var(--accent); --fg: var(--accent-ink); --fg2: var(--accent-ink); }
.ar-c2 { order: 1; --k: .78; --bg: var(--band); --fg: var(--band-ink); --fg2: var(--band-ink-2); }
.ar-c3 { order: 3; --k: .64; --bg: var(--paper-2); --fg: var(--ink); --fg2: var(--ink-2); }
.ar-who { flex: none; height: var(--who); display: flex; flex-direction: column; justify-content: flex-end; align-items: center; text-align: center; gap: 3px;
  padding: 0 8px calc(var(--md) / 2 + 14px); min-width: 0; }
.ar-nm { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; max-width: 100%; }
.ar-who .ar-logo { --ls: 40px; }
.ar-who .ar-site { font-size: clamp(19px, 1.8vw, 26px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; text-decoration: none;
  overflow-wrap: anywhere; min-width: 0; color: var(--ink); transition: color .15s; }
.ar-who .ar-site:hover { color: var(--accent); }
.ar-who .ar-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; line-clamp: 1; overflow: hidden;
  font-size: 15px; line-height: 1.35; color: var(--ink-2); max-width: 100%; }
.ar-eng { font-size: 15px; line-height: 1.35; color: var(--ink-2); }
.ar-block { position: relative; flex: none; height: calc((100% - var(--who)) * var(--k));
  background: var(--bg); color: var(--fg); padding: calc(var(--md) / 2 + 14px) 24px 20px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; box-shadow: inset 0 1px 0 var(--band-edge); }
.ar-medal { position: absolute; left: 50%; top: 0; width: var(--md); height: var(--md); transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1; box-shadow: 0 0 0 6px var(--paper); }
.ar-medal b { font-size: calc(var(--md) * .46); font-weight: 800; letter-spacing: -.06em; line-height: .86; }
.ar-medal span { font-size: 14px; font-weight: 600; margin-top: 3px; }
.ar-c1 .ar-medal { background: var(--panel); color: var(--ink); }
.ar-num { display: flex; align-items: flex-end; gap: 14px; line-height: 1; }
.ar-num b { font-size: clamp(96px, 11vw, 150px); font-weight: 800; letter-spacing: -.02em; line-height: .76; }
.ar-num span { font-size: 22px; font-weight: 700; letter-spacing: -.02em; padding-bottom: 2px; }
.ar-m { font-size: 15px; color: var(--fg2); }
.ar-c1 .ar-block { border-top-left-radius: 50% 96px; border-top-right-radius: 50% 96px; align-items: center; text-align: center; }
.ar-c1 .ar-num { flex-direction: column; align-items: center; gap: 12px; }
.ar-c1 .ar-num b { font-size: clamp(110px, 13vw, 190px); }
.ar-c2 .ar-block { border-top-left-radius: 96px; padding-left: 36px; }
.ar-c3 .ar-block { border-top-right-radius: 96px; align-items: flex-end; text-align: right; padding-right: 36px; }
.ar-c3 .ar-num { flex-direction: row-reverse; }
@media (min-width: 640px) and (max-width: 1279px) {
  .ar-page > .ar-podium { height: 100svh; min-height: 0; }
  .ar-steps { --who: 160px; }
  .ar-col { --md: 84px; } .ar-c1 { --md: 104px; }
  .ar-block { padding-inline: 16px; }
  .ar-who .ar-desc { display: none; }
  .ar-num { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ar-c1 .ar-num { align-items: center; }
  .ar-c3 .ar-num { flex-direction: column; align-items: flex-end; }
  .ar-c2 .ar-block { padding-left: 20px; } .ar-c3 .ar-block { padding-right: 20px; }
  .ar-num span { font-size: 17px; }
  .ar-who .ar-logo { --ls: 32px; } .ar-nm { gap: 8px; } .ar-eng { font-size: 14px; }
}
@media (max-width: 639px) {
  .ar-page > .ar-podium { height: auto; min-height: 100lvh; display: flex; flex-direction: column; padding: 48px 0 24px; }
  .ar-podium .wrap { flex: 1 1 auto; height: auto; }
  .ar-steps { margin-top: auto; }
  .ar-head { margin-bottom: 12px; }
  .ar-head p { text-align: left; font-size: 15px; }
  .ar-route { flex-direction: row-reverse; justify-content: flex-end; }
  .ar-steps { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex: none; }
  .ar-col { order: 0; height: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 14px; align-items: center;
    background: var(--bg); color: var(--fg); padding: 10px 14px; border-radius: var(--ar-r); box-shadow: inset 0 1px 0 var(--band-edge); --md: 66px; }
  .ar-block { display: contents; }
  .ar-num { grid-column: 1; grid-row: 1 / 3; flex-direction: column !important; align-items: center; min-width: 36px; }
  .ar-num b, .ar-c1 .ar-num b { font-size: 60px; }
  .ar-num span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ar-medal { position: static; transform: none; grid-column: 3; grid-row: 1 / 3; box-shadow: none; }
  .ar-medal span { font-size: 14px; margin-top: 2px; }
  .ar-who { grid-column: 2; grid-row: 1; height: auto; padding: 0; align-items: flex-start; text-align: left; gap: 1px; }
  .ar-nm { justify-content: flex-start; gap: 8px; }
  .ar-who .ar-logo { --ls: 24px; }
  .ar-who .ar-site { font-size: 17px; color: inherit; }
  .ar-who .ar-desc { display: none; }
  .ar-eng { color: var(--fg2); font-size: 14px; }
  .ar-m { grid-column: 2; grid-row: 2; text-align: left; font-size: 14px; }
}

/* The chase: every place below the podium */
.ar-ch-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; align-items: start; margin-bottom: 28px; }
.ar-ch-t { grid-column: 1 / 7; min-width: 0; }
.ar-ch-t > p { margin-top: 12px; color: var(--ink-2); font-size: 17px; max-width: 30em; }
.ar-ch-t > p.ar-key { font-size: 15px; margin-top: 8px; }
.ar-aside { grid-column: 7 / 13; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; align-items: start; }
.ar-ch-t:only-child { grid-column: 1 / -1; }
.ar-lab { font-size: 16px; font-weight: 600; color: var(--ink); }
.ar-moves ul { margin-top: 8px; }
.ar-moves li { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.ar-moves li b { color: var(--ink); font-weight: 600; }
.ar-up { color: var(--good); font-weight: 700; }
.ar-dn { color: var(--warn); font-weight: 700; }
.ar-say { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.ar-tier { min-width: 0; }
.ar-scale { position: relative; height: 64px; margin-top: 10px; }
.ar-scale__bar, .ar-scale__fill { position: absolute; left: 0; top: 28px; height: 8px; border-radius: 4px; }
.ar-scale__bar { right: 0; background: var(--paper-2); }
.ar-scale__fill { width: var(--p); background: var(--accent); transform-origin: left; }
.ar-scale__tk { position: absolute; top: 24px; height: 16px; width: 2px; background: var(--ink); left: var(--x); }
.ar-scale__n { position: absolute; top: 44px; left: var(--x); transform: translateX(-50%); font-size: 14px; line-height: 20px; color: var(--ink-2); }
.ar-scale__top { position: absolute; top: 0; left: clamp(48px, var(--p), calc(100% - 48px)); transform: translateX(-50%); font-size: 14px; line-height: 22px; font-weight: 700; white-space: nowrap; }
@media (max-width: 900px) {
  .ar-ch-t, .ar-aside { grid-column: 1 / -1; }
  .ar-ch-head { row-gap: 20px; }
  .ar-aside { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .ar-moves { grid-column: 1 / 7; }
  .ar-tier { grid-column: 7 / 13; }
}
@media (max-width: 639px) {
  .ar-aside { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ar-moves, .ar-tier { grid-column: 1 / -1; }
  .ar-ch-head { margin-bottom: 12px; }
  .ar-page > .ar-chase--long { min-height: 200lvh; }
}

.ar-board { min-width: 0; }
.ar-board table { width: 100%; border-collapse: collapse; font-size: 18px; table-layout: fixed; }
.ar-board th { text-align: left; font-weight: 500; font-size: 14px; color: var(--ink-2); padding: 0 12px 10px 0; border-bottom: 2px solid var(--ink); }
.ar-board th.ar-r { width: 4.6em; }
.ar-board th.ar-n { width: 5em; text-align: right; padding-right: 0; }
.ar-board td { padding: 18px 12px 18px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ar-board td.ar-r { font-weight: 800; font-size: 26px; letter-spacing: -.04em; line-height: 52px; }
.ar-board td.ar-n { text-align: right; white-space: nowrap; padding-right: 0; }
.ar-n b { display: block; font-weight: 800; font-size: 30px; letter-spacing: -.04em; line-height: 52px; }
.ar-n span { display: block; font-size: 14px; color: var(--ink-2); line-height: 1; }
.ar-row { display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.ar-row > div { min-width: 0; flex: 1; }
.ar-row .ar-logo { --ls: 52px; }
.ar-row .ar-site { display: inline-block; font-weight: 700; font-size: 20px; letter-spacing: -.02em; line-height: 1.25; overflow-wrap: anywhere;
  text-decoration: none; color: var(--ink); transition: color .15s; }
.ar-row .ar-site:hover { color: var(--accent); }
.ar-row .ar-desc { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  margin-top: 4px; font-size: 17px; line-height: 1.4; color: var(--ink-2); max-width: 64em; }
.ar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; font-size: 15px; color: var(--ink-2); }
.ar-chip { display: inline-block; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--rule); border-radius: var(--ar-r);
  padding: 3px 9px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; transition: background .15s; }
a.ar-chip:hover { background: var(--rule); }
.ar-chip--none { color: var(--ink-2); font-weight: 500; }
.ar-mv { font-size: 14px; font-weight: 600; }
.ar-board tbody tr { transition: background .15s; }
.ar-board tbody tr:hover td { background: var(--paper-2); }
.ar-more { margin-top: 14px; }
.ar-pages { margin-top: 24px; }
.ar-foot { margin-top: 16px; font-size: 17px; color: var(--ink-2); max-width: 62ch; }
.ar-prov { margin-top: 20px; font-size: 16px; color: var(--ink-2); }
.ar-prov summary { cursor: pointer; }
.ar-prov ul { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.ar-prov a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.ar-prov a:hover { color: var(--accent); }
.ar-prov .ar-logo { --ls: 24px; }
@media (min-width: 640px) and (max-width: 1279px) { .ar-page > .ar-chase--long { min-height: 200svh; } }
@media (min-width: 641px) {
  .ar-board table, .ar-board thead, .ar-board tbody, .ar-board th, .ar-board td { display: block; }
  .ar-board thead tr, .ar-board tbody tr { display: block; position: relative; }
  .ar-board th:nth-child(2), .ar-board td:nth-child(2) { padding-left: 4.6em; padding-right: 5em; }
  .ar-board th.ar-r, .ar-board td.ar-r { position: absolute; left: 0; top: 0; width: 4.6em; border: 0; }
  .ar-board th.ar-n, .ar-board td.ar-n { position: absolute; right: 0; top: 0; width: 5em; border: 0; }
  .ar-board tbody tr:hover td.ar-r, .ar-board tbody tr:hover td.ar-n { background: transparent; }
}
@media (max-width: 640px) {
  .ar-board table, .ar-board tbody, .ar-board tr, .ar-board td { display: block; }
  .ar-board thead { display: none; }
  .ar-board table { table-layout: auto; }
  .ar-board tbody tr { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 0 10px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
  .ar-board td { border: 0; padding: 0; }
  .ar-board tbody tr:hover td { background: transparent; }
  .ar-board td.ar-r { font-size: 22px; line-height: 40px; }
  .ar-n b { font-size: 26px; line-height: 40px; }
  .ar-row { gap: 12px; } .ar-row .ar-logo { --ls: 40px; }
  .ar-row .ar-site { font-size: 18px; } .ar-row .ar-desc { font-size: 15px; }
  .ar-meta { font-size: 14px; margin-top: 8px; } .ar-chip { font-size: 14px; }
  .ar-more { width: 100%; }
  .ar-foot { font-size: 15px; }
}
}

/* One-shot motion, unlayered so it beats the tg-rise utility. Reduced motion
   and no JavaScript show the finished state. */
@media screen and (prefers-reduced-motion: no-preference) {
  .ar-target__disc { animation: ar-grow 1.1s var(--ease) both; }
  .ar-target__ring { animation: ar-grow 1.4s var(--ease) both; }
  [data-reveal-ready] .ar-steps.tg-rise:not(.is-in) { opacity: 1; transform: none; }
  [data-reveal-ready] .ar-steps.tg-rise .ar-col { transition: transform .9s var(--ease); }
  [data-reveal-ready] .ar-steps.tg-rise:not(.is-in) .ar-col { transform: translateY(72px); }
  [data-reveal-ready] .ar-steps .ar-c2 { transition-delay: 140ms; }
  [data-reveal-ready] .ar-steps .ar-c1 { transition-delay: 320ms; }
  [data-reveal-ready] .ar-ch-head .ar-scale__fill { transition: transform 1s var(--ease) .3s; }
  [data-reveal-ready] .ar-ch-head.tg-rise:not(.is-in) .ar-scale__fill { transform: scaleX(0); }
}
@keyframes ar-grow { from { transform: scale(.82); opacity: .4; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .ar-divs a { transition: background .15s; }
  .ar-divs a:active { transform: none; }
}
