/* ==========================================================================
   Yu Cheng: "Light" design
   A sunlit studio wall. Warm plaster ground, the blue-grey of painted
   shadows, works hung with a real shadow and small museum-style labels.
   Image-first and compact: the work should be visible without scrolling.
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  --wall: #efece6;          /* plaster */
  --wall-deep: #e2ddd4;     /* plaster in shade */
  --ink: #1b1c1d;
  --ink-soft: #3d4043;
  --shadow: #5a6870;        /* blue-grey of the painted shadows */
  --muted: #8a867e;
  --rule: rgba(27, 28, 29, .13);
  --sun: #c58f2a;           /* ochre, from the yellow chair */
  --night: #141516;

  /* One family throughout, like the old site: Aktiv Grotesk if an Adobe Fonts kit is loaded, else Inter.
     --display is the light weight used for titles and statements. */
  --sans: "aktiv-grotesk", "Inter", "Helvetica Neue", Arial, sans-serif;
  --display: var(--sans);

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --gap: clamp(.75rem, 1.8vw, 1.75rem);
  --max: 1560px;
  --page-top: clamp(1.75rem, 3.5vw, 3rem);
  --title: clamp(1.2rem, 1.55vw, 1.45rem);      /* page titles stay smaller than the name */
  --wordmark: clamp(1.55rem, 2.2vw, 2rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --hang: 0 1px 1px rgba(30, 26, 20, .05), 0 3px 6px rgba(30, 26, 20, .05), 0 26px 44px -26px rgba(40, 33, 24, .5);
  --hang-lift: 0 1px 1px rgba(30, 26, 20, .05), 0 6px 12px rgba(30, 26, 20, .06), 0 38px 60px -30px rgba(40, 33, 24, .55);
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
::selection { background: var(--ink); color: var(--wall); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 4px; }

.only-classic { display: none !important; }

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

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(4rem, 8vw, 6rem);
}

