/* ==========================================================================
   gallery.css — homepage stylesheet for the watercolor art-museum portfolio
   Monet-inspired design language, shared with assets/css/exhibit-page.css.

   Contents
   --------
   1.  Tokens & base
   2.  Paper grain & golden-hour overlay
   3.  Drifting watercolor washes (.wash-field)
   4.  Cursor paint canvas (#paint-canvas)
   5.  Intro loader (#loader)
   6.  Top navigation (#nav)
   7.  Section primitives (rooms, labels, titles, dividers)
   8.  Hero — the entrance (#hero)
   9.  Room I — the artist (#artist)
   10. Room II — the palette (#palette)
   11. Room III — the gallery (#gallery): frames, tilt, placards
   12. Annex — studies (#studies)
   13. The last room — correspondence (#contact)
   14. Reveal-on-scroll contract
   15. Responsive
   16. Reduced motion
   17. Print
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens & base
   -------------------------------------------------------------------------- */

:root {
  --paper: #f6f1e7;
  --paper-deep: #efe7d8;
  --ink: #2e3a48;
  --ink-soft: #5a6a79; /* 4.53:1 on --paper-deep, 4.94:1 on --paper (WCAG AA) */
  --pond: #7fa8c9;
  --pond-deep: #4a7299;
  --pond-ink: #456a8f; /* text-safe pond: 4.61:1 on --paper-deep, 5.03:1 on --paper */
  --wisteria: #a292c4;
  --sage: #93b48b;
  --rose: #d98ba0;
  --gold: #cdb878;

  --mat: #fbf7ee;
  --hairline: rgba(46, 58, 72, 0.16);
  --font-display: "Cormorant Garamond", "Garamond", "Georgia", serif;
  --font-body: "Karla", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}

html,
body {
  overflow-x: hidden; /* pre-2022 Safari ignores clip */
  overflow-x: clip;
}

body {
  position: relative;
  min-height: 100vh;
  background-color: var(--paper);
  background-image: linear-gradient(
    180deg,
    var(--paper) 0%,
    var(--paper-deep) 58%,
    var(--paper) 100%
  );
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

strong {
  font-weight: 500;
}

ul {
  list-style: none;
}

::selection {
  background: rgba(127, 168, 201, 0.3); /* pond at 30% */
  color: var(--ink);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link — first focusable element on the page */
.skip-link {
  position: absolute;
  top: -3.5rem;
  left: 1rem;
  z-index: 110;
  padding: 0.6rem 1.1rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* Visually hidden, available to assistive technology */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Content sits above the washes (z:0) and the paint canvas (z:1). */
main,
footer#contact {
  position: relative;
  z-index: 2;
}

/* --------------------------------------------------------------------------
   2. Paper grain & golden-hour overlay
   -------------------------------------------------------------------------- */

.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.4'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* "monet" easter egg: gallery.js toggles html.golden for 6 seconds. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  background:
    radial-gradient(
      120% 90% at 50% 28%,
      rgba(255, 226, 158, 0.06) 0%,
      rgba(205, 170, 100, 0.26) 62%,
      rgba(152, 112, 72, 0.4) 100%
    ),
    linear-gradient(180deg, rgba(255, 214, 140, 0.16), rgba(217, 139, 160, 0.12));
  transition: opacity 1.2s ease;
}

html.golden body::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   3. Drifting watercolor washes
   .wash-field stays static (zero height, no stacking context) so each fixed
   .wash can multiply-blend against the paper itself. gallery.js writes a
   --parallax length onto each .wash on scroll; that translate lives on the
   element while drift / border-radius morphing lives on ::before, so the
   keyframes never stomp the inline custom property.
   -------------------------------------------------------------------------- */

.wash-field {
  pointer-events: none;
}

.wash {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  transform: translateY(var(--parallax, 0px));
  will-change: transform;
}

.wash::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 52% 48% 55% 45% / 48% 56% 44% 52%;
  filter: blur(12px); /* gradients carry the softness; heavy blur was 4x frame cost */
  opacity: 0.55;
  will-change: transform;
}

