/* =========================================
   SECTION 01 — PRESENÇA
   ========================================= */

.presence-section {
  --lighthouse-transition-progress: 0;
  position: relative;
  z-index: 2;
  isolation: isolate;
  padding-top: clamp(88px, 8.5vw, 136px);
  padding-bottom: clamp(48px, 4.5vw, 72px);
  padding-inline: 0;
  background: var(--background);
  color: var(--foreground);
}

.presence-section::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(247, 247, 245, 0) 0%,
    rgba(247, 247, 245, 0) 38%,
    rgba(238, 238, 236, .08) 50%,
    rgba(231, 231, 228, .28) 66%,
    rgba(222, 222, 219, .68) 84%,
    #dededb 100%
  );
}

.presence-section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: var(--lighthouse-transition-progress);
  background: linear-gradient(
    180deg,
    rgba(247, 247, 245, 0) 0%,
    rgba(247, 247, 245, 0) 34%,
    rgba(238, 239, 237, .08) 43%,
    rgba(218, 219, 217, .2) 52%,
    rgba(177, 179, 178, .42) 64%,
    rgba(119, 121, 121, .66) 76%,
    rgba(70, 71, 71, .86) 88%,
    #2e2e2e 100%
  );
}

@media (min-width: 901px), (max-width: 720px) {
  .presence-section {
    --lighthouse-overlap: clamp(220px, 30svh, 330px);
    --lighthouse-veil: 1;
  }

  /* Fade only the backgrounds; cards remain opaque above the live canvas. */
  .presence-section::before {
    -webkit-mask-image: linear-gradient(to bottom,
      #000 calc(100% - var(--lighthouse-overlap)),
      rgb(0 0 0 / calc(.55 * var(--lighthouse-veil))) calc(100% - var(--lighthouse-overlap) * .75),
      rgb(0 0 0 / calc(.16 * var(--lighthouse-veil))) calc(100% - var(--lighthouse-overlap) * .45),
      transparent 100%);
    mask-image: linear-gradient(to bottom,
      #000 calc(100% - var(--lighthouse-overlap)),
      rgb(0 0 0 / calc(.55 * var(--lighthouse-veil))) calc(100% - var(--lighthouse-overlap) * .75),
      rgb(0 0 0 / calc(.16 * var(--lighthouse-veil))) calc(100% - var(--lighthouse-overlap) * .45),
      transparent 100%);
    background: linear-gradient(180deg, var(--background) 34%,
      #eeefed 43%, #dadbd9 52%, #b1b3b2 64%, #777979 76%,
      #464747 88%, #2e2e2e 100%);
  }

  .presence-section::after {
    content: none;
  }

  .presence-gallery {
    transform: translate3d(0, var(--lighthouse-card-lift, 0px), 0);
  }
}

@media (max-width: 720px) {
  .presence-section { --lighthouse-overlap: clamp(140px, 22svh, 220px); }
}

.presence-section__inner,
.presence-gallery {
  position: relative;
  z-index: 2;
}

.presence-section__inner {
  width: min(100%, var(--content-width));
  margin-inline: auto;
  padding-inline: var(--page-padding);
}

/* Eyebrow: 01 / PRESENÇA ─────── */
.presence-section__eyebrow {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--foreground);
  font-size: var(--type-micro);
  font-weight: var(--micro-weight);
  letter-spacing: var(--micro-tracking);
  margin-bottom: clamp(48px, 5.2vw, 80px);
  will-change: transform, opacity;
}

.presence-section__eyebrow-rule {
  display: block;
  width: 56px;
  height: 1px;
  background: currentColor;
  opacity: .28;
  transform-origin: left center;
  will-change: transform;
}

/* Editorial: Título à esquerda, Statement à direita */
.presence-section__editorial {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(40px, 5vw, 96px);
  align-items: end;
}

.presence-section__title {
  margin: 0;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: var(--type-section);
  font-weight: var(--heading-weight);
  letter-spacing: var(--heading-tracking);
  line-height: var(--heading-leading);
  color: var(--foreground);
}

.presence-section__title-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.04em;
}

.presence-section__title-line {
  display: block;
  will-change: transform, opacity;
}

.presence-section__statement {
  align-self: end;
  margin: 0 0 0 auto;
  max-width: 27ch;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: var(--type-lead);
  font-weight: var(--lead-weight);
  letter-spacing: var(--lead-tracking);
  line-height: var(--lead-leading);
  color: #111111;
}

.presence-section__statement .magic-word {
  position: relative;
  display: inline-block;
}

