.gallery-page {
  background: var(--paper);
}

.gallery-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(72px, 8vw, 118px) 0 clamp(76px, 8vw, 116px);
  color: var(--paper);
  background:
    radial-gradient(circle at 15% 15%, rgba(25, 91, 139, 0.42), transparent 32%),
    linear-gradient(135deg, var(--navy-950), var(--navy-900));
}

.gallery-hero::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -240px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255, 255, 255, 0.025), 0 0 0 140px rgba(255, 255, 255, 0.02);
}

.gallery-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(520px, 1.18fr);
  align-items: center;
  gap: clamp(44px, 6vw, 92px);
}

.gallery-hero-copy h1 {
  max-width: 760px;
  margin: 20px 0 24px;
  color: var(--paper);
  font-size: clamp(44px, 5vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.gallery-hero-lead {
  max-width: 650px;
  margin: 0;
  color: #d6e0e9;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.7;
}

.gallery-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-top: 35px;
}

.gallery-hero-images {
  display: grid;
  grid-template-columns: 1.22fr 0.78fr;
  grid-template-rows: repeat(2, 210px);
  gap: 14px;
  min-width: 0;
}

.gallery-hero-images figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-content);
  background: var(--navy-800);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24);
}

.gallery-hero-images .hero-image-main {
  grid-row: 1 / -1;
}

.gallery-hero-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.gallery-hero-images figure:hover img {
  transform: scale(1.025);
}

.gallery-hero-images figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 42px 16px 14px;
  color: var(--paper);
  background: linear-gradient(transparent, rgba(3, 28, 53, 0.92));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.gallery-proof {
  background: var(--blue-50);
  border-bottom: 1px solid var(--line);
}

.gallery-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.gallery-proof-grid div {
  display: grid;
  gap: 5px;
  padding: 27px 34px;
  border-left: 1px solid var(--line);
}

.gallery-proof-grid div:last-child {
  border-right: 1px solid var(--line);
}

.gallery-proof-grid strong {
  color: var(--navy-950);
  font-size: 14px;
}

.gallery-proof-grid span {
  color: var(--copy);
  font-size: 12px;
}

.gallery-browser,
.gallery-stories {
  padding: clamp(76px, 8vw, 120px) 0;
}

.gallery-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 36px;
}