.wash--pond {
  top: -18vh;
  right: -12vw;
  width: 56vw;
  height: 56vw;
  min-width: 24rem;
  min-height: 24rem;
}
.wash--pond::before {
  background:
    radial-gradient(circle at 38% 42%, rgba(127, 168, 201, 0.55) 0%, rgba(127, 168, 201, 0) 62%),
    radial-gradient(circle at 64% 58%, rgba(74, 114, 153, 0.32) 0%, rgba(74, 114, 153, 0) 58%),
    radial-gradient(circle at 50% 70%, rgba(147, 180, 139, 0.22) 0%, rgba(147, 180, 139, 0) 55%);
  animation: drift-a 52s ease-in-out infinite alternate;
}

.wash--wisteria {
  top: 30vh;
  left: -18vw;
  width: 50vw;
  height: 50vw;
  min-width: 22rem;
  min-height: 22rem;
}
.wash--wisteria::before {
  background:
    radial-gradient(circle at 55% 45%, rgba(162, 146, 196, 0.5) 0%, rgba(162, 146, 196, 0) 60%),
    radial-gradient(circle at 35% 65%, rgba(217, 139, 160, 0.26) 0%, rgba(217, 139, 160, 0) 55%),
    radial-gradient(circle at 70% 30%, rgba(127, 168, 201, 0.22) 0%, rgba(127, 168, 201, 0) 50%);
  animation: drift-b 64s ease-in-out infinite alternate;
}

.wash--sage {
  bottom: -16vh;
  right: -8vw;
  width: 46vw;
  height: 46vw;
  min-width: 20rem;
  min-height: 20rem;
}
.wash--sage::before {
  background:
    radial-gradient(circle at 45% 50%, rgba(147, 180, 139, 0.48) 0%, rgba(147, 180, 139, 0) 60%),
    radial-gradient(circle at 62% 38%, rgba(205, 184, 120, 0.3) 0%, rgba(205, 184, 120, 0) 55%),
    radial-gradient(circle at 30% 65%, rgba(127, 168, 201, 0.2) 0%, rgba(127, 168, 201, 0) 52%);
  animation: drift-c 58s ease-in-out infinite alternate;
}

.wash--rose {
  top: -10vh;
  left: -14vw;
  width: 42vw;
  height: 42vw;
  min-width: 18rem;
  min-height: 18rem;
}
.wash--rose::before {
  background:
    radial-gradient(circle at 52% 48%, rgba(217, 139, 160, 0.42) 0%, rgba(217, 139, 160, 0) 60%),
    radial-gradient(circle at 32% 62%, rgba(162, 146, 196, 0.24) 0%, rgba(162, 146, 196, 0) 54%),
    radial-gradient(circle at 68% 34%, rgba(205, 184, 120, 0.18) 0%, rgba(205, 184, 120, 0) 50%);
  animation: drift-b 74s ease-in-out infinite alternate;
  animation-delay: -18s;
}

.wash--gold {
  bottom: -14vh;
  left: 20vw;
  width: 40vw;
  height: 40vw;
  min-width: 17rem;
  min-height: 17rem;
}
.wash--gold::before {
  background:
    radial-gradient(circle at 48% 46%, rgba(205, 184, 120, 0.42) 0%, rgba(205, 184, 120, 0) 60%),
    radial-gradient(circle at 64% 60%, rgba(147, 180, 139, 0.22) 0%, rgba(147, 180, 139, 0) 54%),
    radial-gradient(circle at 34% 66%, rgba(217, 139, 160, 0.18) 0%, rgba(217, 139, 160, 0) 50%);
  animation: drift-a 86s ease-in-out infinite alternate;
  animation-delay: -32s;
}

/* Second pass of pond & wisteria, hung elsewhere, fainter, off-beat. */
.wash--pond.wash--alt {
  top: 56vh;
  right: 6vw;
  bottom: auto;
  width: 36vw;
  height: 36vw;
  min-width: 15rem;
  min-height: 15rem;
}
.wash--pond.wash--alt::before {
  opacity: 0.34;
  animation: drift-c 68s ease-in-out infinite alternate;
  animation-delay: -24s;
}

.wash--wisteria.wash--alt {
  top: 4vh;
  left: 34vw;
  width: 32vw;
  height: 32vw;
  min-width: 13rem;
  min-height: 13rem;
}
.wash--wisteria.wash--alt::before {
  opacity: 0.3;
  animation: drift-a 90s ease-in-out infinite alternate;
  animation-delay: -40s;
}

