:root {
  --ink: #1c1a17;
  --muted: #6b655c;
  --faint: #9a9388;
  --bg: #faf8f4;
  --panel: #ffffff;
  --line: #e7e1d6;
  --accent: #0e7c66;
  --up: #1a9e5f;
  --down: #d13b3b;
  --serif: Georgia, 'Times New Roman', serif;
  --mono: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: rgba(250,248,244,.92); position: sticky; top: 0; z-index: 10; backdrop-filter: saturate(1.1) blur(6px); }
.header-inner { display: flex; align-items: center; gap: 20px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -.5px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: block; width: 30px; height: 30px; }
.brand-word span { color: var(--accent); }
/* min-width:0 lets the search box shrink below its intrinsic input width.
   Without it the header sets a floor wider than a phone viewport. */
.search { flex: 1; min-width: 0; }
.search input { width: 100%; min-width: 0; max-width: 420px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 22px; background: #fff; font-size: 14px; }
.search input:focus { outline: none; border-color: var(--accent); }
.nav { display: flex; gap: 18px; font-size: 14px; }
.nav a { color: var(--muted); }

/* Typography */
h1 { font-family: var(--serif); font-weight: 700; letter-spacing: -.5px; line-height: 1.1; margin: 0 0 6px; }
/* Clear the sticky header when a page opens straight on its title. */
main.wrap > h1:first-child { margin-top: 24px; }
h2 { font-family: var(--serif); font-weight: 700; font-size: 22px; margin: 34px 0 14px; }
.lede { color: var(--muted); font-size: 18px; }
.crumb { font-size: 13px; color: var(--faint); margin: 22px 0 10px; }
.crumb a { color: var(--muted); }
.flash { background: #eaf5f0; border: 1px solid #cfe8dd; color: #0e5c48; padding: 10px 14px; border-radius: 8px; margin-top: 16px; }

/* Stat row */
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 20px 0 8px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.stat .value { font-family: var(--mono); font-size: 24px; font-weight: 600; margin-top: 2px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* Chart panel */
.chart-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 18px 0; }
.chart-controls { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.pills { display: inline-flex; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.pills button { border: 0; background: #fff; color: var(--muted); padding: 6px 14px; font-size: 13px; cursor: pointer; font-family: inherit; }
.pills button + button { border-left: 1px solid var(--line); }
.pills button.active { background: var(--accent); color: #fff; }
.chart { width: 100%; height: 340px; }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 340px; color: var(--faint); font-size: 14px; }

/* Cards / grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 14px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.card-art { display: flex; justify-content: center; margin: -2px 0 10px; }
.card-art svg, .card-art img { display: block; width: 96px; height: 96px; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card .ref { color: var(--faint); font-size: 12px; font-family: var(--mono); }
.card .price { font-family: var(--mono); font-size: 18px; margin-top: 8px; }

/* Tables (movers) */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
table.rank { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rank th { text-align: left; color: var(--faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.rank td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.rank .pct { font-family: var(--mono); text-align: right; white-space: nowrap; }
table.rank .spark { width: 120px; }
table.rank .thumb { width: 54px; padding-right: 0; }
table.rank .thumb svg, table.rank .thumb img { display: block; width: 46px; height: 46px; }
table.rank .name a { color: var(--ink); }
table.rank .name small { color: var(--faint); display: block; }

/* Search */
.result { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.result:hover { text-decoration: none; }
.result:hover .result-name { text-decoration: underline; }
.result-art svg { display: block; width: 42px; height: 42px; }
.result-name { flex: 1; }
.result-name small { color: var(--faint); font-size: 13px; }
.result .ref { font-family: var(--mono); color: var(--faint); font-size: 13px; text-align: right; }

/* Prose */
.prose { max-width: 680px; }
.prose p, .prose li { color: #33302a; }
.prose h2 { margin-top: 30px; }

/* Model hero: illustration beside the summary, kept short so the chart is
   reachable without scrolling. */
.model-hero { display: grid; grid-template-columns: 210px 1fr; gap: 26px; align-items: start; margin: 18px 0 4px; }
.hero-art { margin: 0; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; text-align: center; }
.hero-art svg, .hero-art img { display: block; margin: 0 auto; width: 150px; height: auto; }
.hero-art .credit { margin-top: 8px; }
.hero-copy p { margin: 0 0 10px; color: #33302a; max-width: 62ch; }
.hero-copy .fine { margin-top: 0; }
.credit { font-size: 12px; color: var(--faint); }
.hero-photo { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin: 14px 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; background: #f3efe8; }
.footer-inner { padding: 34px 20px; }
.subscribe label { display: block; margin-bottom: 8px; }
.subscribe-row { display: flex; gap: 8px; max-width: 420px; }
.subscribe-row input { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.subscribe button, .search button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; font-family: inherit; }
.fine { color: var(--muted); font-size: 13px; margin-top: 16px; }

@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
  .model-hero { grid-template-columns: 1fr; gap: 16px; }
  .hero-art { justify-self: start; }
  .nav { display: none; }
  .header-inner { gap: 12px; }
}
@media (max-width: 480px) {
  /* Thumb + name + change fit; the sparkline is decoration, the % is the data. */
  table.rank .spark { display: none; }
  .result .ref { display: none; }
}
