@import url('fonts.css');
@import url('tokens.css');

/* ==========================================================================
   Base
========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 var(--step-0) / 1.65 var(--body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-4);
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  font-weight: 900;
}
h2 {
  font-size: var(--step-2);
  margin-top: var(--s-7);
}
h3 {
  font-size: var(--step-1);
  margin-top: var(--s-6);
}
h4,
h5,
h6 {
  font-size: var(--step-0);
  margin-top: var(--s-5);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

p,
ul,
ol,
dl,
figure,
table {
  margin: 0 0 var(--s-5);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color var(--fast) var(--ease-out);
}

a:hover {
  color: var(--accent-hover);
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

strong {
  font-weight: 600;
}

code,
kbd,
samp {
  font-family: var(--mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--s-7) 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--ground);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  transition: top var(--fast) var(--ease-out);
}

.skip-link:focus {
  top: var(--s-4);
}

/* ==========================================================================
   Layout
========================================================================== */

.wrap {
  width: min(100% - 2.5rem, var(--wide));
  margin-inline: auto;
}

.prose {
  width: min(100%, var(--measure));
}

main {
  display: block;
  padding-block: var(--s-7) var(--s-8);
}

/* ==========================================================================
   Masthead
========================================================================== */

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--ground);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-4) var(--s-6);
  padding-block: var(--s-4);
}

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--step-1);
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark:hover {
  color: var(--ink);
}

/* The rule under the wordmark is a kerf — the slot a blade leaves. It marks
   the one element that is the site's identity, and nothing else uses it. */
.wordmark::after {
  content: '';
  display: block;
  height: 3px;
  margin-top: 3px;
  background: var(--accent);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin-left: auto;
  font-family: var(--display);
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current='page'] {
  color: var(--accent);
}

/* ==========================================================================
   Breadcrumbs
========================================================================== */

.crumbs {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: var(--s-5);
}

.crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
}

.crumbs li::after {
  content: '/';
  margin-left: var(--s-2);
  color: var(--rule-strong);
}

.crumbs li:last-child::after {
  content: '';
}

.crumbs a {
  color: var(--muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent);
}

/* ==========================================================================
   Page headers
========================================================================== */

.page-head {
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-5);
  border-bottom: 2px solid var(--ink);
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 var(--s-2);
}

.standfirst {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: var(--measure);
  margin: var(--s-4) 0 0;
}

.meta {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  margin-top: var(--s-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
}

/* ==========================================================================
   Article body
========================================================================== */

.prose h2 {
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
}

.prose li {
  margin-bottom: var(--s-2);
}

.prose figure {
  margin-inline: 0;
}

.prose figcaption {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  margin-top: var(--s-2);
}

.prose blockquote {
  margin: var(--s-5) 0;
  padding-left: var(--s-5);
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}

/* ==========================================================================
   Tables
========================================================================== */

.table-scroll {
  overflow-x: auto;
  margin-bottom: var(--s-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  margin: 0;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--display);
  font-weight: 700;
  padding: var(--s-3) var(--s-4);
  color: var(--ink-2);
}

th,
td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

thead th {
  background: var(--panel);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85em;
  white-space: nowrap;
  border-bottom: 2px solid var(--rule-strong);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--accent-wash);
}

td.model,
th.model {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

/* ==========================================================================
   The spec plate — the site's signature
   ==========================================================================
   Every machine in this catalogue carries a stamped plate with its model
   number and ratings. A model row is rendered as that plate, which is why the
   mono face and the tabular figures are load-bearing rather than styling.
========================================================================== */

.plates {
  list-style: none;
  margin: 0 0 var(--s-6);
  padding: 0;
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.plate {
  background: var(--plate);
  color: var(--plate-ink);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-5) var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  box-shadow: var(--shadow);
}

.plate__model {
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--step-1);
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--plate-ink);
}

.plate__name {
  font-family: var(--body);
  font-size: var(--step--1);
  line-height: 1.4;
  margin: 0;
  color: color-mix(in srgb, var(--plate-ink) 72%, transparent);
}

