:root {
  --paper: #f2efe6;
  --ink: #11110f;
  --muted: #6d6a62;
  --line: rgba(17, 17, 15, 0.2);
  --cobalt: #2855ff;
  --signal: #ff4f2f;
  --acid: #d9ff43;
  --violet: #ad7bff;
  --amber: #ffbd2e;
  --card: #f8f6ef;
  --sans: Arial, Helvetica, sans-serif;
  --condensed: "Arial Narrow", "Helvetica Neue Condensed", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; background: var(--ink); color: white; padding: .8rem 1rem; }
.skip-link:focus { top: 1rem; }
.site-header { height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 3.5vw; border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.wordmark { display: inline-flex; align-items: center; gap: .45rem; width: max-content; text-decoration: none; font-family: var(--condensed); font-weight: 900; letter-spacing: -.07em; font-size: 1.1rem; }
.wordmark i { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.site-header nav { display: flex; gap: 2rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }
.site-header nav a { text-decoration: none; border-bottom: 1px solid transparent; padding: .3rem 0; }
.site-header nav a:hover { border-color: currentColor; }
.live-pill { justify-self: end; display: flex; align-items: center; gap: .55rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 2rem; font: 700 .68rem/1 var(--sans); text-transform: uppercase; letter-spacing: .07em; }
.live-pill span, .sync-dot { width: 8px; height: 8px; background: #16a45b; border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,164,91,.12); }

.hero { min-height: 650px; position: relative; overflow: hidden; padding: 8vh 3.5vw 4rem; border-bottom: 1px solid var(--line); }
.hero-kicker, .eyebrow { display: block; font: 700 .68rem/1.2 var(--sans); letter-spacing: .15em; text-transform: uppercase; }
.hero h1 { position: relative; z-index: 2; margin: 4vh 0 2rem; font-family: var(--condensed); font-size: clamp(4.6rem, 11.7vw, 11rem); font-weight: 900; letter-spacing: -.085em; line-height: .76; text-transform: uppercase; }
.hero h1 span { display: block; }
.hero h1 span:last-child { margin-left: 12vw; color: var(--cobalt); }
.hero-lower { position: relative; z-index: 2; width: min(730px, 62vw); margin-left: auto; display: flex; align-items: end; gap: 4rem; }
.hero-lower p { margin: 0; max-width: 580px; font-size: clamp(1rem, 1.55vw, 1.35rem); line-height: 1.4; letter-spacing: -.02em; }
.round-link { width: 58px; height: 58px; flex: 0 0 58px; border: 1px solid var(--ink); border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-size: 1.4rem; transition: .2s ease; }
.round-link:hover { background: var(--ink); color: var(--paper); transform: translateY(3px); }
.court-lines { position: absolute; inset: 0; opacity: .38; pointer-events: none; }
.court-lines::before, .court-lines::after, .court-lines i { content: ""; position: absolute; border-color: rgba(40,85,255,.32); }
.court-lines::before { width: 32vw; height: 32vw; right: -5vw; top: 1vw; border: 1px solid rgba(40,85,255,.35); border-radius: 50%; }
.court-lines::after { width: 19vw; height: 19vw; left: 3vw; bottom: -13vw; border: 1px solid rgba(255,79,47,.45); border-radius: 50%; }
.court-lines i:nth-child(1) { width: 60vw; border-top: 1px solid var(--line); transform: rotate(-21deg); left: 32vw; top: 43%; }
.court-lines i:nth-child(2) { height: 100%; border-left: 1px solid var(--line); left: 54%; top: 0; }
.court-lines i:nth-child(3) { width: 22px; height: 22px; background: var(--acid); border-radius: 50%; left: 10%; top: 19%; }

.ledger { display: grid; grid-template-columns: repeat(3, 1fr) 1.55fr; min-height: 118px; border-bottom: 1px solid var(--line); }
.ledger > div { padding: 1.6rem 3.5vw; border-right: 1px solid var(--line); display: flex; align-items: baseline; gap: .65rem; }
.ledger > div:last-child { border: 0; }
.ledger strong { font-family: var(--condensed); font-size: 2.5rem; letter-spacing: -.08em; }
.ledger > div > span:not(.sync-dot) { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.ledger .sync-cell { align-items: center; gap: 1rem; }
.sync-cell p { margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.sync-cell b { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.sync-cell time { color: var(--muted); font-size: .78rem; }

.rankings-section { padding: 8rem 3.5vw; }
.section-heading { display: grid; grid-template-columns: 1.25fr .75fr; gap: 3rem; align-items: end; margin-bottom: 3rem; }
.section-heading h2, .method h2 { margin: .9rem 0 0; font-family: var(--condensed); font-size: clamp(3.6rem, 7.5vw, 7rem); line-height: .82; letter-spacing: -.075em; text-transform: uppercase; }
.section-heading p { max-width: 430px; margin: 0; color: var(--muted); line-height: 1.55; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 2.2rem; }
.filter-group { display: flex; gap: .45rem; }
.filter { border: 1px solid transparent; background: transparent; padding: .65rem .9rem; border-radius: 2rem; cursor: pointer; font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.filter:hover { border-color: var(--line); }
.filter.active { background: var(--ink); color: var(--paper); }
.search { position: relative; display: flex; align-items: center; gap: .7rem; }
.search > span { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.search input { width: 260px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: .6rem 2rem .6rem .1rem; outline: none; font-size: .82rem; }
.search input:focus { border-color: var(--ink); }
.search kbd { position: absolute; right: .2rem; border: 1px solid var(--line); border-radius: 3px; padding: .05rem .3rem; background: transparent; color: var(--muted); font-size: .7rem; }
.ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.3rem; }
.sport-card { --accent: var(--cobalt); min-width: 0; background: var(--card); border: 1px solid var(--ink); border-radius: 2px; overflow: hidden; animation: rise .45s both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.sport-card[data-accent="signal"] { --accent: var(--signal); }
.sport-card[data-accent="acid"] { --accent: var(--acid); }
.sport-card[data-accent="violet"] { --accent: var(--violet); }
.sport-card[data-accent="amber"] { --accent: var(--amber); }
.card-header { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.1rem; border-bottom: 1px solid var(--line); }
.card-header > div { display: flex; gap: 1rem; align-items: center; }
.sport-number, .type-label { font: 700 .65rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; }
.type-label { color: var(--muted); }
.sport-mark { width: 31px; height: 31px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font: 900 .63rem/1 var(--condensed); letter-spacing: -.03em; }
.card-title-row { display: grid; grid-template-columns: .8fr 1.2fr; align-items: end; gap: 1rem; padding: 1.4rem 1.1rem 1.2rem; }
.card-title-row h3 { margin: 0; font-family: var(--condensed); font-size: clamp(2rem, 3.5vw, 3.4rem); letter-spacing: -.07em; line-height: .83; text-transform: uppercase; }
.card-description { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.variant-tabs { display: flex; gap: .35rem; overflow-x: auto; padding: 0 1.1rem 1rem; scrollbar-width: none; }
.variant-tabs::-webkit-scrollbar { display: none; }
.variant-tab { white-space: nowrap; border: 1px solid var(--line); background: transparent; border-radius: 2rem; padding: .5rem .72rem; cursor: pointer; font-size: .67rem; font-weight: 700; }
.variant-tab[aria-selected="true"] { border-color: var(--ink); background: var(--accent); }
.source-bar { min-height: 42px; padding: .7rem 1.1rem; background: var(--ink); color: white; display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .67rem; }
.source-bar > span { display: flex; align-items: center; gap: .45rem; }
.source-bar .status-dot { width: 6px; height: 6px; border-radius: 50%; background: #36d780; }
.source-bar .stale { background: var(--amber); }
.source-bar a { color: white; text-underline-offset: 3px; }
.source-bar time { color: #bbb; white-space: nowrap; }
.podium { display: grid; grid-template-columns: 1.15fr 1fr 1fr; border-bottom: 1px solid var(--line); }
.podium-place { min-width: 0; padding: 1.2rem 1rem 1rem; border-right: 1px solid var(--line); min-height: 154px; display: flex; flex-direction: column; }
.podium-place:last-child { border-right: 0; }
.podium-place:first-child { background: var(--accent); }
.place-rank { font: 900 1.8rem/1 var(--condensed); letter-spacing: -.08em; }
.podium-place strong { margin-top: auto; display: block; font-family: var(--condensed); font-size: clamp(1rem, 1.8vw, 1.45rem); letter-spacing: -.04em; line-height: .96; overflow-wrap: anywhere; }
.country { display: flex; align-items: center; gap: .38rem; margin-top: .45rem; color: var(--muted); font-size: .64rem; text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
.podium-place:first-child .country { color: rgba(17,17,15,.65); }
.flag { font-size: .85rem; line-height: 1; }
.table-head, .rank-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) 92px 52px; align-items: center; padding: 0 1.1rem; }
.table-head { height: 35px; color: var(--muted); font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; border-bottom: 1px solid var(--line); }
.table-head span:nth-last-child(-n+2) { text-align: right; }
.rank-row { min-height: 52px; border-bottom: 1px solid var(--line); font-size: .76rem; }
.rank-row:hover { background: rgba(255,255,255,.55); }
.row-rank { font: 900 1.05rem/1 var(--condensed); }
.row-name { min-width: 0; }
.row-name strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name .country { margin-top: .2rem; }
.row-points, .movement { text-align: right; font-variant-numeric: tabular-nums; }
.row-points { font-weight: 700; }
.movement { font-size: .68rem; color: var(--muted); }
.movement.up { color: #0a8a4a; }
.movement.down { color: #d23c2a; }
.expand-button { width: 100%; height: 47px; border: 0; background: transparent; cursor: pointer; font-size: .67rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.expand-button:hover { background: var(--ink); color: white; }
.integrity-mini { margin: 0; padding: .8rem 1.1rem; color: var(--muted); background: #ebe8de; font-size: .63rem; line-height: 1.4; border-top: 1px solid var(--line); }
.loading-state { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); }
.loading-state span { width: 30px; height: 30px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 5rem 0; text-align: center; color: var(--muted); }

.method { padding: 8rem 3.5vw; background: var(--ink); color: var(--paper); display: grid; grid-template-columns: .9fr 1.1fr; gap: 7vw; }
.method .eyebrow { color: var(--acid); }
.method-lead { margin: 0 0 4rem; font-size: clamp(1.25rem, 2.3vw, 2rem); line-height: 1.25; letter-spacing: -.035em; }
.method-steps { border-top: 1px solid rgba(255,255,255,.28); }
.method-steps article { display: grid; grid-template-columns: 45px 110px 1fr; align-items: start; gap: 1rem; padding: 1.3rem 0; border-bottom: 1px solid rgba(255,255,255,.2); }
.method-steps b { color: var(--acid); font-size: .7rem; }
.method-steps h3 { margin: 0; font-family: var(--condensed); font-size: 1.1rem; text-transform: uppercase; }
.method-steps p { margin: 0; color: #aaa89f; font-size: .8rem; line-height: 1.5; }
.integrity-note { margin: 2rem 0 0; padding-left: 1rem; border-left: 3px solid var(--signal); color: #aaa89f; font-size: .72rem; line-height: 1.5; }
.integrity-note span { color: white; font-weight: 700; }
footer { min-height: 130px; padding: 2rem 3.5vw; display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; border-top: 1px solid var(--line); }
footer p { margin: 0; color: var(--muted); font-size: .72rem; }
footer p:nth-child(2) { text-align: center; text-transform: uppercase; letter-spacing: .08em; }
footer p:last-child { justify-self: end; max-width: 290px; text-align: right; line-height: 1.4; }

@media (max-width: 900px) {
  .hero { min-height: 560px; }
  .hero h1 span:last-child { margin-left: 0; }
  .hero-lower { width: 100%; }
  .ledger { grid-template-columns: repeat(3, 1fr); }
  .ledger .sync-cell { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .ranking-grid { grid-template-columns: 1fr; }
  .method { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .site-header { grid-template-columns: 1fr auto; height: 64px; }
  .site-header nav { display: none; }
  .hero { min-height: 520px; padding-top: 3.5rem; }
  .hero h1 { margin-top: 3rem; font-size: clamp(4rem, 21vw, 6.2rem); line-height: .79; }
  .hero-lower { align-items: center; gap: 1.3rem; }
  .hero-lower p { font-size: .96rem; }
  .round-link { width: 48px; height: 48px; flex-basis: 48px; }
  .ledger > div { padding: 1.2rem 1rem; flex-direction: column; gap: .2rem; }
  .ledger strong { font-size: 2rem; }
  .ledger .sync-cell { flex-direction: row; padding-left: 1rem; }
  .rankings-section, .method { padding: 5.5rem 1rem; }
  .section-heading { grid-template-columns: 1fr; gap: 1.5rem; }
  .controls { align-items: stretch; flex-direction: column; }
  .filter-group { overflow-x: auto; }
  .search input { width: 100%; }
  .card-title-row { grid-template-columns: 1fr; }
  .podium { grid-template-columns: 1fr 1fr; }
  .podium-place:first-child { grid-column: 1 / -1; min-height: 130px; }
  .podium-place:nth-child(2) { border-top: 1px solid var(--line); }
  .podium-place:nth-child(3) { border-top: 1px solid var(--line); }
  .table-head, .rank-row { grid-template-columns: 34px minmax(0, 1fr) 66px 42px; padding: 0 .8rem; }
  .method-steps article { grid-template-columns: 32px 82px 1fr; }
  footer { grid-template-columns: 1fr; gap: 1.2rem; }
  footer p:nth-child(2), footer p:last-child { justify-self: start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