@keyframes drift-a {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    border-radius: 52% 48% 55% 45% / 48% 56% 44% 52%;
  }
  50% {
    transform: translate3d(-3vw, 4vh, 0) rotate(5deg) scale(1.05);
    border-radius: 46% 54% 48% 52% / 56% 44% 58% 42%;
  }
  100% {
    transform: translate3d(-5vw, 6vh, 0) rotate(9deg) scale(1.08);
    border-radius: 57% 43% 44% 56% / 45% 57% 43% 55%;
  }
}

@keyframes drift-b {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1.05);
    border-radius: 48% 52% 46% 54% / 54% 46% 56% 44%;
  }
  50% {
    transform: translate3d(4vw, -3vh, 0) rotate(-6deg) scale(1);
    border-radius: 55% 45% 54% 46% / 44% 58% 42% 56%;
  }
  100% {
    transform: translate3d(6vw, -5vh, 0) rotate(-11deg) scale(0.96);
    border-radius: 44% 56% 50% 50% / 52% 44% 56% 48%;
  }
}

@keyframes drift-c {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    border-radius: 50% 50% 46% 54% / 46% 54% 48% 52%;
  }
  50% {
    transform: translate3d(-2vw, -4vh, 0) rotate(4deg) scale(1.06);
    border-radius: 58% 42% 52% 48% / 50% 48% 54% 46%;
  }
  100% {
    transform: translate3d(-4vw, -6vh, 0) rotate(7deg) scale(1.1);
    border-radius: 46% 54% 58% 42% / 56% 46% 50% 50%;
  }
}

/* --------------------------------------------------------------------------
   4. Cursor paint canvas — gallery.js paints watercolor blooms here.
   Above the washes, below all content.
   -------------------------------------------------------------------------- */

#paint-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: multiply;
}

/* --------------------------------------------------------------------------
   5. Intro loader — pure CSS: blooms in, then fades itself away (~1.6s).
   pointer-events: none so it can never trap input.
   -------------------------------------------------------------------------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--paper);
  pointer-events: none;
  animation: loader-fade 0.5s ease 1.1s forwards;
}

#loader > * {
  grid-area: 1 / 1;
}

.loader-blob {
  width: clamp(6rem, 18vw, 9rem);
  height: clamp(6rem, 18vw, 9rem);
  border-radius: 56% 44% 48% 52% / 47% 53% 46% 54%;
  background:
    radial-gradient(circle at 36% 40%, rgba(127, 168, 201, 0.7) 0%, rgba(127, 168, 201, 0) 65%),
    radial-gradient(circle at 64% 58%, rgba(162, 146, 196, 0.55) 0%, rgba(162, 146, 196, 0) 62%),
    radial-gradient(circle at 50% 72%, rgba(147, 180, 139, 0.45) 0%, rgba(147, 180, 139, 0) 58%);
  mix-blend-mode: multiply;
  filter: blur(2px);
  animation: loader-bloom 1.3s cubic-bezier(0.22, 0.8, 0.32, 1) both;
}

.loader-monogram {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.6rem;
  letter-spacing: 0.18em;
  color: var(--ink);
  animation: loader-monogram-in 0.9s ease 0.25s both;
}

@keyframes loader-bloom {
  0% {
    transform: scale(0.15) rotate(-12deg);
    opacity: 0;
    border-radius: 50%;
  }
  60% {
    opacity: 0.9;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.85;
    border-radius: 56% 44% 48% 52% / 47% 53% 46% 54%;
  }
}

@keyframes loader-monogram-in {
  from {
    opacity: 0;
    letter-spacing: 0.4em;
  }
  to {
    opacity: 1;
    letter-spacing: 0.18em;
  }
}

@keyframes loader-fade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* --------------------------------------------------------------------------
   6. Top navigation — transparent at rest; gallery.js adds .scrolled past
   24px and the bar gets translucent paper + blur + a hairline.
   -------------------------------------------------------------------------- */

#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background-color 0.35s ease,
    border-color 0.35s ease,
    -webkit-backdrop-filter 0.35s ease,
    backdrop-filter 0.35s ease,
    box-shadow 0.35s ease;
}

#nav.scrolled {
  background: rgba(246, 241, 231, 0.82);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
  backdrop-filter: blur(10px) saturate(1.1);
  border-bottom-color: var(--hairline);
  box-shadow: 0 10px 30px -22px rgba(46, 58, 72, 0.45);
}

.monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid rgba(46, 58, 72, 0.35);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.monogram:hover {
  background-color: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem clamp(1.1rem, 2.6vw, 2.2rem);
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 0.85rem 0.25rem; /* ≥44px touch target */
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

/* Ink underline that paints in from the left. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem; /* hug the text inside the enlarged tap padding */
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}

/* Kept as separate rules: grouping :focus-visible would drop the whole
   list on engines that don't recognize it. */
.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a:focus-visible::after {
  transform: scaleX(1);
}

/* --------------------------------------------------------------------------
   7. Section primitives — rooms, labels, titles, painted dividers
   -------------------------------------------------------------------------- */

main > section,
footer#contact {
  max-width: 72rem;
  margin: 0 auto;
  padding: clamp(5rem, 11vw, 8.5rem) clamp(1.25rem, 6vw, 4rem);
  scroll-margin-top: 4.5rem;
}

.section-head {
  margin-bottom: clamp(2.8rem, 6vw, 4.5rem);
}

.room-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.section-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  font-weight: 400;
  color: var(--ink-soft);
  margin-top: 0.7rem;
}

/* Painted brush-stroke dividers between rooms; --dc is the stroke pigment.
   The #wc-rough displacement filter (inline SVG in index.html) roughs the
   edges into a dry-brush mark. */
.divider {
  height: 7px;
  width: min(58vw, 23rem);
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0) 0%,
    var(--dc, var(--pond)) 18%,
    var(--dc, var(--pond)) 78%,
    rgba(0, 0, 0, 0) 100%
  );
  opacity: 0.55;
  filter: url(#wc-rough);
}

.divider--pond { --dc: var(--pond); }
.divider--wisteria { --dc: var(--wisteria); }
.divider--sage { --dc: var(--sage); }
.divider--rose { --dc: var(--rose); }
.divider--gold { --dc: var(--gold); }

/* --------------------------------------------------------------------------
   Museum placard — base card shared by hero, works and studies
   -------------------------------------------------------------------------- */

.placard {
  background: rgba(251, 247, 238, 0.88);
  border: 1px solid var(--hairline);
  box-shadow: 0 8px 20px -14px rgba(46, 58, 72, 0.35);
  padding: 1.4rem 1.6rem 1.5rem;
}

.placard-no {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.55rem;
}

.placard-no::after {
  content: "";
  display: block;
  width: 1.8rem;
  height: 2px;
  margin-top: 0.55rem;
  background: var(--gold);
  opacity: 0.75;
}

.placard-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.placard-medium {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.placard-year {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.placard-desc {
  font-size: 0.97rem;
  line-height: 1.7;
  color: var(--ink);
}

.placard-link {
  position: relative;
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--pond-ink);
  text-decoration: none;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(74, 114, 153, 0.4);
  transition: color 0.25s ease, border-color 0.25s ease;
}

/* Invisible halo brings the tap target to ~44px without moving the design. */
.placard-link::before {
  content: "";
  position: absolute;
  inset: -10px -8px;
}

.placard-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* --------------------------------------------------------------------------
   8. Hero — the museum entrance
   -------------------------------------------------------------------------- */

#hero {
  position: relative;
  min-height: 100svh;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem clamp(1.25rem, 6vw, 4rem) 7.5rem;
}

#hero .room-label {
  margin-bottom: 1.6rem;
}

.hero-name {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3.5rem, 11vw, 9rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.hero-word {
  display: block;
}

.hero-word--second {
  font-style: italic;
  margin-top: -0.04em;
}

.hero-stroke {
  width: clamp(9rem, 28vw, 17rem);
  height: 0.55rem;
  margin: clamp(1.4rem, 3.5vw, 2.2rem) auto;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(127, 168, 201, 0) 0%,
    var(--pond) 22%,
    var(--wisteria) 55%,
    var(--sage) 82%,
    rgba(147, 180, 139, 0) 100%
  );
  opacity: 0.7;
  filter: url(#wc-soft);
}

.hero-subtitle {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.55rem);
  text-wrap: balance;
  font-weight: 400;
  color: var(--ink-soft);
  max-width: 34em;
}