.presence-section__statement .magic-word__base {
  display: inline-block;
  opacity: 0.20;
}

.presence-section__statement .magic-word__reveal {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  will-change: opacity;
  transition: none;
  user-select: none;
  -webkit-user-select: none;
}

/* =========================================
   CARDS GALLERY: Esteira Contínua e Infinita
   ========================================= */

.presence-gallery {
  position: relative;
  width: 100%;
  margin-top: clamp(48px, 5.5vw, 84px);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  touch-action: pan-y;
  -webkit-user-drag: none;
}

.presence-gallery.is-dragging {
  cursor: grabbing;
}

.presence-gallery__track {
  display: flex;
  align-items: stretch;
  width: max-content;
  will-change: transform;
}

.presence-gallery__group {
  display: flex;
  align-items: stretch;
  gap: clamp(16px, 1.4vw, 24px);
  padding-right: clamp(16px, 1.4vw, 24px);
  flex-shrink: 0;
}

/* Card Base — Reduzido ~22%, proporção 4/5 rigorosamente preservada */
.presence-card {
  position: relative;
  flex: 0 0 clamp(250px, 26.8vw, 475px);
  width: clamp(250px, 26.8vw, 475px);
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  isolation: isolate;
  background: #111111;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  will-change: transform, opacity;
}

/* Card Media: Full-bleed */
.presence-card__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
}

.presence-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.presence-card:hover .presence-card__media img {
  transform: scale(1.035);
}

/* Gradient Overlay focado na legibilidade superior, preservando a base limpa da imagem */
.presence-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.50) 30%,
      rgba(0, 0, 0, 0.18) 52%,
      rgba(0, 0, 0, 0) 70%
    );
  transition: opacity 300ms ease;
}

/* Conteúdo sobreposto */
.presence-card__content {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: clamp(20px, 2.0vw, 28px);
  box-sizing: border-box;
}

.presence-card__top {
  display: flex;
  flex-direction: column;
  padding-top: clamp(10px, 1.2vw, 16px);
}

/* Título e Descrição no terço superior */
.presence-card__title {
  margin: 0;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: var(--type-content-title);
  font-weight: var(--content-weight);
  letter-spacing: var(--content-tracking);
  line-height: var(--content-leading);
  color: #ffffff;
}

.presence-card__description {
  margin: 14px 0 0;
  font-size: var(--type-body);
  font-weight: var(--body-weight);
  letter-spacing: var(--body-tracking);
  line-height: var(--body-leading);
  color: rgba(255, 255, 255, 0.78);
  max-width: 28ch;
}

/* Responsividade */
@media (max-width: 1024px) {
  .presence-section__editorial {
    gap: 40px;
  }
  .presence-section__statement {
    margin-top: clamp(24px, 4vw, 48px);
    max-width: 32ch;
  }
  .presence-card {
    flex: 0 0 clamp(240px, 42vw, 360px);
    width: clamp(240px, 42vw, 360px);
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 720px) {
  .presence-section {
    padding-top: clamp(64px, 11vw, 96px);
    padding-bottom: clamp(40px, 6vw, 56px);
  }
  .presence-section__eyebrow {
    margin-bottom: 28px;
  }
  .presence-section__editorial {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .presence-section__statement {
    align-self: auto;
    margin: 24px 0 0 0;
    max-width: 100%;
  }
  .presence-gallery {
    margin-top: 36px;
  }
  .presence-card {
    flex: 0 0 clamp(240px, 68vw, 320px);
    width: clamp(240px, 68vw, 320px);
    height: auto;
    aspect-ratio: 4 / 5;
  }
  .presence-card__content {
    padding: 18px 16px;
  }
}

@media (max-width: 520px) {
  .presence-card {
    flex: 0 0 clamp(230px, 72vw, 290px);
    width: clamp(230px, 72vw, 290px);
  }
  .presence-card__content {
    padding: 16px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .presence-section {
    --lighthouse-transition-progress: 1;
  }
  .presence-section__title-mask {
    overflow: visible;
  }
  .presence-section__eyebrow,
  .presence-section__eyebrow-rule,
  .presence-section__title-line,
  .presence-section__statement,
  .presence-card {
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
  }
  .presence-card__media img {
    transition: none !important;
  }
  .presence-section__statement .magic-word__reveal {
    opacity: 1 !important;
  }
  .presence-gallery__track {
    animation: none !important;
  }
  .presence-gallery__group[aria-hidden="true"] {
    display: none !important;
  }
}
