/* nilalisson.com.br — identidade: documento de especificação
   Paleta: papel frio, tinta escura, teal regulatório como único acento */
:root {
  --paper: #F5F7F6;
  --card: #FFFFFF;
  --ink: #1C2B33;
  --ink-soft: #51626B;
  --accent: #0E7C66;
  --accent-soft: #DCEFEA;
  --rule: #D6DEDB;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0rem;
}

.mono { font-family: var(--mono); }
.small { font-size: 0.8rem; }

a { color: var(--accent); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.6rem;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  border-bottom: 1px solid var(--rule);
  background: var(--card);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.brand-dot { color: var(--accent); }
.topbar nav { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--ink-soft); font-size: 0.92rem; }
.topbar nav a.nav-tool { color: var(--accent); font-weight: 600; }
.lang {
  font-family: var(--mono); font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--rule); padding: 0.25rem 0.6rem; border-radius: 4px; color: var(--ink);
}

/* ---------- hero ---------- */
.hero { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem) 3rem; max-width: 72rem; margin-inline: auto; }
.eyebrow {
  color: var(--accent); font-size: 0.78rem; letter-spacing: 0.12em; margin-bottom: 1.2rem;
}
.story {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.35; max-width: 54rem; margin-bottom: 1.8rem;
}
.gherkin {
  border-left: 3px solid var(--accent);
  background: var(--card);
  padding: 1rem 1.3rem; font-size: 0.92rem; max-width: 52rem;
  margin-bottom: 2rem;
}
.gherkin p { margin: 0.25rem 0; }
.gherkin .kw { color: var(--accent); font-weight: 600; }

.cta-row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 0.65rem 1.2rem; border-radius: 5px;
  border: 1px solid var(--ink); color: var(--ink); font-weight: 600; font-size: 0.95rem;
  background: transparent; cursor: pointer; font-family: var(--sans);
}
.btn:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #0A614F; border-color: #0A614F; }
.btn.small-btn { padding: 0.35rem 0.7rem; font-size: 0.8rem; }

/* ---------- blocks ---------- */
.block { padding: 2.6rem clamp(1rem, 5vw, 4rem); max-width: 72rem; margin-inline: auto; }
.block-head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 1.2rem; }
.block-head h2 { font-family: var(--serif); font-size: 1.6rem; }
.req-id {
  color: var(--accent); background: var(--accent-soft);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem; border-radius: 3px; white-space: nowrap;
}
.block > p { max-width: 54rem; margin-bottom: 0.9rem; }
.note { color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- experience ---------- */
.timeline { border-left: 1px solid var(--rule); padding-left: 1.4rem; }
.job { margin-bottom: 1.8rem; position: relative; }
.job::before {
  content: ""; position: absolute; left: -1.72rem; top: 0.45rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper);
}
.job h3 { font-family: var(--serif); font-size: 1.12rem; margin: 0.3rem 0 0.1rem; }
.job-meta { color: var(--ink-soft); font-size: 0.8rem; margin-bottom: 0.4rem; }
.job p:last-child { max-width: 52rem; }

/* ---------- cases ---------- */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.1rem; }
.case {
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1.2rem 1.3rem;
}
.case h3 { font-family: var(--serif); font-size: 1.05rem; margin: 0.5rem 0 0.8rem; }
.case dt {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-top: 0.6rem;
}
.case dd { margin: 0.15rem 0 0; font-size: 0.93rem; }

/* ---------- skills ---------- */
.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.skill { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.2rem; }
.skill h3 { font-family: var(--serif); font-size: 1rem; margin-bottom: 0.4rem; }
.skill p { color: var(--ink-soft); }

.contact-links { font-size: 0.9rem; }

footer { padding: 2rem clamp(1rem, 5vw, 4rem); border-top: 1px solid var(--rule); color: var(--ink-soft); }

