/* Image-led project gallery. Swiper owns transforms on .project-slide. */
.project-gallery {
  --project-width: min(55vw, 920px);
  position: relative;
  isolation: isolate;
  padding-block: clamp(24px, 3vw, 44px) 90px;
  scroll-margin-top: 0;
  /* Reserve a carousel-sized section while the project cards are offscreen. */
  content-visibility: auto;
  contain-intrinsic-block-size: auto 680px;
}
.project-legacy-anchor { position: absolute; top: 0; left: 0; scroll-margin-top: 0; }
.project-gallery::before {
  content: ''; position: absolute; z-index: -1; inset: 12% 0 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, #73878213, transparent 62%);
}
.project-gallery .container { max-width: 1480px; }
.project-gallery .section-heading { align-items: end; gap: 60px; margin-bottom: 20px; }
.project-gallery .section-heading h2 { font-size: clamp(30px, 3vw, 46px); line-height: 1.06; letter-spacing: -.055em; }
.project-gallery .section-heading .eyebrow { margin-bottom: 8px; font-size: 10px; letter-spacing: .2em; color: var(--accent); }
.project-gallery .section-heading > p { max-width: 390px; justify-self: end; font-size: 16px; line-height: 1.7; padding-bottom: 4px; }
.project-toolbar { --js-display: flex; justify-content: space-between; align-items: end; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.project-toolbar .work-filters { display: flex; gap: 20px; flex-wrap: wrap; border: 0; }
.project-toolbar .work-filters button { min-height: 44px; padding: 9px 0; font-size: 12px; }
.project-toolbar .work-filters button[aria-pressed=true] { color: var(--text); }
.project-tools { display: flex; gap: 18px; align-items: end; }
.project-tools .work-search-label { font-size: 10px; letter-spacing: .06em; color: var(--muted); margin-bottom: 7px; }
.project-tools #work-search { width: 210px; height: 44px; border-radius: 6px; font: inherit; font-size: 12px; padding: 10px 13px; }
.project-view-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 7px; white-space: nowrap; }
.project-view-switch button { min-height: 36px; padding: 5px 12px; border-radius: 4px; background: transparent; font-size: 11px; color: var(--muted); }
.project-view-switch button[aria-pressed=true] { color: var(--text); background: var(--surface-hover); }
.project-view-switch button:disabled { opacity: .45; cursor: default; }
.project-gallery-meta { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 18px; }
.project-gallery-meta .work-results-count { margin: 0; font-size: 11px; color: var(--muted); }
.project-gesture-hint { --js-display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--muted); }
.project-gesture-hint span { font-size: 21px; color: var(--accent); }
.project-stage { position: relative; margin-top: 18px; }
.project-carousel { width: 100%; overflow: visible; padding: 12px 0 22px; }
.project-carousel .work-grid { height: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: auto; max-width: 1360px; margin: 0 auto; padding-inline: var(--gutter); gap: 38px 26px; }
.project-carousel .work-card.project-slide { width: auto; min-width: 0; padding: 0; margin: 0; border: 0; display: block; background: transparent; }
.project-carousel .project-slide::before { display: none; }
.project-image-link { display: block; position: relative; overflow: hidden; border-radius: 11px; border: 1px solid #d9d7c526; box-shadow: 0 24px 50px -20px #0005; background: var(--surface); isolation: isolate; }
#main-content .project-image-link { display: block; width: 100%; }
.project-image { position: relative; width: 100%; aspect-ratio: 16 / 10; overflow: hidden; }
.project-gallery[data-view=carousel] .project-image { max-height: 42svh; }
/* A Work cover is a complete composition: near-16:9, contained, on a neutral surface, in its original colours. */
.project-image.project-image-contain { aspect-ratio: 16 / 9; background: #dddbd5; }
.project-image.project-image-contain img { object-fit: contain; }
.project-image img { display: block; width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.project-image-link::after { content: ''; pointer-events: none; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px #ffffff07; background: linear-gradient(180deg, #03131130, transparent 28%, transparent 55%, #03131180); }
/* No contrast overlay over a cover's own lettering. */
.project-image-link:has(.project-image-contain)::after { background: none; }
.project-copy { padding: 22px 3px 0; }
.project-copy .work-card-top { margin: 0 0 12px; gap: 15px; font-size: 9px; }
.project-copy .work-card-top > :first-child { color: var(--accent); letter-spacing: .1em; }
.project-copy .work-card-top > :last-child { max-width: none; color: var(--muted); text-align: right; }
.project-copy h3 { margin: 0; font-size: clamp(25px, 2.6vw, 40px); line-height: 1.2; letter-spacing: -.045em; }
.project-copy .work-description { max-width: 650px; margin: 14px 0 0; font-size: 15px; line-height: 1.7; color: var(--muted); }
.project-copy .work-idea { display: none; }
.project-copy .work-card-actions { margin-top: 22px; padding: 0; gap: 24px; justify-content: flex-start; flex-wrap: wrap; }
.project-copy .work-card-actions a, .project-copy .work-card-actions button { min-height: 44px; font-size: 12px; }
.project-copy .work-details { color: var(--text); }
.project-copy .work-quick-view { margin-left: auto; }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .project-carousel { overflow: hidden; }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .work-grid { display: flex; max-width: none; width: 100%; margin: 0; gap: 0; padding: 0; align-items: start; }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .project-slide { width: var(--project-width); flex: 0 0 var(--project-width); }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .project-copy { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 240ms ease; }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .project-slide[data-active=true] .project-copy { opacity: 1; visibility: visible; pointer-events: auto; }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .project-slide .project-image-link { filter: brightness(.68) saturate(.8); transition: filter 380ms ease, border-color 240ms ease; }
.project-gallery:is(.carousel-pending, .carousel-enhanced) .project-slide[data-active=true] .project-image-link { filter: none; border-color: #d6bf9166; box-shadow: 0 30px 75px -20px #0007; }
.project-gallery.carousel-pending .project-carousel { overflow-x: auto; scrollbar-width: none; }
.project-gallery.carousel-pending .work-grid { gap: 40px; padding-inline: calc((100% - var(--project-width)) / 2); box-sizing: content-box; }
.project-gallery.carousel-enhanced .project-carousel { touch-action: pan-y pinch-zoom; }
.project-gallery.carousel-enhanced .project-slide { transition-property: transform; }
.project-navigation { display: flex; align-items: center; justify-content: space-between; gap: 32px; max-width: 920px; margin: 12px auto 0; padding-top: 24px; border-top: 1px solid var(--line); }
.project-position { display: flex; align-items: center; gap: 14px; min-width: 115px; font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); }
#project-current { font-size: 22px; color: var(--text); }
.project-position-rule { display: block; width: 38px; height: 1px; background: var(--line); }
.project-jump { display: flex; align-items: center; gap: 12px; min-width: 0; }
.project-jump label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.project-jump select { max-width: 270px; min-width: 0; min-height: 44px; padding: 8px 28px 8px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg); color: var(--text); font: inherit; font-size: 11px; }
.project-arrows { display: flex; gap: 10px; }
.project-arrows button { width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 23px; display: grid; place-items: center; transition: background 160ms ease, border-color 160ms ease; }
.project-arrows button:hover { background: var(--surface-hover); border-color: var(--accent); }
.project-arrows button:disabled { opacity: .3; cursor: default; }
.project-gallery [hidden] { display: none !important; }
.project-empty { text-align: center; padding: 76px 24px; color: var(--muted); }
.project-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.project-gallery :is(a, button, input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.project-gallery[data-view=list] .project-carousel .work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-gallery[data-view=list] .project-copy h3 { font-size: 26px; }
.project-gallery[data-view=list] .project-copy .work-description { font-size: 14px; }
.light-theme .project-image-link { border-color: #635d4329; box-shadow: 0 24px 50px -20px #4b4a322e; }
.light-theme .project-gallery.carousel-enhanced .project-slide[data-active=true] .project-image-link { box-shadow: 0 30px 70px -22px #4b4a3240; border-color: #82755477; }
.project-gallery.carousel-still :is(.project-copy, .project-image-link, .project-arrows button) { transition: none; }
@media (min-width: 1800px) { .project-gallery { --project-width: 920px; } }
@media (max-width: 1100px) {
  .project-gallery { --project-width: 65vw; }
  .project-toolbar { align-items: start; flex-direction: column; }
  .project-tools { width: 100%; justify-content: space-between; }
  .project-tools #work-search { width: min(360px, 45vw); }
  .project-gallery .section-heading { gap: 32px; }
  .project-gallery .section-heading > p { font-size: 15px; }
  .project-carousel .work-grid, .project-gallery[data-view=list] .project-carousel .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-jump label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
}
@media (max-width: 760px) {
  .project-gallery { --project-width: 82vw; padding-block: 20px 70px; }
  .project-gallery .section-heading { gap: 20px; margin-bottom: 16px; }
  .project-gallery .section-heading h2 { font-size: 30px; }
  .project-gallery .section-heading > p { display: none; }
  .project-toolbar { gap: 15px; padding-bottom: 15px; }
  .project-toolbar .work-filters { width: 100%; flex-wrap: nowrap; gap: 22px; overflow-x: auto; scrollbar-width: none; }
  .project-toolbar .work-filters button { flex-shrink: 0; font-size: 11px; }
  .project-tools { gap: 12px; }
  .project-tools #work-search { width: 100%; font-size: 16px; }
  .project-tools form { flex: 1; min-width: 0; }
  .project-view-switch { align-self: end; }
  .project-view-switch button { min-height: 36px; font-size: 10px; padding-inline: 10px; }
  .project-gallery-meta { padding-top: 12px; }
  .project-gallery-meta .work-results-count, .project-gesture-hint { font-size: 10px; }
  .project-stage { margin-top: 12px; }
  .project-carousel { padding-block: 8px 8px; }
  .project-image { aspect-ratio: 4 / 3; }
  .project-gallery[data-view=carousel] .project-image { max-height: none; }
  .project-image-link { border-radius: 8px; }
  .project-copy { padding: 18px 1px 0; }
  .project-copy .work-card-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; font-size: 8px; line-height: 1.5; }
  .project-copy h3 { font-size: 29px; line-height: 1.16; }
  .project-copy .work-description { font-size: 13px; line-height: 1.7; margin-top: 12px; }
  .project-copy .work-card-actions { gap: 12px; margin-top: 12px; }
  .project-copy .work-card-actions :is(a, button) { font-size: 10px; }
  .project-copy .work-quick-view { margin-left: 0; }
  .project-navigation { flex-wrap: wrap; margin-top: 8px; gap: 12px; padding-top: 20px; }
  .project-jump { order: 3; width: 100%; }
  .project-jump select { width: 100%; max-width: none; font-size: 12px; }
  .project-position { gap: 12px; }
  .project-arrows button { width: 46px; height: 46px; }
  .project-carousel .work-grid, .project-gallery[data-view=list] .project-carousel .work-grid { grid-template-columns: 1fr; gap: 40px; }
  .project-gallery:is(.carousel-pending, .carousel-enhanced) .work-grid { gap: 0; }
  .project-gallery.carousel-pending .work-grid { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .project-gallery :is(.project-copy, .project-image-link, .project-arrows button) { transition: none; }
}
