/* Paleta de carta aeronáutica: papel, tinta azul, magenta de aerovia */
:root {
  --paper: #fbfbf9;
  --paper-2: #f1f3f4;
  --ink: #1c2a38;
  --ink-soft: #566472;
  --rule: #dde2e6;
  --grid: #e7ebee;
  --land: #b9c4cd;
  --route: #b0306f;
  --pen: #2c5f8d;
  --print: #ffffff;
  --shadow: 0 1px 2px rgba(28,42,56,.12), 0 8px 22px rgba(28,42,56,.09);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101b26; --paper-2: #152330; --ink: #e4e8ec; --ink-soft: #9aa7b3;
    --rule: #263544; --grid: #1a2a37; --land: #3b4f61; --route: #e0619f; --pen: #8db8e0;
    --print: #f4f2ee; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --paper: #101b26; --paper-2: #152330; --ink: #e4e8ec; --ink-soft: #9aa7b3;
  --rule: #263544; --grid: #1a2a37; --land: #3b4f61; --route: #e0619f; --pen: #8db8e0;
  --print: #f4f2ee; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Literata", Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
}
img { max-width: 100%; display: block; }
a { color: var(--pen); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--route); outline-offset: 3px; border-radius: 2px; }

.page { max-width: 720px; margin: 0 auto; padding: 0 16px 80px; }
.wide { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.hand { font-family: "Caveat", cursive; font-weight: 500; color: var(--pen); line-height: 1.1; }
.soft { color: var(--ink-soft); }
.num { font-variant-numeric: lining-nums tabular-nums; }

/* Barra do topo */
.topbar {
  max-width: 1040px; margin: 0 auto; padding: 20px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 15px;
}
.topbar .name { color: var(--ink); text-decoration: none; font-weight: 600; }
.topbar nav { display: flex; gap: 22px; align-items: center; }
.topbar nav a { color: var(--ink-soft); text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--ink); }
.kbtn {
  font: inherit; font-size: 13px; color: var(--ink-soft); background: transparent;
  border: 1px solid var(--rule); border-radius: 6px; padding: 3px 8px; cursor: pointer;
  font-variant-numeric: lining-nums;
}
.kbtn:hover { color: var(--ink); border-color: var(--ink-soft); }
.clock { font-size: 13px; color: var(--ink-soft); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
@media (max-width: 1100px) { .clock { display: none; } }
@media (max-width: 900px) { .topbar nav a:not(.keep) { display: none; } }

/* Tipografia */
h1 { font-size: 46px; line-height: 1.08; font-weight: 500; letter-spacing: -0.015em; }
h2 { font-size: 27px; line-height: 1.2; font-weight: 500; letter-spacing: -0.01em; margin-bottom: 10px; }
h3 { font-size: 21px; line-height: 1.3; font-weight: 600; }
.lead { font-size: 20px; line-height: 1.55; margin-top: 18px; }
.prose p + p { margin-top: 14px; }
.prose h2 { margin-top: 56px; }
.prose h3 { margin-top: 32px; margin-bottom: 6px; }
.prose ul { margin: 12px 0 0 1.1em; }
.prose li + li { margin-top: 6px; }
section { margin-top: 80px; }
.sub { color: var(--ink-soft); font-size: 16px; }
.where { font-size: 15px; color: var(--ink-soft); font-style: italic; }

/* Foto impressa e colada */
.print {
  position: relative; background: var(--print); padding: 8px 8px 34px;
  box-shadow: var(--shadow); transform: rotate(var(--tilt, 2deg));
}
.print img, .print .ph { aspect-ratio: var(--ratio, 4 / 5); width: 100%; height: auto; object-fit: cover; }
.shot img { height: auto; }
.print .ph {
  background: repeating-linear-gradient(135deg, #e7eaec 0 10px, #eef0f2 10px 20px);
  display: grid; place-items: center; text-align: center; padding: 12px;
  color: #6f7c88; font-size: 14px; line-height: 1.35;
}
.print figcaption { position: absolute; left: 8px; right: 8px; bottom: 6px; text-align: center; font-family: "Caveat", cursive; font-size: 20px; color: #2c5f8d; }
.tape::before {
  content: ""; position: absolute; top: -10px; left: 50%; width: 76px; height: 22px; margin-left: -38px;
  background: rgba(214, 205, 170, .55); transform: rotate(-3deg);
}

/* Screenshot */
.shot { margin: 28px 0; }
.shot img { border-radius: 8px; box-shadow: var(--shadow); }
.shot figcaption { font-size: 15px; color: var(--ink-soft); margin-top: 10px; }

/* Totais com sublinhado duplo (contabilidade) */
.tally { display: flex; flex-wrap: wrap; gap: 10px 32px; margin-top: 16px; font-variant-numeric: lining-nums tabular-nums; }
.tally div { font-size: 15px; color: var(--ink-soft); }
.tally b { display: inline-block; font-weight: 600; font-size: 20px; color: var(--ink); border-bottom: 3px double var(--ink); line-height: 1.25; margin-right: 6px; }
.tally.big b { font-size: 30px; }

/* Lista de projetos no landing */
.entries { margin-top: 12px; }
.entry { display: block; padding: 26px 0; border-bottom: 1px solid var(--rule); color: inherit; text-decoration: none; }
.entry:last-child { border-bottom: 0; }
.entry h3 { display: inline; background-image: linear-gradient(var(--pen), var(--pen)); background-size: 0 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s; }
.entry:hover h3, .entry:focus-visible h3 { background-size: 100% 1px; }
.entry p { margin-top: 8px; max-width: 36em; }
.entry .more { display: inline-block; margin-top: 10px; font-size: 15px; color: var(--pen); }

/* Logbook */
table.log { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 16px; }
.log th { text-align: left; font-weight: 400; font-style: italic; font-size: 14px; color: var(--ink-soft); padding: 0 12px 8px 0; border-bottom: 1px solid var(--ink); }
.log td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.log td:first-child { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; color: var(--ink-soft); width: 1%; padding-right: 24px; }
.log td strong { font-weight: 600; }
.log td a { color: var(--ink); text-decoration-color: var(--rule); }
.log td a:hover { color: var(--pen); text-decoration-color: currentColor; }
.log td span { display: block; color: var(--ink-soft); font-size: 15px; margin-top: 2px; }
@media (max-width: 620px) {
  .log thead { display: none; }
  .log tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .log td { display: block; border: 0; padding: 0; width: auto; }
  .log td:first-child { font-size: 14px; margin-bottom: 2px; }
}

/* Cabeçalho das páginas internas */
.back { display: inline-block; margin: 24px 0 36px; font-size: 15px; color: var(--ink-soft); text-decoration: none; }
.back:hover { color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin-top: 28px; padding: 18px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); font-size: 15px; }
.facts dt { color: var(--ink-soft); font-style: italic; font-size: 14px; }
.facts dd { font-variant-numeric: lining-nums; }

/* Próxima perna */
.nextleg { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 16px; }
.nextleg a { text-decoration: none; }
.nextleg small { display: block; color: var(--ink-soft); font-size: 14px; font-style: italic; }

/* Linha do tempo da história */
.timeline { margin-top: 32px; }
.chapter { display: grid; grid-template-columns: 92px 1fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--rule); }
.chapter .yr { font-variant-numeric: lining-nums tabular-nums; color: var(--route); font-weight: 600; font-size: 16px; padding-top: 3px; }
.chapter .yr small { display: block; color: var(--ink-soft); font-weight: 400; font-size: 13px; letter-spacing: .03em; }
.chapter p + p { margin-top: 10px; }
@media (max-width: 620px) { .chapter { grid-template-columns: 1fr; gap: 4px; } }

/* Galeria de fotos coladas */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 32px 0; }
.board .print:nth-child(2) { --tilt: -1.6deg; margin-top: 18px; }
.board .print:nth-child(3) { --tilt: 1.2deg; }
@media (max-width: 620px) { .board { grid-template-columns: 1fr 1fr; } }

