/* ---------- Tokens ---------- */
:root {
  --paper: #f7f5f0;
  --ink: #1f1d1a;
  --muted: #77716a;
  --line: #e2ddd3;
  --accent: #8a5a3c;

  /* Same family as the old Squarespace site: Aktiv Grotesk if an Adobe Fonts kit is loaded, else Inter */
  --sans: "aktiv-grotesk", "Inter", "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);   /* kept as the name for body/title text */

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --max: 1440px;
  --row: 17rem;          /* target row height for justified galleries */
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
html:has(dialog[open]) { overflow: hidden; }   /* lock page scroll behind the lightbox */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--accent); }

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

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) 5rem;
}

/* Markup that only the new design (new.css) uses */
.only-new { display: none !important; }
.solo { font-style: normal; }
.hero .caption span + span::before { content: " · "; }
.lb-caption .only-new + span::before { content: none; }

/* ---------- Header ---------- */
.site-header {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem var(--gutter) 2.75rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  flex-wrap: wrap;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
}
.wordmark:hover { color: var(--ink); }

.site-nav { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); }

.site-nav a,
.series-nav a {
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding-bottom: .3rem;
  border-bottom: 1px solid transparent;
  transition: color .2s, border-color .2s;
}
.site-nav a:hover,
.series-nav a:hover { color: var(--ink); }
.site-nav a[aria-current],
.series-nav a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- Common ---------- */
.page-title {
  font-weight: 300;
  font-size: clamp(1.15rem, 1.5vw, 1.4rem);   /* page titles stay smaller than the name */
  line-height: 1.2;
  margin: 0 0 2rem;
}

.caption,
figcaption {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--muted);
  line-height: 1.5;
}
figcaption em, .caption em { font-weight: 400; color: var(--ink); }

/* ---------- Home ---------- */
.hero { margin: 0 auto; max-width: 1100px; }
.hero-image img { width: 100%; }
.hero .caption { margin: .9rem 0 0; }

.intro {
  max-width: 40rem;
  margin: clamp(3.5rem, 8vw, 6rem) auto;
  text-align: center;
}
.intro p {
  font-size: clamp(1.15rem, 1.9vw, 1.4rem);
  line-height: 1.55;
  font-style: italic;
  margin: 0;
}

.series-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.series-card { text-decoration: none; }
.series-card-img { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--line); }
.series-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.series-card-title {
  display: block;
  margin-top: .9rem;
  font-family: var(--sans);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* ---------- Work galleries ---------- */
.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 2.5rem;
}
.work-head .page-title { margin: 0; }
.series-nav { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; }

/* Justified rows: each item grows in proportion to its aspect ratio (--r),
   so every image in a row ends up the same height. */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 3rem clamp(1.25rem, 2.5vw, 2.5rem);
}
.gallery::after { content: ""; flex-grow: 1000; }

.work {
  margin: 0;
  flex: var(--r) 1 calc(var(--r) * var(--row));
  /* Don't let a lone painting on a short row balloon to full width */
  max-width: calc(var(--r) * var(--row) * 1.8);
  min-width: 0;
}
.work-link { display: block; cursor: zoom-in; background: var(--line); }
.work-link img { width: 100%; transition: opacity .3s; }
.work figcaption { margin-top: .75rem; }
.work figcaption span { display: block; }

/* ---------- Exhibitions ---------- */
.exhibitions { display: grid; gap: clamp(4rem, 8vw, 6rem); }

.exhibition {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) 3fr;
  gap: 1.5rem clamp(2rem, 4vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.exhibition h2 {
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.25;
  margin: 0 0 .75rem;
}
.exhibition header p { margin: 0 0 .5rem; color: var(--muted); font-size: .92rem; }
.exhibition .exh-type {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Installation views: uniform 4:3 tiles in two columns (cropped to fill;
   the lightbox still shows each photo uncropped). */
.exh-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.75rem, 1.5vw, 1.25rem);
  align-content: start;
}
.exh-images .work-link { aspect-ratio: 4 / 3; overflow: hidden; }
.exh-images .work-link img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about-image { margin: 0; position: sticky; top: 2rem; }
.about-image img { width: 100%; }
.bio { font-size: 1.1rem; line-height: 1.65; margin: 0 0 3rem; }

.cv { margin-bottom: 2.75rem; }
.cv h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: .75rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0 0 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--line);
}
.cv ul { list-style: none; margin: 0; padding: 0; }
.cv li {
  position: relative;
  padding: .3rem 0 .3rem 4.5rem;
  font-size: .92rem;
  line-height: 1.45;
}
.cv li span {
  position: absolute; left: 0; top: .45rem;
  font-family: var(--sans); font-size: .82rem; color: var(--muted);
}
.cv-note { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin: -.5rem 0 .75rem; }
.contact p { margin: .25rem 0; }

