/* Corner role badges leave a full-width lower credit bar for the client. */
#project-index.gallery-index {
  --gallery-height: 300px;
  --gallery-gap: 26px;
  margin-top: clamp(62px, 6vw, 104px);
  padding-top: 32px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 100px;
}
#project-index .gallery-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  text-align: center;
}
#project-index .gallery-kicker {
  display: block;
  margin-bottom: 9px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--muted);
}
#project-index .gallery-heading h3 {
  margin: 0 auto;
  max-width: 23ch;
  font-size: clamp(30px, 3.15vw, 48px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -.055em;
}
#project-index #project-count {
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .1em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#project-index .gallery-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  justify-content: safe center;
  gap: clamp(20px, 2.8vw, 42px);
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 28px;
  border-bottom: 1px solid var(--line);
}
#project-index .gallery-filters::-webkit-scrollbar { display: none; }
#project-index .gallery-filters button {
  position: relative;
  flex: none;
  min-height: 48px;
  padding: 12px 0 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
  transition: color .2s ease;
}
#project-index .gallery-filters button::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .24s ease;
}
#project-index .gallery-filters button:hover,
#project-index .gallery-filters button[aria-pressed='true'] { color: var(--ink); }
#project-index .gallery-filters button[aria-pressed='true']::after { transform: scaleX(1); }
#project-index .gallery-filters button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -3px;
}
#project-index .project-gallery-grid {
  display: flex;
  align-items: flex-start;
  gap: var(--gallery-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: none;
  scroll-behavior: auto;
  scrollbar-width: none;
  padding: 4px 2px;
  margin: -4px -2px 0;
}
#project-index .project-gallery-grid::-webkit-scrollbar { display: none; }
#project-index .gallery-track {
  display: flex;
  align-items: flex-start;
  flex: 0 0 auto;
  width: max-content;
  gap: var(--gallery-gap);
}
#project-index .gallery-project {
  --gallery-width: calc(var(--gallery-height) * 16 / 9);
  display: block;
  flex: 0 0 var(--gallery-width);
  width: var(--gallery-width);
  min-width: 0;
  max-width: none;
  color: #fff;
  border-radius: 10px;
}
#project-index .gallery-project[data-format='portrait'] {
  --gallery-width: calc(var(--gallery-height) * 9 / 16);
}
#project-index .gallery-media {
  position: relative;
  height: var(--gallery-height);
  overflow: hidden;
  border-radius: 10px;
  isolation: isolate;
  background: color-mix(in srgb, var(--ink) 6%, var(--paper));
}
#project-index .gallery-media > :is(img,video,canvas) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.2,.7,.3,1);
}
/* V1 grain and glass across the full lower edge for the centred client. */
#project-index .gallery-copy {
  --credit-logo-width: 140px;
  position: absolute;
  z-index: 3;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  transform: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  max-width: 100%;
  min-height: 52px;
  padding: 10px 13px;
  border: 0;
  border-top: 1px solid #ffffff1f;
  border-radius: 0;
  background: linear-gradient(180deg,#29312cd9,#101715e6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  text-align: center;
  text-shadow: none;
  -webkit-text-stroke: 0;
  isolation: isolate;
}
#project-index .gallery-copy::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .085;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#project-index .gallery-copy > * { position: relative; z-index: 1; }
#project-index .gallery-client {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: var(--credit-logo-width);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  white-space: nowrap;
}
#project-index .gallery-client:not(:has(.gallery-client-logo)) { max-width: none; }
#project-index .gallery-client[data-client='ca'] { --credit-logo-width: 36px; }
#project-index .gallery-client[data-client='santos-studios'] { --credit-logo-width: 180px; }
#project-index .gallery-client[data-client='church-jesus-christ'] { --credit-logo-width: 170px; }
#project-index .gallery-copy:has([data-client='church-jesus-christ']) { padding-block: 3px; }
#project-index .gallery-client[data-client='church-jesus-christ'] .gallery-client-logo { width: 170px; max-height: none; margin-block: -20px; filter: brightness(0) invert(1); }
#project-index .gallery-client-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--credit-logo-width);
  max-height: 30px;
  object-fit: contain;
}
#project-index .gallery-role-pills {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: max-content;
  max-width: calc(100% - 24px);
}
#project-index .gallery-role-pills[data-wrap='true'] { flex-wrap: wrap; }
#project-index .gallery-role-pill {
  --role-color: #b5c5ff;
  --tag-hole-x: 9px;
  --tag-hole-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 27px;
  padding: 7px 9px 7px 22px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--role-color) 68%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px #ffffff18;
  -webkit-mask-image: radial-gradient(circle at var(--tag-hole-x) 50%, transparent calc(var(--tag-hole-radius) - .3px), #000 calc(var(--tag-hole-radius) + .4px));
  mask-image: radial-gradient(circle at var(--tag-hole-x) 50%, transparent calc(var(--tag-hole-radius) - .3px), #000 calc(var(--tag-hole-radius) + .4px));
  color: #080e0a;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
#project-index .gallery-role-pill::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 100px 100px;
}
#project-index .gallery-role-label,
#project-index .gallery-role-name { display: inline-flex; align-items: center; line-height: 1; }
#project-index .gallery-role-label { transform: translateY(.06em); }
#project-index .gallery-role-letter { display: inline-block; line-height: 1; transform: translateY(0) scale(1); transform-origin: 50% 60%; }
@keyframes gallery-role-karaoke {
  0%, 100% { transform: translateY(0) scale(1); text-shadow: none; }
  36% { transform: translateY(-3px) scale(1.08); text-shadow: 0 0 3px #ffffffe6, 0 0 7px #ffffffb3, 0 0 13px var(--role-color); }
  64% { transform: translateY(.6px) scale(.99); text-shadow: 0 0 4px #ffffff66, 0 0 8px var(--role-color); }
  82% { transform: translateY(-.3px) scale(1.01); text-shadow: 0 0 3px #ffffff33; }
}
#project-index .gallery-project:focus-visible .gallery-role-letter {
  animation: gallery-role-karaoke 700ms cubic-bezier(.2,.65,.35,1) both;
  animation-delay: calc(var(--letter-index, 0) * 40ms);
}
@media (hover: hover) {
  #project-index .gallery-project:hover .gallery-role-letter {
    animation: gallery-role-karaoke 700ms cubic-bezier(.2,.65,.35,1) both;
    animation-delay: calc(var(--letter-index, 0) * 40ms);
  }
}
#project-index .gallery-role-pill[data-role='editing'] { --role-color: #b5c5ff; }
#project-index .gallery-role-pill[data-role='motion'] { --role-color: #cfb5f6; }
#project-index .gallery-role-pill[data-role='direction'] { --role-color: #ffc596; }
#project-index .gallery-role-pill[data-role='cinematography'] { --role-color: #b4de97; }
#project-index .gallery-role-pill[data-role='vfx'] { --role-color: #9cded4; }
#project-index .gallery-role-pill[data-role='making-of'] { --role-color: #f0b5d1; }
#project-index .gallery-role-pill[data-role='storyboards'] { --role-color: #f2d68b; }
#project-index .gallery-role-plus { display: none; }
#project-index .gallery-role-pills[data-compact='true'] .gallery-role-secondary {
  width: 39px;
  min-height: 27px;
  padding: 0 9px 0 22px;
}
#project-index .gallery-role-pills[data-compact='true'] .gallery-role-secondary .gallery-role-name { display: none; }
#project-index .gallery-role-pills[data-compact='true'] .gallery-role-secondary .gallery-role-plus { display: inline-flex; align-items: center; line-height: 1; transform: translateY(.06em); font-size: 13px; letter-spacing: 0; }
#project-index .gallery-project[data-format='portrait'] .gallery-copy {
  --credit-logo-width: 90px;
  gap: 6px;
  min-height: 44px;
  padding: 7px 6px;
}
#project-index .gallery-project[data-format='portrait'] .gallery-client { font-size: 12px; }
#project-index .gallery-project[data-format='portrait'] .gallery-client[data-client='ca'] { --credit-logo-width: 36px; }
#project-index .gallery-project[data-format='portrait'] .gallery-client-logo { max-height: 26px; }
#project-index .gallery-project[data-format='portrait'] .gallery-role-pills { top: 8px; left: 8px; max-width: calc(100% - 16px); gap: 4px; }
#project-index .gallery-project[data-format='portrait'] .gallery-role-pill { --tag-hole-x: 7px; --tag-hole-radius: 1.8px; font-size: 9px; padding: 6px 6px 6px 19px; min-height: 25px; letter-spacing: .035em; }
#project-index .gallery-project[data-format='portrait'] .gallery-role-pills[data-compact='true'] .gallery-role-secondary { padding: 0 6px 0 19px; width: 34px; min-height: 25px; }
#project-index .gallery-project:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (hover: hover) {
  #project-index .gallery-project:hover .gallery-media > :is(img,video,canvas) { transform: scale(1.035); }
}
#project-index .gallery-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}
#project-index .gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 46px;
  margin: 0;
}
#project-index .gallery-nav :is(.gallery-prev,.gallery-next,.gallery-pause) {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 23px;
  font-weight: 600;
  line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
