:root {
  color-scheme: dark;
  --bg: #0c0c0c;
  --ink: #ece9e2;
  --muted: #8a8a85;
  --hairline: #262626;
  --serif: "Fraunces", Georgia, serif;
  --sans: system-ui, sans-serif;
}

* {
  margin: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.7;
  max-width: 72rem;
  margin: 0 auto;
  padding: 2.5rem clamp(1.25rem, 5vw, 4rem) 8rem;
}

/* film grain: inline SVG noise, no request, barely there */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

a {
  color: inherit;
  text-decoration: none;
}

h1 {
  font-family: var(--serif);
  font-weight: 340;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

/* Fraunces WONK axis: eccentric letterforms, display sizes only */
h1,
.photographers .name {
  font-variation-settings: "WONK" 1;
}

h1 em {
  font-style: italic;
  font-weight: 300;
}

/* small uppercase labels — the "metadata" from the references */
.kicker,
.label,
.bar,
.links,
.foot,
.opening,
figcaption {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- homepage ---------- */
.kicker {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.kicker a:hover {
  color: var(--ink);
}

.home h1 {
  margin-top: 14vh;
  font-size: clamp(3.2rem, 13vw, 10rem);
}

/* pre-opening teaser badge */
.opening {
  display: flex;
  align-items: center;
  gap: 0.6em;
  margin-top: 2rem;
}

.opening .dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: hsl(15 40% 62%);
  animation: hue-cycle 120s linear infinite;
}

/* "Capixabas" drifts through the whole palette, one full cycle every 2 min */
.home h1 em {
  color: hsl(15 40% 62%);
  animation: hue-cycle 120s linear infinite;
}

@keyframes hue-cycle {
  to {
    filter: hue-rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home h1 em,
  .opening .dot {
    animation: none;
  }
}

.tagline {
  margin-top: 2.5rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--muted);
}

.intro {
  margin: 6rem 0 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.intro p + p,
.statement p + p {
  margin-top: 1em;
}

.label {
  margin: 7rem 0 0;
}

.photographers {
  list-style: none;
  margin-top: 1rem;
  padding: 0;
}

.photographers li {
  border-top: 1px solid var(--hairline);
}

.photographers li:last-child {
  border-bottom: 1px solid var(--hairline);
}

.photographers a {
  display: flex;
  align-items: baseline;
  gap: 2rem;
  padding: 1.1rem 0;
}

.photographers .num {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--accent, var(--muted));
}

.photographers .name {
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  line-height: 1.1;
  transition: transform 0.25s, font-style 0s;
}

.photographers a:hover .name {
  font-style: italic;
  transform: translateX(0.75rem);
  color: var(--accent, var(--ink));
}

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
}

.curator {
  margin-bottom: 1.5rem;
  text-align: right;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.3rem;
  line-height: 1.3;
  white-space: nowrap;
}

.curator a:hover {
  color: var(--muted);
}

.curator .label {
  display: block;
  margin-bottom: 0.5rem;
  font-style: normal;
}

@media (max-width: 40rem) {
  .masthead {
    flex-direction: column;
    align-items: flex-start;
  }

  .curator {
    text-align: left;
    margin-bottom: 0;
  }
}

.details {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin-top: 6rem;
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.detail-value {
  margin-top: 1.2rem;
  font-family: var(--serif);
  font-weight: 340;
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  line-height: 1.15;
}

.detail-address {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-address a:hover {
  color: var(--ink);
}

@media (max-width: 40rem) {
  .details {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}

.foot a:hover {
  color: var(--ink);
}

/* ---------- photographer page ---------- */
.bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.bar a:hover {
  color: var(--ink);
}

.artist h1 {
  margin-top: 10vh;
  font-size: clamp(2.8rem, 9vw, 6.5rem);
}

.artist h1 em {
  color: var(--accent, inherit);
}

.artist .bio {
  margin-top: 2rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.artist .links {
  margin-top: 1.5rem;
  display: flex;
  gap: 2rem;
}

.artist .links a:hover {
  color: var(--accent, var(--ink));
}

.statement {
  margin: 7rem 0;
  max-width: 38rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.55;
  color: #c9c6bf;
}

/* first paragraph is the lede; the rest becomes smaller body text */
.statement p + p {
  margin-top: 1.6em;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--muted);
}

/* gallery: rhythm of three — full width, large left, smaller offset */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 5rem 2rem;
}

.gallery figure {
  grid-column: 1 / -1;
}

.gallery figure:nth-child(3n + 2) {
  grid-column: 1 / 8;
}

.gallery figure:nth-child(3n) {
  grid-column: 8 / -1;
  align-self: end;
  margin-top: 8rem;
}

.gallery img {
  display: block;
  max-width: 100%;
  max-height: 85vh; /* portraits must not become a wall */
  width: auto;
  height: auto;
}

figcaption {
  margin-top: 0.8rem;
  color: var(--accent, var(--muted));
}

/* click-to-view: CSS :target lightbox, no JS */
.gallery figure a {
  cursor: zoom-in;
}

/* freeze page scroll while a photo is full screen */
html:has(.lightbox:target) {
  overflow: hidden;
}

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  margin: 0;
  background: var(--bg);
  padding: clamp(1rem, 4vw, 3rem);
}

.lightbox:target {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 1.5rem;
  justify-items: center;
}

.lightbox .shut {
  min-height: 0;
  display: grid;
  place-items: center;
  cursor: zoom-out;
}

.lightbox .close {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(1rem, 3vw, 2rem);
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1;
  color: var(--muted);
}

.lightbox .close:hover {
  color: var(--ink);
}

.lightbox .shut img {
  /* viewport-based cap: 100% is unreliable inside a stretched grid item */
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  width: auto;
  height: auto;
}

/* bottom navigator: every photo of the series, current one lit */
.lightbox nav {
  display: flex;
  gap: 0.75rem;
  max-width: 100%;
  overflow-x: auto;
}

.lightbox nav img {
  display: block;
  height: 3.5rem;
  width: auto;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.lightbox nav a:hover img,
.lightbox nav .current img {
  opacity: 1;
}

.lightbox nav .current {
  outline: 1px solid var(--accent, var(--muted));
  outline-offset: 2px;
}

/* long-form bio after the gallery */
.about {
  margin-top: 7rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.about .label {
  margin: 0 0 1.5rem;
}

.about p + p {
  margin-top: 1em;
}

/* mini portfolio: small always-published grid after the bio */
.portfolio {
  margin-top: 4rem;
  max-width: 34rem;
}

.portfolio .label {
  margin: 0 0 1.5rem;
}

.portfolio .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.75rem;
}

.portfolio a {
  cursor: zoom-in;
}

.portfolio img {
  display: block;
  width: 100%;
  height: auto; /* defeat the width/height attribute hint so aspect-ratio wins */
  aspect-ratio: 1;
  object-fit: cover;
}

/* pre-opening: framed empty tiles hold the photos' place */
.gallery .label {
  grid-column: 1 / -1;
  margin: 0;
}

.placeholder {
  aspect-ratio: 3 / 2;
  border: 1px solid var(--hairline);
  display: grid;
  place-items: center;
}

.placeholder span {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--accent, var(--muted));
  opacity: 0.6;
}

@media (max-width: 40rem) {
  .gallery figure:nth-child(3n + 2),
  .gallery figure:nth-child(3n) {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

/* tighter section rhythm on small screens */
@media (max-width: 40rem) {
  body {
    padding-bottom: 4rem;
  }

  .kicker span + span {
    display: none;
  }

  .home h1 {
    margin-top: 7vh;
  }

  .tagline {
    margin-top: 1.5rem;
  }

  .details {
    margin-top: 3rem;
    padding-top: 1.5rem;
  }

  .intro {
    margin-top: 3rem;
  }

  .label {
    margin-top: 3.5rem;
  }

  .foot {
    margin-top: 4rem;
  }

  .artist h1 {
    margin-top: 6vh;
  }

  .statement {
    margin: 3.5rem 0;
  }

  .gallery {
    gap: 3rem 0;
  }
}
