/* ===== Reset básico ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root {
  /* aproximação de spring (bounce:0) do Framer Motion original: ease-out crítico, sem overshoot */
  --ifx-ease-spring: cubic-bezier(.16,1,.3,1);
  /* ease exato do tween do wordmark no site original */
  --ifx-ease-tween: cubic-bezier(.74,.03,.44,.95);
  /* quanto a grade entra "estourada" no início do zoom-out (maior = descida mais longa/suave) */
  --ifx-zoom-start: 1.8;
  /* duração do zoom-out da grade — todo o resto da entrada do hero deriva desse tempo */
  --ifx-zoom-duration: 2.4s;
}
body {
  background: #000;
  color: #fff;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; }
img, video { max-width: 100%; display: block; }

/* ===== Fontes ===== */
@font-face {
  font-family: 'Frastha';
  src: url('../fonts/Frastha-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Patung';
  src: url('../fonts/Patung-Regular.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===== Tela de intro (loader) ===== */
.ifx-loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .5s ease;
}
.ifx-loader.ifx-loader-done {
  opacity: 0;
  pointer-events: none;
}
.ifx-loader-slogan {
  color: #f2f2f2;
  font-size: 22px;
  letter-spacing: .04em;
  text-align: center;
  max-width: min(560px, calc(100vw - 48px));
  font-family: 'Frastha', -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
}
/* efeito "sendo escrito": cada caractere nasce borrado/invisível e revela em cascata
   (delay por caractere é setado inline via JS, ver js/main.js) */
.ifx-loader-char {
  display: inline-block;
  white-space: pre;
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.4);
  transition: opacity .5s ease, filter .5s ease, transform .5s ease;
}
.ifx-loader-char.ifx-loader-char-in {
  opacity: 1;
  filter: blur(0);
  transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
  .ifx-loader-char { opacity: 1; filter: blur(0); transform: none; transition: none; }
}
.ifx-loader-logo {
  position: absolute;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
}
.ifx-loader-logo img { width: 200px; height: auto; }

/* ===== Header ===== */
.ifx-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  width: min(420px, calc(100vw - 24px));
  background: rgba(11,11,12,.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 30px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: border-radius .45s cubic-bezier(.4,0,.2,1), opacity .4s ease;
}
.ifx-header.ifx-visible { opacity: 1; pointer-events: auto; }
.ifx-header.is-open { border-radius: 28px; }
.ifx-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 8px;
}
.ifx-logo {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: linear-gradient(145deg,rgba(255,255,255,.1),rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.1);
  text-decoration: none;
}
.ifx-logo img { width: 22px; height: 22px; }
.ifx-toggle {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer; padding: 0; position: relative;
  transition: background .2s ease;
}
.ifx-toggle:hover { background: rgba(255,255,255,.12); }
.ifx-toggle .bar {
  width: 18px; height: 2px; border-radius: 2px; background: #f2f2f2;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.ifx-header.is-open .ifx-toggle .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ifx-header.is-open .ifx-toggle .bar:nth-child(2) { opacity: 0; }
.ifx-header.is-open .ifx-toggle .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.ifx-menu {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
  padding: 0 22px;
  opacity: 0; max-height: 0; overflow: hidden;
  transition: opacity .3s ease, max-height .45s cubic-bezier(.4,0,.2,1), padding .45s cubic-bezier(.4,0,.2,1);
}
.ifx-header.is-open .ifx-menu { opacity: 1; max-height: 320px; padding: 4px 22px 26px; }
.ifx-menu-col h3 {
  margin: 0 0 10px; color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .01em;
}
.ifx-menu-col { display: flex; flex-direction: column; }
.ifx-menu-col a {
  color: #9a9a9e; text-decoration: none; font-size: 13px; line-height: 1.9;
  transition: color .15s ease; white-space: nowrap;
}
.ifx-menu-col a:hover { color: #fff; }

@media (max-width: 480px) {
  .ifx-header { width: calc(100vw - 48px); }
  .ifx-menu { grid-template-columns: repeat(3, 1fr); gap: 16px 10px; padding: 0 16px; }
  .ifx-header.is-open .ifx-menu { padding: 4px 16px 22px; }
  .ifx-menu-col h3, .ifx-menu-col a { font-size: 12px; }
}

/* ===== Hero ===== */
.ifx-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  padding: 120px 0 60px;
  background: #000;
}
.ifx-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% center;
  transform: scale(1.35);
  transform-origin: center;
  z-index: 0;
  /* trechos do vídeo são mais claros/acinzentados que o preto da seção — reduzir brilho/
     contraste aqui puxa esses trechos pra mais perto do preto, sem isso o gradiente de saída
     ainda deixava um "degrau" de luminância nítido nas áreas cinzas */
  filter: brightness(.82) contrast(1.05) saturate(.9);
  /* funde o vídeo com o preto sólido do próprio .ifx-hero (mesma cor de fundo da
     seção "Quem Somos" logo abaixo) — o vídeo desaparece antes da borda da section,
     então não sobra costura nítida entre as duas */
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 62%, transparent 100%);
}
/* escurecimento progressivo por cima do vídeo, começando bem antes da máscara de saída —
   puxa qualquer trecho cinza/claro em direção ao preto de forma gradual, em vez de deixar
   o corte de opacidade da mask fazer esse trabalho sozinho na costura final */
