/* Trainwreck Studios — abrasion test pages */
:root {
  --asphalt: #15171a;
  --asphalt-2: #1d2024;
  --asphalt-3: #272b30;
  --line: #34393f;
  --text: #ecebe6;
  --muted: #9ea3a8;
  --paint: #f2c230;          /* road-paint yellow */
  --leather: #d9893b;
  --synthetic: #6fa8c9;
  --denim: #7c86d6;
  --aramid: #e9d45a;
  --radius: 10px;
  --max: 1080px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Arial Narrow", "Roboto Condensed", "Helvetica Neue Condensed", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 17px/1.6 var(--sans);
  color: var(--text);
  background:
    radial-gradient(ellipse at 20% -10%, rgba(242,194,48,.07), transparent 50%),
    var(--asphalt);
}
a { color: var(--paint); }
a:hover { color: #fff; }
img { max-width: 100%; }
sup { color: var(--paint); font-size: .7em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 22px; }

/* Header / nav */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(21,23,26,.9);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(6px);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 14px; color: var(--text); text-decoration: none; }
.brand b { color: var(--paint); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  padding: 6px 12px; border-radius: 999px;
}
.nav a:hover { color: var(--text); background: var(--asphalt-3); }
.nav a[aria-current="page"] { color: var(--asphalt); background: var(--paint); font-weight: 600; }

/* Hero */
.hero { padding: 72px 0 40px; }
.eyebrow { font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; font-size: 13px; color: var(--paint); margin: 0 0 12px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; }
h1 { font-size: clamp(36px, 6vw, 64px); text-transform: uppercase; letter-spacing: .01em; max-width: 16ch; }
h2 { font-size: clamp(26px, 3.4vw, 36px); text-transform: uppercase; margin-bottom: 14px; }
h3 { font-size: 21px; }
.lede { font-size: clamp(18px, 2vw, 21px); color: #d6d5cf; max-width: 62ch; margin: 20px 0 0; }

/* The dashed centre line divider */
.centerline {
  height: 6px; margin: 8px 0 0;
  background: repeating-linear-gradient(90deg, var(--paint) 0 46px, transparent 46px 82px);
  opacity: .85;
}

section { padding: 48px 0; }
section + section { border-top: 1px solid var(--line); }
.prose { max-width: 68ch; }
.prose p { margin: 0 0 1em; }
.muted { color: var(--muted); font-weight: 400; }

/* Test cards on overview */
.tests { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 24px; }
.test-link {
  display: block; padding: 26px; border-radius: var(--radius);
  background: var(--asphalt-2); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: border-color .2s, transform .2s;
}
.test-link:hover { border-color: var(--paint); transform: translateY(-2px); color: var(--text); }
.test-link h3 { font-size: 26px; text-transform: uppercase; margin-bottom: 8px; }
.test-link p { margin: 0; color: var(--muted); }
.test-link .go { display: inline-block; margin-top: 14px; color: var(--paint); font-weight: 600; }

/* Takeaways */
.takeaways { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.takeaways li { background: var(--asphalt-2); border-left: 4px solid var(--paint); padding: 16px 18px; border-radius: 0 var(--radius) var(--radius) 0; }
.takeaways strong { display: block; font-family: var(--display); font-size: 19px; margin-bottom: 4px; }

/* Bar chart */
.chart-box { background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 14px; margin-top: 22px; }
.chart-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; margin-bottom: 14px; }
.chart-head p { margin: 0; color: var(--muted); font-size: 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; background: var(--c); vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 220px) 1fr 104px; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.05); }
.bar-row:first-child { border-top: 0; }
.bar-label strong { display: block; font-size: 15px; line-height: 1.2; }
.bar-label span { font-size: 13px; color: var(--muted); }
.bar-track { height: 18px; background: var(--asphalt-3); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; min-width: 3px; background: var(--c); border-radius: 4px; transition: width .9s cubic-bezier(.2,.7,.2,1); }
.is-drawn .bar-fill { width: var(--w); }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; white-space: nowrap; }
.footnote { font-size: 14px; color: var(--muted); margin: 12px 0 0; }

