/* jakekemple.com
   White paper, black ink, one blue. Serif type, mono labels, generated
   plots for character. */

/* ------------------------------------------------------------ fonts */

@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("../fonts/instrument-serif-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-opsz.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("../fonts/newsreader-opsz-italic.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2-variations");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------ tokens */

:root {
  color-scheme: light;

  --paper: #fcfcfa;
  --ink: #141414;
  --ink-2: #4a4a47;
  --ink-3: #8b8a85;
  --rule: #e4e2dc;
  --rule-2: #cfccc4;
  --wash: #f3f2ee;
  --accent: #2347d8;

  --art-ink: var(--ink);
  --art-paper: var(--paper);
  --art-accent: var(--accent);

  --f-display: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --f-text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: clamp(1rem, 4vw, 3rem);
  --max: 82rem;
  --measure: 38rem;

  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: clamp(1.0625rem, 0.98rem + 0.3vw, 1.1875rem);
  line-height: 1.6;
  font-optical-sizing: auto;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

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

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 0.2em;
  transition: color 0.2s, text-decoration-color 0.2s;
}
a:hover { color: var(--accent); text-decoration-color: currentColor; }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}

::selection { background: var(--accent); color: var(--paper); }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.8rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; }

.eyebrow, .mono {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  line-height: 1.4;
}
.eyebrow { margin: 0 0 1.25rem; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }

.lede {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 36rem;
  font-weight: 350;
}
.lede a { color: var(--ink); }

.notice {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  border-left: 2px solid var(--accent);
  padding: 0.2rem 0 0.2rem 0.8rem;
  max-width: 36rem;
}

/* ------------------------------------------------------------ header */

