/* =========================================================================
   BASE — reset, tipografia, controles e superfícies do navegador
   ========================================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  color-scheme: dark;
}

body {
  min-height: 100svh;
  background-color: var(--ink-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Atmosfera: duas fontes de luz muito baixas + grão */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 42% at 12% -6%, rgba(31, 92, 255, 0.20), transparent 70%),
    radial-gradient(48% 40% at 92% 10%, rgba(31, 212, 242, 0.10), transparent 72%),
    radial-gradient(70% 60% at 50% 108%, rgba(11, 42, 138, 0.22), transparent 70%);
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 112%;
  line-height: var(--lh-title);
  letter-spacing: var(--ls-title);
  color: var(--text);
}

h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

h2 {
  font-size: var(--fs-3xl);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-display);
}

h3 {
  font-size: var(--fs-xl);
  font-weight: 700;
  font-stretch: 104%;
  line-height: 1.22;
}

::selection {
  background: rgba(31, 92, 255, 0.42);
  color: #fff;
  text-shadow: none;
}

/* Trava de rolagem do menu mobile — compensa a barra para não deslocar */
html.is-locked {
  overflow: hidden;
  padding-right: var(--sbw, 0px);
}

/* Foco visível em tudo que é operável por teclado */
:focus-visible {
  outline: 2px solid var(--cyan-400);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Barra de rolagem no idioma do site */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 162, 255, 0.35) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-950); }
::-webkit-scrollbar-thumb {
  background: rgba(111, 162, 255, 0.28);
  border: 2px solid var(--ink-950);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(111, 162, 255, 0.5); }

/* Cursor de texto do campo carrega a cor da marca */
input, textarea { caret-color: var(--cyan-400); }

/* Números tabulares onde há dado */
.tnum, table, .num { font-variant-numeric: tabular-nums; }

/* ---------- Acessibilidade ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--cyan-400);
  color: var(--ink-950);
  font-weight: 600;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  transform: translateY(-160%);
  transition: transform var(--t-base) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

/* Grão fino: tira o aspecto "gradiente liso de tela" e dá textura de impresso */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0.038;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Luz que acompanha o cursor (só em ponteiro fino) */
.pointer-light {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(63, 124, 255, 0.16), rgba(31, 212, 242, 0.05) 42%, transparent 66%);
  transition: opacity 600ms var(--ease-out);
  will-change: transform;
  display: none;
}

@media (pointer: fine) {
  .pointer-light { display: block; }
}

.pointer-light.is-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .pointer-light { display: none; }
}

/* Grids de layout nunca são esticados pelo conteúdo (o clássico estouro do mobile) */
.sec-head,
.title-block,
.hero__inner,
.showroom,
.process,
.cmp,
.svc,
.cases,
.cases__slots,
.contact__grid,
.flow,
.infra-notes,
.site-foot__grid,
.steps {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

/* ---------- Blocos de texto ---------- */
.lead {
  font-size: var(--fs-lg);
  line-height: 1.58;
  color: var(--text-2);
  max-width: 52ch;
}

.prose {
  color: var(--text-2);
  max-width: 46ch;
}
.prose p + p { margin-top: var(--s-4); }
.prose strong { color: var(--text); font-weight: 600; }

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  font-weight: 400;
  color: var(--text-3);
}

.hl {
  color: var(--cyan-300);
  font-style: normal;
}

/* ---------- Botões ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-2);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--btn-line);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  transition:
    background-color var(--t-base) var(--ease-out),
    border-color var(--t-base) var(--ease-out),
    color var(--t-base) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-base) var(--ease-out);
}

.btn svg { width: 18px; height: 18px; flex: none; }

.btn:hover { border-color: var(--line-3); background: rgba(255, 255, 255, 0.03); }
.btn:active { transform: translateY(1px); }

.btn--primary {
  --btn-bg: linear-gradient(180deg, #2a67ff, #1444d6);
  --btn-fg: #fff;
  --btn-line: rgba(140, 180, 255, 0.55);
  box-shadow: var(--glow-blue);
}
.btn--primary:hover {
  --btn-bg: linear-gradient(180deg, #3d77ff, #1a4ee6);
  border-color: rgba(180, 210, 255, 0.7);
}

/* WhatsApp: verde é sinal de "ativo/falar agora", não decoração */
.btn--wa {
  --btn-bg: linear-gradient(180deg, #1fd982, #0fae62);
  --btn-fg: #032418;
  --btn-line: rgba(124, 243, 186, 0.5);
  box-shadow: var(--glow-green);
  font-weight: 700;
}
.btn--wa:hover {
  --btn-bg: linear-gradient(180deg, #33e792, #13bb6b);
  border-color: rgba(180, 255, 220, 0.75);
}
.btn--wa svg { width: 19px; height: 19px; }

.btn--ghost {
  --btn-bg: rgba(10, 18, 33, 0.6);
  --btn-line: var(--line-2);
}

.btn--lg { min-height: 54px; padding: 0 26px; font-size: var(--fs-md); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); gap: 8px; }
.btn--sm svg { width: 16px; height: 16px; }

.btn--block { width: 100%; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 7px; }

.field__label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.field__hint {
  font-size: var(--fs-xs);
  color: var(--text-4);
  line-height: 1.45;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  background: rgba(4, 8, 16, 0.7);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder,
.textarea::placeholder { color: var(--text-4); opacity: 1; }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--line-3); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  background: rgba(6, 12, 24, 0.9);
  box-shadow: 0 0 0 3px rgba(31, 92, 255, 0.18);
}
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: var(--red-400);
  box-shadow: 0 0 0 3px rgba(229, 56, 74, 0.16);
}

.select {
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2393a5bf' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.field__error {
  display: none;
  font-size: var(--fs-xs);
  color: var(--red-300);
  align-items: center;
  gap: 6px;
}
.field__error[data-show="true"] { display: flex; }
.field__error svg { width: 14px; height: 14px; flex: none; }

/* ---------- Utilidades ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.stack > * + * { margin-top: var(--s-4); }
.center { text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
