/* ==========================================================================
   home.css — NTWeb 2026
   Estilos não críticos carregados somente na homepage.
   ========================================================================== */

.nt-cta-final.nt-cta-final--soft {
  border-top: 0;
  padding: var(--space-6) 0 6rem;
}

.nt-home-bg {
  isolation: isolate;
}

.nt-home-bg .nt-container {
  position: relative;
  z-index: 2;
}

.nt-page-home .nt-hero__eyebrow,
.nt-page-home .nt-hero__lead,
.nt-page-home .nt-hero__ctas,
.nt-page-home .nt-statusbar,
.nt-page-home .nt-hero__proof {
  animation: nt-home-hero-rise .72s var(--ease-out) both;
}

.nt-page-home .nt-hero__title {
  animation: nt-home-hero-rise-title .72s var(--ease-out) both;
}

@keyframes nt-home-hero-rise-title {
  from {
    opacity: 1;
    transform: translate3d(0, 14px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.nt-page-home .nt-hero__lead {
  animation-delay: .12s;
}

.nt-page-home .nt-hero__ctas {
  animation-delay: .18s;
}

.nt-page-home .nt-statusbar {
  animation-delay: .24s;
}

.nt-page-home .nt-hero__proof {
  animation-delay: .30s;
}

.nt-home-bg + .nt-section--soft {
  padding-top: var(--space-10) !important;
}

.nt-page-home .nt-footer {
  border-top: 0;
}

.nt-text-center {
  text-align: center;
}

.nt-title--lg {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 700;
  color: var(--text-1);
  margin-top: var(--space-2);
  line-height: var(--lh-tight);
}

.nt-title--md {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw + 0.8rem, 2.25rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-1);
  margin: 0;
  text-wrap: balance;
}

.nt-lead {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-2);
  line-height: var(--lh-body);
  margin: 0;
  text-wrap: pretty;
  max-width: 60ch;
}

.nt-section--soft {
  background: var(--surface-translucent);
  padding: var(--space-16) 0;
}

.nt-container--sm {
  max-width: 760px;
  margin-inline: auto;
  padding: 0 var(--container-pad);
}

.nt-trust {
  padding: var(--space-20) 0;
  background: var(--surface-translucent);
}

.nt-trust__header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.nt-trust__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 3vw, var(--text-4xl));
  font-weight: 700;
  color: var(--text-1);
  margin-top: var(--space-2);
  line-height: var(--lh-tight);
}

.nt-trust__title em {
  color: var(--accent);
  font-style: normal;
}

.nt-trust__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.nt-diferencial {
  background: var(--card-translucent);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}

.nt-diferencial:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nt-diferencial__icon {
  font-size: var(--text-xl);
  color: var(--accent);
  line-height: 1;
}

.nt-diferencial__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
}

.nt-diferencial__desc {
  font-size: var(--text-xs);
  color: var(--text-2);
  line-height: var(--lh-loose);
  margin: 0;
}

.nt-diferencial--datacenter {
  grid-column: 1 / -1;
}

.nt-diferencial__dc-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.nt-diferencial__flag {
  font-size: var(--text-2xl);
  line-height: 1;
}

@media (max-width: 640px) {
  .nt-trust__grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nt-page-home .nt-hero__eyebrow,
  .nt-page-home .nt-hero__title,
  .nt-page-home .nt-hero__lead,
  .nt-page-home .nt-hero__ctas,
  .nt-page-home .nt-statusbar,
  .nt-page-home .nt-hero__proof {
    animation: none !important;
  }
}

@keyframes nt-home-hero-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 14px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* ==========================================================================
   ECOSSISTEMA NTWEB — "centro de comando" interativo (.nt-eco*)
   Hub SVG central + 7 nós-botão em órbita + painel aria-live.
   Markup: homepage.tpl (#solucoes-resumo) · JS: js/home-solucoes.js
   ========================================================================== */

.nt-eco {
  /* clearance da barra fixa quando o hero "EXPLORAR PORTFÓLIO" rola até aqui */
  scroll-margin-top: calc(var(--nav-height) + var(--services-menu-height) + var(--space-4));
  padding: clamp(var(--space-16), 8vw, var(--space-20)) 0;
  position: relative;
  overflow: hidden;
}

/* brilho radial sutil de fundo (decorativo) */
.nt-eco::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, var(--accent-soft) 0%, transparent 55%);
  opacity: 0.85;
}