.site-head {
  view-transition-name: site-head;
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.site-head.scrolled { border-bottom-color: var(--rule); }

.site-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-family: var(--f-display);
  font-size: 1.45rem;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark-mark { width: 1.9rem; height: 1.9rem; display: inline-block; }
.wordmark-mark svg { width: 100%; height: 100%; }

.site-nav {
  display: flex;
  gap: clamp(0.9rem, 2.2vw, 2rem);
}
.site-nav a {
  font-family: var(--f-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.4rem 0;
  position: relative;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.1rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"]::after { transform: scaleX(1); background: var(--accent); }
.nav-n { color: var(--ink-3); font-size: 0.62rem; }
.nav-short { display: none; }

@media (max-width: 46rem) {
  .site-head-inner { flex-direction: column; align-items: flex-start; gap: 0; padding-block: 0.7rem 0.3rem; }
  .site-nav { width: 100%; justify-content: space-between; gap: 0.5rem; }
  .nav-n { display: none; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
}

/* ------------------------------------------------------------ plots */

.plot {
  margin: 0;
  position: relative;
}
.plot-frame {
  aspect-ratio: var(--aspect, 1);
  width: 100%;
  position: relative;
}
.plot-frame svg {
  width: 100%;
  height: 100%;
}
.art .ln {
  fill: none;
  stroke: var(--art-ink);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.art .dots { fill: var(--art-ink); }

.plot[data-redraw] .plot-frame { cursor: pointer; }

/* the pen: strokes draw in, fills fade up */
.plot.drawing .stroke-anim {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: pen var(--dur, 1.6s) var(--ease) forwards;
  animation-delay: var(--delay, 0s);
}
.plot.drawing .fade-anim {
  opacity: 0;
  animation: fade 1s var(--ease) forwards;
  animation-delay: var(--delay, 0s);
}
.plot .plot-frame svg { animation: settle 0.6s var(--ease); }
@keyframes pen { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes settle { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .plot.drawing .stroke-anim, .plot.drawing .fade-anim, .plot .plot-frame svg {
    animation: none; stroke-dasharray: none; opacity: 1;
  }
}

/* ------------------------------------------------------------ home */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  padding-block: clamp(3rem, 9vw, 8rem) clamp(3rem, 7vw, 6rem);
}
.hero-title {
  font-size: clamp(3rem, 1.6rem + 5.6vw, 7.25rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin-bottom: 2rem;
}
.hero-title em { font-style: italic; color: var(--ink-2); }
.hero-plot { align-self: center; }

@media (max-width: 52rem) {
  .hero { grid-template-columns: 1fr; }
  .hero-plot { max-width: 28rem; width: 100%; margin-inline: auto; }
}

.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--ink);
  padding-top: 1rem;
  margin-bottom: 2rem;
}
.section-title { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.75rem); }
.section-more {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
}

/* project rows (home and /work/) */
.work-list { list-style: none; margin: 0; padding: 0; }
.work-row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  gap: 0.4rem clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.work-row:first-child { border-top: 1px solid var(--rule); }
.work-meta {
  display: flex; gap: 0.75rem;
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.work-main { display: flex; flex-direction: column; gap: 0.3rem; }
.work-title {
  font-family: var(--f-display);
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.75rem);
  line-height: 1.05;
  text-decoration: none;
  width: fit-content;
}
.work-arrow {
  display: inline-block;
  font-family: var(--f-text);
  font-size: 0.55em;
  vertical-align: 0.35em;
  color: var(--ink-3);
  transition: transform 0.35s var(--ease), color 0.2s;
}
.work-title:hover .work-arrow { transform: translate(0.15em, -0.15em); color: var(--accent); }
.work-summary { color: var(--ink-2); max-width: 38rem; }
.work-links { display: flex; gap: 1rem; font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
.work-links a { text-decoration: none; color: var(--ink-2); }
.work-links a:hover { color: var(--accent); }
@media (max-width: 46rem) {
  .work-row { grid-template-columns: 1fr; }
}

.section-tight { padding-bottom: clamp(2.5rem, 5vw, 4rem); }
.page-head-art {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, 22rem);
  gap: 2rem;
  align-items: end;
}
@media (max-width: 46rem) { .page-head-art { grid-template-columns: 1fr; } .head-plot { max-width: 16rem; } }

.split {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 6rem);
}
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

.elsewhere { display: grid; gap: 1.25rem; align-content: start; }
.card {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1.25rem;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--rule);
  padding: 1rem;
  transition: border-color 0.3s;
}
.card:hover { border-color: var(--ink); color: var(--ink); }
.card-text { display: flex; flex-direction: column; gap: 0.2rem; }
.card-title { font-family: var(--f-display); font-size: 1.6rem; line-height: 1.1; }
.card-sub { color: var(--ink-3); font-size: 0.95rem; }

/* ------------------------------------------------------------ post lists */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-list li:first-child { border-top: 1px solid var(--rule); }
.post-list li[hidden] { display: none; }
.post-list a {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: baseline;
  padding-block: 1.25rem;
  text-decoration: none;
}
.post-list time, .post-list-cat {
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.post-list-body { display: flex; flex-direction: column; gap: 0.3rem; }
.post-list-title {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
  line-height: 1.1;
  transition: color 0.2s;
}
.post-list a:hover .post-list-title { color: var(--accent); }
.post-list-desc { color: var(--ink-2); max-width: 40rem; }
.post-list.compact a { grid-template-columns: 5.5rem minmax(0, 1fr) auto; }
.post-list.compact .post-list-title { font-size: 1.45rem; }

@media (max-width: 40rem) {
  .post-list a, .post-list.compact a { grid-template-columns: 1fr; gap: 0.35rem; }
  .post-list-cat { display: none; }
}

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.chip {
  appearance: none;
  font: inherit;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  display: inline-flex;
  gap: 0.45rem;
  align-items: baseline;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip[aria-pressed="true"] .chip-n { color: color-mix(in srgb, var(--paper) 65%, transparent); }
.chip:disabled { opacity: 0.35; cursor: default; }
.chip:disabled:hover { border-color: var(--rule-2); color: var(--ink-2); }
.chip-n { color: var(--ink-3); font-size: 0.65rem; }

.empty { color: var(--ink-3); font-style: italic; padding-block: 2rem; }

/* ------------------------------------------------------------ pages */

.page-head { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2rem, 5vw, 3.5rem); }
.page-title {
  font-size: clamp(3.25rem, 2rem + 5vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}
.page .prose { padding-bottom: 5rem; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: clamp(1.8rem, 1.5rem + 1vw, 2.3rem); margin: 2.75rem 0 1rem; }
.prose h3 { font-size: 1.5rem; margin: 2rem 0 0.75rem; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1.25em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 600; }
.prose blockquote {
  margin: 2rem 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--ink);
  font-style: italic;
  color: var(--ink-2);
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }
.prose img { margin: 2rem 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0 2rem;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.prose th {
  text-align: left;
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--ink);
  padding: 0.5rem 0.75rem 0.5rem 0;
}
.prose td { border-bottom: 1px solid var(--rule); padding: 0.6rem 0.75rem 0.6rem 0; }

code, pre { font-family: var(--f-mono); font-size: 0.84em; }
:not(pre) > code { background: var(--wash); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  background: var(--wash);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.5rem 0;
  border-left: 2px solid var(--ink);
}
.highlight .c, .highlight .c1, .highlight .cm { color: var(--ink-3); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kr, .highlight .nb { color: var(--accent); }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .si { color: #6b4b1f; }
.highlight .mi, .highlight .mf { color: #8a2c1c; }

/* ------------------------------------------------------------ post page */
.post-head { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 4vw, 3rem); max-width: calc(52rem + var(--gutter) * 2); }
.post-title { font-size: clamp(2.75rem, 1.8rem + 4vw, 5.5rem); line-height: 0.98; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.post-meta { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.post-body { padding-bottom: 4rem; margin-inline: auto; }
.post-head, .post-body { margin-inline: auto; }
.post-pager { display: flex; justify-content: space-between; gap: 2rem; padding-bottom: 4rem; max-width: calc(52rem + var(--gutter) * 2); }
.post-pager a { display: flex; flex-direction: column; text-decoration: none; font-family: var(--f-display); font-size: 1.5rem; border-top: 1px solid var(--ink); padding-top: 1rem; flex: 1; }
.post-pager a.right { text-align: right; }
.post-pager .eyebrow { margin-bottom: 0.4rem; }

/* 404 */
.lost {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding-block: clamp(3rem, 8vw, 6rem);
}
@media (max-width: 46rem) { .lost { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ gallery */

.gallery { padding-bottom: 5rem; }
.gallery-bar {
  display: grid;
  gap: 1.25rem;
  border-top: 1px solid var(--ink);
  padding-top: 1.25rem;
  margin-bottom: 1.5rem;
}
.gallery-bar .chips { margin: 0; }
.gallery-controls { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; align-items: end; }
.field { display: grid; gap: 0.3rem; }
.field-label { font-family: var(--f-mono); font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.field input, .field select {
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule-2);
  padding: 0.3rem 1.4rem 0.35rem 0;
  border-radius: 0;
  min-width: 10rem;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: right 0.45rem center, right 0.1rem center;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--accent); }
.field input::placeholder { color: var(--ink-3); }

.gallery-status { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 1rem; }

.gallery-grid { display: flex; flex-direction: column; gap: var(--gap, 8px); min-height: 40vh; }
.g-row { display: flex; gap: var(--gap, 8px); }
.tile {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: var(--wash);
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  flex: none;
  opacity: 0;
  animation: tile-in 0.6s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 25ms);
}
@keyframes tile-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none; opacity: 1; } }
.tile img, .tile svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease), opacity 0.4s;
}
.tile img { opacity: 0; }
.tile img.loaded { opacity: 1; }
.tile.placeholder { background: var(--paper); outline: 1px solid var(--rule); outline-offset: -1px; }
.tile.placeholder svg { padding: 4%; }
.tile:hover img, .tile:hover svg { transform: scale(1.025); }
.tile-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1.5rem 0.7rem 0.55rem;
  font-family: var(--f-mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s, transform 0.3s var(--ease);
  text-align: left;
}
.tile.placeholder .tile-cap { color: var(--ink-2); background: linear-gradient(transparent, color-mix(in srgb, var(--paper) 92%, transparent)); }
.tile:hover .tile-cap, .tile:focus-visible .tile-cap { opacity: 1; transform: none; }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 0.35rem; margin-top: 2.5rem; flex-wrap: wrap; }
.pager button, .pager span {
  appearance: none;
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 0 0.6rem;
}
.pager button { cursor: pointer; }
.pager button:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.pager button[aria-current="page"] { background: var(--ink); color: var(--paper); }
.pager button:disabled { opacity: 0.3; cursor: default; }

/* lightbox */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--paper) 97%, transparent);
  color: var(--ink);
  display: none;
  grid-template-rows: minmax(0, 1fr) auto;
}
.lightbox[open] { display: grid; animation: lb-in 0.35s var(--ease); }
.lightbox::backdrop { background: transparent; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-stage {
  position: relative;
  display: grid;
  /* a definite row, so the image's max-height: 100% has something to
     resolve against; an auto row would grow to the image instead */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 3rem) 0;
  min-height: 0;
  touch-action: pan-y;
}
.lb-stage img, .lb-stage svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 40px rgba(0, 0, 0, 0.08);
  animation: settle 0.4s var(--ease);
}
.lb-stage svg { background: var(--paper); height: 100%; aspect-ratio: var(--ar); outline: 1px solid var(--rule); }
.lb-stage img.lb-thumb { filter: blur(8px); }
.lb-info {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem) clamp(1rem, 3vw, 1.75rem);
}
.lb-title { font-family: var(--f-display); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); line-height: 1.1; margin: 0 0 0.35rem; }
.lb-meta { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 0.5rem; display: flex; gap: 1rem; }
.lb-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0; }
.lb-tags .chip { padding: 0.25rem 0.65rem; font-size: 0.64rem; }
.lb-nav { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.lb-count { font-family: var(--f-mono); font-size: 0.72rem; color: var(--ink-3); margin-right: 0.6rem; font-variant-numeric: tabular-nums; }
.lb-btn {
  appearance: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.lb-btn:hover { border-color: var(--ink); }
.lb-close { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.lb-close:hover { background: var(--accent); border-color: var(--accent); }
@media (max-width: 40rem) {
  .lb-info { flex-direction: column; align-items: stretch; }
  .lb-nav { justify-content: flex-end; }
}

/* ------------------------------------------------------------ footer */

.site-foot { margin-top: 3rem; }
.foot-plot { opacity: 0.7; }
.site-foot-inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  /* the rule spans the content box, not the gutters */
  background: linear-gradient(var(--ink), var(--ink)) content-box top / 100% 1px no-repeat;
  padding-block: 1.25rem 2rem;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.foot-name { font-family: var(--f-display); font-size: 1.3rem; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; padding: 0; }
.foot-links a { text-decoration: none; }
.foot-meta { margin: 0; }

/* ------------------------------------------------------------ page transitions */

@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.18s ease-in both; }
::view-transition-new(root) { animation: vt-in 0.38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