/* ---------- Small type ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before { content: ""; width: 1.5rem; height: 1px; background: currentColor; }

.more {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem 0;
  font-size: .8rem;
  border-bottom: 1px solid var(--rule);
  transition: border-color .4s var(--ease);
}
.more::after { content: "\2192"; transition: transform .45s var(--ease); }

.page-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: var(--title);
  line-height: 1.05;
  letter-spacing: -.01em;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: .9rem var(--gutter);
  background: rgba(239, 236, 230, .86);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: .85rem;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--wordmark);
  line-height: 1;
  white-space: nowrap;
  letter-spacing: .01em;
}

.site-nav { display: flex; gap: clamp(1.35rem, 3vw, 2.5rem); }
.site-nav a,
.series-nav a {
  position: relative;
  padding: .35rem 0;
  font-size: .84rem;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color .3s;
}
.series-nav a { color: var(--muted); }
.site-nav a::after,
.series-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .05rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease);
}
.site-nav a[aria-current],
.series-nav a[aria-current] { color: var(--ink); }
.site-nav a[aria-current]::before,
.series-nav a[aria-current]::before {
  content: "";
  position: absolute;
  left: -.8rem;
  top: 50%;
  width: .32rem;
  height: .32rem;
  margin-top: -.16rem;
  border-radius: 50%;
  background: var(--sun);
}

/* ---------- Home: first screen = statement + series, and a painting on a sunlit wall ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  margin-inline: calc(50% - 50vw);
  padding-block: clamp(2rem, 4vw, 3.5rem);
  padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  min-height: min(64svh, 40rem);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 1fr auto;
  column-gap: var(--gap);
  row-gap: .9rem;
  background: radial-gradient(120% 95% at 72% 18%, #ece8e1 0%, var(--wall-deep) 58%, #d8d2c8 100%);
}

.hero-text { grid-column: 1 / 5; grid-row: 1 / 3; align-self: center; animation: fade-in 1.2s .1s var(--ease) both; }
.hero-statement {
  margin-bottom: clamp(1.5rem, 2.8vw, 2.25rem);
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  line-height: 1.22;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.hero-statement em { color: var(--shadow); }

.hero-series { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.hero-series a {
  display: grid;
  grid-template-columns: 3rem 1fr;
  align-items: center;
  column-gap: 1.1rem;
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule);
}
.hs-thumb { display: block; width: 3rem; height: 3.7rem; overflow: hidden; background: var(--wall-deep); box-shadow: 0 1px 3px rgba(30, 26, 20, .14); }
.hs-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.hs-title { font-family: var(--display); font-size: clamp(.98rem, 1.15vw, 1.1rem); line-height: 1.2; transition: color .3s; }

.hero-image {
  grid-column: 6 / 13;
  grid-row: 1;
  justify-self: end;
  align-self: end;
  width: min(100%, calc(50svh * var(--r)));
  animation: hang-in 1.4s .15s var(--ease) both;
}
.hero-image img { width: 100%; box-shadow: var(--hang); }

.hero .caption {
  grid-column: 6 / 13;
  grid-row: 2;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: .1rem .85rem;
  font-size: .76rem;
  color: var(--ink-soft);
  animation: fade-in 1.2s .6s var(--ease) both;
}
.hero .cap-title { font-family: var(--display); font-size: .9rem; font-weight: 400; color: var(--ink); }
.hero .cap-note { color: var(--shadow); }

/* Window light: two soft panes with a cross mullion, drifting slowly across the wall */
.light {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  animation: fade-in 2.4s .2s ease both;
}
.light i {
  position: absolute;
  display: block;
  background:
    linear-gradient(90deg, transparent 48.6%, var(--wall-deep) 48.6%, var(--wall-deep) 51.4%, transparent 51.4%),
    linear-gradient(180deg, transparent 36%, var(--wall-deep) 36%, var(--wall-deep) 38.4%, transparent 38.4%),
    linear-gradient(165deg, rgba(255, 252, 244, .95), rgba(255, 250, 238, .4));
  filter: blur(7px);
  transform-origin: 0 0;
  animation: sun-drift 46s ease-in-out infinite alternate;
}
.light i:nth-child(1) { left: 34%; top: -16%; width: 28vw; height: 78%; opacity: .8; }
.light i:nth-child(2) { left: 70%; top: 10%;  width: 19vw; height: 58%; opacity: .5; animation-duration: 62s; animation-delay: -12s; }

@keyframes sun-drift {
  from { transform: translateX(-2.5vw) skew(-30deg, 9deg); }
  to   { transform: translateX(3.5vw)  skew(-34deg, 11deg); }
}
@keyframes hang-in { from { opacity: 0; transform: translateY(16px); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Home: selected works + exhibitions ---------- */
.home-works { padding-top: clamp(1.75rem, 3.5vw, 2.75rem); }
.home-exh { padding-top: clamp(3.5rem, 7vw, 5.5rem); }

.exh-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.exh-list a {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: baseline;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(100deg, transparent 20%, rgba(252, 249, 242, .95) 50%, transparent 80%) no-repeat;
  background-size: 220% 100%;
  background-position: 130% 0;
  transition: background-position 1.1s var(--ease);
}
.exh-list-year  { grid-column: 1 / 2;  font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.exh-list-title { grid-column: 2 / 9;  font-family: var(--display); font-size: clamp(1.02rem, 1.4vw, 1.25rem); line-height: 1.25; }
.exh-list-type  { grid-column: 9 / 11; font-size: .76rem; color: var(--muted); }
.exh-list-venue { grid-column: 11 / 13; font-size: .76rem; color: var(--ink-soft); text-align: right; }

/* ---------- Page heads: one compact row ---------- */
.work-head,
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 1rem;
  row-gap: .6rem;
  padding-top: var(--page-top);
  padding-bottom: 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--rule);
}
.work-head .eyebrow { display: none; }
.page-head { justify-content: space-between; }


.series-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem 1.75rem;
  padding-left: .8rem;
}

