:root {
  --blue: #20255b;
  --gray: #8e989a;
  --soft-gray: #bfc3c4;
  --ink: #18203d;
  --muted: #626b78;
  --line: #e2e5e6;
  --wash: #fafafa;
  --paper: #ffffff;
  --header-h: 96px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.menu-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  display: grid;
  grid-template-columns: 190px 1fr auto;
  align-items: center;
  gap: 34px;
  min-height: var(--header-h);
  padding: 18px clamp(28px, 5vw, 64px);
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(191, 195, 196, 0.38);
  box-shadow: 0 12px 36px rgba(32, 37, 91, 0.035);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: 190px;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 3.2vw, 48px);
  color: #111933;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.main-nav a {
  position: relative;
  padding: 14px 0;
}

.main-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--blue);
  content: "";
  opacity: 0;
  transform: scaleX(0.42);
  transition: opacity 160ms ease, transform 160ms ease;
}

.main-nav a:is(.active, :hover)::after {
  opacity: 1;
  transform: scaleX(1);
}

.button,
.document-button,
.primary-button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--blue);
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.button:hover,
.document-button:hover,
.primary-button:hover,
.download-button:hover {
  background: #151a4c;
  transform: translateY(-1px);
}

.button.secondary,
.download-button {
  background: #fff;
  color: var(--blue);
}

.button.secondary:hover,
.download-button:hover {
  background: var(--blue);
  color: #fff;
}

