/* BMX 2000 wiki: a printed parts catalogue on screen. Flat paper and ink, hairline rules, one
   accent (signal orange, for marks and gains only), Inter at reading sizes, tables over cards.
   The game keeps its Y2K chrome; the site stays calm. Light only, like a catalogue page. */
:root {
  --bg: #f6f6f3;
  --paper: #ffffff;
  --tile: #e8e8e4;   /* part shots are flattened onto exactly this */
  --dark: #0f1114;   /* clothing shots keep their studio black */
  --ink: #141414;
  --ink-2: #3b3b38;
  --muted: #62625d;
  --rule: #dcdcd6;
  --rule-2: #c4c4be;
  --accent: #ff4f00;
  --accent-ink: #b83a00;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; text-wrap: balance; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 9; padding: 8px 12px; background: var(--ink); color: var(--paper); }
.skip:focus { top: 8px; }
.sub { color: var(--muted); font-size: 0.9em; font-weight: 400; }
.linkish { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; cursor: pointer; }
.wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
@media (min-width: 900px) { .wrap { width: min(1240px, 100% - 64px); } }

/* ── Header ── */
.top { border-bottom: 1px solid var(--rule); background: var(--bg); }
.top__in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-height: 52px; }
.top__id { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.top__id span { color: var(--rule-2); }
.top__logo { font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.top__wiki { color: var(--ink-2); text-decoration: none; }
.top__wiki[aria-current] { color: var(--ink); }
.top__nav { order: 5; display: flex; gap: 18px; width: 100%; padding: 2px 0 10px; overflow-x: auto; scrollbar-width: none; font-size: 14px; }
.top__nav::-webkit-scrollbar { display: none; }
.top__nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.top__nav a:hover { color: var(--ink); }
.top__nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.top__search, .top__cta { display: none; }
.top__find { margin-left: auto; display: grid; place-items: center; width: 36px; height: 36px; color: var(--ink); }
.i { width: 18px; height: 18px; fill: currentColor; }
@media (min-width: 900px) {
  .top__in { flex-wrap: nowrap; }
  .top__nav { order: 0; width: auto; padding: 0; overflow: visible; }
  .top__search { display: flex; margin-left: auto; width: 220px; height: 32px; border: 1px solid var(--rule-2); background: var(--paper); }
  .top__search input { flex: 1; min-width: 0; padding: 0 10px; border: 0; background: none; font-size: 14px; }
  .top__search input:focus { outline: none; }
  .top__search:focus-within { border-color: var(--ink); }
  .top__search button { width: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
  .top__find { display: none; }
  .top__cta { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
  .top__cta:hover { background: #000; }
}

/* ── Page head ── */
.crumbs { padding-top: 14px; font-size: 13px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; }
.crumbs li:not(:last-child)::after { content: "/"; margin: 0 7px; color: var(--rule-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.head { padding: 10px 0 4px; }
.head h1 { font-size: 28px; line-height: 1.15; }
.head__sub { margin-top: 4px; color: var(--muted); }
.lede { margin-top: 10px; max-width: 68ch; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.article__main > .lede { margin-top: 0; }
@media (min-width: 900px) { .head { padding-top: 14px; } .head h1 { font-size: 34px; } }

/* ── Sections ── */
.sec { margin-top: 32px; }
.sec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 8px; border-top: 1px solid var(--ink); margin-bottom: 10px; }
.sec__head h2 { font-size: 17px; }
.more { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.note { max-width: 72ch; margin: -2px 0 12px; font-size: 14px; color: var(--muted); }
.sec h3 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.sec h3 .sub { margin-left: 6px; font-weight: 400; font-size: 13px; }
.inline { max-width: 80ch; }
.list li { padding: 5px 0; border-bottom: 1px solid var(--rule); }
.list li:first-child { border-top: 1px solid var(--rule); }

/* ── Article: main column + infobox ── */
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 14px; }
.article__main { min-width: 0; }
.infobox { align-self: start; }
.ib-pic { margin-bottom: 8px; }
.ib-pic img { width: 100%; }
@media (min-width: 980px) {
  .article { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "main info"; gap: 48px; }
  .infobox { grid-area: info; position: sticky; top: 16px; }
  .article__main { grid-area: main; }
}
.tile { display: block; background: var(--tile); }
.tile--dark { background: var(--dark); }
.tile--print { display: grid; place-items: center; background: #26272a; padding: 10%; }
.tile--print img { max-height: 100%; width: auto; object-fit: contain; }
.ib-pic.tile--print { aspect-ratio: 4 / 3; }
.ib-pic.tile--print img { max-height: 180px; }
.nopic { display: block; width: 100%; height: 100%; aspect-ratio: 4 / 3; background: var(--tile); }

/* ── Key / value tables ── */
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv th, .kv td { padding: 6px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.kv tr:first-child > * { border-top: 1px solid var(--rule); }
.kv th { width: min(10em, 36%); padding-right: 12px; font-weight: 400; color: var(--muted); }
.facts .kv th { width: 34%; }
.kv td { font-variant-numeric: tabular-nums; }
.kv td .sw { margin-right: 4px; vertical-align: -1px; }
.kv--spec th { width: 12em; }
.kv--rules { margin-top: 18px; }
.kv--rules th { width: 110px; color: var(--ink); font-weight: 600; }
.kv--caps td { text-transform: capitalize; }
.kv--look { margin-top: 10px; }
.kv--look th { width: 26%; }
.kv--look td:last-child { color: var(--muted); }
.infobox .kv th { width: 38%; }
.facts { display: grid; gap: 0 32px; margin-top: 16px; }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Item tables ── */
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 6px 14px 6px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.tbl th:last-child, .tbl td:last-child { padding-right: 0; }
.tbl thead th { padding-top: 0; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; border-bottom-color: var(--rule-2); }
.tbl tbody th { font-weight: 400; }
.tbl .n { text-align: right; white-space: nowrap; }
.tbl td.best { font-weight: 600; }
.tbl td.neg { color: var(--muted); }
.tbl td.nw { white-space: nowrap; }
.tbl--text td { vertical-align: top; }
.tbl--text td .sub { display: block; margin-top: 2px; }
.tbl--text th[scope="row"] { vertical-align: top; font-weight: 600; }
.tbl tbody tr:hover > * { background: rgba(0, 0, 0, 0.025); }
.tbl a, .idx a, .slotnav a, .infobox .kv a, .facts a, .jump a, .foot a, .looks-strip a { text-decoration-color: transparent; }
.tbl a:hover, .idx a:hover, .slotnav a:hover, .infobox .kv a:hover, .facts a:hover, .jump a:hover, .foot a:hover { text-decoration-color: var(--accent); }
.tbl .opt { display: none; }
@media (min-width: 720px) { .tbl .opt { display: table-cell; } .ph { display: none; } }
.it { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.it__t { display: grid; min-width: 0; }
.it__n { font-weight: 500; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
a.it:hover .it__n { text-decoration-color: var(--accent); }
.it__s { font-size: 12.5px; color: var(--muted); }
.th { flex: none; display: block; width: 48px; height: 36px; overflow: hidden; background: var(--tile); }
.th img, .th .nopic { width: 100%; height: 100%; object-fit: cover; }
.th--wear { width: 36px; background: var(--dark); }
.th--wear img { object-position: 50% 22%; }
.th--mark { display: grid; place-items: center; width: 36px; padding: 4px; background: #26272a; }
.th--mark img { object-fit: contain; }
.th__x { color: #f6f6f3; font-size: 15px; font-weight: 600; line-height: 1; }
.tbl .c-item { min-width: 200px; }
.tbl thead th[data-key] button { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.tbl thead th[data-key] button:hover { color: var(--ink); }
.tbl thead th[aria-sort] button { color: var(--ink); }
.tbl thead th[aria-sort="ascending"] button::after { content: " ↑"; color: var(--accent-ink); }
.tbl thead th[aria-sort="descending"] button::after { content: " ↓"; color: var(--accent-ink); }

/* ── Riding ── */
.ride { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
.ride th, .ride td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.ride tr:first-child > * { border-top: 1px solid var(--rule); }
.ride th { width: 34%; font-weight: 600; }
.ride th .sub { display: block; font-size: 12.5px; }
.ride .v { width: 64px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.ride .v.best { font-weight: 700; }
.ride .v.neg { color: var(--muted); }
.ride .b { width: 25%; }
.ride .fx { color: var(--muted); font-size: 13.5px; padding-right: 0; }
.ride--fx th { font-weight: 500; }
.ride--fx th .sub { display: inline; font-size: 12.5px; }

@media (max-width: 599px) { .ride .fx { display: none; } .ride th { width: auto; } .ride .b { width: 34%; padding-right: 0; } }
.bar { position: relative; display: block; width: 100%; max-width: 160px; height: 6px; background: #e3e3de; }
.bar i { position: absolute; top: 0; bottom: 0; left: calc(var(--l) * 100%); width: calc(var(--w) * 100%); background: var(--accent); }
.bar i.neg { background: #a3a39d; }
.bar--div::before { content: ""; position: absolute; left: calc(50% - 0.5px); top: -3px; bottom: -3px; width: 1px; background: var(--ink-2); }

/* ── Swatches ── */
.sw { display: inline-block; flex: none; width: 12px; height: 12px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.swl { columns: 3 190px; column-gap: 24px; font-size: 13.5px; }
.swl li { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; break-inside: avoid; }
.swl .sw { align-self: center; }
.swl .sub { margin-left: auto; padding-left: 8px; font-size: 12.5px; white-space: nowrap; }
.swl .cur { font-weight: 600; }
.more-sw { margin-top: 14px; }
.more-sw summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }

/* ── Prints and looks ── */
.prints { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.prints li { display: flex; align-items: center; gap: 10px; width: min(100%, 300px); font-size: 14px; }
.prints .sub { display: block; font-size: 12.5px; }
.prints .tile--print { flex: none; width: 72px; height: 72px; padding: 8px; }
.looks-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 14px 12px; }
.looks-strip a { display: grid; gap: 6px; font-size: 14px; text-decoration: none; }
.looks-strip a:hover span:last-child { text-decoration: underline; text-decoration-color: var(--accent); }
.tile--look { aspect-ratio: 5 / 8; overflow: hidden; }
.tile--look img { width: 100%; height: 100%; object-fit: cover; }
.look { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
.look > .tile--look { margin-top: 9px; }
.look__body > p { max-width: 68ch; }
@media (min-width: 760px) { .look { grid-template-columns: 140px minmax(0, 1fr); gap: 28px; } }

/* ── Prev / next, slot lists ── */
.pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14px; }
.pn__next { text-align: right; }
.slotnav ul { display: flex; flex-wrap: wrap; gap: 4px 16px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14px; }
.slotnav a { color: var(--ink-2); }
.slotnav a[aria-current] { color: var(--ink); font-weight: 600; text-decoration-color: var(--accent); }
.jump { margin-top: 18px; font-size: 14px; display: grid; gap: 4px; }
.jump b { font-weight: 600; margin-right: 4px; }

/* ── Wiki home ── */
.head--home h1 { font-size: 30px; }
@media (min-width: 900px) { .head--home h1 { font-size: 40px; } }
.find { display: flex; max-width: 620px; margin-top: 18px; height: 42px; border: 1px solid var(--ink); background: var(--paper); }
.find input { flex: 1; min-width: 0; padding: 0 12px; border: 0; background: none; font-size: 16px; }
.find input:focus { outline: none; }
.find button { padding: 0 16px; border: 0; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 14px; cursor: pointer; }
.find__results { max-width: 620px; border: 1px solid var(--rule-2); border-top: 0; background: var(--paper); }
.find__results li a { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 8px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.find__results li a:hover, .find__results li a:focus-visible { background: var(--bg); }
.find__results .th { width: 48px; height: 36px; }
.find__results .th--wear { width: 36px; }
.find__results b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find__results small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find__results .lvl { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.find__all { display: block; padding: 8px; font-size: 13.5px; }
.find__none { padding: 10px 8px; color: var(--muted); font-size: 14px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 12px; }
@media (min-width: 900px) { .slots { grid-template-columns: repeat(9, minmax(0, 1fr)); } }
.slots a { display: block; text-decoration: none; font-size: 14px; }
.slots .tile { aspect-ratio: 4 / 3; overflow: hidden; }
.slots .tile img { width: 100%; height: 100%; object-fit: cover; }
.slots__n { display: inline-block; margin-top: 5px; font-weight: 500; }
.slots .sub { margin-left: 5px; font-size: 13px; }
.slots a:hover .slots__n { text-decoration: underline; text-decoration-color: var(--accent); }
.cols { display: grid; gap: 28px; }
@media (min-width: 900px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.col h3 { margin: 0 0 6px; padding-top: 8px; border-top: 1px solid var(--ink); font-size: 17px; font-weight: 600; color: var(--ink); }
.col h3 a { text-decoration: none; }
.col h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.idx { columns: 2; column-gap: 20px; font-size: 14px; }
.idx li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.idx .sub { font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── Catalogue filters ── */
.filters { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin-bottom: 14px; font-size: 13px; }
.js .filters { display: grid; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .filters { grid-template-columns: 2fr repeat(7, minmax(0, 1fr)) 1.4fr; align-items: end; } }
.filters label { display: grid; gap: 3px; min-width: 0; }
.filters label > span { color: var(--muted); white-space: nowrap; }
.filters__q { grid-column: 1 / -1; }
@media (min-width: 1100px) { .filters__q { grid-column: auto; } }
.filters input[type="search"], .filters select { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 0; background: var(--paper); font-size: 14px; }
.filters select { appearance: none; -webkit-appearance: none; padding-right: 22px; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M0 0h10L5 6z' fill='%2362625d'/%3E%3C/svg%3E") no-repeat right 8px center / 8px 5px; }
.filters select.is-set { border-color: var(--ink); }
.filters input:focus, .filters select:focus { outline: none; border-color: var(--ink); }
.filters__level { grid-column: 1 / -1; }
@media (min-width: 1100px) { .filters__level { grid-column: auto; } }
.filters input[type="range"] { width: 100%; height: 32px; margin: 0; accent-color: var(--ink); }
.filters__count { grid-column: 1 / -1; display: flex; gap: 12px; font-size: 13.5px; color: var(--muted); }
.filters__count b { color: var(--ink); font-weight: 600; }
.empty { padding: 24px 0; color: var(--muted); }
tr[hidden] { display: none; }

/* ── Levels ── */
.tbl--levels td, .tbl--levels th { vertical-align: top; }
.tbl--levels tbody th { font-weight: 600; font-size: 15px; }
.tbl--levels td.lv { font-size: 14px; line-height: 1.5; }
.tbl--levels td.lv p + p { margin-top: 3px; }
.tbl--levels td.lv b { display: inline-block; min-width: 68px; font-weight: 500; color: var(--muted); }
.tbl--levels td.lv b.acc { color: var(--accent-ink); }

/* ── Footer ── */
.foot { margin-top: 64px; border-top: 1px solid var(--ink); padding: 14px 0 40px; font-size: 13.5px; color: var(--muted); }
.foot__in { display: grid; gap: 10px; }
.foot__id b { color: var(--ink); font-weight: 700; margin-right: 6px; }
.foot__nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.foot__nav a, .foot__id a { color: var(--ink-2); }
.foot__fine { font-size: 12.5px; }
