/* arena.whipcode.io: mesmos tokens do landing (apps/landing). Gráficos sobre --bg-1 (#0c0e11), superfície validada da paleta. */
:root {
  --bg: #07080a;
  --bg-1: #0c0e11;
  --bg-2: #12151a;
  --bg-3: #181c22;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --fg: #eef1f4;
  --fg-2: #a7aeb8;
  --fg-3: #7f8792;
  --green: #22c55e;
  --green-text: #4ade80;
  --red: #ff8a80;
  --amber: #f5b544;
  --wrap: 1180px;
  --radius: 14px;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: 'Instrument Serif', Georgia, serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
main:focus { outline: none; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--green-text); outline-offset: 2px; border-radius: 4px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* barra de carregamento */
body.loading::before {
  content: ''; position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 40;
  background: linear-gradient(90deg, transparent, var(--green-text), transparent) no-repeat;
  background-size: 40% 100%; animation: load 1.1s linear infinite;
}
@keyframes load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
@media (prefers-reduced-motion: reduce) {
  body.loading::before { animation: none; background: var(--green-text); opacity: .5; }
  * { transition: none !important; }
}

/* header */
.site { position: sticky; top: 0; z-index: 20; background: rgba(7, 8, 10, .72); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.site .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; font-size: 15px; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 19px; color: var(--fg-2); margin-left: -3px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.btn-ghost { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--fg-2); font: 500 13px var(--sans); text-decoration: none; cursor: pointer; }
.btn-ghost:hover { color: var(--fg); background: var(--bg-2); }
.btn-ghost.lang { border-color: var(--line-2); font-family: var(--mono); font-size: 12px; }
.btn { display: inline-flex; align-items: center; min-height: 34px; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); color: var(--fg); font: 500 13px var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--bg-3); }

/* hero e cabeçalhos de página */
.hero { padding: 56px 0 28px; }
.eyebrow { margin: 0 0 14px; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--green-text); }
.kicker { margin: 0 0 10px; display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 13.5px; }
h1 { margin: 0 0 14px; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; }
h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; }
.page-head { padding: 4px 0 20px; }
.page-head h1 { font-size: clamp(28px, 4vw, 42px); }
.page-head h1.model-name { word-break: break-word; }
.lede { margin: 0 0 16px; max-width: 700px; color: var(--fg-2); font-size: 17px; }
.note { margin: 0; max-width: 780px; color: var(--fg-3); font-size: 13px; }
.meta-line { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--fg-3); font-size: 13px; }
.meta-line span + span::before { content: '·'; margin-right: 16px; color: var(--line-2); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding: 28px 0 10px; color: var(--fg-3); font-size: 13px; }
.crumbs a { color: var(--fg-2); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] { color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.section-title { margin: 40px 0 6px; font: 500 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.group-title { margin: 18px 0 10px; font-size: 15px; font-weight: 600; color: var(--fg-2); }

/* painéis */
.panel { margin: 0 0 20px; padding: 20px; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.panel h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.panel h3 { margin: 22px 0 10px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.sub { margin: 3px 0 0; color: var(--fg-3); font-size: 13px; }
.link { color: var(--fg-2); font-size: 13px; text-decoration: none; white-space: nowrap; }
.link:hover { color: var(--fg); }
.state { padding: 64px 0; color: var(--fg-3); }
.empty { margin: 12px 0; color: var(--fg-3); font-size: 13.5px; }
.notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-2); color: var(--fg-2); font-size: 13.5px; }
.notice .ic { color: var(--amber); flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* filtros: uma linha, acima dos gráficos */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 0 0 16px; }
.field { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: 12.5px; }
select, input[type=search] { min-height: 34px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-2); color: var(--fg); font: 500 13px var(--sans); }
select { max-width: 280px; padding-right: 30px; appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a7aeb8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
input[type=search] { width: 240px; max-width: 100%; }
input[type=search]::placeholder { color: var(--fg-3); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg-2); }
.seg button { min-height: 28px; padding: 4px 11px; border: 0; border-radius: 7px; background: none; color: var(--fg-2); font: 500 12.5px var(--sans); cursor: pointer; }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed=true] { background: var(--bg-3); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; color: var(--fg-2); font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.count { font-size: 12.5px; }

/* gráficos */
.chart { position: relative; }
.plot { position: relative; width: 100%; }
.svg { display: block; overflow: visible; touch-action: pan-y; }
.svg:focus { outline: none; }
.svg:focus-visible { outline: 2px solid var(--green-text); outline-offset: 4px; border-radius: 6px; }
.svg .grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.svg .axis { stroke: var(--line-2); stroke-width: 1; shape-rendering: crispEdges; }
.svg .tick { fill: var(--fg-3); font: 11px var(--mono); }
.svg .crosshair { stroke: var(--fg-3); stroke-width: 1; stroke-dasharray: 2 3; }
.legend { display: flex; flex-wrap: wrap; gap: 2px 4px; margin: 0 0 10px; }
.lg { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 8px; border: 0; border-radius: 6px; background: none; color: var(--fg-2); font: 500 12.5px var(--sans); cursor: pointer; }
.lg:hover { background: var(--bg-2); color: var(--fg); }
.lg[aria-pressed=false] { color: var(--fg-3); text-decoration: line-through; }
.lg[aria-pressed=false] .sw { opacity: .3; }
.legend.static { gap: 4px 14px; margin: 10px 0 0; color: var(--fg-2); font-size: 12.5px; }
.legend.static span { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; flex: none; width: 16px; height: 0; border-top: 2px solid var(--c); }
.sw.dash { border-top-style: dashed; }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tip { position: absolute; z-index: 5; min-width: 200px; max-width: 340px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-3); font-size: 12.5px; pointer-events: none; box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.tip-h { margin-bottom: 6px; color: var(--fg-2); font: 500 11.5px var(--mono); }
.tip-title { margin-bottom: 6px; color: var(--fg); font-weight: 600; word-break: break-word; }
.tip-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0; }
.tip-row b { display: block; color: var(--fg); font-weight: 500; }
.tip-row small { display: block; color: var(--fg-3); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-row .v, .tip-kv .v { color: var(--fg); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tip-kv { display: flex; justify-content: space-between; gap: 16px; padding: 1px 0; color: var(--fg-3); }

/* dot plot com IC */
.dp { position: relative; --dp-name: 250px; }
.dp-row { display: grid; grid-template-columns: 38px minmax(0, var(--dp-name)) minmax(0, 1fr); gap: 10px; align-items: center; min-height: 28px; border-radius: 6px; text-decoration: none; }
a.dp-row:hover, a.dp-row:focus-visible { background: var(--bg-2); }
.dp-head { min-height: 22px; }
.dp-rank { padding-right: 2px; text-align: right; color: var(--fg-3); font: 12px var(--mono); }
.dp-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--fg); }
.dp-name .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-axis { position: relative; height: 22px; margin-right: 8px; }
.dp-tick { position: absolute; top: 3px; transform: translateX(-50%); color: var(--fg-3); font: 11px var(--mono); white-space: nowrap; }
.dp-track { display: block; width: calc(100% - 8px); height: 28px; overflow: visible; }
.dp-grid { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }

