/* páginas de estudo de caso: reaproveita os tokens e componentes de /style.css */

.back { font: 400 14px var(--mono); color: var(--ink-2); text-decoration: none; margin-left: auto; }
.back:hover { color: var(--accent); }

.case-hero { padding-top: 72px; padding-bottom: 40px; }
.case-hero h1 { font-size: clamp(36px, 6vw, 56px); font-weight: 700; letter-spacing: -0.035em; }
.case-hero .role { margin: 12px 0 18px; }
.case-hero .lede { max-width: 64ch; }
.case-hero .tags { margin: 0 0 28px; }

.facts {
  margin: 40px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.facts div { background: var(--surface); padding: 16px 18px; }
.facts dt { font: 400 12px var(--mono); color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 15px; font-weight: 500; color: var(--ink); }

.prose { max-width: 70ch; color: var(--ink-2); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 20px; }
.prose li { margin: 6px 0; }
.prose code, .note code {
  font: 400 .88em var(--mono); background: var(--accent-soft); color: var(--ink);
  padding: 1px 6px; border-radius: 4px;
}

/* decisões técnicas */
.decisions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.decision { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.decision h3 { font-size: 17px; font-weight: 600; }
.decision p { color: var(--ink-2); font-size: 15px; margin: 8px 0 0; }

/* diagrama de fluxo */
.flow {
  list-style: none; margin: 0; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 0;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface);
}
.flow li { padding: 18px; border-right: 1px solid var(--line); position: relative; counter-increment: step; }
.flow li:last-child { border-right: 0; }
.flow li::before { content: "0" counter(step); font: 500 12px var(--mono); color: var(--accent); }
.flow li:not(:last-child)::after {
  content: "\2192"; position: absolute; right: -9px; top: 16px; z-index: 1;
  width: 18px; text-align: center; background: var(--surface); color: var(--accent); font: 500 14px var(--mono);
}
.flow strong { display: block; margin-top: 6px; font-size: 15px; }
.flow span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.flow li.guard { background: var(--accent-soft); }

.note {
  margin: 20px 0 0; padding: 14px 18px; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 8px 8px 0; color: var(--ink-2); font-size: 15px; max-width: 70ch;
}

/* console de demonstração (EntreSentidos) */
.console { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.console-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid var(--line); font: 400 12px var(--mono); color: var(--muted);
}
.console-body { padding: 20px 18px; }
.ask { display: flex; gap: 8px; }
.ask input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: 400 15px var(--sans);
}
.ask input:focus { outline: none; border-color: var(--accent); }
.ask .btn { height: 44px; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.chips button {
  font: 400 12px var(--mono); color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.chips button:hover { border-color: var(--accent); color: var(--accent); }
.answer { margin-top: 18px; min-height: 24px; }
.answer[hidden] { display: none; }
.answer p { margin: 0; white-space: pre-line; color: var(--ink); }
.answer .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.badge { font: 500 11px var(--mono); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.badge.ok { border-color: var(--signal); color: var(--signal); }
.badge.warn { border-color: var(--accent); color: var(--accent); }
.answer .src { margin-top: 10px; font-size: 13px; color: var(--muted); }
.answer.err p { color: var(--accent); }

/* demo em moldura de celular (RepublicApp) */
.demo { display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.phone {
  width: 380px; height: 760px; border: 10px solid var(--ink); border-radius: 36px; overflow: hidden;
  background: var(--bg); box-shadow: 0 30px 60px -30px rgba(0,0,0,.4);
}
.phone iframe { width: 100%; height: 100%; border: 0; display: block; }
.creds { margin: 18px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font: 400 14px var(--mono); }
.creds dt { color: var(--muted); }
.creds dd { margin: 0; color: var(--ink); }
.creds button {
  margin-left: 8px; font: 400 11px var(--mono); color: var(--accent); background: none;
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 8px; cursor: pointer;
}

.next { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; }

@media (max-width: 900px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: 1fr; }
  .flow li { border-right: 0; border-bottom: 1px solid var(--line); }
  .flow li:last-child { border-bottom: 0; }
  .flow li:not(:last-child)::after { content: "\2193"; right: auto; left: 18px; top: auto; bottom: -11px; }
  .demo { grid-template-columns: 1fr; }
  .phone { display: none; }
}
@media (max-width: 640px) {
  .decisions { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .ask { flex-direction: column; }
}
