/* Light theme only, on purpose: no prefers-color-scheme switching. */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1c1917;
  --muted: #5b564f;
  --faint: #8a847b;
  --line: #e6e1d8;
  --track: #e7e3da;
  --accent: #1d4ed8;
  --up: #15803d;
  --down: #b91c1c;
  --warn-bg: #fef3c7;
  --warn-ink: #78350f;
  --active: #166534;
  --active-bg: #dcfce7;
  --slow: #854d0e;
  --slow-bg: #fef08a;
  --stale: #991b1b;
  --stale-bg: #fee2e2;
  --unknown-bg: #e7e3da;
  --radius: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }

/* header: a four-colour stripe, one colour per pack */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.stripe { display: flex; height: 5px; }
.stripe i { flex: 1; background: var(--pc); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-weight: 800; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.sub { margin: 0; color: var(--muted); font-size: .95rem; }

.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.1; letter-spacing: -0.03em; margin: 0 0 10px; font-weight: 800; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, #fde68a 62%); padding: 0 .1em; }
.hero p { max-width: 62ch; margin: 0; color: var(--muted); font-size: 1.05rem; }

h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.15; margin: 22px 0 8px; }
h2 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 30px 0 8px; }
.crumb { display: inline-block; margin-top: 20px; font-size: .9rem; }
.banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 14px; margin: 16px 0; }
.note { font-size: .85rem; color: var(--muted); }

/* pack cards */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); gap: 14px; margin: 22px 0 8px; padding: 0; list-style: none; }
.pack-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px; overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.pack-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--pc); }
.pack-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(28, 25, 23, .08); }
.pack-card h3 { margin: 6px 0 2px; font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pack-card h3 a { color: var(--ink); text-decoration: none; }
.pack-card h3 a:hover { text-decoration: underline; }
.pack-card p { margin: 4px 0; font-size: .88rem; }
.pack-card .tag { color: var(--muted); min-height: 2.6em; }
.wins { margin-top: 10px; }
.wins .label { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.wins .label b { color: var(--ink); }
.wins .bar { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; margin-top: 4px; }
.wins .bar i { display: block; height: 100%; background: var(--pc); border-radius: 99px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 1px 9px; border-radius: 99px; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.active { background: var(--active-bg); color: var(--active); }
.badge.slow { background: var(--slow-bg); color: var(--slow); }
.badge.stale { background: var(--stale-bg); color: var(--stale); }
.badge.unknown { background: var(--unknown-bg); color: var(--muted); }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 26px 0 10px; }
.search { flex: 1 1 300px; position: relative; }
.search input { width: 100%; padding: 12px 14px 12px 40px; font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; }
.search input:hover { border-color: #cfc8bb; }
.search::before { content: ""; position: absolute; left: 14px; top: 50%; width: 13px; height: 13px; margin-top: -8px; border: 2px solid var(--faint); border-radius: 50%; }
.search::after { content: ""; position: absolute; left: 27px; top: 50%; width: 6px; height: 2px; margin-top: 5px; background: var(--faint); transform: rotate(45deg); }
.legend { font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.legend .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; margin-right: 4px; background: color-mix(in srgb, #1d4ed8 22%, white); border: 1px solid #c7d2fe; }

/* the matrix */
.matrix-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: clip; }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.matrix th, .matrix td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.matrix tbody tr:last-child td { border-bottom: 0; }
.matrix thead th { font-size: .85rem; background: var(--surface); position: sticky; top: 0; z-index: 2; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.matrix thead th .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--pc); margin-right: 7px; }
.matrix tr.group th { background: var(--bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); padding: 9px 14px; border-top: 1px solid var(--line); }
.matrix tr.uc:hover td { filter: brightness(.985); }
.uc-name { width: 25%; }
.uc-name a { font-weight: 700; color: var(--ink); text-decoration: none; }
.uc-name a:hover { color: var(--accent); text-decoration: underline; }
.uc-name small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; line-height: 1.35; margin-top: 2px; }

/* strength tint: darker = stronger, drawn in each pack's own colour */
td.cell-td { background: var(--tint, transparent); }
td.s5 { --tint: color-mix(in srgb, var(--pc) 24%, white); }
td.s4 { --tint: color-mix(in srgb, var(--pc) 15%, white); }
td.s3 { --tint: color-mix(in srgb, var(--pc) 8%, white); }
td.s2 { --tint: color-mix(in srgb, var(--pc) 3%, white); }

.meter { display: inline-flex; gap: 3px; vertical-align: middle; }
.meter i { width: 14px; height: 8px; border-radius: 3px; background: var(--track); }
.meter i.on { background: var(--pc); }
.score { font-weight: 800; font-size: .95rem; margin-left: 7px; vertical-align: middle; }
.score small { font-weight: 500; color: var(--faint); font-size: .72rem; }
.best-tag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--ink); border-radius: 4px; padding: 1px 6px; margin-left: 7px; vertical-align: middle; }
.delta { font-size: .78rem; font-weight: 700; margin-left: 6px; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.lowconf { font-size: .72rem; color: var(--muted); margin-left: 6px; cursor: help; border-bottom: 1px dotted var(--muted); }
.ev { display: block; margin-top: 5px; font: .72rem/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); word-break: break-word; }

/* rank + details pages */
.rank { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 12px; counter-reset: rank; }
.rank > li { counter-increment: rank; position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--pc); border-radius: var(--radius); padding: 14px 16px 14px 18px; }
.rank > li::before { content: counter(rank); position: absolute; right: 14px; top: 8px; font-size: 2.2rem; font-weight: 800; color: var(--track); line-height: 1; }
.rank h3 { margin: 0; font-size: 1.1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-right: 36px; }
.rank h3 a { color: var(--ink); text-decoration: none; }
.rank p { margin: 6px 0; }
code, .cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }
pre.cmd { background: #f1eee6; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; white-space: pre-wrap; word-break: break-word; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; margin: 8px 0; }
.chips li { background: #f1eee6; border: 1px solid var(--line); border-radius: 6px; padding: 2px 9px; font-size: .82rem; }
.chips li a { text-decoration: none; }
.skilltable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.skilltable td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.skilltable td:first-child { width: 44%; word-break: break-word; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; }
details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 12px 0; }
summary { cursor: pointer; font-weight: 700; }
.cols { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
.pack-title { border-left: 8px solid var(--pc); padding-left: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.site-footer { color: var(--muted); font-size: .85rem; padding-top: 30px; padding-bottom: 44px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pack-card { transition: none; }
  .pack-card:hover { transform: none; }
}

@media (max-width: 800px) {
  .matrix thead { position: absolute; left: -9999px; }
  .matrix, .matrix tbody, .matrix tr, .matrix td, .matrix th { display: block; }
  .matrix tr.group th { border-bottom: 0; }
  .matrix tr.uc { border-bottom: 10px solid var(--bg); }
  .matrix td { border-bottom: 1px solid var(--line); }
  .matrix td.cell-td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; align-items: start; }
  .matrix td.cell-td::before { content: attr(data-label); font-size: .8rem; font-weight: 700; color: var(--ink); }
  .uc-name { width: auto; }
  .hero { padding-top: 24px; }
}