.button svg,
.document-button svg,
.primary-button svg,
.download-button svg {
  width: 19px;
  height: 19px;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.section-band,
.content-section,
.site-footer {
  padding-right: clamp(28px, 5vw, 64px);
  padding-left: clamp(28px, 5vw, 64px);
}

.hero,
.page-hero {
  padding-top: calc(var(--header-h) + 28px);
  background: linear-gradient(180deg, #fff 0%, #fff 78%, #fafafa 100%);
}

.hero {
  min-height: 0;
  padding-bottom: 32px;
}

.hero-content,
.page-hero-inner {
  max-width: 620px;
}

.hero-content {
  max-width: none;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  color: var(--blue);
  font-size: clamp(30px, 3.1vw, 42px);
  font-weight: 420;
  letter-spacing: 0;
  line-height: 1.1;
}

.hero em,
.page-hero em {
  font-style: italic;
  font-weight: inherit;
}

.hero h1 strong {
  font-weight: 720;
}

.rule,
.mini-rule {
  display: block;
  width: 72px;
  height: 3px;
  margin: 28px 0 24px;
  background: var(--gray);
}

.hero p,
.page-hero p {
  max-width: 540px;
  margin: 0 0 30px;
  color: #344056;
  font-size: 18px;
  font-weight: 360;
}

.hero-intro-row {
  display: grid;
  grid-template-columns: minmax(0, 540px) auto;
  align-items: start;
  justify-content: space-between;
  gap: 36px;
}

.hero-intro-row p {
  margin-bottom: 0;
}

.hero-intro-row .primary-button {
  justify-self: end;
}

.home-performance {
  max-width: 1540px;
  margin: 0 auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.home-performance-section {
  padding-top: 32px;
  padding-bottom: 34px;
}

.performance-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

/* "Retornos", "Fundos", "Cartas" e "Documentos" usam o MESMO rótulo (eyebrow):
   mesma fonte, tamanho e cor (azul). Tamanho maior que os eyebrows de página. */
.section-heading .eyebrow,
.performance-heading .eyebrow {
  font-size: 16px;
}

.performance-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.performance-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

.performance-table th,
.performance-table td {
  padding: 12px 9px;
  border-bottom: 1px solid #d9dddd;
  color: #6a6d70;
  font-size: 12px;
  font-weight: 680;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}

.performance-table th {
  color: var(--blue);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Separador entre os benchmarks do fundo e os benchmarks gerais (CDI/SMLL/Dólar). */
.performance-table tr.has-separator td {
  border-top: 2px solid var(--soft-gray);
}

.performance-table th:first-child,
.performance-table td:first-child {
  width: 210px;
  padding-left: 0;
  text-align: center;
}

.performance-table tr.is-fund td:first-child,
.performance-table tr.is-summary td:first-child {
  color: #65696d;
  font-size: 13px;
  font-weight: 780;
  text-transform: uppercase;
}

.performance-table tr.is-benchmark td {
  font-style: italic;
  font-weight: 620;
}

.performance-table tr.is-summary td {
  font-weight: 760;
}

.performance-table td:empty::after {
  content: "";
}

.performance-footnote {
  margin: 18px 0 0;
  color: #6a6d70;
  font-size: 12px;
  font-style: italic;
  font-weight: 620;
  text-transform: uppercase;
}

.page-hero {
  min-height: 0;
  padding-top: calc(var(--header-h) + 28px);
  padding-bottom: 22px;
}

.page-hero h1 {
  font-size: clamp(26px, 2.8vw, 36px);
}

.content-section {
  padding-top: 40px;
  padding-bottom: 52px;
}

.soft-section {
  background: #fafafa;
  border-top: 1px solid rgba(191, 195, 196, 0.26);
  border-bottom: 1px solid rgba(191, 195, 196, 0.26);
}

.section-heading {
  margin-bottom: 28px;
}

.split-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 760;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h2,
h3,
p {
  overflow-wrap: anywhere;
}

h2 {
  max-width: 680px;
  margin: 0;
  color: var(--blue);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 420;
  line-height: 1.18;
}

.section-copy {
  max-width: 640px;
  margin: 16px 0 0;
  color: #344056;
  font-size: 18px;
  font-weight: 360;
}

.text-link,
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 720;
  white-space: nowrap;
}

.text-link svg,
.card-link svg {
  width: 20px;
  height: 20px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.strategy-card {
  display: flex;
  min-height: 238px;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: border-color 160ms ease, transform 160ms ease;
}

.strategy-card:hover {
  border-color: var(--soft-gray);
  transform: translateY(-1px);
}

.strategy-card h3 {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 22px;
  font-weight: 620;
  line-height: 1.25;
}

.strategy-card p {
  margin: 0 0 28px;
  color: #344056;
  font-size: 15px;
}

.letters-list,
.documents-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.letter-row,
.document-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 28px;
  align-items: center;
  min-height: 108px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.letter-row time,
.document-row time {
  color: var(--muted);
  font-size: 14px;
}

.letter-row h3,
.document-row h3 {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 20px;
  font-weight: 560;
}

.letter-row p,
.document-row p {
  margin: 0;
  color: #4f5a65;
  font-size: 14px;
}

.documents-list {
  border-top: 0;
}

/* Placeholder de carregamento / lista vazia (cartas e documentos vêm da API). */
.list-message {
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
  font-size: 15px;
}

/* Cartas na home: 2 mais recentes em destaque + demais agrupadas por ano (dropdown). */
.letters-year > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 20px;
  font-weight: 560;
}

.letters-year > summary::-webkit-details-marker {
  display: none;
}

.letters-year > summary::after {
  content: "+";
  color: var(--gray);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

.letters-year[open] > summary::after {
  content: "\2212";
}

.letters-year > summary:hover {
  color: #151a4c;
}

/* Linhas de cartas na home: compactas (rótulo único) e alinhadas aos anos. */
.letters-list[data-recent] .letter-row {
  grid-template-columns: 1fr auto;
  gap: 20px;
  min-height: 0;
  padding: 16px 0;
}

/* "1º semestre de ANO" dentro do dropdown: fonte do período (cinza), um pouco
   maior que a original. */
.letters-list[data-recent] .letter-row h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}

.letters-list[data-recent] .letter-row .download-button {
  min-height: 40px;
  padding: 0 18px;
}

.document-row {
  grid-template-columns: 1fr 190px auto;
}

.funds-list {
  display: grid;
  gap: 22px;
}

.fund-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.fund-summary h2 {
  margin-bottom: 10px;
  font-size: 28px;
}

/* Nome do fundo clicável (leva à página do fundo). */
.fund-summary h2 a {
  transition: color 160ms ease;
}

.fund-summary h2 a:hover {
  color: #151a4c;
  text-decoration: underline;
}

.fund-summary p {
  max-width: 720px;
  margin: 0;
  color: #344056;
}

.table-block {
  margin-top: 24px;
}

.table-block + .table-block {
  margin-top: 44px;
}

.table-block h2 {
  margin-bottom: 20px;
  font-size: 30px;
}

body[data-fund-page] .page-hero h1 {
  font-size: clamp(28px, 3vw, 44px);
}

body[data-fund-page] .table-block h2 {
  font-size: 27px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 18px 18px 18px 0;
  border-bottom: 1px solid var(--line);
  color: #30394c;
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Características em DUAS colunas (a tabela de Características é a única com
   .info-table; a de Retorno é só .data-table). As linhas (tr) fluem em 2
   colunas via multicol no tbody; cada tr vira um par rótulo | valor. */
.info-table {
  display: block;
  min-width: 0;
}

.info-table tbody {
  display: block;
  column-count: 2;
  column-gap: 56px;
}

.info-table tr {
  display: grid;
  grid-template-columns: minmax(110px, 42%) 1fr;
  column-gap: 16px;
  align-items: baseline;
  break-inside: avoid;
  border-bottom: 1px solid var(--line);
}

.info-table th,
.info-table td {
  width: auto;
  padding: 13px 0;
  border: 0;
}

@media (max-width: 760px) {
  .info-table tbody {
    column-count: 1;
  }
}

.documents-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.distributors-block {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.distributors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
  margin-top: 18px;
}

.distributor-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-bottom: 1px solid rgba(32, 37, 91, 0.18);
  color: var(--blue);
  font-size: 12px;
  font-weight: 620;
  line-height: 1;
  transition: opacity 160ms ease, transform 160ms ease;
}

.distributor-link:hover {
  opacity: 0.78;
  transform: translateY(-1px);
}

/* Largura mínima uniforme: a legenda "Fale com seu assessor" cabe sem
   sobrepor o vizinho e os itens ficam igualmente separados. O logo é
   centralizado numa faixa de altura fixa (assim logos de tamanhos diferentes
   ficam alinhados na mesma linha média). */
/* Células de largura FIXA e igual, com o logo centralizado → os centros de
   todos os símbolos ficam igualmente espaçados (independe do tamanho do logo).
   A faixa de altura fixa centraliza verticalmente logos de tamanhos diferentes. */
.distributor-item {
  display: grid;
  width: 120px;
  gap: 6px;
  justify-items: center;
}

.distributor-logo-link {
  display: grid;
  width: 120px;
  min-height: 46px;
  align-items: center;
  justify-items: center;
  color: var(--blue);
  font-size: 12px;
  font-weight: 620;
  line-height: 1;
  transition: opacity 160ms ease, transform 160ms ease;
}

/* Distribuidores sem legenda (links diretos, ex.: Daycoval/Warren) mantêm a
   célula mais larga (140px) — os com legenda (XP/BTG/RB) ficam mais juntos. */
.distributors-grid > .distributor-logo-link {
  width: 140px;
}

/* Separa um pouco mais o grupo com legenda do primeiro wordmark que vem na
   sequência (FIF: RB→Daycoval, Global: RB→Warren, Institucional: Daycoval→Warren). */
.distributor-item + .distributor-logo-link {
  margin-left: 20px;
}

.distributor-logo-link:hover {
  transform: translateY(-1px);
}

.distributor-logo-img {
  display: block;
  width: auto;
  max-width: 112px;
  height: 28px;
  object-fit: contain;
  object-position: center;
  filter: grayscale(1);
  opacity: 0.78;
  transition: filter 160ms ease, opacity 160ms ease;
}

/* XP e BTG são marcas compactas (ícone) — maiores que os wordmarks p/ equilibrar. */
.distributor-logo-img[alt="XP Investimentos"],
.distributor-logo-img[alt="BTG Pactual"] {
  height: 40px;
}

/* Logo ganha cor ao passar o mouse (igual ao site atual). */
.distributor-logo-link:hover .distributor-logo-img {
  filter: grayscale(0);
  opacity: 1;
}

.distributor-logo-fallback {
  display: none;
  border-bottom: 1px solid rgba(32, 37, 91, 0.18);
}

.distributor-item p {
  margin: 0;
  color: var(--gray);
  font-size: 10px;
  font-weight: 520;
  line-height: 1.2;
  text-align: center;
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}

.contact-list {
  display: grid;
  gap: 22px;
  margin: 0;
  font-style: normal;
}

.contact-item {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.contact-item span {
  display: block;
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.contact-item a,
.contact-item p {
  margin: 7px 0 0;
  color: #30394c;
}

.contact-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  color: var(--blue);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  padding: 14px 16px;
  outline: 0;
  transition: border-color 160ms ease;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
}

.admin-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.admin-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.admin-card h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.admin-card p {
  color: #4f5a65;
}

.admin-card input {
  max-width: 100%;
  color: #344056;
}

.upload-output {
  min-height: 130px;
  margin-top: 16px;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fafafa;
  color: #30394c;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.site-footer {
  padding-top: 54px;
  padding-bottom: 42px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.footer-grid {
  display: grid;
  grid-template-columns: 184px 1fr auto;
  gap: 38px;
  align-items: end;
}

.footer-grid img {
  width: 174px;
}

.footer-institutional {
  display: flex;
  align-items: flex-end;
  gap: 34px;
  flex-wrap: wrap;
}

.footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.footer-certifications {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
}

.footer-certification-link {
  display: inline-flex;
  align-items: center;
}

.footer-certification-logo {
  width: auto !important;
  max-width: none;
  height: 42px;
  object-fit: contain;
  opacity: 0.54;
  filter: grayscale(1);
  transition: opacity 160ms ease;
}

.footer-certification-link:hover .footer-certification-logo {
  opacity: 0.72;
}

.footer-certification-logo.anbima-certification {
  height: 52px;
  opacity: 0.72;
  filter: none;
}

.footer-certification-logo.como-investir-certification {
  height: 48px;
  opacity: 1;
  filter: none;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  font-weight: 620;
}

/* Aviso legal / disclaimer de rentabilidade (rodapé, letra miúda). */
.footer-legal {
  max-width: 1100px;
  margin: 16px 0 0;
  color: var(--gray);
  font-size: 11px;
  line-height: 1.5;
}

.fade-in {
  animation: fadeIn 120ms ease both;
}

@keyframes fadeIn {
  from {
    opacity: 0.96;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 1120px) {
  .site-header {
    grid-template-columns: 170px 1fr auto;
    gap: 18px;
  }

  .brand {
    width: 170px;
  }

  .main-nav {
    gap: 18px;
    font-size: 13px;
  }

  .strategy-grid,
  .admin-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --header-h: 78px;
  }

  .site-header {
    grid-template-columns: 140px auto;
    min-height: var(--header-h);
  }

  .brand {
    width: 140px;
  }

  .menu-toggle {
    display: grid;
    justify-self: end;
    width: 42px;
    height: 42px;
    place-items: center;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
  }

  .main-nav,
  .document-button {
    display: none;
  }

  .site-header.menu-open .main-nav,
  .site-header.menu-open .document-button {
    display: flex;
    grid-column: 1 / -1;
  }

  .site-header.menu-open .main-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 8px;
  }

  .site-header.menu-open .main-nav a {
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }

  .site-header.menu-open .document-button {
    margin-top: 8px;
  }

  .hero,
  .page-hero {
    min-height: auto;
    padding-top: calc(var(--header-h) + 37px);
    padding-bottom: 46px;
  }

  .home-performance {
    margin-top: 0;
  }

  .home-performance-section {
    padding-top: 36px;
    padding-bottom: 28px;
  }

  .performance-heading {
    display: grid;
    align-items: start;
    margin-bottom: 18px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 42px;
  }

  body[data-fund-page] .page-hero h1 {
    font-size: 38px;
  }

  .split-heading,
  .fund-summary,
  .contact-layout,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-institutional {
    align-items: flex-start;
    gap: 20px;
  }

  .footer-certifications {
    gap: 22px;
  }

  .split-heading {
    display: grid;
    align-items: start;
  }

  .hero-intro-row {
    grid-template-columns: 1fr;
    justify-content: start;
    gap: 24px;
  }

  .hero-intro-row .primary-button {
    justify-self: start;
  }

  .strategy-grid,
  .admin-panel {
    grid-template-columns: 1fr;
  }

  .letter-row,
  .document-row {
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
  }

  .fund-summary {
    display: grid;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

@media (max-width: 520px) {
  .section-band,
  .content-section,
  .site-footer,
  .site-header {
    padding-right: 22px;
    padding-left: 22px;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 38px;
  }

  body[data-fund-page] .page-hero h1 {
    font-size: 34px;
  }

  .hero p,
  .page-hero p,
  .section-copy {
    font-size: 16px;
  }

  .button,
  .primary-button,
  .document-button {
    width: 100%;
  }
}
