/* ===========================================================================
   Batalha de Robôs | Experience ESEG Engenharias 2026
   Tema unico. Sem dependencias externas.
   Paleta amostrada do banner oficial: navy #01164F, teal #42B9C1, branco.
   =========================================================================== */

:root {
  --navy-900: #01102f;
  --navy-800: #01164f;
  --navy-700: #062063;
  --navy-600: #0b2b7a;

  --teal:      #42b9c1;
  --teal-soft: #7fd6db;
  --teal-dim:  rgba(66, 185, 193, 0.14);

  --ink:       #ffffff;
  --ink-soft:  #c8d4ec;
  --ink-dim:   #8fa1c4;

  --line:      rgba(127, 214, 219, 0.20);
  --line-soft: rgba(200, 212, 236, 0.12);

  --surface:      rgba(255, 255, 255, 0.045);
  --surface-high: rgba(255, 255, 255, 0.075);

  --warn:      #ffcc4d;
  --warn-bg:   rgba(255, 204, 77, 0.10);
  --danger:    #ff7a6b;
  --danger-bg: rgba(255, 122, 107, 0.10);
  --good:      #6ee7a0;
  --good-bg:   rgba(110, 231, 160, 0.10);

  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1080px;

  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "Courier New", monospace;

  color-scheme: dark;
}

/* --------------------------------------------------------------- base ---- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-soft);
  background-color: var(--navy-800);
  /* grade de pontos discreta, igual a do banner oficial */
  background-image: radial-gradient(rgba(127, 214, 219, 0.07) 1px, transparent 1px);
  background-size: 26px 26px;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 .6em;
}
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin-top: 2.4em; }
h3 { font-size: 1.12rem; margin-top: 1.8em; color: var(--teal-soft); }
h2:first-child, h3:first-child { margin-top: 0; }

p { margin: 0 0 1.1em; }
strong { color: var(--ink); font-weight: 650; }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-soft); text-decoration: underline; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: .45em; }
li::marker { color: var(--teal); }

hr { border: 0; border-top: 1px solid var(--line-soft); margin: 3rem 0; }

img { max-width: 100%; }

code {
  font-family: var(--mono);
  font-size: .89em;
  background: var(--teal-dim);
  color: var(--teal-soft);
  padding: .12em .4em;
  border-radius: 5px;
  white-space: nowrap;
}
/* Assinaturas longas em titulo (onHitByBullet(self, bulletBotId, ...))
   nao cabem em tela estreita e empurravam a pagina para o lado. */
h1 code, h2 code, h3 code, h4 code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 68ch; }
.muted { color: var(--ink-dim); font-size: .93rem; }
.center { text-align: center; }

/* ------------------------------------------------------------- header ---- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(1, 16, 47, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
}

.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { color: var(--ink); font-size: .95rem; font-weight: 700; }
.brand-text span { color: var(--teal); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }

.nav-toggle {
  margin-left: auto;
  display: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}

.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li { margin: 0; }
.site-nav a {
  display: block;
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: .89rem;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { background: var(--teal-dim); color: var(--teal-soft); font-weight: 600; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    width: 100%;
    margin: 0 0 12px;
    order: 3;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); border-radius: 0; }
  .site-header .wrap { flex-wrap: wrap; }
}

/* --------------------------------------------------------------- hero ---- */

/* O arquivo do banner e 1920x1080 com muito espaco vazio: o logo ocupa
   so a faixa entre 9% e 65% da altura. As margens negativas abaixo estao
   em porcentagem da LARGURA do container, entao o recorte acompanha
   qualquer tamanho de tela sem cortar o logo. */
.hero-banner {
  background: var(--navy-800);
  padding: 4px 0 10px;
}
.hero-banner .banner-crop {
  max-width: 840px;
  margin: 0 auto;
  overflow: hidden;
  /* o arredondamento faz o recorte ler como um cartao proposital,
     e nao como uma emenda mal feita com o fundo da pagina */
  border-radius: 16px;
}
.hero-banner img {
  display: block;
  /* 102% de largura com -1% de recuo esconde a coluna branca de 1px
     que existe na borda do JPEG original */
  width: 102%;
  height: auto;
  margin-left: -1%;
  margin-top: -5%;
  margin-bottom: -19%;
}

.hero {
  padding: 44px 0 8px;
  border-bottom: 1px solid var(--line-soft);
}
.hero .eyebrow {
  color: var(--teal);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .8em;
}
.hero h1 { max-width: 20ch; }
.hero .lead { font-size: 1.2rem; }

.page-head {
  padding: 46px 0 26px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 42px;
}
.page-head .eyebrow {
  color: var(--teal);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .7em;
}
.page-head h1 { margin-bottom: .35em; }
.page-head p:last-child { margin-bottom: 0; }

main { padding-bottom: 72px; }
section { scroll-margin-top: 80px; }

/* -------------------------------------------------------------- cards ---- */

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card h3 { margin-top: 0; color: var(--ink); }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

