:root {
  --brx-ink: #092442;
  --brx-ink-soft: #3a4f66;
  --brx-night: #090a09;
  --brx-night-2: #101412;
  --brx-cream: #f3eee4;
  --brx-white: #ffffff;
  --brx-yellow: #f3c62e;
  --brx-green: #007a3d;
  --brx-red: #c91832;
  --brx-line: rgba(255, 255, 255, 0.16);
  --brx-muted: rgba(255, 255, 255, 0.72);
  --brx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.brx-gallery,
.brx-gallery *,
.brx-lightbox,
.brx-lightbox * {
  box-sizing: border-box;
}

body.brx-standalone-demo {
  margin: 0;
  min-height: 100%;
  background: var(--brx-cream);
  color: var(--brx-ink);
  font-family: var(--brx-font);
}

body.brx-standalone-demo main {
  min-height: 100svh;
}

.brx-gallery {
  position: fixed;
  isolation: isolate;
  inset: 0;
  z-index: 99990;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  transform: none;
  background:
    radial-gradient(circle at 52% 42%, rgba(243, 198, 46, 0.08), transparent 28rem),
    radial-gradient(circle at 76% 72%, rgba(0, 122, 61, 0.08), transparent 34rem),
    #000000;
  color: var(--brx-white);
}

body.brx-gallery-immersive-page {
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
}

.brx-gallery .brx-gallery__copy {
  display: none;
}

.brx-gallery .brx-gallery__trim {
  display: none;
}

body.brx-standalone-demo .brx-gallery {
  left: auto;
  width: 100%;
  min-height: 100svh;
  margin: 0;
  transform: none;
}

.brx-gallery::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.045), transparent 34rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.86));
}

.brx-gallery::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  z-index: -1;
  background: radial-gradient(ellipse at center bottom, rgba(243, 198, 46, 0.08), transparent 38rem);
  pointer-events: none;
}

