/* ==========================================================================
   skchima.github.io — Design Moderno, Dinâmico e Altamente Legível
   Tipografia: Inter (UI e Texto) + JetBrains Mono (Código e Tags)
   Cores: Deep Slate + Royal Purple Gradient + Violet Accents
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  /* Cores Base */
  --bg: #0c0d14;
  --bg-card: #131522;
  --bg-card-hover: #191c2c;
  --bg-raised: #1e2133;

  /* Texto */
  --fg: #f1f5f9;
  --fg-secondary: #cbd5e1;
  --fg-muted: #94a3b8;
  --fg-faint: #64748b;

  /* Bordas e Linhas */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.2);

  /* Identidade Visual (Roxo / Violeta) */
  --purple-dark: #320459;
  --purple-main: #500090;
  --purple-light: #7c22b9;
  --purple-gradient: linear-gradient(135deg, #2b034e 0%, #4c0089 50%, #6815a5 100%);
  --accent: #a855f7;
  --accent-light: #c084fc;
  --accent-bg: rgba(168, 85, 247, 0.12);

  /* Tipografia */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Layout */
  --max-width: 1680px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* ---------- Reset & Base ---------- */

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.65;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--purple-light);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
}

/* ---------- Topo / Header Roxo Unificado ---------- */

.site-hero-header,
#title-block-header {
  background: var(--purple-gradient);
  color: #ffffff;
  padding: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 2rem 2rem;
}

/* Barra de Navegação no topo da faixa roxa */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-item {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.925rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-weight: 600;
  box-shadow: none;
}

.nav-sep {
  color: rgba(255, 255, 255, 0.4);
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pill-link:hover {
  background: #ffffff;
  color: var(--purple-dark);
  border-color: #ffffff;
  transform: translateY(-1px);
}

.profile-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
}

.avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.avatar-img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
  display: block;
}

.profile-info {
  text-align: center;
  width: 100%;
}

.profile-info h1 {
  margin: 0 auto;
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #ffffff;
  line-height: 1.15;
  text-align: center;
}

.profile-course {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.35;
}

.profile-institution {
  margin: 0.15rem 0 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.35;
}

.profile-info .subtitle {
  margin: 0.5rem 0 0;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 400;
  line-height: 1.4;
}

/* Suporte a Quarto Header (#title-block-header ocultado quando substituído pelo hero) */
#title-block-header {
  display: none;
}

/* ---------- Container Principal ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

/* Otimização widescreen e header compacto para a página inicial */
body.home-page .header-container {
  max-width: 1720px;
  width: 95%;
  padding: 0.75rem 2rem 1.15rem;
}

body.home-page main {
  max-width: 1720px;
  width: 95%;
  padding: 1.5rem 2rem 2.5rem;
}

body.home-page .header-nav {
  padding-bottom: 0.45rem;
  margin-bottom: 0.65rem;
}

body.home-page .profile-block {
  gap: 0.45rem;
}

body.home-page .avatar-img {
  width: 120px;
  height: 120px;
  border-width: 3px;
  box-shadow: none;
}

body.home-page .profile-info h1 {
  font-size: 1.55rem;
}

body.home-page .profile-course {
  font-size: 0.925rem;
  margin-top: 0.2rem;
}

body.home-page .profile-institution {
  font-size: 0.825rem;
  margin-top: 0.1rem;
}

/* Limitar largura de leitura confortável para artigos acadêmicos */
body:has(#title-block-header) main {
  max-width: 1040px;
}

/* ---------- Tipografia & Títulos de Seção ---------- */

h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.25rem;
  background: var(--purple-light);
  border-radius: 2px;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin: 0 0 0.5rem;
}

p {
  margin: 0 0 1rem;
  color: var(--fg-secondary);
  font-size: 1rem;
  line-height: 1.7;
}

a {
  color: var(--accent-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: all 0.15s ease;
}

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

/* ---------- Grade de 4 Colunas da Página Inicial (No-Scroll) ---------- */

.home-four-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.85fr 1.15fr 0.9fr;
  gap: clamp(3rem, 3.8vw, 4.5rem);
  align-items: start;
}

.home-four-columns .section-block h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
}

.home-four-columns .section-block p {
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 0.9rem;
}

.home-four-columns .interests-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-left: 1.2rem;
  margin: 0;
}

.home-four-columns .interests-list li {
  font-size: 0.95rem;
  line-height: 1.55;
}

.home-four-columns .timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.home-four-columns .timeline-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.home-four-columns .timeline-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.home-four-columns .timeline-date {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-light);
}