.fam-leather { --c: var(--leather); }
.fam-synthetic { --c: var(--synthetic); }
.fam-denim { --c: var(--denim); }
.fam-aramid { --c: var(--aramid); }

/* Material cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; margin-top: 22px; }
.card { background: var(--asphalt-2); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius); padding: 18px 18px 16px; display: flex; flex-direction: column; }
.card header { margin-bottom: 12px; display: flex; gap: 14px; align-items: flex-start; }
.swatch {
  flex: none; width: 88px; height: auto; aspect-ratio: 101 / 126; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); background: #ddd;
  filter: grayscale(1) contrast(1.05);
}
.is-missing { display: none !important; }

/* Original test photos */
.photo { margin: 0; background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; align-self: start; }
.photo img { display: block; width: 100%; height: auto; border-radius: 6px; background: #ddd; image-rendering: auto; }
.photo figcaption { font-size: 13.5px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.method-side { display: grid; gap: 16px; align-content: start; }
.test-link .teaser { float: right; width: 120px; height: auto; margin: 0 0 10px 16px; border-radius: 6px; border: 1px solid var(--line); background: #ddd; }
.hero-grid { display: grid; gap: 28px; align-items: end; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1fr auto; } }
.hero-photo { margin: 0; width: 150px; }
.hero-photo img { width: 100%; height: auto; display: block; border-radius: 8px; background: #ddd; border: 1px solid var(--line); }
.hero-photo figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
@media (max-width: 859px) { .hero-photo { display: none; } }
.card .chip { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--c); font-weight: 700; }
.card h3 { margin-top: 4px; }
.card .meta { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.card p { margin: 0 0 12px; font-size: 15.5px; }
.card .result { margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--c); }

/* Comparison table */
.table-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 18px 0 10px; font-size: 14px; color: var(--muted); }
.table-tools button {
  font: inherit; color: var(--text); background: var(--asphalt-3); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.table-tools button[aria-pressed="true"] { background: var(--paint); color: var(--asphalt); border-color: var(--paint); font-weight: 600; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 560px; }
th, td { padding: 12px 16px; text-align: left; border-top: 1px solid var(--line); }
thead th { border-top: 0; background: var(--asphalt-2); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
tbody th { font-weight: 600; }
td { font-variant-numeric: tabular-nums; }
td:nth-child(3), td:nth-child(4), thead th:nth-child(3), thead th:nth-child(4) { text-align: right; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 9px; }

/* Method box */
.method { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 860px) { .method { grid-template-columns: 1.4fr 1fr; } }
.facts { background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.06); font-size: 15px; }
.facts div:first-child { border-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }

/* CE ratings */
.ratings { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-top: 20px; }
.rating { background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.rating b { display: block; font-family: var(--display); font-size: 30px; color: var(--paint); line-height: 1; margin-bottom: 6px; }
.rating span { font-size: 14.5px; color: #d6d5cf; }

/* Pager + footer */
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager a { text-decoration: none; font-weight: 600; }
.site-footer { border-top: 1px solid var(--line); padding: 30px 0 48px; color: var(--muted); font-size: 14px; }
.site-footer p { margin: 0 0 8px; max-width: 80ch; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 28px; }
  .bar-row { grid-template-columns: 1fr auto; grid-template-areas: "label value" "track track"; gap: 6px 12px; }
  .bar-label { grid-area: label; }
  .bar-value { grid-area: value; }
  .bar-track { grid-area: track; }
  table { min-width: 0; font-size: 15px; }
  th, td { padding: 10px 12px; }
  th:nth-child(2), td:nth-child(2), .unit { display: none; }
  tbody th { white-space: normal; }
  tbody th .muted { display: block; font-size: 13px; padding-left: 18px; }
}
td { white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .test-link { transition: none; }
}
