:root {
  --wall: #fbfbf9;
  --paper: #ffffff;
  --ink: #141414;
  --muted: #66665f;
  --faint: #9a9a92;
  --rule: #e3e3dd;
  --accent: #1f3bd6; /* ultramarine, from Venus */

  --font-body: "General Sans", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Times New Roman", serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.75rem, 1.2rem + 2vw, 2.75rem);
  --text-hero: clamp(3.25rem, 1rem + 8vw, 8.5rem);

  --gutter: clamp(1.25rem, 5vw, 5rem);
  --room-pad: clamp(5rem, 12vw, 11rem);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }

.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 4px; }

/* Masthead */
.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem var(--gutter);
  background: color-mix(in srgb, var(--wall) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.masthead.scrolled { border-bottom-color: var(--rule); }
.wordmark { font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none; }
.nav { display: flex; gap: clamp(1rem, 2.5vw, 2.5rem); list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.nav a { text-decoration: none; color: var(--muted); transition: color .2s; }
.nav a:hover { color: var(--ink); }
.nav-cta { color: var(--ink) !important; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

/* Shared labels */
.eyebrow, .room-no {
  font-size: var(--text-xs); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.label { display: flex; flex-direction: column; gap: .1rem; font-size: var(--text-sm); line-height: 1.45; }
.label-artist { font-weight: 600; font-size: var(--text-sm); }
.label-title em { font-size: 1.05em; }
.label-meta { color: var(--muted); font-size: var(--text-xs); }
.label-status { color: var(--faint); font-size: var(--text-xs); margin-top: .25rem; }
.label-status.award { color: var(--ink); }
.label-no { font-size: var(--text-xs); color: var(--faint); font-variant-numeric: tabular-nums; margin-bottom: .2rem; }

.text-link { display: inline-flex; gap: .4rem; font-size: var(--text-sm); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; width: fit-content; transition: color .2s; }
.text-link:hover { color: var(--accent); }

/* Entrance */
.entrance {
  min-height: calc(100vh - 70px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: var(--gutter);
  padding: clamp(2rem, 6vw, 5rem) var(--gutter) clamp(4rem, 8vw, 7rem);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.entrance-text { display: flex; flex-direction: column; gap: 1.75rem; }
.entrance h1 { font-size: var(--text-hero); line-height: .92; letter-spacing: -0.035em; font-weight: 500; }
.entrance-sub { color: var(--muted); max-width: 30ch; }
.entrance-object { margin: 0; display: flex; align-items: flex-end; justify-content: center; gap: clamp(1.5rem, 3vw, 3rem); }
.entrance-object { --ar: 0.297; --hero-h: min(72vh, 680px); }
.entrance-object { flex-wrap: wrap; row-gap: 1.25rem; }
.entrance-object .object-hit { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.entrance-object img { display: block; width: calc(var(--hero-h) * var(--ar)); max-width: 100%; height: auto; mix-blend-mode: multiply; }
.entrance-object .label { flex: 0 0 auto; }
.label-side { padding-bottom: 1rem; max-width: 15rem; border-left: 1px solid var(--rule); padding-left: 1rem; }

.object-hit { all: unset; cursor: zoom-in; display: block; }
.object-hit:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 6px; }

/* Rooms */
.room { padding: var(--room-pad) var(--gutter); border-bottom: 1px solid var(--rule); }
.room-head { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 1rem var(--gutter); align-items: baseline; margin-bottom: clamp(3rem, 7vw, 6rem); }
.room-head h2 { font-size: var(--text-xl); letter-spacing: -0.02em; line-height: 1.1; }
.room-intro { grid-column: 2; color: var(--muted); max-width: 52ch; }
.room-head-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.room-head-row > div { display: grid; gap: .75rem; }

/* Hanging wall */
.wall {
  --h: clamp(220px, 32vw, 470px);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: clamp(3rem, 6vw, 6rem) clamp(2.5rem, 5.5vw, 6rem);
}
.wall[data-room="elemental"] {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end;
  gap: clamp(3rem, 6vw, 5.5rem) clamp(1.5rem, 3vw, 3rem);
}
.wall[data-room="elemental"] .work img { height: auto; width: 100%; }
.wall[data-room="elemental"] .work.wide { grid-column: 1 / -1; width: min(100%, 860px); justify-self: center; margin-bottom: clamp(1rem, 3vw, 2.5rem); }
.wall[data-room="sculpture"] { --h: clamp(260px, 38vw, 560px); }
.work { margin: 0; display: flex; flex-direction: column; gap: 1.1rem; max-width: 100%; }
.work img {
  height: var(--h); width: auto; max-width: 100%; object-fit: contain;
  box-shadow: 0 1px 2px rgba(20,20,20,.08), 0 18px 34px -22px rgba(20,20,20,.35);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
  background: #eee;
}
.work.cutout img { box-shadow: none; background: transparent; mix-blend-mode: multiply; }
.work .object-hit:hover img { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20,20,20,.08), 0 26px 44px -24px rgba(20,20,20,.4); }
.work .label { max-width: 22rem; }

/* Artist */
.artist-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }
.statement { margin: 0; }
.statement p { font-family: var(--font-serif); font-size: var(--text-xl); line-height: 1.25; font-weight: 300; letter-spacing: -0.01em; max-width: 20ch; }
.prose { display: grid; gap: 1.1rem; color: #33332f; max-width: 58ch; }
.record { margin-top: clamp(4rem, 8vw, 7rem); display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 1rem var(--gutter); }
.record h3 { font-size: var(--text-xs); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.record-list { margin: 0; border-top: 1px solid var(--ink); }
.record-list div { display: grid; grid-template-columns: 6rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.record-list dt { color: var(--muted); font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.record-list dd { margin: 0; }

/* Checklist */
.btn-quiet { background: none; border: 1px solid var(--rule); padding: .6rem 1rem; font-size: var(--text-sm); cursor: pointer; transition: border-color .2s; }
.btn-quiet:hover { border-color: var(--ink); }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--ink); }
.works-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 760px; }
.works-table th { text-align: left; font-weight: 500; font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .9rem 1rem .9rem 0; border-bottom: 1px solid var(--rule); }
.works-table td { padding: 1rem 1rem 1rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.works-table td:first-child { color: var(--faint); font-variant-numeric: tabular-nums; width: 3rem; }
.works-table tbody tr { cursor: pointer; transition: background .2s; }
.works-table tbody tr:hover { background: var(--paper); }
.works-table td em { font-size: 1.05em; }
.table-note { margin-top: 1.25rem; font-size: var(--text-xs); color: var(--muted); }

/* Contact */
.contact { background: var(--paper); border-bottom: 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); align-items: start; }
.contact-lede { font-family: var(--font-serif); font-size: var(--text-lg); line-height: 1.45; max-width: 34ch; }
.contact-detail { display: grid; gap: 1.75rem; justify-items: start; }
.avail { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); width: 100%; max-width: 26rem; }
.avail li { padding: .8rem 0; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); }
.btn { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; padding: 1rem 1.75rem; font-size: var(--text-sm); letter-spacing: .04em; transition: background .25s; }
.btn:hover { background: var(--accent); }
.contact-email { font-size: var(--text-sm); color: var(--muted); }

.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 2rem var(--gutter); font-size: var(--text-xs); color: var(--muted); border-top: 1px solid var(--rule); background: var(--paper); }
.footer a { text-decoration: none; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a:hover { color: var(--ink); }

/* Viewer */
.viewer { position: fixed; inset: 0; z-index: 50; background: var(--paper); display: flex; flex-direction: column; opacity: 0; transition: opacity .3s var(--ease); }
.viewer.open { opacity: 1; }
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem var(--gutter); border-bottom: 1px solid var(--rule); font-size: var(--text-sm); }
.viewer-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.viewer-close { background: none; border: 0; cursor: pointer; font-size: var(--text-sm); padding: .25rem 0; }
.viewer-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 24rem; }
.viewer-wall { display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 4vw, 4rem); background: var(--wall); min-height: 0; }
.viewer-wall img { max-height: 100%; max-width: 100%; object-fit: contain; box-shadow: 0 1px 2px rgba(20,20,20,.08), 0 24px 44px -26px rgba(20,20,20,.4); }
.viewer-wall.cutout img { box-shadow: none; mix-blend-mode: multiply; }
.viewer-label { padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem); display: flex; flex-direction: column; gap: 1rem; border-left: 1px solid var(--rule); overflow-y: auto; }
.viewer-title { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; }
.viewer-meta { margin: .5rem 0 0; border-top: 1px solid var(--rule); }
.viewer-meta div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--rule); font-size: var(--text-sm); }
.viewer-meta dt { color: var(--muted); font-size: var(--text-xs); letter-spacing: .1em; text-transform: uppercase; padding-top: .15rem; }
.viewer-meta dd { margin: 0; }
.viewer-note { color: #33332f; font-size: var(--text-sm); }
.viewer-nav { margin-top: auto; padding-top: 1.5rem; display: flex; justify-content: space-between; }
.viewer-nav button { background: none; border: 0; cursor: pointer; font-size: var(--text-sm); padding: .5rem 0; color: var(--muted); }
.viewer-nav button:hover { color: var(--ink); }
body.locked { overflow: hidden; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (max-width: 900px) {
  .entrance { grid-template-columns: 1fr; min-height: auto; }
  .entrance-object { --hero-h: min(60vh, 520px); }
  .room-head, .record { grid-template-columns: 1fr; }
  .room-intro { grid-column: 1; }
  .artist-grid, .contact-grid { grid-template-columns: 1fr; }
  .wall[data-room="elemental"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .viewer-body { display: block; overflow-y: auto; }
  .viewer-wall { height: 58vh; padding: 1.25rem; }
  .viewer-label { border-left: 0; border-top: 1px solid var(--rule); overflow: visible; }
}
@media (max-width: 640px) {
  .nav li:not(:last-child) { display: none; }
  .wall { --h: auto !important; flex-direction: column; align-items: stretch; }
  .wall[data-room="elemental"] { grid-template-columns: 1fr; }
  .work img { height: auto; width: 100%; }
  .work.cutout img { width: auto; max-height: 70vh; margin: 0 auto; }
  .entrance-object { flex-direction: column; align-items: center; }
  .entrance-object { --hero-h: 56vh; }
  .entrance-object .object-hit { flex: none; width: 100%; justify-content: center; }
  .label-side { border-left: 0; padding-left: 0; text-align: center; align-items: center; max-width: none; }
}

/* Print: checklist for galleries */
@media print {
  .masthead, .entrance, .collection, .artist, .contact, .footer, .viewer, #print-btn { display: none !important; }
  body { background: #fff; }
  .room { padding: 0; border: 0; }
  .room-head { margin-bottom: 1.5rem; }
  .works-table { min-width: 0; font-size: 10pt; }
  .works-table tbody tr { break-inside: avoid; }
  .checklist::before { content: "Joseph Schoenleber — Checklist of Works"; display: block; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 9pt; margin-bottom: 1rem; }
}

/* placeholder for works without a photo yet */
.no-image { display: grid; place-items: center; min-width: 220px; min-height: 260px; width: 100%; height: 100%; background: #ecece7; color: var(--faint); font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; }
.hero-framed img { mix-blend-mode: normal; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 40px -18px rgba(0,0,0,.35); }

/* Share */
.share-btn { align-self: flex-start; background: none; border: 0; padding: .35rem 0 .1rem; margin-top: .35rem; font: inherit; font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); cursor: pointer; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.share-btn::before { content: "↗ "; letter-spacing: 0; }
.share-btn:hover, .share-btn[aria-expanded="true"] { color: var(--ink); border-bottom-color: currentColor; }
.share-btn:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }
.share-btn-lg { margin-top: 0; font-size: var(--text-xs); }
.viewer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; }
.share-menu { position: fixed; z-index: 70; min-width: 13rem; background: var(--paper); border: 1px solid var(--ink); padding: .4rem 0; box-shadow: 0 18px 40px -20px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.share-menu[hidden] { display: none; }
.share-head { font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: .5rem 1rem .4rem; border-bottom: 1px solid var(--rule); margin-bottom: .25rem; }
.share-item { display: block; width: 100%; text-align: left; background: none; border: 0; font: inherit; font-size: var(--text-sm); color: var(--ink); text-decoration: none; padding: .55rem 1rem; cursor: pointer; }
.share-item:hover, .share-item:focus-visible { background: var(--wall); color: var(--accent); outline: none; }
.entrance-object .share-btn { display: none; }
@media (max-width: 640px) { .label-side .share-btn { align-self: center; } }
@media print { .share-btn, .share-menu { display: none !important; } }

/* Artist portrait */
.artist-grid.has-photo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "photo statement" "photo bio"; row-gap: clamp(1.75rem, 3vw, 2.5rem); }
.artist-grid.has-photo .artist-portrait { grid-area: photo; }
.artist-grid.has-photo .statement { grid-area: statement; }
.artist-grid.has-photo .prose { grid-area: bio; }
.artist-grid.has-photo .statement p { max-width: 24ch; }
.artist-portrait[hidden], .artist-portrait .label[hidden] { display: none; }
.artist-portrait { margin: 0; display: flex; flex-direction: column; gap: .9rem; max-width: 30rem; }
.artist-portrait img { display: block; width: 100%; height: auto; object-fit: cover; box-shadow: 0 1px 2px rgba(20,20,20,.06), 0 22px 40px -26px rgba(20,20,20,.35); }
.artist-portrait .label { font-size: var(--text-xs); color: var(--muted); }
@media (max-width: 900px) {
  .artist-grid.has-photo { grid-template-columns: 1fr; grid-template-areas: "photo" "statement" "bio"; }
  .artist-portrait { max-width: 24rem; }
}