.gallery-section-heading h2 {
  max-width: 820px;
  margin: 16px 0 15px;
  color: var(--navy-950);
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.gallery-section-heading > div > p:last-child {
  max-width: 700px;
  margin: 0;
  color: var(--copy);
  line-height: 1.75;
}

.gallery-result-status {
  flex: 0 0 auto;
  margin: 0 0 8px;
  color: var(--navy-800);
  font-size: 13px;
  font-weight: 700;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 34px;
}

.gallery-filters button {
  min-height: 42px;
  padding: 9px 15px;
  color: var(--navy-800);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 700 13px/1.2 "Manrope", Arial, sans-serif;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.gallery-filters button:hover {
  border-color: var(--orange-300);
  transform: translateY(-1px);
}

.gallery-filters button.is-active {
  color: var(--paper);
  background: var(--navy-900);
  border-color: var(--navy-900);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 18px;
}

.project-card {
  grid-column: span 4;
  min-width: 0;
  margin: 0;
}

.project-card-wide {
  grid-column: span 8;
}

.project-card[hidden] {
  display: none;
}

.project-card button {
  position: relative;
  width: 100%;
  height: 350px;
  display: block;
  overflow: hidden;
  padding: 0;
  color: var(--paper);
  background: var(--navy-900);
  border: 0;
  border-radius: var(--radius-content);
  cursor: zoom-in;
  text-align: left;
  box-shadow: 0 12px 34px rgba(3, 28, 53, 0.1);
}

.project-card-tall button {
  height: 520px;
}

.project-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 420ms ease, filter 420ms ease;
}

.project-card button::after {
  content: "+";
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--navy-950);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  transform: translateY(-5px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.project-card button:hover img,
.project-card button:focus-visible img {
  transform: scale(1.035);
  filter: saturate(1.04);
}

.project-card button:hover::after,
.project-card button:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.project-card button > span {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 5px;
  padding: 74px 22px 20px;
  background: linear-gradient(transparent, rgba(3, 28, 53, 0.94));
}

.project-card small {
  color: var(--orange-300);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card strong {
  color: var(--paper);
  font-size: 16px;
  line-height: 1.35;
}

.gallery-stories {
  background: var(--blue-50);
  border-top: 1px solid var(--line);
}

.gallery-story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-story-grid article {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  padding: 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 30px rgba(3, 28, 53, 0.06);
}

.gallery-story-grid article > span {
  color: var(--orange-600);
  font-size: 13px;
  font-weight: 700;
}

.gallery-story-grid h3 {
  margin: 50px 0 14px;
  color: var(--navy-950);
  font-size: 25px;
  letter-spacing: -0.025em;
}

.gallery-story-grid p {
  margin: 0 0 28px;
  color: var(--copy);
  line-height: 1.7;
}

.gallery-story-grid a {
  margin-top: auto;
  color: var(--navy-900);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.gallery-story-grid a:hover {
  color: var(--orange-600);
}

.gallery-context {
  padding: clamp(68px, 7vw, 100px) 0;
  color: var(--paper);
  background: var(--navy-950);
}

.gallery-context-layout {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: clamp(44px, 7vw, 110px);
}

.gallery-context h2 {
  max-width: 610px;
  margin: 17px 0 0;
  color: var(--paper);
  font-size: clamp(34px, 4vw, 53px);
  line-height: 1.07;
  letter-spacing: -0.045em;
}

.gallery-context-layout > div:last-child > p {
  margin: 8px 0 28px;
  color: #d2dde7;
  font-size: 17px;
  line-height: 1.8;
}

.gallery-context-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.gallery-context-links a {
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  text-decoration-color: var(--orange-500);
  text-underline-offset: 5px;
}

.gallery-dialog {
  width: min(1200px, calc(100% - 36px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  padding: 0;
  color: var(--paper);
  background: transparent;
  border: 0;
}

.gallery-dialog::backdrop {
  background: rgba(3, 18, 32, 0.93);
  backdrop-filter: blur(6px);
}

.gallery-dialog-shell {
  position: relative;
  min-height: min(760px, calc(100dvh - 36px));
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 16px;
}

.gallery-dialog figure {
  max-height: calc(100dvh - 70px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  margin: 0;
}

.gallery-dialog figure img {
  width: 100%;
  max-height: calc(100dvh - 135px);
  object-fit: contain;
  border-radius: 10px;
}

.gallery-dialog figcaption {
  color: var(--paper);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.gallery-dialog-close,
.gallery-dialog-nav {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  cursor: pointer;
}

.gallery-dialog-nav {
  width: 50px;
  height: 50px;
  font-size: 22px;
}

.gallery-dialog-close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  font-size: 28px;
}

.gallery-dialog-close:hover,
.gallery-dialog-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

@media (max-width: 1100px) {
  .gallery-hero-layout {
    grid-template-columns: 1fr;
  }

  .gallery-hero-copy {
    max-width: 820px;
  }

  .gallery-hero-images {
    grid-template-rows: repeat(2, 250px);
  }

  .project-card {
    grid-column: span 6;
  }

  .project-card-wide {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .gallery-hero {
    padding: 58px 0 66px;
  }

  .gallery-hero-copy h1 {
    font-size: clamp(40px, 12vw, 58px);
  }

  .gallery-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-hero-actions .button {
    width: 100%;
  }

  .gallery-hero-images {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 290px 170px;
    gap: 10px;
  }

  .gallery-hero-images .hero-image-main {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .gallery-proof-grid,
  .gallery-story-grid,
  .gallery-context-layout {
    grid-template-columns: 1fr;
  }

  .gallery-proof-grid div,
  .gallery-proof-grid div:last-child {
    padding: 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-left: 0;
  }

  .gallery-proof-grid div:last-child {
    border-bottom: 0;
  }

  .gallery-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .gallery-filters {
    flex-wrap: nowrap;
    margin-right: -20px;
    padding-right: 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .gallery-filters button {
    flex: 0 0 auto;
  }

  .project-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-card,
  .project-card-wide {
    grid-column: auto;
  }

  .project-card button,
  .project-card-tall button {
    height: clamp(300px, 82vw, 430px);
  }

  .gallery-story-grid article {
    min-height: 280px;
  }

  .gallery-dialog-shell {
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    gap: 5px;
  }

  .gallery-dialog-nav {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero-images img,
  .gallery-filters button,
  .project-card img,
  .project-card button::after {
    transition: none;
  }
}
