/* art.dzoba.com
   Type and accent follow dzoba.com (IBM Plex Mono/Sans, sage links). The page
   is light rather than dzoba.com's near-black because the drawings are dark
   ink on white paper, and the SVGs have no background of their own.
   Contrast (WCAG AA, normal text) is checked against --bg:
   --text 16.7:1, --muted 6.2:1, --faint 5.0:1, --link 5.6:1. */

:root {
  --bg: #f7f7f6;
  --paper: #ffffff;
  --border: #e3e3e1;
  --text: #171717; /* the black ink used in the drawings */
  --muted: #5c5c5c;
  --faint: #6b6b6b;
  --link: #4a6b50; /* dzoba.com sage (#6b8f71), darkened for a light page */
  --link-hover: #34503a;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --wide: 76rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

main {
  flex: 1;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  font-family: var(--mono);
  font-weight: 500;
  line-height: 1.25;
  margin: 0;
}

h1 {
  font-size: clamp(1.6rem, 3vw, 2rem);
}

h2 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1rem;
}

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

.prose {
  max-width: 40rem;
  color: var(--muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.mono {
  font-family: var(--mono);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  background: var(--paper);
  padding: 0.25rem 0.5rem;
  z-index: 10;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand span {
  color: var(--faint);
  font-weight: 400;
}

.site-nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--muted);
}

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

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 5rem;
  color: var(--faint);
  font-size: 0.875rem;
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.site-footer a {
  color: var(--faint);
}

.site-footer a:hover {
  color: var(--link);
}

/* Paper: a white sheet with a hairline edge, used for every drawing */

.paper {
  background: var(--paper);
  border: 1px solid var(--border);
}

/* Home */

.intro {
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.intro p {
  font-size: 1.1rem;
  max-width: 36rem;
  color: var(--muted);
  margin: 0;
}

.series-list {
  display: grid;
  gap: 4rem;
}

.series-card {
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .series-card {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 3rem;
  }
}

.series-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.series-card h2 a {
  color: var(--text);
}

.series-card h2 a:hover {
  color: var(--link);
}

.meta {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--faint);
  margin-bottom: 1rem;
}

.series-card .summary {
  color: var(--muted);
}

/* Series page */

.page-head {
  padding: clamp(2.5rem, 6vw, 4rem) 0 2rem;
}

.page-head h1 {
  margin-bottom: 0.5rem;
}

.crumbs {
  font-size: 0.9rem;
  color: var(--faint);
  margin-bottom: 1rem;
}

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

.group {
  padding-top: 3.5rem;
}

.group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.group-head h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.group-head p {
  margin: 0;
  color: var(--faint);
  font-size: 0.9rem;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 2.25rem 1.75rem;
}

/* A series with a single drawing gets one wide card instead of a lone small one */
.grid.solo {
  grid-template-columns: minmax(0, 48rem);
}

.card {
  display: block;
  color: var(--text);
}

.card:hover {
  color: var(--text);
  text-decoration: none;
}

.card img {
  width: 100%;
  transition: box-shadow 150ms ease;
}

.card:hover img {
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.08);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.65rem;
}

.card-num {
  font-family: var(--mono);
  font-weight: 500;
}

.card:hover .card-num {
  color: var(--link);
}

.accents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.accents li,
.inks li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.accents,
.inks {
  list-style: none;
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  background: var(--c, var(--text));
}

.status {
  font-size: 0.8rem;
  color: var(--faint);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.status::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}

.status.plotted {
  color: var(--text);
}

.status.plotted::before {
  background: currentColor;
}

/* Drawing page */

.drawing-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 1.5rem 0 1.25rem;
}

.drawing-top .crumbs {
  margin: 0;
}

.pager {
  display: flex;
  gap: 1.25rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.pager .off {
  color: var(--border);
}

.figure {
  margin: 0;
}

.figure a {
  display: block;
}

.figure img {
  margin: 0 auto;
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  height: auto;
  background: var(--paper);
}

.figure figcaption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--faint);
  margin-top: 0.75rem;
}

.figure figcaption a {
  display: inline;
}

.drawing-info {
  display: grid;
  gap: 2rem;
  padding-top: 2.5rem;
}

@media (min-width: 52rem) {
  .drawing-info {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 4rem;
  }
}

.drawing-info h1 {
  margin-bottom: 0.75rem;
}

.drawing-info .lede {
  color: var(--muted);
}

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.55rem 1.5rem;
  font-size: 0.95rem;
}

.facts dt {
  color: var(--faint);
}

.facts dd {
  margin: 0;
}

.inks {
  display: grid;
  gap: 0.2rem;
}

/* Ink rows wrap as text; as flex items the names could be squeezed mid-word */
.inks li {
  display: block;
}

.inks .swatch {
  margin-right: 0.4rem;
}

.inks .n {
  color: var(--faint);
}

.num {
  font-family: var(--mono);
  font-size: 0.9em;
}

.detail {
  padding-top: 3.5rem;
}

.detail h2 {
  margin-bottom: 1.25rem;
}

.prevnext {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.95rem;
}

.prevnext .next {
  text-align: right;
}

.prevnext .up {
  text-align: center;
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* About and 404 */

.placeholder {
  border: 1px dashed var(--faint);
  padding: 0.75rem 1rem;
  color: var(--muted);
  background: var(--paper);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
