:root {
  --ink: #171a1f;
  --ink-soft: #30353c;
  --muted: #68707a;
  --paper: #f3f2ee;
  --surface: #ffffff;
  --surface-alt: #e9e9e6;
  --rule: #c9cbd0;
  --rule-dark: #858b93;
  --red: #c9252d;
  --red-dark: #971d24;
  --steel: #506174;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", Arial, sans-serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --shell: min(1160px, calc(100% - 40px));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; }

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: white;
  background: var(--red);
  font-weight: 600;
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.reference-bar {
  color: #b9bec5;
  background: var(--ink);
  border-bottom: 2px solid var(--red);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.reference-bar-inner {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header {
  position: relative;
  z-index: 5;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.wordmark-mark {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(from 225deg, var(--ink) 0 68%, var(--red) 68% 81%, #d8dade 81% 100%);
}

.wordmark-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: white;
}

.wordmark-mark::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 2px;
  right: 5px;
  bottom: 12px;
  background: var(--red);
  transform: rotate(-45deg);
  transform-origin: left;
}

.wordmark-mark span {
  position: relative;
  z-index: 1;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.wordmark-copy strong,
.wordmark-copy small {
  display: block;
  font-family: var(--display);
  line-height: .88;
  text-transform: uppercase;
}

.wordmark-copy strong { font-size: 24px; letter-spacing: .025em; }
.wordmark-copy small { color: var(--red); font-size: 14px; font-weight: 600; letter-spacing: .17em; }

.site-header nav { display: flex; align-items: stretch; gap: 4px; }

.site-header nav a {
  padding: 12px 14px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--red);
  border-bottom-color: var(--red);
}

.home-intro {
  padding: 70px 0 0;
  overflow: hidden;
  background-color: var(--paper);
  background-image: linear-gradient(rgba(23, 26, 31, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(23, 26, 31, .045) 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: 1px solid var(--rule-dark);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 470px);
  align-items: center;
  gap: 8%;
}

.index-label,
.record-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.index-label span,
.record-label span:first-child { color: var(--red); }

h1, h2, h3 {
  margin-top: 0;
  font-family: var(--display);
  font-weight: 600;
  line-height: .98;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin-bottom: 0;
  font-size: clamp(56px, 7vw, 88px);
  letter-spacing: -.025em;
}

h2 { margin-bottom: 0; font-size: clamp(38px, 4vw, 52px); letter-spacing: -.015em; }
h3 { font-size: 25px; letter-spacing: .01em; }

.lede {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
  line-height: 1.6;
}

.intro-copy .lede { max-width: 650px; }
.hero-actions { display: flex; align-items: center; gap: 24px; margin-top: 34px; }

.button {
  display: inline-block;
  padding: 12px 17px;
  color: white;
  background: var(--red);
  border: 1px solid var(--red-dark);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .035em;
  text-decoration: none;
  text-transform: uppercase;
}

.button:hover { background: var(--red-dark); }

.text-link {
  color: var(--ink-soft);
  border-bottom: 1px solid var(--rule-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.text-link:hover { color: var(--red); border-color: var(--red); }

.quick-index {
  background: var(--surface);
  border: 1px solid var(--rule-dark);
  box-shadow: 8px 8px 0 rgba(23, 26, 31, .08);
}

.panel-heading {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  color: white;
  background: var(--ink);
  border-bottom: 3px solid var(--red);
}

.panel-heading h2 { font-size: 29px; }

.panel-kicker,
.record-count,
.country-code,
.feature-code,
.level-number,
.level-code {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panel-kicker { display: block; margin-bottom: 3px; color: #9da3aa; }
.record-count { color: #aeb3ba; white-space: nowrap; }
.index-list a { display: grid; grid-template-columns: 52px 1fr 20px; align-items: center; min-height: 55px; padding: 0 18px; border-bottom: 1px solid var(--rule); text-decoration: none; }
.index-list a:hover { color: var(--red); background: #f7f7f5; }
.index-list a > span:last-child { text-align: right; }
.country-code { color: var(--muted); }
.index-list strong { font-size: 15px; font-weight: 600; }

.panel-footer {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  color: var(--ink-soft);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.panel-footer:hover { color: var(--red); }

.rev-scale {
  height: 66px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-top: 62px;
  color: var(--muted);
  border-bottom: 4px solid var(--ink);
  font-family: var(--mono);
  font-size: 9px;
}

.rev-scale i { height: 11px; border-left: 1px solid var(--rule-dark); }
.rev-scale span { position: relative; padding-bottom: 11px; }
.rev-scale span::after { content: ""; position: absolute; right: 50%; bottom: 0; height: 18px; border-left: 2px solid var(--ink); }
.rev-scale span:last-child { color: var(--red); }
.rev-scale span:last-child::after { border-color: var(--red); }

.photo-section {
  padding: 92px 0 100px;
  color: #eef0f2;
  background: var(--ink);
  border-bottom: 4px solid var(--red);
}

.photo-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 34px;
}

.photo-heading .index-label { margin-bottom: 0; color: #8f969e; }
.photo-heading h2 { max-width: 570px; text-align: right; }

.vehicle-gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.vehicle-gallery figure {
  grid-column: span 4;
  margin: 0;
  background: #22262c;
  border: 1px solid #3c424a;
}

.vehicle-gallery figure:nth-child(1),
.vehicle-gallery figure:nth-child(2) { grid-column: span 6; }

.vehicle-gallery figure > a {
  display: block;
  overflow: hidden;
  background: #0d0f12;
}

.vehicle-gallery img {
  width: 100%;
  height: 255px;
  display: block;
  object-fit: cover;
  filter: saturate(.86) contrast(1.04);
  transition: filter 160ms ease, transform 160ms ease;
}

.vehicle-gallery figure:nth-child(1) img,
.vehicle-gallery figure:nth-child(2) img { height: 330px; }
.vehicle-gallery figure:nth-child(4) img { object-position: 60% 63%; }

.vehicle-gallery a:hover img {
  filter: saturate(1) contrast(1.02);
  transform: scale(1.012);
}

.vehicle-gallery figcaption {
  min-height: 64px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
}

.vehicle-gallery figcaption strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.vehicle-gallery figcaption span {
  color: #969da5;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
  text-align: right;
  text-transform: uppercase;
}

.vehicle-gallery figcaption a { text-decoration: none; }
.vehicle-gallery figcaption a:hover { color: white; }

.database-section { padding: 94px 0 102px; background: var(--surface); }

.section-heading {
  display: grid;
  grid-template-columns: 1.05fr .75fr;
  align-items: end;
  gap: 8%;
  padding-bottom: 35px;
  border-bottom: 1px solid var(--ink);
}

.section-heading > p { max-width: 520px; margin: 0 0 2px; color: var(--muted); font-size: 14px; }

.hierarchy-table { margin: 0; padding: 0; list-style: none; }

.hierarchy-table li {
  display: grid;
  grid-template-columns: 50px 70px minmax(170px, .7fr) 1fr 20px;
  align-items: center;
  gap: 18px;
  min-height: 74px;
  border-bottom: 1px solid var(--rule);
}

.hierarchy-table li:hover { background: #f7f7f5; }
.hierarchy-table strong { font-family: var(--display); font-size: 22px; font-weight: 600; text-transform: uppercase; }
.hierarchy-table p { margin: 0; color: var(--muted); font-size: 13px; }
.level-number { color: var(--muted); }
.level-code { width: max-content; padding: 3px 7px; color: var(--steel); background: #e6e9ec; border: 1px solid #cbd0d5; }
.row-arrow { color: var(--red); font-family: var(--mono); font-size: 13px; text-align: right; }

.reference-section { padding: 105px 0 115px; }

.reference-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8%;
}

.reference-heading .index-label { grid-column: 1 / -1; }
.reference-heading > p:last-child { max-width: 500px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 55px;
  border: 1px solid var(--rule-dark);
  background: var(--surface);
}

.reference-grid article { min-height: 240px; padding: 25px 25px 30px; border-right: 1px solid var(--rule); }
.reference-grid article:last-child { border-right: 0; }
.feature-code { color: var(--red); }
.reference-grid h3 { margin: 58px 0 11px; }
.reference-grid p { margin: 0; color: var(--muted); font-size: 13px; }

.breadcrumbs { padding-top: 24px; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; color: var(--muted); font-family: var(--mono); font-size: 10px; text-transform: uppercase; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 9px; color: var(--rule-dark); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--red); }

.article-layout { min-height: 62vh; padding-top: 56px; padding-bottom: 100px; }

.page-heading {
  max-width: 900px;
  padding: 30px 0 42px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule-dark);
}

.record-label { justify-content: space-between; }
.page-heading h1 { font-size: clamp(58px, 8vw, 88px); }
.page-heading .lede { font-size: 17px; }

.record-image {
  max-width: 900px;
  margin: 28px 0 0;
  background: var(--surface);
  border: 1px solid var(--rule-dark);
}

.record-image img {
  width: 100%;
  height: clamp(300px, 46vw, 510px);
  display: block;
  object-fit: cover;
}

.record-image figcaption {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 13px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
  text-transform: uppercase;
}

.record-image figcaption span:first-child { color: var(--ink-soft); font-weight: 500; }
.record-image figcaption a { text-decoration: none; }
.record-image figcaption a:hover { color: var(--red); }

.prose { max-width: 800px; padding-top: 38px; font-size: 15px; }
.prose h2 { margin: 0 0 24px; font-size: 34px; }
.prose h3 { margin: 30px 0 0; padding: 15px 0 8px; border-top: 1px solid var(--rule); font-size: 25px; }
.prose h3 a { display: flex; align-items: center; justify-content: space-between; color: var(--ink); text-decoration: none; }
.prose h3 a::after { content: "→"; color: var(--red); font-family: var(--mono); font-size: 15px; }
.prose h3 a:hover { color: var(--red); }
.prose p { margin: 0 0 18px; color: var(--ink-soft); }
.prose h3 + p { margin-top: 0; color: var(--muted); }
.prose > p:last-child a { display: inline-block; margin-top: 20px; color: var(--red); font-weight: 600; text-decoration: none; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prose th { color: white; background: var(--ink); font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--rule); }
.prose tr:nth-child(even) td { background: var(--surface-alt); }

.site-footer {
  padding: 42px 0;
  color: #afb4ba;
  background: var(--ink);
  border-top: 4px solid var(--red);
}

.footer-inner { display: grid; grid-template-columns: 1fr auto auto; align-items: end; gap: 60px; }
.site-footer strong { color: white; font-family: var(--display); font-size: 21px; letter-spacing: .03em; text-transform: uppercase; }
.site-footer p { margin: 4px 0 0; font-size: 11px; }
.footer-links { display: flex; gap: 24px; font-size: 11px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: white; }
.footer-note { font-family: var(--mono); text-align: right; }

@media (max-width: 880px) {
  .intro-grid { grid-template-columns: 1fr; }
  .quick-index { margin-top: 50px; }
  .section-heading, .reference-heading { grid-template-columns: 1fr; }
  .section-heading > p, .reference-heading > p:last-child { margin-top: 22px; }
  .hierarchy-table li { grid-template-columns: 38px 60px 150px 1fr 16px; gap: 12px; }
  .reference-grid { grid-template-columns: 1fr; }
  .reference-grid article { min-height: 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .reference-grid article:last-child { border-bottom: 0; }
  .reference-grid h3 { margin-top: 30px; }
  .vehicle-gallery figure,
  .vehicle-gallery figure:nth-child(1),
  .vehicle-gallery figure:nth-child(2) { grid-column: span 6; }
  .vehicle-gallery figure:last-child { grid-column: span 12; }
  .footer-inner { grid-template-columns: 1fr auto; }
  .footer-links { display: none; }
}

@media (max-width: 640px) {
  :root { --shell: min(100% - 28px, 1160px); }
  .reference-bar-inner span:last-child { display: none; }
  .header-inner { min-height: 76px; }
  .wordmark-mark { width: 43px; height: 43px; }
  .wordmark-copy strong { font-size: 20px; }
  .site-header nav a { padding-inline: 8px; }
  .site-header nav a:not(:first-child) { display: none; }
  .home-intro { padding-top: 52px; }
  h1 { font-size: clamp(49px, 16vw, 68px); }
  h2 { font-size: 38px; }
  .hero-actions { align-items: flex-start; flex-direction: column; }
  .quick-index { box-shadow: 5px 5px 0 rgba(23, 26, 31, .08); }
  .panel-heading { align-items: flex-end; }
  .rev-scale { margin-top: 48px; }
  .photo-section { padding: 70px 0 76px; }
  .photo-heading { align-items: flex-start; flex-direction: column; }
  .photo-heading h2 { text-align: left; }
  .vehicle-gallery figure,
  .vehicle-gallery figure:nth-child(1),
  .vehicle-gallery figure:nth-child(2),
  .vehicle-gallery figure:last-child { grid-column: 1 / -1; }
  .vehicle-gallery img,
  .vehicle-gallery figure:nth-child(1) img,
  .vehicle-gallery figure:nth-child(2) img { height: 260px; }
  .database-section { padding: 72px 0 78px; }
  .hierarchy-table li { grid-template-columns: 32px 50px 1fr 14px; gap: 9px; padding: 12px 0; }
  .hierarchy-table p { grid-column: 3; margin-top: -8px; }
  .row-arrow { grid-column: 4; grid-row: 1 / span 2; }
  .reference-section { padding: 78px 0 85px; }
  .reference-grid { margin-top: 40px; }
  .article-layout { padding-top: 38px; }
  .page-heading { padding-top: 22px; }
  .record-label span:last-child { display: none; }
  .record-image figcaption { align-items: flex-start; flex-direction: column; gap: 4px; }
  .footer-inner { grid-template-columns: 1fr; gap: 18px; }
  .footer-note { text-align: left; }
}

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