:root { --ink:#14312b; --muted:#60706b; --paper:#f5f2e9; --card:#fffdf7; --green:#1f6b57; --lime:#c9df71; --line:#d9ddd3; --amber:#9a5a18; }
* { box-sizing:border-box; }
html { scroll-behavior:smooth; }
body { margin:0; color:var(--ink); background:var(--paper); font-family:"DM Sans",sans-serif; line-height:1.55; }
a { color:inherit; }
.topbar { height:74px; display:flex; align-items:center; justify-content:space-between; padding:0 clamp(20px,5vw,76px); border-bottom:1px solid var(--line); background:rgba(245,242,233,.94); position:sticky; top:0; z-index:5; backdrop-filter:blur(12px); }
.brand { display:flex; gap:10px; align-items:center; text-decoration:none; font-weight:700; }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; color:white; background:var(--green); font-size:12px; }
nav { display:flex; gap:28px; align-items:center; font-size:14px; font-weight:600; }
nav a { text-decoration:none; }
.repo { border:1px solid var(--ink); padding:9px 14px; border-radius:999px; }
main { overflow:hidden; }
.hero { min-height:620px; padding:clamp(70px,10vw,140px) clamp(20px,8vw,120px) 80px; display:grid; grid-template-columns:minmax(0,1.5fr) minmax(280px,.7fr); gap:clamp(40px,8vw,130px); align-items:center; position:relative; }
.hero:after { content:""; position:absolute; width:520px; height:520px; border:1px solid #cdd5c5; border-radius:50%; right:-270px; top:-140px; box-shadow:0 0 0 70px rgba(201,223,113,.12),0 0 0 140px rgba(31,107,87,.05); }
.eyebrow { text-transform:uppercase; letter-spacing:.14em; color:var(--green); font-size:12px; font-weight:700; }
h1,h2 { font-family:"Newsreader",serif; line-height:1.02; margin:.35em 0; font-weight:600; }
h1 { font-size:clamp(48px,6.7vw,92px); max-width:850px; letter-spacing:-.035em; }
h2 { font-size:clamp(38px,4vw,62px); letter-spacing:-.025em; }
.lede { color:var(--muted); max-width:720px; font-size:clamp(17px,1.5vw,21px); }
.hero-actions { display:flex; gap:12px; margin-top:30px; }
.button { padding:13px 18px; border-radius:4px; text-decoration:none; font-weight:700; font-size:14px; }
.primary { background:var(--ink); color:white; }
.secondary { border:1px solid var(--ink); }
.status-card { background:var(--card); border:1px solid var(--line); padding:28px; box-shadow:12px 12px 0 rgba(31,107,87,.1); position:relative; z-index:1; }
.status-label { font-weight:700; font-size:13px; }
.dot { display:inline-block; width:8px; height:8px; background:var(--green); border-radius:50%; margin-right:7px; }
.big-number { font-family:"Newsreader",serif; font-size:72px; line-height:1; margin-top:35px; }
.status-card>p:not(.status-label) { color:var(--muted); }
.divider { height:1px; background:var(--line); margin:24px 0; }
dl { margin:0; } dl div { display:flex; justify-content:space-between; gap:12px; padding:8px 0; } dt { color:var(--muted); } dd { margin:0; font-weight:700; } .pending { color:var(--amber); }
.warning { margin:0 clamp(20px,8vw,120px); border-left:5px solid var(--amber); background:#fff6df; padding:18px 22px; }
.section { padding:110px clamp(20px,8vw,120px); }
.section-heading { max-width:760px; margin-bottom:45px; } .section-heading>p:last-child { color:var(--muted); font-size:18px; }
.cards { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.card { background:var(--card); border:1px solid var(--line); padding:25px; min-height:240px; display:flex; flex-direction:column; }
.card .icon { width:42px; height:42px; border-radius:50%; display:grid; place-items:center; background:#e4edd2; font-size:20px; }
.card h3 { font-size:23px; margin:24px 0 5px; }
.card .count { font-family:"Newsreader",serif; font-size:46px; line-height:1; margin:18px 0 4px; }
.card .meta { color:var(--muted); font-size:13px; margin-top:auto; }
.method { background:var(--ink); color:#f8f4e8; }
.method .eyebrow { color:var(--lime); }
.steps { list-style:none; margin:50px 0; padding:0; display:grid; grid-template-columns:repeat(4,1fr); border-top:1px solid rgba(255,255,255,.22); }
.steps li { padding:25px 22px 20px 0; border-right:1px solid rgba(255,255,255,.22); }
.steps li+li { padding-left:22px; }
.steps span { color:var(--lime); font-size:12px; font-weight:700; }
.steps h3 { margin:28px 0 8px; } .steps p { color:#b9c6c1; }
.fair { margin-top:70px; padding:35px; background:#1b4038; }
.fair-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:28px; } .fair-grid p { color:#c8d5d0; }
.next { display:grid; grid-template-columns:1fr 1fr; gap:10vw; align-items:start; }
.checklist p { border-bottom:1px solid var(--line); padding:17px 0; margin:0; display:flex; gap:16px; }
.checklist span { width:25px; height:25px; flex:0 0 auto; border-radius:50%; display:grid; place-items:center; background:var(--lime); font-size:12px; font-weight:700; }
footer { border-top:1px solid var(--line); display:flex; justify-content:space-between; padding:28px clamp(20px,5vw,76px); color:var(--muted); font-size:13px; }
@media (max-width:900px) { nav a:not(.repo){display:none}.hero,.next{grid-template-columns:1fr}.cards,.steps,.fair-grid{grid-template-columns:repeat(2,1fr)}.hero{padding-top:80px}.status-card{max-width:500px}.steps li:nth-child(2){border-right:0} }
@media (max-width:560px) { .cards,.steps,.fair-grid{grid-template-columns:1fr}.steps li{border-right:0;border-bottom:1px solid rgba(255,255,255,.22)!important;padding-left:0!important}.hero-actions{flex-direction:column}.button{text-align:center}footer{flex-direction:column}.repo{font-size:0}.repo:after{content:"GitHub";font-size:13px} }

/* Explorador interativo */
.cards .card { font:inherit; color:inherit; text-align:left; cursor:pointer; position:relative; transition:transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.cards .card:hover { transform:translateY(-3px); box-shadow:8px 8px 0 rgba(31,107,87,.12); }
.cards .card:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
.cards .card.is-off { opacity:.5; background:transparent; }
.card-toggle { margin-top:14px; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.card.is-off .card-toggle:before { content:"+ "; }

.explorer { background:var(--card); border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.explorer code { font-family:ui-monospace,"SFMono-Regular",Menlo,monospace; font-size:.92em; background:#eef0e6; padding:2px 6px; border-radius:3px; }
.controls { display:flex; flex-wrap:wrap; gap:28px 46px; align-items:flex-start; padding-bottom:28px; border-bottom:1px solid var(--line); }
.control-block { display:flex; flex-direction:column; gap:10px; }
.control-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); }
.legend { display:flex; flex-wrap:wrap; gap:8px; }
.chip { display:inline-flex; align-items:center; gap:8px; border:1px solid var(--line); background:transparent; border-radius:999px; padding:8px 15px; font:inherit; font-size:14px; font-weight:600; color:var(--muted); cursor:pointer; transition:border-color .15s ease, color .15s ease, background .15s ease; }
.chip i { width:11px; height:11px; border-radius:3px; background:currentColor; opacity:.35; }
.chip.is-on { color:var(--ink); border-color:var(--ink); background:var(--paper); }
.chip.is-on i { opacity:1; }
.chip:focus-visible, select:focus-visible, .view-toggle:focus-visible, .ghost:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
select { font:inherit; font-size:15px; font-weight:600; color:var(--ink); background:var(--paper); border:1px solid var(--ink); border-radius:4px; padding:10px 14px; min-width:250px; cursor:pointer; }
.view-toggle, .ghost { font:inherit; font-size:14px; font-weight:600; background:transparent; border:1px solid var(--ink); border-radius:999px; padding:9px 16px; cursor:pointer; color:inherit; }
.view-toggle[aria-pressed="true"] { background:var(--ink); color:var(--card); }

.stats { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin:34px 0 10px; padding:0; }
.stat { border-left:2px solid var(--lime); padding:4px 0 4px 16px; }
.stat dt { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); }
.stat dd { margin:6px 0 0; font-family:"Newsreader",serif; font-size:40px; line-height:1; font-variant-numeric:tabular-nums; }

.chart-figure { margin:26px 0 0; }
.chart-wrap { position:relative; }
.chart { width:100%; max-width:100%; min-height:220px; }
.chart svg { display:block; overflow:visible; }
.chart .bar { transition:opacity .15s ease; }
.chart svg.is-hovering .bar { opacity:.5; }
.chart svg .bar.is-active { opacity:1; }
.row-label { font-size:13px; fill:var(--ink); font-weight:600; }
.axis-text { font-size:11px; fill:var(--muted); font-variant-numeric:tabular-nums; }
.bar-value { font-size:12px; fill:var(--muted); font-weight:700; font-variant-numeric:tabular-nums; }
.hit { cursor:crosshair; }
.tooltip[hidden] { display:none; }
.tooltip { position:absolute; top:0; left:0; pointer-events:none; background:var(--ink); color:#f8f4e8; padding:10px 13px; border-radius:5px; font-size:13px; max-width:230px; display:flex; flex-direction:column; gap:3px; box-shadow:0 6px 20px rgba(20,49,43,.22); z-index:3; }
.tooltip strong { font-size:14px; }
.tip-group { display:flex; align-items:center; gap:7px; color:#cfdad5; }
.tip-group i { width:9px; height:9px; border-radius:2px; }
.tip-value { color:#cfdad5; font-variant-numeric:tabular-nums; }
.chart-figure figcaption { color:var(--muted); font-size:13px; margin-top:18px; max-width:760px; }
.empty { color:var(--muted); padding:40px 0; }

.table-view { overflow-x:auto; }
.table-view table { border-collapse:collapse; width:100%; font-size:14px; }
.table-view caption { text-align:left; color:var(--muted); font-size:13px; padding-bottom:12px; }
.table-view th, .table-view td { border-bottom:1px solid var(--line); padding:11px 14px; text-align:right; font-variant-numeric:tabular-nums; }
.table-view thead th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.08em; }
.table-view th[scope="row"], .table-view thead th:first-child { text-align:left; }
.table-view tbody tr:hover { background:var(--paper); }

.explorer-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:22px; margin-top:52px; }
.sql-panel, .sim-panel { border:1px solid var(--line); background:var(--paper); padding:24px; min-width:0; }
.panel-head { display:flex; justify-content:space-between; align-items:center; gap:14px; }
.panel-head h3 { margin:0; font-family:"Newsreader",serif; font-size:24px; font-weight:600; }
.panel-note { color:var(--muted); font-size:13px; margin:10px 0 18px; }
.sql-panel pre { margin:0; background:var(--ink); color:#e8efe9; padding:18px; border-radius:5px; overflow-x:auto; }
.sql-panel code { background:transparent; color:inherit; padding:0; font-size:13px; line-height:1.6; white-space:pre; }
#sim-slider { width:100%; margin:14px 0 22px; accent-color:var(--green); }
.sim-row { display:grid; grid-template-columns:70px 1fr 96px; align-items:center; gap:12px; margin-bottom:12px; font-size:14px; }
.sim-row span { color:var(--muted); font-weight:600; }
.sim-row strong { text-align:right; font-variant-numeric:tabular-nums; }
.track { background:#e6e4da; border-radius:4px; height:16px; overflow:hidden; }
.fill { height:100%; border-radius:0 4px 4px 0; transition:width .18s ease; }
.fill.csv { background:#b9c0ae; }
.fill.parquet { background:var(--green); }
.sim-saving { font-size:14px; color:var(--muted); margin:18px 0 0; border-top:1px solid var(--line); padding-top:16px; }
.policy-note { margin:38px 0 0; font-size:13px; color:var(--muted); border-left:3px solid var(--lime); padding-left:14px; }

@media (max-width:900px) { .explorer-grid { grid-template-columns:1fr; } .stats { grid-template-columns:repeat(2,1fr); } select { min-width:0; width:100%; } .controls { gap:20px; } .control-block { width:100%; } }
@media (max-width:560px) { .stats { grid-template-columns:1fr 1fr; } .stat dd { font-size:30px; } .sim-row { grid-template-columns:56px 1fr 78px; font-size:13px; } }
@media (prefers-reduced-motion:reduce) { .cards .card, .fill, .chart .bar { transition:none; } .cards .card:hover { transform:none; } }

/* Globo e galeria de táxons */
.globe-section { background:var(--ink); color:#f4efe2; border-bottom:1px solid var(--line); }
.globe-section .eyebrow { color:var(--lime); }
.globe-section .section-heading>p:last-child { color:#b9c6c1; }
.globe-layout { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(240px,.7fr); gap:clamp(28px,5vw,70px); align-items:center; }
.globe-host { position:relative; aspect-ratio:1/1; width:min(100%,min(78vh,700px)); margin-inline:auto; touch-action:pan-y; }
.globe-host canvas { width:100%; height:100%; display:block; cursor:grab; }
.globe-host canvas.is-dragging { cursor:grabbing; }
.globe-host canvas.is-flat { aspect-ratio:2/1; height:auto; margin-top:12%; border:1px solid rgba(255,255,255,.18); }
.globe-loading[hidden] { display:none !important; }
.globe-loading { position:absolute; inset:0; display:grid; place-items:center; color:#8fa39c; font-size:14px; margin:0; }
.globe-side .control-label { color:#8fa39c; }
.globe-legend .scale { height:12px; border-radius:3px; margin:12px 0 7px; }
.scale-ends { display:flex; justify-content:space-between; font-size:12px; color:#b9c6c1; font-variant-numeric:tabular-nums; }
.scale-none { display:flex; align-items:center; gap:9px; font-size:12px; color:#8fa39c; margin:14px 0 0; }
.scale-none i { width:13px; height:13px; border-radius:3px; background:#41524d; }
.globe-top-wrap { margin-top:36px; }
.globe-top { list-style:none; margin:14px 0 0; padding:0; font-size:14px; }
.globe-top li { display:flex; justify-content:space-between; gap:14px; padding:9px 0; border-bottom:1px solid rgba(255,255,255,.14); }
.globe-top li span:last-child { font-weight:700; font-variant-numeric:tabular-nums; }
.globe-top .bar-mini { display:block; height:3px; margin-top:6px; border-radius:2px; }
.globe-section .panel-note { color:#8fa39c; margin-top:30px; }
.globe-host .tooltip { box-shadow:0 6px 22px rgba(0,0,0,.4); }

.gallery { display:grid; grid-template-columns:repeat(auto-fill,minmax(168px,1fr)); gap:14px; }
.taxon-card { background:var(--card); border:1px solid var(--line); padding:20px 18px; display:flex; flex-direction:column; gap:4px; transition:transform .18s ease, box-shadow .18s ease; }
.taxon-card:hover { transform:translateY(-3px); box-shadow:8px 8px 0 rgba(31,107,87,.1); }
.taxon-card .sil { height:88px; display:grid; place-items:center; margin-bottom:14px; }
.taxon-card .sil img { max-height:88px; max-width:100%; opacity:.88; }
.taxon-card .taxon-group { display:flex; align-items:center; gap:7px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.09em; color:var(--muted); }
.taxon-card .taxon-group i { width:9px; height:9px; border-radius:2px; }
.taxon-card h3 { margin:6px 0 0; font-size:19px; font-family:"DM Sans",sans-serif; font-weight:600; }
.taxon-card .taxon-count { font-family:"Newsreader",serif; font-size:32px; line-height:1.1; font-variant-numeric:tabular-nums; }
.taxon-card .taxon-count small { font-family:"DM Sans",sans-serif; font-size:12px; color:var(--muted); font-weight:600; margin-left:5px; }
.taxon-card .taxon-author { margin:12px 0 0; font-size:10.5px; color:var(--muted); line-height:1.45; }
.credits { margin-top:34px; border-top:1px solid var(--line); padding-top:20px; font-size:13px; color:var(--muted); }
.credits summary { cursor:pointer; font-weight:600; color:var(--ink); }
.credits ul { margin:16px 0 0; padding-left:18px; }
.credits li { margin-bottom:7px; }
.credits a { color:var(--green); }
.cards .card .icon img { max-height:24px; max-width:24px; opacity:.85; }

@media (max-width:900px) { .globe-layout { grid-template-columns:1fr; } .globe-host { width:min(100%,64vh); } .globe-top-wrap { margin-top:24px; } }
@media (prefers-reduced-motion:reduce) { .taxon-card { transition:none; } .taxon-card:hover { transform:none; } }

/* Seletor de dimensão em botões: o menu nativo fechava sozinho no Linux */
.dimension-block { flex:1 1 420px; min-width:0; }
.dimension-chips { display:flex; flex-wrap:wrap; gap:8px; }
.chip.dim { color:var(--muted); }
.chip.dim.is-on { color:var(--card); background:var(--ink); border-color:var(--ink); }

/* Passagem de telas pequenas: itens de grade não podem ficar maiores que a coluna */
.stat, .globe-top li, .taxon-card, .sim-row, .card { min-width:0; }
/* o cartão do topo usa "dl div { display:flex }"; aqui o rótulo fica acima do número */
.stat { display:block; }
.stat dd { overflow-wrap:normal; word-break:keep-all; }
@media (max-width:620px) {
  .section { padding:72px clamp(18px,6vw,120px); }
  /* o anel decorativo cruzava o título no celular, onde não há coluna livre para ele */
  .hero:after { display:none; }
  .hero { padding:54px clamp(18px,6vw,120px) 60px; min-height:0; }
  .warning { margin-inline:clamp(18px,6vw,120px); }
  .stats { grid-template-columns:1fr 1fr; gap:12px; margin:26px 0 4px; }
  .stat { padding-left:12px; }
  .stat dt { font-size:10.5px; letter-spacing:.06em; }
  .stat dd { font-size:26px; }
  .chip { padding:7px 12px; font-size:13px; }
  .controls { gap:18px; }
  .gallery { grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
  .taxon-card { padding:16px 14px; }
  .taxon-card .sil { height:64px; }
  .taxon-card .sil img { max-height:64px; }
  .taxon-card .taxon-count { font-size:26px; }
  .globe-side .panel-note { margin-top:20px; }
  .sql-panel, .sim-panel { padding:18px; }
  .panel-head h3 { font-size:21px; }
}
/* Sombra nas bordas avisa que a tabela rola para o lado */
.table-view {
  background:
    linear-gradient(to right, var(--card) 30%, rgba(255,253,247,0)) left center,
    linear-gradient(to left, var(--card) 30%, rgba(255,253,247,0)) right center,
    radial-gradient(farthest-side at 0 50%, rgba(20,49,43,.16), transparent) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(20,49,43,.16), transparent) right center;
  background-repeat:no-repeat;
  background-size:44px 100%, 44px 100%, 14px 100%, 14px 100%;
  background-attachment:local, local, scroll, scroll;
}
