/* ==========================================================================
   NexLab3D — estilos do site
   1. Variáveis da marca
   2. Base
   3. Componentes (botões, títulos, marca)
   4. Cabeçalho e menu
   5. Seções
   6. Animações
   7. Movimento reduzido
   ========================================================================== */

/* 1. Variáveis da marca ------------------------------------------------- */
:root {
  /* Cores (manual da marca) */
  --noite: #0A1A2F;
  --noite-2: #13284A;
  --linha: #1C3150;
  --linha-2: #2A4468;
  --limao: #C8F031;
  --limao-claro: #D7F660;
  --limao-profundo: #4E6B00;
  --nevoa: #8FA6BF;
  --gelo: #F5F7FA;
  --texto-suave: #C9D4E0;

  /* Cores das áreas claras */
  --tinta: #0A1A2F;
  --tinta-suave: #3A4C63;
  --borda-clara: #D5DCE5;

  /* Fontes */
  --fonte-titulo: "Michroma", "Manrope", system-ui, sans-serif;
  --fonte-texto: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Espaços e cantos */
  --espaco-secao: clamp(72px, 10vw, 128px);
  --raio-sm: 10px;
  --raio-md: 18px;
  --raio-lg: 28px;
  --altura-header: 72px;

  /* Movimento */
  --suave: cubic-bezier(.2, .7, .2, 1);
}

/* 2. Base --------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altura-header) + 16px);
}

body {
  margin: 0;
  background: var(--noite);
  color: var(--gelo);
  font-family: var(--fonte-texto);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible {
  outline: 2px solid var(--limao);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--raio-sm);
  background: var(--limao);
  color: var(--noite);
  font-weight: 800;
  text-decoration: none;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 32px);
}

/* 3. Componentes -------------------------------------------------------- */
.title {
  font-family: var(--fonte-titulo);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.15;
  letter-spacing: .01em;
  text-transform: uppercase;
  text-wrap: balance;
}

.lead {
  font-size: clamp(17px, 1.6vw, 19px);
  line-height: 1.6;
  color: var(--texto-suave);
  max-width: 36em;
}

.section { padding-block: var(--espaco-secao); }

.section-head {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--fonte-texto);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s, transform .2s var(--suave);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--limao); color: var(--noite); }
.btn-primary:hover { background: var(--limao-claro); }

.btn-ghost { border-color: var(--nevoa); color: var(--gelo); font-weight: 700; }
.btn-ghost:hover { border-color: var(--gelo); background: rgba(245, 247, 250, .06); }

.btn-dark { background: var(--noite); color: var(--gelo); }
.btn-dark:hover { background: var(--noite-2); }

.btn-sm { min-height: 44px; padding: 10px 20px; font-size: 15px; }

.btn-icon { width: 22px; height: 22px; flex-shrink: 0; }

/* Marca (símbolo + logotipo) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gelo);
  text-decoration: none;
}
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-word {
  font-family: var(--fonte-titulo);
  font-size: 17px;
  line-height: 1;
  letter-spacing: .01em;
  text-transform: uppercase;
}
.brand-word span { color: var(--limao); }

/* 4. Cabeçalho e menu --------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(10, 26, 47, .88);
  border-bottom-color: var(--linha);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--altura-header);
}

.nav { margin-left: auto; }
.nav-list { display: flex; gap: 4px 28px; }
.nav-list a {
  display: inline-block;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--texto-suave);
  text-decoration: none;
  background-image: linear-gradient(var(--limao), var(--limao));
  background-size: 0 2px;
  background-position: 0 calc(100% - 4px);
  background-repeat: no-repeat;
  transition: color .2s, background-size .3s var(--suave);
}
.nav-list a:hover { color: var(--gelo); background-size: 100% 2px; }
.nav-cta { display: none; }

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  border-radius: var(--raio-sm);
  background: transparent;
  color: var(--gelo);
  cursor: pointer;
}
.menu-toggle span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--suave), top .3s var(--suave);
}
.menu-toggle span:first-child { top: 17px; }
.menu-toggle span:last-child { top: 25px; }
.menu-toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .header-cta { display: none; }
  .menu-toggle { display: block; }

  .nav {
    position: fixed;
    inset: calc(var(--altura-header) + env(safe-area-inset-top, 0px)) 0 auto 0;
    margin: 0;
    padding: 12px clamp(20px, 4vw, 32px) 32px;
    background: var(--noite);
    border-bottom: 1px solid var(--linha);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .25s, transform .3s var(--suave), visibility 0s .3s;
  }
  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: 0 0 0 100vmax rgba(3, 10, 20, .6);
    transition: opacity .25s, transform .3s var(--suave), visibility 0s;
  }
  .nav-list { flex-direction: column; gap: 0; }
  .nav-list a {
    display: block;
    padding: 16px 0;
    font-size: 20px;
    color: var(--gelo);
    border-bottom: 1px solid var(--linha);
    background: none;
  }
  .nav-cta { display: flex; width: 100%; margin-top: 24px; }
}

/* 5. Seções ------------------------------------------------------------- */

/* Topo */
.hero { padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 96px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(40px, 6vw, 80px);
}