/* ---------- interview map ---------- */
.map { padding: 2.5rem clamp(1rem, 5vw, 4rem) 4rem; max-width: 60rem; margin-inline: auto; }
.map h1 { font-family: var(--serif); font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.4rem; }
.map .note { margin-bottom: 1.6rem; }

details.node {
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  margin-bottom: 0.8rem; overflow: hidden;
}
details.node > summary {
  cursor: pointer; padding: 0.9rem 1.2rem;
  font-family: var(--serif); font-weight: 600; font-size: 1.08rem;
  display: flex; align-items: center; gap: 0.7rem; list-style: none;
}
details.node > summary::-webkit-details-marker { display: none; }
details.node > summary::after { content: "+"; margin-left: auto; font-family: var(--mono); color: var(--accent); }
details.node[open] > summary::after { content: "–"; }
.leafs { padding: 0 1.2rem 1rem; }

details.leaf { border-top: 1px solid var(--rule); }
details.leaf > summary {
  cursor: pointer; padding: 0.65rem 0.2rem; font-weight: 600; font-size: 0.95rem; list-style: none;
}
details.leaf > summary::-webkit-details-marker { display: none; }
details.leaf > summary::before { content: "▸ "; color: var(--accent); }
details.leaf[open] > summary::before { content: "▾ "; }
details.leaf p {
  padding: 0 0.2rem 0.8rem 1.1rem; font-size: 0.93rem; color: var(--ink);
  border-left: 2px solid var(--accent-soft); margin-left: 0.3rem;
}

/* ---------- print (mapa de entrevista vira folha de cola) ---------- */
@media print {
  .topbar, footer { display: none; }
  body { background: #fff; font-size: 11pt; }
  details, details.node, details.leaf { border: none; }
  details > summary { padding: 0.3rem 0; }
  /* truque: o conteúdo de details fechado não imprime; usar "Abrir tudo" antes */
}

@media (max-width: 600px) {
  .topbar nav { gap: 0.7rem; font-size: 0.85rem; }
  .timeline { padding-left: 1rem; }
  .job::before { left: -1.32rem; }

  /* chat vira bottom-sheet de tela cheia; 100dvh acompanha a barra de endereço */
  .chat-panel {
    inset: 0; width: 100vw; height: 100vh; height: 100dvh;
    border-radius: 0; border: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .chat-head { padding-top: max(0.85rem, env(safe-area-inset-top)); }
  /* 16px evita o zoom automático do iOS ao focar o campo */
  .chat-form input { font-size: 16px; }
  /* o widget EXP não compete com o chat aberto */
  body:has(.chat-panel:not([hidden])) .game-box { display: none; }
}

/* ---------- chat widget ---------- */
.chat-fab {
  position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 50;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 0.7rem 1.2rem; font-family: var(--sans); font-weight: 600; font-size: 0.95rem;
  cursor: pointer; box-shadow: 0 4px 14px rgba(14, 124, 102, 0.35);
}
.chat-fab:hover { background: #0A614F; }

.chat-panel[hidden] { display: none !important; }
.chat-panel {
  position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 70;
  width: min(380px, calc(100vw - 2rem)); height: min(540px, calc(100vh - 4rem));
  height: min(540px, calc(100dvh - 4rem));
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 8px 30px rgba(28, 43, 51, 0.18);
}
.chat-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--rule); background: var(--paper);
}
.chat-sub { font-size: 0.68rem; color: var(--ink-soft); margin-top: 0.15rem; }
.chat-close {
  background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink-soft); line-height: 1;
  min-width: 44px; min-height: 44px; margin: -0.5rem -0.5rem 0 0; display: flex; align-items: center; justify-content: center;
}
.chat-close:hover { color: var(--ink); }
.chat-min {
  background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--ink-soft); line-height: 1;
  min-width: 44px; min-height: 44px; margin: -0.5rem 0 0 0; display: flex; align-items: center; justify-content: center;
}
.chat-min:hover { color: var(--ink); }
.chat-head-btns { display: flex; align-items: flex-start; }