.hero-hint {
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--ink-soft);
  margin-top: 1.1rem;
}

/* Tell the truth per input: trail painting is mouse-only; touch gets splashes. */
.hint-touch {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  .hint-cursor {
    display: none;
  }

  .hint-touch {
    display: inline;
  }
}

.hero-placard {
  margin-top: 3rem;
  max-width: 17rem;
  text-align: center;
  transform: rotate(-1.4deg);
}

.hero-placard .placard-no::after {
  margin-left: auto;
  margin-right: auto;
}

.hero-placard .placard-title {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.hero-placard .placard-medium {
  font-size: 0.62rem;
  margin-bottom: 0;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: calc(2.1rem + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.25s ease;
  white-space: nowrap;
}

.scroll-cue:hover {
  color: var(--pond-ink);
}

.scroll-cue span {
  display: inline-block;
  animation: cue-float 2.2s ease-in-out infinite;
}

@keyframes cue-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(0.35em); }
}

/* --------------------------------------------------------------------------
   9. Room I — the artist: blob-masked portrait + offset wisteria wash
   -------------------------------------------------------------------------- */

.artist-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 4.5rem);
  align-items: center;
}

.artist-portrait {
  position: relative;
  max-width: 21rem;
  margin: 0 auto;
}

.artist-portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 58% 42% 55% 45% / 48% 55% 45% 52%;
  border: 1px solid rgba(46, 58, 72, 0.18);
  box-shadow:
    0 1px 2px rgba(46, 58, 72, 0.1),
    0 22px 44px -22px rgba(46, 58, 72, 0.35);
}

/* Loose wisteria pigment pooled behind the portrait, offset down-left. */
.portrait-wash {
  position: absolute;
  inset: -9%;
  transform: translate(-8%, 8%);
  border-radius: 45% 55% 48% 52% / 56% 44% 58% 42%;
  background:
    radial-gradient(circle at 42% 44%, rgba(162, 146, 196, 0.5) 0%, rgba(162, 146, 196, 0) 64%),
    radial-gradient(circle at 64% 62%, rgba(127, 168, 201, 0.3) 0%, rgba(127, 168, 201, 0) 58%),
    radial-gradient(circle at 36% 70%, rgba(217, 139, 160, 0.24) 0%, rgba(217, 139, 160, 0) 54%);
  mix-blend-mode: multiply;
  filter: blur(14px);
  animation: portrait-wash-morph 24s ease-in-out infinite alternate;
}

@keyframes portrait-wash-morph {
  0% {
    border-radius: 45% 55% 48% 52% / 56% 44% 58% 42%;
    transform: translate(-8%, 8%) rotate(0deg);
  }
  100% {
    border-radius: 55% 45% 56% 44% / 46% 56% 44% 56%;
    transform: translate(-10%, 6%) rotate(6deg);
  }
}

.artist-prose p {
  margin-bottom: 1.25rem;
  max-width: 38rem;
}

.artist-prose p:last-child {
  margin-bottom: 0;
}

.pull-quote {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--pond-ink);
  padding-left: 1.3rem;
  border-left: 3px solid var(--gold);
  margin-top: 2rem;
}

/* --------------------------------------------------------------------------
   10. Room II — the palette: pigment-blob buttons
   gallery.js appends span.ripple at the click point and toggles .splash.
   The pigment color rides each button's inline --c custom property; the
   shape itself morphs on the ::before so .splash never stomps it.
   -------------------------------------------------------------------------- */

.pigment-cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.7rem 2.1rem;
  max-width: 56rem;
  margin: 0 auto;
  padding-top: 1rem;
}

.pigment {
  position: relative;
  overflow: visible;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 1.75rem 2.7rem;
  border-radius: 56% 44% 48% 52% / 47% 53% 46% 54%;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  transition: transform 0.3s ease;
}

/* The blot of pigment itself: pooled center, settled darker rim.
   Plain-color fallback first: color-mix() with var() is invalid at
   computed-value time on pre-2023 engines, which would otherwise leave the
   blot fully transparent rather than falling back through the cascade. */