.nt-eco__inner {
  position: relative;
  z-index: 1;
}

/* ---------- Cabeçalho ---------- */
.nt-eco__header {
  text-align: center;
  max-width: 62ch;
  margin: 0 auto clamp(var(--space-8), 5vw, var(--space-16));
}

.nt-eco__title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 1.4rem + 2.4vw, var(--text-display));
  font-weight: 700;
  color: var(--text-1);
  line-height: var(--lh-tight);
  margin: var(--space-2) 0 0;
  text-wrap: balance;
}

.nt-eco__title em {
  font-style: normal;
  color: var(--accent-on-light);
}

.nt-eco__lead {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-2);
  line-height: var(--lh-body);
  margin: var(--space-4) auto 0;
  max-width: 56ch;
  text-wrap: pretty;
}

/* ---------- Layout: palco + painel ---------- */
.nt-eco__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(var(--space-8), 4vw, var(--space-16));
}

/* ---------- Palco radial ---------- */
.nt-eco__stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  aspect-ratio: 1 / 1;
  /* container-size habilita unidades cqmin para o raio de órbita confiável */
  container-type: size;
}

/* SVG decorativo (anéis + conectores) */
.nt-eco__links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
}

.nt-eco__ring {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  opacity: 0;
  transform-origin: 300px 300px;
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
  transform: scale(0.94);
}

.nt-eco__ring--inner {
  stroke-dasharray: 3 7;
}

.nt-eco.is-revealed .nt-eco__ring {
  opacity: 1;
  transform: scale(1);
}

.nt-eco.is-revealed .nt-eco__ring--inner {
  transition-delay: 0.12s;
  animation: nt-eco-spin 60s linear infinite;
}

@keyframes nt-eco-spin {
  to { transform: rotate(360deg); }
}

/* conectores hub → nó: traçado animado via dashoffset */
.nt-eco__link {
  stroke: var(--border-bright);
  stroke-width: 1.4;
  stroke-linecap: round;
  /* comprimento >= maior conector (232px) com folga */
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  opacity: 0.6;
  transition: stroke 0.3s var(--ease-out),
              stroke-width 0.3s var(--ease-out),
              opacity 0.3s var(--ease-out);
}

.nt-eco.is-revealed .nt-eco__link {
  animation: nt-eco-draw 0.9s var(--ease-out) forwards;
}

/* atraso escalonado por conector (ordem do markup; .nt-eco__link é <line>) */
.nt-eco.is-revealed .nt-eco__link:nth-of-type(1) { animation-delay: 0.05s; }
.nt-eco.is-revealed .nt-eco__link:nth-of-type(2) { animation-delay: 0.12s; }
.nt-eco.is-revealed .nt-eco__link:nth-of-type(3) { animation-delay: 0.19s; }
.nt-eco.is-revealed .nt-eco__link:nth-of-type(4) { animation-delay: 0.26s; }
.nt-eco.is-revealed .nt-eco__link:nth-of-type(5) { animation-delay: 0.33s; }
.nt-eco.is-revealed .nt-eco__link:nth-of-type(6) { animation-delay: 0.40s; }
.nt-eco.is-revealed .nt-eco__link:nth-of-type(7) { animation-delay: 0.47s; }

@keyframes nt-eco-draw {
  to { stroke-dashoffset: 0; }
}

/* conector do nó ativo: realça com a cor da marca */
.nt-eco__link.is-active {
  stroke: var(--node-accent, var(--accent));
  stroke-width: 2.4;
  opacity: 1;
}

/* ---------- Hub central ---------- */
.nt-eco__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: clamp(108px, 26%, 156px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, var(--card) 0%, var(--card) 62%, var(--card-hover) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md), inset 0 0 0 6px var(--surface);
}

