/* Page-level art direction for the selected portfolio. */
.work-page .work-intro {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: clamp(24px, 3.4vh, 34px);
  min-height: clamp(460px, calc(72svh - var(--site-header-height, 97px)), 620px);
  padding-block: clamp(44px, 5vh, 72px);
  text-align: center;

}

.work-page .work-intro h1 {
  max-width: 12ch;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(52px, 7vw, 90px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: 1.03;
  text-wrap: balance;
}

.work-page .work-title-line { display: block; }

.work-page .work-intro h1 em {
  color: var(--heading-muted);
  font-weight: 400;
}

.work-page .work-intro-copy {
  max-width: 49ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.2vw, 18px);
  line-height: 1.9;
  text-wrap: pretty;
}

.work-page .work-intro-link {
  display: inline-flex;
  justify-self: center;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 28px);
  min-height: 48px;
  margin-top: 0;
  margin-inline: auto;
  padding-inline: 26px;
  border: 1px solid var(--rule-soft);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .085em;
  text-transform: uppercase;
  transition:
    color var(--theme-colour-duration, 200ms) ease,
    background-color var(--theme-colour-duration, 200ms) ease,
    border-color var(--theme-colour-duration, 200ms) ease,
    transform 240ms var(--ease-quiet);
}

.work-page .work-intro-link .arrow-icon {
  width: 19px;
  height: 19px;
  color: var(--accent);
  transition:
    color var(--theme-colour-duration, 520ms) var(--ease-quiet),
    transform 620ms var(--ease-quiet);
}

.work-page .work-intro-link:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 10%, transparent);
  transform: translate3d(0, -1px, 0);
}

.work-page .work-intro-link:focus-visible .arrow-icon {
  color: #fff;
  transform: translateY(3px);
}

.work-page .work-intro-link:active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: translate3d(0, 0, 0) scale(.985);
  box-shadow: none;
}

.work-page .work-intro-link:active .arrow-icon {
  color: #fff;
  transform: translateY(2px);
}

@media (hover: hover) and (pointer: fine) {
  .work-page .work-intro-link:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 10%, transparent);
    transform: translate3d(0, -1px, 0);
  }

  .work-page .work-intro-link:hover .arrow-icon {
    color: #fff;
    transform: translateY(3px);
  }
}

/* A single editorial introduction leads directly to the photographs. */
html[data-theme] .work-page .work-section { padding-top: 36px; border-top: 0; background: var(--bg, var(--paper)); }
.work-page .work-collection-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.work-page .work-collection-head h2 { margin: 0; font-family: var(--serif); font-size: clamp(28px, 3vw, 40px); font-weight: 400; letter-spacing: -.025em; line-height: 1.2; }
.work-page .work-collection-head p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.work-page .gallery-tools { margin-top: 22px; margin-bottom: 26px; padding-bottom: 18px; }
.work-page .gallery-filter-groups { width: 100%; justify-content: space-between; }
/* The filter container reveals once; its labels and separators travel together. */
.has-reveal .work-page .gallery-tools :is(.gallery-filter-groups, .filter-set),
.has-reveal .work-page .gallery-tools::after { opacity: 1; transform: none; transition: none; }
.has-reveal .work-page .gallery-tools { will-change: auto; }
.has-reveal .work-page .work-collection-head { will-change: auto; transition-duration: 900ms; }
.has-reveal .work-page .work-card { will-change: auto; }
/* This class is set in the head, before the first paint or deferred scripts. */
html.work-arrival-motion .work-page :is(.work-collection-head, .work-card):not(.is-visible) {
  opacity: 0;
  pointer-events: none;
}

/* A stationary anchor avoids the heading's entrance transform changing the landing. */
html:has(.work-page) { scroll-padding-top: 0; }
.work-page { overflow-anchor: none; }
.work-page #work { scroll-margin-top: calc(var(--site-header-height) + 20px); }

.work-page .work-filter-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Let the portfolio introduction arrive as a paced editorial sequence,
   while its photographs keep the shared, lazy scroll reveal system. */
.work-page .work-intro > :nth-child(1) { --reveal-delay: 40ms; }
.work-page .work-intro > :nth-child(2) { --reveal-delay: 150ms; }
.work-page .work-intro > :nth-child(3) { --reveal-delay: 285ms; }
.work-page .work-intro > :nth-child(4) { --reveal-delay: 410ms; }

.work-page .work-intro-link .arrow-icon {
  transition: transform 620ms var(--ease-quiet), color var(--theme-colour-duration, 520ms) var(--ease-quiet);
}

/* Frames keep their exact grid position during reveal, hover and press.
   The photograph retains its independent decode fade and contained zoom. */