.ifx-hero-video-fade {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0) 25%,
    rgba(0,0,0,.35) 50%,
    rgba(0,0,0,.7) 68%,
    #000 85%
  );
  pointer-events: none;
}
.ifx-hero-noise {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background-image: url('../assets/noise.jpg');
  background-repeat: repeat;
  opacity: .15;
  mix-blend-mode: overlay;
  transform: scale(1.2);
  z-index: 1;
  pointer-events: none;
}
.ifx-hero-copyright {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* sem z-index: precisa ficar no mesmo contexto de empilhamento do vídeo pra o
   mix-blend-mode do headline conseguir "ler" o vídeo por baixo */
.ifx-hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}

/* wrapper que faz o "zoom-out" de entrada: services + caixa do headline entram estourados
   (--ifx-zoom-start) e recolhem pra scale(1) — dá a impressão de a grade vir esticada e se
   reposicionar; zoom inicial maior + duração longa = descida mais suave */
/* transform cria um novo contexto de empilhamento — por isso o mix-blend-mode
   pra "ler" o vídeo por baixo tem que ficar aqui (no elemento que já cria esse
   contexto), e não num descendente: um mix-blend-mode dentro de um contexto
   isolado só mistura com o que está DENTRO desse contexto, nunca com o vídeo
   lá fora. Com o blend aqui, todo o grupo (services + grid + headline) é
   composto junto e só então misturado com o vídeo por baixo, como uma unidade. */
.ifx-hero-scale {
  margin-top: clamp(24px, 6vh, 72px);
  transform: scale(var(--ifx-zoom-start));
  transition: transform var(--ifx-zoom-duration) var(--ifx-ease-spring);
  mix-blend-mode: difference;
}
.ifx-hero.ifx-hero-in .ifx-hero-scale { transform: scale(1); }

/* ---- bloco com grade decorativa (headline) ---- */
.ifx-hero-grid {
  position: relative;
  margin: 0 8% 0 8%;
  padding: 3px 0 29px;
}

/* linhas horizontais (topo/base da caixa): NÃO são infinitas — largura sempre igual à da
   caixa (mesma referência dos quadrados de canto), então terminam exatamente em cima do
   quadrado branco em ambas as pontas, o tempo todo (inclusive durante o zoom-out, que já
   escala a caixa inteira via .ifx-hero-scale) */
.ifx-hero-grid::before,
.ifx-hero-grid::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,.22);
}
.ifx-hero-grid::before { top: 0; }
.ifx-hero-grid::after { bottom: 0; }

/* ===== Grid vertical do site inteiro =====
   Antes eram 4 linhas presas dentro do hero (com fade no fim da seção). Agora são
   um overlay fixo à viewport — filho direto do <body>, não do .ifx-hero — que
   atravessa o site inteiro sem nunca desaparecer, demarcando as mesmas 3 colunas
   (esquerda/centro/direita) que outras seções usam pra alinhar conteúdo, como a
   "Serviços" (ver .ifx-services-columns em css/services-section.css). Mantém o
   mesmo "zoom-out" de entrada do hero, disparado pela classe no <body> (ver main.js). */
