/* =========================================================
   Felipe Mota Advocacia — efeitos e ajustes
   Efeitos inspirados na biblioteca naocodei.com/free-code
   ========================================================= */

:root {
  --accent: #FFB59D;
  --accent-strong: #C03C00;
  --surface: #121414;
  --outline: #44474A;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 80px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
html, body { overflow-x: clip; }

.material-symbols-outlined {
  display: inline-block; width: 1em; height: 1em; line-height: 1 !important;
  overflow: hidden; white-space: nowrap; direction: ltr; vertical-align: middle;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Barra de progresso ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; pointer-events: none; }
.scroll-progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Header ---------- */
#site-header { transition: background-color .3s, box-shadow .3s; }
.header-inner { transition: height .3s var(--ease-out); }
#site-header.is-scrolled { box-shadow: 0 10px 30px -15px rgba(0,0,0,.6); }
#site-header.is-scrolled .header-inner { height: 64px; }

.nav-link { position: relative; transition: color .15s; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease-out);
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav-link.is-active { color: var(--accent); }

/* Menu mobile com animação */
.mobile-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease-out); border-top-color: transparent; }
.mobile-drawer > nav { overflow: hidden; min-height: 0; padding-top: 0; padding-bottom: 0; transition: padding .35s var(--ease-out); }
.mobile-drawer.is-open { grid-template-rows: 1fr; border-top-color: var(--outline); }
.mobile-drawer.is-open > nav { padding-top: 24px; padding-bottom: 24px; }
@media (min-width: 1024px) { .mobile-drawer { display: none; } }

/* ---------- Cursor personalizado (desktop) ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none; border-radius: 50%; opacity: 0; transition: opacity .3s; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--accent); }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1px solid rgba(255,181,157,.6);
  transition: opacity .3s, width .3s var(--ease-out), height .3s var(--ease-out), margin .3s var(--ease-out), background-color .3s, border-color .3s;
}
html.has-cursor .cursor-dot, html.has-cursor .cursor-ring { opacity: 1; }
html.has-cursor.cursor-hover .cursor-ring {
  width: 64px; height: 64px; margin: -32px 0 0 -32px;
  background: rgba(255,181,157,.08); border-color: var(--accent);
}
html.has-cursor, html.has-cursor a, html.has-cursor button { cursor: none; }

/* ---------- Hero ---------- */
.hero { --mx: 70%; --my: 30%; }
.hero::before, .contact-box::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx) var(--my), rgba(255,181,157,.10), transparent 60%);
  transition: opacity .4s; z-index: 0;
}
.contact-box { --mx: 50%; --my: 50%; }

.hero-orb { position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; will-change: transform; }
.hero-orb--a { width: 420px; height: 420px; top: -120px; left: -140px; background: rgba(192,60,0,.28); }
.hero-orb--b { width: 360px; height: 360px; bottom: -160px; right: -80px; background: rgba(255,181,157,.12); }

.hero-outline-text {
  position: absolute; right: -2vw; top: 6%; pointer-events: none; user-select: none;
  font-size: clamp(140px, 26vw, 380px); line-height: 1; font-weight: 700;
  color: transparent; -webkit-text-stroke: 1px rgba(255,181,157,.08);
  will-change: transform;
}

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); position: relative; }
.pulse-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }

.scroll-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: 1px; height: 48px; overflow: hidden; }
.scroll-hint__line { display: block; width: 1px; height: 100%; background: linear-gradient(var(--accent), transparent); animation: scrollHint 2s var(--ease-out) infinite; }
@keyframes scrollHint { 0% { transform: translateY(-100%); } 100% { transform: translateY(100%); } }

