/* ---------------------------------------------------------------
   Marcus Vinícius — portfolio
   Sem frameworks, sem build, sem dependências externas.
   --------------------------------------------------------------- */

:root {
  --bg:      #fbfbfa;
  --surface: #ffffff;
  --text:    #16181d;
  --muted:   #62666e;
  --rule:    #e4e4e0;
  --accent:  #0b4fd0;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0f1113;
    --surface: #15181b;
    --text:    #e6e8ea;
    --muted:   #969ba2;
    --rule:    #262a2f;
    --accent:  #7ea7ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 5rem 1.5rem 6rem;
}

@media (max-width: 40rem) {
  body { font-size: 16px; }
  main { padding: 3rem 1.25rem 4rem; }
}

/* ---------- tipografia ---------- */

p { margin: 0 0 1.15rem; }

.lead {
  font-size: 1.2em;
  line-height: 1.5;
  letter-spacing: -0.015em;
  margin-bottom: 1.75rem;
}

strong { font-weight: 640; }

blockquote {
  margin: 0 0 1.15rem;
  padding: 0.1rem 0 0.1rem 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}

.aside {
  color: var(--muted);
  font-size: 0.94em;
}

h2 {
  margin: 0 0 1.5rem;
  font-size: 0.78rem;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

h3 {
  margin: 0 0 0.9rem;
  font-size: 1.02rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

/* ---------- links ---------- */

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .12s ease, text-decoration-color .12s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- seções ---------- */

section, footer {
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--rule);
}

.intro > p:last-child { margin-bottom: 0; }

/* ---------- imagens ---------- */

figure { margin: 0; }

.portrait {
  margin-bottom: 2.25rem;
}

.portrait img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.shot {
  margin: 1.75rem 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--surface);
}

.shot a { display: block; text-decoration: none; }

.shot a:hover img { border-color: var(--accent); }

figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- trajetória ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  display: grid;
  grid-template-columns: 6.75rem 1fr;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}

.timeline li:first-child { border-top: 0; padding-top: 0; }

.years {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 0.22rem;
  font-variant-numeric: tabular-nums;
}

.role strong { display: block; font-weight: 600; }

.role em {
  display: block;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ---------- projetos ---------- */

.project { margin-bottom: 3rem; }
.project:last-child { margin-bottom: 0; }
.project p:last-of-type { margin-bottom: 0; }

.stack {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0;
  padding: 0;
}

.stack li {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.14rem 0.45rem;
}

/* ---------- listas de links ---------- */

.links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.links li { padding: 0.3rem 0; }

.links a { font-family: var(--mono); font-size: 0.92rem; }

/* ---------- contato ---------- */

.contact {
  margin: 0;
  display: grid;
  grid-template-columns: 6.75rem 1fr;
  gap: 0.35rem 1rem;
}

.contact dt {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  padding-top: 0.1rem;
}

.contact dd { margin: 0 0 0.75rem; }

.contact .note {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 30rem) {
  .timeline li, .contact { grid-template-columns: 1fr; gap: 0.25rem; }
  .years { padding-top: 0; }
}

/* ---------------------------------------------------------------
   Impressão / exportar para PDF
   Duas coisas quebram o fundo no PDF e as duas são tratadas aqui:
   1. o navegador descarta cores de fundo na impressão, a menos que
      print-color-adjust mande o contrário;
   2. a faixa de margem do @page nunca é pintada — por isso ela vai
      a zero e o respiro vira padding do conteúdo.
   O Chromium força prefers-color-scheme: light ao imprimir, então a
   paleta escura é fixada aqui na mão em vez de vir da media query.
   --------------------------------------------------------------- */

@page { margin: 0; }

@media print {
  :root {
    --bg:      #0f1113;
    --surface: #15181b;
    --text:    #e6e8ea;
    --muted:   #969ba2;
    --rule:    #2c3036;
    --accent:  #7ea7ff;
  }

  html {
    background: var(--bg);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: var(--bg);
    color: var(--text);
    font-size: 10.5pt;
  }

  main {
    max-width: none;
    padding: 20mm 22mm;
  }

  /* Padding em vez de margin: margem some na quebra de página,
     padding sobrevive e vira o respiro no topo da página seguinte. */
  section, footer {
    margin-top: 0;
    padding-top: 10mm;
  }

  .project {
    margin-bottom: 0;
    padding-top: 10mm;
    break-inside: avoid;
  }

  .project:first-of-type { padding-top: 0; }

  .timeline li, .contact, figure, blockquote { break-inside: avoid; }
  h2, h3 { break-after: avoid; }

  /* Preview em largura cheia empurra cada projeto pra uma folha só,
     deixando meia página vazia. A 75% cabem dois por folha. */
  .shot { margin: 1.25rem 0; }
  .shot img { max-width: 75%; max-height: 9cm; width: auto; }

  a { text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent); }
}
