:root {
  --wall: #eeeae3;
  --wall-2: #e5e0d7;
  --ink: #191815;
  --muted: #6f695f;
  --line: rgba(25, 24, 21, .14);
  --night: #11100e;
  --accent: #3f5a4a;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --g: clamp(16px, 4vw, 56px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.wrap { width: min(100% - 2 * var(--g), 1240px); margin-inline: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.02; letter-spacing: -.01em; margin: 0; }
.label { font: 500 11px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.label.light { color: rgba(255,255,255,.78); }
.meta { font: 400 12.5px/1.6 var(--mono); color: var(--muted); letter-spacing: .02em; margin: 0; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 20px var(--g); background: rgba(238,234,227,.9); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: background .3s, border-color .3s; }
.mark { font: 500 21px/1 var(--serif); text-decoration: none; letter-spacing: .01em; margin: 0; }
.mark span { font: 500 10.5px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-left: 10px; }
.nav nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav nav a { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--muted); padding-bottom: 4px; border-bottom: 1px solid transparent; }
.nav nav a:hover, .nav nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
.home .nav { position: fixed; inset: 0 0 auto 0; background: transparent; color: #fff; backdrop-filter: none; }
.home .nav .mark span, .home .nav nav a { color: rgba(255,255,255,.75); }
.home .nav nav a:hover { color: #fff; border-color: #fff; }
.home .nav.solid { background: rgba(238,234,227,.92); color: var(--ink); backdrop-filter: blur(10px); border-color: var(--line); }
.home .nav.solid .mark span, .home .nav.solid nav a { color: var(--muted); }
.home .nav.solid nav a:hover { color: var(--ink); border-color: var(--ink); }
@media (max-width: 620px) { .mark span { display: none; } .nav nav a { letter-spacing: .1em; } }

/* hero */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #26302f; color: #fff; isolation: isolate; }
.heroframe { position: absolute; inset: 0; z-index: -3; will-change: transform; }
.heroimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; animation: drift 34s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1.04); } to { transform: scale(1.14) translate(-1%, -1.2%); } }
.vignette { position: absolute; inset: 0; z-index: -2; background: radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(10,9,8,.55) 100%), linear-gradient(180deg, rgba(10,9,8,.35) 0%, transparent 22%, transparent 55%, rgba(10,9,8,.7) 100%); }
.grain { position: absolute; inset: -50%; z-index: -1; opacity: .13; mix-blend-mode: overlay; pointer-events: none; animation: grain 1.2s steps(6) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes grain { 0% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); } 40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); } 100% { transform: translate(0,0); } }
.herotext { position: absolute; left: var(--g); right: var(--g); bottom: clamp(48px, 9vh, 96px); }
.herotext h1 { font-size: clamp(3.4rem, 11vw, 9.5rem); font-weight: 400; line-height: .9; letter-spacing: -.02em; margin-bottom: 18px; text-shadow: 0 2px 30px rgba(0,0,0,.25); }
.scrollcue { position: absolute; right: var(--g); bottom: clamp(48px, 9vh, 96px); font: 400 22px/1 var(--sans); text-decoration: none; color: rgba(255,255,255,.75); animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .heroimg, .grain, .scrollcue { animation: none; } }
.herotext h1 .ch { display: inline-block; will-change: transform, opacity, filter; }
.herotext h1 .sp { display: inline-block; width: .26em; }

