/* ===== Tokens ===== */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #111827;
  --accent-soft: #f3f4f6;
  --max: 820px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --fg: #e6edf3;
    --muted: #8b949e;
    --line: #21262d;
    --accent: #e6edf3;
    --accent-soft: #161b22;
  }
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  padding: 48px 20px;
}

a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .15s; }
a:hover { border-color: var(--fg); }

.muted { color: var(--muted); }

/* ===== Layout ===== */
.cv {
  max-width: var(--max);
  margin: 0 auto;
}

.section { margin-top: 36px; }

.section h2 {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  padding-bottom: 8px;
  margin-bottom: 18px;
  border-bottom: 2px solid var(--line);
}

/* ===== Header ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.header h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.header__role {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
}

.contacts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.contacts a { border-bottom-color: transparent; }
.contacts a:hover { border-bottom-color: var(--muted); }

.header__photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

/* ===== Perfil ===== */
.prose p { margin-bottom: 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { font-weight: 600; }

/* ===== CTA / navegação ===== */
.cta {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
}
.cta a {
  border-bottom: none;
  color: var(--accent);
  font-weight: 500;
}
.cta a:hover { border-bottom: 1px solid var(--accent); }
.header .cta { margin-top: 10px; }

/* ===== Competências ===== */
.skills {
  display: grid;
  gap: 10px;
}
.skill {
  font-size: 14px;
  line-height: 1.55;
}
.skill__key {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  display: inline-block;
  min-width: 130px;
  margin-right: 6px;
}

/* ===== Timeline / Experiência ===== */
.job {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.job:first-child { border-top: none; padding-top: 0; }

.job__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.job__period {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.job__org {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.job__body h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}
.job__body p { font-size: 14px; }

/* ===== Formação + Cursos ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.edu h3 { font-size: 15px; font-weight: 600; }
.edu__org { color: var(--muted); }
.edu__period { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 2px; }

.courses { list-style: none; display: grid; gap: 8px; }
.courses li { font-size: 14px; padding-left: 16px; position: relative; }
.courses li::before { content: "▹"; position: absolute; left: 0; color: var(--muted); }

/* ===== Footer ===== */
.footer {
  display: flex;
  justify-content: space-between;
  margin-top: 44px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ===== Botão PDF ===== */
.skip-print {
  position: fixed;
  top: 20px;
  right: 20px;
  font-family: var(--mono);
  font-size: 12px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  z-index: 10;
}
.skip-print:hover { border-color: var(--fg); }

/* ===== Responsivo ===== */
@media (max-width: 640px) {
  body { padding: 28px 16px; }
  .header { flex-direction: column-reverse; align-items: flex-start; gap: 18px; }
  .header h1 { font-size: 28px; }
  .job { grid-template-columns: 1fr; gap: 6px; }
  .job__meta { flex-direction: row; gap: 12px; align-items: baseline; }
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .skill__key { min-width: auto; display: block; margin-bottom: 2px; }
}

/* ===== Impressão / PDF ===== */
@media print {
  :root {
    --bg: #fff; --fg: #000; --muted: #555; --line: #ccc; --accent: #000; --accent-soft: #f5f5f5;
  }
  body { padding: 0; font-size: 10.5pt; }
  .cv { max-width: 100%; }
  .skip-print { display: none; }
  a { border-bottom: none !important; }
  .section { margin-top: 18px; }
  .job { break-inside: avoid; padding: 9px 0; }
  .header { break-inside: avoid; }
  @page { margin: 14mm; }
}
