/* Dutch & Netherlandish Printers' Devices — static site styling
   Palette: aged paper + oxblood rubrication + slate ink, echoing the
   printed catalogue this data comes from rather than a generic app UI. */

:root {
  --paper: #f1ece1;
  --paper-deep: #e6dfcf;
  --ink: #201c16;
  --ink-soft: #4a4438;
  --rubric: #8a2e1f;      /* rubrication red, used sparingly */
  --rubric-deep: #6c2317;
  --slate: #2c4356;       /* links / secondary accent */
  --line: #c9beA4;
  --card: #faf7ef;
  --shadow: rgba(32, 28, 22, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Spectral", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.55;
}

h1, h2, h3, .display {
  font-family: "Fraunces", "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

a { color: var(--slate); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--slate); }

code, .notation, .ic-code {
  font-family: "IBM Plex Mono", "SFMono-Regular", Menlo, monospace;
  font-size: 0.82em;
}

/* ---------- header / running nav ---------- */
.site-header {
  background: var(--ink);
  color: var(--paper);
  padding: 1.1rem 1.5rem 0.9rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px var(--shadow);
}
.site-header .title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}
.site-title {
  font-family: "Fraunces", serif;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--paper);
}
.site-title a { color: inherit; border: none; }
.site-title small {
  display: block;
  font-family: "Spectral", serif;
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9c0ac;
  margin-top: 0.15rem;
}
.site-stats {
  font-size: 0.78rem;
  color: #b9b09a;
  font-family: "IBM Plex Mono", monospace;
}

.az-nav {
  max-width: 1100px;
  margin: 0.7rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.az-nav a {
  color: #e4dcc7;
  border: 1px solid #46433a;
  border-radius: 3px;
  padding: 0.18rem 0.55rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.4;
}
.az-nav a:hover, .az-nav a.current {
  background: var(--rubric);
  border-color: var(--rubric);
  color: #fff;
}
.az-nav a.empty { opacity: 0.35; pointer-events: none; }

/* ---------- page shell ---------- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}
.breadcrumb a { color: var(--slate); }

/* ---------- letter index page (bspr list) ---------- */
.letter-heading {
  font-size: 2.4rem;
  border-bottom: 3px solid var(--rubric);
  display: inline-block;
  padding: 0 0.15em 0.05em;
  margin: 0 0 1.4rem;
}
.bspr-list {
  columns: 2;
  column-gap: 2.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.bspr-list li {
  break-inside: avoid;
  margin-bottom: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.bspr-list a { font-size: 1.02rem; color: var(--ink); font-weight: 600; }
.bspr-list a:hover { color: var(--rubric); border-color: var(--rubric); }
.bspr-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}
.bspr-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--slate);
}

/* ---------- bspr detail page ---------- */
.bspr-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.2rem;
  margin-bottom: 1.6rem;
}
.bspr-header h1 { font-size: 2rem; margin: 0 0 0.3rem; }
.bspr-id-tag {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--rubric-deep);
  background: #f3e4d9;
  border-radius: 3px;
  padding: 0.08rem 0.4rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.bspr-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}
.bspr-facts dt { font-weight: 600; color: var(--ink); }
.bspr-facts dd { margin: 0; }

.device-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.device-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
  box-shadow: 0 1px 3px var(--shadow);
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 1.75rem;
  align-items: start;
}
.device-left {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.device-right {
  display: flex;
  flex-direction: column;
  min-width: 0; /* allow long IC text to wrap instead of overflowing the grid column */
}
.device-thumb-wrap {
  min-height: 140px;
  max-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 0.4rem;
}
.device-thumb-wrap img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  filter: grayscale(1) contrast(1.02);
}
.device-thumb-missing {
  color: var(--ink-soft);
  font-size: 0.75rem;
  font-style: italic;
  text-align: center;
  padding: 2rem 1rem;
}
.device-id {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
  color: var(--slate);
  margin-bottom: 0.35rem;
}
.device-caption {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 0.8rem;
}
.device-ic {
  font-size: 0.82rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.6rem;
}
.ic-entry { margin-bottom: 0.3rem; display: flex; gap: 0.5rem; align-items: baseline; flex-wrap: wrap; }
.ic-entry a.ic-code {
  color: var(--rubric-deep);
  white-space: nowrap;
  border-bottom: 1px dotted var(--rubric-deep);
}
.ic-entry a.ic-code:hover { color: var(--rubric); border-bottom-style: solid; }
.ic-desc { color: var(--ink-soft); }
.ic-desc .ic-sep { color: var(--rubric); margin: 0 0.35em; font-style: normal; }