/* ---------- 404 ---------- */
.notfound { max-width: 36rem; margin: 4rem 0; }

/* ---------- Footer ---------- */
.site-footer {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  font-family: var(--sans);
  font-size: .75rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.site-footer { align-items: center; }
.site-footer p { margin: 0; }
.footer-links { display: flex; gap: .25rem; margin-right: -.5rem; }

/* Email / Instagram icons, with the address shown on hover */
.icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--muted);
  transition: color .2s;
}
.icon-link:hover { color: var(--accent); }
.icon { width: 1.15rem; height: 1.15rem; }
.icon-link[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + .35rem);
  right: 0;
  padding: .3rem .6rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.contact-icons { display: flex; gap: .25rem; margin-left: -.5rem !important; }
.contact-icons .icon-link[data-tip]::after { right: auto; left: .5rem; }
.contact-icons .icon { width: 1.35rem; height: 1.35rem; }

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;   /* follows the mobile browser toolbar */
  max-width: none;
  max-height: none;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  background: var(--paper);
  color: var(--ink);
}
.lightbox::backdrop { background: var(--paper); }
.lightbox[open] { display: flex; flex-direction: column; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }

.lb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 5rem 1rem;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 1px 12px rgba(0,0,0,.06);
}
.lb-caption {
  text-align: center;
  padding: .5rem 1.5rem 2rem;
  min-height: 4.5rem;
}
.lb-caption span { display: inline; }
.lb-caption span + span::before { content: " · "; }

.lb-btn {
  position: absolute;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: 300 1.8rem/1 var(--serif);
  padding: 1rem;
}
.lb-btn:hover { color: var(--ink); }
.lb-close { top: .75rem; right: 1rem; font-family: var(--sans); font-size: 1.8rem; }
.lb-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute; top: 1.6rem; left: 1.5rem;
  font-family: var(--sans); font-size: .75rem; letter-spacing: .1em; color: var(--muted);
}

/* ---------- Responsive ---------- */

/* Large desktop monitors */
@media (min-width: 1800px) {
  :root { --max: 1680px; --row: 20rem; }
}

/* Tablets (iPad portrait / landscape) */
@media (max-width: 1100px) {
  :root { --row: 15rem; }
}

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .about-image { position: static; }
  .exhibition { grid-template-columns: 1fr; }
}

/* Phones */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { white-space: nowrap; letter-spacing: .08em; font-size: .7rem; }
  .site-header { padding-top: 1.25rem; padding-bottom: 1.5rem; }
  .series-cards { grid-template-columns: 1fr; }
  .work { flex-basis: 100%; max-width: none; }
  .gallery { gap: 2.5rem; }
  .exh-images { grid-template-columns: 1fr; }

  /* Series tabs: one swipeable row instead of wrapping onto several lines */
  .work-head { margin-bottom: 1.5rem; }
  .series-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: calc(100% + 2 * var(--gutter));
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    gap: 1.5rem;
  }
  .series-nav::-webkit-scrollbar { display: none; }
  .series-nav a { white-space: nowrap; flex-shrink: 0; }

  .lb-stage { padding: 3.5rem .75rem .5rem; }
  .lb-caption { padding-inline: 3.5rem; }
  .lb-prev, .lb-next { top: auto; bottom: .5rem; transform: none; }
}

/* Phones held sideways: short screens, keep the painting as large as possible */
@media (max-height: 500px) and (orientation: landscape) {
  .lb-stage { padding: .75rem 4rem 0; }
  .lb-caption { padding: .35rem 4rem .6rem; min-height: 0; }
  .lb-count { top: .9rem; }
  .lb-close { top: .25rem; }
  .lb-prev, .lb-next { top: 50%; bottom: auto; transform: translateY(-50%); }
}

/* Touch screens: bigger tap targets (~44px) */
@media (pointer: coarse) {
  .site-nav a,
  .series-nav a { padding: .85rem 0 .7rem; }
  .site-header { align-items: center; }
  .icon-link { width: 2.75rem; height: 2.75rem; }
  .site-footer { align-items: center; }
}

/* Hover effects only where there is a real pointer */
@media (hover: hover) {
  .icon-link:hover::after, .icon-link:focus-visible::after { opacity: 1; }
  .series-card:hover img { transform: scale(1.03); }
  .work-link:hover img { opacity: .92; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
