/* =====================================================================
   home-fx.css — camada de efeitos avançados da home institucional.
   Carregado APENAS pelo index.html, DEPOIS de home.css (sobrepõe quando
   preciso). Não altera home.css/main.js. Tudo respeita prefers-reduced-motion.
   ===================================================================== */

/* ---------- 0. Barra de progresso de leitura ---------- */
.fx-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  z-index: 200;
  background: linear-gradient(90deg, var(--portal-green), var(--portal-gold), var(--portal-accent));
  box-shadow: 0 0 12px rgba(192, 137, 42, 0.5);
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ---------- 1. Hero imersivo (aurora + orbes) ---------- */
.portal-hero { position: relative; overflow: hidden; isolation: isolate; }
.hero-grid { position: relative; z-index: 2; }

.fx-aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 140%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(42% 55% at 18% 22%, rgba(46, 125, 70, 0.16), transparent 70%),
    radial-gradient(38% 50% at 82% 30%, rgba(192, 137, 42, 0.14), transparent 72%),
    radial-gradient(46% 60% at 60% 88%, rgba(192, 82, 106, 0.12), transparent 70%);
  animation: fx-aurora-drift 22s ease-in-out infinite alternate;
}
.fx-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.fx-orb.o1 { width: 320px; height: 320px; top: -60px; left: -40px; background: radial-gradient(circle at 30% 30%, #9fce9f, transparent 70%); animation: fx-float-a 18s ease-in-out infinite; }
.fx-orb.o2 { width: 260px; height: 260px; bottom: -80px; right: -30px; background: radial-gradient(circle at 40% 40%, #edc98a, transparent 70%); animation: fx-float-b 21s ease-in-out infinite; }
.fx-orb.o3 { width: 180px; height: 180px; top: 40%; right: 22%; background: radial-gradient(circle at 40% 40%, #eaa9b6, transparent 70%); animation: fx-float-a 16s ease-in-out infinite reverse; }

@keyframes fx-aurora-drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(0,-3%,0) scale(1.08); }
}
@keyframes fx-float-a {
  0%,100% { transform: translate3d(0,0,0); }
  50%     { transform: translate3d(24px,-30px,0); }
}
@keyframes fx-float-b {
  0%,100% { transform: translate3d(0,0,0); }
  50%     { transform: translate3d(-28px,24px,0); }
}

/* Logo do hero com respiração e brilho ao passar o mouse */
.hero-photo.logo-showcase { transition: box-shadow 0.5s ease, transform 0.5s ease; }
.hero-photo.logo-showcase img { animation: fx-breathe 7s ease-in-out infinite; }
.hero-visual:hover .hero-photo.logo-showcase {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7), 0 34px 80px rgba(31, 77, 46, 0.16);
}
@keyframes fx-breathe {
  0%,100% { transform: scale(1.05); }
  50%     { transform: scale(1.09); }
}

/* Entrada encenada do conteúdo do hero (load stagger) */
.portal-hero .hero-copy > * { opacity: 0; transform: translateY(22px); animation: fx-rise 0.9s cubic-bezier(.16,.84,.44,1) forwards; }
.portal-hero .hero-copy > .kicker      { animation-delay: 0.05s; }
.portal-hero .hero-copy > h1           { animation-delay: 0.16s; }
.portal-hero .hero-copy > .hero-lead   { animation-delay: 0.30s; }
.portal-hero .hero-copy > .hero-note   { animation-delay: 0.42s; }
.portal-hero .hero-copy > .hero-actions{ animation-delay: 0.54s; }
.portal-hero .hero-visual { opacity: 0; transform: translateY(30px) scale(.98); animation: fx-rise 1s cubic-bezier(.16,.84,.44,1) 0.4s forwards; }
@keyframes fx-rise { to { opacity: 1; transform: none; } }

/* Título com sublinhado animado (desenho ao revelar) */
.hero-copy h1 { position: relative; }

/* ---------- 2. Revelações no scroll — mais ricas + com stagger ---------- */
/* Sobrepõe o .reveal simples do home.css: acrescenta leve escala e desfoque. */
.reveal {
  opacity: 0;
  transform: translateY(30px) scale(0.985);
  filter: blur(4px);
  transition: opacity 0.7s cubic-bezier(.16,.84,.44,1), transform 0.7s cubic-bezier(.16,.84,.44,1), filter 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: none; filter: none; }
/* Variantes direcionais (via data-fx no HTML) */
.reveal[data-fx="left"]  { transform: translateX(-38px); }
.reveal[data-fx="right"] { transform: translateX(38px); }
.reveal[data-fx="zoom"]  { transform: scale(0.9); }
.reveal[data-fx="left"].is-visible,
.reveal[data-fx="right"].is-visible,
.reveal[data-fx="zoom"].is-visible { transform: none; }

/* Cards que sobem em cascata dentro de um grid revelado */
.fx-stagger.is-visible > * { animation: fx-rise 0.7s cubic-bezier(.16,.84,.44,1) both; }
.fx-stagger.is-visible > *:nth-child(1) { animation-delay: 0.04s; }
.fx-stagger.is-visible > *:nth-child(2) { animation-delay: 0.12s; }
.fx-stagger.is-visible > *:nth-child(3) { animation-delay: 0.20s; }
.fx-stagger.is-visible > *:nth-child(4) { animation-delay: 0.28s; }
.fx-stagger.is-visible > *:nth-child(5) { animation-delay: 0.36s; }
.fx-stagger.is-visible > *:nth-child(6) { animation-delay: 0.44s; }

/* ---------- 3. Cards: brilho (sheen) e imagem com zoom ---------- */
.focus-card, .news-card { position: relative; overflow: hidden; }
.focus-card::after, .news-card::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.45), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s ease;
  pointer-events: none;
}
.focus-card:hover::after, .news-card:hover::after { left: 130%; }
.focus-card span {
  display: inline-block;
  font-size: 34px;
  line-height: 1;
  opacity: 0.55;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.focus-card:hover span { transform: translateY(-2px) scale(1.12); opacity: 1; }
.news-card:hover .news-image { transform: scale(1.06); }
.news-image { transition: transform 0.6s cubic-bezier(.2,.7,.3,1); }

/* Botões com leve elevação luminosa */
.portal-button-lg { position: relative; overflow: hidden; }
.portal-button-lg::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120px 60px at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.25), transparent 60%);
  opacity: 0; transition: opacity 0.3s ease;
}
.portal-button-lg:hover::before { opacity: 1; }

