:root {
  --ink: #0d1014;
  --ink-2: #161a20;
  --ink-3: #232831;
  --ink-line: rgba(244, 241, 234, 0.1);
  --paper: #f4f1ea;
  --paper-2: #ebe7dd;
  --card: #fbfaf6;
  --text: #15181d;
  --text-2: #4d535c;
  --text-3: #80868f;
  --line: #ddd8cc;
  --accent: #3b5bdb;
  --accent-soft: #e4e8f8;
  --on-ink: #f4f1ea;
  --on-ink-2: #a9aeb6;
  --ok: #2f7a55;
  --ok-soft: #e1efe6;
  --warn: #9a6a12;
  --warn-soft: #f4ead2;
  --bad: #a3392f;
  --bad-soft: #f4e0dc;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-light:hover { background: #fff; }
.btn-ghost { border-color: var(--ink-line); color: var(--on-ink); }
.btn-ghost:hover { border-color: rgba(244, 241, 234, .35); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-3); }
.btn-outline:disabled { opacity: .4; cursor: default; }
.btn-text { background: none; border: 0; color: var(--text-2); padding: 0 8px; height: 36px; }
.btn-text:hover { color: var(--text); }

/* Navegação */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 16, 20, .94); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--ink-line); color: var(--on-ink);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 24px; letter-spacing: -.01em; }
.logo.small { font-size: 18px; gap: 8px; }
.nav-links { display: flex; gap: 32px; font-size: 14px; color: var(--on-ink-2); }
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--on-ink); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--ink); color: var(--on-ink); }
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--ink-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 20%, transparent 75%);
  opacity: .55;
}
.hero-inner {
  position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: 64px;
  align-items: center; padding-top: 112px; padding-bottom: 120px;
}
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--on-ink-2); margin-bottom: 24px; }
.eyebrow.dark { color: var(--text-3); margin-bottom: 16px; }
.hero h1 { font-family: var(--serif); font-size: clamp(44px, 6.2vw, 80px); line-height: 1.02; letter-spacing: -.025em; }
.lede { margin-top: 28px; max-width: 520px; font-size: 18px; color: var(--on-ink-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; padding-top: 72px; padding-bottom: 80px; }
}