/* Contato */
.sign { margin-top: 24px; font-size: 42px; }
footer.foot { max-width: 1040px; margin: 0 auto; padding: 32px 16px 48px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
footer.foot button { font: inherit; color: inherit; background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Paleta de comandos */
.palette { position: fixed; inset: 0; z-index: 50; display: none; place-items: start center; padding: 14vh 16px 0; background: rgba(16, 27, 38, .35); backdrop-filter: blur(2px); }
.palette.open { display: grid; }
.palette .box { width: 100%; max-width: 520px; background: var(--paper); border: 1px solid var(--rule); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.palette input { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--rule); padding: 14px 16px; outline: none; }
.palette ul { list-style: none; max-height: 50vh; overflow: auto; padding: 6px; }
.palette li a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 16px; }
.palette li a small { color: var(--ink-soft); font-size: 13px; font-style: italic; }
.palette li a.on { background: var(--paper-2); }
.palette .hint { font-size: 12px; color: var(--ink-soft); padding: 8px 16px; border-top: 1px solid var(--rule); font-variant-numeric: lining-nums; }

/* Cursor avião */
html.plane-on, html.plane-on * { cursor: none !important; }
#plane { position: fixed; left: 0; top: 0; width: 26px; height: 26px; margin: -1px 0 0 -13px; transform-origin: 50% 4%; pointer-events: none; z-index: 100; color: var(--ink); transition: width .15s, height .15s, margin .15s, color .15s; will-change: transform; }
#plane.hot { color: var(--route); width: 34px; height: 34px; margin: -1px 0 0 -17px; }
#trail { position: fixed; inset: 0; pointer-events: none; z-index: 99; }

/* Mapa-múndi */
.mapgrid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: stretch; margin-top: 20px; }
#worldmap { position: relative; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; background: var(--paper); touch-action: pan-y; }
#worldmap svg { width: 100%; height: auto; display: block; }
#worldmap.zoomed svg { cursor: grab; }
#worldmap .dot { fill: var(--land); }
#worldmap .land { fill: url(#dots); }
#worldmap .grat { fill: none; stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
#worldmap .leg { fill: none; stroke: var(--route); stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
#worldmap .leg.next { stroke-dasharray: 3 7; stroke-width: 1.6; }
#worldmap .mapplane path { fill: var(--ink); stroke: var(--paper); stroke-width: 1.4; }
#worldmap .apt { cursor: pointer; outline: none; }
#worldmap .apt .hit { fill: transparent; }
#worldmap .apt .pin { fill: var(--paper); stroke: var(--route); stroke-width: 2.2; }
#worldmap .apt.maybe .pin { stroke-dasharray: 2.5 2.5; }
#worldmap .apt:hover .pin, #worldmap .apt:focus-visible .pin, #worldmap .apt.sel .pin { fill: var(--route); }
#worldmap .apt:focus-visible .hit { stroke: var(--route); stroke-width: 1.5; }
#worldmap .apt.quiet text { display: none; }
#worldmap .grouplbl { cursor: pointer; outline: none; }
#worldmap .grouplbl.hidden { display: none; }
#worldmap .grouplbl:hover .lbl-code, #worldmap .grouplbl:focus-visible .lbl-code { fill: var(--route); }
#worldmap .lbl-code { font: 600 15px "Literata", Georgia, serif; fill: var(--ink); letter-spacing: .02em; font-variant-numeric: lining-nums; paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
#worldmap .lbl-city { font: 400 13px "Literata", Georgia, serif; fill: var(--ink-soft); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.mapctl { position: absolute; bottom: 12px; right: 12px; display: flex; gap: 6px; }
.mapctl button { font: inherit; font-size: 16px; line-height: 1; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer; font-variant-numeric: lining-nums; }
.mapctl button.wide { font-size: 14px; }
.mapctl button:hover { border-color: var(--ink-soft); }
.maphint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font-size: 14px; background: var(--ink); color: var(--paper); padding: 6px 12px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.maphint.on { opacity: .92; }

