/* home.css — estilos só da página inicial */

/* ---------- HERO ----------
   Camadas (de trás pra frente): orbs → G gigante → código → texto → painel 3D flutuante → chips.
   --px / --py (-1..1) vêm do mouse e --sy do scroll (home.js); tudo parado se reduced-motion. */
.hero {
  --px: 0; --py: 0; --sy: 0;
  position: relative; isolation: isolate; overflow: hidden;
  min-height: calc(100dvh - var(--nav-h)); display: flex; align-items: center;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(4.5rem, 8vw, 6rem);
}
.hero::after { /* funde o hero com a seção de baixo */
  content: ''; position: absolute; inset: auto 0 0 0; height: 30%; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.hero-bg { position: absolute; inset: 0; z-index: -2; pointer-events: none; }
.hero-orb { position: absolute; border-radius: 50%; filter: blur(10px); will-change: transform; }
.hero-orb-a {
  width: 46vmax; height: 46vmax; right: -12vmax; top: -14vmax;
  background: radial-gradient(circle, rgba(212,179,116,.16), transparent 62%);
  transform: translate(calc(var(--px) * -26px), calc(var(--py) * -20px + var(--sy) * -.08px));
}
.hero-orb-b {
  width: 34vmax; height: 34vmax; left: -14vmax; bottom: -16vmax;
  background: radial-gradient(circle, rgba(120,110,200,.08), transparent 62%);
  transform: translate(calc(var(--px) * 18px), calc(var(--py) * 14px));
}
.hero-g {
  position: absolute; right: clamp(2rem, 25vw, 26rem); top: 47%;
  font-family: var(--font-display); font-style: italic; font-weight: 300; font-optical-sizing: auto;
  font-size: clamp(26rem, 62vw, 58rem); line-height: .8; letter-spacing: -.05em;
  color: transparent;
  background: linear-gradient(165deg, rgba(242,240,233,.11) 10%, rgba(212,179,116,.085) 50%, rgba(242,240,233,.025) 90%);
  -webkit-background-clip: text; background-clip: text;
  transform: translate(calc(var(--px) * -34px), calc(-50% + var(--py) * -24px + var(--sy) * .18px));
  user-select: none; will-change: transform;
  animation: g-in 2.2s var(--ease-out) both;
}
@keyframes g-in { from { opacity: 0; letter-spacing: .05em; filter: blur(12px); } }
.hero-code {
  position: absolute; right: clamp(16rem, 34vw, 34rem); bottom: 12%;
  font-family: var(--font-mono); font-size: .74rem; line-height: 1.75; color: rgba(242,240,233,.07);
  white-space: pre; transform: translate(calc(var(--px) * -12px), calc(var(--py) * -10px + var(--sy) * .1px));
}

.hero-grid {
  position: relative; display: grid; align-items: start;
  grid-template-columns: minmax(0, 1fr) clamp(320px, 31vw, 400px);
  grid-template-areas: "title title" "sub stage";
  column-gap: clamp(2rem, 5vw, 4.5rem);
}
.hero-copy { grid-area: title; position: relative; z-index: 2; }
.hero-sub { grid-area: sub; position: relative; z-index: 2; padding-top: clamp(1.4rem, 2.5vw, 2.2rem); }
.hero-title {
  margin: 1.4rem 0 0; max-width: none;
  font-size: clamp(2.7rem, 6.6vw, 6rem); line-height: .98; letter-spacing: -.04em;
  text-wrap: pretty;
}
.hero-title .nb { white-space: nowrap; }
.hero-sub .lead { margin-bottom: 2.2rem; max-width: 52ch; }

/* Painel flutuante em 3D, subindo ao lado da 2ª linha do título */
.hero-stage {
  grid-area: stage; position: relative; z-index: 3; justify-self: end; width: 100%;
  margin-top: clamp(-6rem, -3.6vw, -2rem);
  perspective: 1400px;
}
.hero-float { animation: float 7s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes float { 50% { transform: translateY(-14px); } }
.hero-panel {
  height: clamp(330px, 48vh, 430px);
  transform: rotateY(calc(-13deg + var(--px) * 5deg)) rotateX(calc(7deg + var(--py) * -4deg)) rotateZ(1deg);
  transform-origin: 50% 50%;
  transition: transform .9s var(--ease-out);
  box-shadow:
    0 1px 0 rgba(255,255,255,.05) inset,
    -30px 50px 90px -20px rgba(0,0,0,.75),
    0 0 0 1px rgba(212,179,116,.06),
    0 30px 120px -30px rgba(212,179,116,.22);
}
.hero-panel::before { /* reflexo de vidro */
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 1;
  background: linear-gradient(115deg, rgba(255,255,255,.07), transparent 32%);
}
.hero-panel { position: relative; }
.hero-stage::after { /* sombra no "chão" */
  content: ''; position: absolute; left: 12%; right: 8%; bottom: -46px; height: 40px; z-index: -1;
  background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent); filter: blur(6px);
  animation: shadow 7s ease-in-out infinite;
}
@keyframes shadow { 50% { transform: scale(.88); opacity: .7; } }

/* Chips flutuantes */
.hero-chip {
  position: absolute; z-index: 4; display: flex; align-items: center; gap: .65rem;
  padding: .6rem .85rem .6rem .6rem; max-width: 270px;
  background: rgba(20,20,26,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong); border-radius: 12px;
  box-shadow: 0 18px 40px -10px rgba(0,0,0,.7);
  font-family: var(--font-mono);
  transition: border-color .4s, box-shadow .4s;
}
.hero-chip b { display: block; font-weight: 500; font-size: .7rem; letter-spacing: .03em; color: var(--text); }
.hero-chip small { display: block; font-size: .64rem; color: var(--accent); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.chip-ico { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); }
.chip-ico.ok { color: var(--ok); background: rgba(127,209,160,.1); border-color: rgba(127,209,160,.3); }
.chip-ico svg { width: 15px; height: 15px; }
.chip-gtm { left: -26%; top: 60%; animation: float 6s ease-in-out infinite -2s; translate: calc(var(--px) * 16px) calc(var(--py) * 12px); }
.chip-ga4 { right: -8%; bottom: -6%; animation: float 8s ease-in-out infinite -4s; translate: calc(var(--px) * 24px) calc(var(--py) * 18px); }
.hero-chip.ping { border-color: var(--accent-line); box-shadow: 0 18px 40px -10px rgba(0,0,0,.7), 0 0 0 4px rgba(212,179,116,.08); }
.chip-ga4.ping { border-color: rgba(127,209,160,.4); box-shadow: 0 18px 40px -10px rgba(0,0,0,.7), 0 0 0 4px rgba(127,209,160,.08); }

/* Entrada: o painel "pousa" em 3D */
.js .hero-stage[data-reveal] { opacity: 0; transform: translateY(40px) scale(.96); }
.js .hero-stage[data-reveal].in { opacity: 1; transform: none; transition-duration: 1.4s; }
.js .hero-chip { opacity: 0; transition: opacity .8s var(--ease-out) 1s, border-color .4s, box-shadow .4s; }
.js .hero-stage.in .hero-chip { opacity: 1; }
.js .hero-stage.in .chip-ga4 { transition-delay: 1.3s, 0s, 0s; }

@media (max-width: 1100px) {
  .chip-gtm { left: -8%; }
  .hero-code { display: none; }
}
@media (max-width: 960px) {
  .hero { min-height: 0; align-items: flex-start; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "sub" "stage"; }
  .hero-title .nb { white-space: normal; }
  .hero-stage { margin-top: 2.6rem; justify-self: stretch; max-width: 520px; padding: 3.4rem 5% 3.6rem; }
  .hero-panel { height: 320px; transform: rotateY(calc(-6deg + var(--px) * 3deg)) rotateX(4deg); }
  .hero-g { font-size: 30rem; right: -9rem; top: 34%; }
  .chip-gtm { left: 1%; top: 0; }
  .chip-ga4 { right: 1%; bottom: 0; }
  .scroll-cue { display: none; }
}
@media (max-width: 480px) {
  .hero-chip small { max-width: 150px; }
  .chip-gtm { left: -1%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-float, .hero-chip, .hero-stage::after, .hero-g { animation: none !important; }
  .hero { --px: 0 !important; --py: 0 !important; --sy: 0 !important; }
}

.scroll-cue { position: absolute; left: 50%; bottom: 1.4rem; width: 24px; height: 38px; margin-left: -12px; border: 1px solid var(--border-strong); border-radius: 12px; display: grid; justify-items: center; padding-top: 7px; }
.scroll-cue span { width: 3px; height: 7px; border-radius: 2px; background: var(--accent); animation: cue 1.8s var(--ease) infinite; }
@keyframes cue { 0% { opacity: 0; transform: translateY(-3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }

@media (max-width: 960px) {
  .hero { min-height: 0; align-items: flex-start; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-copy .display { max-width: 14ch; }
  .hero-panel { height: 330px; }
  .scroll-cue { display: none; }
}

/* Números */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(2.5rem, 6vw, 4rem); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.stat { padding: clamp(1.2rem, 3vw, 2rem); display: flex; flex-direction: column; gap: .4rem; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat-num { font-family: var(--font-display); font-weight: 300; font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat-num em { font-style: italic; color: var(--accent); }
.stat-label { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat { flex-direction: row; align-items: baseline; justify-content: space-between; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--border); }
}

/* Projetos em destaque */
.featured .card { padding: 0; display: flex; flex-direction: column; }
.feat-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.feat-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: saturate(.85) brightness(.82); transition: transform 1.1s var(--ease-out), filter .5s; }
.card:hover .feat-media img { transform: scale(1.05); filter: none; }
.feat-body { padding: clamp(1.2rem, 2.5vw, 1.8rem); display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.feat-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.feat-meta span:first-child { color: var(--accent); }
.feat-body .link-arrow { margin-top: auto; padding-top: 1.2rem; }

/* Método (passos) */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; border-top: 1px solid var(--border-strong); }
.step { position: relative; padding: 1.8rem 1.4rem 0 0; }
.step::before { content: ''; position: absolute; top: -1px; left: 0; width: 100%; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.2s var(--ease-out); transition-delay: var(--d, 0ms); }
.step.in::before { transform: scaleX(.35); }
.step:hover::before { transform: scaleX(1); transition-delay: 0ms; }
.step-n { font-family: var(--font-display); font-style: italic; font-size: 2.4rem; line-height: 1; color: var(--accent); }
.step h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; line-height: 1.2; letter-spacing: -.02em; margin: 1rem 0 .6rem; }
.step h3 em { font-style: italic; color: var(--accent); font-weight: 300; }
.step p { font-size: .92rem; color: var(--text-secondary); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 2rem; } }
@media (max-width: 520px) { .steps { grid-template-columns: minmax(0, 1fr); } .step { padding-right: 0; } }
.hero-panel .dl-head { font-size: .68rem; }
.hero-panel .dl-head > span:first-child { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Logos oficiais de GTM e GA4 nos chips */
.chip-ico.logo { background: rgba(255,255,255,.05); border-color: var(--border-strong); }
.chip-ico.logo svg { width: 17px; height: 17px; }
.hero-chip.ping .chip-ico.logo { border-color: var(--accent-line); }
/* Nome da tag/evento nunca é cortado: quebra em até 2 linhas em vez de reticências */
.hero-chip { max-width: 300px; }
.hero-chip small { white-space: normal; overflow: visible; text-overflow: clip; max-width: 230px; overflow-wrap: anywhere; text-wrap: balance; line-height: 1.35; }
@media (max-width: 480px) { .hero-chip { max-width: 250px; } .hero-chip small { max-width: 190px; } }

/* Link de cada passo do método para o entregável modelo */
.step-link { margin-top: 1rem; font-size: .7rem; }

/* Cartões de dor: a frase do cliente em destaque */
.dores .dor h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); line-height: 1.22; }
.dores .dor p { font-size: .9rem; }
.dores .dor .card-num { color: #E06A55; }
.dores .dor:hover .card-num { color: var(--accent); }

/* Celular: home mais curta */
@media (max-width: 640px) {
  .hero { padding: 1.6rem 0 2.2rem; }
  .hero-title { margin-top: 1rem; font-size: clamp(2.2rem, 10vw, 2.8rem); }
  .hero-sub { padding-top: 1rem; }
  .hero-sub .lead { margin-bottom: 1.4rem; font-size: .95rem; }
  .hero-stage { margin-top: 1.4rem; padding: 3rem 3% 3rem; }
  .hero-panel { height: 250px; }
  .hero-g { font-size: 22rem; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1.4rem; }
  .stat { flex-direction: column; align-items: flex-start; padding: .9rem .8rem; gap: .25rem; }
  .stat + .stat { border-top: 0; border-left: 1px solid var(--border); }
  .stat-num { font-size: 1.8rem; }
  .stat-label { font-size: .58rem; letter-spacing: .05em; }
  .feat-media { aspect-ratio: 16 / 9; }
  .feat-body { padding: 1rem 1.1rem 1.1rem; }
  .feat-body .chips { display: none; }
  .steps { border-top: 0; }
  .step { padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); }
  .step::before { display: none; }
  .step-n { font-size: 1.8rem; }
  .step h3 { margin: .5rem 0 .35rem; font-size: 1.1rem; }
}
@media (max-width: 640px) { .stat-num em { font-size: .62em; white-space: nowrap; } }
