/* ================================================
   MAURICIO DE SOUZA - PORTFOLIO
   Curriculo (versao "sem explorar")
   ------------------------------------------------
   Herda as cores de style.css. Aqui o texto longo usa
   uma fonte legivel; a Press Start 2P fica so nos
   titulos, para nao cansar a leitura.
   ================================================ */

html, body {
  /* style.css trava scroll e fixa height:100% (bom para a tela do jogo,
     pessimo aqui: a pagina fica presa a uma tela de altura e a impressao
     corta tudo que passa disso). Aqui a altura tem que ser livre.        */
  height: auto;
  min-height: 100%;
  overflow: visible;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  image-rendering: auto;
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at 20% 0%, rgba(255,107,107,0.07), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(254,202,87,0.05), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: 80px;
}

.pixel { font-family: 'Press Start 2P', monospace; }

/* ================================================
   BARRA SUPERIOR
   ================================================ */

.cv-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 2px solid #222;
}

.cv-topbar .spacer { flex: 1; }

.cv-btn {
  display: inline-block;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--white);
  background: #1a1a1a;
  border: 2px solid #333;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
}

.cv-btn:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--bg);
  transform: translate(-1px, -1px);
}

.cv-btn-primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--bg);
}

.cv-btn-primary:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--bg);
}

/* ================================================
   FOLHA
   ================================================ */

.cv-sheet {
  position: relative;
  z-index: 10;
  max-width: 940px;
  margin: 0 auto;
  padding: 48px 28px 0;
}

/* ---- Cabecalho ---- */

.cv-header {
  border-bottom: 2px solid #222;
  padding-bottom: 28px;
  margin-bottom: 36px;
}

.cv-kicker {
  font-size: 0.45rem;
  letter-spacing: 0.3em;
  color: var(--gray);
  margin-bottom: 18px;
}

/* ---- Foto + bloco de texto ---- */

.cv-header-top {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

.cv-header-text { flex: 1; min-width: 0; }

.cv-photo {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  object-fit: cover;
  display: block;
  image-rendering: auto;            /* body usa pixelated; a foto nao pode */
  border: 3px solid var(--red);
  box-shadow: 8px 8px 0 rgba(255, 107, 107, 0.18);
  filter: saturate(0.95);
}

.cv-name {
  font-size: clamp(1.1rem, 4vw, 1.9rem);
  line-height: 1.35;
  color: var(--white);
  text-shadow: 3px 3px 0 var(--red-dark);
  margin-bottom: 20px;
}

.cv-name em { font-style: normal; color: var(--red); }

.cv-role {
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  color: var(--yellow);
  font-weight: 600;
  margin-bottom: 16px;
}

.cv-summary {
  font-size: 1rem;
  line-height: 1.75;
  color: #cfcfcf;
  max-width: 68ch;
}

/* ---- Contatos ---- */

.cv-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 24px;
}

.cv-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #ddd;
  text-decoration: none;
  background: #151515;
  border: 1px solid #2a2a2a;
  padding: 8px 12px;
  transition: border-color 0.12s, color 0.12s;
}

.cv-contact:hover { border-color: var(--red); color: var(--white); }
.cv-contact .ic { color: var(--red); }

/* ---- Secoes ---- */

.cv-section { margin-bottom: 44px; }

.cv-section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: var(--red);
  margin-bottom: 24px;
}

.cv-section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, #2a2a2a, transparent);
}

/* ---- Timeline (experiencia / formacao) ---- */

.cv-timeline {
  list-style: none;
  border-left: 2px solid #222;
  padding-left: 24px;
}

.cv-entry { position: relative; padding-bottom: 30px; }
.cv-entry:last-child { padding-bottom: 0; }

.cv-entry::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 5px;
  width: 10px;
  height: 10px;
  background: var(--red);
  box-shadow: 0 0 0 3px var(--bg);
}

.cv-entry.is-current::before {
  background: var(--yellow);
  animation: cvPulse 2s ease-in-out infinite;
}

.cv-entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 4px;
}

.cv-entry-role {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--white);
}

.cv-entry-when {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.42rem;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--gray);
  padding: 4px 7px;
  white-space: nowrap;
}

.cv-entry.is-current .cv-entry-when { background: var(--yellow); }

.cv-entry-org {
  font-size: 0.88rem;
  color: var(--yellow);
  margin-bottom: 10px;
}

.cv-entry-org .place { color: var(--gray); }

.cv-entry-desc {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #bbb;
  max-width: 72ch;
}

.cv-bullets {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.93rem;
  line-height: 1.7;
  color: #bbb;
  max-width: 72ch;
}

.cv-bullets li { margin-bottom: 5px; }
.cv-bullets li::marker { color: var(--red); }

/* ---- Skills ---- */

.cv-skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.cv-skill-group {
  background: #131313;
  border: 1px solid #242424;
  border-top: 3px solid var(--red);
  padding: 18px;
}

.cv-skill-group h3 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.48rem;
  letter-spacing: 0.12em;
  color: var(--yellow);
  margin-bottom: 14px;
}

.cv-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.cv-tag {
  font-size: 0.8rem;
  color: #ddd;
  background: #1e1e1e;
  border: 1px solid #2e2e2e;
  padding: 5px 10px;
}

/* ---- Projetos ---- */

.cv-projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.cv-project {
  display: flex;
  flex-direction: column;
  background: #131313;
  border: 1px solid #242424;
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
}

.cv-project:hover { border-color: var(--red); transform: translateY(-2px); }

.cv-project-tag {
  align-self: flex-start;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  color: var(--bg);
  background: var(--red);
  padding: 4px 7px;
  margin-bottom: 12px;
}

.cv-project-tag.tag-alt { background: var(--gray); }