.chat-log { flex: 1; overflow-y: auto; padding: 0.9rem; display: flex; flex-direction: column; gap: 0.55rem; }
.chat-msg { max-width: 85%; padding: 0.55rem 0.8rem; border-radius: 8px; font-size: 0.9rem; line-height: 1.5; }
.chat-msg.bot { background: var(--paper); border: 1px solid var(--rule); align-self: flex-start; }
.chat-msg.user { background: var(--accent); color: #fff; align-self: flex-end; }
.chat-msg.wait { color: var(--ink-soft); font-style: italic; }

.chat-pipe { align-self: flex-start; max-width: 95%; font-size: 0.68rem; color: var(--ink-soft);
  border-left: 2px solid var(--accent-soft); padding-left: 0.6rem; }
.chat-pipe summary { cursor: pointer; color: var(--accent); }
.chat-pipe p { margin: 0.2rem 0; }

.chat-wa { align-self: flex-start; font-size: 0.85rem; border-color: var(--accent); color: var(--accent); }

.chat-form { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid var(--rule); }
.chat-form input {
  flex: 1; padding: 0.55rem 0.7rem; border: 1px solid var(--rule); border-radius: 6px;
  font-family: var(--sans); font-size: 0.9rem;
}
.chat-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- documented cases ---------- */
.docs-h { font-family: var(--serif); font-size: 1.3rem; margin-top: 2.4rem; margin-bottom: 0.3rem; }
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; margin-top: 1rem; }
.doc-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 6px;
  padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.4rem;
}
.doc-card h4 { font-family: var(--serif); font-size: 1.05rem; margin: 0.5rem 0 0; }
.doc-tag { color: var(--accent); }
.doc-card p:not(.doc-tag) { font-size: 0.93rem; flex: 1; }
.doc-card .btn { align-self: flex-start; margin-top: 0.4rem; border-color: var(--accent); color: var(--accent); }
.doc-card .btn:hover { background: var(--accent); color: #fff; }

/* ---------- flagship projects ---------- */
.proj-h { font-family: var(--serif); font-size: 1.35rem; margin-bottom: 0.3rem; }
.projects { display: grid; grid-template-columns: 1fr; gap: 1.4rem; margin-top: 1rem; }
.project {
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: 1.6rem 1.7rem; border-top: 3px solid var(--accent);
}
.project h4 { font-family: var(--serif); font-size: 1.25rem; margin: 0.5rem 0 0.2rem; }
.proj-client { color: var(--accent); font-weight: 600; font-size: 0.85rem; margin-bottom: 0.6rem; }
.proj-meta { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.8rem; }
.proj-sub { color: var(--accent); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; margin: 0.9rem 0 0.4rem; }
.proj-scope-list { margin: 0 0 0.9rem; padding-left: 1.2rem; }
.proj-scope-list li { font-size: 0.92rem; margin-bottom: 0.4rem; }
.proj-actors { font-size: 0.9rem; color: var(--ink-soft); border-top: 1px solid var(--rule); padding-top: 0.7rem; }
@media (min-width: 760px) { .projects { grid-template-columns: 1fr 1fr; } }

/* ---------- github card ---------- */
.git-card { margin-top: 2.4rem; background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--accent); border-radius: 8px; padding: 1.5rem 1.7rem; }
.git-card h3 { font-family: var(--serif); font-size: 1.25rem; margin: 0.5rem 0 0.4rem; }
.git-card .btn { margin-top: 0.8rem; display: inline-block; }