.pigment::before {
  content: "";
  position: absolute;
  inset: -7% -5%;
  z-index: -1;
  border-radius: 56% 44% 48% 52% / 47% 53% 46% 54%;
  background: var(--c, var(--pond));
  box-shadow: 0 14px 26px -18px rgba(46, 58, 72, 0.5);
  opacity: 0.45;
  mix-blend-mode: multiply;
  filter: blur(0.4px);
  animation: pigment-morph 12s ease-in-out infinite alternate;
  transition: opacity 0.3s ease, transform 0.4s ease;
}

/* A loose satellite blot, as if the brush rested here a moment. */
.pigment::after {
  content: "";
  position: absolute;
  z-index: -2;
  width: 38%;
  height: 48%;
  right: -10%;
  bottom: -16%;
  border-radius: 62% 38% 55% 45% / 48% 62% 38% 52%;
  background: var(--c, var(--pond));
  mix-blend-mode: multiply;
  opacity: 0.55;
  filter: blur(0.6px);
}

@supports (background: color-mix(in srgb, red 50%, transparent)) {
  .pigment::before {
    opacity: 0.82;
    background:
      radial-gradient(
        ellipse 75% 70% at 33% 30%,
        color-mix(in srgb, var(--c, var(--pond)) 30%, transparent) 0%,
        transparent 68%
      ),
      radial-gradient(
        ellipse 110% 105% at 58% 64%,
        color-mix(in srgb, var(--c, var(--pond)) 72%, transparent) 0%,
        color-mix(in srgb, var(--c, var(--pond)) 44%, transparent) 62%,
        transparent 92%
      );
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--c, var(--pond)) 50%, transparent),
      inset 0 0 22px color-mix(in srgb, var(--c, var(--pond)) 38%, transparent),
      0 14px 26px -18px rgba(46, 58, 72, 0.5);
  }

  .pigment::after {
    background: color-mix(in srgb, var(--c, var(--pond)) 50%, transparent);
  }
}

.pigment:hover {
  transform: translateY(-3px);
}

.pigment:hover::before {
  opacity: 1;
  transform: scale(1.05);
}

.pigment--mix::before {
  background: linear-gradient(
    120deg,
    var(--pond) 0%,
    var(--wisteria) 38%,
    var(--rose) 70%,
    var(--sage) 100%
  );
  opacity: 0.6;
}

/* Organic scatter — offsets via margins so transforms stay free for .splash;
   rotation rides the ::before so the splash/hover transforms never stomp it. */
.pigment:nth-child(2n) { margin-top: 1.4rem; }
.pigment:nth-child(3n) { margin-top: -0.7rem; }
.pigment:nth-child(4n) { margin-bottom: 1.1rem; }
.pigment:nth-child(odd)::before { transform: rotate(-3deg); }
.pigment:nth-child(2n)::before { animation-delay: -4s; transform: rotate(2.5deg); }
.pigment:nth-child(3n)::before { animation-delay: -7s; animation-duration: 15s; }
.pigment:nth-child(5n)::before { animation-delay: -10s; transform: rotate(-1.5deg); }
.pigment:nth-child(2n)::after { right: auto; left: -10%; bottom: auto; top: -12%; width: 30%; height: 40%; }
.pigment:nth-child(3n)::after { width: 26%; height: 34%; right: -6%; bottom: -20%; }

@keyframes pigment-morph {
  0% { border-radius: 56% 44% 48% 52% / 47% 53% 46% 54%; }
  50% { border-radius: 45% 55% 56% 44% / 55% 45% 54% 46%; }
  100% { border-radius: 52% 48% 44% 56% / 44% 58% 42% 56%; }
}

/* One-shot squash & stretch when a pigment is tapped. */
.pigment.splash {
  animation: pigment-splash 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes pigment-splash {
  0% { transform: scale(1); }
  30% { transform: scale(1.12, 0.86); }
  60% { transform: scale(0.92, 1.08); }
  100% { transform: scale(1); }
}

/* Expanding, fading ring spawned by gallery.js at the click point. */
.pigment .ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--c, var(--pond-deep));
  border-radius: 50%;
  pointer-events: none;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0.85;
  animation: ripple-out 0.9s ease-out forwards;
}

@keyframes ripple-out {
  to {
    transform: translate(-50%, -50%) scale(9);
    opacity: 0;
  }
}

/* --------------------------------------------------------------------------
   11. Room III — the gallery: hung frames with tilt + sheen, zigzag layout
   -------------------------------------------------------------------------- */

