/* ============================================================
   TN Costa Tecnologia — Landing Page
   ============================================================ */

:root {
  --bg: #05070d;
  --bg-soft: #090c16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f5fb;
  --text-muted: #9aa3ba;
  --text-faint: #6b7488;
  --accent-blue: #4f7bff;
  --accent-violet: #9061f9;
  --accent-cyan: #35d0e0;
  --gradient: linear-gradient(120deg, var(--accent-blue), var(--accent-violet));
  --gradient-soft: linear-gradient(120deg, rgba(79,123,255,0.16), rgba(144,97,249,0.16));
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --maxw: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

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

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px var(--accent-blue);
}

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

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-head h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: 17px; }
.section-head.center { max-width: 680px; margin-left: auto; margin-right: auto; text-align: center; }

section { position: relative; padding: 110px 0; }

/* ---------- Background mesh ---------- */
.mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(560px 420px at 12% -6%, rgba(79,123,255,0.22), transparent 60%),
    radial-gradient(620px 480px at 92% 8%, rgba(144,97,249,0.18), transparent 60%),
    radial-gradient(520px 420px at 50% 100%, rgba(53,208,224,0.10), transparent 60%),
    var(--bg);
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Header ---------- */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, border-color 0.3s ease, padding 0.3s ease;
  border-bottom: 1px solid transparent;
}
header.scrolled {
  background: rgba(5, 7, 13, 0.78);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  padding: 12px 0;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-faint); letter-spacing: 0.04em; margin-top: 1px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-cta { display: flex; align-items: center; gap: 18px; }

.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(79, 123, 255, 0.55);
}
.btn-primary:hover { box-shadow: 0 10px 30px -6px rgba(144, 97, 249, 0.65); transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-strong); }

.btn-sm { padding: 10px 18px; font-size: 13.5px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding: 190px 0 130px;
  position: relative;
}
.hero-inner { max-width: 780px; }
.hero h1 {
  font-size: clamp(38px, 6vw, 62px);
  margin-bottom: 22px;
}
.hero .lede {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 38px;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 64px; }