.brx-gallery__exit {
  position: absolute;
  top: max(14px, calc(env(safe-area-inset-top, 0px) + 12px));
  right: max(14px, calc(env(safe-area-inset-right, 0px) + 12px));
  z-index: 20;
  display: inline-flex;
  min-width: 46px;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 0 17px 0 14px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-family: var(--brx-font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  transition: border-color 0.22s ease, color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.brx-gallery__exit:hover {
  border-color: rgba(243, 198, 46, 0.82);
  background: rgba(0, 0, 0, 0.62);
  color: var(--brx-yellow);
  transform: translateY(-1px);
}

.brx-gallery__exit-mark {
  display: block;
  font-size: 25px;
  font-weight: 300;
  line-height: 0.82;
}

.brx-gallery__trim {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  display: grid;
  grid-template-columns: 34% 34% 32%;
  height: 7px;
}

.brx-gallery__trim span:nth-child(1) {
  background: var(--brx-yellow);
}

.brx-gallery__trim span:nth-child(2) {
  background: var(--brx-green);
}

.brx-gallery__trim span:nth-child(3) {
  background: var(--brx-red);
}

.brx-gallery__copy {
  position: absolute;
  left: clamp(24px, 5.2vw, 78px);
  top: clamp(68px, 13vh, 116px);
  z-index: 3;
  width: min(430px, calc(100% - 48px));
  pointer-events: none;
}

.brx-gallery__eyebrow {
  margin: 0 0 18px;
  color: var(--brx-yellow);
  font-size: clamp(12px, 1.2vw, 14px);
  font-weight: 900;
  letter-spacing: 0.18em;
  line-height: 1.15;
  text-transform: uppercase;
}

.brx-gallery h1 {
  margin: 0;
  max-width: 9.2ch;
  color: var(--brx-white);
  font-size: clamp(43px, 5vw, 72px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.94;
  text-transform: uppercase;
}

.brx-gallery__copy > p:not(.brx-gallery__eyebrow) {
  margin: 24px 0 0;
  max-width: 410px;
  color: var(--brx-muted);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.65;
}

.brx-gallery__meta {
  display: block;
  width: min(360px, 100%);
  margin-top: 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(243, 198, 46, 0.5);
}

.brx-gallery__meta span {
  display: none;
  min-height: 0;
  align-items: center;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.brx-gallery__meta span:first-child {
  display: inline-flex;
}

.brx-gallery__meta strong {
  color: var(--brx-yellow);
  font-weight: 950;
  margin-right: 5px;
}

.brx-gallery__stage {
  position: absolute;
  inset: 0;
  min-height: 100%;
}

.brx-gallery__canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: 0;
  touch-action: none;
  cursor: grab;
}

.brx-gallery__canvas:active {
  cursor: grabbing;
}

.brx-gallery__loading {
  position: absolute;
  left: 50%;
  bottom: clamp(36px, 8vh, 92px);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0;
  transform: translateX(-50%);
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.brx-gallery__loading[hidden] {
  opacity: 0;
  visibility: hidden;
}

.brx-gallery__loading span {
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--brx-yellow);
  box-shadow: 0 0 0 0 rgba(243, 198, 46, 0.56);
  animation: brx-pulse 1.3s ease-out infinite;
}

.brx-gallery__loading p {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.brx-gallery__hint {
  display: none;
}

.brx-gallery__hint span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  padding: 9px 11px;
  backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.brx-gallery__fallback {
  position: relative;
  z-index: 4;
  max-width: 1180px;
  margin: 0 auto;
  padding: 130px 22px 80px;
}

.brx-gallery__fallback h2 {
  margin: 0;
  color: var(--brx-white);
  font-size: clamp(34px, 6vw, 72px);
  line-height: 0.95;
  text-transform: uppercase;
}

.brx-gallery__fallback p {
  max-width: 620px;
  color: var(--brx-muted);
}

.brx-gallery__fallback-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.brx-gallery__fallback-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.brx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: clamp(18px, 3vh, 34px);
  min-height: 100dvh;
  padding:
    max(18px, calc(env(safe-area-inset-top, 0px) + 16px))
    max(18px, calc(env(safe-area-inset-right, 0px) + 16px))
    max(18px, calc(env(safe-area-inset-bottom, 0px) + 16px))
    max(18px, calc(env(safe-area-inset-left, 0px) + 16px));
  background:
    radial-gradient(circle at center, rgba(243, 198, 46, 0.12), transparent 32rem),
    rgba(0, 0, 0, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.brx-lightbox.is-active {
  opacity: 1;
  visibility: visible;
}

.brx-lightbox__figure {
  position: relative;
  width: min(76vh, 74vw, 760px);
  max-width: 760px;
  aspect-ratio: 1;
  margin: 0;
  border-radius: 999px;
  filter: drop-shadow(0 34px 88px rgba(0, 0, 0, 0.72));
}

.brx-lightbox__figure::before {
  content: "";
  position: absolute;
  inset: -12px;
  border: 2px solid rgba(243, 198, 46, 0.7);
  border-radius: inherit;
  pointer-events: none;
}

.brx-lightbox__figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), transparent 28%, transparent 62%, rgba(0, 0, 0, 0.26)),
    radial-gradient(circle at 50% 50%, transparent 62%, rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.brx-lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  background: #050505;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brx-lightbox__thumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
  width: min(760px, 88vw);
  max-width: 100%;
}

.brx-lightbox__thumb {
  width: clamp(48px, 6vw, 74px);
  height: clamp(48px, 6vw, 74px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  opacity: 0.68;
  transform: scale(0.9);
  transition: transform 0.22s ease, opacity 0.22s ease, border-color 0.22s ease;
}

.brx-lightbox__thumb img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  box-shadow: none;
}

.brx-lightbox__thumb:hover,
.brx-lightbox__thumb.is-active {
  border-color: var(--brx-yellow);
  opacity: 1;
  transform: scale(1.14);
}

.brx-lightbox__close,
.brx-lightbox__nav {
  position: absolute;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0;
  background: rgba(0, 0, 0, 0.38);
  color: var(--brx-white);
  cursor: pointer;
  font-family: var(--brx-font);
  line-height: 1;
  backdrop-filter: blur(14px);
}

.brx-lightbox__close {
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  font-size: 34px;
}

.brx-lightbox__nav {
  display: none;
}

.brx-lightbox__nav--prev {
  left: 24px;
}

.brx-lightbox__nav--next {
  right: 24px;
}

.brx-lightbox__close:hover,
.brx-lightbox__nav:hover {
  border-color: var(--brx-yellow);
  color: var(--brx-yellow);
}

@keyframes brx-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(243, 198, 46, 0.56);
  }
  100% {
    box-shadow: 0 0 0 18px rgba(243, 198, 46, 0);
  }
}

@media (max-width: 900px) {
  .brx-gallery {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    margin: 0;
  }

  .brx-gallery::before {
    background:
      radial-gradient(circle at 50% 46%, rgba(255, 255, 255, 0.05), transparent 18rem),
      linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.9));
  }

  .brx-gallery__stage {
    min-height: 100%;
  }
}

@media (max-width: 560px) {
  .brx-gallery {
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
  }

  .brx-gallery__exit {
    width: 48px;
    height: 48px;
    padding: 0;
  }

  .brx-gallery__exit-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .brx-lightbox {
    gap: 18px;
    padding:
      max(14px, calc(env(safe-area-inset-top, 0px) + 12px))
      max(14px, calc(env(safe-area-inset-right, 0px) + 12px))
      max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px))
      max(14px, calc(env(safe-area-inset-left, 0px) + 12px));
  }

  .brx-lightbox__figure {
    width: min(84vw, 58dvh, 430px);
  }

  .brx-lightbox__thumbs {
    justify-content: flex-start;
    gap: 7px;
    width: 100%;
    overflow-x: auto;
    padding: 8px 2px 10px;
    scrollbar-width: none;
  }

  .brx-lightbox__thumbs::-webkit-scrollbar {
    display: none;
  }

  .brx-lightbox__thumb {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
  }

  .brx-lightbox__close {
    top: max(14px, calc(env(safe-area-inset-top, 0px) + 10px));
    right: max(14px, calc(env(safe-area-inset-right, 0px) + 10px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .brx-gallery__loading span {
    animation: none;
  }

  .brx-lightbox,
  .brx-gallery__loading {
    transition: none;
  }
}
