.profile-head {
  --profile-art-opacity: 0.16;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 30rem);
  column-gap: clamp(2rem, 8vw, 8rem);
  align-items: end;
  padding-block: clamp(3rem, 6vw, 6rem);
}

.home-hero--archive-art,
.archive-hub--art {
  --profile-art-opacity: 0.16;
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.home-hero--archive-art > :not(.home-hero__art),
.archive-hub--art > :not(.archive-hub__art) {
  position: relative;
  z-index: 1;
}

.archive-hub--art {
  min-height: clamp(24rem, 48vw, 38rem);
}

.home-hero__kicker {
  font-size: clamp(0.875rem, 2vw, 1.125rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary, #888);
  margin-block: 0 0.25rem;
}

.home-hero__copy > .button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.profile-head > :not(.profile-head__art) {
  position: relative;
  z-index: 1;
}

.profile-head__art,
.home-hero__art,
.archive-hub__art {
  position: absolute;
  z-index: 0;
  inset: 0 0 0 42%;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 34%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 34%, #000 100%);
}

.profile-head__art img,
.home-hero__art img,
.archive-hub__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  opacity: var(--profile-art-opacity);
  filter: invert(1) grayscale(1) contrast(1.65);
  mix-blend-mode: screen;
  transform: scale(1.025);
}

/* ---- Breeder hub header: logo right of H1 on desktop ---- */

.breeder-hub__header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(1rem, 3vw, 2rem);
}

.breeder-hub__logo {
  flex-shrink: 0;
}

.breeder-hub__logo img {
  width: clamp(120px, 16vw, 200px);
  height: auto;
  object-fit: contain;
  object-position: center;
  /* override archive-hub__art background art treatment */
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  transform: none !important;
  border-radius: var(--radius-sm, 0.5rem);
}

.breeder-hub__titles {
  min-width: 0;
}

.breeder-hub__titles h1 {
  margin-block: 0.25rem 0;
}

@media (min-width: 901px) {
  .breeder-hub__header {
    flex-direction: row;
    align-items: center;
  }
}

@media (prefers-color-scheme: light) {
  .profile-head,
  .home-hero--archive-art,
  .archive-hub--art {
    --profile-art-opacity: 0.22;
  }

  .profile-head__art img,
  .home-hero__art img,
  .archive-hub__art img {
    filter: saturate(0.72) contrast(1.12);
    mix-blend-mode: multiply;
  }
}

.profile-head h1,
.profile-head > .eyebrow {
  grid-column: 1 / -1;
}

.profile-head .dek,
.profile-head .facts {
  margin-bottom: 0;
}

.profile-head .facts {
  margin-top: 0;
  align-self: end;
}

.specimen-gallery {
  --gallery-gutter: clamp(1rem, 2.5vw, 2rem);
  position: relative;
  padding: clamp(2rem, 4vw, 4rem) var(--gallery-gutter) var(--gallery-gutter);
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 92%, var(--green));
  color: var(--ink);
}

.specimen-gallery__header {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 0.5fr);
  gap: var(--gallery-gutter);
  align-items: end;
  margin-bottom: clamp(1.5rem, 3vw, 3rem);
}

.specimen-gallery__header h2 {
  max-width: 14ch;
  margin: 0.2rem 0 0;
  font-size: clamp(2.6rem, 6vw, 6rem);
}

.specimen-gallery__header > p {
  max-width: 28rem;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 68%, transparent);
}

.specimen-gallery__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  grid-auto-rows: clamp(18rem, 28vw, 32rem);
  min-height: 0;
  gap: clamp(1rem, 2.2vw, 2rem);
  overflow: visible;
  border: 0;
  background: transparent;
}

.specimen-frame {
  position: relative;
  grid-column: span 5;
  min-width: 0;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border-top: 1px solid var(--line);
  background: transparent;
}

.specimen-frame--lead {
  grid-column: span 7;
  grid-row: span 2;
}

.specimen-frame:nth-child(4n),
.specimen-frame:nth-child(4n + 3) {
  grid-column: span 7;
}

.specimen-frame:nth-child(3) {
  grid-column: span 5;
}

.specimen-gallery[data-gallery-count="1"] .specimen-gallery__grid {
  display: block;
  min-height: 0;
}

.specimen-gallery[data-gallery-count="1"] .specimen-frame__button {
  height: min(72vw, 56rem);
}

.specimen-gallery[data-gallery-count="2"] .specimen-frame {
  grid-row: auto;
}

.specimen-frame__button {
  all: unset;
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: zoom-in;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 82%, var(--green));
}

.specimen-frame__button:hover {
  transform: none;
  box-shadow: none;
}

.specimen-frame__button:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: -6px;
  z-index: 2;
}

.specimen-frame img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.specimen-frame__button:hover img {
  transform: scale(1.012);
  filter: saturate(1.08) contrast(1.03);
}

.specimen-frame__index,
.specimen-frame__expand {
  position: absolute;
  z-index: 1;
  padding: 0.45rem 0.6rem;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  color: var(--ink);
  font: 500 0.68rem var(--mono);
}

.specimen-frame__index {
  top: 0.75rem;
  left: 0.75rem;
}