.ifx-site-grid {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  transform: scaleX(var(--ifx-zoom-start));
  transition: transform var(--ifx-zoom-duration) var(--ifx-ease-spring);
}
body.ifx-hero-in .ifx-site-grid { transform: scaleX(1); }

.ifx-site-grid-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  /* bem mais discreta que a linha "grande" usada só dentro do hero — aqui é um
     traço de fundo que marca a estrutura, não um elemento de destaque */
  background: rgba(255,255,255,.07);
}
.ifx-site-grid-line--v0 { left: 8%; }
.ifx-site-grid-line--v1 { left: 36%; }
.ifx-site-grid-line--v2 { left: 64%; }
.ifx-site-grid-line--v3 { left: 92%; }

/* quadrados sólidos: só nos 4 cantos da caixa do IRONFOX (linhas externas) —
   só aparecem depois que a grade termina o zoom-out e volta à posição final */
.ifx-hero-grid-dot {
  position: absolute;
  width: 5px; height: 5px;
  background: rgba(255,255,255,.85);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity .5s ease var(--ifx-zoom-duration);
  transform: translate(-50%, -50%);
}
.ifx-hero.ifx-hero-in .ifx-hero-grid-dot { opacity: 1; }
.ifx-hero-grid-dot--tl { top: 0; left: 0; }
.ifx-hero-grid-dot--tr { top: 0; left: 100%; }
.ifx-hero-grid-dot--bl { top: 100%; left: 0; }
.ifx-hero-grid-dot--br { top: 100%; left: 100%; }

/* lista de serviços — cada item começa no início da sua coluna do grid (mesmas colunas das linhas verticais) */
.ifx-hero-services {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 8% 10px 8%;
  padding: 0;
  list-style: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
}
.ifx-hero-services li {
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 1.3s var(--ifx-ease-spring), transform 1.3s var(--ifx-ease-spring);
}
.ifx-hero.ifx-hero-in .ifx-hero-services li { opacity: 1; transform: translateY(0); }
.ifx-hero-services li:nth-child(1) { transition-delay: 1s; }
.ifx-hero-services li:nth-child(2) { transition-delay: 1.1s; }
.ifx-hero-services li:nth-child(3) { transition-delay: 1.3s; }
.ifx-hero-services li span { color: rgba(255,255,255,.35); margin-right: 6px; }

/* wrapper só do fade-in do wordmark — fica de fora do que o PowerGlitch mexe no <h1>
   (mix-blend-mode pra ler o vídeo por baixo fica em .ifx-hero-scale, ver acima) */
.ifx-hero-headline-wrap {
  opacity: 0;
  transition: opacity 1.6s var(--ifx-ease-tween);
  transition-delay: .3s;
}
.ifx-hero.ifx-hero-in .ifx-hero-headline-wrap { opacity: 1; }

/* headline com glitch periódico (PowerGlitch cuida da animação via JS) */
.ifx-hero-headline {
  position: relative;
  z-index: 1;
  margin: 30px 0 0;
  text-align: center;
  font-family: 'Frastha', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  font-size: clamp(100px, 27vw, 560px);
  line-height: .82;
  letter-spacing: -0.01em;
  color: #fff;
  text-transform: uppercase;
}

/* ---- rodapé do hero (descrição + cta) ---- */
/* contido só na coluna central do grid (entre a 2ª e a 3ª linha vertical) */
.ifx-hero-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  margin: 40px 36% 0 36%;
}

.ifx-hero-desc {
  margin: 0;
  max-width: 560px;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255,255,255,.9);
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1.3s var(--ifx-ease-spring), transform 1.3s var(--ifx-ease-spring);
  transition-delay: .5s;
}
.ifx-hero.ifx-hero-in .ifx-hero-desc { opacity: 1; transform: translateY(0); }

