.project-media {
  --gallery-accent: #f05a69;
  position: relative;
  isolation: isolate;
  width: min(1500px, calc(100% - 112px));
  padding-block: 28px 68px;
}
.project-media [hidden] { display: none !important; }
.project-media .sr-only, .gallery-results { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.gallery-backdrop { position: absolute; z-index: -1; top: 0; right: 0; width: 43%; height: 470px; overflow: hidden; pointer-events: none; opacity: .31; mask-image: linear-gradient(90deg, transparent, #000 44%, #000 90%, transparent), linear-gradient(180deg, transparent, #000 15%, #000 67%, transparent); mask-composite: intersect; }
.gallery-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; filter: saturate(.78); }
.gallery-showcase { display: grid; grid-template-columns: minmax(0, 27fr) minmax(0, 47fr) minmax(0, 23fr); align-items: start; gap: 30px; padding-block: 32px 30px; }
.gallery-intro { min-width: 0; padding-top: 10px; }
.gallery-intro .eyebrow { font-size: 9px; letter-spacing: .2em; }
.gallery-intro h2 { margin-top: 14px; font-size: clamp(34px, 3.4vw, 56px); line-height: 1.18; letter-spacing: -.025em; }
.gallery-title-lead { color: #f1ece8; }
.gallery-intro h2 em { color: var(--gallery-accent); }
.gallery-description { max-width: 31em; margin-top: 15px; color: #b9b0b6; font-size: 16px; line-height: 1.85; }
.gallery-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.gallery-tags > span { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 5px 12px; border: 1px solid #b9869c1c; border-radius: 7px; background: linear-gradient(#20191b88, #100e117d); color: #b4a6af; font-size: 11px; }
.gallery-tags svg { width: 13px; height: 13px; color: #da8794; }
.gallery-stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 28px 0 0; }
.gallery-stats > div { display: flex; flex-direction: column; align-items: flex-start; }
.gallery-stats dt { color: var(--gallery-accent); font-size: 22px; font-weight: 500; line-height: 1.2; }
.gallery-stats dd { margin: 4px 0 0; color: #8d808c; font-size: 11px; }

.media-trailer { grid-column: 2; min-width: 0; position: relative; padding-bottom: 23px; }
.trailer-frame { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; min-width: 0; overflow: hidden; border: 1px solid #a360795e; border-radius: 10px; background: radial-gradient(ellipse at center, #281522, #08070a 75%); box-shadow: 0 14px 40px #0004, 0 0 30px #852e4410; }
.project-trailer { display: block; width: 100%; height: 100%; min-height: 0; aspect-ratio: 16 / 9; object-fit: contain; }
.gallery-preview-image { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-preview-error { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 24px; color: #e3cbd5; font-size: 13px; line-height: 1.7; text-align: center; }
.trailer-play { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 0 0 10px; border: 0; background: linear-gradient(0deg, #0b020929, transparent 60%); color: #fff4f1; font-size: 12px; font-weight: 600; }
.trailer-play-icon { display: grid; place-items: center; width: 74px; height: 74px; border: 1px solid #ff7485; border-radius: 50%; background: radial-gradient(circle at 40% 20%, #8c253bd9, #340b16ed 76%); box-shadow: 0 0 0 5px #a51d3226, 0 0 32px #dc33463b; transition: transform .2s, box-shadow .2s; }
.trailer-play-icon svg { width: 26px; height: 26px; margin-left: 4px; }
.trailer-play > span:last-child:not(.trailer-play-icon) { padding: 3px 10px; border-radius: 4px; background: #13080bc9; text-shadow: 0 1px 3px #000; }
.trailer-play:hover .trailer-play-icon { transform: scale(1.06); box-shadow: 0 0 0 7px #a51d3236, 0 0 38px #dc33465c; }
.trailer-play:focus-visible { outline-offset: -5px; border-radius: 9px; }
.trailer-error { position: absolute; inset: auto 12px 47px; padding: 10px 12px; border: 1px solid #a1546855; border-radius: 5px; background: #170b15ed; color: #e3cbd5; font-size: 11px; line-height: 1.6; text-align: center; }
.trailer-external { position: absolute; right: 0; bottom: 0; display: block; width: fit-content; color: #97818e; font-size: 9px; }
.trailer-external:hover { color: #efb6c3; }

.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding-top: 19px; border-top: 1px solid #b996a226; }
.gallery-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.gallery-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 38px; padding: 8px 18px; border: 1px solid transparent; border-radius: 99px; background: transparent; color: #c2b2bb; font-size: 13px; line-height: 1.4; transition: color .2s, border-color .2s, background .2s, box-shadow .2s; }
.gallery-filters button:hover { color: #f2dbe2; background: #5e203129; }
.gallery-filters button[aria-pressed="true"], .gallery-filters button.is-active { border-color: #ec6c7b; color: #ffe8ed; background: radial-gradient(ellipse at center, #6623319c, #32121cb3); box-shadow: 0 0 0 1px #d3495330, 0 0 20px #d8445b29, inset 0 0 15px #b44a5c17; }
.gallery-filter-icon { width: 15px; height: 15px; color: #f27a8b; flex: none; }
.gallery-sort-wrap { flex: none; }
.gallery-sort-wrap select { min-height: 35px; max-width: 170px; padding: 7px 27px 7px 12px; border: 1px solid #8b475a43; border-radius: 8px; background-color: #100c10; color: #d2b8c4; font: 10px var(--font-body); cursor: pointer; }
.project-media .gallery-grid { display: grid; grid-template-columns: repeat(var(--gallery-columns, 6), minmax(0, 1fr)); align-items: start; gap: 22px 14px; }
.media-card { min-width: 0; }
.project-media .gallery-item { position: relative; display: block; min-width: 0; overflow: hidden; border: 1px solid #a76a844f; border-radius: 7px; background: #100b10; transition: border-color .2s, box-shadow .2s, transform .2s; }
.project-media .gallery-item:hover { border-color: #e07893ad; box-shadow: 0 7px 24px #0006, 0 0 17px #ac365629; transform: translateY(-2px); }
.project-media .gallery-item[aria-current="true"] { border-color: #f27a8b; box-shadow: 0 0 0 1px #f27a8b, 0 0 18px #ac365640; }
.project-media .gallery-image { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 11; overflow: hidden; background: radial-gradient(ellipse at center, #271823, #09080c); }
.project-media .gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.project-media .gallery-item:hover img { transform: scale(1.035); }
.project-media .gallery-image.is-portrait img, .project-media .gallery-grid-portrait .gallery-item img, .project-media .media-card.is-portrait .gallery-item img, .project-media .media-card-portrait .gallery-item img { object-fit: contain; }
.media-card-badge { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 16px); padding: 4px 7px; border: 1px solid #f4c5d218; border-radius: 5px; background: #170e15cc; backdrop-filter: blur(8px); color: #f0dfe5; font-size: 10px; line-height: 1.35; pointer-events: none; }
.media-card-badge svg { width: 12px; height: 12px; flex: none; }
.media-card-play { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 44px; height: 44px; transform: translate(-50%, -50%); border: 1px solid #ff8699; border-radius: 50%; background: radial-gradient(circle at 40% 10%, #a33051df, #530d24df); box-shadow: 0 0 20px #db315536; color: #fff3f5; }
.media-card-play svg { width: 17px; height: 17px; margin-left: 2px; }
.media-card-duration { position: absolute; bottom: 9px; left: 9px; padding: 3px 6px; border-radius: 4px; background: #120b13c9; color: #f1e4e9; font-size: 9px; line-height: 1.3; }
.project-media .gallery-expand { position: absolute; right: 8px; bottom: 8px; display: grid; place-items: center; width: 28px; height: 28px; margin: 0; padding: 0; border: 1px solid #e9a7bc69; border-radius: 50%; background: #1b0b15d1; color: #f4d7e3; backdrop-filter: blur(6px); transition: color .2s, border-color .2s, background .2s; }
.gallery-expand svg { width: 14px; height: 14px; }
.project-media .gallery-item:hover .gallery-expand { color: white; border-color: #f69eae; background: #6c2035db; }
.media-card-title { margin-top: 9px; color: #e5dde2; font: 600 13px/1.6 var(--font-body); }
.media-card-caption { margin-top: 3px; color: #978995; font-size: 12px; line-height: 1.7; }
.gallery-show-all { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 42px; max-width: 100%; margin: 27px auto 0; padding: 9px 30px; border: 1px solid #f16a79; border-radius: 99px; background: radial-gradient(ellipse at center, #4a172f26, #170b119e); box-shadow: 0 0 18px #d8445b20, inset 0 0 12px #ad37521a; color: #f78692; font-size: 11px; font-weight: 600; transition: background .2s, box-shadow .2s; }
.gallery-show-all:hover { background: #401320; box-shadow: 0 0 24px #d8445b36; }
.gallery-show-all svg { width: 16px; height: 16px; }
.gallery-show-all > span:last-child { font-size: 21px; font-weight: 400; line-height: 1; }
.gallery-empty { padding: 25px 10px; color: #bca6b2; font-size: 12px; text-align: center; }
.gallery-image-error { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 8px; padding: 24px; text-align: center; color: #bcacb5; font-size: 11px; }
.gallery-image-error span { color: #957b87; font-size: 10px; }

.lightbox {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 22px 30px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
}

.lightbox[open] { display: flex; flex-direction: column; }
.lightbox::backdrop { background: #070609f5; backdrop-filter: blur(16px); }
.lightbox-toolbar { display: flex; align-items: center; gap: 24px; width: min(1380px, 100%); margin: 0 auto 15px; min-height: 46px; flex: none; }
.lightbox-title { color: #bdaab3; font-size: 9px; letter-spacing: .2em; }
.lightbox-count { color: #a97e8a; font-size: 11px; letter-spacing: .1em; margin-left: auto; }
.lightbox .lightbox-close { position: static; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #72505a; border-radius: 50%; background: #1a1119; color: #e2c8d1; font-size: 26px; line-height: 1; flex: none; }
.lightbox-close:hover, .lightbox-arrow:hover { background: #361b29; border-color: #bb7989; }
.lightbox-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; flex: 1; width: 100%; touch-action: pan-y pinch-zoom; }
.lightbox .lightbox-image { display: block; width: auto; height: auto; max-width: calc(100% - 140px); max-height: 100%; margin: 0; object-fit: contain; box-shadow: 0 14px 60px #0005; }
.lightbox-image[hidden], .lightbox-error[hidden], .lightbox-arrow[hidden] { display: none; }
.lightbox-arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; transform: translateY(-50%); border: 1px solid #664350; border-radius: 50%; background: #160e17; color: #d8b3c0; font-size: 27px; line-height: 1; z-index: 2; }
.lightbox-previous { left: 0; }
.lightbox-next { right: 0; }
.lightbox-footer { display: flex; align-items: center; justify-content: space-between; gap: 25px; width: min(1380px, 100%); padding-top: 17px; margin: 18px auto 0; border-top: 1px solid #6d435744; flex: none; }
.lightbox .lightbox-caption { padding: 0; color: #cbb6c0; font-size: 12px; line-height: 1.7; }
.lightbox-hint { color: #907885; font-size: 10px; flex: none; }
.lightbox .lightbox-error { padding: 30px 60px; color: #cbb6c0; font-size: 13px; text-align: center; }

@media (max-width: 1200px) {
  .gallery-showcase { grid-template-columns: minmax(0, 35fr) minmax(0, 53fr) minmax(0, 12fr); gap: 24px; }
  .gallery-intro h2 { font-size: 39px; }
  .gallery-description { font-size: 14px; }
  .gallery-stats { gap: 23px; margin-top: 22px; }
}
@media (max-width: 1100px) {
  .project-media .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px 18px; }
  .gallery-showcase { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .gallery-backdrop { width: 60%; opacity: .16; }
  .gallery-intro h2 { font-size: 40px; }
  .media-card-title { font-size: 12px; }
  .media-card-caption { font-size: 11px; }
  .media-card-badge { font-size: 9px; }
}
@media (max-width: 900px) {
  .project-media { width: calc(100% - 64px); }
  .gallery-showcase { grid-template-columns: minmax(0, 1fr); gap: 25px; padding-top: 24px; }
  .gallery-intro { max-width: 560px; }
  .gallery-intro h2 { font-size: 44px; }
  .gallery-description { max-width: 39em; }
  .gallery-tags { margin-top: 16px; }
  .gallery-stats { gap: 34px; margin-top: 20px; }
  .media-trailer { grid-column: auto; }
  .gallery-backdrop { width: 75%; height: 390px; opacity: .18; }
  .gallery-filters { gap: 5px; }
  .gallery-filters button { padding-inline: 12px; gap: 7px; font-size: 10px; }
  .gallery-toolbar { gap: 12px; }
}
@media (max-width: 600px) {
  .project-media { width: calc(100% - 40px); padding-block: 5px 44px; }
  .gallery-showcase { gap: 23px; padding-block: 24px; }
  .gallery-intro h2 { font-size: 37px; }
  .gallery-intro .eyebrow { font-size: 8px; letter-spacing: .16em; }
  .gallery-description { font-size: 13px; line-height: 1.8; margin-top: 12px; }
  .gallery-tags { gap: 6px; margin-top: 15px; }
  .gallery-tags > span { padding: 5px 10px; font-size: 9px; min-height: 29px; }
  .gallery-stats { gap: 28px; margin-top: 21px; }
  .gallery-stats dt { font-size: 21px; }
  .gallery-backdrop { width: 100%; height: 310px; opacity: .1; }
  .trailer-frame { border-radius: 8px; }
  .trailer-play { gap: 7px; padding-bottom: 7px; font-size: 10px; }
  .trailer-play-icon { width: 56px; height: 56px; }
  .trailer-play-icon svg { width: 21px; height: 21px; }
  .trailer-external { font-size: 8px; }
  .gallery-toolbar { flex-wrap: wrap; gap: 12px; padding-top: 16px; margin-bottom: 16px; }
  .gallery-filters { flex-wrap: nowrap; width: 100%; gap: 4px; }
  .gallery-filters button { flex: 1 1 auto; min-height: 36px; padding: 7px 9px; font-size: 9px; gap: 5px; }
  .gallery-filter-icon { width: 12px; height: 12px; }
  .gallery-sort-wrap { margin-left: auto; }
  .gallery-sort-wrap select { min-height: 33px; font-size: 9px; }
  .project-media .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px 11px; }
  .project-media .gallery-image { aspect-ratio: 16 / 12; }
  .project-media .gallery-item { border-radius: 6px; }
  .media-card-badge { top: 6px; left: 6px; max-width: calc(100% - 12px); gap: 4px; padding: 3px 5px; font-size: 7px; }
  .media-card-badge svg { width: 10px; height: 10px; }
  .media-card-play { width: 36px; height: 36px; }
  .media-card-play svg { width: 14px; height: 14px; }
  .media-card-duration { left: 6px; bottom: 6px; font-size: 8px; }
  .project-media .gallery-expand { right: 6px; bottom: 6px; width: 25px; height: 25px; }
  .gallery-expand svg { width: 12px; height: 12px; }
  .media-card-title { font-size: 12px; margin-top: 8px; }
  .media-card-caption { margin-top: 2px; font-size: 11px; }
  .gallery-show-all { min-height: 42px; margin-top: 25px; padding-inline: 22px; gap: 12px; font-size: 10px; }
  .lightbox { padding: 14px 12px; padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .lightbox-toolbar { gap: 14px; margin-bottom: 12px; }
  .lightbox-title { font-size: 8px; letter-spacing: .14em; }
  .lightbox-count { font-size: 10px; }
  .lightbox .lightbox-image { max-width: 100%; max-height: calc(100% - 64px); margin-bottom: 64px; }
  .lightbox-arrow { top: auto; bottom: 0; width: 44px; height: 44px; transform: none; }
  .lightbox-previous { left: calc(50% - 56px); }
  .lightbox-next { right: calc(50% - 56px); }
  .lightbox-footer { flex-direction: column; align-items: center; gap: 5px; margin-top: 13px; padding-top: 13px; text-align: center; }
  .lightbox .lightbox-caption { font-size: 11px; }
  .lightbox-hint { font-size: 9px; }
}

@media (max-width: 380px) {
  .gallery-filters button { padding-inline: 6px; font-size: 8px; }
  .gallery-filter-icon { width: 11px; height: 11px; }
}

@media (max-height: 500px) and (min-width: 601px) {
  .lightbox { padding-block: 10px; }
  .lightbox-toolbar { margin-bottom: 6px; min-height: 38px; }
  .lightbox .lightbox-close { width: 38px; height: 38px; }
  .lightbox-footer { padding-top: 9px; margin-top: 9px; }
}