.nt-eco__hub-pulse {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--accent-border);
  opacity: 0;
  pointer-events: none;
}

.nt-eco.is-revealed .nt-eco__hub-pulse {
  animation: nt-eco-pulse 3.2s var(--ease-out) infinite;
}

@keyframes nt-eco-pulse {
  0%   { transform: scale(1);    opacity: 0.55; }
  70%  { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}

.nt-eco__hub-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(var(--text-lg), 4vw, var(--text-2xl));
  letter-spacing: -0.01em;
  color: var(--accent-on-light);
  line-height: 1;
}

.nt-eco__hub-sub {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

/* ---------- Nós (botões em órbita) ---------- */
.nt-eco__nodes {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.nt-eco__node {
  /* raio de órbita ≈ 232/600 do palco; cqmin lê o tamanho do .nt-eco__stage */
  --orbit-radius: 38.6cqmin;
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(78px, 17cqmin, 104px);
  aspect-ratio: 1 / 1;
  /* posiciona no anel via rotate→translate→counter-rotate (mantém ícone reto) */
  transform:
    translate(-50%, -50%)
    rotate(var(--node-angle, 0deg))
    translate(0, calc(-1 * var(--orbit-radius)))
    rotate(calc(-1 * var(--node-angle, 0deg)));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-2);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--node-accent, var(--accent));
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              background var(--duration-base) var(--ease-out),
              scale var(--duration-base) var(--ease-out);
  opacity: 0;
  scale: 0.6;
}

.nt-eco.is-revealed .nt-eco__node {
  animation: nt-eco-node-pop 0.5s var(--ease-out) forwards;
}

/* pop escalonado dos nós após o traçado dos conectores */
.nt-eco.is-revealed .nt-eco__node:nth-child(1) { animation-delay: 0.30s; }
.nt-eco.is-revealed .nt-eco__node:nth-child(2) { animation-delay: 0.37s; }
.nt-eco.is-revealed .nt-eco__node:nth-child(3) { animation-delay: 0.44s; }
.nt-eco.is-revealed .nt-eco__node:nth-child(4) { animation-delay: 0.51s; }
.nt-eco.is-revealed .nt-eco__node:nth-child(5) { animation-delay: 0.58s; }
.nt-eco.is-revealed .nt-eco__node:nth-child(6) { animation-delay: 0.65s; }
.nt-eco.is-revealed .nt-eco__node:nth-child(7) { animation-delay: 0.72s; }

@keyframes nt-eco-node-pop {
  from { opacity: 0; scale: 0.6; }
  to   { opacity: 1; scale: 1; }
}

.nt-eco__node-icon {
  display: inline-flex;
  width: clamp(26px, 6vw, 34px);
  height: clamp(26px, 6vw, 34px);
}

.nt-eco__node-icon svg {
  width: 100%;
  height: 100%;
}

.nt-eco__node-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-1);
  line-height: 1;
  white-space: nowrap;
}

/* hover / foco / ativo */
.nt-eco__node:hover,
.nt-eco__node:focus-visible {
  border-color: var(--node-accent, var(--accent));
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--node-accent, var(--accent)) 18%, transparent);
}

.nt-eco__node:focus-visible {
  outline: 2px solid var(--accent-on-light);
  outline-offset: 2px;
}

.nt-eco__node.is-active {
  border-color: var(--node-accent, var(--accent));
  background: var(--card);
  box-shadow: var(--shadow-md), 0 0 0 5px color-mix(in srgb, var(--node-accent, var(--accent)) 22%, transparent);
}

/* leve "respiro" do nó ativo (só após reveal, pausa em reduced-motion) */
.nt-eco.is-revealed .nt-eco__node.is-active {
  animation: none;
}

.nt-eco__node.is-active .nt-eco__node-icon {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--node-accent, var(--accent)) 50%, transparent));
}

/* ---------- Painel de detalhe (aria-live) ---------- */
.nt-eco__panel {
  position: relative;
  background: var(--card-translucent);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 3vw, var(--space-8));
  box-shadow: var(--shadow-sm);
  min-height: 220px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-left-color var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
  overflow: hidden;
}