.home-four-columns .timeline-content {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--fg-secondary);
}

.home-four-columns .contact-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.home-four-columns .contact-card-item {
  min-height: 50px;
  padding: 0.65rem 0.95rem;
}

.home-four-columns .contact-card-item.email-card {
  gap: 0.25rem;
  padding: 0.65rem 0.95rem;
}

.home-four-columns .contact-card-title {
  font-size: 0.95rem;
}

.home-four-columns .contact-card-val {
  font-size: 0.9rem;
}

@media (max-width: 1180px) {
  .home-four-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  .home-four-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ---------- Linhas de Duas Colunas (Row-based) ---------- */

.row-two-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3.5rem;
}

.row-two-columns:last-child {
  margin-bottom: 0;
}

@media (min-width: 860px) {
  .row-two-columns {
    grid-template-columns: 1.35fr 1fr;
    gap: 3.5rem;
    align-items: start;
  }
}

.row-two-columns > .section-block h2 {
  margin-top: 0;
}

/* ---------- Cards Modernos & Interativos ---------- */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.35rem;
  }
}

.interactive-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.interactive-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: none;
}

.interactive-card p {
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.card-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.card-header h3 a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
}

.card-header h3 a:hover {
  color: var(--accent-light);
}

.card-date {
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-badge {
  font-family: var(--font-sans);
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--fg-secondary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.meta-subtext {
  font-size: 0.875rem;
  color: var(--fg-muted);
  margin-bottom: 0.75rem;
}

.card-footer-action {
  margin-top: 0.55rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent-light);
  text-decoration: none;
}

.card-footer-action:hover {
  color: #ffffff;
  transform: translateX(3px);
}

/* ---------- Filtros Interativos / Abas de Projetos ---------- */

.filter-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.5rem;
  margin-bottom: 1.15rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  color: var(--fg-secondary);
  border: 1px solid var(--border);
  padding: 0.55rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 42px;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
  border-color: var(--border-hover);
}

.filter-btn.active {
  background: var(--purple-main);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
  font-weight: 600;
}

/* ---------- Lista de Destaques / Timeline ---------- */

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.timeline-item {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.timeline-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.timeline-date {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-light);
  flex-shrink: 0;
}

.timeline-content {
  font-size: 0.95rem;
  color: var(--fg-secondary);
}

/* ---------- Tags & Interesses ---------- */

.interests-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-left: 1.25rem;
  margin: 0;
  color: var(--fg-secondary);
  list-style-type: disc;
}

.interests-list li {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Bloco de Contato Interativo ---------- */

/* ---------- Bloco de Contato ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (max-width: 580px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  min-height: 72px;
}

.contact-card-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.contact-card-item.email-card {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.35rem;
}

.contact-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.contact-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
}

.contact-card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  transition: color 0.15s ease;
}

.contact-card-item:hover .contact-card-title {
  color: var(--accent-light);
}

.contact-card-icon {
  font-size: 0.95rem;
  color: var(--fg-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.contact-card-item:hover .contact-card-icon {
  color: var(--accent-light);
  transform: translate(2px, -2px);
}

.contact-card-val {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s ease;
}

a.contact-card-val:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1.2;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
  color: #ffffff;
}

/* ---------- Code & Quarto Styles ---------- */

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Container de Bloco de Código: o card visual fica estático e envolve o slide */
div.sourceCode {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple-light);
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

div.sourceCode > pre,
div.sourceCode pre.sourceCode {
  display: block;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 1rem 1.25rem;
  overflow-x: visible !important;
  max-width: none !important;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
}

/* Para elementos pre avulsos fora de div.sourceCode */
pre:not(.sourceCode) {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--purple-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  main,
  body:has(#title-block-header) main {
    padding: 1.25rem 1rem 2.5rem;
  }

  div.sourceCode {
    margin: 1rem 0;
  }

  div.sourceCode > pre,
  div.sourceCode pre.sourceCode,
  pre:not(.sourceCode) {
    padding: 0.85rem 0.95rem;
  }

  pre code {
    font-size: 0.82rem;
  }
}

blockquote {
  border-left: 3px solid var(--purple-light);
  background: rgba(255, 255, 255, 0.03);
  margin: 1.25rem 0;
  padding: 0.85rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--fg-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

th mjx-container,
th .MathJax {
  text-transform: none;
  letter-spacing: normal;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

/* Responsividade para fórmulas matemáticas longas no MathJax */
mjx-container[display="true"],
.MathJax_Display,
.math.display {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.35rem 0;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Pipeline Visual & Responsivo (Pipeline Flow) ---------- */

.pipeline-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.75rem auto 2.25rem;
  padding: 1.25rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 100%;
  box-sizing: border-box;
}

.pipeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  flex: 1 1 0;
  min-width: 0;
}

.pipeline-step-badge {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
}

.pipeline-step-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.25;
}

.pipeline-step-code {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-muted);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.pipeline-step p,
.pipeline-arrow p {
  margin: 0;
}

.pipeline-step.pipeline-step-final {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.08);
}