/* entrance */
.entrance { width: min(100% - 2 * var(--g), 760px); margin: 0 auto; padding: clamp(96px, 16vw, 200px) 0 clamp(80px, 12vw, 150px); }
.statement p { font: 400 clamp(1.6rem, 3.4vw, 2.5rem)/1.28 var(--serif); margin: 0 0 .7em; letter-spacing: -.005em; }
.statement p + p { color: #48443d; }
.sig { font: italic 400 1.5rem/1 var(--serif); color: var(--accent); margin: 30px 0 0; }

/* rooms on landing */
.rooms { width: min(100% - 2 * var(--g), 1360px); margin: 0 auto; padding-bottom: clamp(60px, 10vw, 140px); }
.roomshead { border-top: 1px solid var(--line); padding-top: 28px; margin-bottom: clamp(40px, 6vw, 80px); display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.roomshead h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.room { display: grid; grid-template-columns: 1.55fr 1fr; gap: clamp(28px, 5vw, 80px); align-items: center; text-decoration: none; margin-bottom: clamp(70px, 11vw, 150px); }
.room:nth-child(odd of .room) { grid-template-columns: 1fr 1.55fr; }
.room:nth-child(odd of .room) .roomimg { order: 2; }
.roomimg { margin: 0; overflow: hidden; background: var(--wall-2); }
.roomimg img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.room:hover .roomimg img { transform: scale(1.03); }
.roomimg { will-change: clip-path; }
.roomtext h3 { font-size: clamp(2.4rem, 5vw, 4.2rem); margin-bottom: 14px; }
.dek { font: italic 400 1.3rem/1.4 var(--serif); color: #48443d; margin: 0 0 22px; max-width: 30ch; }
.enter { display: inline-block; margin-top: 26px; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; border-bottom: 1px solid var(--ink); padding-bottom: 6px; }
.room:hover .enter span { display: inline-block; transform: translateX(4px); transition: transform .3s; }
@media (max-width: 860px) { .room, .room:nth-child(odd of .room) { grid-template-columns: 1fr; } .room:nth-child(odd of .room) .roomimg { order: 0; } }

/* page heads */
.pagehead { padding: clamp(70px, 10vw, 130px) 0 clamp(40px, 6vw, 70px); }
.pagehead h1 { font-size: clamp(2.8rem, 7vw, 5.5rem); }

/* exhibitions index */
.exgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(40px, 6vw, 90px) clamp(24px, 4vw, 56px); padding-bottom: 120px; }
.exitem { text-decoration: none; }
.exitem figure { margin: 0 0 20px; overflow: hidden; background: var(--wall-2); }
.exitem img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 1.4s cubic-bezier(.2,.7,.2,1); }
.exitem:hover img { transform: scale(1.03); }
.exitem h3 { font-size: clamp(2rem, 3.6vw, 3rem); margin-bottom: 8px; }
@media (max-width: 760px) { .exgrid { grid-template-columns: 1fr; } }

/* a gallery */
.wall { width: min(100% - 2 * var(--g), 720px); margin: 0 auto; padding: clamp(90px, 14vw, 180px) 0 clamp(70px, 10vw, 130px); }
.wall h1 { font-size: clamp(3.2rem, 9vw, 7rem); margin-bottom: 18px; }
.walltext { margin-top: clamp(36px, 5vw, 56px); border-top: 1px solid var(--line); padding-top: 32px; }
.walltext p { font: 400 clamp(1.25rem, 2vw, 1.5rem)/1.5 var(--serif); margin: 0 0 1em; color: #2c2a25; }
.hang { padding-bottom: clamp(60px, 10vw, 120px); }
.plate { margin: 0 auto clamp(90px, 14vw, 190px); }
.plate .open { display: block; width: 100%; cursor: zoom-in; }
.plate img { margin: 0 auto; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 30px 60px -38px rgba(25,24,21,.55); }
.plate .open { overflow: hidden; }
.plate.wide { width: min(100% - 2 * var(--g), 1320px); }
.plate.wide img { width: 100%; max-height: 88vh; object-fit: contain; }
.plate.tall { width: min(100% - 2 * var(--g), 720px); }
.plate.tall img { max-height: 90vh; width: auto; }
.pair { width: min(100% - 2 * var(--g), 1240px); margin: 0 auto clamp(90px, 14vw, 190px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 64px); align-items: end; }
.pair .plate { margin: 0; width: 100%; }
.pair .plate:nth-child(2) { margin-top: clamp(40px, 8vw, 120px); }
@media (max-width: 700px) { .pair { grid-template-columns: 1fr; gap: clamp(90px, 14vw, 190px); } .pair .plate:nth-child(2) { margin-top: 0; } }
figcaption { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 16px; font: 400 11.5px/1.5 var(--mono); color: var(--muted); letter-spacing: .03em; }
.plate.tall figcaption { justify-content: center; }
figcaption .no { color: var(--ink); font-weight: 500; }
.nextroom { width: min(100% - 2 * var(--g), 1240px); margin: 0 auto; border-top: 1px solid var(--line); padding: 40px 0 clamp(80px, 12vw, 140px); }
.nextroom a { font: 400 clamp(2.2rem, 6vw, 4.6rem)/1.05 var(--serif); text-decoration: none; display: inline-flex; gap: .3em; }
.nextroom a:hover span:last-child { transform: translateX(8px); }
.nextroom a span:last-child { transition: transform .3s; }

/* lightbox */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(14,13,11,.97); color: #fff; }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox figure { margin: 0; height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 56px 0 24px; min-width: 0; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 130px); width: auto; height: auto; object-fit: contain; }
.lightbox figcaption { color: rgba(255,255,255,.6); justify-content: center; }
.lightbox figcaption .no { color: #fff; }
.lbprev, .lbnext { height: 100%; font-size: 22px; color: rgba(255,255,255,.6); }
.lbprev:hover, .lbnext:hover, .lbclose:hover { color: #fff; }
.lbclose { position: absolute; top: 18px; right: 22px; font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.7); z-index: 2; }
@media (max-width: 700px) { .lightbox[open] { grid-template-columns: 40px 1fr 40px; } }

/* index of works */
.iw { border-top: 1px solid var(--line); padding: 30px 0 70px; }
.iw h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: 26px; display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; }
.iw h2 .label { margin: 0; }
.iw h2 a { text-decoration: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
.thumb { text-decoration: none; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--wall-2); transition: opacity .3s; }
.thumb:hover img { opacity: .82; }
.thumb span { display: block; margin-top: 8px; font: 400 11px/1 var(--mono); color: var(--muted); }

/* about */
.aboutgrid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 96px); padding-bottom: 130px; align-items: start; }
.aboutgrid figure { margin: 0; }
.abouttext p { font: 400 clamp(1.25rem, 2vw, 1.5rem)/1.5 var(--serif); margin: 0 0 1em; }
.elsewhere { margin-top: 44px; border-top: 1px solid var(--line); padding-top: 26px; }
.elsewhere p:last-child { font-size: 1.2rem; }
.elsewhere a { color: var(--accent); }
@media (max-width: 820px) { .aboutgrid { grid-template-columns: 1fr; } }