.nt-eco__panel.is-active {
  border-left-color: var(--node-accent, var(--accent));
}

.nt-eco__panel-spark {
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 64px;
  pointer-events: none;
  background: radial-gradient(circle at 0 0, var(--node-accent, var(--accent)) 0%, transparent 70%);
  opacity: 0.16;
}

.nt-eco__panel-tag {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  /* nome do produto — token de texto garante contraste AA em qualquer
     --node-accent (cores de marca como #f48634/#0EA5E9 falham como texto);
     a cor da marca aparece na borda esquerda, no spark e no nó ativo */
  color: var(--text-1);
  line-height: 1.1;
}

.nt-eco__panel-desc {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-2);
  line-height: var(--lh-body);
  margin: 0;
  text-wrap: pretty;
  flex: 1;
}

/* swap suave de conteúdo (controlado pelo JS via .is-swapping) */
.nt-eco__panel-tag,
.nt-eco__panel-desc,
.nt-eco__panel-link {
  transition: opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.nt-eco__panel.is-swapping .nt-eco__panel-tag,
.nt-eco__panel.is-swapping .nt-eco__panel-desc,
.nt-eco__panel.is-swapping .nt-eco__panel-link {
  opacity: 0;
  transform: translateY(6px);
}

.nt-eco__panel-link {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-on-light);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--duration-fast) var(--ease-out),
              opacity var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}

.nt-eco__panel-link:hover,
.nt-eco__panel-link:focus-visible {
  border-bottom-color: currentColor;
}

.nt-eco__panel-link:focus-visible {
  outline: 2px solid var(--accent-on-light);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* ---------- Rodapé CTA ---------- */
.nt-eco__footer {
  text-align: center;
  margin-top: clamp(var(--space-8), 4vw, var(--space-12));
}

.nt-eco__cta {
  display: inline-flex;
}

/* ==========================================================================
   Responsivo — abaixo de 720px o layout radial vira lista limpa
   ========================================================================== */
@media (max-width: 980px) {
  .nt-eco__layout {
    grid-template-columns: 1fr;
    gap: clamp(var(--space-6), 5vw, var(--space-10));
  }

  .nt-eco__stage {
    max-width: 460px;
  }

  .nt-eco__panel {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  /* desativa o palco radial: nós viram grid de cards */
  .nt-eco__stage {
    aspect-ratio: auto;
    max-width: none;
  }

  .nt-eco__links,
  .nt-eco__hub {
    display: none;
  }

  .nt-eco__nodes {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
  }

  .nt-eco__node {
    position: static;
    transform: none;
    width: auto;
    aspect-ratio: auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: var(--space-3);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    opacity: 1;
    scale: 1;
    animation: none !important;
  }

  .nt-eco__node-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
  }

  .nt-eco__node-label {
    font-size: var(--text-sm);
    white-space: normal;
  }

  .nt-eco__panel {
    margin-top: var(--space-6);
  }
}

@media (max-width: 420px) {
  .nt-eco__nodes {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Movimento reduzido — sem traçado/órbita/pulso; tudo estático e legível
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .nt-eco__ring,
  .nt-eco.is-revealed .nt-eco__ring {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .nt-eco__link,
  .nt-eco.is-revealed .nt-eco__link {
    stroke-dashoffset: 0;
    opacity: 0.6;
    animation: none !important;
  }

  .nt-eco__node,
  .nt-eco.is-revealed .nt-eco__node {
    opacity: 1;
    scale: 1;
    animation: none !important;
  }

  .nt-eco__hub-pulse,
  .nt-eco.is-revealed .nt-eco__hub-pulse {
    animation: none !important;
    opacity: 0;
  }

  .nt-eco__panel.is-swapping .nt-eco__panel-tag,
  .nt-eco__panel.is-swapping .nt-eco__panel-desc,
  .nt-eco__panel.is-swapping .nt-eco__panel-link {
    opacity: 1;
    transform: none;
  }
}