.ifx-hero-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
  background: #13100F;
  color: #E9E8E2;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(60px);
  transition: background .2s ease, opacity 1.3s var(--ifx-ease-spring) .65s, transform 1.3s var(--ifx-ease-spring) .65s;
}
.ifx-hero.ifx-hero-in .ifx-hero-cta { opacity: 1; transform: translateY(0); }
.ifx-hero-cta:hover { background: #630102; }
.ifx-hero-cta .plus {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  line-height: 1;
  transition: transform .5s ease;
}
.ifx-hero-cta:hover .plus { transform: translateY(-50%) rotate(360deg); }

@media (max-width: 700px) {
  /* sem min-height fixo: a seção acompanha a altura do conteúdo em vez de
     forçar 100svh e sobrar espaço vazio abaixo do botão em telas estreitas */
  .ifx-hero { min-height: auto; padding: 130px 0 32px; }
  .ifx-hero-scale { margin-top: clamp(12px, 3vh, 32px); }
  .ifx-hero-grid { padding: 14px 20px 20px; }
  .ifx-hero-services { font-size: 10px; }
  .ifx-hero-grid-dot { display: none; }
  /* a palavra é uma só (sem espaço pra quebrar linha), então o clamp desktop
     baseado em vw não considera o padding extra da .ifx-hero-grid aqui em cima
     e a "IRONFOX" vaza pra fora da grid — recalibrado pra sempre caber */
  .ifx-hero-headline { font-size: clamp(56px, 22vw, 180px); }
  /* na tela estreita, a coluna central some — volta pra largura do grid inteiro */
  .ifx-hero-bottom { margin: 40px 8% 0 8%; }
}

/* ===== Blur progressivo no rodapé da tela =====
   Fixo na base do viewport o tempo todo (não é de uma seção específica) — "esconde"
   o conteúdo que passa por baixo dele com um blur que aumenta gradualmente de cima
   pra baixo. 8 camadas empilhadas, cada uma com blur maior e mascarada numa faixa
   horizontal progressiva — evita a borda "dura" que um único blur com máscara teria. */
.ifx-bottom-blur {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 120px;
  z-index: 40;
  pointer-events: none;
}
.ifx-bottom-blur span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.ifx-bottom-blur span:nth-child(1) {
  backdrop-filter: blur(.3px) saturate(120%);
  -webkit-backdrop-filter: blur(.3px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 0%, black 8.75%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 0%, black 8.75%, black 100%);
}
.ifx-bottom-blur span:nth-child(2) {
  backdrop-filter: blur(1.3px) saturate(120%);
  -webkit-backdrop-filter: blur(1.3px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 8.75%, black 17.5%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 8.75%, black 17.5%, black 100%);
}
.ifx-bottom-blur span:nth-child(3) {
  backdrop-filter: blur(2.8px) saturate(120%);
  -webkit-backdrop-filter: blur(2.8px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 17.5%, black 26.25%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 17.5%, black 26.25%, black 100%);
}
.ifx-bottom-blur span:nth-child(4) {
  backdrop-filter: blur(5px) saturate(120%);
  -webkit-backdrop-filter: blur(5px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 26.25%, black 35%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 26.25%, black 35%, black 100%);
}
.ifx-bottom-blur span:nth-child(5) {
  backdrop-filter: blur(7.8px) saturate(120%);
  -webkit-backdrop-filter: blur(7.8px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 35%, black 43.75%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 35%, black 43.75%, black 100%);
}
.ifx-bottom-blur span:nth-child(6) {
  backdrop-filter: blur(11.3px) saturate(120%);
  -webkit-backdrop-filter: blur(11.3px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 43.75%, black 52.5%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 43.75%, black 52.5%, black 100%);
}
.ifx-bottom-blur span:nth-child(7) {
  backdrop-filter: blur(15.3px) saturate(120%);
  -webkit-backdrop-filter: blur(15.3px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 52.5%, black 61.25%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 52.5%, black 61.25%, black 100%);
}
.ifx-bottom-blur span:nth-child(8) {
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  mask-image: linear-gradient(to bottom, transparent 0%, transparent 61.25%, black 70%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, transparent 61.25%, black 70%, black 100%);
}
@media (max-width: 700px) {
  .ifx-bottom-blur { height: 80px; }
}
