/* ============================================================
   LAR — Hero quebra-cabeça com scroll (GSAP + Lenis)
   ============================================================ */

:root {
  --A: 1.79;                 /* aspect-ratio da composição (3x2). Recalculado em JS */
  --bg: #0d0d0f;
  --fg: #f4f2ee;
  --muted: rgba(244, 242, 238, 0.55);
  --line: rgba(244, 242, 238, 0.18);
  --logo: url("../image-web/logo-branca.png");
  --accent: #033C45;
}

/* ---------- Barra de rolagem ---------- */
html {
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: #06525e; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { background: var(--bg); color: var(--fg); }

body {
  font-family: "Inter", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---------- HERO (pinada) ---------- */
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* Stage: mantém o aspect-ratio da composição e COBRE a viewport (cover).
   Assim as 6 peças nunca abrem fenda, em qualquer proporção de tela. */
.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max(100vw, calc(100vh * var(--A)));
  height: max(100vh, calc(100vw / var(--A)));
  will-change: transform;
}

/* Cada projeto é uma camada empilhada = grade 3x2 */
.layer {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0;
}

.tile {
  position: relative;
  overflow: hidden;
  will-change: opacity, transform;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* margem negativa mínima elimina hairline entre células no sub-pixel */
  transform: scale(1.003);
}

/* ---------- Overlay preto + scrim de legibilidade ----------
   Camada 1: tint preto uniforme em TODAS as imagens (contraste da logo).
   Camadas 2/3: reforço embaixo/topo pra HUD e logo. */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background:
    linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.22)),
    linear-gradient(to top, rgba(8, 8, 10, 0.55) 0%, rgba(8, 8, 10, 0.2) 24%, rgba(8, 8, 10, 0) 46%),
    linear-gradient(to bottom, rgba(8, 8, 10, 0.4) 0%, rgba(8, 8, 10, 0) 24%);
}

/* ---------- Logo (topo centralizado) ---------- */
.hero__logo {
  position: absolute;
  top: clamp(20px, 3vw, 40px);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(52px, 5.5vw, 84px);
  height: auto;
  z-index: 55;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.35));
}

/* ---------- HUD ---------- */
.hud {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  padding: clamp(20px, 3.5vw, 48px);
}

.hud__caption {
  position: absolute;
  left: clamp(20px, 3.5vw, 48px);
  bottom: clamp(72px, 9vw, 120px);
  height: clamp(48px, 7vw, 92px);
}
.caption {
  position: absolute;
  left: 0;
  bottom: 0;
  white-space: nowrap;
}
.caption__kicker {
  display: block;
  font-size: clamp(10px, 0.9vw, 12px);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.caption__title {
  font-size: clamp(28px, 5vw, 72px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.hud__progress {
  position: absolute;
  right: clamp(20px, 3.5vw, 48px);
  bottom: clamp(24px, 3.5vw, 48px);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}
.hud__progress-track {
  width: clamp(90px, 12vw, 180px);
  height: 1px;
  background: var(--line);
  position: relative;
}
.hud__progress-track i {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0%;
  background: var(--fg);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 3vw, 40px);
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-hint__mouse {
  width: 22px;
  height: 34px;
  border: 1.5px solid var(--muted);
  border-radius: 12px;
  position: relative;
}
.scroll-hint__mouse::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 7px;
  width: 3px;
  height: 6px;
  border-radius: 2px;
  background: var(--fg);
  transform: translateX(-50%);
  animation: mouseDot 1.7s ease-in-out infinite;
}
@keyframes mouseDot {
  0%   { opacity: 0; transform: translate(-50%, 0); }
  25%  { opacity: 1; }
  60%  { opacity: 1; transform: translate(-50%, 9px); }
  100% { opacity: 0; transform: translate(-50%, 11px); }
}

.scroll-space { width: 100%; }

/* ---------- CONTATO (última tela DENTRO da hero) ---------- */
.contact {
  position: absolute;
  inset: 0;
  z-index: 70;                 /* cobre imagens, logo e HUD */
  background: #000;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(32px, 6vw, 80px);
  opacity: 0;                  /* controlado pela timeline (scrub) */
  pointer-events: none;       /* liberado só quando visível */
}
.contact__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vw, 34px);
}
.contact__kicker {
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact__title {
  font-size: clamp(44px, 9vw, 128px);
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 0.95;
}
.contact__icons {
  display: flex;
  gap: clamp(14px, 2vw, 22px);
  margin-top: clamp(6px, 1.5vw, 14px);
}

/* Botão de ícone: quadrado, borda, SEM fundo. Fundo só no hover. */
.icon-btn {
  --size: clamp(60px, 8vw, 84px);
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0;                 /* quadrado */
  color: var(--fg);
  background: transparent;
  transition: background-color 0.35s ease, color 0.35s ease,
              border-color 0.35s ease, transform 0.35s ease;
}
.icon-btn svg {
  width: 42%;
  height: 42%;
  display: block;
}
.icon-btn:hover,
.icon-btn:focus-visible {
  background: var(--accent);        /* fundo #033C45 no hover (todos os ícones) */
  color: #fff;                      /* ícone branco sobre o verde-petróleo */
  border-color: var(--accent);
  transform: translateY(-4px);
  outline: none;
}
.contact__foot {
  margin-top: clamp(18px, 3vw, 40px);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.loader__logo {
  position: relative;
  width: clamp(150px, 18vw, 240px);
  aspect-ratio: 556 / 526;
}
.loader__layer {
  position: absolute;
  inset: 0;
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
}
.loader__ghost { background: rgba(244, 242, 238, 0.13); }  /* logo "fantasma" */
.loader__fill  { background: var(--fg); }                   /* preenchimento */

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint__mouse::after { animation: none; }
}

/* ---------- Ajustes mobile ---------- */
@media (max-width: 680px) {
  /* Paginação centralizada na base (não mais no canto) */
  .hud__progress {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 20px;
    gap: 10px;
  }
  .hud__progress-track { width: 34vw; }

  /* Dica acima da paginação, sem mouse (no touch é "deslizar") */
  .scroll-hint {
    bottom: 58px;
    font-size: 9px;
    letter-spacing: 0.26em;
    gap: 0;
  }
  .scroll-hint__mouse { display: none; }
}
