/* ================================================================
   SmartFlux v2 — Core Foundation
   Typography · Layout · Nav · Buttons · Footer
   ================================================================ */

:root {
  /* Palette — Dark Premium (navy slate + acento único esmeralda/teal).
     Base navy da família slate-900 para ar mais "premium coeso". */
  --bg: #080b13;
  --bg-2: #0c111d;
  --bg-3: #111827;
  --ink: #f1f4fa;
  --ink-2: #b6c0d4;
  /* Contraste AA garantido mesmo sobre superfícies de vidro (UI/UX Pro Max §1):
     ink-3 ~5.4:1 e ink-4 ~3.8:1 sobre o fundo translúcido dos cards. */
  --ink-3: #808ea9;
  --ink-4: #66748f;
  --line: rgba(255,255,255,.06);
  --line-2: rgba(255,255,255,.12);
  --surface: rgba(255,255,255,.03);
  --surface-2: rgba(255,255,255,.055);
  --surface-3: rgba(255,255,255,.08);

  /* Acento único, coeso na família esmeralda→teal (sem salto pro violeta).
     a1 = âncora (botões/links), a2/a3 = variações próximas para gradientes. */
  --a1: #10b981;
  --a2: #16d1a3;
  --a3: #2dd4bf;
  --accent-ink: #03241b;

  /* Type */
  --f-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --f-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --f-display: 'Instrument Serif', Georgia, serif;

  /* Geometry */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 32px;
  --max: 1240px;
  /* Ritmo vertical mais enxuto p/ dinâmica (UI/UX Pro Max §6 whitespace-balance). */
  --pad-section: 108px;

  /* Motion */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --smooth: cubic-bezier(.4, 0, .2, 1);
}

/* Accent themes */
[data-accent="cyan"]    { --a1:#00e5b8; --a2:#37d3ff; --a3:#7c5cff; --accent-ink:#04221b }
[data-accent="emerald"] { --a1:#3ee083; --a2:#7cf2c0; --a3:#37d3ff; --accent-ink:#062314 }
[data-accent="amber"]   { --a1:#ffcc66; --a2:#ff9a55; --a3:#ff6b6b; --accent-ink:#241704 }
[data-accent="violet"]  { --a1:#b794ff; --a2:#7c5cff; --a3:#37d3ff; --accent-ink:#1a0a3a }

[data-density="compact"]     { --pad-section: 88px }
[data-density="comfortable"] { --pad-section: 128px }
[data-density="spacious"]    { --pad-section: 168px }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; max-width: 100%; }
body {
  color: var(--ink);
  font-family: var(--f-sans);
  font-feature-settings: "ss01", "cv11";
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer }
img, svg { display: block; max-width: 100% }
ul, ol { list-style: none }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 2;
}
.skip-link {
  position: absolute; left: 16px; top: -80px;
  background: var(--ink); color: var(--bg);
  padding: 12px 16px; border-radius: 12px;
  font-weight: 700; z-index: 1000; transition: .2s;
}
.skip-link:focus { top: 16px }

/* Foco de teclado visível (acessibilidade — UI/UX Pro Max §1 focus-states).
   :focus-visible só aparece na navegação por teclado, não atrapalha o mouse. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--a1);
  outline-offset: 2px;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4 {
  font-family: var(--f-sans);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.0;
}
h1 {
  font-size: clamp(48px, 7.5vw, 100px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 0.95;
}
h2 {
  font-size: clamp(36px, 5vw, 68px);
  letter-spacing: -0.04em;
  line-height: 1.02;
  /* Subtle engraved relief — keeps section titles consistent with the hero */
  text-shadow:
    0 -1px 0 rgba(255,255,255,.10),
    0 1px 0 rgba(0,0,0,.45),
    0 2px 1px rgba(0,0,0,.35),
    0 8px 22px rgba(0,0,0,.4);
}
h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.03em;
}
p { margin: 0; color: var(--ink-2) }

.serif {
  font-family: var(--f-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
}
[data-serif="false"] .serif {
  font-family: var(--f-sans);
  font-style: normal;
  font-weight: 700;
}
.mono { font-family: var(--f-mono); font-feature-settings: "ss01" }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--a1);
  text-transform: uppercase;
  letter-spacing: .16em;
}
.eyebrow::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--a1);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--a1) 18%, transparent);
}