.specimen-frame__expand {
  right: 0.75rem;
  bottom: 0.75rem;
  opacity: 0;
  transform: translateY(0.4rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: var(--green);
  color: #f3f0e8;
}

.specimen-frame__button:hover .specimen-frame__expand,
.specimen-frame__button:focus-visible .specimen-frame__expand {
  opacity: 1;
  transform: none;
}

.specimen-frame figcaption {
  min-height: 3.2rem;
  padding: 0.65rem 0;
  border-top: 1px solid var(--line);
  color: color-mix(in srgb, var(--ink) 72%, transparent);
  font: 400 0.66rem/1.45 var(--mono);
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(8 12 9 / 98%);
  color: var(--paper);
}

.lightbox::backdrop {
  background: rgb(8 12 9 / 96%);
}

.lightbox__shell {
  position: relative;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) 5.5rem;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  padding: clamp(4.5rem, 7vw, 6rem) clamp(1rem, 3vw, 3rem) 2rem;
}

.lightbox__figure {
  grid-column: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.lightbox__figure img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.lightbox__figure figcaption {
  padding: 1rem 0 0;
  color: #d9ded9;
  font: 400 0.72rem/1.45 var(--mono);
  text-align: center;
}

.lightbox__close,
.lightbox__previous,
.lightbox__next {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #677269;
  background: #111813;
  color: var(--paper);
  box-shadow: none;
}

.lightbox [hidden] {
  display: none;
}

.lightbox__close:hover,
.lightbox__previous:hover,
.lightbox__next:hover {
  transform: none;
  border-color: var(--acid);
  box-shadow: none;
}

.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
}

.lightbox__previous,
.lightbox__next {
  align-self: center;
  padding: 0.75rem 0.4rem;
}

.lightbox__previous {
  grid-column: 1;
}

.lightbox__next {
  grid-column: 3;
}

.lightbox__counter {
  position: absolute;
  top: 1.6rem;
  left: 1.5rem;
  margin: 0;
  font: 500 0.72rem var(--mono);
}

@media (max-width: 900px) {
  .profile-head__art,
  .home-hero__art,
  .archive-hub__art {
    display: none;
  }

  .archive-hub--art {
    min-height: 0;
  }

  .profile-head {
    grid-template-columns: 1fr;
  }

  .profile-head h1,
  .profile-head > .eyebrow {
    grid-column: auto;
  }

  .profile-head .facts {
    margin-top: 1.5rem;
  }

  .specimen-gallery__header {
    grid-template-columns: 1fr;
  }

  .specimen-gallery__grid {
    display: flex;
    min-height: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .specimen-frame,
  .specimen-frame--lead {
    flex: 0 0 min(82vw, 42rem);
    scroll-snap-align: start;
    margin-top: 0;
  }

  .specimen-frame--lead {
    flex-basis: min(92vw, 52rem);
  }

  .specimen-frame__button {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .specimen-gallery[data-gallery-count="1"] .specimen-frame__button {
    height: auto;
  }
}

@media (max-width: 560px) {
  .profile-head {
    padding-block: 2.75rem;
  }

  .profile-head h1 {
    margin-block: 0.25em;
  }

  .specimen-gallery {
    padding-top: 2.25rem;
  }

  .specimen-gallery__header h2 {
    font-size: 2.8rem;
  }

  .specimen-gallery__header > p {
    font-size: 1rem;
  }

  .specimen-frame,
  .specimen-frame--lead {
    flex-basis: 88vw;
  }

  .lightbox__shell {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 4.5rem 1rem 1rem;
  }

  .lightbox__figure {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .lightbox__previous,
  .lightbox__next {
    align-self: end;
  }

  .lightbox__previous {
    grid-column: 1;
    grid-row: 2;
  }

  .lightbox__next {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ── Mobile gallery discoverability ── */

/* Hide cues by default; reveal them only for scrollable multi-image galleries. */
.specimen-gallery__swipe-hint,
.specimen-gallery__progress {
  display: none;
}

@media (max-width: 900px) {
  /* Allow absolute-positioned children within the scroll grid */
  .specimen-gallery[data-gallery-count]:not([data-gallery-count="1"]) .specimen-gallery__grid {
    position: relative;
    padding-bottom: 2.75rem;
  }

  /* Swipe hint overlay */
  .specimen-gallery[data-gallery-count]:not([data-gallery-count="1"]) .specimen-gallery__swipe-hint {
    display: block;
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 0.4rem 0.85rem;
    background: rgba(0, 0, 0, 0.65);
    color: var(--paper);
    font: 500 0.68rem var(--mono);
    border-radius: 1rem;
    pointer-events: none;
    z-index: 2;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
  }

  .specimen-gallery:not([data-gallery-count="1"]) .swipe-hint--dismissed {
    opacity: 0;
  }

  /* Scroll progress indicator */
  .specimen-gallery[data-gallery-count]:not([data-gallery-count="1"]) .specimen-gallery__progress {
    appearance: none;
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    width: 100%;
    border: 0;
    background: #59635c;
    z-index: 1;
  }

  .specimen-gallery__progress::-webkit-progress-bar {
    background: #59635c;
  }

  .specimen-gallery__progress::-webkit-progress-value,
  .specimen-gallery__progress::-moz-progress-bar {
    background: var(--green);
    transition: width 0.15s linear;
  }
}

@media (prefers-reduced-motion: reduce) {
  .specimen-frame img,
  .specimen-frame__expand {
    transition: none;
  }
}
