/* TOPODATA Downloader — site de documentação (mesmo framework do OSMnx Routing & Isochrones) */
:root {
  --green: #2f7d5b; --green-soft: #e4f2ea; --red: #b0412e; --red-soft: #f9e7e2;
  --blue: #2b6cb0; --blue-soft: #e5eef8; --orange: #e8590c; --orange-soft: #fdeee3;
  --sand: #c98146; --sand-soft: #f6ecdf;
  --ink: #1f2328; --muted: #5b636d; --line: #e4ded3; --paper: #fbf9f5; --card: #ffffff;
  --code-bg: #1f2430; --code-ink: #e6e6e6; --shadow: 0 10px 30px rgba(31, 35, 40, .08);
  --radius: 14px; --max: 1120px;
  --hero: linear-gradient(135deg, #0f3b2c 0%, #2f7d5b 34%, #c98146 70%, #8a3a1f 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8e6e1; --muted: #a9adb3; --line: #33363c; --paper: #15171b; --card: #1d2026;
    --green-soft: #16302a; --red-soft: #3a1f1a; --blue-soft: #16283a; --orange-soft: #3a2416;
    --sand-soft: #33281c; --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --green: #5cbf8f; --orange: #ff8a3d; --blue: #6aa8ee; --red: #e2765f;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.65 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
code { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .9em; }
:not(pre) > code { background: var(--blue-soft); padding: .1em .4em; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--paper) 85%, transparent); border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.topbar > .wrap { max-width: 1360px; }   /* room for the full menu next to the name */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink);
  text-decoration: none; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: .93rem; white-space: nowrap; }
.topnav a:hover, .topnav a.active { color: var(--ink); }
.lang { display: flex; gap: 4px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px; }
.lang a { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  color: var(--muted); text-decoration: none; }
.lang a.on { background: var(--ink); color: var(--paper); }
.menu-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  cursor: pointer; }
.menu-btn[aria-expanded="true"] { background: var(--ink); color: var(--paper); }
.mobile-nav { border-top: 1px solid var(--line); background: var(--paper); }
.topbar .mobile-nav .wrap { height: auto; gap: 0; align-items: stretch; }
.mobile-nav a { padding: 10px 0; font-size: 1rem; border-bottom: 1px solid var(--line); }
.mobile-nav a:last-child { border-bottom: 0; }
@media (max-width: 420px) { .brand span { font-size: .9rem; } .topbar .wrap { gap: 10px; } }

/* hero */
.hero { background: var(--hero); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center;
  padding-top: 64px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(1.8rem, 4.4vw, 3.2rem); overflow-wrap: anywhere; line-height: 1.1; margin: 0 0 16px; }
.hero p.lead { font-size: 1.15rem; opacity: .95; margin: 0 0 26px; max-width: 34em; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.hero .badges span { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35);
  padding: 4px 12px; border-radius: 999px; font-size: .85rem; }
.hero figure { margin: 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, .35); transform: rotate(-1.2deg); background: #f4f1ea; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px;
  font-weight: 600; text-decoration: none; margin: 0 10px 10px 0; }
.btn.primary { background: #fff; color: #0f3b2c; }
.btn.ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .7); }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 40px; }
  .hero figure { transform: none; } }

/* sections */
section { padding: 64px 0; border-bottom: 1px solid var(--line); }
section h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 8px; }
section .kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem;
  font-weight: 700; margin: 0 0 8px; }
section > .wrap > p.intro { color: var(--muted); font-size: 1.07rem; max-width: 46em; margin: 0 0 32px; }
h3 { font-size: 1.25rem; margin: 32px 0 10px; }
.k-green { color: var(--green); } .k-red { color: var(--red); } .k-blue { color: var(--blue); }
.k-orange { color: var(--orange); }

.grid { display: grid; gap: 18px; }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .grid.c4, .grid.c2 { grid-template-columns: minmax(0, 1fr); }
  .pair { grid-template-columns: minmax(0, 1fr); } .pair > div + div { border-left: 0; border-top: 1px solid var(--line); }
  section { padding: 44px 0; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); }
.card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 12px; }
.card h4 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.t-green { background: var(--green-soft); } .t-red { background: var(--red-soft); }
.t-blue { background: var(--blue-soft); } .t-orange { background: var(--orange-soft); }

/* steps */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps > li { counter-increment: s; position: relative; min-width: 0; padding: 18px 20px 18px 70px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.steps > li::before { content: counter(s); position: absolute; left: 18px; top: 16px; width: 36px;
  height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--hero); }
.steps > li h4 { margin: 0 0 4px; }
.steps > li p { margin: 0; color: var(--muted); }