/* ---------- certificações ---------- */
.certs { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-top: 1rem; }
.cert { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 1rem 1.1rem; }
.cert-tag { display: inline-block; background: var(--accent); color: #fff; border-radius: 3px; padding: 0.1rem 0.5rem; font-size: 0.68rem; letter-spacing: 0.05em; }
.cert h4 { font-size: 0.98rem; margin: 0.55rem 0 0.25rem; }
.cert p { color: var(--ink-soft); }

/* ---------- IA neste site ---------- */
.ai-block { border-top: 3px solid var(--accent); background: linear-gradient(180deg, rgba(14,124,102,0.05), transparent 55%); border-radius: 8px; padding-top: 1.4rem; }
.chips-label { color: var(--accent); margin-top: 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 0.5rem 0 1.4rem; }
.chip { font: inherit; font-size: 0.86rem; background: #fff; border: 1px solid var(--accent); color: var(--accent); border-radius: 999px; padding: 0.42rem 0.95rem; cursor: pointer; transition: 0.15s; }
.chip:hover { background: var(--accent); color: #fff; }
.treino-card { background: var(--card); border: 1px dashed var(--accent); border-radius: 8px; padding: 1.3rem 1.5rem; }
.treino-card h3 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: 0.3rem; }
.treino-card .btn { margin-top: 0.7rem; display: inline-block; }

/* ---------- gamificação ---------- */
.game-box { position: fixed; left: 1rem; bottom: 1rem; z-index: 60; }
.game-toggle { font-size: 0.72rem; letter-spacing: 0.06em; background: #fff; border: 1px solid var(--rule); border-radius: 999px; padding: 0.4rem 0.85rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.game-toggle:hover { border-color: var(--accent); color: var(--accent); }
.game-panel { position: absolute; bottom: 2.6rem; left: 0; width: 250px; background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 0.9rem 1rem; box-shadow: 0 8px 28px rgba(0,0,0,0.12); }
.game-title { color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5rem; }
.game-list { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.game-list li { font-size: 0.85rem; padding: 0.18rem 0; color: var(--ink-soft); }
.game-list li.got { color: var(--ink); }
.game-list li.got .mono { color: var(--accent); }
.game-hint { color: var(--ink-soft); }
.game-toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: 8px; padding: 0.6rem 1.1rem; opacity: 0; transition: 0.3s; z-index: 70; display: flex; flex-direction: column; gap: 0.05rem; }
.game-toast.show { opacity: 1; transform: translate(-50%, 0); }
.game-toast .mono { color: #9fd8cb; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---------- simulador de entrevista ---------- */
.sim-wrap { max-width: 760px; margin: 0 auto; }
.sim-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.9rem; margin: 1.2rem 0 1.6rem; }
.sim-role { font: inherit; text-align: left; background: var(--card); border: 1px solid var(--rule); border-radius: 8px; padding: 1rem 1.1rem; cursor: pointer; transition: 0.15s; }
.sim-role:hover, .sim-role.active { border-color: var(--accent); box-shadow: 0 2px 10px rgba(14,124,102,0.12); }
.sim-role h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.sim-role p { font-size: 0.82rem; color: var(--ink-soft); }
.sim-log { background: #fff; border: 1px solid var(--rule); border-radius: 8px; min-height: 300px; max-height: 55vh; overflow-y: auto; padding: 1rem; margin-bottom: 0.8rem; }
.sim-msg { margin-bottom: 0.9rem; max-width: 92%; padding: 0.65rem 0.9rem; border-radius: 8px; font-size: 0.94rem; white-space: pre-wrap; }
.sim-msg.ai { background: var(--card); border: 1px solid var(--rule); }
.sim-msg.user { background: rgba(14,124,102,0.10); margin-left: auto; }
.sim-msg.fb { background: #fff8e6; border: 1px solid #e8d9a0; }
.sim-msg.wait { color: var(--ink-soft); font-style: italic; }
.sim-form { display: flex; gap: 0.6rem; }
.sim-form textarea { flex: 1; font: inherit; font-size: 0.94rem; border: 1px solid var(--rule); border-radius: 8px; padding: 0.7rem 0.9rem; resize: vertical; min-height: 76px; }
.sim-form textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.sim-actions { display: flex; gap: 0.6rem; align-items: flex-start; flex-direction: column; }