.view-switch {
  display: flex;
  gap: 1rem;
  margin-left: .5rem;
  padding-left: 1.25rem;
  border-left: 1px solid var(--rule);
}
.view-switch button {
  position: relative;
  padding: .35rem 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: .78rem;
  color: var(--muted);
  cursor: pointer;
}
.view-switch button[aria-pressed="true"] { color: var(--ink); }
.view-switch button[aria-pressed="true"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .05rem; height: 1px; background: currentColor;
}

/* ---------- Wall labels ---------- */
.cap-title { font-family: var(--display); font-weight: 400; font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.25; color: var(--ink); }
.cap-meta  { margin-top: .3rem; font-size: .78rem; color: var(--ink-soft); }
.cap-note  { font-size: .78rem; color: var(--shadow); }

/* ---------- Gallery: grid (default). Justified rows: every painting in a row has the same height ---------- */
.gallery {
  --row: 17rem;                       /* target row height */
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2rem, 3.5vw, 3rem) clamp(1rem, 2vw, 1.75rem);
}
.gallery::after { content: ""; flex-grow: 1000; }   /* keeps a short last row from stretching */
.gallery .work {
  /* grows in proportion to its aspect ratio (--r), so heights match within a row */
  flex: var(--r) 1 calc(var(--r) * var(--row));
  max-width: calc(var(--r) * var(--row) * 1.8);    /* a lone work on a short row stays modest */
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.gallery .work[hidden] { display: none; }
.gallery .work-link { display: block; cursor: zoom-in; }
.gallery .work-link img {
  width: 100%;
  height: auto;
  background: var(--wall-deep);
  box-shadow: var(--hang);
  transition: transform .9s var(--ease), box-shadow .9s var(--ease);
}
.gallery figcaption { display: flex; flex-direction: column; margin-top: .8rem; }
.gallery .cap-title { font-size: clamp(.86rem, 1vw, .95rem); }
.gallery .cap-meta { margin-top: .1rem; font-size: .72rem; }
.gallery .cap-note { font-size: .72rem; }

/* ---------- Gallery: one by one (optional), label beside each work ---------- */
.gallery[data-view="sequence"] {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: clamp(4rem, 8vw, 7rem);
}
.gallery[data-view="sequence"]::after { content: none; }
.gallery[data-view="sequence"] .work                              { --img: 2 / 7;  --cap: 8 / 11; --side: end;   --align: flex-start; --cap-row: 1; }
.gallery[data-view="sequence"] .work:nth-child(even)              { --img: 7 / 12; --cap: 3 / 6;  --side: start; --align: flex-end; }
.gallery[data-view="sequence"] .work.is-landscape                 { --img: 1 / 9;  --cap: 10 / 13; }
.gallery[data-view="sequence"] .work.is-landscape:nth-child(even) { --img: 5 / 13; --cap: 1 / 4; }
.gallery[data-view="sequence"] .work.is-square                    { --img: 2 / 8;  --cap: 9 / 12; }
.gallery[data-view="sequence"] .work.is-square:nth-child(even)    { --img: 6 / 12; --cap: 2 / 5; }

.gallery[data-view="sequence"] .work {
  grid-column: 1 / -1;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: end;
}
.gallery[data-view="sequence"] .work-link {
  grid-column: var(--img);
  grid-row: 1;
  justify-self: var(--side);
  width: min(100%, calc(72svh * var(--r)));
}
.gallery[data-view="sequence"] figcaption {
  grid-column: var(--cap);
  grid-row: var(--cap-row);
  align-items: var(--align);
  margin: 0;
  padding-bottom: .2rem;
}
.gallery[data-view="sequence"] .work:nth-child(even) figcaption { text-align: right; }
.gallery[data-view="sequence"] .cap-title { font-size: clamp(1.05rem, 1.4vw, 1.3rem); }
.gallery[data-view="sequence"] .cap-meta,
.gallery[data-view="sequence"] .cap-note { font-size: .78rem; }

/* ---------- Exhibitions: details left, three equal views right ---------- */
.exhibitions { display: grid; gap: clamp(1.75rem, 3.5vw, 2.75rem); }
.exhibition {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  row-gap: 1.25rem;
  padding-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 6rem;
}
.exhibition:last-child { border-bottom: 0; padding-bottom: 0; }
.exhibition header { grid-column: 1 / 5; display: flex; flex-direction: column; gap: .55rem; }
.exh-year { font-family: var(--display); font-size: .95rem; line-height: 1; color: var(--shadow); }
.exhibition h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.2rem, 1.65vw, 1.55rem);
  line-height: 1.2;
  letter-spacing: -.005em;
  text-wrap: balance;
}
.exh-meta { display: grid; gap: .35rem; margin-top: .35rem; font-size: .84rem; color: var(--ink-soft); }
.exh-type { font-size: .66rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--sun); }