.pipeline-step.pipeline-step-final .pipeline-step-badge {
  color: #d8b4fe;
}

.pipeline-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  flex-shrink: 0;
  padding: 0 0.15rem;
}

.pipeline-arrow-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(168, 85, 247, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  white-space: nowrap;
}

.pipeline-arrow-icon {
  font-size: 1.15rem;
  color: var(--fg-muted);
  line-height: 1;
}

@media (max-width: 820px) {
  .pipeline-flow {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 1.15rem 0.85rem;
  }

  .pipeline-step {
    width: 100%;
    padding: 0.75rem 0.85rem;
  }

  .pipeline-arrow {
    flex-direction: row;
    gap: 0.5rem;
    padding: 0.15rem 0;
  }

  .pipeline-arrow-icon {
    transform: rotate(90deg);
  }
}

/* ---------- Grade de Árvores de Estratégias ---------- */

.strategy-trees-flow {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin: 2rem auto;
  padding: 1.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 820px;
  box-sizing: border-box;
}

.strategy-tree-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: var(--bg-raised);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  width: 100%;
}

.strategy-tree-item.valid-strategy {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.12);
}

.strategy-tree-item p {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.strategy-tree-item img {
  filter: invert(0.94) hue-rotate(180deg);
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
  margin: 0 auto;
}

@media (max-width: 680px) {
  .strategy-trees-flow {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1rem 0.85rem;
  }

  .strategy-tree-item {
    width: 100%;
    padding: 1rem 0.65rem;
  }

  .strategy-tree-item img {
    max-width: 300px;
  }
}

/* ---------- Diagramas Categóricos & Ambientes Matemáticos ---------- */

.cd-diagram {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 2.5rem auto;
  padding: 2.25rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 620px;
  width: 100%;
  box-sizing: border-box;
}

.cd-diagram p {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.cd-diagram img {
  filter: invert(0.94) hue-rotate(180deg);
  width: 100%;
  max-width: 440px;
  min-width: 260px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.theorem-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple-light);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  margin: 2rem 0;
}

.theorem-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-light);
  margin-bottom: 0.65rem;
}

.proof-box {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
  font-size: 0.95rem;
  color: var(--fg-secondary);
}

.proof-title {
  font-weight: 600;
  font-style: italic;
  color: var(--fg);
  display: block;
  margin-bottom: 0.5rem;
}

.proof-box .qed {
  float: right;
  font-weight: bold;
  color: var(--accent-light);
}

.resumo-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple-light);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  margin: 1.75rem 0 2.25rem;
  font-size: 1.05rem;
  line-height: 1.65;
}

.resumo-box strong {
  color: #ffffff;
}

/* ---------- Rodapé Opcional (Oculto) ---------- */

.site-footer {
  display: none;
}

/* ---------- Responsividade Mobile ---------- */

@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .header-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .quick-links {
    width: 100%;
    justify-content: flex-start;
  }

  .profile-block {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
  }

  .avatar-img {
    width: 100px;
    height: 100px;
  }

  .profile-info h1 {
    font-size: 1.4rem;
  }

  .timeline-item {
    flex-direction: column;
    gap: 0.35rem;
  }

  .site-footer {
    flex-direction: column;
    text-align: center;
  }

  .cd-diagram {
    padding: 1.5rem 1rem;
    margin: 1.75rem auto;
  }

  .cd-diagram img {
    min-width: 0;
    max-width: 100%;
  }
}

/* ---------- Sub-Abas Interativas (Mobile-First) ---------- */

.tab-nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 13, 20, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 0;
  margin: -0.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
}

.tab-nav {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  color: var(--fg-secondary);
  border: 1px solid var(--border);
  padding: 0.55rem 1.15rem;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 500;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 42px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
  border-color: var(--border-hover);
}

.tab-btn.active {
  background: var(--purple-main);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
  font-weight: 600;
}

.tab-pane {
  display: none;
  animation: fadeInPane 0.25s ease forwards;
}

.tab-pane.active {
  display: block;
}