.hero-visual {
  position: relative;
  margin-top: 20px;
}
.code-card {
  background: rgba(9, 12, 22, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-width: 640px;
}
.code-card .dots { display: flex; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.code-card .dots span { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.12); }
.code-card pre {
  padding: 22px 24px 26px;
  font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.75;
  overflow-x: auto;
  color: #b7c0d8;
}
.code-card .c1 { color: #6b7488; }
.code-card .c2 { color: #6ee7c9; }
.code-card .c3 { color: #82aaff; }
.code-card .c4 { color: #f3f5fb; }
.code-card .c5 { color: #ffb86b; }

/* ---------- Credibility bar ---------- */
.cred-bar {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cred-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.cred-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.cred-item .ico {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--accent-cyan);
}
.cred-item p { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ---------- Bento services ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(200px, auto);
  gap: 18px;
}
.bento-card {
  grid-column: span 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
  position: relative;
  overflow: hidden;
}
.bento-card:hover { border-color: var(--border-strong); transform: translateY(-3px); background: var(--surface-strong); }
.bento-card.wide { grid-column: span 4; }
.bento-card.featured {
  background: linear-gradient(155deg, rgba(79,123,255,0.10), rgba(144,97,249,0.08));
  border-color: rgba(144,97,249,0.35);
}
.bento-card .ico {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  margin-bottom: 4px;
}
.bento-card h3 { font-size: 19px; }
.bento-card p { color: var(--text-muted); font-size: 14.5px; }
.bento-card .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.bento-card .tag {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
}

/* ---------- AI highlight ---------- */
.ai-section {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(144,97,249,0.28);
  background: linear-gradient(160deg, rgba(79,123,255,0.08), rgba(144,97,249,0.05) 60%, transparent);
  padding: 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.ai-copy h2 { font-size: clamp(26px, 3.6vw, 36px); margin-bottom: 16px; }
.ai-copy > p { color: var(--text-muted); font-size: 16.5px; margin-bottom: 28px; }
.ai-list { display: flex; flex-direction: column; gap: 16px; }
.ai-list li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; color: var(--text); }
.ai-list .check {
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; margin-top: 1px;
  background: var(--gradient-soft); border: 1px solid rgba(144,97,249,0.4);
  display: flex; align-items: center; justify-content: center; color: var(--accent-cyan);
}
/* ---------- WhatsApp mockup (Automação & IA) ---------- */
.wa-frame {
  background: rgba(9,12,22,0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.wa-top {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.wa-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--gradient); color: #fff; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.wa-who { display: flex; flex-direction: column; gap: 3px; margin-right: auto; }
.wa-who strong { font-size: 14.5px; font-weight: 600; }
.wa-who span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.wa-dot { width: 7px; height: 7px; border-radius: 50%; background: #35e07e; box-shadow: 0 0 8px #35e07e; flex-shrink: 0; }
.wa-badge { flex-shrink: 0; opacity: 0.85; }
.wa-body { padding: 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; }
.chat-msg .bubble { background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 12px; border-bottom-left-radius: 4px; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; color: var(--text-muted); max-width: 82%; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.user .bubble { background: var(--gradient-soft); color: var(--text); border-radius: 12px; border-bottom-right-radius: 4px; border-color: rgba(144,97,249,0.3); }
/* Typing dots are pure decoration — hidden unless JS explicitly shows one at a time.
   Without JS every real message is already visible by default (see .wa-armed rule below). */
.wa-typing { display: none; align-self: flex-start; gap: 4px; padding: 11px 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 12px; border-bottom-left-radius: 4px; }
.wa-typing.show { display: inline-flex; }
.wa-typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-cyan); opacity: 0.5; animation: wa-blink 1.2s infinite ease-in-out; }
.wa-typing i:nth-child(2) { animation-delay: 0.2s; }
.wa-typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes wa-blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
/* Progressive enhancement: full conversation visible by default; JS arms the staged reveal */
.wa-body.wa-armed > .chat-msg,
.wa-body.wa-armed > .wa-card { opacity: 0; transform: translateY(6px); transition: opacity 0.35s ease, transform 0.35s ease; }
.wa-body.wa-armed > .chat-msg.in,
.wa-body.wa-armed > .wa-card.in { opacity: 1; transform: translateY(0); }
.wa-card {
  align-self: flex-start; max-width: 82%;
  background: rgba(53,208,224,0.06); border: 1px solid rgba(53,208,224,0.25); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; margin-top: 2px;
}
.wa-card-row { display: flex; gap: 10px; align-items: flex-start; }
.wa-card-row svg { color: var(--accent-cyan); flex-shrink: 0; margin-top: 2px; }
.wa-card-row strong { display: block; font-size: 13.5px; font-weight: 600; color: var(--text); }
.wa-card-row span { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.wa-card-foot { font-size: 12px; color: var(--accent-cyan); border-top: 1px dashed rgba(53,208,224,0.25); padding-top: 10px; }

/* ---------- Process ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.process-step {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  background: var(--surface);
  position: relative;
}
.process-step .num {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.process-step h3 { font-size: 17px; margin-bottom: 10px; }
.process-step p { font-size: 14px; color: var(--text-muted); }
.process-step::after {
  content: '';
  position: absolute;
  top: 30px; right: -20px;
  width: 20px; height: 1px;
  background: var(--border-strong);
  display: block;
}
.process-step:last-child::after { display: none; }

/* ---------- Portfolio ---------- */
.portfolio-grid { display: flex; flex-direction: column; gap: 26px; }
.portfolio-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  align-items: stretch;
}
.portfolio-card:nth-child(2) { grid-template-columns: 0.95fr 1.05fr; }
.portfolio-card:nth-child(2) .pf-media { order: 2; }
.pf-media {
  position: relative;
  min-height: 320px;
  background: #0b0f1c;
  overflow: hidden;
}
.pf-media img { width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0.94; transition: transform 0.5s ease, opacity 0.3s ease; }
.portfolio-card:hover .pf-media img { transform: scale(1.035); opacity: 1; }
.pf-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5,7,13,0.55));
}
.pf-body { padding: 44px 46px; display: flex; flex-direction: column; justify-content: center; }
.pf-tag {
  display: inline-flex; align-self: flex-start;
  font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(53,208,224,0.1); border: 1px solid rgba(53,208,224,0.25);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.pf-body h3 { font-size: 26px; margin-bottom: 12px; }
.pf-body p { color: var(--text-muted); font-size: 15px; margin-bottom: 22px; }
.pf-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.pf-meta span { font-size: 12.5px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.pf-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; color: var(--text); }
.pf-link svg { transition: transform 0.2s ease; }
.pf-link:hover svg { transform: translate(3px, -3px); }

/* ---------- Contact ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 60px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 56px;
}
.contact-info h2 { font-size: clamp(26px, 3.4vw, 34px); margin-bottom: 16px; }
.contact-info p { color: var(--text-muted); font-size: 15.5px; margin-bottom: 30px; }
.contact-list { display: flex; flex-direction: column; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: center; font-size: 14.5px; }
.contact-list .ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--gradient-soft); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--accent-cyan); flex-shrink: 0;
}
.contact-list a { color: var(--text); font-weight: 500; }
.contact-list a:hover { color: var(--accent-cyan); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field input, .field textarea {
  background: rgba(5,7,13,0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: rgba(79,123,255,0.06);
}
.field textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 12.5px; color: var(--text-faint); margin-top: 12px; }
.form-status { font-size: 14px; margin-top: 14px; display: none; padding: 12px 14px; border-radius: var(--radius-sm); }
.form-status.show { display: block; }
.form-status.ok { background: rgba(53,208,224,0.1); border: 1px solid rgba(53,208,224,0.3); color: #8fe9f0; }
.form-status.err { background: rgba(249,97,97,0.1); border: 1px solid rgba(249,97,97,0.3); color: #ffb0b0; }

/* ---------- Final CTA strip ---------- */
.cta-strip {
  border-radius: var(--radius-lg);
  background: var(--gradient);
  padding: 56px 60px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.cta-strip h2 { color: #fff; font-size: clamp(22px, 3vw, 30px); max-width: 480px; }
.cta-strip .btn-ghost { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); color: #fff; }
.cta-strip .btn-ghost:hover { background: rgba(255,255,255,0.22); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 56px 0 34px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; margin-bottom: 40px; flex-wrap: wrap; }
.footer-brand p { color: var(--text-faint); font-size: 13.5px; margin-top: 10px; max-width: 300px; }
.footer-links { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; letter-spacing: 0.03em; }
.footer-col a, .footer-col span { display: block; font-size: 14px; color: var(--text-faint); margin-bottom: 10px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px;
  padding-top: 26px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-faint);
}

/* ---------- Reveal animation ----------
   Visible by default (no-JS / JS error / crawlers always see full content).
   Animation is progressive enhancement, only armed once JS confirms it can run it. */
.reveal { opacity: 1; transform: none; }
body.js-anim .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
body.js-anim .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .cred-grid { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .bento-card { grid-column: span 4; }
  .ai-section { grid-template-columns: 1fr; padding: 40px; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .process-step::after { display: none; }
  .portfolio-card, .portfolio-card:nth-child(2) { grid-template-columns: 1fr; }
  .portfolio-card:nth-child(2) .pf-media { order: 0; }
  .pf-media { min-height: 240px; }
  .contact-wrap { grid-template-columns: 1fr; padding: 34px; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links { display: none; }
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
  }
  .hero { padding: 150px 0 90px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  section { padding: 76px 0; }
  .cta-strip { flex-direction: column; text-align: center; padding: 44px 30px; }
  .footer-top { flex-direction: column; }
  .footer-links { gap: 36px; }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,7,13,0.98);
  backdrop-filter: blur(10px);
  display: flex; flex-direction: column;
  padding: 26px 28px;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav .close-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 50px; }
.mobile-nav a { font-size: 22px; font-weight: 600; padding: 16px 0; border-bottom: 1px solid var(--border); }
