/* R+ Engenharia Especializada — estilos compartilhados */
:root {
  --bg: #060A1C;
  --card: #0D1430;
  --line: #1F2B55;
  --ink: #F1F5FF;
  --muted: #A9B4D0;
  --water: #2F7BFF;
  --water-light: #5AB8FF;
  --fire: #FF6A1A;
  --fire-red: #E3261B;
  --cta-from: #C2410C;
  --cta-to: #B91C1C;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Work Sans", system-ui, sans-serif;
  line-height: 1.6;
  touch-action: manipulation;
}
h1, h2, h3, .font-display { font-family: Outfit, system-ui, sans-serif; text-wrap: balance; }

/* Fundo: brilho azul/laranja nas laterais (sem quadriculado) */
.bg-tech {
  background:
    radial-gradient(60rem 40rem at 0% 0%, rgba(47,123,255,.18), transparent 60%),
    radial-gradient(50rem 36rem at 100% 10%, rgba(255,106,26,.14), transparent 60%),
    var(--bg);
}

.text-gradient {
  background: linear-gradient(90deg, var(--water-light), #8FD0FF 35%, var(--fire) 70%, var(--fire-red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Ícones do sprite (Lucide): estilo herdado pelo <use> */
use { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Foco visível em todos os controles */
:focus-visible { outline: 3px solid var(--water-light); outline-offset: 3px; border-radius: 10px; }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--bg); padding: .75rem 1rem; border-radius: .5rem; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 52px; padding: .85rem 1.5rem; border-radius: 14px;
  font-family: Outfit, sans-serif; font-weight: 600; font-size: 1.05rem; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out), filter 200ms;
}
.btn:active { transform: scale(.97); }
.btn-cta {
  color: #fff;
  background: linear-gradient(135deg, var(--cta-from), var(--cta-to));
  box-shadow: 0 10px 30px -10px rgba(227,38,27,.7), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-cta:hover { box-shadow: 0 14px 40px -10px rgba(255,106,26,.85), inset 0 1px 0 rgba(255,255,255,.22); filter: brightness(1.08); }
.btn-ghost { color: var(--ink); border: 1.5px solid var(--line); background: rgba(13,20,48,.6); }
.btn-ghost:hover { border-color: var(--water-light); }

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(18,28,63,.85), rgba(13,20,48,.85));
  border: 1px solid var(--line); border-radius: 18px;
  transition: border-color 200ms, box-shadow 200ms;
}
.card:hover { border-color: rgba(90,184,255,.45); box-shadow: 0 0 0 1px rgba(90,184,255,.12), 0 20px 40px -24px rgba(47,123,255,.6); }

.icon-badge {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; flex: none;
  background: rgba(47,123,255,.14); color: var(--water-light); border: 1px solid rgba(90,184,255,.25);
}
.icon-badge.fire { background: rgba(255,106,26,.12); color: var(--fire); border-color: rgba(255,106,26,.3); }

/* Etapas (timeline) */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 4.25rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; font-family: Outfit, sans-serif; font-weight: 700; font-size: 1.15rem;
  color: #fff; background: linear-gradient(135deg, var(--water), var(--fire-red));
  box-shadow: 0 0 0 4px var(--bg), 0 0 24px rgba(47,123,255,.45);
}
.step:not(:last-child)::after {
  content: ""; position: absolute; left: 23px; top: 52px; bottom: -1.75rem; width: 2px;
  background: linear-gradient(var(--water), rgba(255,106,26,.5));
}

/* FAQ com <details> nativo */
.faq details { border: 1px solid var(--line); border-radius: 16px; background: rgba(13,20,48,.7); transition: border-color 200ms; }
.faq details[open] { border-color: rgba(90,184,255,.45); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.15rem 1.25rem; min-height: 56px; font-family: Outfit, sans-serif; font-weight: 600; font-size: 1.05rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { flex: none; transition: transform 250ms var(--ease-out); color: var(--water-light); }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq .answer { padding: 0 1.25rem 1.25rem; color: var(--muted); }

/* Botão flutuante do WhatsApp */
.wa-float {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 40;
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: #25D366; color: #04210F; box-shadow: 0 10px 30px -6px rgba(37,211,102,.6);
  transition: transform 200ms var(--ease-out);
}
.wa-float:hover { transform: translateY(-2px); }
.wa-float::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #25D366;
  animation: wa-pulse 2.4s var(--ease-out) infinite;
}
@keyframes wa-pulse { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

/* Barra de CTA fixa no mobile (páginas de serviço) */
.mobile-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom));
  background: rgba(6,10,28,.92); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
@media (max-width: 767px) {
  body.has-mobile-cta { padding-bottom: 88px; }
  body.has-mobile-cta .wa-float { display: none; }
}
@media (min-width: 768px) { .mobile-cta { display: none; } }

/* Revelação ao rolar */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ HOME: logo estático em destaque ============ */
/* --s = lado da imagem quadrada (1,5x o tamanho anterior); mostramos só a região do R+ (x 10–90%, y 10–64%).
   Limites: no celular o R+ (≈59% da imagem) cabe na largura; no desktop sobra altura para nome e botões. */
