/* ============ Nil Alisson · novo site ============
   Dark theme compartilhado. Cada página define seu accent:
   body.theme-ba  (roxo)  · body.theme-ai (azul elétrico) · body.theme-hub (teal)
================================================== */
:root {
  --bg: #0b0f14;
  --bg-soft: #101722;
  --card: #131c29;
  --card-2: #182335;
  --line: #223047;
  --ink: #e8edf4;
  --ink-soft: #9fb0c3;
  --mono: "JetBrains Mono", "IBM Plex Mono", Consolas, monospace;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
}
body.theme-ba  { --accent: #a78bfa; --accent-2: #7c3aed; --glow: rgba(167,139,250,.14); }
body.theme-ai  { --accent: #5eead4; --accent-2: #2563eb; --glow: rgba(94,234,212,.12); }
body.theme-hub { --accent: #34d399; --accent-2: #0e7c66; --glow: rgba(52,211,153,.13); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); line-height: 1.65; font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.mono { font-family: var(--mono); }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(11,15,20,.82); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); }
.topnav { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.topnav a { color: var(--ink-soft); font-size: .92rem; }
.topnav a:hover { color: var(--ink); text-decoration: none; }
.topnav .lang { border: 1px solid var(--line); border-radius: 8px; padding: .2rem .6rem; font-family: var(--mono); font-size: .8rem; }
.topnav .pill { border-radius: 999px; padding: .4rem 1rem; font-size: .85rem; font-weight: 600; transition: .15s ease; border: 1.5px solid transparent; }
.topnav .pill-ba { border-color: #a78bfa88; color: #a78bfa; }
.topnav .pill-ba:hover { background: #a78bfa; color: #0b0f14; }
.topnav .pill-ai { border-color: #5eead488; color: #5eead4; }
.topnav .pill-ai:hover { background: #5eead4; color: #0b0f14; }
.topnav .pill-hub { border-color: #34d39988; color: #34d399; }
.topnav .pill-hub:hover { background: #34d399; color: #0b0f14; }
.gate-links .pill-accent { border: 1.5px solid var(--accent); color: var(--accent); }
.gate-links .pill-accent:hover { background: var(--accent); color: var(--bg); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: .35rem .6rem; font-size: 1.1rem; cursor: pointer; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(4rem, 10vw, 7rem) clamp(1rem, 5vw, 3rem) clamp(3rem, 7vw, 5rem);
  max-width: 74rem; margin-inline: auto;
  display: grid; grid-template-columns: 1.25fr .75fr; gap: 3rem; align-items: center;
}
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto auto; width: 60%; height: 120%;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
}
.kicker { font-family: var(--mono); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.12; font-weight: 800; letter-spacing: -.01em; }
.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { margin-top: 1.1rem; color: var(--ink-soft); font-size: 1.08rem; max-width: 38rem; }
.typedline { font-family: var(--mono); color: var(--accent); }
.typedline .cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cta-row { display: flex; gap: .8rem; margin-top: 1.8rem; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  border: 1.5px solid var(--accent); color: var(--accent); background: transparent;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.primary { background: linear-gradient(120deg, var(--accent-2), var(--accent)); border: none; color: #0b0f14; }
.social-row { display: flex; gap: 1rem; margin-top: 1.6rem; }
.social-row a { color: var(--ink-soft); font-size: .9rem; font-family: var(--mono); }
.social-row a:hover { color: var(--accent); }
.hero-photo { display: flex; justify-content: center; }
.hero-photo .ring {
  width: min(260px, 60vw); aspect-ratio: 1; border-radius: 50%;
  padding: 6px; background: linear-gradient(135deg, var(--accent), transparent 60%);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: var(--card-2); }
.hero-photo .ph {
  width: 100%; height: 100%; border-radius: 50%; background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); color: var(--ink-soft); font-size: .85rem; text-align: center; padding: 1rem;
}

/* ---------- seções ---------- */
main { max-width: 74rem; margin-inline: auto; padding: 0 clamp(1rem, 5vw, 3rem) 4rem; }
section { padding: clamp(2.2rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--line); }
.sec-kicker { font-family: var(--mono); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: .4rem 0 1.4rem; font-weight: 750; }
.lead { color: var(--ink-soft); max-width: 46rem; }

/* cards genéricos */
.grid { display: grid; gap: 1.1rem; margin-top: 1.4rem; }
.grid.c2 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.c3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card h3 { font-size: 1.08rem; margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .95rem; }
.card .tag { display: inline-block; font-family: var(--mono); font-size: .72rem; color: var(--accent); border: 1px solid var(--line); border-radius: 6px; padding: .1rem .5rem; margin: 0 .3rem .5rem 0; }
.card .link { display: inline-block; margin-top: .8rem; font-size: .9rem; font-weight: 600; }

/* experiência (timeline) */
.xp { border-left: 2px solid var(--line); padding-left: 1.4rem; margin-top: 1.4rem; display: grid; gap: 1.6rem; }
.xp-item { position: relative; }
.xp-item::before { content: ""; position: absolute; left: -1.78rem; top: .45rem; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.xp-item h3 { font-size: 1.05rem; }
.xp-item .org { color: var(--ink-soft); font-size: .92rem; }
.xp-item .period { font-family: var(--mono); font-size: .78rem; color: var(--accent); }
.xp-item ul { margin: .6rem 0 0 1.1rem; color: var(--ink-soft); font-size: .94rem; display: grid; gap: .35rem; }

/* skills pills */
.pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pill { font-family: var(--mono); font-size: .8rem; color: var(--ink); background: var(--card-2); border: 1px solid var(--line); padding: .3rem .7rem; border-radius: 999px; }

/* certs */
.cert { display: flex; gap: .9rem; align-items: baseline; }
.cert .badge { font-family: var(--mono); font-size: .72rem; color: var(--accent); white-space: nowrap; }

/* gateway (index) */
.gateway { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 3rem clamp(1rem,4vw,2rem); }
.gate-wrap { max-width: 62rem; width: 100%; text-align: center; }
.gate-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.4rem; margin-top: 2.4rem; text-align: left; }
.gate-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.8rem;
  transition: transform .18s ease, border-color .18s ease;
}
.gate-card:hover { transform: translateY(-4px); text-decoration: none; }
.gate-card.ba:hover { border-color: #a78bfa; }
.gate-card.ai:hover { border-color: #5eead4; }
.gate-card.hub:hover { border-color: #34d399; }
.gate-card h3 { font-size: 1.25rem; color: var(--ink); margin-bottom: .5rem; }
.gate-card p { color: var(--ink-soft); font-size: .94rem; }
.gate-card .go { display: inline-block; margin-top: 1rem; font-family: var(--mono); font-size: .85rem; }
.gate-card.ba .go, .gate-card.ba .ico { color: #a78bfa; }
.gate-card.ai .go, .gate-card.ai .ico { color: #5eead4; }
.gate-card.hub .go, .gate-card.hub .ico { color: #34d399; }
.gate-card .ico { font-size: 1.6rem; font-family: var(--mono); }
.gate-links { margin-top: 2.2rem; display: flex; gap: 1.4rem; justify-content: center; flex-wrap: wrap; }
.gate-links a { color: var(--ink-soft); font-family: var(--mono); font-size: .85rem; }
.gate-links a:hover { color: var(--ink); }

/* agentes hub */
.agent-card .status { font-family: var(--mono); font-size: .72rem; padding: .15rem .55rem; border-radius: 6px; }
.status.live { color: #34d399; border: 1px solid #34d39955; }
.status.soon { color: var(--ink-soft); border: 1px solid var(--line); }

/* footer */
footer { border-top: 1px solid var(--line); padding: 2rem clamp(1rem,4vw,2.5rem); color: var(--ink-soft); font-size: .88rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: 74rem; margin-inline: auto; }
footer .mono { font-size: .8rem; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.on { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- responsivo ---------- */
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3rem; }
  .hero-photo { order: -1; }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 1rem clamp(1rem,4vw,2.5rem); gap: .9rem; }
  .topnav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ============ widget de chat flutuante (Nil AI) ============ */
.chat-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 60;
  display: flex; align-items: center; gap: .55rem;
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
  color: #0b0f14; border: none; border-radius: 999px;
  padding: .8rem 1.15rem; font-family: var(--sans); font-weight: 700; font-size: .92rem;
  cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.chat-fab .dot { width: 8px; height: 8px; border-radius: 50%; background: #0b0f14; opacity: .7; }
.chat-fab.hidden { display: none; }

.chat-panel {
  position: fixed; bottom: 22px; right: 22px; z-index: 61;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 60px));
  display: none; flex-direction: column;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,.5); overflow: hidden;
}
.chat-panel.open { display: flex; }

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line);
  background: var(--card);
}
.chat-head .who { display: flex; align-items: center; gap: .6rem; }
.chat-head .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; color: #0b0f14; font-size: .8rem;
}
.chat-head .name { font-weight: 700; font-size: .95rem; }
.chat-head .status-line { font-size: .72rem; color: var(--accent); font-family: var(--mono); }
.chat-head .min { background: none; border: none; color: var(--ink-soft); font-size: 1.4rem; cursor: pointer; line-height: 1; padding: 0 .3rem; }
.chat-head .min:hover { color: var(--ink); }

.chat-body {
  flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .8rem;
}
.chat-msg { max-width: 85%; padding: .65rem .85rem; border-radius: 12px; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.chat-msg.bot { align-self: flex-start; background: var(--card-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg.user { align-self: flex-end; background: linear-gradient(120deg, var(--accent-2), var(--accent)); color: #0b0f14; border-bottom-right-radius: 4px; font-weight: 500; }
.chat-msg .fontes { display: block; margin-top: .5rem; font-size: .72rem; color: var(--ink-soft); font-family: var(--mono); }
.chat-typing { align-self: flex-start; color: var(--ink-soft); font-size: .85rem; font-family: var(--mono); padding: .3rem .2rem; }
.chat-typing span { animation: chatblink 1.2s infinite; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes chatblink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

.chat-foot { border-top: 1px solid var(--line); padding: .7rem; display: flex; gap: .5rem; background: var(--card); }
.chat-foot input {
  flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .8rem; color: var(--ink); font-family: var(--sans); font-size: 16px; outline: none;
}
.chat-foot input:focus { border-color: var(--accent); }
.chat-foot button {
  background: linear-gradient(120deg, var(--accent-2), var(--accent)); color: #0b0f14;
  border: none; border-radius: 10px; padding: 0 1rem; font-weight: 700; cursor: pointer; font-size: 1.1rem;
}
.chat-foot button:disabled { opacity: .5; cursor: default; }
.chat-disclaimer { font-size: .68rem; color: var(--ink-soft); text-align: center; padding: .4rem 1rem .6rem; font-family: var(--mono); }

@media (max-width: 560px) {
  .chat-panel { bottom: 0; right: 0; left: 0; width: 100vw; height: 68vh; max-height: 68vh; border-radius: 18px 18px 0 0; }
  .chat-fab { bottom: 16px; right: 16px; }
  .chat-head .min { font-size: 2.1rem; padding: .5rem .7rem; }
}