.plate__specs {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-1) var(--s-4);
  font-family: var(--mono);
  font-size: var(--step--1);
  font-variant-numeric: tabular-nums;
  border-top: 1px solid color-mix(in srgb, var(--plate-ink) 20%, transparent);
  padding-top: var(--s-3);
}

.plate__specs dt {
  color: color-mix(in srgb, var(--plate-ink) 60%, transparent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85em;
  align-self: center;
}

.plate__specs dd {
  margin: 0;
  font-weight: 500;
}

.plate__variants {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--plate-ink) 55%, transparent);
  margin: 0;
}

/* An unverified row is labelled where it is read, not in a footnote. */
.plate--pending .plate__model::after,
.badge-pending {
  content: 'unverified';
  font-family: var(--mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  vertical-align: super;
  margin-left: var(--s-2);
  color: var(--warn);
}

.source-note {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  background: var(--panel);
  border-left: 3px solid var(--rule-strong);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  margin-bottom: var(--s-6);
}

/* ==========================================================================
   Card grids
========================================================================== */

.grid {
  list-style: none;
  margin: 0 0 var(--s-6);
  padding: 0;
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.card {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s-4) var(--s-5);
  background: var(--ground);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  transition:
    border-color var(--fast) var(--ease-out),
    transform var(--fast) var(--ease-out);
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.card__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-0);
  margin: 0;
  line-height: 1.25;
}

.card__title a {
  text-decoration: none;
  color: var(--ink);
}

.card:hover .card__title a {
  color: var(--accent);
}

.card__note {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
  margin: 0;
}

.card__desc {
  font-size: var(--step--1);
  color: var(--ink-2);
  margin: 0;
}

/* Brand cards carry a count, so the grid can be scanned for depth. */
.card--brand .card__title {
  font-size: var(--step-1);
}

/* ==========================================================================
   Link lists
========================================================================== */

.link-list {
  list-style: none;
  margin: 0 0 var(--s-6);
  padding: 0;
  border-top: 1px solid var(--rule);
}

.link-list li {
  border-bottom: 1px solid var(--rule);
}

.link-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  text-decoration: none;
  color: var(--ink);
}

.link-list a:hover {
  color: var(--accent);
}

.link-list .note {
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--muted);
}

/* ==========================================================================
   Sections
========================================================================== */

.section {
  margin-bottom: var(--s-8);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--ink);
}

.section__head h2 {
  margin: 0;
  font-size: var(--step-2);
}

.section__head .more {
  font-family: var(--mono);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ==========================================================================
   Home
========================================================================== */

.hero {
  padding-block: var(--s-7) var(--s-6);
  border-bottom: 2px solid var(--ink);
  margin-bottom: var(--s-7);
}

.hero h1 {
  max-width: 20ch;
  margin-bottom: var(--s-4);
}

.hero p {
  font-size: var(--step-1);
  color: var(--ink-2);
  max-width: var(--measure);
  margin: 0;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  margin-top: var(--s-6);
  padding: 0;
  list-style: none;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.stat__n {
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--step-2);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat__l {
  font-family: var(--display);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ==========================================================================
   Footer
========================================================================== */

.foot {
  border-top: 1px solid var(--rule);
  background: var(--panel);
  padding-block: var(--s-6);
  font-size: var(--step--1);
  color: var(--ink-2);
}

.foot__cols {
  display: grid;
  gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  margin-bottom: var(--s-5);
}

.foot h2 {
  font-family: var(--display);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 var(--s-3);
  color: var(--muted);
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--s-2);
}

.foot a {
  color: var(--ink-2);
  text-decoration: none;
}

.foot a:hover {
  color: var(--accent);
}

.foot__base {
  border-top: 1px solid var(--rule-strong);
  padding-top: var(--s-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ==========================================================================
   Pagination
========================================================================== */

.pager {
  display: flex;
  gap: var(--s-4);
  justify-content: space-between;
  border-top: 1px solid var(--rule);
  padding-top: var(--s-4);
  font-family: var(--mono);
  font-size: var(--step--1);
}

/* ==========================================================================
   Motion
========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card:hover {
    transform: none;
  }
}
