:root {
  --bg: #fbfbf9;
  --ink: #171716;
  --muted: #74736e;
  --line: #e4e3de;
  --mat: #f0efeb;
  --sans: "EB Garamond", Garamond, Georgia, "Times New Roman", serif;
  --serif: var(--sans);
  --gutter: clamp(16px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p a, .crumb a { border-bottom: 1px solid var(--line); transition: border-color .2s; }
p a:hover, .crumb a:hover { border-color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; background: var(--ink); color: var(--bg); padding: 6px 10px; z-index: 10; }

/* header / footer */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.name { white-space: nowrap; font: 400 21px/1 var(--serif); letter-spacing: 0; }
.site-header nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.site-header nav a { color: var(--muted); transition: color .2s; padding: 4px 0; border-bottom: 1px solid transparent; }
.site-header nav a:hover { color: var(--ink); }
.site-header nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.site-footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 40px var(--gutter) 32px; margin-top: 96px;
  color: var(--muted); font-size: 15px; border-top: 1px solid var(--line);
}

/* index: one collapsible row per year, every painting in the same square cell at equal visual weight */
.years { padding: 24px var(--gutter) 0; }
.year { border-bottom: 1px solid var(--line); }
.year:first-child { border-top: 1px solid var(--line); }
.year summary {
  display: block; padding: 20px 0;
  cursor: pointer; list-style: none; user-select: none;
}
.year summary::-webkit-details-marker { display: none; }
.year .yr { font: 400 24px/1 var(--sans); letter-spacing: .02em; color: var(--muted); transition: color .2s; }
.year summary:hover .yr, .year summary:focus-visible .yr, .year[open] .yr { color: var(--ink); }
.year .grid { padding: 8px 0 56px; }
.year[open] .grid { animation: reveal .45s ease both; }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 64px) clamp(20px, 3vw, 40px);
}
.card { display: block; }
/* every cell is the same square; each painting is scaled to the same visual area (width set per work by build.py) */
.frame {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1 / 1;
}
.frame img {
  width: var(--w, 75%); height: auto;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.cap { display: block; margin-top: 10px; text-align: center; }
.cap .t {
  font-family: var(--serif); font-size: 16px; line-height: 1.35; letter-spacing: .04em; font-variant: small-caps;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .35s;
}
.card:hover .frame img, .card:focus-visible .frame img { transform: scale(1.015); }
.card:hover .cap .t, .card:focus-visible .cap .t { background-size: 100% 1px; }

/* work page: painting first, details beneath */
.work { max-width: 1180px; margin: 0 auto; padding: 24px var(--gutter) 0; }
.work-figure { margin: 0 0 56px; display: flex; justify-content: center; }
.zoom { all: unset; cursor: zoom-in; display: block; }
.zoom:focus-visible { outline: 2px solid var(--ink); outline-offset: 6px; }
.work-img {
  max-height: calc(100vh - 150px); width: auto; margin: 0 auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 16px 40px -20px rgba(0,0,0,.25);
}
/* work page: painting / on-the-wall toggle; the wall shows 216 x 152 in at one scale for every work */
.has-wall { flex-direction: column; align-items: center; margin-bottom: 0; }
.pane[hidden] { display: none; }
.wall {
  position: relative; aspect-ratio: 216 / 152;
  width: min(calc(100vw - 2 * var(--gutter)), calc((100vh - 150px) * 216 / 152), 1180px);
  background: linear-gradient(#f2f2ed, #e9e9e3 86.8%, #c8c6c0 86.8%, #c8c6c0 87.1%, #e2e0db 87.1%);
}
.on-wall { position: absolute; box-shadow: 2px 6px 14px rgba(20,20,20,.28); }
.on-wall img { width: 100%; height: 100%; object-fit: fill; }
.view-tabs { display: flex; justify-content: center; gap: 28px; margin: 20px 0 48px; }
.view-tabs button {
  all: unset; cursor: pointer; padding: 4px 0; border-bottom: 1px solid transparent;
  font-size: 16px; letter-spacing: .06em; font-variant: small-caps; color: var(--muted); transition: color .2s;
}
.view-tabs .compare {
  padding: 4px 0; border-bottom: 1px solid transparent;
  font-size: 16px; letter-spacing: .06em; font-variant: small-caps; color: var(--muted); transition: color .2s;
}
.view-tabs .compare::after { content: " →"; }
.view-tabs .compare:hover { color: var(--ink); }
.view-tabs button:hover, .view-tabs button[aria-selected="true"] { color: var(--ink); }
.view-tabs button[aria-selected="true"] { border-color: var(--ink); }
.view-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* /wall/: every dimensioned work side by side at one scale; scrolls sideways, or fits the screen */
.fw-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; max-width: none; }
.fw-head p { color: var(--muted); font-size: 15px; }
.fw-fit { font: inherit; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 2px 0; cursor: pointer; }
.fw-fit:hover { border-color: var(--ink); }
.fw-scroll { overflow-x: auto; overflow-y: hidden; }
.fw {
  --in: calc(max(100vh - 250px, 320px) / var(--tall));
  position: relative; width: calc(var(--total) * var(--in)); height: calc(var(--tall) * var(--in));
  background: linear-gradient(#f2f2ed, #e9e9e3 86.8%, #c8c6c0 86.8%, #c8c6c0 87.1%, #e2e0db 87.1%);
}
.fit .fw { --in: calc((100vw - 2 * var(--gutter)) / var(--total)); margin: 0 var(--gutter); }
.fw-p { position: absolute; box-shadow: 2px 6px 14px rgba(20,20,20,.28); }
.fw-p img { width: 100%; height: 100%; object-fit: fill; }
.fw-p.here { outline: 1px solid var(--ink); outline-offset: calc(2 * var(--in)); }
.fw-lab { position: absolute; bottom: calc(3 * var(--in)); font-size: clamp(10px, calc(2.6 * var(--in)), 13px); line-height: 1.25; color: var(--muted); }
.fw-lab .t { display: block; color: var(--ink); font-variant: small-caps; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fw-lab .fw-yr { display: block; color: var(--ink); margin-bottom: 2px; }
.fit .fw-lab { display: none; }

.work-info {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(32px, 6vw, 96px); max-width: 980px; margin: 0 auto;
}
.work-info .crumb, .work-info .pager { grid-column: 1 / -1; }
.crumb { display: flex; justify-content: space-between; margin: 0 0 32px; font-size: 15px; color: var(--muted); }
.crumb a { color: var(--ink); }
.work-info h1 { font: 400 30px/1.25 var(--serif); letter-spacing: -.01em; margin: 0 0 28px; }
dl { margin: 0; }
dl div { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
dl div:last-child { border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 15px; padding-top: 1px; }
dd { margin: 0; }
dl .note { grid-template-columns: 1fr; color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 48px; }
.pager a { display: block; padding: 14px 0; border-top: 1px solid var(--ink); }
.pager a[rel="next"] { text-align: right; }
.pager .dir { display: block; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.pager a[rel="prev"] .dir::before { content: "← "; }
.pager a[rel="next"] .dir::after { content: " →"; }
.pager .pt { display: block; margin-top: 6px; font: 17px/1.35 var(--serif); }
.pager a:hover .dir { color: var(--ink); }

.lightbox {
  position: fixed; inset: 0; z-index: 20; background: rgba(251,251,249,.98);
  display: flex; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-close { position: absolute; top: 18px; right: var(--gutter); background: none; border: 0; font: inherit; color: var(--ink); cursor: pointer; padding: 8px 0; }

/* pages */
.page-head { padding: 40px var(--gutter) 24px; max-width: 1200px; }
.page-head h1, .about h1 { font: 400 clamp(32px, 4.5vw, 48px)/1.15 var(--serif); letter-spacing: -.02em; margin: 0 0 8px; }
.page-head .crumb { justify-content: flex-start; margin-bottom: 32px; }
.page-head p { margin: 0; }

.shows { padding: 8px var(--gutter) 0; }
.show { border-bottom: 1px solid var(--line); }
.show:first-child { border-top: 1px solid var(--line); }
.show-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none; user-select: none;
}
.show-head::-webkit-details-marker { display: none; }
.show-head .sn { font: 400 24px/1.2 var(--sans); letter-spacing: .02em; color: var(--muted); transition: color .2s; }
.show-head:hover .sn, .show-head:focus-visible .sn, .show[open] .sn { color: var(--ink); }
.show-head .sm { color: var(--muted); font-size: 16px; }
.show[open] .show-imgs { padding-bottom: 48px; animation: reveal .45s ease both; }
.show-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); }
.show-imgs figure { margin: 0; }
.show-imgs figure:first-child { grid-column: 1 / -1; }
.show-imgs img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

/* texts: one row per work; poetry collections open to their parts */
.texts-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; max-width: none; }
.texts-head p { font-size: 16px; }
.texts { padding: 8px var(--gutter) 0; }
.text { border-bottom: 1px solid var(--line); }
.text:first-child { border-top: 1px solid var(--line); }
.text summary, .text-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: baseline;
  padding: 18px 0;
}
.text summary { cursor: pointer; list-style: none; user-select: none; }
.text summary::-webkit-details-marker { display: none; }
.tt { font: 400 20px/1.35 var(--sans); }
.tk { color: var(--muted); font-size: 15px; }
.ta { max-width: 62ch; margin: 0; padding: 0 0 24px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.text[open] .ta { animation: reveal .45s ease both; }
.parts {
  list-style: none; margin: 0; padding: 4px 0 28px;
  columns: 2; column-gap: 48px; color: var(--muted); font-size: 15px; line-height: 1.5;
}
.parts li { break-inside: avoid; padding: 4px 0; }
.text[open] .parts { animation: reveal .45s ease both; }

.about { padding: 40px var(--gutter) 0; max-width: 680px; min-height: 40vh; }
.about .lede { font-size: 18px; margin: 16px 0 0; color: var(--muted); }

/* responsive */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .work-img { max-height: 75vh; }
  .work-figure { margin-bottom: 32px; }
  .work-info { grid-template-columns: 1fr; }
  .crumb { margin-bottom: 24px; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .view-tabs { flex-wrap: wrap; gap: 8px 22px; }
  .site-header { padding-top: 16px; padding-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .name { font-size: 17px; }
  .site-header nav { gap: 14px; font-size: 16px; }
  .grid { grid-template-columns: 1fr; gap: 40px; }
  .work-info h1 { font-size: 24px; }
  .show-imgs { grid-template-columns: 1fr; }
  .text summary, .text-row { grid-template-columns: minmax(0, 1fr); }
  .tk { display: none; }
  .parts { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* footer links */
.foot-links { display: flex; gap: 24px; }
.foot-links a { color: var(--muted); transition: color .2s; }
.foot-links a:hover { color: var(--ink); }

/* contact */
.contact-page {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 96px); padding: 40px var(--gutter) 0; max-width: 1200px;
}
.contact-intro h1 { font: 400 clamp(32px, 4.5vw, 48px)/1.15 var(--serif); letter-spacing: -.02em; margin: 0 0 16px; }
.contact-intro p { color: var(--muted); max-width: 36ch; margin: 0; }
.contact-form { display: grid; gap: 20px; }
.contact-form label { display: grid; gap: 6px; }
.contact-form label span { font-size: 14px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 10px 0; outline: none; transition: border-color .2s; -webkit-appearance: none; appearance: none;
}
.contact-form select {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2374736e'/%3E%3C/svg%3E") no-repeat right 4px center;
}
.contact-form textarea { resize: vertical; min-height: 140px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { border-color: var(--ink); }
.contact-form button {
  justify-self: start; font: 500 16px var(--sans); letter-spacing: .04em;
  color: var(--bg); background: var(--ink); border: 1px solid var(--ink);
  padding: 14px 28px; cursor: pointer; transition: background .2s, color .2s;
}
.contact-form button:hover { background: transparent; color: var(--ink); }
.contact-form button[disabled] { opacity: .5; cursor: default; }
.form-status { margin: 0; min-height: 1.5em; color: var(--muted); }
.hp { position: absolute; left: -9999px; }
@media (max-width: 760px) { .contact-page { grid-template-columns: 1fr; } }