.exh-images { grid-column: 5 / 13; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(.5rem, 1vw, .9rem); }
.exh-images .work-link { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--wall-deep); cursor: zoom-in; }
.exh-images .work-link img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--ease); }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  align-items: start;
  padding-top: var(--page-top);
}
.about-image { grid-column: 1 / 6; position: sticky; top: 5.5rem; margin: 0; }
.about-image img { width: 100%; box-shadow: var(--hang); }
.about-image figcaption { margin-top: .8rem; font-size: .74rem; color: var(--muted); }

.about-text { grid-column: 7 / 13; }
/* The site header already carries the name; keep the heading for screen readers only */
.about .page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.bio {
  margin-bottom: clamp(2.25rem, 4vw, 3rem);
  font-family: var(--display);
  font-size: clamp(1.05rem, 1.3vw, 1.2rem);
  line-height: 1.6;
  text-wrap: pretty;
}

.cv { margin-bottom: clamp(2rem, 3.5vw, 2.75rem); }
.cv h2 {
  margin: 0;
  padding-bottom: .65rem;
  border-bottom: 1px solid var(--ink);
  font-family: var(--sans);
  font-weight: 500;
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.cv ul { list-style: none; margin: 0; padding: 0; }
.cv li {
  position: relative;
  padding: .55rem 0 .55rem 4.5rem;
  border-bottom: 1px solid var(--rule);
  font-size: .88rem;
  line-height: 1.45;
  color: var(--ink-soft);
}
.cv li > span { position: absolute; left: 0; top: .66rem; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cv li em { font-family: var(--display); font-weight: 400; color: var(--ink); }
.solo { font-size: 0; font-style: normal; }
.solo::after {
  content: "Solo";
  display: inline-block;
  margin: 0 .1rem 0 .5rem;
  padding: .1rem .45rem .08rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: .56rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  vertical-align: .2em;
  color: var(--sun);
}
.cv.contact { display: none; }   /* the footer right below carries the same icons */
.contact-icons { display: flex; gap: .35rem; margin: .5rem 0 0 -.65rem; color: var(--ink); }
.contact-icons .icon { width: 1.45rem; height: 1.45rem; }
.contact-icons .icon-link[data-tip]::after { right: auto; left: .65rem; bottom: auto; top: calc(100% + .2rem); }

/* ---------- 404 ---------- */
.notfound { padding-block: clamp(3rem, 8vw, 6rem); max-width: 40rem; }
.notfound .page-title { margin-bottom: 1.25rem; }
.notfound p:last-child { color: var(--ink-soft); }
.notfound a { text-decoration: underline; text-underline-offset: .25em; text-decoration-thickness: 1px; }

/* ---------- Footer ---------- */
.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name links" "copy copy";
  align-items: end;
  gap: 1.75rem 2rem;
  padding: clamp(2.75rem, 5.5vw, 4rem) var(--gutter) 1.5rem;
  background: var(--night);
  color: #8f8b84;
  font-size: .76rem;
}
.footer-name {
  grid-area: name;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(2.1rem, 5.2vw, 4.4rem);
  line-height: .9;
  letter-spacing: -.025em;
  color: #eeeae3;
}
.footer-links {
  grid-area: links;
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
  margin-right: -.6rem;
  color: #e4e0d8;
}

/* Email / Instagram as line icons; the address appears on hover */
.icon-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  color: inherit;
  transition: color .3s;
}
.icon { width: 1.3rem; height: 1.3rem; }
.icon-link[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + .3rem);
  right: 0;
  padding: .35rem .65rem;
  border-radius: 2px;
  background: var(--ink);
  color: var(--wall);
  font-size: .72rem;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease);
}
.site-footer .icon-link[data-tip]::after { background: #eeeae3; color: var(--night); }
.footer-copy { grid-area: copy; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .1); }

