:root {
  --ink: #111;
  --muted: #777;
  --accent: #0076DF;
  --faint: #aaa;
  --line: #e4e4e4;
  --paper: #fff;
  --placeholder: #f1f1f0;
  --radius: 2px;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }

html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body:has(dialog[open]) { overflow: hidden; }

/* Header */
.site-header {
  padding: clamp(26px, 4vw, 68px) var(--gutter) 20px;
}
.site-header h1 {
  padding: 0;
  margin: 1rem 0 4rem 0;
}
.site-header h2 {
  font-size: clamp(21px, 1.3vw, 46px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 0.95;
  margin: 1rem 0;
}
.header-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 24px;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.subtitle {
  margin: 0;
  font-size: clamp(13px, .65vw, 20px);;
  color: var(--ink);
}
.meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* Filters */
.filters {
  padding: 16px var(--gutter);
  /* border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 13px;
}
.filters .sep { color: var(--faint); }
.filters button {
  font: inherit;
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.filters button:hover { color: var(--ink); }
.filters button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* Grid */
.grid {
  padding: 18px var(--gutter) 96px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 34px 20px;
}
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 48px 28px; } }
@media (max-width: 620px)  { .grid { grid-template-columns: 1fr; gap: 48px; } }

.card {
  all: unset;
  display: block;
  cursor: pointer;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--paper);
}

.card:hover {
  border-bottom: 2px solid var(--line) ;
}
.card:focus-visible { outline: 1px solid var(--ink); outline-offset: 8px; }

.placeholder {
  aspect-ratio: 4 / 3;
  background: var(--placeholder);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  transition: background-color .2s ease;
}
.placeholder span {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.placeholder { position: relative; overflow: hidden; }
.placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.placeholder img.fit-contain { object-fit: contain; background: #fff; padding: 4%; }
/* 5% black wash over every image so white-background shots don't melt into the page */
.placeholder:has(img)::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.05); pointer-events: none; }
.card:hover .placeholder { background: #e9e9e7; }

.card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-bottom: 8px;
  /* border-bottom: 1px solid var(--line); */
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-meta span {
  font-size: 8px;
  padding: 1px 8px;
  color: var(--ink);
  border-radius: 50px;
  background: var(--placeholder);
}
.card-title {
  margin: 12px 0 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-cat {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.card-tension {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* Footer */
/* Wordmark: SVG viewBox is fitted to the text in app.js, so it always spans the full width */
.wordmark {
  padding: 0 var(--gutter);
}
.wordmark svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.wordmark text {
  font-size: 100px;
  font-weight: 800;
  letter-spacing: -0.04em;
  fill: var(--ink);
}

.site-footer {
  padding: 24px var(--gutter) 48px;
  /* border-top: 1px solid var(--line); */
  font-size: 12px;
  color: var(--muted);
}
.site-footer a { color: #000; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Modal */
.modal {
  width: calc(100% - 2 * var(--gutter));
  max-width: none;
  max-height: calc(100% - 2 * var(--gutter));
  padding: 0;
  border: 0px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.modal::backdrop { background: rgba(17, 17, 17, 0.55); }
.modal[open] { animation: modal-in .25s ease-out; }
.modal[open]::backdrop { animation: fade-in .25s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .modal[open], .modal[open]::backdrop { animation: none; }
}

.modal-close {
  /* Sticky, and pulled out of the flow with a negative bottom margin so it
     overlaps the body's top padding instead of pushing the layout around */
  position: sticky;
  top: 12px;
  z-index: 1;
  display: block;
  height: 30px;
  margin: 12px 12px -42px auto;
  font: inherit;
  font-size: 12px;
  background: var(--paper);
  border: 0px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
}
.modal-close:hover { border-color: var(--ink); }
.modal-close:focus { outline: none; }
.modal-close:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.modal-body {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  align-items: start;
  gap: clamp(24px, 4vw, 64px);
  padding: 56px clamp(20px, 4vw, 56px) 56px;
}
/* Image stays in view while the text column scrolls */
.entry-media { position: sticky; top: 24px; }
@media (max-width: 800px) {
  .modal-body { grid-template-columns: 1fr; gap: 32px; }
  .entry-media { position: static; }
}

.placeholder--large { aspect-ratio: 4 / 3; }
.image-credit { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.image-credit a { color: inherit; text-decoration: none; }
.image-credit a:hover { color: var(--ink); text-decoration: underline; }

.entry-head { margin: 0 0 40px; }
.entry-num {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.entry-head h2 {
  margin: 6px 0 24px;
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
  /* text-transform: uppercase; */
}
.entry-facts {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px 32px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.entry-facts dt { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.entry-facts dd { margin: 2px 0 0; font-size: 14px; }
@media (max-width: 560px) { .entry-facts { grid-template-columns: 1fr 1fr; gap: 12px 24px; } }

.entry-section {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.entry-section h3 {
  margin: 3px 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.entry-section p { margin: 0; font-size: 16px; line-height: 1.6; max-width: 46em; }
.entry-section p + p { margin-top: 0.9em; }
.entry-section a { color: var(--muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; font-size: 0.85em; }
.entry-section a:hover { color: var(--ink); }
.entry-section:last-child p { font-size: 20px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
.entry-section p.is-placeholder { color: var(--faint); font-style: italic; font-size: 15px; font-weight: 400; }
@media (max-width: 560px) { .entry-section { grid-template-columns: 1fr; gap: 6px; } }