:root { --s: min(155vw, 1500px, calc((100vh - 300px) / .54)); }
@supports (height: 1dvh) { :root { --s: min(155vw, 1500px, calc((100dvh - 300px) / .54)); } }
.hero-logo {
  position: relative; overflow: hidden; flex: none;
  --box-w: min(calc(var(--s) * .8), 100vw);
  width: var(--box-w); height: calc(var(--s) * .54);
  /* funde as bordas do recorte com o fundo da página */
  -webkit-mask-image: radial-gradient(ellipse farthest-side at 50% 50%, #000 68%, transparent 100%);
          mask-image: radial-gradient(ellipse farthest-side at 50% 50%, #000 68%, transparent 100%);
}
.hero-logo img {
  position: absolute; max-width: none; display: block;
  width: var(--s); height: var(--s);
  left: calc((var(--box-w) - var(--s)) / 2); top: calc(var(--s) * -.1);
}

/* Nome em texto metálico brilhante: "ENGENHARIA ESPECIALIZADA" em uma linha, mesmo tamanho */
.wordmark {
  position: relative; z-index: 2; margin-top: calc(var(--s) * -.03);
  display: flex; align-items: center; gap: .3em; line-height: 1; white-space: nowrap;
  /* no celular a linha inteira (~15,5em) precisa caber na largura da tela */
  font-size: max(18px, min(calc(var(--s) * .04), 5.6vw));
  font-family: Outfit, sans-serif; font-weight: 700; font-style: italic;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.55)) drop-shadow(0 0 14px rgba(180,210,255,.35));
}
.wm-1, .wm-2 {
  letter-spacing: .02em;
  background: linear-gradient(180deg,
    #ffffff 0%, #f4f7fb 22%, #b9c3d0 44%, #6f7a89 50%, #dfe6ee 56%, #ffffff 70%, #a7b1bf 88%, #e9eef4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
/* traços vermelhos da logo nas pontas (só quando há espaço) */
@media (min-width: 640px) {
  .wordmark::before, .wordmark::after {
    content: ""; width: 2.2em; height: 2px; margin: 0 .3em;
    background: linear-gradient(90deg, transparent, #E3261B);
  }
  .wordmark::after { transform: scaleX(-1); }
}

#hero-shader, #particles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#hero-shader { opacity: 0; transition: opacity 1.2s var(--ease-out); }
#hero-shader.is-ready { opacity: 1; }

/* Entrada do hero (fade-in-up escalonado, como no Animated Shader Hero) */
@keyframes hero-in {
  from { opacity: 0; transform: translateY(24px); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}
/* "backwards" (e não "both") para não travar o transform do hover depois da entrada */
.hero-logo { animation: hero-in 900ms var(--ease-out) backwards; }
/* o wordmark já usa filter (drop-shadow), então entra sem o blur */
@keyframes hero-in-soft { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.wordmark  { animation: hero-in-soft 900ms var(--ease-out) 180ms backwards; }
.choices .choice { animation: hero-in 800ms var(--ease-out) backwards; }
.choices .choice:nth-child(1) { animation-delay: 380ms; }
.choices .choice:nth-child(2) { animation-delay: 500ms; }

/* Botão verde do WhatsApp no topo */
.btn-wa-top {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  min-height: 44px; padding: .55rem 1.1rem; border-radius: 12px;
  background: #25D366; color: #04210F; font-family: Outfit, sans-serif; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(37,211,102,.65);
  transition: transform 200ms var(--ease-out), filter 200ms;
}
.btn-wa-top:hover { transform: translateY(-2px); filter: brightness(1.06); }
.btn-wa-top:active { transform: scale(.97); }

/* Botões da home: sobem para logo abaixo de "ENGENHARIA ESPECIALIZADA" (o texto termina a ~83% da altura do logo) */
.choices { position: relative; z-index: 2; margin-top: 1.1rem; }

/* Botões em destaque: laranja (fogo) e azul (água), as duas cores da logo */
.choice {
  --glow: 255,106,26;
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem; height: 100%;
  min-height: 60px; padding: .8rem 1.1rem; border-radius: 16px;
  text-align: left; cursor: pointer; text-decoration: none; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
  background: linear-gradient(135deg, #F97316 0%, #EA580C 45%, #C2410C 100%);
  border: 1px solid rgba(255,190,140,.5);
  box-shadow: 0 14px 36px -14px rgba(var(--glow),.85), 0 0 0 1px rgba(var(--glow),.15), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform 220ms var(--ease-out), box-shadow 220ms, filter 220ms;
}
.choice--water {
  --glow: 47,123,255;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 45%, #1D4ED8 100%);
  border-color: rgba(150,200,255,.5);
}
/* reflexo de luz que atravessa o botão periodicamente */
.choice::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: choice-shine 4.5s var(--ease-out) 1.4s infinite;
}
.choice--water::before { animation-delay: 2.1s; }
@keyframes choice-shine { 0% { transform: translateX(-120%); } 35%, 100% { transform: translateX(120%); } }
.choice-text { display: flex; flex-direction: column; gap: .15rem; }
.choice:hover {
  transform: translateY(-3px); filter: brightness(1.08);
  box-shadow: 0 22px 48px -14px rgba(var(--glow),1), 0 0 0 1px rgba(var(--glow),.35), inset 0 1px 0 rgba(255,255,255,.35);
}
.choice:active { transform: scale(.98); }
.choice .arrow { flex: none; transition: transform 220ms var(--ease-out); }
.choice:hover .arrow { transform: translateX(4px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