/* cards por uso */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-1); text-decoration: none; transition: border-color .15s, background .15s; }
.card:hover { border-color: var(--line-2); background: var(--bg-2); }
.card h4 { margin: 0; font-size: 15px; font-weight: 600; }
.card .desc { margin: 3px 0 0; color: var(--fg-3); font-size: 13px; line-height: 1.45; }
.leader .k { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.leader .m { margin: 2px 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; word-break: break-word; }
.leader .tie { margin-top: 4px; color: var(--fg-3); font-size: 12px; }
.lab { display: inline-flex; align-items: center; gap: 7px; color: var(--fg-2); font-size: 13px; }
.mini { display: grid; gap: 6px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; }
.mini li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.mini .r { color: var(--fg-3); font-family: var(--mono); font-size: 12px; }
.mini .n { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--fg-2); }
.mini .n span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini .v { color: var(--fg-3); font-family: var(--mono); font-size: 12px; }
.card .foot { display: flex; justify-content: space-between; margin-top: auto; color: var(--fg-3); font-size: 12px; }

/* tabelas */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl caption { text-align: left; }
.tbl th { padding: 8px 10px; border-bottom: 1px solid var(--line-2); color: var(--fg-3); font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.tbl td, .tbl tbody th { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody th { font: inherit; letter-spacing: 0; text-transform: none; color: var(--fg); font-weight: 500; }
.tbl tbody tr:hover > * { background: rgba(255, 255, 255, .02); }
.tbl .r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl a { color: var(--fg); font-weight: 500; text-decoration: none; }
.tbl a:hover { text-decoration: underline; text-underline-offset: 3px; }
.tbl .lic { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.tbl small { display: block; color: var(--fg-3); font: 11px var(--sans); white-space: nowrap; }
.tbl tr.current > * { background: var(--bg-2); }
.tbl-note { margin: 10px 0 0; color: var(--fg-3); font-size: 12.5px; }
.up { color: var(--green-text); }
.down { color: var(--red); }
.new { color: var(--amber); }

/* matriz lab × uso */
.matrix td { min-width: 118px; padding: 6px 6px; }
.matrix thead th { vertical-align: bottom; }
.matrix thead .lab { font: 500 12px var(--sans); letter-spacing: 0; text-transform: none; color: var(--fg-2); }
.matrix tr.grp th { padding: 16px 10px 6px; border-bottom: 1px solid var(--line); color: var(--fg-3); font: 500 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.matrix tbody th[scope=row] { white-space: nowrap; }
.matrix tfoot td, .matrix tfoot th { padding: 10px; color: var(--fg-3); font-size: 12.5px; }
.cell { display: block; padding: 5px 8px; border-radius: 8px; text-decoration: none; }
a.cell:hover { background: var(--bg-2); }
.cell .rk { font: 500 13px var(--mono); color: var(--fg); }
.cell .mdl { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-3); font-size: 11.5px; font-weight: 400; }
.cell.top { background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.cell.top .rk { font-weight: 600; }

/* página de modelo */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; margin: 0 0 20px; }
.tile { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); }
.tile .k { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.tile .v { margin: 4px 0 2px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--fg-3); font-size: 12.5px; }

details.twin { margin-top: 14px; }
details.twin summary { display: inline-flex; align-items: center; min-height: 28px; color: var(--fg-2); font-size: 13px; cursor: pointer; }
details.twin summary:hover { color: var(--fg); }
details.twin[open] summary { margin-bottom: 8px; }
details.twin .tbl-wrap { max-height: 480px; overflow: auto; }

/* rodapé */
.site-foot { margin-top: 48px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 12.5px; }
.site-foot p { margin: 0 0 6px; max-width: 820px; }
.site-foot a { color: var(--fg-2); }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .panel { padding: 14px; }
  .hero { padding-top: 36px; }
  .dp { --dp-name: 130px; }
  .dp-row { grid-template-columns: 30px minmax(0, var(--dp-name)) minmax(0, 1fr); gap: 6px; }
  .brand span { display: none; }
  .brand em { margin-left: 0; }
}