/* ---------- 4. Faixa de credibilidade (fatos reais/registro) ---------- */
.fx-facts {
  background:
    linear-gradient(rgba(15,46,28,0.92), rgba(15,46,28,0.92)),
    radial-gradient(60% 120% at 15% 0%, rgba(192,137,42,0.25), transparent 60%),
    radial-gradient(60% 120% at 85% 100%, rgba(192,82,106,0.22), transparent 60%),
    var(--portal-green-2);
  color: #e7eee8;
  border-top: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.fx-facts .portal-container { padding-block: clamp(48px, 7vw, 84px); }
.fx-facts .fx-facts-head { max-width: 640px; margin-bottom: 40px; }
.fx-facts .kicker { color: #e7a9b6; }
.fx-facts h2 { color: #fff; font-family: var(--portal-serif); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 0 0 14px; line-height: 1.1; }
.fx-facts .fx-facts-sub { color: #bccdc0; margin: 0; font-size: 15.5px; }
.fx-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 20px;
}
.fx-fact {
  padding: 26px 24px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.fx-fact:hover { transform: translateY(-5px); border-color: rgba(231,169,182,0.5); background: rgba(255,255,255,0.08); }
.fx-fact .fx-num {
  font-family: var(--portal-serif);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  color: #fff;
  line-height: 1;
  letter-spacing: -0.01em;
}
.fx-fact .fx-num small { font-size: 0.5em; color: #e7a9b6; margin-left: 2px; font-weight: 700; }
.fx-fact .fx-label { display: block; margin-top: 10px; color: #bccdc0; font-size: 13.5px; line-height: 1.45; }
.fx-fact .fx-tag {
  display: inline-block; margin-bottom: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #9fb4a4;
}

/* ---------- 5. Botão voltar ao topo ---------- */
.fx-top {
  position: fixed;
  right: clamp(16px, 3vw, 30px);
  bottom: clamp(16px, 3vw, 30px);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--portal-green);
  color: #fff;
  cursor: pointer;
  z-index: 120;
  opacity: 0;
  transform: translateY(16px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  box-shadow: 0 12px 30px rgba(15,46,28,0.28);
}
.fx-top.show { opacity: 1; transform: none; pointer-events: auto; }
.fx-top:hover { background: var(--portal-accent); transform: translateY(-2px); }

/* Divisor orgânico entre hero e conteúdo */
.fx-wave { display: block; width: 100%; height: 40px; margin-top: -1px; color: var(--portal-paper); }
.fx-wave svg { display: block; width: 100%; height: 100%; }

/* ---------- Acessibilidade: movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .fx-aurora, .fx-orb, .hero-photo.logo-showcase img,
  .portal-hero .hero-copy > *, .portal-hero .hero-visual,
  .fx-stagger.is-visible > * { animation: none !important; }
  .portal-hero .hero-copy > *, .portal-hero .hero-visual { opacity: 1; transform: none; }
  .reveal { filter: none; transform: none; transition: opacity 0.3s ease; }
  .focus-card::after, .news-card::after { display: none; }
  .fx-progress { transition: none; }
}