/* ---------- Palavras alternadas ---------- */
.word-rotator { display: inline-flex; position: relative; overflow: hidden; vertical-align: bottom; height: 1.35em; font-style: italic; }
.word-rotator__item { display: inline-block; transition: transform .5s var(--ease-out), opacity .5s; white-space: nowrap; }
.word-rotator__item.is-out { transform: translateY(-110%); opacity: 0; }
.word-rotator__item.is-in-start { transform: translateY(110%); opacity: 0; transition: none; }

/* ---------- Revelações (apenas quando animações estão ativas) ---------- */
.anim [data-reveal] {
  opacity: 0; transform: translateY(32px);
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.anim [data-reveal].is-visible { opacity: 1; transform: none; }

/* Palavra por palavra */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w > span { display: inline-block; }
.anim [data-words] .w > span { transform: translateY(105%); transition: transform .9s var(--ease-out); transition-delay: calc(var(--wi) * 60ms + var(--d, 0s)); }
.anim [data-words].is-visible .w > span { transform: none; }

/* Máscara de revelação de imagem */
.anim [data-mask] { clip-path: inset(100% 0 0 0); transition: clip-path 1.3s var(--ease-out); }
.anim [data-mask].is-visible { clip-path: inset(0 0 0 0); }

/* Parallax interno nas imagens */
.parallax-img { transform: scale(1.18); will-change: transform; }

/* Avatar no contato */
.avatar-ring { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; padding: 2px; background: conic-gradient(from 0deg, var(--accent-strong), var(--accent), var(--accent-strong)); }
.avatar-ring img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 2px solid #1A1C1C; }
.avatar-ring::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border-radius: 50%; background: #25D366; border: 2px solid #1A1C1C; }

/* Moldura decorativa atrás do retrato */
.about-frame {
  position: absolute; inset: 24px -16px -24px 16px; border: 1px solid rgba(255,181,157,.35);
  border-radius: 6px; pointer-events: none; will-change: transform;
}
@media (min-width: 768px) { .about-frame { inset: 32px -28px -32px 28px; } }

/* Texto que se preenche ao rolar */
[data-fill] .fw { transition: color .25s, opacity .25s; }
.anim [data-fill] .fw { opacity: .18; }
.anim [data-fill] .fw.is-lit { opacity: 1; }
[data-fill] .fw.is-lit.accent { color: var(--accent); }

/* ---------- Números (odômetro) ---------- */
.stat { display: flex; flex-direction: column-reverse; gap: 6px; padding-left: 16px; border-left: 1px solid var(--outline); }
.stat dd { line-height: 1; }
.odo { display: inline-flex; overflow: hidden; height: 1em; line-height: 1; vertical-align: bottom; }
.odo-digit { display: inline-block; height: 1em; overflow: hidden; }
.odo-strip { display: flex; flex-direction: column; transition: transform 2s cubic-bezier(.16,1,.3,1); transition-delay: var(--od, 0s); }
.odo-strip > span { height: 1em; line-height: 1; display: block; text-align: center; }

/* ---------- Áreas: cards empilhados ---------- */
.stack { display: flex; flex-direction: column; gap: 24px; padding-bottom: 24px; }
.stack-card { position: sticky; top: calc(var(--header-h) + 16px + var(--i) * 18px); transform-origin: 50% 0; will-change: transform; }
.stack-card__inner {
  display: flex; flex-direction: column; gap: 16px;
  min-height: 320px; padding: 28px;
  background: linear-gradient(160deg, #222525 0%, #1A1C1C 60%);
  border: 1px solid var(--outline); border-radius: 8px;
  box-shadow: 0 -20px 40px -20px rgba(0,0,0,.7);
  transition: border-color .2s;
}
.stack-card:hover .stack-card__inner { border-color: var(--accent); }
.stack-card__num { font-size: 56px; line-height: .9; color: transparent; -webkit-text-stroke: 1px rgba(255,181,157,.45); }
@media (min-width: 768px) { .stack-card__inner { padding: 40px; min-height: 360px; } .stack-card__num { font-size: 80px; } }
@media (max-width: 767px) { .stack-card { top: calc(var(--header-h) + 8px + var(--i) * 12px); } }

.link-arrow .material-symbols-outlined { transition: transform .3s var(--ease-elastic); }
.link-arrow:hover .material-symbols-outlined { transform: translateX(6px); }

/* ---------- Botões elásticos / magnéticos ---------- */
.btn-elastic { position: relative; transition: transform .5s var(--ease-elastic), background-color .2s, color .2s, border-color .2s; will-change: transform; }
.btn-elastic:active { transform: scale(.94) !important; transition-duration: .1s; }
.btn-shine { overflow: hidden; isolation: isolate; }
.btn-shine::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-20deg); animation: shine 4s ease-in-out infinite;
}
@keyframes shine { 0%, 70% { left: -60%; } 100% { left: 130%; } }

