.gallery-page {
  color: var(--ink);
  background: var(--green-950);
}

.gallery-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  overflow: clip;
  background: #eee7dc;
}

.gallery-hero {
  position: relative;
  min-height: min(76svh, 650px);
  overflow: hidden;
  color: var(--white);
  background: var(--green-950);
}

.gallery-hero > img,
.gallery-hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gallery-hero > img {
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(0.78) contrast(1.02);
}

.gallery-hero__veil {
  background:
    linear-gradient(180deg, rgba(4, 22, 19, 0.68), rgba(4, 22, 19, 0.08) 34%, rgba(4, 22, 19, 0.32) 56%, rgba(4, 22, 19, 0.93)),
    linear-gradient(90deg, rgba(5, 29, 25, 0.32), transparent 70%);
}

.gallery-nav {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 22px 0;
}

.gallery-nav > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.gallery-nav > a:first-child {
  color: rgba(255, 255, 255, 0.7);
}

.gallery-nav > a:first-child span {
  font-size: 19px;
}

.gallery-nav b {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.gallery-brand > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 11px;
}

.gallery-brand b {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.gallery-hero__copy {
  position: absolute;
  right: 22px;
  bottom: 64px;
  left: 22px;
  z-index: 1;
}

.gallery-hero__copy p {
  margin: 0 0 13px;
  color: #e0c17f;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.gallery-hero__copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 49px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.1;
}

.gallery-hero__copy > span {
  display: block;
  margin-top: 13px;
  color: rgba(255, 255, 255, 0.65);
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.gallery-hero__count {
  position: absolute;
  right: 22px;
  bottom: 62px;
  z-index: 1;
  display: none;
  text-align: right;
}

.gallery-hero__count strong {
  display: block;
  color: #e2c47f;
  font-family: Georgia, serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}

.gallery-hero__count span {
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.gallery-content {
  padding-bottom: 80px;
}

.gallery-intro {
  padding: 54px 22px 36px;
}

.gallery-intro p {
  margin: 0 0 13px;
  color: var(--red-deep);
  font-family: var(--serif);
  font-size: 23px;
  letter-spacing: 0.12em;
}

.gallery-intro > span {
  display: block;
  color: #66706b;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.025em;
  line-height: 1.9;
}

.gallery-filters {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 7px;
  padding: 14px 22px;
  overflow-x: auto;
  border-top: 1px solid rgba(21, 37, 34, 0.1);
  border-bottom: 1px solid rgba(21, 37, 34, 0.1);
  background: rgba(238, 231, 220, 0.94);
  box-shadow: 0 8px 24px rgba(21, 37, 34, 0.06);
  backdrop-filter: blur(15px);
  scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
  display: none;
}

.gallery-filters button {
  display: inline-flex;
  min-height: 35px;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid rgba(21, 37, 34, 0.16);
  border-radius: 999px;
  color: #606a65;
  background: rgba(255, 255, 255, 0.3);
  font-size: 10px;
}

.gallery-filters button span {
  color: #9c8e7e;
  font-family: Georgia, serif;
  font-size: 9px;
}

.gallery-filters button.is-active {
  color: var(--white);
  border-color: var(--green-800);
  background: var(--green-800);
}

.gallery-filters button.is-active span {
  color: #dec381;
}

.gallery-status {
  padding: 25px 22px 14px;
  color: #7d827e;
  font-size: 10px;
}

.gallery-status strong {
  color: var(--red-deep);
  font-family: Georgia, serif;
  font-size: 19px;
  font-weight: 400;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
  padding: 0 22px;
}

.gallery-card {
  min-width: 0;
  margin: 0;
}

.gallery-card.is-featured {
  grid-column: 1 / -1;
}

.gallery-card > button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 0.82;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  background: #cfc7bc;
}

.gallery-card.is-featured > button {
  aspect-ratio: 1.52;
}

.gallery-card > button::after {
  content: "↗";
  position: absolute;
  right: 9px;
  bottom: 9px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: var(--white);
  background: rgba(7, 30, 27, 0.42);
  backdrop-filter: blur(7px);
  font-size: 12px;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-card[data-id="16"] img {
  object-position: center;
}

.gallery-card[data-id="21"] img {
  object-position: center 38%;
}

.gallery-card > button:active img {
  transform: scale(1.025);
}

.gallery-card figcaption {
  padding: 10px 1px 4px;
}

.gallery-card figcaption h2 {
  margin: 0;
  color: #253530;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

.gallery-card figcaption p {
  margin: 4px 0 0;
  color: #85867f;
  font-size: 8px;
  line-height: 1.6;
}

.gallery-card.is-featured figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 11px;
}

.gallery-card.is-featured figcaption h2 {
  font-size: 18px;
}

.gallery-card.is-featured figcaption p {
  max-width: 175px;
  margin: 0;
  text-align: right;
}

.gallery-footer {
  display: grid;
  min-height: 360px;
  padding: 70px 22px max(46px, env(safe-area-inset-bottom));
  place-items: center;
  align-content: center;
  color: var(--white);
  background: var(--green-950);
  text-align: center;
}

.gallery-footer .footer__seal {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
}

.gallery-footer p {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.12em;
}

.gallery-footer > strong {
  margin-top: 13px;
  color: #d6b878;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.18em;
}

.gallery-footer a {
  display: flex;
  min-width: 180px;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  margin-top: 36px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.gallery-top {
  position: fixed;
  right: max(18px, calc((100vw - 480px) / 2 + 18px));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: var(--white);
  background: rgba(14, 46, 42, 0.92);
  box-shadow: 0 11px 28px rgba(8, 27, 24, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  width: min(100%, 480px);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: auto;
  overflow: hidden;
  color: var(--white);
  background: #061816;
}

.gallery-lightbox::backdrop {
  background: rgba(2, 13, 12, 0.86);
}

.gallery-lightbox__close {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  z-index: 2;
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: var(--white);
  background: rgba(5, 25, 22, 0.48);
  backdrop-filter: blur(8px);
  font-size: 25px;
  font-weight: 200;
}

.gallery-lightbox__stage {
  display: grid;
  width: 100%;
  height: calc(100% - 190px - env(safe-area-inset-bottom));
  place-items: center;
}

.gallery-lightbox__stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-lightbox__info {
  position: absolute;
  right: 20px;
  bottom: calc(82px + env(safe-area-inset-bottom));
  left: 20px;
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: start;
  gap: 13px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.gallery-lightbox__info > p {
  margin: 1px 0 0;
  color: rgba(255, 255, 255, 0.36);
  font-family: Georgia, serif;
  font-size: 9px;
}

.gallery-lightbox__info > p span:first-child {
  color: #d9bb7a;
  font-size: 19px;
}

.gallery-lightbox__info h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.gallery-lightbox__info > div > span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
  line-height: 1.6;
}

.gallery-lightbox__nav {
  position: absolute;
  right: 20px;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
}

.gallery-lightbox__nav button {
  display: grid;
  width: 45px;
  height: 45px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.21);
  border-radius: 50%;
  color: var(--white);
  background: transparent;
  font-size: 17px;
}

@media (min-width: 600px) {
  .gallery-shell {
    box-shadow: 0 0 120px rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 350px) {
  .gallery-nav,
  .gallery-intro,
  .gallery-status,
  .gallery-grid {
    padding-right: 18px;
    padding-left: 18px;
  }

  .gallery-filters {
    padding-right: 18px;
    padding-left: 18px;
  }

  .gallery-brand b {
    display: none;
  }

  .gallery-hero__copy {
    right: 18px;
    left: 18px;
  }

  .gallery-hero__copy h1 {
    font-size: 42px;
  }

  .gallery-grid {
    gap: 10px 8px;
  }

  .gallery-card figcaption h2 {
    font-size: 14px;
  }
}
