/* The Category Report. Swiss / International direction: flush left, heavy ink
   rules, large rank numerals. Tokens first, then components. No raw colors
   below the token blocks. */
:root {
  --paper: #f3f4ef;
  --paper-2: #e6e9e1;
  --ink: #17201c;
  --muted: #4a5650;
  --hair: #bfc5ba;
  --accent: #b3261e;
  --accent-ink: #fbfaf5;
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-text: Charter, "Bitstream Charter", "Iowan Old Style", "Noto Serif", Georgia, serif;
  --step--1: 0.875rem;
  --step-0: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.6rem, 1.35rem + 1.2vw, 2.25rem);
  --step-3: clamp(2rem, 1.5rem + 2.6vw, 3.5rem);
  --rule: 3px;
  --gap: clamp(1rem, 0.8rem + 1vw, 1.75rem);
  --measure: 40rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #111614;
    --paper-2: #1b2320;
    --ink: #e9ece5;
    --muted: #a8b2ab;
    --hair: #3a4540;
    --accent: #ff8273;
    --accent-ink: #111614;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-0);
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: var(--rule) solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; margin: 0; letter-spacing: -0.01em; overflow-wrap: break-word; }
h1 { font-size: var(--step-3); font-weight: 800; }
h2 { font-size: var(--step-2); font-weight: 800; }
h3 { font-size: var(--step-1); font-weight: 600; line-height: 1.2; }
p { margin: 0 0 1em; max-width: var(--measure); }
.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.plain { list-style: none; margin: 0; padding: 0; }
.skip { position: absolute; left: -999rem; top: 0; background: var(--ink); color: var(--paper); padding: 0.75rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* Masthead: the one texture on the site is the ledger ruling behind it. */
.masthead {
  border-bottom: var(--rule) solid var(--ink);
  background:
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--hair) 7px 8px),
    var(--paper-2);
}
.masthead-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1.5rem; padding-block: 0.6rem; }
.wordmark {
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-1);
  text-decoration: none; background: var(--ink); color: var(--paper); padding: 0.3rem 0.6rem;
}
.wordmark:hover { color: var(--paper); background: var(--accent); }
.masthead nav, .footer nav { display: flex; flex-wrap: wrap; gap: 0 0.25rem; }
.masthead nav a, .footer nav a {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step--1);
  padding: 0.85rem 0.6rem; min-height: 44px; background: var(--paper-2);
}
main { padding-block: var(--gap) calc(var(--gap) * 3); }

/* Search */
.search label { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 0.4rem; }
.search-row { display: flex; max-width: var(--measure); border: var(--rule) solid var(--ink); background: var(--paper); }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: inherit; padding: 0.7rem 0.9rem; min-height: 52px; border-radius: 0;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.search input:focus-visible { outline-offset: -6px; }
.search button {
  border: 0; border-left: var(--rule) solid var(--ink); background: var(--ink); color: var(--paper);
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-0);
  padding: 0 1.2rem; min-height: 52px; cursor: pointer; border-radius: 0;
}
.search button:hover { background: var(--accent); color: var(--accent-ink); }
.search-big .search-row { max-width: 46rem; }
.search-big input, .search-big button { min-height: 64px; font-size: var(--step-1); }
.search-big label { font-size: var(--step-1); }

/* Home */
.hero { padding-block: clamp(1.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem); }
.hero h1 { max-width: 16ch; }
.lede { font-size: var(--step-1); line-height: 1.4; color: var(--muted); margin-block: 1rem 1.75rem; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap) calc(var(--gap) * 2); border-top: var(--rule) solid var(--ink); padding-top: var(--gap); }
.home-grid h2 { margin-bottom: 0.75rem; }
.categories li { border-bottom: 1px solid var(--hair); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.categories a { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); padding-block: 0.7rem; flex: 1; }
.categories span { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
.card { border-bottom: 1px solid var(--hair); padding-block: 0.9rem; }
.card a { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); line-height: 1.2; display: inline-block; padding-block: 0.3rem; }
.card p { color: var(--muted); font-size: var(--step--1); margin: 0.2rem 0 0; }
@media (min-width: 52rem) { .home-grid { grid-template-columns: 1fr 2fr; } }

/* Breadcrumbs and datelines */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin: 0 0 var(--gap); padding: 0; font-size: var(--step--1); color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; }
.crumbs a { display: inline-block; padding-block: 0.7rem; }
.crumbs li[aria-current] { padding-block: 0.7rem; }
.dateline { color: var(--muted); font-size: var(--step--1); }
.sample {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 600; font-size: var(--step--1); padding: 0.35rem 0.6rem;
}