.placecard { border: 1px solid var(--rule); border-radius: 12px; padding: 20px; background: var(--paper-2); font-size: 16px; line-height: 1.55; }
.placecard h3 { font-size: 22px; font-weight: 500; }
.placecard h3 + .soft { font-size: 14px; margin-top: 2px; }
.placecard .soft { font-size: 15px; }
.placecard ul.places { list-style: none; margin-top: 14px; }
.placecard .places li + li { border-top: 1px solid var(--rule); }
.placecard .places button { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; font: inherit; color: var(--ink); background: none; border: 0; padding: 11px 4px; cursor: pointer; border-radius: 6px; }
.placecard .places button:hover { background: var(--paper); }
.placecard .places b { display: block; font-weight: 600; font-size: 16px; }
.placecard .places small { color: var(--ink-soft); font-size: 14px; font-variant-numeric: lining-nums; }
.placecard .pc { flex: none; width: 46px; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--route); font-variant-numeric: lining-nums; }
.placecard .cardback { font: inherit; font-size: 14px; color: var(--pen); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; margin-bottom: 14px; }
.placecard .pcode { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--route); font-variant-numeric: lining-nums; }
.placecard .when { margin: 12px 0 6px; font-style: italic; color: var(--ink-soft); font-variant-numeric: lining-nums; }
.placecard .plinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.placecard .plinks a { font-size: 14px; padding: 5px 12px; border: 1px solid var(--rule); border-radius: 999px; text-decoration: none; background: var(--paper); }
.placecard .plinks a:hover { border-color: var(--pen); }
@media (max-width: 860px) {
  .mapgrid { grid-template-columns: 1fr; }
  #worldmap .lbl-code { font-size: 30px; stroke-width: 7px; }
  #worldmap .lbl-city { font-size: 26px; stroke-width: 7px; }
  #worldmap .leg { stroke-width: 2.4; }
}

