:root {
  --paper: #ffffff;
  --paper-raised: #fafafa;
  --ink: #111111;
  --ink-soft: #555555;
  --line: #dddddd;
  --line-strong: #afafaf;
  --spec: #767676;
  --tag-bg: #f0f0f0;
  --accent: #6b5fa8;
  --accent-soft: rgba(107, 95, 168, 0.12);
}

:root[data-theme="dark"] {
  --paper: #0e0e0e;
  --paper-raised: #161616;
  --ink: #f2f2f2;
  --ink-soft: #b5b5b5;
  --line: #2e2e2e;
  --line-strong: #454545;
  --spec: #8a8a8a;
  --tag-bg: #1e1e1e;
  --accent: #b3a4e8;
  --accent-soft: rgba(179, 164, 232, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.display {
  font-family: "Pixelify Sans", ui-sans-serif, system-ui, sans-serif;
}

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

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* masthead */

header.masthead {
  border-bottom: 2px solid var(--ink);
  padding: 36px 0 18px;
  margin-bottom: 6px;
}

.masthead-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.wordmark {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0;
}

.volume-tag {
  font-size: 12px;
  color: var(--spec);
  white-space: nowrap;
  letter-spacing: 0.05em;
  border: 1px solid var(--line-strong);
  padding: 5px 10px;
}

.tagline {
  max-width: 60ch;
  color: var(--ink-soft);
  margin: 14px 0 0;
  font-size: 14px;
}

.provenance {
  max-width: 60ch;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--spec);
}

/* interface legend */

.legend {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  align-items: center;
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.legend-diagram {
  width: 96px;
  height: 40px;
  flex-shrink: 0;
}

.legend-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  margin: 0 0 4px;
}

.legend-text p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  max-width: 62ch;
}

.legend-text p + p {
  margin-top: 8px;
}

/* section heads */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 46px 0 18px;
}

.section-head h2 {
  font-size: 15px;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  margin: 0;
  font-weight: 600;
}

.section-head .count {
  font-size: 12px;
  color: var(--spec);
}

/* catalog grid */

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.part {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 16px 16px;
  background: var(--paper-raised);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color 0.15s ease;
}

.part:hover {
  background-color: var(--accent-soft);
}

.part-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.part-num {
  font-size: 12px;
  color: var(--spec);
  letter-spacing: 0.03em;
}

.part-status {
  font-size: 10.5px;
  background: var(--tag-bg);
  color: var(--ink-soft);
  padding: 2px 7px;
  border: 1px solid var(--line-strong);
}

.part-icon {
  width: 100%;
  height: 100px;
}

.part-name {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.part-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0;
}

.part-specs {
  font-size: 11.5px;
  color: var(--spec);
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
  margin-top: auto;
}

.part-specs div {
  margin-bottom: 2px;
}

.part-price {
  font-size: 15px;
  font-weight: 600;
  margin-top: 4px;
}

/* print goods */

.goods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.good {
  border: 1px solid var(--line);
  padding: 18px;
  background: var(--paper-raised);
}

.good h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

.good p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 10px;
}

.good .meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--spec);
  border-top: 1px dashed var(--line-strong);
  padding-top: 8px;
}

/* footer */

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
  font-size: 12.5px;
  color: var(--spec);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

footer a {
  color: var(--ink-soft);
}

@media (max-width: 520px) {
  .masthead-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .legend {
    grid-template-columns: 1fr;
  }
}