.gradient-text {
  background: linear-gradient(105deg, var(--a1) 0%, var(--a2) 45%, var(--a3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% 100%;
  animation: gradShift 6s ease-in-out infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
}

/* ===== BUTTONS ===== */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  font-family: var(--f-sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), background .3s;
  will-change: transform;
  isolation: isolate;
  overflow: hidden;
}
.btn--primary {
  background: linear-gradient(135deg, var(--a1) 0%, var(--a2) 100%);
  color: var(--accent-ink);
  box-shadow:
    0 1px 0 rgba(255,255,255,.3) inset,
    0 0 0 1px rgba(255,255,255,.1) inset,
    0 6px 16px -3px color-mix(in oklab, var(--a1) 50%, transparent),
    0 24px 56px -14px color-mix(in oklab, var(--a1) 40%, transparent);
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.25), transparent 50%);
  opacity: 0;
  transition: opacity .3s;
}
.btn--primary:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    0 1px 0 rgba(255,255,255,.35) inset,
    0 0 0 1px rgba(255,255,255,.15) inset,
    0 10px 28px -4px color-mix(in oklab, var(--a1) 60%, transparent),
    0 40px 80px -16px color-mix(in oklab, var(--a1) 50%, transparent),
    0 0 60px -8px color-mix(in oklab, var(--a1) 30%, transparent);
}
.btn--primary:hover::before { opacity: 1 }
.btn--primary:active { transform: translateY(-1px) scale(.99) }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: rgba(255,255,255,.2);
  transform: translateY(-3px);
}
.btn--sm { height: 44px; padding: 0 20px; font-size: 13.5px }
.btn .arrow {
  width: 16px; height: 16px;
  transition: transform .4s var(--spring);
}
.btn:hover .arrow { transform: translateX(5px) }

/* Hero CTAs pulse */
.hero .btn--primary,
.cta-final .btn--primary,
a.mobile-cta {
  animation: ctaPulse 4s ease-in-out infinite;
}
@keyframes ctaPulse {
  0%, 100% {
    box-shadow:
      0 1px 0 rgba(255,255,255,.25) inset,
      0 4px 12px -2px color-mix(in oklab, var(--a1) 40%, transparent),
      0 20px 50px -12px color-mix(in oklab, var(--a1) 35%, transparent);
  }
  50% {
    box-shadow:
      0 1px 0 rgba(255,255,255,.35) inset,
      0 8px 24px -2px color-mix(in oklab, var(--a1) 55%, transparent),
      0 32px 70px -8px color-mix(in oklab, var(--a1) 45%, transparent);
  }
}

/* ===== NAV ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 65%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, background .4s;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
}
.nav-inner {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo-full {
  height: 54px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  object-position: left center;
}
.brand-logo-wrap {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  background: #0a1028;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 4px 16px -6px rgba(0,0,0,.5);
  position: relative;
}
.brand-logo-wrap::before { display: none }
.brand-logo {
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
  position: relative;
  z-index: 1;
  background: transparent;
}
.brand-name {
  display: block;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.025em;
  line-height: 1;
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .14em;
  margin-top: 3px;
}
.nav-links { display: flex; gap: 6px }
.nav-links a {
  font-size: 13.5px;
  color: var(--ink-3);
  padding: 8px 14px;
  border-radius: 99px;
  transition: color .25s, background .25s;
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5.5px;
  flex-shrink: 0;
  transition: .3s var(--ease);
}
.nav-hamburger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--ink-2);
  border-radius: 99px;
  transition: transform .3s var(--ease), opacity .3s;
  transform-origin: center;
}
.nav-hamburger.active { background: var(--surface-2); border-color: var(--line-2) }
.nav-hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.nav-hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0) }
.nav-hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

/* Mobile nav */
.nav-mobile {
  display: flex;
  position: fixed;
  inset: 72px 0 0 0;
  z-index: 49;
  background: color-mix(in oklab, var(--bg) 96%, transparent);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  padding: 32px 24px;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s .35s;
}
.nav-mobile.open {
  pointer-events: all;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s 0s;
}
.nav-mobile a {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  padding: 14px 20px;
  border-radius: var(--r-lg);
  color: var(--ink-2);
  transition: .2s;
  border: 1px solid transparent;
}
.nav-mobile a:hover { color: var(--ink); background: var(--surface); border-color: var(--line) }
.nav-mobile .btn {
  margin-top: 16px;
  width: 100%;
  justify-content: center;
  font-size: 16px;
}
body.menu-open { overflow: hidden }