.device-usage {
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.55rem 0.7rem;
}
.device-usage .years { font-family: "IBM Plex Mono", monospace; font-weight: 500; color: var(--ink); }
.device-usage .other-printers { margin-top: 0.35rem; }
.device-usage .note { font-style: italic; margin-top: 0.2rem; }

@media (max-width: 640px) {
  .device-card { grid-template-columns: 1fr; }
}

/* ---------- Visual Survey ---------- */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.9rem;
}
.visual-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 4px;
  padding: 0.5rem;
  text-decoration: none;
  color: var(--ink);
}
.visual-card:hover { border-color: var(--rubric); box-shadow: 0 1px 4px var(--shadow); }
.visual-thumb {
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
}
.visual-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(1); }
.visual-thumb-missing { font-size: 0.65rem; color: var(--ink-soft); font-style: italic; }
.visual-id { font-family: "IBM Plex Mono", monospace; font-size: 0.7rem; color: var(--slate); }

/* ---------- device detail (full page, one device) ---------- */
.device-detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 2rem;
  align-items: start;
}
.device-detail-image {
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.6rem;
}
.device-detail-image img { width: 100%; height: auto; filter: grayscale(1); }
.used-by-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.used-by-list li { margin-bottom: 0.4rem; }

footer.site-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 2rem 1rem 3rem;
}

@media (max-width: 640px) {
  .bspr-list { columns: 1; }
  .bspr-facts { grid-template-columns: 1fr; }
  .device-detail-grid { grid-template-columns: 1fr; }
}

/* ---- home page ---- */
.home-hero { text-align:center; padding:2.5rem 0 1rem; }
.home-kicker { font-family:"IBM Plex Mono",monospace; font-size:.8rem; letter-spacing:.08em; text-transform:uppercase; color:var(--slate); margin:0; }
.home-hero h1.display { font-size:3rem; margin:.4rem 0 1rem; }
.home-lede { max-width:56ch; margin:0 auto 1rem; font-size:1.15rem; }
.home-stats { color:var(--slate); }
.home-cta { margin:1.5rem 0; display:flex; gap:1rem; justify-content:center; flex-wrap:wrap; }
.btn { display:inline-block; padding:.6rem 1.3rem; background:var(--rubric); color:#fff; border-radius:2px; }
.btn:hover { filter:brightness(1.1); text-decoration:none; }
.btn-alt { background:var(--slate); }
.home-strip { display:flex; gap:1rem; justify-content:center; align-items:center; flex-wrap:wrap; margin:1rem 0 2.5rem; }
.home-strip img { height:110px; width:auto; border:1px solid #cfc7b3; background:#fff; padding:3px; }
.home-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(15rem,1fr)); gap:1rem; }
.home-tile { display:block; padding:1rem 1.2rem; border:1px solid #cfc7b3; background:rgba(255,255,255,.4); color:inherit; }
.home-tile:hover { border-color:var(--rubric); text-decoration:none; }
.home-tile h2 { margin:0 0 .3rem; font-size:1.1rem; color:var(--rubric); }
.home-tile p { margin:0; font-size:.95rem; }
.home-credit { text-align:center; margin:2.5rem 0 1rem; font-size:.9rem; color:var(--slate); }
/* ---- prose (intro) ---- */
.prose { max-width:68ch; margin:0 auto; line-height:1.65; }
.prose h1 { font-family:"Fraunces",serif; font-size:2rem; }
.prose h2 { margin-top:2rem; font-size:1.3rem; }
.prose h3 { margin-top:1.5rem; font-size:1.1rem; }
.prose img { display:block; margin:1.2rem auto; max-width:100%; height:auto; border:1px solid #cfc7b3; background:#fff; padding:3px; }
.prose blockquote { margin:1rem 0; padding:.2rem 1rem; border-left:3px solid var(--rubric); color:#4a4338; }
.prose .footnote { font-size:.9rem; border-top:1px solid #cfc7b3; margin-top:2rem; }
