/* Self-hosted from Google Fonts (SIL Open Font License). Latin only: nothing on the site needs Latin Extended. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: block;
  src: url(fonts/cormorant-garamond-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(fonts/cormorant-garamond-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant SC';
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url(fonts/cormorant-sc-500-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Old Standard TT';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(fonts/old-standard-tt-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Fallback for the Greek in varieties (β, γ, …), which none of the above have. Light, to sit with Cormorant. */
@font-face {
  font-family: 'Noto Serif Display';
  font-style: italic;
  font-weight: 300;
  font-display: block;
  src: url(fonts/noto-serif-display-300-italic-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
  font-family: 'Noto Serif Display';
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url(fonts/noto-serif-display-300-greek.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}

:root {
  --ground: #efe6c8;
  --paper: #f4ecd2;
  --mount: #e8ddb9;
  --mount-edge: #b9ab80;
  --rule-light: #cfc29a;
  --text: #2a2418;
  --text-muted: #5a4a2a;
  --accent: #7a2e1c;
  --stage: #15130d;
  --stage-text: #ece3c8;

  --serif: 'Cormorant Garamond', 'Noto Serif Display', Georgia, serif;
  --caps: 'Cormorant SC', 'Noto Serif Display', Georgia, serif;
  --title: 'Old Standard TT', 'Noto Serif Display', Georgia, serif;
}

* {
  box-sizing: border-box;
}

/* Spacing is in rem, so phones scale it all down by shrinking the root, not rule by rule.
   Text sizes are set separately (body's here), so they don't follow it. */
html {
  font-size: 16px;
}
html, body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--serif);
}
body {
  font-size: 18px;
}

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

img {
  display: block;
}

.wrap, .book {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 2rem;
}
.wrap.wide {
  max-width: 1440px;
}

.caps {
  font-family: var(--caps);
  font-weight: 500;
}

.double-rule {
  width: 100%;
  height: 3px;
  border-top: 1px solid var(--text);
  border-bottom: 1px solid var(--text);
}