/* ===== FOOTER ===== */
footer {
  padding: 72px 0 40px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 48px;
}
.foot-grid h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.foot-grid ul { display: flex; flex-direction: column; gap: 8px }
.foot-grid a { font-size: 14px; color: var(--ink-2); transition: color .2s }
.foot-grid a:hover { color: var(--ink) }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.foot-social { display: flex; align-items: center; gap: 12px }
.foot-social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.foot-social-btn:hover {
  transform: translateY(-2px);
  border-color: var(--line-2);
  background: color-mix(in oklab, var(--surface) 70%, #fff 6%);
}
.foot-social-btn .foot-ico { width: 22px; height: 22px; display: block }
.foot-grid p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 36ch;
  margin-top: 14px;
}
.foot-badge { margin-top: 16px }
.foot-kommo-badge {
  height: 30px;
  width: auto;
  border-radius: 7px;
  opacity: .7;
  transition: opacity .25s;
}
.foot-kommo-badge:hover { opacity: 1 }
.foot-base {
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .1em;
}

/* Mobile floating CTA */
.mobile-cta {
  display: none;
  position: fixed;
  left: 16px; right: 16px;
  /* Respeita a barra de gestos/notch (safe-area — UI/UX Pro Max §5). */
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
  /* Escondido até o hero sair da tela, pra não competir com os botões
     do próprio hero (revelado via .revealed pelo v2-engine.js). */
  transform: translateY(160%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s var(--ease), opacity .3s;
}
.mobile-cta.revealed { transform: none; opacity: 1; pointer-events: auto; }

/* Scroll progress */
#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3));
  box-shadow: 0 0 12px color-mix(in oklab, var(--a1) 60%, transparent);
  pointer-events: none;
  border-radius: 0 99px 99px 0;
  transition: width .08s linear;
}

/* ===== SECTIONS (base) ===== */
section {
  padding: var(--pad-section) 0;
  position: relative;
  z-index: 2;
}
.section-head {
  max-width: 780px;
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 {
  margin: 16px 0 18px;
  text-wrap: balance;
}
.section-head p {
  font-size: clamp(16px, 1.3vw, 18px);
  color: var(--ink-3);
  max-width: 58ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .nav-links { display: none }
  .nav-hamburger { display: flex }
  .foot-grid { grid-template-columns: 1fr 1fr }
}
@media (max-width: 720px) {
  :root { --pad-section: 72px; --r-2xl: 24px; --r-xl: 20px }
  .container { padding: 0 20px }
  .mobile-cta { display: flex }
  .foot-grid { grid-template-columns: 1fr }
  footer { padding-bottom: 100px }
  .brand-logo-full { height: 40px; max-width: 180px; }
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 480px) {
  :root { --pad-section: 56px; }
  .container { padding: 0 16px; }
  .section-head { margin-bottom: 44px; }
  .section-head p { font-size: 14.5px; }
  h2 { font-size: clamp(26px, 7.5vw, 36px); }
  h3 { font-size: clamp(17px, 4.5vw, 22px); }
  .eyebrow { font-size: 10.5px; letter-spacing: .13em; }
  .btn { height: 50px; padding: 0 22px; font-size: 14px; }
  .btn--sm { height: 42px; padding: 0 18px; }
  .actions { gap: 10px; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .foot-base { flex-direction: column; text-align: center; gap: 8px; }
  .nav-mobile { padding: 20px 16px; }
  .nav-mobile a { font-size: 18px; padding: 12px 16px; min-height: 48px; display: flex; align-items: center; }
  .nav-inner { height: 60px; }
}

/* Touch targets — ensure all tappable elements hit 44px minimum */
@media (max-width: 1100px) {
  .nav-mobile a { min-height: 48px; display: flex; align-items: center; }
}
