/* =====================================================================
   John Code — Engenharia de Software de Alta Performance
   Design system inspirado no layout do AG Precisão (Material Design 3),
   adaptado para uma paleta tech (indigo / violeta).
   ===================================================================== */

/* ----------------------------- Tokens -------------------------------- */
:root {
  /* Paleta primária (indigo) */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-dark: #3730a3;
  --primary-container: #e0e7ff;
  --on-primary-container: #1e1b4b;

  /* Secundária / acentos */
  --secondary: #7c3aed;      /* violeta */
  --accent: #06b6d4;         /* ciano */
  --amber: #f59e0b;          /* estrelas / destaques */
  --success: #10b981;

  /* Superfícies e neutros (frios, tech) */
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --surface-3: #e6eafr;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* Texto */
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --on-primary: #ffffff;

  /* Gradientes */
  --gradient-hero: linear-gradient(135deg, #4f46e5 0%, #6d28d9 45%, #2563eb 100%);
  --gradient-brand: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --gradient-text: linear-gradient(120deg, #a5b4fc 0%, #c4b5fd 50%, #67e8f9 100%);

  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, .10), 0 8px 10px -6px rgba(15, 23, 42, .05);
  --shadow-xl: 0 24px 48px -12px rgba(79, 70, 229, .22);

  /* Layout */
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
  --container: 1200px;
  --header-h: 74px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Correção de um token acima (fallback seguro) */
:root { --surface-3: #e9edf6; }

/* ----------------------------- Reset --------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* --------------------------- Utilitários ----------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: 96px 0; position: relative; }
.section--tint { background: var(--surface-2); }
.section--dark {
  background: #0b1020;
  color: #cbd5e1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-container);
  padding: 6px 14px;
  border-radius: 999px;
}
.section--dark .eyebrow { background: rgba(129, 140, 248, .15); color: #a5b4fc; }

.section-head { max-width: 680px; margin-bottom: 56px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  margin: 18px 0 14px;
}
.section-head p { color: var(--text-muted); font-size: 1.075rem; }
.section--dark .section-head p { color: #94a3b8; }

.text-gradient {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ----------------------------- Botões -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: .975rem;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .2s;
  white-space: nowrap;
}
.btn .ms { font-size: 20px; }
.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, .5);
}
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 12px 26px -6px rgba(79, 70, 229, .6); }
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-light {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  backdrop-filter: blur(6px);
}
.btn-light:hover { background: rgba(255, 255, 255, .22); transform: translateY(-2px); }
.btn-white { background: #fff; color: var(--primary-dark); }
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-block { width: 100%; }

/* ----------------------------- Header -------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background .3s, box-shadow .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.header.scrolled {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 11px; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.28rem; letter-spacing: -.03em; }
.brand-mark {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--gradient-brand);
  display: grid; place-items: center;
  color: #fff; font-size: 20px;
  box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .55);
  flex-shrink: 0;
}
.brand span { color: var(--primary); }
.header:not(.scrolled) .brand.on-hero { color: #fff; }
.header:not(.scrolled) .brand.on-hero span { color: #c4b5fd; }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 500;
  font-size: .95rem;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color .25s, background .25s, box-shadow .35s var(--ease), border-color .25s;
}
/* brilho refletido (varredura tipo espelho) */
.nav a::before {
  content: '';
  position: absolute;
  top: 0; left: -140%;
  width: 55%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-22deg);
  transition: left .6s var(--ease);
  pointer-events: none;
  z-index: -1;
}
.nav a:hover::before { left: 150%; }
/* hover/ativo: vidro + brilho suave */
.nav a:hover, .nav a.active {
  color: var(--primary);
  background: rgba(79, 70, 229, .10);
  border-color: rgba(79, 70, 229, .26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 20px -6px rgba(79, 70, 229, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
/* sobre o hero (fundo escuro): vidro translúcido claro */
.header:not(.scrolled) .nav.on-hero a { color: rgba(255, 255, 255, .85); }
.header:not(.scrolled) .nav.on-hero a:hover,
.header:not(.scrolled) .nav.on-hero a.active {
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 26px -6px rgba(139, 121, 251, .6);
}

/* Botão CTA do menu ("Fale Conosco"): espelho + brilho */
.header-actions .btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.header-actions .btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -140%;
  width: 55%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-22deg);
  transition: left .6s var(--ease);
  pointer-events: none;
}
.header-actions .btn-primary:hover::before { left: 150%; }
.header-actions .btn-primary:hover {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 14px 30px -6px rgba(79, 70, 229, .75);
}

.header-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  place-items: center;
  color: var(--text);
}
.header:not(.scrolled) .nav-toggle.on-hero { color: #fff; }
.nav-toggle .ms { font-size: 28px; }

/* --------------------------- Hero ------------------------------------ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 60px) 0 90px;
  background: var(--gradient-hero);
  color: #fff;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 80% 15%, rgba(103, 232, 249, .22), transparent 60%),
    radial-gradient(50% 50% at 12% 85%, rgba(167, 139, 250, .28), transparent 60%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(80% 80% at 50% 40%, #000, transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 7px 16px; border-radius: 999px;
  font-size: .85rem; font-weight: 500;
  backdrop-filter: blur(6px);
  margin-bottom: 26px;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .3); }
.hero h1 {
  color: #fff;
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.05;
  margin-bottom: 22px;
}
.hero h1 .accent { background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.2rem; color: rgba(255, 255, 255, .88); max-width: 540px; margin-bottom: 34px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 42px; }
.hero-trust { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-size: .9rem; color: rgba(255,255,255,.75); }
.hero-trust .item { display: flex; align-items: center; gap: 8px; }
.hero-trust .ms { font-size: 20px; color: #a5b4fc; }

/* Painel de código no hero */
.hero-visual { position: relative; }
.code-card {
  background: rgba(13, 17, 33, .72);
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6);
  backdrop-filter: blur(10px);
  overflow: hidden;
}
.code-card .bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid rgba(148, 163, 184, .18); }
.code-card .bar i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.code-card .bar i:nth-child(1) { background: #ff5f57; }
.code-card .bar i:nth-child(2) { background: #febc2e; }
.code-card .bar i:nth-child(3) { background: #28c840; }
.code-card .bar span { margin-left: 8px; font-size: .78rem; color: #94a3b8; font-family: 'JetBrains Mono', ui-monospace, monospace; }
.code-body { padding: 22px 22px 26px; font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace; font-size: .86rem; line-height: 1.85; }
.code-body .ln { color: #e2e8f0; white-space: pre; }
.code-body .c-key { color: #c4b5fd; }
.code-body .c-fn { color: #67e8f9; }
.code-body .c-str { color: #6ee7b7; }
.code-body .c-num { color: #fdba74; }
.code-body .c-com { color: #64748b; }
.code-body .indent { padding-left: 22px; }

.hero-float {
  position: absolute;
  background: rgba(255,255,255,.97);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 16px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 11px;
  font-size: .85rem; font-weight: 600;
}
.hero-float .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.hero-float small { display: block; font-weight: 500; color: var(--text-subtle); font-size: .74rem; }
.hero-float.f1 { top: -22px; right: 22px; }
.hero-float.f1 .ic { background: var(--success); }
.hero-float.f2 { bottom: -24px; left: -18px; }
.hero-float.f2 .ic { background: var(--secondary); }

/* --------------------------- Stats ----------------------------------- */
.stats {
  position: relative;
  z-index: 3;
  margin-top: -56px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 38px 30px;
  box-shadow: var(--shadow-lg);
}
.stat { text-align: center; position: relative; }
.stat + .stat::before { content: ''; position: absolute; left: -10px; top: 10%; height: 80%; width: 1px; background: var(--border); }
.stat .num { font-family: 'Sora', sans-serif; font-size: clamp(2rem, 4vw, 2.7rem); font-weight: 800; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { color: var(--text-muted); font-size: .95rem; margin-top: 4px; }

/* --------------------------- Serviços -------------------------------- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--gradient-brand);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: transparent; }
.card:hover::after { transform: scaleX(1); }
.card-icon {
  width: 58px; height: 58px;
  border-radius: 15px;
  display: grid; place-items: center;
  background: var(--primary-container);
  color: var(--primary);
  margin-bottom: 20px;
  transition: background .3s, color .3s, transform .3s;
}
.card-icon .ms { font-size: 30px; }
.card:hover .card-icon { background: var(--gradient-brand); color: #fff; transform: scale(1.06) rotate(-4deg); }
.card h3 { font-size: 1.28rem; margin-bottom: 10px; }
.card p { color: var(--text-muted); font-size: .975rem; }
.card .card-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--primary); font-weight: 600; font-size: .92rem; }
.card .card-link .ms { font-size: 18px; transition: transform .25s; }
.card:hover .card-link .ms { transform: translateX(4px); }

/* --------------------------- Pilares --------------------------------- */
.pillars { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; }
.pillar { text-align: left; }
.pillar-num { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1rem; color: var(--primary); background: var(--primary-container); width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 18px; }
.section--dark .pillar-num { background: rgba(129,140,248,.15); color: #a5b4fc; }
.pillar h3 { font-size: 1.35rem; margin-bottom: 10px; }
.section--dark .pillar h3 { color: #f1f5f9; }
.pillar p { color: var(--text-muted); }
.section--dark .pillar p { color: #94a3b8; }
.pillar-list { margin-top: 16px; display: grid; gap: 9px; }
.pillar-list li { display: flex; align-items: flex-start; gap: 9px; color: var(--text-muted); font-size: .95rem; }
.section--dark .pillar-list li { color: #cbd5e1; }
.pillar-list .ms { color: var(--accent); font-size: 20px; flex-shrink: 0; }

/* --------------------------- Timeline -------------------------------- */
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 20px; }
.timeline::before { content: ''; position: absolute; top: 21px; left: 6%; right: 6%; height: 2px; background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent)); }
.tl-item { position: relative; padding-top: 56px; }
.tl-item .tl-dot { position: absolute; top: 12px; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); box-shadow: 0 0 0 5px var(--primary-container); }
.tl-item .tl-year { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--primary); margin-bottom: 6px; }
.tl-item h4 { font-size: 1.05rem; margin-bottom: 6px; }
.tl-item p { color: var(--text-muted); font-size: .93rem; }

/* --------------------------- Projetos -------------------------------- */
.projects-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }
.project {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  padding: 30px;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.project::before { content: ''; position: absolute; inset: 0; background: var(--pbg); opacity: 1; transition: transform .5s var(--ease); z-index: 0; }
.project::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,10,25,.15) 0%, rgba(6,10,25,.85) 100%); z-index: 1; }
.project:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
.project:hover::before { transform: scale(1.08); }
.project > * { position: relative; z-index: 2; }
.project .p-body { width: 100%; }
.project .tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; backdrop-filter: blur(4px); }
.project h3 { color: #fff; font-size: 1.5rem; margin-bottom: 8px; }
.project p { color: rgba(255,255,255,.86); font-size: .98rem; }
.project .metrics { display: flex; gap: 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.2); }
.project .metrics b { display: block; font-family: 'Sora', sans-serif; font-size: 1.3rem; }
.project .metrics small { color: rgba(255,255,255,.75); font-size: .8rem; }
.p--fintech { --pbg: linear-gradient(135deg, #4f46e5, #7c3aed); }
.p--ai { --pbg: linear-gradient(135deg, #0ea5e9, #6366f1); }
.p--health { --pbg: linear-gradient(135deg, #0d9488, #0ea5e9); }
.p--quantum { --pbg: linear-gradient(135deg, #7c3aed, #db2777); }

/* --------------------------- Depoimentos ----------------------------- */
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.testi .stars { display: flex; gap: 2px; color: var(--amber); margin-bottom: 16px; }
.testi .stars .ms { font-size: 20px; font-variation-settings: 'FILL' 1; }
.testi blockquote { color: var(--text); font-size: 1.03rem; line-height: 1.65; flex-grow: 1; }
.testi .who { display: flex; align-items: center; gap: 13px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.testi .avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-family: 'Sora', sans-serif; }
.testi .who b { display: block; font-size: .97rem; }
.testi .who small { color: var(--text-subtle); font-size: .85rem; }

/* --------------------------- Contato --------------------------------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; align-items: start; }
.contact-info h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 16px 0 16px; }
.contact-info > p { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 30px; }
.contact-list { display: grid; gap: 18px; }
.contact-item { display: flex; align-items: center; gap: 15px; }
.contact-item .ic { width: 50px; height: 50px; border-radius: 14px; background: var(--primary-container); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.contact-item .ic .ms { font-size: 24px; }
.contact-item small { color: var(--text-subtle); font-size: .82rem; }
.contact-item b { font-size: 1.02rem; font-weight: 600; }
.contact-socials { display: flex; gap: 12px; margin-top: 30px; }
.contact-socials a { width: 46px; height: 46px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-muted); transition: all .25s; }
.contact-socials a:hover { background: var(--gradient-brand); color: #fff; border-color: transparent; transform: translateY(-3px); }
.contact-socials .ms { font-size: 22px; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-lg);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.field label .req { color: var(--secondary); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .97rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .14); }
.field input::placeholder, .field textarea::placeholder { color: #94a3b8; }
.form-note { font-size: .82rem; color: var(--text-subtle); margin-top: 4px; text-align: center; }

.form-alert { display: none; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: .92rem; margin-bottom: 18px; }
.form-alert .ms { font-size: 20px; flex-shrink: 0; }
.form-alert.ok { display: flex; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.form-alert.err { display: flex; background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .btn-label, .btn.loading .ms { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- CTA ----------------------------------- */
.cta-band { position: relative; overflow: hidden; background: var(--gradient-hero); color: #fff; border-radius: var(--radius-lg); padding: 60px; text-align: center; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: radial-gradient(50% 80% at 80% 20%, rgba(103,232,249,.25), transparent 60%); }
.cta-band > * { position: relative; z-index: 2; }
.cta-band h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.cta-band p { color: rgba(255,255,255,.88); font-size: 1.1rem; max-width: 560px; margin: 0 auto 30px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* --------------------------- Footer ---------------------------------- */
.footer { background: #0b1020; color: #94a3b8; padding: 72px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer .brand { color: #fff; margin-bottom: 16px; }
.footer-about p { font-size: .95rem; margin-bottom: 20px; max-width: 320px; }
.footer-socials { display: flex; gap: 10px; }
.footer-socials a { width: 42px; height: 42px; border-radius: 11px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: #cbd5e1; transition: all .25s; }
.footer-socials a:hover { background: var(--gradient-brand); color: #fff; transform: translateY(-3px); }
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; font-family: 'Inter', sans-serif; font-weight: 600; }
.footer-col ul { display: grid; gap: 11px; }
.footer-col a { font-size: .93rem; color: #94a3b8; transition: color .2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding-top: 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .87rem; }
.footer-bottom .cnpj { color: #64748b; }

/* --------------------------- WhatsApp float -------------------------- */
.wa-float {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25d366;
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 12px 30px -6px rgba(37, 211, 102, .6);
  z-index: 900;
  transition: transform .25s;
  animation: wa-pulse 2.4s infinite;
}
.wa-float:hover { transform: scale(1.08); }
.wa-float svg { width: 32px; height: 32px; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.5); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }

/* --------------------------- Mobile nav ------------------------------ */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(11, 16, 32, .55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s;
}
.mobile-menu.open { opacity: 1; visibility: visible; }
.mobile-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(340px, 86vw);
  height: 100%;
  background: var(--surface);
  padding: 26px 24px;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
  display: flex; flex-direction: column;
}
.mobile-menu.open .mobile-panel { transform: translateX(0); }
.mobile-panel .mm-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.mobile-panel nav { display: grid; gap: 4px; }
.mobile-panel nav a { padding: 13px 14px; border-radius: 12px; font-weight: 500; color: var(--text); font-size: 1.05rem; transition: background .2s; }
.mobile-panel nav a:hover { background: var(--surface-2); color: var(--primary); }
.mobile-panel .btn { margin-top: 24px; }
.mm-close { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
.mm-close .ms { font-size: 28px; }

/* --------------------------- Animações ------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
.reveal.d4 { transition-delay: .32s; }
.reveal.d5 { transition-delay: .40s; }

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

/* --------------------------- Responsivo ------------------------------ */
@media (max-width: 992px) {
  .hero .container { grid-template-columns: 1fr; gap: 44px; }
  .hero-visual { max-width: 480px; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .pillars { grid-template-columns: 1fr; gap: 22px; }
  .timeline { grid-template-columns: repeat(2, 1fr); gap: 34px 24px; }
  .timeline::before { display: none; }
  .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 860px) {
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: grid; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .stat + .stat::before { display: none; }
}
@media (max-width: 640px) {
  .section { padding: 68px 0; }
  .container { padding-inline: 18px; }
  .cards-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .testi-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 26px 20px; }
  .cta-band { padding: 44px 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-float { display: none; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ============================ LOGO (imagem) =========================== */
.brand-logo {
  height: 40px;
  width: auto;
  display: block;
  transition: filter .3s;
}
/* branca sobre o hero (fundo escuro); colorida quando o header vira claro */
.header:not(.scrolled) .brand.on-hero .brand-logo { filter: brightness(0) invert(1); }
.brand-logo--footer { height: 34px; filter: brightness(0) invert(1); }
.mobile-panel .brand-logo { height: 34px; }
.brand-text { display: inline-flex; align-items: center; gap: 11px; }

/* ====================== PROJETOS (cards ricos) ======================== */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.pcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s;
}
.pcard:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); border-color: transparent; }

.pcard-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; cursor: zoom-in; }
.pcard-cover-img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.pcard:hover .pcard-cover-img { transform: scale(1.06); }
.pcard-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(6, 10, 25, .38));
  opacity: 0; transition: opacity .3s; pointer-events: none;
}
.pcard:hover .pcard-cover::after { opacity: 1; }
.pcard-tag {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: rgba(255, 255, 255, .92); color: var(--primary-dark);
  font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 999px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.pcard-count {
  position: absolute; bottom: 14px; right: 14px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(6, 10, 25, .6); color: #fff;
  font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pcard-count .ms { font-size: 16px; }

.pcard-body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex-grow: 1; }
.pcard-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--text-subtle); font-size: .85rem; font-weight: 500; margin-bottom: 10px; }
.pcard-meta .ms { font-size: 18px; color: var(--primary); }
.pcard-body h3 { font-size: 1.4rem; margin-bottom: 8px; }
.pcard-chamada { color: var(--primary); font-weight: 600; font-size: 1rem; margin-bottom: 10px; }
.pcard-desc { color: var(--text-muted); font-size: .97rem; flex-grow: 1; }
.pcard-metrics { display: flex; gap: 26px; margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pcard-metrics b { display: block; font-family: 'Sora', sans-serif; font-size: 1.35rem; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pcard-metrics small { color: var(--text-subtle); font-size: .8rem; }

.pcard-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pcard-thumb {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px;
  background-size: cover; background-position: center;
  border: 1px solid var(--border); cursor: zoom-in; overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.pcard-thumb::before { content: ''; position: absolute; inset: 0; background: rgba(79, 70, 229, 0); transition: background .25s; }
.pcard-thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pcard-thumb:hover::before { background: rgba(79, 70, 229, .22); }
.pcard-thumb .ms {
  position: absolute; inset: 0; margin: auto; width: 36px; height: 36px;
  display: grid; place-items: center; color: #fff; font-size: 22px; z-index: 2;
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s;
}
.pcard-thumb:hover .ms { opacity: 1; transform: scale(1); }

/* ============================= LIGHTBOX ============================== */
.lightbox {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 30px;
  background: rgba(6, 10, 25, .92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden; transition: opacity .3s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-figure { margin: 0; max-width: min(1100px, 92vw); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lb-img { max-width: 100%; max-height: 78vh; border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7); object-fit: contain; transform: scale(.96); transition: transform .3s var(--ease); background: #0b1020; }
.lightbox.open .lb-img { transform: scale(1); }
.lb-caption { color: rgba(255, 255, 255, .85); font-size: .95rem; text-align: center; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: background .2s, transform .2s; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lb-close .ms, .lb-prev .ms, .lb-next .ms { font-size: 28px; }
.lb-close { top: 22px; right: 22px; }
.lb-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 22px; top: 50%; transform: translateY(-50%); }
.lb-close:hover { background: rgba(255, 255, 255, .22); }
.lb-prev:hover { background: rgba(255, 255, 255, .22); transform: translateY(-50%) scale(1.08); }
.lb-next:hover { background: rgba(255, 255, 255, .22); transform: translateY(-50%) scale(1.08); }
.lb-counter { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .7); font-size: .85rem; letter-spacing: .05em; }

/* ==================== Responsivo (projetos/lightbox) ================= */
@media (max-width: 860px) {
  .projects { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 640px) {
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
  .lb-close { top: 14px; right: 14px; }
  .pcard-body { padding: 20px; }
}
