/* Gallery page — one page, three sections (Brands / Artists / Startups).
   Reuses the site's dark, editorial language (styles.css) and adds a
   masonry-style layout so photos keep their original orientation —
   nothing is force-cropped into a shape it wasn't shot in. */

.gallery-masthead {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 3rem) 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5ch;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--text);
}

.gallery-hero {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 5rem) clamp(1rem, 3vw, 3rem) clamp(1.5rem, 4vw, 3rem);
}

.gallery-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.gallery-title {
  margin: 0.4rem 0 0;
  padding-right: 0.06em;
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.06em;
  text-transform: uppercase;
}

.gallery-intro {
  max-width: 52ch;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.1rem);
  line-height: 1.65;
}

/* Sticky in-page nav — jumps to and highlights each section. */
.gallery-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: clamp(0.4rem, 1.5vw, 1.5rem);
  width: 100%;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 3rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(11, 11, 11, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow-x: auto;
  scrollbar-width: none;
}

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

.gallery-nav-inner {
  display: flex;
  gap: clamp(0.4rem, 1.5vw, 1.5rem);
  width: min(100%, 1600px);
  margin: 0 auto;
}

.gallery-nav-link {
  flex-shrink: 0;
  padding: 0.5rem 0.2rem;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom: 1px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
}

.gallery-nav-link:hover,
.gallery-nav-link:focus-visible {
  color: var(--text);
}

.gallery-nav-link.is-active {
  color: var(--text);
  border-color: var(--text);
}

/* Section shell */
.gallery-section {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 3vw, 3rem) 0;
  scroll-margin-top: 4.5rem;
  border-bottom: 1px solid var(--line);
}

.gallery-section:last-of-type {
  border-bottom: none;
}

.gallery-section-head {
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.gallery-section-title {
  margin: 0.3rem 0 0;
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  display: inline-block;
  padding-right: 0.05em;
  background-size: 220% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gallery-title-flow 10s ease-in-out infinite;
}

.gallery-section[data-type="brands"] .gallery-section-title {
  background-image: linear-gradient(100deg, #f3f0e8, #ff8a5c 45%, #ffcf70 60%, #f3f0e8);
}

.gallery-section[data-type="artists"] .gallery-section-title {
  background-image: linear-gradient(100deg, #f3f0e8, #7bd8ff 45%, #8f7cff 60%, #f3f0e8);
}

.gallery-section[data-type="startups"] .gallery-section-title {
  background-image: linear-gradient(100deg, #f3f0e8, #7dffb0 45%, #7dd8ff 60%, #f3f0e8);
}

.gallery-section[data-type="favourites"] .gallery-section-title {
  background-image: linear-gradient(100deg, #f3f0e8, #ffd27d 45%, #ff8fb0 60%, #f3f0e8);
}

@keyframes gallery-title-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.gallery-section-intro {
  max-width: 52ch;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.6;
}

/* Masonry grid — CSS columns, so every tile keeps the image's real
   aspect ratio instead of being forced into a fixed box and cropped. */
.gallery-grid {
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  column-count: 3;
  column-gap: clamp(0.65rem, 1.4vw, 1rem);
}

.gallery-grid > * {
  break-inside: avoid;
  margin-bottom: clamp(0.65rem, 1.4vw, 1rem);
}

/* Frame — a lightbox-triggering image tile. No fixed aspect-ratio and
   no object-fit: cover — the image sets its own height so horizontal
   shots stay horizontal and nothing gets cropped. */
.frame {
  position: relative;
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 0;
  border: 1px solid var(--line);
  background: #101010;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 200ms ease;
}

.frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.38) 82%, rgba(0, 0, 0, 0.5)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 24%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.frame.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.1) 48%, rgba(255,255,255,0.03) 100%);
  background-size: 200% 100%;
  animation: gallery-skeleton 1.2s ease-in-out infinite;
}

@keyframes gallery-skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.frame:hover,
.frame:focus-visible {
  border-color: rgba(243, 240, 232, 0.32);
}

.frame:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

.frame img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 260ms ease, transform 700ms cubic-bezier(0.19, 1, 0.22, 1);
}

.frame.is-loaded img,
.frame.is-loading img {
  opacity: 1;
}

.frame.is-loading img {
  filter: blur(6px);
  transform: scale(1.01);
}

.frame.is-loaded img {
  opacity: 1;
  filter: none;
}

.frame:hover img,
.frame:focus-visible img {
  transform: scale(1.035);
}

.frame-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  opacity: 0.85;
  backdrop-filter: blur(10px);
}

.frame-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.frame-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 0.9rem 1.1rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--text);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.frame:hover .frame-caption,
.frame:focus-visible .frame-caption {
  opacity: 0.92;
  transform: translateY(0);
}

/* Review card — used to balance out uneven masonry columns with
   something on-brand rather than leaving empty space. */
.review-card {
  padding: clamp(1.5rem, 2.6vw, 2rem);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.01) 55%, rgba(255, 255, 255, 0.03));
}

.reel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.65rem, 1.4vw, 1rem);
  margin-top: clamp(0.5rem, 1vw, 1rem);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.reel-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--line);
  background: #101010;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease;
}

.reel-card:hover,
.reel-card:focus-visible {
  border-color: rgba(243, 240, 232, 0.28);
  background: #161616;
}

.reel-card:hover .reel-play,
.reel-card:focus-visible .reel-play {
  transform: scale(1.08);
  background: rgba(255,255,255,0.2);
}

.reel-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(6px) brightness(0.55);
  transform: scale(1.08); /* prevent blur edge bleed */
  opacity: 0;
  transition: opacity 400ms ease;
}

.reel-thumb.is-loaded {
  opacity: 1;
}

.reel-play {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  transition: transform 220ms ease, background 220ms ease;
}

.reel-play svg {
  width: 20px;
  height: 20px;
  color: #fff;
  margin-left: 3px;
}

.review-quote-mark {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 800;
  opacity: 0.5;
}

.review-quote {
  margin: 0;
  font-size: clamp(0.98rem, 1.4vw, 1.08rem);
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--text);
}

.review-attribution {
  display: flex;
  flex-direction: column;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.review-name {
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.review-role {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Closing CTA band beneath each section's grid. */
.gallery-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

.gallery-cta p {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.gallery-cta a {
  flex-shrink: 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--text);
  font-size: 0.88rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms ease, transform 700ms ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.gallery-footer {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 3vw, 3rem) clamp(2.5rem, 6vw, 4rem);
}

@media (max-width: 920px) {
  .gallery-grid {
    column-count: 2;
  }

  .reel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    column-count: 1;
  }

  .reel-grid {
    grid-template-columns: 1fr;
  }

  .gallery-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}