#project-index .gallery-nav .gallery-pause { width: 40px; height: 40px; font-size: 15px; }
#project-index .gallery-nav :is(.gallery-prev,.gallery-next,.gallery-pause):hover:not(:disabled),
#project-index .gallery-nav .gallery-pause[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
#project-index .gallery-nav :is(.gallery-prev,.gallery-next,.gallery-pause):disabled { opacity: .3; cursor: default; }
#project-index .gallery-nav button:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
#project-index [hidden] { display: none !important; }
@media (max-width: 1000px) {
  #project-index.gallery-index { --gallery-height: 285px; --gallery-gap: 20px; }
}
@media (max-width: 700px) {
  #project-index.gallery-index {
    --gallery-height: 285px;
    --gallery-gap: 17px;
    margin-top: 44px;
    padding-top: 24px;
    scroll-margin-top: 82px;
  }
  #project-index .gallery-heading { gap: 9px; margin-bottom: 16px; }
  #project-index .gallery-kicker { font-size: 9px; margin-bottom: 8px; }
  #project-index .gallery-heading h3 { font-size: 30px; max-width: 18ch; }
  #project-index #project-count { font-size: 9px; }
  #project-index .gallery-filters { gap: 25px; margin-bottom: 21px; }
  #project-index .gallery-filters button { min-height: 44px; font-size: 11px; padding-bottom: 12px; }
  #project-index .gallery-project { max-width: calc(100vw - var(--gutter) * 2 - 18px); }
  #project-index .gallery-media { border-radius: 8px; }
  #project-index .gallery-copy { --credit-logo-width: 120px; min-height: 48px; gap: 8px; padding: 8px 10px; }
  #project-index .gallery-client { font-size: 12px; }
  #project-index .gallery-role-pills { top: 8px; left: 8px; max-width: calc(100% - 16px); }
  #project-index .gallery-role-pill { --tag-hole-x: 7px; --tag-hole-radius: 1.8px; font-size: 9px; padding: 6px 8px 6px 19px; }
  #project-index .gallery-project[data-format='portrait'] .gallery-copy { --credit-logo-width: 90px; min-height: 44px; gap: 5px; padding: 7px 5px; }
  #project-index .gallery-project[data-format='portrait'] .gallery-client { font-size: 12px; }
  #project-index .gallery-footer { margin-top: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  #project-index :is(.gallery-media>img,.gallery-media>video,.gallery-media>canvas,.gallery-filters button,.gallery-filters button::after) { transition: none; }
  #project-index .gallery-role-letter { animation: none !important; transform: none !important; text-shadow: none !important; }
}
body.motion-paused #project-index .gallery-role-letter { animation: none !important; transform: none !important; text-shadow: none !important; }
/* Retain the separate featured-card client credit. */
.project-caption .project-client { margin: 9px 0 3px; color: var(--ink); font-size: 14px; }
@media (max-width: 700px) { .project-caption .project-client { font-size: 12px; } }