@keyframes fadeInPane {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Grid de Cards de Destaque / Resumo Executivo ---------- */

.highlight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

@media (min-width: 768px) {
  .highlight-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.highlight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.highlight-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.highlight-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-light);
  margin-bottom: 0.25rem;
}

.highlight-card h3 {
  font-size: 1.15rem;
  margin: 0;
  color: #ffffff;
}

.highlight-card p {
  font-size: 0.925rem;
  color: var(--fg-secondary);
  line-height: 1.55;
  margin: 0;
}

/* ---------- Cards de Download de PDF (Pôster e Slides) ---------- */

.download-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.download-card-grid > p {
  margin: 0;
  display: flex;
  width: 100%;
}

@media (min-width: 640px) {
  .download-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.download-card {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 3.5rem 1.25rem 1.35rem;
  text-decoration: none;
  color: #ffffff;
  transition: all 0.2s ease;
  min-height: 80px;
  width: 100%;
  box-sizing: border-box;
}

.download-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: none;
}

.download-card strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  order: 2;
  margin: 0.2rem 0;
}

.download-card .download-card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  order: 1;
}

.download-card .download-card-meta {
  font-size: 0.825rem;
  color: var(--fg-muted);
  order: 3;
}

.download-card .download-card-icon {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.6rem;
  color: var(--accent-light);
  transition: transform 0.2s ease;
}

.download-card:hover .download-card-icon {
  transform: translateY(-50%) translateX(3px);
}

/* ---------- Cards Expansíveis (<details>) para Demonstrações ---------- */

details.collapsible-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  margin: 1.25rem 0;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

details.collapsible-box:hover {
  border-color: var(--border-hover);
}

details.collapsible-box[open] {
  border-color: rgba(255, 255, 255, 0.2);
}

details.collapsible-box summary {
  padding: 0.9rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent-light);
  cursor: pointer;
  background: var(--bg-raised);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

details.collapsible-box summary::-webkit-details-marker {
  display: none;
}

details.collapsible-box summary::after {
  content: "＋";
  font-size: 1.15rem;
  color: var(--accent);
  transition: transform 0.2s ease;
}

details.collapsible-box[open] summary::after {
  content: "−";
  transform: rotate(180deg);
}

details.collapsible-box .collapsible-content {
  padding: 1.25rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

/* ---------- Tabela Comparativa de Complexidade ---------- */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  -webkit-overflow-scrolling: touch;
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
  text-align: left;
}

.styled-table th,
.styled-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.styled-table th {
  background: var(--bg-raised);
  color: var(--fg);
  font-weight: 600;
}

.styled-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Botões de Ação Rápida entre Abas */
.jump-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  color: var(--fg);
  border: 1px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.jump-tab-btn:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* ---------- Layout SIICUSP com Índice Lateral Reativo (TOC) ---------- */

.siicusp-layout {
  display: block;
  width: 100%;
}

.siicusp-content {
  min-width: 0;
  width: 100%;
}

.tab-toc-sidebar {
  display: none;
}

@media (min-width: 1080px) {
  body:has(#title-block-header) main {
    max-width: 1380px;
    padding: 2rem 2rem 3rem;
  }

  .siicusp-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 3.25rem;
    align-items: start;
  }

  .tab-toc-sidebar {
    display: block;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 0.25rem 0 1rem 1.25rem;
    border-left: 1px solid var(--border);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }

  .tab-toc-sidebar::-webkit-scrollbar {
    width: 4px;
  }

  .tab-toc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }

  .tab-toc-sticky {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .tab-toc-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
  }

  .tab-toc-title {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fg-muted);
  }

  .tab-toc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .tab-toc-nav .toc-item {
    margin: 0;
    padding: 0;
  }

  .tab-toc-nav .toc-level-3 {
    padding-left: 0.85rem;
  }

  .tab-toc-nav .toc-link {
    display: block;
    padding: 0.35rem 0.65rem;
    font-size: 0.825rem;
    line-height: 1.45;
    color: var(--fg-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  .tab-toc-nav .toc-level-3 .toc-link {
    font-size: 0.775rem;
    color: var(--fg-muted);
    line-height: 1.4;
  }

  .tab-toc-nav .toc-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(255, 255, 255, 0.3);
  }

  .tab-toc-nav .toc-link.active {
    color: var(--accent-light);
    font-weight: 600;
    border-left-color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
  }
}

  .tab-toc-nav .toc-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
    border-left-color: rgba(255, 255, 255, 0.3);
  }

  .tab-toc-nav .toc-link.active {
    color: var(--accent-light);
    font-weight: 600;
    border-left-color: var(--accent);
    background: rgba(168, 85, 247, 0.1);
  }
}

