/* ═══════════ 9 · PRELOADER ═══════════ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .8s ease, visibility .8s
}

#preloader.done {
  opacity: 0;
  visibility: hidden
}

.pre-inner {
  text-align: center;
  width: min(320px, 72vw)
}

.pre-logo {
  margin-bottom: 2rem;
  justify-content: center
}

.pre-logo .logo-img {
  height: 34px
}

.pre-bar {
  height: 1px;
  background: #2a2a30;
  overflow: hidden
}

.pre-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--brand);
  transition: width .2s ease
}

.pre-label {
  margin-top: 1rem;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--white-dim)
}

/* ═══════════ 1 · SCROLL STAGE (hero) ═══════════ */
#scrollStage {
  /* Eram 460vh: a altura servia de pista de rolagem para o scrub dos 120
     quadros em canvas. Com o vídeo em loop não há percurso a percorrer, e o
     hero passa a ocupar uma tela — que era a queixa do cliente sobre o tempo
     de rolagem até chegar ao conteúdo. */
  height: 100vh;
  position: relative;
  padding: 0
}

.stage-sticky {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background-color: var(--black);
  background-image: url('../../../assets/hero-bg.jpeg');
  background-size: cover;
  background-position: center 29%;
  background-repeat: no-repeat;
}

.stage-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Era rgba(0,0,0,.6) uniforme, que fazia sentido para escurecer um vídeo.
     Sobre a malha — que já nasce num fundo quase preto — aquilo apagava o
     efeito. Agora escurece só o centro, onde o texto está, e deixa as bordas
     livres para a malha aparecer. */
  background: radial-gradient(ellipse at center,
      rgba(0, 0, 0, .72) 0%,
      rgba(0, 0, 0, .55) 45%,
      rgba(0, 0, 0, .18) 100%);
  z-index: 1;
}

.stage-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
  pointer-events: none;
  opacity: 1;
  z-index: 2;
}

.stage-text h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 1.05;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .7);
  /* .stage-text é flex-column com align-items:center, então este item
     "encolhe até o conteúdo" em vez de esticar — sem max-width ele calcula
     a largura como se não fosse quebrar linha nenhuma. Passava despercebido
     com texto simples, mas o split em <span> por caractere (para o teste do
     blob reveal) expôs isso: o título vazava pra fora da tela no mobile. */
  max-width: 100%;
  /* Âncora para o blob de revelação (posicionado em position:absolute
     por JS) — ver "TESTE: blob reveal do H1" no main.js. */
  position: relative;
}

/* ═══ TESTE: blob reveal do H1 (protótipo, ver main.js) ═══
   Cada caractere nasce borrado/deslocado e o JS alterna esta classe
   conforme o blob "passa" por cima dele. Fica dentro do <em> também,
   herdando a cor laranja normalmente — nenhuma cor é definida aqui. */
.hero-reveal-word {
  /* Sem isto, o navegador trata cada <span> de letra como um ponto de
     quebra de linha válido (mesmo sem espaço entre eles), e as palavras
     quebravam no meio ("res" numa linha, "ultados" na seguinte). Agrupar
     as letras aqui dentro faz a palavra inteira andar junto — ou cabe na
     linha, ou desce inteira para a próxima. */
  display: inline-block;
}

.hero-reveal-char {
  display: inline-block;
  opacity: 0;
  filter: blur(14px);
  transform: translateY(16px);
  transition:
    opacity .5s cubic-bezier(.215, .61, .355, 1),
    filter .5s cubic-bezier(.215, .61, .355, 1),
    transform .5s cubic-bezier(.215, .61, .355, 1);
}

.hero-reveal-char.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.hero-reveal-blob {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 26px rgba(254, 80, 0, .65);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  will-change: transform, width, height;
}

.hero-reveal-blob.is-active {
  opacity: 1;
}

.stage-text h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.08;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .7)
}

.stage-text .lead {
  margin-top: 1.6rem;
  color: var(--white);
  font-size: clamp(.9rem, 1.4vw, 1.1rem);
  letter-spacing: .05em;
  max-width: 42rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.84), 0 0 12px rgba(0, 0, 0, 0.5);
}

@keyframes hint {
  to {
    top: 110%;
  }
}

.stage-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, #ffe6c2 0%, var(--amber) 34%, rgba(7, 7, 8, 0) 74%);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ── 12.2 Íris de diafragma — transição do hero para Serviços ── */
#scrollStage+#servicos {
  --iris-k: 1;
  isolation: isolate;
}

#scrollStage+#servicos::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle calc(var(--iris-k) * 78vh) at 50% calc(58vh - 100%),
      rgba(255, 214, 170, calc(.20 * (1 - var(--iris-k)) + .05)) 0%,
      rgba(254, 80, 0, calc(.16 * (1 - var(--iris-k)) + .04)) 42%,
      rgba(7, 7, 8, 0) 72%);
  opacity: calc(.35 + .65 * (1 - var(--iris-k)));
  transition: none;
}

#scrollStage+#servicos>* {
  position: relative;
  z-index: 1;
}

.hero-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1.5rem;
  stroke: var(--brand);
}