a.card { display: block; color: inherit; transition: border-color .15s, background .15s; }
a.card:hover {
  text-decoration: none;
  border-color: var(--teal);
  background: var(--surface-high);
}
a.card h3 { color: var(--teal-soft); }
a.card .go { color: var(--teal); font-size: .88rem; font-weight: 600; }

.card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--navy-900);
  font-weight: 800;
  font-size: .95rem;
  margin-bottom: 12px;
}

/* ------------------------------------------------------------ callout ---- */

.note {
  border-left: 3px solid var(--teal);
  background: var(--teal-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 1.6em 0;
}
.note > :last-child { margin-bottom: 0; }
.note .note-title {
  display: block;
  color: var(--teal-soft);
  font-weight: 700;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: .4em;
}

.note.warn { border-left-color: var(--warn); background: var(--warn-bg); }
.note.warn .note-title { color: var(--warn); }
.note.danger { border-left-color: var(--danger); background: var(--danger-bg); }
.note.danger .note-title { color: var(--danger); }
.note.good { border-left-color: var(--good); background: var(--good-bg); }
.note.good .note-title { color: var(--good); }

/* ------------------------------------------------------------- tabela ---- */

.table-wrap {
  overflow-x: auto;
  margin: 1.4em 0;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
table { border-collapse: collapse; width: 100%; font-size: .94rem; min-width: 460px; }
thead th {
  background: rgba(66, 185, 193, 0.10);
  color: var(--teal-soft);
  text-align: left;
  font-size: .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.col-sig { white-space: nowrap; }

/* ------------------------------------------------------------- codigo ---- */

.code {
  position: relative;
  margin: 1.4em 0;
  background: var(--navy-900);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line-soft);
}
.code-head .file {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--ink-dim);
}
.copy-btn {
  margin-left: auto;
  background: var(--teal-dim);
  border: 1px solid var(--line);
  color: var(--teal-soft);
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--teal); color: var(--navy-900); }
.copy-btn.done { background: var(--good); border-color: var(--good); color: var(--navy-900); }

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: .855rem;
  line-height: 1.6;
  color: #dbe6ff;
  tab-size: 4;
}
.code pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  white-space: pre;
  border-radius: 0;
}

/* realce de sintaxe aplicado por assets/js/main.js */
.tok-com  { color: #6f83ad; font-style: italic; }
.tok-str  { color: #9ee6a8; }
.tok-kw   { color: #ff9ec4; }
.tok-num  { color: #ffcc4d; }
.tok-self { color: #ff9ec4; font-style: italic; }
.tok-cls  { color: #ffd98a; }
.tok-fn   { color: #7fd6db; }

/* ----------------------------------------------------------- timeline ---- */

.timeline { list-style: none; margin: 2rem 0; padding: 0 0 0 30px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding-bottom: 30px; margin-bottom: 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -37px; top: 7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--teal);
  border: 3px solid var(--navy-800);
  box-shadow: 0 0 0 2px var(--teal);
}
.timeline .time {
  display: inline-block;
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: .2em;
}
.timeline h3 { margin: 0 0 .3em; color: var(--ink); font-size: 1.05rem; }
.timeline p { margin-bottom: 0; }

/* ----------------------------------------------------------- diagrama ---- */

.diagram { margin: 2em 0; text-align: center; }
.diagram svg { max-width: 100%; height: auto; }
/* Sem um teto, o SVG estica ate a largura do texto e a tipografia
   interna fica desproporcional em relacao ao resto da pagina. */
.diagram.compasso svg { max-width: 440px; }
.diagram.fluxo svg { max-width: 780px; }
.diagram figcaption { color: var(--ink-dim); font-size: .88rem; margin-top: .8em; }

/* --------------------------------------------------------------- misc ---- */

.pill {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-dim);
  color: var(--teal-soft);
  border: 1px solid var(--line);
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: var(--navy-900);
  font-weight: 700;
  font-size: .96rem;
}
.btn:hover { background: var(--teal-soft); color: var(--navy-900); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--teal); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--teal-dim); color: var(--teal-soft); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0; }

.next-links {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin-top: 3.5rem; padding-top: 1.8rem;
  border-top: 1px solid var(--line-soft);
}

dl.defs { margin: 1.4em 0; }
dl.defs dt { color: var(--teal-soft); font-family: var(--mono); font-size: .92rem; font-weight: 600; margin-top: 1.1em; }
dl.defs dd { margin: .25em 0 0; }

/* ------------------------------------------------------------- footer ---- */

.site-footer {
  border-top: 1px solid var(--line-soft);
  background: rgba(1, 16, 47, 0.6);
  padding: 34px 0;
  font-size: .9rem;
  color: var(--ink-dim);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.site-footer img { height: 30px; width: auto; opacity: .85; }
.site-footer p { margin: 0; }
.site-footer .right { margin-left: auto; text-align: right; }

@media (max-width: 640px) {
  .site-footer .right { margin-left: 0; text-align: left; }
  .hero { padding-top: 32px; }
  .page-head { padding-top: 34px; }
}