.terminal {
  background: linear-gradient(180deg, var(--ink-2), #11151a);
  border: 1px solid var(--ink-line); border-radius: 14px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .6);
  overflow: hidden; min-width: 0;
}
.terminal-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--ink-line); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); }
.terminal-title { margin-left: 10px; font: 12px var(--mono); color: var(--on-ink-2); }
.terminal-query { padding: 14px 18px; font-size: 12.5px; color: var(--on-ink-2); border-bottom: 1px solid var(--ink-line); overflow-x: auto; white-space: nowrap; }
.prompt { color: var(--on-ink); margin-right: 4px; }
.kw { color: #8ea2ff; }
.feed { list-style: none; margin: 0; padding: 6px 0; }
.feed li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: baseline; padding: 12px 18px; border-bottom: 1px solid rgba(244, 241, 234, .05); }
.feed li:last-child { border-bottom: 0; }
.feed .f-date { font: 12px var(--mono); color: var(--on-ink-2); }
.feed .f-name { font-size: 14.5px; min-width: 0; }
.feed .f-name small { display: block; color: var(--on-ink-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .f-val { font: 13px var(--mono); color: var(--on-ink); text-align: right; white-space: nowrap; }
.feed-skel { height: 58px; background: linear-gradient(90deg, transparent, rgba(244, 241, 234, .04), transparent); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Seções */
.section { padding: 120px 0; }
.section-alt { background: var(--paper-2); }
@media (max-width: 640px) { .section { padding: 80px 0; } }
.section-head { max-width: 720px; margin-bottom: 56px; }
.section h2, .cta h2 { font-family: var(--serif); font-size: clamp(32px, 4.2vw, 52px); line-height: 1.08; letter-spacing: -.02em; }
.section-lede { margin-top: 20px; font-size: 17px; color: var(--text-2); max-width: 620px; }

.pillars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.pillars li { padding: 32px 28px 8px 0; border-right: 1px solid var(--line); }
.pillars li + li { padding-left: 28px; }
.pillars li:last-child { border-right: 0; }
.pillars .num { font-size: 12px; color: var(--text-3); }
.pillars h3 { font-family: var(--serif); font-size: 26px; margin: 28px 0 12px; }
.pillars p { color: var(--text-2); font-size: 15px; }
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr 1fr; }
  .pillars li { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 20px 28px 0 !important; }
  .pillars li:nth-child(odd) { border-right: 1px solid var(--line); }
  .pillars li:nth-child(even) { padding-left: 20px !important; }
}
@media (max-width: 560px) {
  .pillars { grid-template-columns: 1fr; }
  .pillars li { border-right: 0 !important; padding: 24px 0 !important; }
}

/* Dados */
.data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
@media (max-width: 960px) { .data-grid { grid-template-columns: 1fr; gap: 48px; } }
.layers { margin: 40px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.layers > div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.layers dt { font-weight: 500; }
.layers dd { margin: 0; color: var(--text-2); font-size: 15px; }
@media (max-width: 560px) { .layers > div { grid-template-columns: 1fr; gap: 4px; } }
.sources { margin-top: 24px; font-size: 12px; color: var(--text-3); letter-spacing: .02em; }

.record { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 30px 60px -40px rgba(20, 24, 30, .35); min-width: 0; }
.record-head { display: flex; justify-content: space-between; align-items: center; }
.record-id { font-size: 12px; color: var(--text-3); }
.record-title { font-family: var(--serif); font-size: 30px; line-height: 1.15; margin-top: 20px; }
.record-sub { color: var(--text-2); margin-top: 6px; font-size: 15px; }
.record-fields { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0 20px; border-top: 1px solid var(--line); }
.record-fields > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.record-fields dt { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.record-fields dd { margin: 4px 0 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.record-fields dd small, .d-fields dd small { display: block; color: var(--text-3); font-size: 12.5px; }
.record figcaption { font-size: 12px; color: var(--text-3); overflow-wrap: anywhere; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.concluida { background: var(--ok-soft); color: var(--ok); }
.pill.anunciada { background: var(--accent-soft); color: var(--accent); }
.pill.cancelada { background: var(--warn-soft); color: var(--warn); }
.pill.bloqueada { background: var(--bad-soft); color: var(--bad); }

/* Estatísticas */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 20px; }
.stat { padding: 20px 22px; border-right: 1px solid var(--line); display: grid; gap: 4px; min-width: 0; }
.stat:last-child { border-right: 0; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-family: var(--serif); font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12.5px; color: var(--text-3); }
@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* Filtros */
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--text-3); }
.filters select, .filters input[type="search"] {
  height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 0 10px; font-size: 14px; color: var(--text);
}
.filters select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2380868f' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.filters select:focus, .filters input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.f-search { position: relative; flex: 1 1 240px; }
.f-search svg { position: absolute; left: 12px; bottom: 11px; color: var(--text-3); }
.f-search input { width: 100%; padding-left: 36px !important; }
.seg { display: inline-flex; height: 38px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; height: 100%; padding: 0 12px; font-size: 14px; color: var(--text-2); cursor: pointer; border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--ink); color: var(--on-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.f-actions { display: flex; gap: 4px; margin-left: auto; align-items: center; }
@media (max-width: 640px) {
  .filters label:not(.f-search) { flex: 1 1 calc(50% - 6px); }
  .filters select { width: 100%; }
  .seg { flex: 1 1 100%; }
  .seg label { flex: 1; }
  .seg span { justify-content: center; }
  .f-actions { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* Tabela */
.table-layout { display: grid; gap: 20px; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.scroll { overflow-x: auto; }
.deals { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 14px; }
.deals th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 0 14px; height: 42px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--card); }
.deals th button { background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; display: inline-flex; align-items: center; gap: 4px; }
.deals th button:hover, .deals th button[aria-sort] { color: var(--text); }
.deals th button[aria-sort="ascending"]::after { content: "↑"; }
.deals th button[aria-sort="descending"]::after { content: "↓"; }
.deals th.num, .deals td.num { text-align: right; }
.deals td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.deals tbody tr { cursor: pointer; transition: background .1s; }
.deals tbody tr:hover { background: #f6f3ec; }
.deals tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.deals tbody tr:last-child td { border-bottom: 0; }
.deals .c-date { font: 13px var(--mono); color: var(--text-2); white-space: nowrap; }
.deals .c-target { font-weight: 500; min-width: 180px; }
.deals .c-target small, .deals .c-buyer small { display: block; font-weight: 400; color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.deals .c-buyer { color: var(--text-2); min-width: 160px; }
.deals .c-sector { color: var(--text-2); white-space: nowrap; }
.deals .c-type { color: var(--text-2); white-space: nowrap; }
.deals .c-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.deals .c-value small { display: block; color: var(--text-3); font-size: 12px; }
.cc { display: inline-block; font: 10.5px var(--mono); color: var(--text-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.deals .skel td { height: 62px; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .03), transparent); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
.empty { padding: 48px 16px; text-align: center; color: var(--text-3); }
@media (max-width: 640px) {
  .deals { min-width: 0; }
  .deals thead { display: none; }
  .deals tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px;
    grid-template-areas: "target target value" "buyer buyer status" "date sector type";
    padding: 16px; border-bottom: 1px solid var(--line);
  }
  .deals tbody tr:last-child { border-bottom: 0; }
  .deals td { padding: 0; border: 0; min-width: 0 !important; }
  .deals .c-target { grid-area: target; }
  .deals .c-value { grid-area: value; text-align: right; }
  .deals .c-buyer { grid-area: buyer; font-size: 13.5px; }
  .deals .c-status { grid-area: status; text-align: right; }
  .deals .c-date { grid-area: date; font-size: 12px; color: var(--text-3); }
  .deals .c-sector { grid-area: sector; font-size: 12.5px; color: var(--text-3); white-space: normal; }
  .deals .c-type { grid-area: type; font-size: 12.5px; color: var(--text-3); text-align: right; white-space: normal; }
  .deals .skel { display: block !important; }
  .deals .skel td { display: block; }
  .stat { padding: 16px; }
  .stat-value { font-size: 26px; }
}
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13px; }
.pager div { display: flex; gap: 8px; }

.breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.breakdown > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
@media (max-width: 760px) { .breakdown { grid-template-columns: 1fr; } }
.breakdown h3 { font-size: 14px; font-weight: 500; }
.breakdown h3 + .muted { margin-top: 2px; }
.bars { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
@media (max-width: 1000px) { .bars { grid-template-columns: 1fr; } }
.bars li { display: grid; gap: 4px; font-size: 13px; }
.bars li button { all: unset; display: grid; gap: 4px; cursor: pointer; }
.bars .b-row { display: flex; justify-content: space-between; gap: 8px; }
.bars .b-row span:last-child { font-variant-numeric: tabular-nums; color: var(--text-2); }
.bars .b-track { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.bars .b-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.bars li button:hover .b-row span:first-child { text-decoration: underline; }
.years { display: flex; align-items: end; gap: 6px; height: 160px; margin-top: 14px; }
.years > div { flex: 1; display: flex; flex-direction: column; justify-content: end; gap: 4px; min-width: 0; }
.years i { display: block; background: var(--ink); border-radius: 2px 2px 0 0; min-height: 2px; }
.years span { font: 10.5px var(--mono); color: var(--text-3); text-align: center; overflow: hidden; }
.years b { display: block; font: 500 10.5px var(--mono); color: var(--text-2); text-align: center; margin-bottom: 4px; }
.years .y-col { display: flex; flex-direction: column; justify-content: end; }

.disclaimer { margin-top: 20px; font-size: 12.5px; color: var(--text-3); max-width: 820px; }

/* CTA e rodapé */
.cta { background: var(--ink); color: var(--on-ink); padding: 120px 0; text-align: center; }
.cta-inner { display: grid; justify-items: center; gap: 20px; }
.cta h2 { max-width: 760px; }
.cta p { color: var(--on-ink-2); font-size: 17px; margin-bottom: 12px; }
.foot { background: var(--ink); color: var(--on-ink); border-top: 1px solid var(--ink-line); }
.foot-inner { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 28px; font-size: 13px; }
.foot .muted { color: var(--on-ink-2); }

/* Painel de detalhe */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(13, 16, 20, .45); animation: fade .15s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(520px, 100%);
  background: var(--card); overflow-y: auto; padding: 32px; box-shadow: -20px 0 60px rgba(0, 0, 0, .2);
  animation: slide .2s ease-out;
}
@media (max-width: 640px) { .drawer-panel { padding: 24px 16px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 20px; cursor: pointer; line-height: 1; }
.drawer-close:hover { border-color: var(--text-3); }
.d-meta { font: 12px var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.d-title { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin: 14px 40px 8px 0; }
.d-sub { color: var(--text-2); }
.d-summary { margin-top: 20px; font-size: 16px; }
.d-fields { display: grid; grid-template-columns: 1fr 1fr; margin: 28px 0 0; border-top: 1px solid var(--line); }
.d-fields > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.d-fields > div.full { grid-column: 1 / -1; }
.d-fields dt { font: 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.d-fields dd { margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.d-note { margin-top: 20px; font-size: 12.5px; color: var(--text-3); }
