:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #292239;
  --muted: #5e565d;
  --accent: #953f33;
  --rule: #ddd8cf;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: 'Segoe UI', system-ui, sans-serif;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }

.wrap { width: min(76rem, calc(100% - 2 * var(--gutter))); margin-inline: auto; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
[id] { scroll-margin-top: 1.5rem; }

.skip-link {
  position: absolute;
  top: 1rem;
  left: var(--gutter);
  z-index: 1;
  padding: .75rem 1rem;
  background: var(--paper);
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding-block: 1rem .5rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  max-width: 100%;
}

.wordmark img { width: clamp(15rem, 29vw, 20rem); height: auto; filter: brightness(0); }

nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem clamp(.85rem, 3.2vw, 2.6rem); }
nav a {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: .3em;
}
nav a:hover, nav a[aria-current="page"] { text-decoration: underline; }

h1, h2 { font-family: var(--serif); font-weight: 400; }

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.35fr);
  align-items: center;
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  padding-block: clamp(2.25rem, 4.2vw, 4rem) clamp(2.5rem, 6vw, 5.5rem);
}

.artist-intro h1 {
  font-size: clamp(3.5rem, 6vw, 6.5rem);
  line-height: .97;
  letter-spacing: -.065em;
}

.artist-intro em { display: block; }
.artist-intro p { margin-top: 1.25rem; color: var(--muted); line-height: 1.5; }

.gallery-entry {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: .4rem;
  font-weight: 600;
  text-underline-offset: .3em;
}

.gallery-entry:hover { color: var(--accent); }

.portfolio {
  padding-block: clamp(2rem, 4vw, 3.75rem) clamp(2.75rem, 6vw, 5.5rem);
  border-top: 1px solid var(--rule);
}

.portfolio h2 {
  margin-bottom: clamp(1.25rem, 2.4vw, 2rem);
  font-size: clamp(2rem, 3.8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.collection-page { border-top: 0; }
.collection-page .gallery-link { background: transparent; }

.collection-page h1 {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.collection-footer {
  padding-block: 1.25rem 1.75rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  text-align: center;
}

.collection-footer a { text-underline-offset: .2em; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.75rem);
}

.painting { margin: 0; }
.painting figcaption {
  margin-top: .6rem;
  color: var(--muted);
  font-size: .875rem;
  line-height: 1.45;
}

.gallery-link {
  display: block;
  aspect-ratio: 4 / 3;
  background: #f1efea;
  cursor: zoom-in;
}

.gallery-link img { width: 100%; height: 100%; object-fit: contain; }
.gallery-link[data-artwork-face] { background: transparent; }
.gallery-link[data-artwork-face]:focus-visible { outline-color: var(--ink); }

.photo-rectified[data-artwork-face]:not([data-artwork-face=""]) {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}

.photo-rectified[data-artwork-face]:not([data-artwork-face=""]) > img {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--photo-width, 960px);
  height: var(--photo-height, 1280px);
  max-width: none;
  max-height: none;
  object-fit: fill;
  clip-path: var(--photo-outline);
  transform-origin: top left;
  transform: scale(var(--photo-scale)) var(--photo-transform);
}

/* Project each photographed canvas onto a rectangle in a shared 960 × 720 frame. */

[data-artwork-face="summer-flowers"] {
  --photo-transform: matrix3d(1.1444072596, 0.0309721758, 0, 0.0000477361, -0.0355140318, 1.1069486096, 0, -0.0000476862, 0, 0, 1, 0, -29.1030318442, -364.8364595919, 0, 1);
  --photo-outline: polygon(8.75912% 28.28125%, 88.11262% 26.71875%, 87.69552% 71.79688%, 10.42753% 71.71875%);
}

[data-artwork-face="deep-waters"] {
  --photo-transform: matrix3d(1.0529824279, 0.0571797223, 0, 0.0001666024, -0.0032647132, 0.9731294098, 0, -0.0000036559, 0, 0, 1, 0, 50.2795428481, -296.1193071122, 0, 1);
  --photo-outline: polygon(1.77083% 25.62500%, 97.08333% 21.71875%, 97.08333% 83.82813%, 1.97917% 79.53125%);
}

[data-artwork-face="autumn-green"] {
  --photo-transform: matrix3d(1.1546028318, 0.073979789, 0, 0.0001657062, 0.0368132164, 1.0934917371, 0, 0.0000603101, 0, 0, 1, 0, -14.7271482445, -224.6080838565, 0, 1);
  --photo-outline: polygon(5.93750% 17.50000%, 95.31250% 13.20312%, 96.66667% 71.25000%, 3.95833% 68.51563%);
}

[data-artwork-face="citrus-still-life"] {
  --photo-width: 1280px;
  --photo-height: 989px;
  --photo-transform: matrix3d(0.781664151778, 0.002542570153, 0, -0.000000018635, -0.000914227078, 0.780641755073, 0, -0.000002857003, 0, 0, 1, 0, -12.472800026563, -3.536591121344, 0, 1);
  --photo-outline: polygon(1.25% 3.741153%, 97.1875% 3.336704%, 97.03125% 89.787664%, 1.328125% 90.192113%);
}

[data-artwork-face="woodland-flowers"] {
  --photo-width: 1280px;
  --photo-height: 960px;
  --photo-transform: matrix3d(0.953595421999, -0.010684723014, 0, -0.000020451232, -0.013515525666, 0.948005419112, 0, -0.000043416352, 0, 0, 1, 0, -170.559927006199, -95.197286333752, 0, 1);
  --photo-outline: polygon(14.140625% 15.729167%, 90.390625% 16.770833%, 88.984375% 81.5625%, 14.84375% 81.875%);
}

[data-artwork-face="flowers-and-fruit"] {
  --photo-transform: matrix3d(0.778178597318, -0.030731439719, 0, -0.000086092513, -0.025546893581, 0.792547655899, 0, -0.000073861767, 0, 0, 1, 0, 70.655861927551, -169.970740750592, 0, 1);
  --photo-outline: polygon(25.625% 17.5%, 76.666667% 18.984375%, 74.166667% 80.15625%, 26.25% 81.484375%);
}

[data-artwork-face="pink-roses"] {
  --photo-width: 592px;
  --photo-transform: matrix3d(0.63371072854, 0.002196096134, 0, -0.000022876001, 0, 0.644554215361, 0, 0, 0, 0, 1, 0, 288.214679157102, -14.184584930205, 0, 1);
  --photo-outline: polygon(0.337838% 1.71875%, 99.493243% 1.5625%, 99.493243% 87.65625%, 0.337838% 88.984375%);
}

[data-artwork-face="oranges"] {
  --photo-transform: matrix3d(0.569004609612, -0.010854536855, 0, -0.000017004211, -0.007504589147, 0.56507441865, 0, -0.000033808127, 0, 0, 1, 0, 185.890805132682, -16.268396737606, 0, 1);
  --photo-outline: polygon(6.5625% 2.34375%, 98.75% 3.671875%, 95% 97.421875%, 6.5625% 97.578125%);
}

.details { color: var(--paper); background: var(--ink); }

.details-inner {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 6rem);
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}