.work {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3.5rem);
  align-items: center;
  margin-bottom: clamp(4.5rem, 9vw, 7.5rem);
}

.work:last-child {
  margin-bottom: 0;
}

/* The painted frame: off-white mat, thin double ink border, hung shadow.
   gallery.js drives --rx/--ry (tilt) and --mx/--my (sheen position). */
.frame {
  position: relative;
  background: var(--mat);
  padding: clamp(1.1rem, 3.5vw, 2.1rem);
  border: 1px solid rgba(46, 58, 72, 0.28);
  box-shadow:
    0 1px 2px rgba(46, 58, 72, 0.1),
    0 14px 28px -14px rgba(46, 58, 72, 0.3),
    0 34px 56px -28px rgba(74, 114, 153, 0.28);
}

/* Inner line of the double border. */
.frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(46, 58, 72, 0.14);
  pointer-events: none;
}

.frame img {
  width: 100%;
  border: 1px solid rgba(46, 58, 72, 0.12);
}

.frame[data-tilt] {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.2s ease-out, box-shadow 0.4s ease;
  will-change: transform;
}

.frame[data-tilt]:hover {
  box-shadow:
    0 1px 2px rgba(46, 58, 72, 0.1),
    0 20px 34px -14px rgba(46, 58, 72, 0.33),
    0 44px 66px -28px rgba(74, 114, 153, 0.32);
}

/* Glass sheen that follows the cursor across the frame. */
.frame[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.5) * 100%),
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0.12) 32%,
    rgba(255, 255, 255, 0) 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.frame[data-tilt]:hover::after {
  opacity: 0.5;
}

.work-placard {
  max-width: 30rem;
  padding: 1.6rem 1.8rem 1.7rem;
  text-align: left;
}

/* --------------------------------------------------------------------------
   12. Annex — studies & sketches grid
   -------------------------------------------------------------------------- */

.studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(1.6rem, 4vw, 2.6rem);
  align-items: stretch;
}

.study {
  display: flex;
  flex-direction: column;
}

.frame--small {
  padding: 0.85rem;
}

.frame--small::before {
  inset: 5px;
}

.frame--small img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.study:nth-child(odd) .frame--small {
  transform: rotate(-0.45deg);
}

.study:nth-child(even) .frame--small {
  transform: rotate(0.45deg);
}

.frame--small,
.study .frame--small img {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.study:hover .frame--small {
  transform: rotate(0deg) translateY(-4px);
}

.study-placard {
  flex: 1;
  margin-top: 1.1rem;
  padding: 1.1rem 1.2rem 1.25rem;
  text-align: center;
}

.study-placard .placard-title {
  font-size: 1.25rem;
}

.study-placard .placard-desc {
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   13. The last room — correspondence
   -------------------------------------------------------------------------- */

footer#contact {
  text-align: center;
  padding-bottom: clamp(4rem, 8vw, 6rem);
}

footer#contact .section-head {
  margin-bottom: clamp(2.2rem, 5vw, 3.5rem);
}

.contact-links {
  display: grid;
  justify-items: center;
  gap: clamp(1rem, 2.5vw, 1.6rem);
}

.contact-link {
  position: relative;
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.35rem, 4.5vw, 2.5rem);
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color 0.3s ease;
}

/* Brush of pigment that paints in beneath the words. */
.contact-link::after {
  content: "";
  position: absolute;
  left: -0.15em;
  right: -0.15em;
  bottom: 0.08em;
  height: 0.32em;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pond) 0%, var(--wisteria) 60%, var(--rose) 100%);
  opacity: 0.16;
  transform: scaleX(0.3); /* resting hint so links don't read as plain text */
  transform-origin: left center;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.contact-link:hover {
  color: var(--pond-ink);
}

.contact-link:hover::after {
  transform: scaleX(1);
  opacity: 0.45;
}

.contact-link:focus-visible::after {
  transform: scaleX(1);
  opacity: 0.45;
}