.hero-copy { display: grid; gap: 22px; justify-items: start; }

.hero-place {
  font-size: 15px;
  font-weight: 700;
  color: var(--limao);
}

.hero-title {
  font-family: var(--fonte-titulo);
  font-weight: 400;
  font-size: clamp(38px, 6.2vw, 84px);
  line-height: 1.04;
  letter-spacing: .005em;
  text-transform: uppercase;
}
.layer-line { display: block; }

.hero-sub {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.15;
}

.hero-text {
  max-width: 34em;
  font-size: 18px;
  color: var(--texto-suave);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

.hero-visual { display: flex; justify-content: center; }

/* Mesa de impressão com o símbolo sendo desenhado */
.bed {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--raio-lg);
  border: 1px solid var(--linha-2);
  background-color: var(--noite-2);
  background-image:
    linear-gradient(rgba(143, 166, 191, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 166, 191, .12) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
  overflow: hidden;
}
.bed::before,
.bed::after {
  /* marcas de canto, como as referências de uma mesa de impressão */
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--nevoa);
  border-style: solid;
  opacity: .6;
}
.bed::before { top: 18px; left: 18px; border-width: 2px 0 0 2px; }
.bed::after { right: 18px; bottom: 18px; border-width: 0 2px 2px 0; }

.draw { width: 56%; height: auto; overflow: visible; }
.draw-trace {
  fill: none;
  stroke: var(--gelo);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw-route { fill: none; stroke: none; }
.draw-nozzle { fill: var(--limao); }

.bed-caption {
  position: absolute;
  left: 22px;
  bottom: 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nevoa);
}

/* Fatos rápidos */
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 24px;
  margin-top: clamp(48px, 7vw, 80px);
  padding-top: 28px;
  border-top: 1px solid var(--linha);
}
.facts li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--texto-suave);
}
.facts svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--limao); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { justify-content: flex-start; }
  .bed { max-width: 360px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; }
}

/* Como funciona: linha do bico percorrendo as etapas */
.steps { border-top: 1px solid var(--linha); }

.steps-wrap { position: relative; --p: 0; }

.steps-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.step { display: grid; gap: 20px; align-content: start; }

.step-num {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--linha-2);
  background: var(--noite);
  font-family: var(--fonte-titulo);
  font-size: 14px;
  color: var(--nevoa);
  transition: background-color .4s, border-color .4s, color .4s;
}
.step.is-active .step-num {
  background: var(--limao);
  border-color: var(--limao);
  color: var(--noite);
}

.step-body { display: grid; gap: 8px; }
.step h3 { font-size: 20px; font-weight: 800; line-height: 1.3; }
.step p { color: var(--texto-suave); }

/* trilho: a posição e o tamanho vêm do JavaScript (--track-start, --track-len) */
.steps-track {
  position: absolute;
  top: 22px;
  left: var(--track-start, 23px);
  width: var(--track-len, 0px);
  height: 2px;
  background: var(--linha);
}
.steps-fill {
  position: absolute;
  inset: 0;
  background: var(--limao);
  transform-origin: left center;
  transform: scaleX(var(--p));
}
.steps-nozzle {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 100%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--limao);
  box-shadow: 0 0 0 5px rgba(200, 240, 49, .18);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .3s;
}
.steps-wrap.is-moving .steps-nozzle { opacity: 1; }

@media (max-width: 760px) {
  .steps-list { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .step { grid-template-columns: 46px minmax(0, 1fr); column-gap: 20px; }
  .step-body { padding-top: 8px; }
  .steps-track {
    top: var(--track-start, 23px);
    left: 22px;
    width: 2px;
    height: var(--track-len, 0px);
  }
  .steps-fill { transform-origin: center top; transform: scaleY(var(--p)); }
  .steps-nozzle { top: calc(var(--p) * 100%); left: 50%; }
}

/* Serviços (área clara) */
.services { background: var(--gelo); color: var(--tinta); }
.services :focus-visible { outline-color: var(--limao-profundo); }

.services-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(32px, 6vw, 80px);
}
.service {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 20px;
  padding-block: 32px;
  border-top: 1px solid var(--borda-clara);
}
.service h3 { font-size: 21px; font-weight: 800; line-height: 1.3; margin-bottom: 8px; }
.service p { color: var(--tinta-suave); max-width: 32em; }

.service-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--noite);
}
.service-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--limao);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 760px) {
  .services-list { grid-template-columns: minmax(0, 1fr); }
}

/* Portfólio no Instagram */
.portfolio-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 48px;
}
.portfolio .section-head { margin-bottom: 0; }
.portfolio-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 900px) {
  .portfolio-inner { grid-template-columns: minmax(0, 1fr); align-items: start; }
}

/* Empresas (faixa limão) */
.business { background: var(--limao); color: var(--noite); }
.business :focus-visible { outline-color: var(--noite); }
.business .lead { color: var(--noite); font-weight: 500; }

.business-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.business-copy { display: grid; gap: 20px; flex: 1 1 520px; min-width: 0; }
.business-list { display: grid; gap: 12px; }
.business-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 700;
}
.business-list svg { width: 22px; height: 22px; flex-shrink: 0; }