/* ---------- Lightbox: a dark viewing room ---------- */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  background: #121212;
  color: #e7e3dc;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}
.lightbox::backdrop { background: #121212; }
.lightbox[open] { display: flex; flex-direction: column; animation: fade-in .45s ease; }

.lb-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 6rem 1rem;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .7);
}
.lb-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: .2rem 1rem;
  min-height: 5rem;
  padding: .75rem 1.5rem 2rem;
  font-size: .8rem;
  color: #a9a49c;
  text-align: center;
}
.lb-caption .cap-title { font-size: 1.05rem; color: #f2efe9; }
.lb-caption .cap-meta { margin: 0; color: #c9c4bc; }
.lb-caption .cap-note { color: #8f8b84; }

.lb-btn {
  position: absolute;
  padding: 1rem;
  border: 0;
  background: none;
  font: 300 1.6rem/1 var(--sans);
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: color .3s;
}
.lb-close { top: .75rem; right: 1rem; font-size: 1.9rem; }
.lb-prev  { left: .75rem;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: .75rem; top: 50%; transform: translateY(-50%); }
.lb-count {
  position: absolute; top: 1.6rem; left: 1.6rem;
  font-size: .72rem; letter-spacing: .14em; color: #8f8b84; font-variant-numeric: tabular-nums;
}

/* ---------- Scroll reveal (only when JS has set it up) ---------- */
.js-reveal .gallery .work,
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.js-reveal .gallery .work.is-in,
.js-reveal [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Hover (real pointers only) ---------- */
@media (hover: hover) {
  .site-nav a:hover, .series-nav a:hover { color: var(--ink); }
  .site-nav a:hover::after, .series-nav a:hover::after { transform: scaleX(1); }
  .view-switch button:hover { color: var(--ink); }
  .more:hover { border-color: var(--ink); }
  .more:hover::after { transform: translateX(5px); }
  .hero-series a:hover .hs-title { color: var(--shadow); }
  .hero-series a:hover .hs-thumb img { transform: scale(1.12); }
  .gallery .work-link:hover img { transform: translateY(-4px); box-shadow: var(--hang-lift); }
  .exh-images .work-link:hover img { transform: scale(1.035); }
  .exh-list a:hover { background-position: -30% 0; }
  .icon-link:hover { color: var(--sun); }
  .icon-link:hover::after { opacity: 1; transform: none; }
  .lb-btn:hover { color: #fff; }
}

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

/* ---------- Tablets ---------- */
@media (max-width: 1100px) {
  .gallery { --row: 14rem; }

  .work-head .view-switch { order: 2; margin-left: auto; }
  .work-head .series-nav { order: 3; flex-basis: 100%; margin-left: 0; }

  .gallery[data-view="sequence"] .work                              { --img: 1 / 8;  --cap: 9 / 13; }
  .gallery[data-view="sequence"] .work:nth-child(even)              { --img: 6 / 13; --cap: 1 / 5; }
  .gallery[data-view="sequence"] .work.is-square                    { --img: 1 / 8;  --cap: 9 / 13; }
  .gallery[data-view="sequence"] .work.is-square:nth-child(even)    { --img: 6 / 13; --cap: 1 / 5; }
  .gallery[data-view="sequence"] .work.is-landscape,
  .gallery[data-view="sequence"] .work.is-landscape:nth-child(even) { --img: 1 / 13; --cap: 1 / 8; --cap-row: 2; --side: center; --align: flex-start; }
  .gallery[data-view="sequence"] .work.is-landscape figcaption,
  .gallery[data-view="sequence"] .work.is-landscape:nth-child(even) figcaption { margin-top: 1.1rem; text-align: left; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    min-height: 0;
    padding-block: 1.75rem 2.25rem;
  }
  .hero-image { grid-column: 1; grid-row: 1; justify-self: center; width: min(100%, calc(50svh * var(--r))); }
  .hero .caption { grid-column: 1; grid-row: 2; justify-self: start; justify-content: flex-start; }
  .hero-text { grid-column: 1; grid-row: 3; margin-top: 1.25rem; }
  .light i:nth-child(1) { left: 6%; width: 55vw; height: 62%; }
  .light i:nth-child(2) { left: 62%; width: 34vw; }

  .exh-list-year  { grid-column: 1 / 3; }
  .exh-list-title { grid-column: 3 / 13; }
  .exh-list-type  { grid-column: 3 / 7;  grid-row: 2; margin-top: .4rem; }
  .exh-list-venue { grid-column: 7 / 13; grid-row: 2; margin-top: .4rem; }

  .exhibition header, .exh-images { grid-column: 1 / -1; }

  .about-image { grid-column: 1 / -1; position: static; margin-bottom: 2rem; }
  .about-text { grid-column: 1 / -1; }
}

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  .site-header { padding-block: .8rem; }
  :root { --wordmark: 1.4rem; --title: 1.1rem; }
  .site-header { gap: .75rem; }
  .site-nav { gap: 1rem; }
  .site-nav a { font-size: .78rem; }

  /* 2-3 works per row; material and size are in the lightbox */
  .gallery { --row: 7rem; gap: 1.5rem .75rem; }
  .gallery:not([data-view="sequence"]) .cap-meta,
  .gallery:not([data-view="sequence"]) .cap-note { display: none; }
  .gallery .cap-title { font-size: .8rem; line-height: 1.25; }
  .gallery figcaption { margin-top: .55rem; }

  .work-head .series-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    flex-basis: calc(100% + 2 * var(--gutter));
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: calc(var(--gutter) + .8rem) var(--gutter);
    gap: 1.6rem;
  }
  .series-nav::-webkit-scrollbar { display: none; }
  .work-head .view-switch { border-left: 0; padding-left: 0; }

  .exh-list-year  { grid-column: 1 / -1; }
  .exh-list-title { grid-column: 1 / -1; margin-top: .3rem; }
  .exh-list-type  { grid-column: 1 / 6;  grid-row: 3; }
  .exh-list-venue { grid-column: 6 / 13; grid-row: 3; }

  /* Installation views: swipe sideways instead of stacking */
  .exh-images {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    gap: .6rem;
  }
  .exh-images::-webkit-scrollbar { display: none; }
  .exh-images .work-link { flex: 0 0 80%; scroll-snap-align: start; }

  /* One by one on phones: everything stacked */
  .gallery[data-view="sequence"] { row-gap: 3.5rem; }
  .gallery[data-view="sequence"] .work.work:nth-child(n) { --img: 1 / 13; --cap: 1 / 13; --cap-row: 2; --side: center; --align: flex-start; }
  .gallery[data-view="sequence"] .work.work:nth-child(n) figcaption { margin-top: 1rem; text-align: left; }
  .gallery[data-view="sequence"] .work-link { width: min(100%, calc(66svh * var(--r))); }

  .site-footer { grid-template-columns: 1fr; grid-template-areas: "name" "links" "copy"; }
  .footer-links { justify-content: flex-start; margin: 0 0 0 -.6rem; }
  .site-footer .icon-link[data-tip]::after { right: auto; left: .6rem; }

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

/* Narrow phones (iPhone SE, small Androids) */
@media (max-width: 380px) {
  :root { --wordmark: 1.25rem; --title: 1.02rem; }
  .site-nav { gap: .8rem; }
  .site-nav a { font-size: .72rem; }
  .site-nav a[aria-current]::before { left: -.6rem; }
}
@media (max-width: 340px) {
  .site-nav a[aria-current]::before { display: none; }
}

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

/* Touch screens: ~44px tap targets */
@media (pointer: coarse) {
  .site-nav a, .series-nav a, .view-switch button { padding-block: .75rem; }
  .icon-link { width: 2.9rem; height: 2.9rem; }
}

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