/* footer */
.foot { background: var(--night); color: rgba(255,255,255,.62); }
.footin { width: min(100% - 2 * var(--g), 1240px); margin: 0 auto; padding: 60px 0 50px; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 24px; align-items: baseline; font: 400 12px/1.6 var(--mono); }
.footin p { margin: 0; }
.foot .mark { color: #fff; font-size: 22px; }
.foot .mark span { color: rgba(255,255,255,.5); }
.foot a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.3); }
@media (max-width: 760px) { .footin { grid-template-columns: 1fr; } }

/* ---------- motion ---------- */
/* Reveal targets start hidden only when JS + motion are on (html.m). */
.m .herotext h1, .m .herotext .label, .m .scrollcue,
.m .statement p, .m .sig, .m .roomshead, .m .roomtext > *,
.m .wall > *, .m .walltext p, .m .plate, .m .nextroom,
.m .pagehead > *, .m .exitem, .m .iw, .m .aboutgrid > * { opacity: 0; }
.m .roomimg { clip-path: inset(100% 0 0 0); }
.nav { will-change: transform; }

/* Cross-page transitions (Chrome, Edge, Safari 18.2+). Gallery titles carry a
   view-transition-name, so a title glides from its card into the gallery. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .38s cubic-bezier(.4,0,.2,1) both; }
::view-transition-new(root) { animation: vt-in .6s cubic-bezier(.22,1,.36,1) .08s both; }
::view-transition-group(*) { animation-duration: .7s; animation-timing-function: cubic-bezier(.22,1,.36,1); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-group(*) { animation: none; }
}

.plate .open:focus-visible { outline: 1px solid var(--muted); outline-offset: 8px; }
.plate .open:focus:not(:focus-visible) { outline: none; }