/* Dúvidas */
.faq-inner {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.7fr);
  align-items: start;
  gap: 32px clamp(32px, 6vw, 80px);
}
.faq .section-head { margin-bottom: 0; }
.faq-list { border-top: 1px solid var(--linha); }

@media (max-width: 900px) {
  .faq-inner { grid-template-columns: minmax(0, 1fr); }
}
.faq-item { border-bottom: 1px solid var(--linha); }

.faq-item summary {
  position: relative;
  display: block;
  padding: 24px 56px 24px 0;
  font-size: clamp(17px, 1.6vw, 19px);
  font-weight: 800;
  line-height: 1.4;
  cursor: pointer;
  list-style: none;
  transition: color .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--limao); }

.faq-icon {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 50%;
  border: 1.5px solid var(--linha-2);
  transition: transform .35s var(--suave), border-color .2s, background-color .2s;
}
.faq-icon::before,
.faq-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  border-radius: 2px;
  background: var(--limao);
}
.faq-icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-icon { transform: rotate(45deg); border-color: var(--limao); }

.faq-a { overflow: hidden; }
.faq-a p { padding: 0 56px 26px 0; color: var(--texto-suave); max-width: 40em; }

/* Contato */
.contact { padding-top: 0; }
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 40px 64px;
  padding: clamp(36px, 6vw, 72px);
  border-radius: var(--raio-lg);
  border: 1px solid var(--linha);
  background: var(--noite-2);
}
.contact-copy { display: grid; gap: 20px; justify-items: start; align-content: start; }

.contact-list { display: grid; align-content: start; }
.contact-list li {
  display: grid;
  gap: 2px;
  padding-block: 16px;
  border-bottom: 1px solid var(--linha-2);
}
.contact-list li:first-child { padding-top: 0; }
.contact-list li:last-child { border-bottom: 0; }
.contact-label { font-size: 14px; font-weight: 600; color: var(--nevoa); }
.contact-list a,
.contact-list li > span:last-child { font-size: 18px; font-weight: 700; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { color: var(--limao); }

@media (max-width: 860px) {
  .contact-panel { grid-template-columns: minmax(0, 1fr); }
}

/* Rodapé */
.site-footer {
  padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--linha);
  font-size: 14px;
  color: var(--nevoa);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}
.site-footer .brand-mark { width: 28px; height: 28px; }
.site-footer .brand-word { font-size: 14px; }

/* Botão fixo do WhatsApp */
.wa-float {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 22px 14px 18px;
  border-radius: 999px;
  background: var(--limao);
  color: var(--noite);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(3, 10, 20, .45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity .3s, transform .35s var(--suave), visibility 0s .35s, background-color .2s;
}
.wa-float.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .3s, transform .35s var(--suave), visibility 0s, background-color .2s;
}
.wa-float:hover { background: var(--limao-claro); }
.wa-float svg { width: 24px; height: 24px; }

@media (max-width: 560px) {
  .wa-float { padding: 0; width: 56px; justify-content: center; }
  .wa-float span { display: none; }
}

/* Sem JavaScript, o botão fixo e o trilho ficam sempre visíveis/estáticos */
html:not(.js) .wa-float { opacity: 1; visibility: visible; transform: none; }

/* 6. Animações ---------------------------------------------------------- */

/* Títulos aparecem de baixo para cima, em camadas, como uma peça sendo impressa */
@keyframes camadas {
  from { clip-path: inset(100% 0 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes surgir {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.js .hero-title .layer-line {
  clip-path: inset(100% 0 0 0);
  animation: camadas .9s steps(9, end) forwards;
}
.js .hero-title .layer-line:nth-child(1) { animation-delay: .15s; }
.js .hero-title .layer-line:nth-child(2) { animation-delay: .55s; }

.js .hero-place,
.js .hero-sub,
.js .hero-text,
.js .hero-actions {
  opacity: 0;
  animation: surgir .7s var(--suave) forwards;
}
.js .hero-place { animation-delay: .05s; }
.js .hero-sub { animation-delay: 1.05s; }
.js .hero-text { animation-delay: 1.2s; }
.js .hero-actions { animation-delay: 1.35s; }

.js [data-layer] { clip-path: inset(100% 0 0 0); }
.js [data-layer].is-visible { animation: camadas .8s steps(8, end) forwards; }

/* O símbolo começa escondido; o JavaScript desenha o traço e move o bico */
.js .draw-trace { stroke-dasharray: 130; stroke-dashoffset: 130; }
.js .draw-nozzle { opacity: 0; }
.js .bed { cursor: pointer; }

/* Pergunta fechando: o ícone volta antes da animação terminar */
.faq-item.is-closing .faq-icon { transform: none; border-color: var(--linha-2); }

/* 7. Movimento reduzido ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .hero-title .layer-line,
  .js [data-layer] { clip-path: none; }
  .js .hero-place,
  .js .hero-sub,
  .js .hero-text,
  .js .hero-actions { opacity: 1; }
  .js .draw-trace { stroke-dashoffset: 0; }
  .js .draw-nozzle { opacity: 1; }
  .btn:hover { transform: none; }
}