/* Setores do landing */
.sectors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.sector { display: flex; flex-direction: column; gap: 6px; padding: 22px; border: 1px solid var(--rule); border-radius: 12px; color: inherit; text-decoration: none; background: var(--paper); transition: border-color .15s, background .15s; min-height: 210px; }
.sector:hover, .sector:focus-visible { border-color: var(--ink); background: var(--paper-2); }
.sector h3 { font-size: 22px; font-weight: 500; }
.sector p { font-size: 16px; color: var(--ink-soft); line-height: 1.5; }
.sector .tally { margin-top: auto; padding-top: 12px; }
.sector .go { font-size: 15px; color: var(--pen); margin-top: 4px; }
@media (max-width: 860px) { .sectors { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .sectors { grid-template-columns: 1fr; } .sector { min-height: 0; } }

/* Abertura do landing */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: center; padding-top: 40px; }
.hero .print { --tilt: 2.4deg; --ratio: 1 / 1; }
.looking { margin-top: 24px; padding-left: 14px; border-left: 2px solid var(--route); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 8px; }
  .hero .print { width: 220px; order: -1; margin-left: 6px; }
  h1 { font-size: 38px; }
  body { font-size: 17px; }
}

/* Fluxo do pipeline: etapas em sequência real */
ol.flow { list-style: none; margin: 20px 0 0; counter-reset: step; position: relative; }
ol.flow li { counter-increment: step; position: relative; padding: 0 0 22px 44px; }
ol.flow li::before {
  content: counter(step); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--route); background: var(--paper); color: var(--route);
  display: grid; place-items: center; font-size: 14px; font-weight: 600; font-variant-numeric: lining-nums;
}
ol.flow li::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 2px; border-left: 2px dotted var(--route); opacity: .5; }
ol.flow li:last-child::after { display: none; }
ol.flow li b { display: block; font-weight: 600; }
.prose ol.flow li + li { margin-top: 0; }
.built { font-size: 15px; }
.col { max-width: 720px; }
