/* Manul Portraits — one stylesheet for every page */

:root {
  --wall: #dce3e5;
  --ink: #1e2a33;
  --muted: #4c5a63;
  --link: #2b5870;
  --frame: #4b3425;
  --mat: #eef1ee;
  --brass: #c9a657;
  --brass-dark: #a8873c;
  --plaque-ink: #2a2213;
  --rule: #b9c4c8;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --cat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%234b3425' stroke='%234b3425' opacity='.2'%3E%3Cellipse stroke='none' cx='30' cy='29' rx='6' ry='5'/%3E%3Cellipse stroke='none' cx='70' cy='29' rx='6' ry='5'/%3E%3Cellipse stroke='none' cx='50' cy='37' rx='22' ry='16'/%3E%3Cpath stroke='none' d='M29 47C17 61 18 82 24 93H76C82 82 83 61 71 47Z'/%3E%3Cpath d='M74 89C88 89 93 76 87 66' fill='none' stroke-width='10' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --wall: #1a2125;
    --ink: #e2e7e9;
    --muted: #a7b3b9;
    --link: #93c3d9;
    --frame: #6b4a36;
    --mat: #2a3237;
    --rule: #34414a;
    --cat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23c9a657' stroke='%23c9a657' opacity='.3'%3E%3Cellipse stroke='none' cx='30' cy='29' rx='6' ry='5'/%3E%3Cellipse stroke='none' cx='70' cy='29' rx='6' ry='5'/%3E%3Cellipse stroke='none' cx='50' cy='37' rx='22' ry='16'/%3E%3Cpath stroke='none' d='M29 47C17 61 18 82 24 93H76C82 82 83 61 71 47Z'/%3E%3Cpath d='M74 89C88 89 93 76 87 66' fill='none' stroke-width='10' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
  }
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
}

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

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

.wrap {
  width: min(1080px, 100% - 32px);
  margin-inline: auto;
}

/* Header */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 28px 20px;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.site-nav { display: flex; gap: 22px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* Intro */

.intro { padding-block: 56px 40px; max-width: 38em; }

.intro h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.intro p { margin: 0 0 12px; color: var(--muted); }

/* Framed portraits */

.frame {
  position: relative;
  margin: 0;
  border: 12px solid var(--frame);
  padding: 12px;
  background: var(--mat);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 14px 22px -12px rgba(15, 25, 30, 0.55);
}

.frame .photo {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--cat) center 60% / 62% no-repeat, color-mix(in srgb, var(--mat) 82%, var(--frame));
  overflow: hidden;
}

.frame .photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plaque {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 18px auto 0;
  padding: 8px 26px 9px;
  background: linear-gradient(175deg, #dcbd6c, var(--brass) 45%, var(--brass-dark));
  color: var(--plaque-ink);
  text-align: center;
  line-height: 1.3;
  border-radius: 2px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}

/* screws */
.plaque::before,
.plaque::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #7d6328;
}
.plaque::before { left: 9px; }
.plaque::after { right: 9px; }

.plaque strong { display: block; font-size: 1.05rem; }
.plaque span { display: block; font-size: 0.85rem; font-style: italic; }

/* Gallery wall */

.wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 64px 56px;
  padding-block: 8px 72px;
}

.piece { flex: 0 1 300px; margin: 0; }

.plaque span:empty { display: none; }

.note {
  margin: 16px 0 0;
  font-size: 1rem;
  color: var(--muted);
}
.note:empty { display: none; }

.more { margin: 0 0 72px; }

/* Stories */

.stories { padding-block: 8px 72px; }

.story {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 40px;
  padding-block: 48px;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 24px;
}
.story:first-child { border-top: 0; padding-top: 16px; }

.story .frame { border-width: 9px; padding: 9px; align-self: start; }

.story h2 { margin: 0; font-size: 1.9rem; line-height: 1.15; }
.story .role { margin: 4px 0 18px; color: var(--muted); font-style: italic; }
.story p { margin: 0 0 14px; max-width: 36em; }
.story .today { color: var(--muted); }

/* Prose pages */

.prose { padding-block: 56px 72px; max-width: 38em; }
.prose h1 { margin: 0 0 20px; font-size: clamp(2rem, 4.5vw, 2.8rem); line-height: 1.1; }
.prose h2 { margin: 40px 0 10px; font-size: 1.35rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }

/* Footer */

.site-footer {
  padding-block: 22px 40px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Species page */

.species { display: grid; grid-template-columns: minmax(0, 38em) 260px; gap: 56px; padding-block: 56px 72px; align-items: start; }
.species .prose { padding: 0; }
.species aside { position: sticky; top: 24px; }
.species .frame { border-width: 10px; padding: 10px; }

.glance { margin: 28px 0 0; padding: 16px 18px; border: 1px solid var(--rule); background: color-mix(in srgb, var(--mat) 55%, transparent); font-size: 0.95rem; }
.glance h2 { margin: 0 0 8px; font-size: 1.05rem; }
.glance dl { margin: 0; }
.glance dt { font-weight: 700; }
.glance dd { margin: 0 0 8px; color: var(--muted); }

@media (max-width: 820px) {
  .species { grid-template-columns: 1fr; gap: 32px; }
  .species aside { position: static; max-width: 300px; }
}

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .intro { padding-block: 36px 28px; }
  .wall { gap: 36px 16px; }
  .piece { flex-basis: calc(50% - 8px); }
  .note { font-size: 0.9rem; }
  .wall .frame { border-width: 8px; padding: 7px; }
  .wall .plaque { padding: 6px 16px 7px; margin-top: 12px; }
  .wall .plaque::before { left: 5px; }
  .wall .plaque::after { right: 5px; }
  .wall .plaque strong { font-size: 0.95rem; }
  .wall .plaque span { font-size: 0.75rem; }
  .story { grid-template-columns: 1fr; gap: 20px; padding-block: 36px; }
  .story .frame { width: min(240px, 70%); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