.colophon {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   14. Reveal-on-scroll — gallery.js adds .is-visible (with a staggered
   inline transition-delay). Hidden state only applies when JS is running
   (html.js is set by an inline script in <head>).
   -------------------------------------------------------------------------- */

html.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

html.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 900px) {
  /* About: portrait beside prose */
  .artist-layout {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .artist-portrait {
    max-width: none;
    margin: 0;
  }

  /* Gallery zigzag: frame left / placard right, flipped on .work--flip */
  .work {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  .work .work-placard {
    justify-self: start;
  }

  .work--flip {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .work--flip .frame {
    order: 2;
  }

  .work--flip .work-placard {
    order: 1;
    justify-self: end;
    text-align: right;
  }

  .work--flip .placard-no::after {
    margin-left: auto;
  }

  /* Hero placard hangs in the lower-right of the entrance wall */
  .hero-placard {
    position: absolute;
    right: clamp(1.5rem, 6vw, 5rem);
    bottom: clamp(5.5rem, 12vh, 8rem);
    margin-top: 0;
  }
}

@media (max-width: 899px) {
  #nav {
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
  }

  .monogram {
    width: 2.7rem;
    height: 2.7rem;
    font-size: 1rem;
  }

  .nav-links a {
    font-size: 0.66rem;
    letter-spacing: 0.16em;
  }
}

@media (max-width: 599px) {
  body {
    font-size: 1rem;
  }

  /* The wrapped 3-row bar would cover ~18% of a small screen if fixed;
     let it scroll away with the entrance instead. */
  #nav {
    position: absolute;
    gap: 0.2rem 1rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  .nav-links {
    gap: 0.1rem 0.9rem;
    justify-content: center;
  }

  .nav-links a {
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    padding: 0.85rem 0.25rem; /* ≥44px tap target */
  }

  /* Trim GPU load: fewer multiply-blended fixed layers on phone GPUs. */
  .wash--alt,
  .wash--rose {
    display: none;
  }

  .wash::before {
    filter: blur(8px);
  }

  /* Tighter mats and placards on small screens */
  .frame {
    padding: 0.9rem;
  }

  .frame::before {
    inset: 5px;
  }

  .placard {
    padding: 1.1rem 1.1rem 1.2rem;
  }

  .work-placard {
    padding: 1.2rem 1.2rem 1.3rem;
  }

  .placard-medium {
    letter-spacing: 0.2em;
  }

  .hero-placard {
    max-width: 15rem;
  }

  .pigment {
    padding: 1.05rem 1.3rem; /* ≥44px tap target */
    font-size: 0.78rem;
  }

  .pull-quote {
    font-size: 1.25rem;
  }
}

/* --------------------------------------------------------------------------
   16. Reduced motion — stop the drifting, morphing, floating and blooming;
   show everything instantly.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #loader {
    display: none;
  }

  /* The compound selectors are needed to out-rank the per-wash rules
     (e.g. .wash--pond::before, .wash--pond.wash--alt::before), which
     would otherwise win on specificity and keep animating. */
  .wash,
  .wash::before,
  .wash--pond::before,
  .wash--wisteria::before,
  .wash--sage::before,
  .wash--rose::before,
  .wash--gold::before,
  .wash--pond.wash--alt::before,
  .wash--wisteria.wash--alt::before,
  .portrait-wash,
  .pigment::before,
  .pigment:nth-child(2n)::before,
  .pigment:nth-child(3n)::before,
  .pigment:nth-child(5n)::before,
  .scroll-cue span,
  .loader-blob,
  .loader-monogram {
    animation: none;
  }

  .pigment.splash {
    animation: none;
  }

  .pigment .ripple {
    animation: none;
    opacity: 0;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .frame[data-tilt] {
    transform: none;
    transition: none;
  }

  #nav,
  .pigment,
  .pigment::before,
  .nav-links a::after,
  .contact-link::after,
  .frame--small,
  .study .frame--small img,
  .frame[data-tilt]::after,
  .skip-link,
  body::after {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   17. Print — drop the atmosphere, keep the catalogue
   -------------------------------------------------------------------------- */

@media print {
  .grain,
  .wash-field,
  .wash,
  #paint-canvas,
  #loader,
  .scroll-cue,
  .hero-hint,
  .divider,
  .portrait-wash {
    display: none;
  }

  body {
    background: #fff;
  }

  body::after {
    content: none;
  }

  #nav {
    position: static;
    background: none;
  }

  html.js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #hero {
    min-height: auto;
  }

  .hero-placard {
    position: static;
  }

  .frame,
  .placard {
    box-shadow: none;
  }

  .frame[data-tilt] {
    transform: none;
  }
}