html[data-theme] body#page-top.work-page .work-card {
  transform: none;
}
html[data-theme] body#page-top.work-page .work-art > .photo-open {
  border-radius: inherit;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  transform: none;
  scale: 1;
  transition: none;
}

/* One card fade and one caption fade replace the older nested movements. */
@media (prefers-reduced-motion: no-preference) {
  html.has-reveal[data-theme] body#page-top.work-page .work-card {
    opacity: 0;
    transform: none;
    transition: opacity 520ms var(--work-cine-ease);
    transition-delay: var(--reveal-delay, 0ms);
  }

  html.has-reveal[data-theme] body#page-top.work-page .work-card.is-visible {
    opacity: 1;
    transform: none;
  }

  .has-reveal .work-page .work-card .work-art img {
    transition: opacity 560ms var(--work-cine-ease), transform 680ms var(--work-cine-ease);
    transition-delay: calc(var(--reveal-delay, 0ms) + 30ms);
  }

  .has-reveal .work-page .work-card.is-image-loaded .work-art img {
    transition: opacity 560ms var(--work-cine-ease), transform 680ms var(--work-cine-ease);
  }

  html.has-reveal[data-theme] body#page-top.work-page .work-card .work-caption {
    opacity: 0;
    transform: none;
    transition: opacity 320ms var(--work-cine-ease);
    transition-delay: calc(var(--reveal-delay, 0ms) + 60ms);
  }

  html.has-reveal[data-theme] body#page-top.work-page .work-card.is-visible .work-caption {
    opacity: 1;
  }

  html.has-reveal[data-theme] body#page-top.work-page .work-card .work-caption :is(.caption-kicker, h3) {
    opacity: 1;
    transform: none;
    animation: none;
    transition: color var(--theme-colour-duration, 180ms) ease;
    transition-delay: 0ms;
  }
}

/* One calm, first-visit entrance for the editorial intro. */
@keyframes workIntroArrival {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes workIntroTitleArrival {
  from {
    opacity: 0;
    transform: translate3d(-15px, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: no-preference) {
  html.work-arrival-motion .work-page .work-intro > * {
    animation: workIntroArrival 1050ms var(--ease-quiet) both;
  }

  html.work-arrival-motion .work-page .work-intro > :nth-child(1) { animation-delay: 80ms; }
  html.work-arrival-motion .work-page .work-intro > h1 {
    opacity: 1;
    transform: none;
    transition: none;
    animation: none;
  }
  html.work-arrival-motion .work-page .work-title-line {
    animation: workIntroTitleArrival 1120ms var(--ease-quiet) both;
  }
  html.work-arrival-motion .work-page .work-title-line:first-child { animation-delay: 140ms; }
  html.work-arrival-motion .work-page .work-title-line:last-child { animation-delay: 280ms; }
  html.work-arrival-motion .work-page .work-intro > :nth-child(3) { animation-delay: 390ms; }
  html.work-arrival-motion .work-page .work-intro > :nth-child(4) {
    animation-duration: 920ms;
    animation-delay: 490ms;
  }
}

@media (max-width: 700px) {
  .work-page .work-intro {
    row-gap: 28px;
    min-height: 0;
    padding-block: 48px 56px;

  }

  .work-page .work-section {
    padding-top: 18px;
  }

  .work-page .work-intro h1 {
    font-size: clamp(54px, 13vw, 78px);
    line-height: 1.02;
  }

  .work-page .work-intro-copy {
    max-width: 38ch;
    margin-top: 0;
    line-height: 1.75;
  }

  .work-page .work-intro-link {
    min-height: 50px;
    gap: 14px;
    padding-inline: 16px;
    font-size: 10px;
    letter-spacing: .07em;
    margin-top: 0;
  }
}

@media (max-height: 680px) {
  .work-page .work-intro {
    justify-content: flex-start;
    min-height: 0;
    gap: 18px;
    padding-block: 28px;
    transform: none;
  }

  .work-page .work-intro h1 {
    font-size: clamp(48px, 8vw, 82px);
  }
}

@media (max-width: 380px) {
  .work-page .work-intro h1 {
    font-size: clamp(38px, 13vw, 50px);
  }

  .work-page .work-intro-link {
    max-width: 100%;
    gap: 10px;
    padding-inline: 12px;
    font-size: 9px;
    letter-spacing: .045em;
  }

  .work-page .filter-set {
    column-gap: 6px;
  }

  .work-page .filter-button {
    max-width: 100%;
    gap: 4px;
    font-size: 9px;
    letter-spacing: .045em;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-page .work-intro > *,
  .work-page .work-intro-link .arrow-icon,
  .work-page .work-section .section-heading :is(.section-number, h2, .section-lede) {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}
