:root {
  --bg: #0e0d0b;
  --bg-2: #161411;
  --ink: #ece6da;
  --ink-2: #d3cbbd;
  --muted: #a39a8d;
  --line: #2a2621;
  --gold: #c9a45c;
  --serif: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 4vw, 80px);
  --max: 1440px;
  --max-wide: 1840px;
  --row-h: clamp(220px, 17vw, 400px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

/* Type scales up gently on large screens */
html { font-size: clamp(16px, 0.35vw + 11px, 20px); scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 300 1rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(3.2rem, 7vw, 7rem); }
h2 { font-size: clamp(2.2rem, 4vw, 3.8rem); }

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 400;
}

.btn {
  display: inline-block;
  padding: 0.9rem 1.8rem;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #16130e;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--gold); }
.btn--ghost { background: transparent; color: var(--ink); border-color: #4a4339; }
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--small { padding: 0.65rem 1.2rem; font-size: 0.72rem; }

/* Nav */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem var(--gutter);
  background: linear-gradient(to bottom, rgba(14,13,11,0.92), rgba(14,13,11,0));
  transition: background 0.3s;
}
.nav.is-solid { background: rgba(14,13,11,0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav__name { font-family: var(--serif); font-size: 1.4rem; letter-spacing: 0.02em; }
.nav__links { display: flex; gap: clamp(1rem, 2.5vw, 2.4rem); }
.nav__links a { font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); transition: color 0.2s; }
.nav__links a:hover { color: var(--gold); }
.nav__toggle { display: none; }

@media (max-width: 720px) {
  .nav__toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; cursor: pointer;
  }
  .nav__toggle span { display: block; width: 24px; height: 1px; background: var(--ink); margin-left: auto; margin-right: 10px; transition: transform 0.3s; }
  .nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(14,13,11,0.98); border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1.2rem;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  }
  .nav__links.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav__links a { padding: 0.9rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
  .nav__links a:last-child { border-bottom: 0; }
  .nav.is-open { background: rgba(14,13,11,0.98); }
}

/* Hero */
.hero {
  min-height: 100svh;
  max-width: var(--max-wide); margin: 0 auto;
  display: grid; grid-template-columns: 5fr 6fr; align-items: center; gap: clamp(2rem, 6vw, 8rem);
  padding: 6.5rem var(--gutter) 3rem;
}
.hero__lede { max-width: 30rem; color: var(--ink-2); font-size: 1.1rem; margin: 1.8rem 0 2.4rem; }
.hero__art { margin: 0; justify-self: center; }
.hero__art img { max-height: calc(100svh - 11rem); width: auto; box-shadow: 0 40px 80px -30px rgba(0,0,0,0.8); }
.hero__art figcaption { margin-top: 0.9rem; font-size: 0.85rem; color: var(--muted); }
.hero__art em { font-family: var(--serif); font-size: 1.1rem; color: var(--ink-2); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 6rem; min-height: auto; }
  .hero__art { order: -1; }
  .hero__art img { max-height: 62svh; }
}

/* Sections */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(4rem, 9vw, 8rem) var(--gutter); }
.section--wide { max-width: var(--max-wide); }
.section__head { margin-bottom: clamp(2rem, 4vw, 3.5rem); }

/* Series filters */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: -1rem 0 clamp(1.5rem, 3vw, 2.5rem); }
.filter {
  background: transparent; border: 1px solid #4a4339; color: var(--ink-2); cursor: pointer;
  padding: 0.5rem 1rem; font-size: 0.78rem; letter-spacing: 0.08em; transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.filter:hover { border-color: var(--gold); color: var(--gold); }
.filter[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #16130e; }
.filter__count { opacity: 0.6; margin-left: 0.35rem; }

/* Gallery — justified rows: equal height per row, reads left to right */
.gallery { display: flex; flex-wrap: wrap; gap: clamp(16px, 2vw, 32px); }
.gallery::after { content: ""; flex-grow: 999; }
.work {
  flex-grow: var(--r);
  flex-basis: calc(var(--r) * var(--row-h));
  margin: 0; cursor: zoom-in; position: relative;
}
.work__frame { position: relative; aspect-ratio: var(--r); overflow: hidden; background: var(--c, var(--bg-2)); }
.work__frame img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.9s cubic-bezier(.2,.7,.2,1), opacity 0.6s ease; }
.js .work__frame img, .js .moment img { opacity: 0; }
.js .work__frame img.is-loaded, .js .moment img.is-loaded { opacity: 1; }
.work:hover .work__frame img { transform: scale(1.03); }
.work figcaption { padding: 0.8rem 0 0; display: flex; flex-direction: column; gap: 0.1rem; }
.work__title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; }
.work__details { color: var(--muted); font-size: 0.82rem; }
.badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase;
  background: rgba(14,13,11,0.82); color: var(--gold); padding: 0.3rem 0.6rem; border: 1px solid rgba(201,164,92,0.4);
}
@media (max-width: 560px) {
  .work { flex-basis: 100%; }
}