/* Report */
.report-head { border-bottom: var(--rule) solid var(--ink); padding-bottom: 0.75rem; margin-bottom: var(--gap); }
.report-head h1 { font-size: var(--step-2); max-width: 24ch; margin-bottom: 0.75rem; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.report-main > section { margin-bottom: calc(var(--gap) * 2); }
.report-main > section > h2 { border-top: var(--rule) solid var(--ink); padding-top: 0.6rem; margin-bottom: 1rem; }
.report-main > .summary p:first-child { font-size: var(--step-1); line-height: 1.4; }
.jump h2 { font-size: var(--step-0); margin-bottom: 0.25rem; }
.jump ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.jump a { display: inline-block; padding-block: 0.7rem; font-family: var(--font-display); font-weight: 600; font-size: var(--step--1); }
.how { background: var(--paper-2); border-left: var(--rule) solid var(--ink); padding: 1rem; }
.report-main > .how > h2 { border-top: 0; padding-top: 0; font-size: var(--step-1); }
.how p { font-size: var(--step--1); line-height: 1.5; }
.how .credit { margin: 0; font-family: var(--font-display); font-weight: 600; }
.how .credit a { display: inline-block; padding-block: 0.6rem; }
@media (min-width: 60rem) {
  .report-grid { grid-template-columns: 12rem minmax(0, 1fr); gap: calc(var(--gap) * 2); }
  .jump { position: sticky; top: 1rem; align-self: start; border-top: var(--rule) solid var(--ink); padding-top: 0.6rem; }
  .jump ol { display: block; }
  .jump a { padding-block: 0.45rem; }
}

/* Product blocks */
.products { list-style: none; margin: 0; padding: 0; }
.product { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 0 0.75rem; border-top: 1px solid var(--ink); padding-block: 1.1rem 0.6rem; }
.product:first-child { border-top: 0; padding-top: 0; }
.numeral { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); line-height: 0.9; color: var(--accent); }
.product h3 { margin-bottom: 0.75rem; }
.facts { margin: 0 0 1rem; border-top: 1px solid var(--hair); max-width: var(--measure); }
.facts div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 0.75rem; border-bottom: 1px solid var(--hair); padding-block: 0.4rem; font-size: var(--step--1); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.find { display: inline-block; padding-block: 0.7rem; font-family: var(--font-display); font-weight: 600; }
.product-featured { background: var(--paper-2); border: var(--rule) solid var(--ink); padding: 1rem 0.9rem 0.6rem; }
.product-featured:first-child { padding-top: 1rem; border-top: var(--rule) solid var(--ink); }

/* The featured photo is the link. It must look tappable. */
.photo {
  display: block; max-width: 26rem; margin-bottom: 1.1rem; text-decoration: none;
  border: var(--rule) solid var(--ink); background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink); transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}
.photo:hover, .photo:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); color: inherit; }
.photo-bar {
  display: block; background: var(--accent); color: var(--accent-ink); text-align: left;
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-0); padding: 0.85rem 0.9rem;
  border-top: var(--rule) solid var(--ink);
}

/* Comparison table */
.table-scroll { overflow-x: auto; border: 1px solid var(--ink); }
table { border-collapse: collapse; width: 100%; min-width: 38rem; font-size: var(--step--1); }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--hair); vertical-align: top; }
thead th { font-family: var(--font-display); font-weight: 600; background: var(--ink); color: var(--paper); }
tbody th { font-weight: 400; max-width: 16rem; }
tbody th span { display: block; color: var(--muted); }
td { font-variant-numeric: tabular-nums; white-space: nowrap; }
#faq h3 { margin: 1.25rem 0 0.4rem; }

/* Prose pages */
.prose h2 { font-size: var(--step-1); margin: 1.75rem 0 0.5rem; }
.prose h1 { margin-bottom: 1rem; }
.prose ul { max-width: var(--measure); padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* Test page */
.steps { max-width: var(--measure); padding-left: 1.3rem; margin: 0; font-size: var(--step--1); }
.steps li { margin-bottom: 0.6rem; }
.testpage > section { margin-bottom: calc(var(--gap) * 2); }
.variants { display: grid; gap: 0.75rem; }
.variant { display: block; border: var(--rule) solid var(--ink); padding: 0.8rem 0.9rem; text-decoration: none; background: var(--paper); }
.variant strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--accent); }
.variant span { display: block; }
.variant code { display: block; font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; margin-top: 0.25rem; }
@media (min-width: 44rem) { .variants { grid-template-columns: 1fr 1fr; } }

/* Footer */
.footer { border-top: var(--rule) solid var(--ink); background: var(--paper-2); padding-block: 1rem; font-size: var(--step--1); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.25rem 1.5rem; }
.footer p { margin: 0; color: var(--muted); }

/* One page-load move: the headline block settles in. */
@media (prefers-reduced-motion: no-preference) {
  .hero > *, .report-head > * { animation: settle 420ms var(--ease) both; }
  .hero > :nth-child(2), .report-head > :nth-child(2) { animation-delay: 70ms; }
  .hero > :nth-child(3), .report-head > :nth-child(3) { animation-delay: 140ms; }
  /* Transform only: the text is never hidden while the motion runs. */
  @keyframes settle { from { transform: translateY(12px); } }
}
@media (prefers-reduced-motion: reduce) { .photo { transition: none; } }