.cv-project h3 {
  font-size: 1rem;
  color: var(--white);
  margin-bottom: 8px;
}

.cv-project p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #aaa;
  flex: 1;
  margin-bottom: 14px;
}

.cv-project-links { display: flex; flex-wrap: wrap; gap: 8px; }

.cv-link {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--yellow);
  border-bottom: 1px solid #3a3a3a;
  padding-bottom: 2px;
}

.cv-link:hover { color: var(--white); border-color: var(--white); }

/* ---- Chamada final ---- */

.cv-cta {
  text-align: center;
  border: 2px dashed #2a2a2a;
  padding: 36px 24px;
  margin-bottom: 40px;
}

.cv-cta p {
  font-size: 0.95rem;
  color: #bbb;
  line-height: 1.7;
  margin-bottom: 22px;
  max-width: 56ch;
  margin-left: auto;
  margin-right: auto;
}

.cv-foot {
  text-align: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  letter-spacing: 0.15em;
  color: #333;
}

@keyframes cvPulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--bg); }
  50%      { box-shadow: 0 0 0 3px var(--bg), 0 0 12px 2px rgba(254,202,87,0.5); }
}

/* ================================================
   RESPONSIVO
   ================================================ */

@media (max-width: 720px) {
  .cv-header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 22px;
  }
  .cv-photo { width: 128px; height: 128px; box-shadow: 6px 6px 0 rgba(255,107,107,0.18); }
  .cv-summary { margin-left: auto; margin-right: auto; }
  .cv-contacts { justify-content: center; }
}

@media (max-width: 600px) {
  .cv-sheet { padding: 32px 18px 0; }
  .cv-topbar { padding: 10px 14px; }
  .cv-btn { font-size: 0.42rem; padding: 9px 11px; }
  .cv-summary, .cv-entry-desc, .cv-bullets { font-size: 0.92rem; }
  .cv-timeline { padding-left: 18px; }
  .cv-entry::before { left: -25px; }
}

/* ================================================
   IMPRESSAO / PDF
   ------------------------------------------------
   Vira uma folha branca comum: e este arquivo que a
   pessoa salva como PDF pelo botao IMPRIMIR.
   ================================================ */

@media print {
  @page { margin: 14mm; }

  /* --- 1) Destravar a pagina ---------------------------------
     style.css define html/body com height:100% e overflow:hidden.
     Na impressao isso limita o documento a UMA tela de altura e o
     navegador corta o resto (e o corte muda conforme a rolagem).
     Tudo aqui precisa ser altura livre e overflow visivel.      */
  html, body {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
    background: #fff !important;
    background-image: none !important;
    color: #111 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* --- 2) Sumir com tudo que e fixo ---------------------------
     Elemento position:fixed na impressao gruda em toda pagina ou
     empurra o conteudo. Nenhum deles serve no papel.            */
  .cv-topbar,
  .scanlines,
  .pixel-grid,
  .corner,
  .corner-pulse,
  .screen-flash,
  #stars-canvas,
  .cv-cta,
  .no-print { display: none !important; }

  .cv-sheet {
    max-width: none;
    width: auto;
    padding: 0;
    margin: 0;
    overflow: visible !important;
  }

  /* A foto precisa sair na impressao: por padrao o navegador
     descarta cores/imagens de fundo, entao forcamos a fidelidade. */
  .cv-header-top { gap: 20px; }

  .cv-photo {
    width: 34mm;
    height: 34mm;
    border-color: #b03030 !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cv-name,
  .cv-entry-role,
  .cv-project h3 { color: #111 !important; text-shadow: none !important; }

  .cv-name em,
  .cv-section-title,
  .cv-entry-org,
  .cv-skill-group h3,
  .cv-link { color: #b03030 !important; }

  .cv-role { color: #333 !important; }

  .cv-summary,
  .cv-entry-desc,
  .cv-bullets,
  .cv-project p,
  .cv-cta p { color: #333 !important; }

  .cv-kicker, .cv-entry-org .place, .cv-foot { color: #666 !important; }

  .cv-header, .cv-timeline, .cv-cta { border-color: #ccc !important; }

  .cv-contact,
  .cv-skill-group,
  .cv-project,
  .cv-tag {
    background: #fff !important;
    border-color: #ccc !important;
    color: #222 !important;
  }

  .cv-skill-group { border-top-color: #b03030 !important; }

  .cv-entry-when {
    background: #eee !important;
    color: #333 !important;
  }

  .cv-entry::before { background: #b03030 !important; box-shadow: none !important; animation: none !important; }

  /* --- 3) Quebras de pagina ----------------------------------
     A secao PODE quebrar entre paginas (se nao puder, uma secao
     mais alta que a folha estoura e some). O que nao pode quebrar
     no meio e cada bloco individual: um emprego, um card, um
     grupo de skills. E titulo nunca fica sozinho no rodape.     */
  .cv-section { break-inside: auto; margin-bottom: 26px; }

  .cv-entry,
  .cv-project,
  .cv-skill-group,
  .cv-contact { break-inside: avoid; }

  .cv-section-title,
  .cv-entry-head,
  .cv-entry-org { break-after: avoid; }

  .cv-name, .cv-role { break-after: avoid; }

  .cv-foot { break-before: avoid; }

  /* Sem animacao/transicao no papel */
  * { animation: none !important; transition: none !important; }

  /* Compacta um pouco: sobra menos pagina orfa no fim */
  .cv-header { padding-bottom: 18px; margin-bottom: 24px; }
  .cv-entry { padding-bottom: 18px; }
  .cv-summary, .cv-entry-desc, .cv-bullets, .cv-project p { font-size: 10.5pt; line-height: 1.55; }
  .cv-entry-role { font-size: 11.5pt; }
  .cv-entry-org { font-size: 10pt; margin-bottom: 6px; }
}