.display {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--text);
}
.eyebrow {
  margin: 0;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.prose {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
}

/* Controls */

.button, .field {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: transparent;
  color: var(--text);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.1em;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.button:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.button.ghost {
  background: transparent;
}
.button.primary {
  height: 48px;
  padding: 0 24px;
  background: var(--text);
  color: var(--paper);
}
.button.primary:hover {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.button.large {
  height: 48px;
  padding: 0 24px;
}
.field {
  border-color: var(--mount-edge);
  background: var(--paper);
  font-family: var(--serif);
  font-size: 18px;
  padding: 0 14px;
}

/* A field with its button attached, the button stretching to the field's height. */
.search {
  display: flex;
}
.search .field {
  flex: 1;
  min-width: 0;
  border-color: var(--text);
  border-right: 0;
}
.search .button {
  height: auto;
}

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

/* Home: a title page. The masthead also heads the list pages. */

/* The title and nav are sized in em, so phones only change this. */
.masthead {
  font-size: 16px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 1.375rem 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
}
.masthead .top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.masthead .spacer, .masthead .menu {
  display: none;
}
.masthead .title {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: var(--title);
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  color: var(--text);
}
.masthead .small {
  font-size: 1.125em;
  letter-spacing: 0.1em;
}
.masthead .large {
  font-size: 2.25em;
  letter-spacing: 0.1em;

  transform: scale(1, 1.1);

  margin-top: 10px;
}
.masthead .nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 36px;
  font-family: var(--caps);
  font-weight: 500;
  font-size: 1em;
  letter-spacing: 0.1em;
}
.masthead .nav a {
  padding: 10px 0;
}

.potd {
  max-width: 1160px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.75rem 4.5rem;
}
/* Sized from the window's height, so the top of the reel shows under it: the image is 3:5, and 16rem
   is roughly the masthead, the padding, and a glimpse of the reel. Never wider than it used to be. */
.mount {
  flex: 0 1 clamp(200px, (100svh - 16rem) * 0.6, 340px);
  min-width: 200px;
  padding: 0.875rem;
  border: 1px solid var(--mount-edge);
  background: var(--mount);
}
.mount img {
  width: 100%;
  height: auto;
  background: var(--paper);
}
.potd .caption {
  flex: 1 1;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.potd .caption p {
  margin: 0;
}
.potd .number {
  font-size: 20px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  position: relative;
}
.potd .number:after {
  content: '';
  width: 70%;
  margin-left: 15%;
  height: 1px;
  background: var(--text-muted);
  position: absolute;
  bottom: -10px;
  left: 0px;
}
.potd .latin {
  margin: 0.25rem 0 0;
  font-weight: 400;
  font-style: italic;
  font-size: 54px;
  line-height: 1;
  color: var(--text);
  text-wrap: balance;
}
.potd .common {
  font-size: 24px;
}
.potd .meta {
  font-size: 18px;
  color: var(--text-muted);
}
.potd .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 0.625rem;
}
.potd .actions .button {
  height: 48px;
  padding: 0 1.5em;
}

/* A strip of random plates drifting across the page, edge to edge. */
.reel {
  overflow: hidden;
  padding-top: 2rem;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.reel .track {
  display: flex;
  width: max-content;
  animation: reel 90s linear infinite;
}
/* Spaced by a margin, not a gap, so each copy ends with its space and half the track is exactly one copy. */
.reel a {
  flex: none;
  margin-right: 1rem;
  padding: 0.4rem;
  border: 1px solid var(--mount-edge);
  background: var(--mount);
}
.reel img {
  display: block;
  width: auto;
  height: 13rem;
  background: var(--paper);
}
/* Keyboard focus only: a clicked plate keeps focus when you come back to the page. */
.reel .track:has(a:hover),
.reel .track:has(a:focus-visible) {
  animation-play-state: paused;
}
@keyframes reel {
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .reel {
    overflow-x: auto;
    mask-image: none;
  }
  .reel .track {
    animation: none;
  }
  .reel a[aria-hidden] {
    display: none;
  }
}

.finder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.finder .heading {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.24em;
}
.finder form {
  width: 100%;
  max-width: 720px;
}
.finder .field {
  height: 60px;
  padding: 0 1.25rem;
  font-size: 22px;
}
.finder .button.primary {
  padding: 0 28px;
}
.ideas {
  justify-content: center;
  max-width: 820px;
}
.ideas .chip {
  height: 38px;
  font-size: 15px;
}
/* With the finder's gap, this sits 1.5rem under the chips. */
.finder .browse {
  margin: 0.25rem 0 0;
}
.finder .browse a {
  text-decoration: underline;
}

.leader {
  flex: 1;
  border-bottom: 1px dotted var(--text);
}

.epigraph {
  padding-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.epigraph figure {
  margin: 0;
  max-width: 680px;
  padding-top: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.epigraph blockquote {
  margin: 0;
  font-style: italic;
  font-size: 21px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-line;
}
.epigraph figcaption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.epigraph figcaption .caps {
  font-size: 16px;
  letter-spacing: 0.14em;
}

/* Not found */

.not-found {
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 32px 0;
  text-align: center;
}
.not-found h1 {
  font-size: 52px;
  line-height: 1.05;
}
.not-found .actions {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* About page */

.about-page {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}
.about-page section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about-page h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.24em;
}
/* Citations: a superscript number whose source pops up above it. */
.cite {
  position: relative;
  font-size: 0.65em;
  line-height: 0;
}
.cite button {
  padding: 0 0.15em;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
}
.cite .source {
  position: absolute;
  bottom: 1.4em;
  left: 50%;
  z-index: 10;
  width: max-content;
  max-width: min(320px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--mount-edge);
  background: var(--paper);
  box-shadow: 0 4px 16px rgba(42, 36, 24, 0.15);
  font-size: 16px;
  line-height: 1.4;
  text-align: left;
  color: var(--text);
  transform: translateX(calc(-50% + var(--shift, 0px)));
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0.15s;
}
.cite:hover .source,
.cite button:focus-visible + .source,
.cite.open .source {
  visibility: visible;
  opacity: 1;
}

.about-page .prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.vignette {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.vignette img {
  max-height: 320px;
  max-width: 100%;
  width: auto;
  height: auto;
}
.vignette figcaption {
  font-style: italic;
  font-size: 17px;
  text-align: center;
  color: var(--text-muted);
}
.artists {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.artists dt {
  font-size: 22px;
  font-style: italic;
}
.artists dt span {
  margin-left: 6px;
  font-family: var(--caps);
  font-style: normal;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.artists dd {
  margin: 2px 0 0;
  font-size: 19px;
  line-height: 1.5;
}
.artists a,
.artist-index a,
.artist-rest a {
  text-decoration: underline;
  text-decoration-color: var(--mount-edge);
  text-underline-offset: 3px;
}
.artist-rest {
  font-size: 18px;
  line-height: 1.6;
}
/* The main artists, most plates first, in two columns (one on phones). */
.artist-index {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2 260px;
  column-gap: 32px;
  font-size: 18px;
  line-height: 1.6;
}
.artist-index li {
  break-inside: avoid;
}
.artist-index span {
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.downloads {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.downloads a, .downloads span {
  font-family: var(--caps);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: 0.14em;
}
.downloads a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.downloads span {
  color: var(--text-muted);
}
.downloads p {
  margin: 2px 0 0;
  font-size: 19px;
  line-height: 1.5;
}

/* List pages */

.list-page {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}
.list-page.liked {
  padding-bottom: 0;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}
.page-header .titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.page-header h1 {
  font-size: 52px;
  line-height: 1.05;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.filters .search {
  width: clamp(240px, 30vw, 440px);
}
.share-link {
  width: 100%;
  max-width: 720px;
}

.plate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px;
  transition: background 0.1s ease;
}
.card:hover {
  background: rgba(255, 250, 230, 0.45);
}
.card .image {
  position: relative;
  aspect-ratio: 3 / 5;
  margin-bottom: 4px;
  padding: 5px;
  background: var(--mount);
  border: 1px solid var(--mount-edge);
}
.card .image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--paper);
}
.card .number {
  position: absolute;
  top: 9px;
  right: 9px;
  background: rgba(244, 236, 210, 0.88);
  font-size: 16px;
  line-height: 1;
  text-box: trim-both ex alphabetic;
  padding: 7px 4px;
  color: var(--text-muted);
}
.card .latin, .card .common {
  padding: 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .latin {
  font-style: italic;
  font-size: 17px;
  color: var(--text);
}
.card .common {
  font-size: 15px;
  color: var(--text-muted);
}

.empty {
  font-size: 22px;
  color: var(--text-muted);
}

/* Equal side columns keep the page count centred when Previous or Next is missing. */
.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  font-family: var(--caps);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.pagination .prev {
  justify-self: end;
}
.pagination .next {
  justify-self: start;
}

/* By color */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--mount-edge);
  background: var(--paper);
  font-family: var(--caps);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--text);
}
.chip:hover {
  border-color: var(--text);
}
.chip[aria-current="page"] {
  border-color: var(--text);
  background: var(--text);
  color: var(--paper);
}
.chip .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.strip {
  display: flex;
  height: 28px;
  overflow: hidden;
  border: 1px solid var(--text);
}
/* One group per color family: a faint line between them, and the current one outlined. */
.strip .group {
  position: relative;
  display: flex;
  flex-basis: 0;
  min-width: 0;
}
.strip .group + .group {
  border-left: 1px solid color-mix(in srgb, var(--text) 30%, transparent);
}
.strip .group.on::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--text);
  pointer-events: none;
}
.strip a {
  flex: 1;
  min-width: 0;
  opacity: 0.35;
}
.strip .on a {
  opacity: 1;
}
.strip a:hover {
  opacity: 1;
  outline: 2px solid var(--text);
  outline-offset: -2px;
}

/* By taxon */

.chip .count {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0;
  color: var(--text-muted);
}
.chip[aria-current="page"] .count {
  color: inherit;
}

/* An indented tree: every branch hangs off its parent's line, at the middle of its row. */
/* The taxon treemap: tiles for orders and families, grouped by clade, laid out by taxon.php's script. */
.taxa p {
  margin: 0 0 16px;
  font-size: 16px;
  font-style: italic;
  color: var(--text-muted);
}
/* When the treemap is opened up, the header links back to the tree and on to the order's page. */
.page-header .eyebrow a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.page-header .eyebrow a:hover,
.page-header h1 a:hover {
  color: var(--accent);
}

/* The frame goes on the wrapper: the tiles are placed absolutely, so they'd ignore padding on the treemap. */
.taxa {
  padding: 2px;
  border: 1px solid var(--mount-edge);
}
.treemap {
  position: relative;
  width: 100%;
}
.treemap .n {
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}
.treemap .tile {
  position: absolute;
  overflow: hidden;
  container-type: size;
  border: 1px solid var(--ground);
  background: var(--stage);
}
.treemap .tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
  transition: transform 0.3s ease, filter 0.3s ease;
}
.treemap .tile:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}
/* The whole tile opens an order; the name on top of it goes to the order's page. */
.treemap .tile .open {
  position: absolute;
  inset: 0;
  cursor: zoom-in;
}
.treemap .tile .open.page {
  cursor: pointer;
}
.treemap .tile .caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 18px 8px 5px;
  background: linear-gradient(transparent, rgba(21, 19, 13, 0.8));
  color: var(--stage-text);
  line-height: 1.1;
  pointer-events: none;
}
.treemap .tile .name {
  min-width: 0;
  color: inherit;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(14px, 9cqi, 28px);
  pointer-events: auto;
}
.treemap .tile .name:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.treemap .tile .n {
  flex-shrink: 0;
  font-size: clamp(11px, 5cqi, 17px);
}
/* Tiles too small to label just show their plate; hovering says what they are. */
@container (max-width: 60px) or (max-height: 40px) {
  .treemap .tile .caption {
    display: none;
  }
}

/* Plate detail */

.plate-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  height: 100vh;
}
.stage {
  position: relative;
  overflow: hidden;
  background: var(--stage);
  color: var(--stage-text);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.stage.dragging {
  cursor: grabbing;
}
/* A picture that isn't a plate (the 404 hounds): fitted by CSS, on paper, with no zoom or drag. */
.stage.still {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: auto;
}
.stage.still .image {
  position: static;
  width: auto;
  height: auto;
  max-width: calc(100% - 192px);
  max-height: calc(100% - 64px);
  padding: 4%;
  box-sizing: border-box;
}
.stage .image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: var(--paper);
}
.stage .arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(236, 227, 200, 0.12);
  color: var(--stage-text);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.stage .arrow:hover {
  background: rgba(236, 227, 200, 0.22);
  color: #fff;
}
.stage .arrow.prev {
  left: 24px;
}
.stage .arrow.next {
  right: 24px;
}
.zoom {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(28, 25, 18, 0.7);
}
.zoom button {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--stage-text);
  font-family: var(--caps);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.zoom button.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.zoom button:hover {
  background: rgba(236, 227, 200, 0.12);
}
.stage .bar {
  display: none;
}
.round {
  display: flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 25, 18, 0.7);
  color: var(--stage-text);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.round:hover {
  background: rgba(236, 227, 200, 0.22);
  color: #fff;
}
.stage .close,
.stage .random {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  width: 48px;
  height: 48px;
  background: rgba(236, 227, 200, 0.12);
}
.stage .random {
  left: auto;
  right: 24px;
}
.stage .close:hover,
.stage .random:hover {
  background: rgba(236, 227, 200, 0.22);
}