/* About */
.about { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 7vw, 7rem); align-items: center; }
.about__img { margin: 0; }
.about__text h2 { margin-bottom: 1.8rem; }
.about__text p:not(.eyebrow) { color: var(--ink-2); max-width: 38rem; font-size: 1.05rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } .about__img { max-width: 480px; } }

/* Timeline */
.timeline { list-style: none; margin: 0 0 clamp(3rem, 6vw, 5rem); padding: 0; border-top: 1px solid var(--line); }
.timeline li {
  display: grid; grid-template-columns: 6rem 1fr; gap: 1.5rem;
  padding: 1.3rem 0; border-bottom: 1px solid var(--line);
}
.timeline__year { color: var(--gold); font-family: var(--serif); font-size: 1.4rem; }
.timeline__title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.3; }
.timeline__place { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 520px) { .timeline li { grid-template-columns: 3.5rem 1fr; gap: 1rem; } }

/* Exhibition photo strip */
.strip__head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.2rem; }
.strip__title { margin: 0; font-family: var(--serif); font-size: 1.6rem; }
.strip__controls { display: flex; gap: 0.5rem; }
.strip__btn {
  width: 2.8rem; height: 2.8rem; border: 1px solid #4a4339; background: transparent; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ink); transition: border-color 0.2s, color 0.2s, opacity 0.2s;
}
.strip__btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.strip__btn:disabled { opacity: 0.3; cursor: default; }
.moments {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth; padding-inline: 2px;
  padding-bottom: 1rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.moment { flex: 0 0 auto; margin: 0; scroll-snap-align: start; cursor: zoom-in; width: min-content; }
.moment img { height: clamp(280px, 30vw, 460px); width: auto; max-width: none; transition: opacity 0.6s ease; }
.moment figcaption { font-size: 0.85rem; color: var(--muted); padding-top: 0.6rem; line-height: 1.5; }

/* Contact */
.contact { text-align: center; border-top: 1px solid var(--line); }
.contact__lede { color: var(--ink-2); max-width: 32rem; margin: 1.4rem auto 2.4rem; font-size: 1.05rem; }
.contact__links { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

.footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 1.5rem;
  padding: 2rem var(--gutter); border-top: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em;
}
.footer a:hover { color: var(--gold); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8,7,6,0.97);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 5rem;
  animation: fade 0.25s ease;
}
.lightbox__figure { margin: 0; display: flex; flex-direction: column; align-items: center; max-width: 100%; max-height: 100%; }
.lightbox__figure img { max-height: calc(100svh - 13rem); max-width: 100%; width: auto; object-fit: contain; }
.lightbox figcaption { text-align: center; padding-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
#lb-title { font-family: var(--serif); font-size: 1.5rem; }
#lb-details { color: var(--muted); font-size: 0.85rem; }
#lb-enquire { margin-top: 0.8rem; }
.lightbox__count { position: absolute; top: 1.2rem; left: 1.5rem; margin: 0; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.1em; }
.lightbox > button {
  position: absolute; background: none; border: 0; color: var(--ink); cursor: pointer;
  font: 300 2.8rem/1 var(--sans); padding: 0.6rem 1rem; opacity: 0.75; transition: opacity 0.2s, color 0.2s;
}
.lightbox > button:hover { opacity: 1; color: var(--gold); }
.lightbox__close { top: 0.6rem; right: 1rem; }
.lightbox__prev { left: 0.5rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.5rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox { padding: 3.5rem 0.75rem 4rem; }
  .lightbox__figure img { max-height: calc(100svh - 16rem); }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 0.4rem; transform: none; }
}
@keyframes fade { from { opacity: 0; } }

/* Reveal on scroll (only when JS runs, so content never stays hidden) */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s cubic-bezier(.2,.7,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }
