.project-gallery-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(184, 154, 99, 0.08), transparent 30%),
    linear-gradient(180deg, #010914 0%, #030d1a 52%, #010914 100%);
}

.project-gallery-page [hidden] { display: none !important; }

.gallery-site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  min-height: 82px;
  padding: 12px clamp(16px, 4vw, 54px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  background: rgba(1, 9, 20, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.gallery-brand { text-align: center; line-height: 1.1; }
.gallery-brand strong {
  display: block;
  color: var(--gold);
  font-family: var(--font-signature);
  font-size: 1.65rem;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.gallery-brand span {
  display: block;
  margin-top: 4px;
  color: var(--light);
  font-family: var(--font-main);
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.gallery-back,
.gallery-budget {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--light);
  font-size: 0.7rem;
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gallery-budget { justify-self: end; color: var(--gold); }

.gallery-hero {
  min-height: 520px;
  padding: 160px 0 90px;
  display: grid;
  align-items: end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(1, 9, 20, 0.95), rgba(1, 9, 20, 0.5)),
    linear-gradient(0deg, #010914, transparent 70%),
    url('../assets/projetos/casa-urban/03.webp?v=20260819-6') center 58% / cover no-repeat;
}
.gallery-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 180px;
  background: linear-gradient(transparent, #010914);
}
.gallery-hero-content { position: relative; z-index: 1; }
.gallery-hero h1 {
  max-width: 760px;
  margin: 0 0 24px;
  color: var(--light);
  font-size: clamp(2.7rem, 7vw, 6.7rem);
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 0.98;
}
.gallery-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.gallery-project-nav {
  position: sticky;
  top: 82px;
  z-index: 800;
  padding: 14px 0;
  overflow-x: auto;
  background: rgba(1, 9, 20, 0.94);
  border-top: 1px solid rgba(184, 154, 99, 0.13);
  border-bottom: 1px solid rgba(184, 154, 99, 0.2);
  backdrop-filter: blur(16px);
}
.gallery-project-nav .container { display: flex; gap: 10px; }
.gallery-project-nav a {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid rgba(184, 154, 99, 0.3);
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: 0.25s;
}
.gallery-project-nav a:hover,
.gallery-project-nav a:focus-visible {
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

.gallery-loading {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}
.gallery-loading i { color: var(--gold); font-size: 1.7rem; animation: gallery-spin 1s linear infinite; }

.gallery-project-section { padding: 88px 0; scroll-margin-top: 138px; }
.gallery-project-section:nth-child(even) {
  background: rgba(216, 218, 221, 0.018);
  border-top: 1px solid rgba(184, 154, 99, 0.12);
  border-bottom: 1px solid rgba(184, 154, 99, 0.12);
}
.gallery-project-heading {
  margin-bottom: 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 30px;
}
.gallery-project-heading h2 {
  margin: 0 0 12px;
  color: var(--light);
  font-size: clamp(2rem, 4.4vw, 4rem);
  font-weight: 300;
  letter-spacing: -0.035em;
  line-height: 1.08;
}
.gallery-project-heading p { max-width: 760px; margin: 0; color: var(--muted); }
.gallery-project-count {
  padding-bottom: 10px;
  color: var(--gold);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gallery-carousel {
  --carousel-height: clamp(430px, 53vw, 670px);
  --carousel-progress: 0%;
  position: relative;
}
.gallery-carousel-stage {
  height: var(--carousel-height);
  position: relative;
  isolation: isolate;
}
.gallery-carousel-stage::before {
  content: "";
  position: absolute;
  inset: 18% 16% 4%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 154, 99, 0.12), transparent 68%);
  filter: blur(32px);
  pointer-events: none;
}
.gallery-carousel-viewport {
  height: 100%;
  position: relative;
  overflow: hidden;
  outline: none;
  perspective: 1600px;
  perspective-origin: center 48%;
  touch-action: pan-y;
  cursor: grab;
}
.gallery-carousel-viewport.is-dragging { cursor: grabbing; }
.gallery-carousel-viewport:focus-visible::after {
  content: "";
  position: absolute;
  inset: 8px 68px;
  z-index: 30;
  border: 1px solid var(--gold);
  pointer-events: none;
}
.gallery-carousel-track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.gallery-carousel-slide {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  width: var(--slide-width, min(70vw, 840px));
  height: var(--slide-height, min(calc(100% - 90px), 520px));
  margin: 0;
  padding: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  overflow: visible;
  border: 0;
  border-radius: 0;
  color: var(--light);
  background: transparent;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) translateZ(-380px) scale(0.55);
  transition:
    transform 0.72s cubic-bezier(0.22, 0.8, 0.22, 1),
    width 0.32s ease,
    height 0.32s ease,
    opacity 0.5s ease,
    filter 0.5s ease,
    visibility 0.72s;
  will-change: transform, opacity;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gallery-carousel-slide[data-offset="0"] {
  z-index: 8;
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) translateZ(90px) scale(1);
  cursor: zoom-in;
}
.gallery-carousel-slide[data-offset="-1"] {
  z-index: 6;
  opacity: 0.5;
  visibility: visible;
  transform: translate(-50%, -50%) translateX(-49%) translateZ(-120px) rotateY(17deg) scale(0.86);
}
.gallery-carousel-slide[data-offset="1"] {
  z-index: 6;
  opacity: 0.5;
  visibility: visible;
  transform: translate(-50%, -50%) translateX(49%) translateZ(-120px) rotateY(-17deg) scale(0.86);
}
.gallery-carousel-slide[data-offset="-2"] {
  z-index: 4;
  opacity: 0.2;
  visibility: visible;
  transform: translate(-50%, -50%) translateX(-76%) translateZ(-260px) rotateY(23deg) scale(0.72);
}
.gallery-carousel-slide[data-offset="2"] {
  z-index: 4;
  opacity: 0.2;
  visibility: visible;
  transform: translate(-50%, -50%) translateX(76%) translateZ(-260px) rotateY(-23deg) scale(0.72);
}
.gallery-carousel-slide[data-offset="-3"],
.gallery-carousel-slide[data-offset="3"] {
  z-index: 2;
  opacity: 0.055;
  visibility: visible;
  pointer-events: none;
}
.gallery-carousel-slide[data-offset="-3"] {
  transform: translate(-50%, -50%) translateX(-94%) translateZ(-350px) rotateY(27deg) scale(0.62);
}
.gallery-carousel-slide[data-offset="3"] {
  transform: translate(-50%, -50%) translateX(94%) translateZ(-350px) rotateY(-27deg) scale(0.62);
}
.gallery-carousel-frame {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  overflow: hidden;
  background: transparent;
  box-shadow: 0 28px 82px rgba(0, 0, 0, 0.54);
  transition: transform 0.28s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
}
.gallery-carousel-slide[data-offset="0"] .gallery-carousel-frame {
  transform: rotateX(var(--tilt-x)) rotateY(var(--tilt-y));
}
.gallery-carousel-slide[data-offset="0"]:hover .gallery-carousel-frame {
  box-shadow: 0 34px 96px rgba(0, 0, 0, 0.62);
}
.gallery-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: saturate(0.82) brightness(0.64);
  transition: transform 0.5s ease, filter 0.55s ease;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.gallery-carousel-slide[data-offset="0"] img {
  filter: saturate(0.96) brightness(1);
}
.gallery-carousel-slide[data-offset="0"]:hover img { transform: scale(1.018); }
.gallery-carousel-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(1, 9, 20, 0.26), transparent 28%, transparent 72%, rgba(1, 9, 20, 0.2));
  pointer-events: none;
}
.gallery-carousel-slide[data-offset="0"]::after {
  background: linear-gradient(180deg, transparent 68%, rgba(1, 9, 20, 0.4));
}
.gallery-slide-number,
.gallery-slide-action {
  position: absolute;
  z-index: 2;
  color: var(--gold-soft);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  pointer-events: none;
}
.gallery-slide-number {
  top: 15px;
  right: 16px;
  padding: 5px 8px;
  border: 1px solid rgba(184, 154, 99, 0.3);
  background: rgba(1, 9, 20, 0.74);
}
.gallery-slide-action {
  left: 18px;
  bottom: 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-carousel-slide[data-offset="0"]:hover .gallery-slide-action,
.gallery-carousel-slide[data-offset="0"]:focus-visible .gallery-slide-action {
  opacity: 1;
  transform: none;
}
.gallery-carousel-slide:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 5px;
}
.gallery-carousel-control {
  width: 54px;
  height: 54px;
  padding: 0;
  position: absolute;
  top: 50%;
  z-index: 20;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 154, 99, 0.48);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(1, 9, 20, 0.86);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
  font-size: 1.2rem;
  transform: translateY(-50%);
  transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  cursor: pointer;
}
.gallery-carousel-control:hover,
.gallery-carousel-control:focus-visible {
  color: var(--navy);
  background: var(--gold);
  transform: translateY(-50%) scale(1.06);
}
.gallery-carousel-prev { left: 2px; }
.gallery-carousel-next { right: 2px; }
.gallery-carousel-status {
  min-height: 62px;
  margin-top: -8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
}
.gallery-carousel-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.gallery-carousel-counter {
  flex: 0 0 auto;
  color: var(--gold);
  font-family: var(--font-signature);
  font-size: 1.72rem;
  line-height: 1;
}
.gallery-carousel-caption {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.gallery-carousel-progress {
  width: clamp(130px, 18vw, 230px);
  height: 1px;
  overflow: hidden;
  background: rgba(184, 154, 99, 0.2);
}
.gallery-carousel-progress-bar {
  width: var(--carousel-progress);
  height: 100%;
  display: block;
  background: var(--gold);
  transition: width 0.55s cubic-bezier(0.22, 0.8, 0.22, 1);
}
.gallery-carousel-instruction {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(174, 180, 189, 0.72);
  font-size: 0.61rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gallery-carousel-instruction i { color: var(--gold); font-size: 0.9rem; }

.gallery-project-videos {
  margin-top: clamp(56px, 8vw, 94px);
  padding-top: clamp(34px, 5vw, 54px);
  border-top: 1px solid rgba(184, 154, 99, 0.2);
}
.gallery-video-heading {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}
.gallery-video-heading h3 {
  margin: 0 0 10px;
  color: var(--light);
  font-size: clamp(1.65rem, 3.4vw, 2.85rem);
  font-weight: 300;
  letter-spacing: -0.025em;
}
.gallery-video-heading p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.gallery-video-count {
  padding-bottom: 7px;
  color: var(--gold);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.gallery-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px) clamp(22px, 3vw, 36px);
}
.gallery-video-grid.is-single {
  grid-template-columns: minmax(0, 880px);
}
.gallery-video-card { min-width: 0; }
.gallery-video-media {
  position: relative;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.42);
}
.gallery-video-media video {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  accent-color: var(--gold);
}
.gallery-video-media video:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}
.gallery-video-caption {
  padding-top: 17px;
  border-top: 1px solid rgba(184, 154, 99, 0.32);
}
.gallery-video-caption h4 {
  margin: 0 0 7px;
  color: var(--light);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}
.gallery-video-caption p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.gallery-footer,
.gallery-noscript {
  padding: 34px 5%;
  color: var(--muted);
  border-top: 1px solid rgba(184, 154, 99, 0.18);
  font-size: 0.76rem;
  text-align: center;
}
.gallery-footer-name {
  margin-inline: 4px 6px;
  color: var(--gold);
  font-family: var(--font-signature);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}
.gallery-footer-discipline {
  margin-right: 5px;
  color: var(--light);
  font-family: var(--font-main);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  padding: 32px 86px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  background: rgba(0, 4, 10, 0.97);
  backdrop-filter: blur(14px);
}
.gallery-lightbox figure {
  min-width: 0;
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
}
.gallery-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}
.gallery-lightbox figcaption {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.gallery-lightbox button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(184, 154, 99, 0.42);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(1, 9, 20, 0.8);
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.25s;
}
.gallery-lightbox button:hover,
.gallery-lightbox button:focus-visible { color: var(--navy); background: var(--gold); }
.gallery-lightbox-close { position: absolute; top: 20px; right: 22px; }

@keyframes gallery-spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .gallery-carousel { --carousel-height: clamp(390px, 64vw, 570px); }
  .gallery-carousel-slide { width: var(--slide-width, min(78vw, 760px)); }
  .gallery-carousel-control { width: 48px; height: 48px; }
  .gallery-carousel-slide[data-offset="-1"] {
    transform: translate(-50%, -50%) translateX(-54%) translateZ(-130px) rotateY(17deg) scale(0.84);
  }
  .gallery-carousel-slide[data-offset="1"] {
    transform: translate(-50%, -50%) translateX(54%) translateZ(-130px) rotateY(-17deg) scale(0.84);
  }
  .gallery-carousel-instruction { display: none; }
  .gallery-carousel-status { grid-template-columns: minmax(0, 1fr) auto; }
  .gallery-lightbox { padding: 72px 18px 28px; grid-template-columns: 1fr; }
  .gallery-lightbox figure { grid-row: 1; }
  .gallery-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .gallery-lightbox-prev { left: 12px; }
  .gallery-lightbox-next { right: 12px; }
  .gallery-lightbox img { max-height: calc(100vh - 130px); }
}

@media (max-width: 680px) {
  .gallery-site-header { min-height: 72px; grid-template-columns: 1fr 1fr; }
  .gallery-brand { display: none; }
  .gallery-project-nav { top: 72px; }
  .gallery-hero { min-height: 470px; padding: 132px 0 68px; }
  .gallery-hero h1 { font-size: clamp(2.7rem, 14vw, 4.5rem); }
  .gallery-project-section { padding: 66px 0; scroll-margin-top: 128px; }
  .gallery-project-heading { grid-template-columns: 1fr; gap: 8px; }
  .gallery-project-count { padding: 0; }
  .gallery-carousel { --carousel-height: clamp(320px, 88vw, 470px); }
  .gallery-carousel-stage { margin-inline: -4%; }
  .gallery-carousel-viewport:focus-visible::after { inset: 6px 48px; }
  .gallery-carousel-slide {
    width: var(--slide-width, 84vw);
    height: var(--slide-height, min(calc(100% - 70px), 410px));
  }
  .gallery-carousel-slide[data-offset="-1"] {
    opacity: 0.34;
    transform: translate(-50%, -50%) translateX(-66%) translateZ(-160px) rotateY(16deg) scale(0.78);
  }
  .gallery-carousel-slide[data-offset="1"] {
    opacity: 0.34;
    transform: translate(-50%, -50%) translateX(66%) translateZ(-160px) rotateY(-16deg) scale(0.78);
  }
  .gallery-carousel-slide[data-offset="-2"],
  .gallery-carousel-slide[data-offset="2"],
  .gallery-carousel-slide[data-offset="-3"],
  .gallery-carousel-slide[data-offset="3"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .gallery-carousel-control { width: 44px; height: 44px; }
  .gallery-carousel-prev { left: 0; }
  .gallery-carousel-next { right: 0; }
  .gallery-carousel-status {
    min-height: 82px;
    margin-top: -12px;
    grid-template-columns: 1fr auto;
    gap: 12px;
  }
  .gallery-carousel-copy {
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
  }
  .gallery-carousel-caption { font-size: 0.62rem; }
  .gallery-carousel-progress { width: 92px; }
  .gallery-slide-action { display: none; }
  .gallery-video-heading { grid-template-columns: 1fr; gap: 8px; }
  .gallery-video-count { padding: 0; }
  .gallery-video-grid,
  .gallery-video-grid.is-single { grid-template-columns: 1fr; }
  .gallery-lightbox-nav { width: 42px !important; height: 42px !important; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-loading i { animation: none; }
  .gallery-carousel-slide,
  .gallery-carousel-frame,
  .gallery-carousel-slide img,
  .gallery-carousel-progress-bar { transition: none; }
}