.details h2 { margin-bottom: .7rem; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; }
.details p { max-width: 64ch; color: #e6dfe4; line-height: 1.65; }
#about p + p { margin-top: 1rem; }

#about {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "title title"
    "portrait copy";
  align-items: start;
  column-gap: clamp(1rem, 2.5vw, 1.75rem);
}

#about-title { grid-area: title; }
.bio-copy { grid-area: copy; }

.bio-portrait {
  grid-area: portrait;
  width: clamp(6.5rem, 12vw, 8.5rem);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  border-radius: .125rem;
}

.lightbox {
  width: min(60rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: .85rem;
  border: 0;
  color: var(--paper);
  background: var(--ink);
}

.lightbox::backdrop { background: rgb(21 16 28 / .84); }

.viewer-bar, .viewer-navigation { display: flex; align-items: center; gap: .5rem; }
.viewer-bar { flex-wrap: wrap; justify-content: space-between; margin-bottom: .8rem; }
.viewer-position { min-width: 5ch; font-size: .875rem; text-align: center; }

.viewer-bar button {
  min-height: 2.75rem;
  padding: .5rem .65rem;
  border: 1px solid currentColor;
  color: inherit;
  background: transparent;
  font-size: .9375rem;
  cursor: pointer;
}

.viewer-bar button:focus-visible { outline-color: var(--paper); outline-offset: 2px; }
.viewer-bar button:hover { background: rgb(255 255 255 / .12); }
.lightbox-image { width: 100%; max-height: calc(100dvh - 7rem); object-fit: contain; }
.lightbox-photo[data-artwork-face]:not([data-artwork-face=""]) {
  width: min(100%, calc((100dvh - 7rem) * 4 / 3));
  margin-inline: auto;
}

@media (max-width: 48rem) {
  .feature, .details-inner { grid-template-columns: 1fr; }
  .artist-intro h1 { font-size: clamp(2.7rem, 8.5vw, 4.25rem); }
  .artist-intro em { display: inline; }
  .artist-intro p { margin-top: .8rem; }
}

@media (max-width: 34rem) {
  nav { column-gap: clamp(.6rem, 2.8vw, 1.2rem); }
  .gallery { grid-template-columns: 1fr; }

  #about {
    grid-template-areas:
      "portrait title"
      "copy copy";
    align-items: center;
    gap: 1.2rem 1.1rem;
  }

  #about-title { margin: 0; }
  .bio-portrait { width: 5.25rem; }
}