.sheet {
  background: var(--ground);
  color: var(--text);
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.sheet .names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sheet .kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.like {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  margin-right: -6px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--caps);
  font-weight: 500;
  font-size: 17px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.like svg {
  fill: none;
}
.like:hover,
.like[aria-pressed="true"] {
  color: var(--accent);
}
.like[aria-pressed="true"] svg {
  fill: currentColor;
}
.sheet .latin {
  font-style: italic;
  font-size: 44px;
  line-height: 1.05;
}
.sheet .common {
  margin: 0;
  font-size: 22px;
  color: var(--text);
}
.facts {
  margin: 1em 0;
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 8px 12px;
  border-top: 4px double var(--text);
  padding-top: 1.3em;
}
.facts dt {
  font-family: var(--caps);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.facts dd {
  margin: 0;
}
/* A rank within the one above it, like Family under Order: a ↳ hook, drawn so it matches the text. */
.facts dt.sub {
  padding-left: 4px;
}
.facts dt.sub::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 1v4.5A2.5 2.5 0 0 0 4.5 8H11M8.5 5.5 11 8l-2.5 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 1v4.5A2.5 2.5 0 0 0 4.5 8H11M8.5 5.5 11 8l-2.5 2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.facts a {
  text-decoration: underline;
  text-decoration-color: var(--mount-edge);
  text-underline-offset: 3px;
}
.sheet .text {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet .text h2 {
  margin: 0;
  font-family: var(--caps);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}
.sheet .text p {
  margin: 0;
  font-size: 19px;
  line-height: 1.5;
}
.sheet .text a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sheet .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: auto;
  gap: 8px;
}
.sheet .actions svg {
  height: 0.8em;
  width: auto;
  margin: 0 3px;
  overflow: visible;
}
/* Flickr and BHL logos, in the page's ink rather than their own greys. */
.logo-ink {
  fill: var(--text);
}
.logo-mid {
  fill: color-mix(in srgb, var(--text) 85%, var(--paper));
}
.logo-light {
  fill: color-mix(in srgb, var(--text) 35%, var(--paper));
}
.sheet .steps {
  display: none;
}
.sheet .handle {
  display: none;
}

/* Phone */

@media (max-width: 800px) {
  html {
    font-size: 10px;
  }

  .masthead {
    font-size: 10px;
  }
  .masthead .top {
    justify-content: space-between;
  }
  .masthead .spacer {
    display: block;
    width: 44px;
  }
  .masthead .menu {
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
  }
  /* Squeezing the large title shouldn't take Curtis's down with it. */
  .masthead .small {
    font-size: 1.4em;
  }
  /* The open menu is a list to tap, so its links stay full size. */
  .masthead .nav {
    font-size: 1.6em;
    display: none;
    flex-direction: column;
    align-items: center;
  }
  .masthead .nav.open {
    display: flex;
  }
  /* The menu opens between the title and the rule, so the rule still closes off the masthead. */
  .masthead .double-rule {
    order: 1;
  }
  .masthead .nav a {
    padding: 0.9rem 0;
    font-size: max(1em, 14px);
  }

  /* Tighter underneath, so the reel peeks out below the plate's button. */
  .potd {
    flex-direction: column;
    padding-bottom: 1.5rem;
  }
  .reel {
    padding-top: 1.5rem;
  }
  .potd .caption {
    display: contents;
  }
  .potd .number {
    font-size: 16px;
    margin-bottom: -1rem !important;
  }
  .potd .number:after {
    display: none;
  }
  /* As on desktop, from the window's height: 380px is roughly the masthead, the caption stacked
     beneath (a one-line name), and a glimpse of the reel. */
  .mount {
    flex: none;
    width: clamp(180px, (100svh - 310px) * 0.6, 320px);
    max-width: 100%;
    min-width: 0;
  }
  .potd .latin {
    font-size: 36px;
    text-align: center;
  }
  .potd .common {
    font-size: 20px;
    text-align: center;
  }
  .potd .meta {
    font-size: 16px;
    text-align: center;
  }
  .potd .actions {
    width: 100%;
    display: grid;
  }
  .potd .actions .button {
    font-size: 15px;
    letter-spacing: 0.12em;
  }

  .finder .field {
    height: 52px;
    font-size: 18px;
  }
  .finder .button.primary {
    padding: 0 16px;
  }
  .ideas {
    width: calc(100% + 4rem);
    max-width: none;
    justify-content: flex-start;
  }

  .epigraph blockquote {
    font-size: 20px;
  }
  .epigraph figcaption .caps {
    font-size: 14px;
  }

  .page-header h1 {
    font-size: 38px;
  }
  .filters {
    width: 100%;
  }
  .filters .search {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .plate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px;
  }
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 -2rem;
    padding: 0 2rem;
    scrollbar-width: none;
  }
  .chips::-webkit-scrollbar {
    display: none;
  }
  .strip {
    height: 18px;
  }

  .plate-view {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  /* The stage fills the screen down to where the sheet shows the plate's names.
     --peek is measured by plate.php; the 16px is the sheet's overlap. */
  .stage {
    height: calc(100vh - var(--peek, 140px) + 16px);
    height: calc(100svh - var(--peek, 140px) + 16px);
    flex-shrink: 0;
  }
  .stage .arrow, .zoom {
    display: none;
  }
  .stage.still {
    padding: 16px 16px 32px;
  }
  .stage.still .image {
    max-width: 100%;
    max-height: 100%;
  }
  .stage .bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    font-size: 18px;
  }
  .stage .close {
    top: 8px;
    left: 8px;
    width: 44px;
    height: 44px;
    background: rgba(28, 25, 18, 0.7);
  }
  .stage .random {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    background: rgba(28, 25, 18, 0.7);
  }
  .stage .spacer {
    width: 44px;
  }
  .stage .bar span {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(28, 25, 18, 0.7);
  }
  .sheet .handle {
    display: block;
    align-self: center;
    width: 40px;
    height: 4px;
    margin: -10px 0 -4px;
    border-radius: 2px;
    background: var(--mount-edge);
  }
  .sheet {
    flex: 1;
    margin-top: -16px;
    position: relative;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.35);
    overflow: visible;
  }
  .sheet .latin {
    font-size: 34px;
  }
  .sheet .common {
    font-size: 20px;
  }
  /* Two equal columns, so the source buttons line up with the arrows above. minmax(0, …) holds
     them equal even when a label like "High Res" is wider than half the sheet. */
  .sheet .steps,
  .sheet .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0;
  }
  .sheet .steps .button,
  .sheet .actions .button {
    padding: 0 8px;
  }
  .sheet .actions .button:only-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 450px) {
  .masthead {
    font-size: 2vw;
  }
  .masthead .title {
    gap: 0px;
  }
}

/* Wide enough phones and small tablets fit a third column. */
@media (min-width: 530px) and (max-width: 800px) {
  .plate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