/* ---------- Diferenciais ---------- */
#particles { opacity: .7; }
.feature {
  display: flex; flex-direction: column; gap: 10px; padding: 28px;
  background: rgba(26,28,28,.6); backdrop-filter: blur(6px);
  border: 1px solid var(--outline); border-radius: 8px;
  transition: border-color .25s, transform .4s var(--ease-out), opacity .9s var(--ease-out);
  transform-style: preserve-3d;
}
.feature:hover { border-color: var(--accent); }

/* ---------- Linha do tempo ---------- */
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 40px; display: flex; flex-direction: column; gap: 48px; }
.timeline__track { position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--outline); border-radius: 2px; overflow: hidden; }
.timeline__fill { display: block; width: 100%; height: 100%; background: linear-gradient(var(--accent), var(--accent-strong)); transform-origin: 50% 0; transform: scaleY(0); }
.timeline__step { position: relative; display: flex; flex-direction: column; gap: 8px; }
.timeline__dot {
  position: absolute; left: -40px; top: 0; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--outline);
  transition: border-color .4s, background-color .4s, box-shadow .4s, transform .5s var(--ease-elastic);
}
.timeline__step.is-active .timeline__dot { border-color: var(--accent); background: var(--accent-strong); box-shadow: 0 0 0 6px rgba(255,181,157,.12); transform: scale(1.1); }
@media (min-width: 768px) {
  .timeline { padding-left: 64px; gap: 64px; }
  .timeline__track { left: 15px; }
  .timeline__dot { left: -64px; width: 32px; height: 32px; }
}

/* ---------- Instagram ---------- */
.insta-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  background: #1E2020; border: 1px solid var(--outline); border-radius: 6px;
  transition: border-color .2s, transform .4s var(--ease-out), opacity .9s var(--ease-out);
  transform-style: preserve-3d;
}
.insta-card:hover { border-color: var(--accent); }
.insta-card img { transition: transform .8s var(--ease-out); }
.insta-card:hover img { transform: scale(1.06); }

/* ---------- Faixa rolante no rodapé ---------- */
.marquee { overflow: hidden; padding: 20px 0; }
.marquee__track { display: flex; gap: 32px; width: max-content; white-space: nowrap; animation: marquee 40s linear infinite; font-size: clamp(28px, 5vw, 56px); color: transparent; -webkit-text-stroke: 1px rgba(255,231,224,.35); }
.marquee__track span:nth-child(even) { color: var(--accent); -webkit-text-stroke: 0; font-size: .5em; align-self: center; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- WhatsApp flutuante ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: #25D366;
  box-shadow: 0 10px 30px -8px rgba(37,211,102,.6);
  transition: transform .5s var(--ease-elastic), opacity .4s;
}
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25D366; z-index: -1; animation: pulse 2.4s infinite; }
.wa-float.is-hidden { opacity: 0; transform: scale(.6) translateY(20px) !important; pointer-events: none; }
@media (min-width: 768px) { .wa-float { right: 28px; bottom: 28px; width: 64px; height: 64px; } }

/* ---------- Movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .parallax-img { transform: none; }
}
