/* facial360 — sistema visual do site público.
   Tokens definidos no :root claro; o modo escuro só redefine os tokens. */

:root {
  --ground: #F4F6F8;
  --surface: #FFFFFF;
  --surface-2: #EDF0F4;
  --ink: #191C22;
  --muted: #59616E;
  --line: #DCE1E8;
  --line-strong: #C3CAD4;
  --accent: #9A5600;
  --accent-soft: #FDF1DF;
  --ok: #1C6E45;
  --ok-soft: #E4F2EA;
  --deny: #A62119;
  --deny-soft: #FBE9E7;
  --code-bg: #1C2027;
  --code-ink: #E3E7ED;
  --code-key: #E0A458;
  --code-str: #8FC79A;

  --font-display: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #13161B;
    --surface: #1A1E25;
    --surface-2: #21262F;
    --ink: #E6EAEF;
    --muted: #98A2B0;
    --line: #2A303A;
    --line-strong: #3A424E;
    --accent: #EFA85C;
    --accent-soft: #2A2116;
    --ok: #5CBE8C;
    --ok-soft: #16261E;
    --deny: #F0827A;
    --deny-soft: #2A1917;
    --code-bg: #101318;
    --code-ink: #DDE2E9;
  }
}

:root[data-theme="dark"] {
  --ground: #13161B;
  --surface: #1A1E25;
  --surface-2: #21262F;
  --ink: #E6EAEF;
  --muted: #98A2B0;
  --line: #2A303A;
  --line-strong: #3A424E;
  --accent: #EFA85C;
  --accent-soft: #2A2116;
  --ok: #5CBE8C;
  --ok-soft: #16261E;
  --deny: #F0827A;
  --deny-soft: #2A1917;
  --code-bg: #101318;
  --code-ink: #DDE2E9;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.1rem, 4vw, 2.5rem) 5rem;
}

/* ---------- topo ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.topnav { display: flex; gap: 1.25rem; font-size: 0.85rem; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--accent); }

.masthead {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1.75rem;
  margin-bottom: 2.5rem;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.eyebrow span::after { content: "·"; margin-left: 0.75rem; color: var(--line-strong); }
.eyebrow span:last-child::after { content: ""; }

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 1.2rem + 3.4vw, 3.15rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0 0 0.9rem;
}
.lead {
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.16rem);
  color: var(--muted);
  max-width: 62ch;
  margin: 0;
}

/* ---------- layout de documento ---------- */
.layout { display: grid; gap: 3rem; align-items: start; }
@media (min-width: 960px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); gap: 3.5rem; }
  .toc { position: sticky; top: 2rem; }
}

.toc { font-size: 0.845rem; }
.toc-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.75rem;
}
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.42rem; }
.toc a { color: var(--muted); text-decoration: none; display: block; line-height: 1.35; }
.toc a:hover { color: var(--accent); }

a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

main { display: flex; flex-direction: column; gap: 3.25rem; min-width: 0; }
section { scroll-margin-top: 1.5rem; }

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.4rem, 1.15rem + 0.9vw, 1.78rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 1.1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 0.97rem; font-weight: 650; margin: 2rem 0 0.7rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 650; }
a { color: var(--accent); }

code {
  font-family: var(--font-mono);
  font-size: 0.855em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.1em 0.36em;
  white-space: nowrap;
}

/* ---------- blocos ---------- */
.split { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
@media (min-width: 620px) { .split { grid-template-columns: 1fr 1fr; } }

.party {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.15rem 1.25rem 1.25rem;
}
.party-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.party ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.party li { font-size: 0.92rem; }

.figure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5rem 1.25rem 1.1rem;
  overflow-x: auto;
}
.figure svg { display: block; min-width: 540px; width: 100%; height: auto; }
.fig-node { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; }
.fig-node-accent { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.25; }
.fig-label { fill: var(--ink); font-family: var(--font-body); font-size: 13px; font-weight: 600; }
.fig-sub { fill: var(--muted); font-family: var(--font-body); font-size: 11px; }
.fig-flow { stroke: var(--line-strong); stroke-width: 1.5; fill: none; }
.fig-arrow { fill: var(--line-strong); }
.fig-note { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; }
.caption { font-size: 0.82rem; color: var(--muted); margin: 0.9rem 0 0; max-width: none; }

.code {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 4px;
  padding: 1.05rem 1.2rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 0 0 1.1rem;
  border: 1px solid var(--line);
}
.code code { background: none; border: none; padding: 0; white-space: pre; font-size: inherit; }
.k { color: var(--code-key); }
.s { color: var(--code-str); }
.c { color: #7C8798; }

.endpoint {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 3px;
  padding: 0.7rem 0.95rem;
  margin: 0 0 1.1rem;
  overflow-x: auto;
  white-space: nowrap;
}
.verb { color: var(--accent); font-weight: 700; }

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.15rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
table { border-collapse: collapse; width: 100%; font-size: 0.875rem; min-width: 480px; }
th, td { text-align: left; padding: 0.62rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  background: var(--surface-2);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.mono, .tnum { font-family: var(--font-mono); font-size: 0.83rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.req { color: var(--deny); font-weight: 600; }
.opt { color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.85rem; counter-reset: s; }
.steps li {
  counter-increment: s;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.95rem 1.1rem 0.95rem 3.1rem;
  position: relative;
  font-size: 0.93rem;
}
.steps li::before {
  content: counter(s);
  position: absolute;
  left: 1.05rem;
  top: 0.95rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
  width: 1.4rem;
  height: 1.4rem;
  display: grid;
  place-items: center;
  line-height: 1;
}

.note {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 4px 4px 0;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.15rem;
  font-size: 0.9rem;
}
.note p { max-width: none; }
.note-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.12em 0.5em;
  border-radius: 3px;
  white-space: nowrap;
}
.pill-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.pill-deny { background: var(--deny-soft); color: var(--deny); border: 1px solid var(--deny); }

.asks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  overflow: hidden;
}
.asks li { padding: 0.95rem 1.15rem; border-bottom: 1px solid var(--line); font-size: 0.93rem; }
.asks li:last-child { border-bottom: none; }
.ask-q { font-weight: 650; display: block; margin-bottom: 0.2rem; }
.ask-why { color: var(--muted); font-size: 0.87rem; }

footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--muted);
}
footer p { max-width: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