/* figures */
figure.shot { margin: 24px 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
figure.shot img { width: 100%; }
figure.shot figcaption { padding: 12px 18px; font-size: .92rem; color: var(--muted);
  border-top: 1px solid var(--line); }
.legend { display: inline-flex; align-items: center; gap: 6px; margin-right: 14px; white-space: nowrap; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.sw.line { height: 4px; border-radius: 2px; width: 22px; }
.sw.dash { height: 0; border-top: 4px dashed #111; width: 22px; border-radius: 0; }
.sw.dot { border-radius: 50%; }
.ramp { width: 120px; height: 10px; border-radius: 5px; display: inline-block; vertical-align: middle; }
.ramp.iso { background: linear-gradient(90deg, #1a9641, #a6d96a, #ffffbf, #fdae61, #d7191c); }
.ramp.roads { background: linear-gradient(90deg, #2b83ba, #abdda4, #ffffbf, #fdae61, #d7191c); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.pair > div { padding: 12px 18px; font-size: .92rem; color: var(--muted); }
.pair > div + div { border-left: 1px solid var(--line); }
.pair b { color: var(--ink); }

/* diagrams */
.diagram { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); }
.diagram svg { width: 100%; height: auto; }
.diagram svg text { font-family: inherit; fill: var(--ink); }

/* tables */
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: color-mix(in srgb, var(--blue-soft) 60%, var(--card)); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* algorithm blocks */
.alg { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--blue));
  border-radius: var(--radius); padding: 22px 24px; margin: 22px 0; box-shadow: var(--shadow); }
.alg h3 { margin-top: 0; display: flex; align-items: center; gap: 10px; }
.alg h3 img { width: 30px; height: 30px; }
h3 .inline-ico { display: inline; width: 26px; vertical-align: -6px; }
.alg .id { font-size: .82rem; color: var(--muted); }

/* code */
pre { position: relative; background: var(--code-bg); color: var(--code-ink); padding: 18px 20px;
  border-radius: 12px; overflow-x: auto; font-size: .9rem; line-height: 1.55; }
pre .copy { position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, .12);
  color: #fff; border: 0; border-radius: 6px; padding: 4px 10px; font-size: .78rem; cursor: pointer; }
pre .copy:hover { background: rgba(255, 255, 255, .25); }

/* callouts and faq */
.note { border-radius: 12px; padding: 14px 18px; margin: 18px 0; border: 1px solid; }
.note.tip { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.note.warn { background: var(--orange-soft); border-color: color-mix(in srgb, var(--orange) 40%, transparent); }
details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin: 10px 0;
  padding: 0 18px; }
details summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; }
details summary::before { content: "▸"; display: inline-block; width: 1.2em; color: var(--red);
  transition: transform .2s; }
details[open] summary::before { transform: rotate(90deg); }
details > div { padding: 0 0 14px; color: var(--muted); }

footer { padding: 36px 0 60px; color: var(--muted); font-size: .9rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; }

/* lists, facts and small print */
ul.plain { margin: 0 0 18px; padding-left: 1.2em; }
ul.plain li { margin: 4px 0; }
dl.facts { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr); gap: 8px 18px;
  margin: 16px 0 0; }
dl.facts dt { font-weight: 700; }
dl.facts dd { margin: 0; color: var(--muted); }
@media (max-width: 640px) { dl.facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.facts dd { margin-bottom: 10px; } }
.note:not(.tip):not(.warn) { background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
p.small { font-size: .85rem; color: var(--muted); }
details > div p { margin: 0 0 8px; }

/* author */
.author { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 32px; align-items: start;
  margin-top: 22px; }
.author img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 6px var(--card), 0 0 0 9px var(--green), var(--shadow); }
.author h2 { margin-top: 0; }
.author .role { font-weight: 600; color: var(--green); margin-top: 0; }
.author p { max-width: 46em; }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
a.chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600;
  font-size: .9rem; }
a.chip:hover { border-color: var(--green); color: var(--green); }
@media (max-width: 640px) { .author { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .author img { width: 140px; height: 140px; } }

/* TOPODATA: diagramas com cores que acompanham o tema */
.diagram svg .b-green { fill: var(--green-soft); stroke: var(--green); }
.diagram svg .b-orange { fill: var(--orange-soft); stroke: var(--orange); }
.diagram svg .b-blue { fill: var(--blue-soft); stroke: var(--blue); }
.diagram svg .b-red { fill: var(--red-soft); stroke: var(--red); }
.diagram svg .b-sand { fill: var(--sand-soft); stroke: var(--sand); }
.diagram svg .b-card { fill: var(--card); stroke: var(--muted); }
.diagram svg .ln { stroke: var(--muted); fill: none; }
.diagram svg .ln-green { stroke: var(--green); fill: none; }
.diagram svg .ln-red { stroke: var(--red); fill: none; }
.diagram svg .ln-orange { stroke: var(--orange); fill: none; }
.diagram svg .ah { fill: var(--muted); }
.diagram svg .t-sub { fill: var(--muted); }
.diagram svg .t-green { fill: var(--green); } .diagram svg .t-red { fill: var(--red); }
.diagram svg .t-orange { fill: var(--orange); }
.k-sand { color: var(--sand); } .t-sand { background: var(--sand-soft); }

/* faixas de cor dos produtos */
.chips { display: inline-flex; border-radius: 4px; overflow: hidden; vertical-align: middle;
  box-shadow: 0 0 0 1px var(--line); }
.chips i { display: block; width: 12px; height: 14px; }
.grad { display: inline-block; width: 84px; height: 14px; border-radius: 4px; vertical-align: middle;
  box-shadow: 0 0 0 1px var(--line); }
td.num, th.num { text-align: right; white-space: nowrap; }
.stat { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 0 0 4px; }
.hero figure img { aspect-ratio: 4 / 3; }
