:root {
  --bg-body: #edf4f1;
  --bg-container: #ffffff;
  --text-main: #1c2d2a;
  --text-muted: #536762;
  --primary: #0b766b;
  --primary-hover: #095f56;
  --border: #d8e5e1;
  --switch-focus: #6345ed;
  --switch-bg: #a5a4a4;
  --switch-sun: #ffd233;
  --switch-circle: #313131;
  --card-bg: #ffffff;
  --card-border: #dce8e4;
  --sidebar-bg: #e8eeec;
  --sidebar-text: #263632;
  --sidebar-muted: #667772;
  --sidebar-border: #d2ddda;
  --sidebar-hover: #dce5e2;
  /* Superfícies e raios compartilhados (cartões, painéis, laboratórios).
     Derivam de --primary/--card-bg, então acompanham tema e paleta. */
  --tint: color-mix(in srgb, var(--primary) 9%, var(--card-bg));
  --tint-strong: color-mix(in srgb, var(--primary) 16%, var(--card-bg));
  --tint-gain: color-mix(in srgb, var(--primary) 45%, var(--card-bg));
  --warm: #b4472f;
  --radius-card: 14px;
  --shadow-card: 0 2px 8px rgb(16 36 32 / 4%);
  --shadow-card-hover: 0 10px 26px rgb(16 36 32 / 9%);
}

[data-theme="dark"] {
  --bg-body: #000000;
  --bg-container: #000000;
  --text-main: #ffffff;
  --text-muted: #a1a6af;
  --primary: #6345ed;
  --primary-hover: #7b61ff;
  --border: #30363d;
  --switch-bg: #30363d;
  --switch-circle: #000000;
  --card-bg: #000000;
  --card-border: #30363d;
  --sidebar-bg: #000000;
  --sidebar-text: #e5e9f0;
  --sidebar-muted: #9ba5b4;
  --sidebar-border: #2a3240;
  --sidebar-hover: #111111;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background-color: var(--text-muted);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary);
}

html,
body {
  overflow-x: clip;
}

html {
  scroll-padding-top: 5.5rem;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1100px;
  background: var(--bg-container);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: clip;
}

/* HEADER */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem 3rem;
  border-radius: 19px 19px 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-container);
  box-shadow: 0 4px 14px rgba(25, 31, 40, 0.06) !important;
}

.logo {
  display: flex;
  flex-direction: column;
  justify-self: start;
}

.logo {
  color: inherit;
  text-decoration: none;
}

.logo:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--primary);
  outline-offset: 5px;
}

.logo-top {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-bottom {
  font-size: 0.75rem;
  letter-spacing: 4px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-width: 0;
}

.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

.site-header nav a {
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
}

.site-header nav a:hover,
.site-header nav a.active {
  color: var(--primary);
}

main a:not(.cta-button):not(.error-btn):not(.source-link):not( .subscription-secondary-button ) {
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
  transition: color 180ms ease, text-decoration-color 180ms ease;
}

.nav-search {
  position: relative;
  flex: 0 1 240px;
}

.nav-search input {
  width: 200px;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-container);
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
}

.nav-search input:focus {
  width: 280px;
  border-color: var(--primary);
}

.nav-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* THEME */

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  justify-self: end;
}

.eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cta-button {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--primary);
  color: var(--bg-body);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  border: unset;
}

.cta-button:hover {
  background: var(--primary-hover);
}

/* Carry the selected accent color through section and content titles. */

main h1,
main h2,
main h3,
main h4 {
  color: var(--primary);
}

.daniel {
  font-size: 0.8rem;
  color: var(--primary) !important;
}

.about h2 {
  font-family: "Playfair Display", serif;
  font-size: 2rem;
  margin: 0.5rem 0 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* FOOTER */

.site-footer {
  padding: 2rem 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-container);
}

@media (max-width: 992px) {
  /* TABLET */

  body {
    padding: 1rem;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.25rem;
    padding: 1.5rem 2rem;
    text-align: left;
  }

  .logo {
    justify-self: start;
  }

  .theme-toggle {
    justify-self: end;
    margin-top: 0;
  }

  .site-header > nav {
    grid-column: 1 / -1;
    width: 100%;
    flex-direction: row;
  }

  .site-header nav ul {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  .nav-search {
    flex: 1 1 240px;
    max-width: 420px;
  }

  .nav-search input,
  .nav-search input:focus {
    width: 100%;
  }
}

@media (max-width: 768px) {
  /* MOBILE */

  body {
    padding: 0.5rem;
  }

  .container {
    border-radius: 14px;
  }

  .site-header {
    padding: 1.25rem 1rem;
  }

  .logo-top {
    font-size: 1.65rem;
  }

  .logo-bottom {
    font-size: 0.68rem;
    letter-spacing: 3px;
  }

  .site-header nav ul {
    width: fit-content;
    max-width: 100%;
    gap: 0.5rem 1rem;
  }

  .site-header nav a {
    font-size: 0.85rem;
  }

  .nav-search {
    width: min(100%, 420px);
    flex: none;
  }

  .cta-button {
    width: 100%;
    text-align: center;
  }

  .site-footer {
    padding: 1.5rem 1.25rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
  }

  .container {
    min-height: 100vh;
    border-radius: 14px;
    border-left: 0;
    border-right: 0;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    border-radius: 13px 13px 0 0;
    padding: 1rem 0.85rem;
    gap: 0.75rem;
  }

  .logo-top {
    font-size: 1.45rem;
  }

  .theme-toggle {
    gap: 0.5rem;
  }

  .site-header > nav {
    gap: 0.75rem;
  }

  .site-header nav ul {
    gap: 0.25rem 0.8rem;
  }

  .site-header nav a {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  .logo-top {
    font-size: 1.3rem;
  }

  .site-header nav a {
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 992px) {
  /* HEADER MOBILE — duas linhas: logo/tema em cima, opções abaixo */

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo theme" "nav nav";
    align-items: center;
    text-align: left;
  }

  .site-header .logo {
    grid-area: logo;
    justify-self: start;
  }

  .site-header .theme-toggle {
    grid-area: theme;
    justify-self: end;
    margin-top: 0;
  }

  .site-header > nav {
    grid-area: nav;
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1rem;
  }

  .site-header > nav ul {
    width: fit-content;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }
}

@media (max-width: 768px) {
  .site-header > nav {
    flex-direction: column;
    gap: 0.9rem;
  }

  .site-header > nav ul {
    width: fit-content;
    gap: 0.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo theme" "nav nav";
    gap: 0.75rem;
  }

  .site-header > nav ul {
    width: fit-content;
    gap: 0.25rem 0.8rem;
  }
}

/* DATA LOADING */

.data-loading {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
}

@keyframes data-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.subscription-status-actions .cta-button,
.subscription-secondary-button {
  width: 100%;
  text-align: center;
}

/* SIDEBAR DE NAVEGAÇÃO */

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  justify-self: end;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-container);
  color: var(--text-main);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.sidebar-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.site-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 500ms cubic-bezier(.4, 0, .2, 1), visibility 500ms cubic-bezier(.4, 0, .2, 1);
}

.site-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1000;
  width: min(340px, 88vw);
  padding: 1.25rem;
  overflow-y: auto;
  background: var(--bg-container);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.12);
  transform: translateX(-102%);
  transition: transform 500ms cubic-bezier(.4, 0, .2, 1);
}

.site-sidebar.is-open {
  transform: translateX(0);
}

/* Fechado no modo gaveta: sem sombra vazando na borda e fora da ordem de foco. */
@media (max-width: 1099px) {
  .site-sidebar:not(.is-open) {
    box-shadow: none;
    visibility: hidden;
    transition: transform 500ms cubic-bezier(.4, 0, .2, 1), visibility 0s linear 500ms;
  }
}

.site-sidebar-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.site-sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0.2rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.site-sidebar-header .eyebrow {
  margin-bottom: 0.25rem;
}

.site-sidebar-header strong {
  font-family: "Playfair Display", serif;
  font-size: 1.25rem;
}

.site-sidebar-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-container);
  color: var(--text-main);
  cursor: pointer;
}

.site-sidebar-close:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.site-sidebar-nav {
  padding: 0.75rem 0 1rem;
}

.site-sidebar-group {
  display: grid;
  gap: 0.2rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

.site-sidebar-group:last-child {
  border-bottom: 0;
}

.site-sidebar-label {
  margin: 0.5rem 0 0.45rem 0.7rem;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.7rem;
  border-radius: 8px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.site-sidebar-nav a i {
  width: 18px;
  color: var(--text-muted);
  text-align: center;
}

.site-sidebar-nav a:hover,
.site-sidebar-nav a:focus-visible {
  background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
  color: var(--primary);
  outline: none;
}

body.sidebar-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .site-sidebar,
  .site-sidebar-backdrop {
    transition: none !important;
  }
}

/* HEADER — controles integrados */

.site-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
}

.header-main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  min-width: 0;
}

.site-header .header-main-nav .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-container);
}

.site-header .header-main-nav .theme-toggle:hover {
  border-color: var(--primary);
}

.site-header .sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-container);
  color: var(--text-main);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.site-header .sidebar-toggle:hover,
.site-header .sidebar-toggle:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--bg-container));
  outline: none;
}

@media (max-width: 992px) {
  .site-header .header-main-nav {
    display: flex;
  }
}

@media (max-width: 480px) {
  .site-header {
    gap: 0.55rem;
  }

  .site-header .header-main-nav {
    gap: 0.4rem;
  }

  .site-header .sidebar-toggle {
    min-height: 38px;
    padding: 0.5rem 0.65rem;
  }

  .site-header .header-main-nav .theme-toggle {
    min-height: 38px;
    padding: 0.3rem 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hamburger-icon span,
  .site-header .sidebar-toggle {
    transition: none;
  }
}

/* HEADER — navegação unificada */

.site-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
}

.header-main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.15rem;
  min-width: 0;
}

.header-primary-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.header-primary-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: color 180ms ease, background-color 180ms ease;
}

.header-primary-links a:hover,
.header-primary-links a:focus-visible,
.header-primary-links a.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
  outline: none;
}

.header-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--border);
}

.header-theme-toggle {
  flex: 0 0 auto;
}

.site-header .header-main-nav .header-theme-toggle,
.site-header .header-main-nav .header-theme-toggle:hover,
.site-header .header-main-nav .header-theme-toggle:focus,
.site-header .header-main-nav .header-theme-toggle:focus-visible,
.site-header .header-main-nav .header-theme-toggle:active {
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
}

.site-header .header-main-nav .header-theme-toggle:hover,
.site-header .header-main-nav .header-theme-toggle:focus,
.site-header .header-main-nav .header-theme-toggle:focus-visible,
.site-header .header-main-nav .header-theme-toggle:active {
  color: var(--text-main);
}

.site-header .sidebar-toggle,
.site-header .theme-toggle {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.site-header .sidebar-toggle:hover,
.site-header .sidebar-toggle:focus-visible,
.site-header .theme-toggle:hover,
.site-header .theme-toggle:focus-visible {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
  outline: none;
}

.hamburger-icon {
  width: 17px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.site-header .sidebar-toggle:hover .hamburger-icon span:first-child {
  transform: translateX(2px);
}

.site-header .sidebar-toggle:hover .hamburger-icon span:last-child {
  transform: translateX(-2px);
}

.site-header .theme-toggle i {
  font-size: 0.95rem;
}

@media (max-width: 992px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-main-nav {
    gap: 0.65rem;
  }

  .header-primary-links a {
    min-height: 36px;
    padding-inline: 0.55rem;
  }
}

@media (max-width: 680px) {
  .header-primary-links {
    display: none;
  }

  .header-main-nav {
    gap: 0.2rem;
  }

  .header-nav-actions {
    padding-left: 0.2rem;
    border-left: 0;
  }

  .site-header .sidebar-toggle,
  .site-header .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-primary-links a,
  .site-header .sidebar-toggle,
  .site-header .theme-toggle,
  .hamburger-icon span {
    transition: none;
  }
}

/* TEMA DENTRO DO MENU DE NAVEGAÇÃO */

.site-sidebar-preferences {
  margin-top: auto;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
}

.site-sidebar-preferences .site-sidebar-label {
  display: block;
  margin-bottom: 0.45rem;
}

.sidebar-theme-toggle {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.7rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.sidebar-theme-toggle i {
  width: 18px;
  color: var(--text-muted);
  text-align: center;
}

.sidebar-theme-toggle:hover,
.sidebar-theme-toggle:focus-visible {
  background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
  color: var(--primary);
  outline: none;
}

.sidebar-theme-toggle:hover i,
.sidebar-theme-toggle:focus-visible i {
  color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-theme-toggle {
    transition: none;
  }
}

/* SWITCH DE TEMA ANIMADO NO MENU */

.sidebar-theme-toggle {
  justify-content: flex-start;
  gap: 0.75rem;
}

.theme-switch-track {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--switch-bg);
  box-sizing: border-box;
  transition: background-color 500ms ease;
}

.theme-switch-track::before {
  position: absolute;
  content: "";
  left: 4px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--switch-circle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1), background-color 500ms ease;
}

.theme-switch-track i {
  position: relative;
  z-index: 1;
  width: 22px;
  margin-left: 0;
  color: var(--switch-sun);
  font-size: 0.68rem;
  line-height: 22px;
  text-align: center;
  transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms ease;
}

.sidebar-theme-toggle[aria-pressed="true"] .theme-switch-track::before {
  transform: translateX(22px);
}

.sidebar-theme-toggle[aria-pressed="true"] .theme-switch-track i {
  transform: translateX(22px) rotate(180deg);
  color: #00bfff;
}

.sidebar-theme-toggle:hover .theme-switch-track,
.sidebar-theme-toggle:focus-visible .theme-switch-track {
  background: color-mix(in srgb, var(--switch-bg) 88%, var(--primary));
}

.sidebar-theme-toggle:focus-visible {
  outline: 3px solid var(--switch-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .theme-switch-track,
  .theme-switch-track::before,
  .theme-switch-track i {
    transition-duration: 0.01ms;
  }
}

.sidebar-theme-toggle[aria-pressed="false"] .theme-switch-track i,
.header-theme-toggle[aria-pressed="false"] #header-theme-icon {
  color: #2685d8;
}

.sidebar-theme-toggle[aria-pressed="true"] .theme-switch-track i,
.header-theme-toggle[aria-pressed="true"] #header-theme-icon {
  color: #ffd43b;
}

.site-sidebar-nav a.active,
.site-sidebar-nav a[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 7%, var(--card-bg));
  color: var(--primary);
}

.site-sidebar-nav a.active i,
.site-sidebar-nav a[aria-current="page"] i {
  color: var(--primary);
}

@media (min-width: 821px) {
  .site-header .header-nav-actions {
    display: none;
  }
}

@media (max-width: 820px) {
  .header-theme-toggle {
    display: none !important;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "logo nav";
    align-items: center;
  }

  .header-primary-links {
    display: none;
  }

  .site-header > .header-main-nav {
    grid-area: nav;
    grid-column: auto;
    width: auto;
    flex-direction: row;
    justify-content: flex-end;
    gap: 0;
  }

  .site-header .header-nav-actions {
    display: flex;
    padding-left: 0;
    border-left: 0;
  }
}

/* Em telas largas, a navegação permanece aberta na lateral. */

.header-primary-links {
  display: none;
}

@media (min-width: 1100px) {
  body {
    padding-left: calc(250px + 3rem);
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .site-header .header-main-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .header-primary-links {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }

  .site-header .header-theme-toggle {
    display: none;
  }

  .site-sidebar {
    inset: 2rem auto 2rem 1rem;
    width: 250px;
    transform: none;
    border: 1px solid var(--border);
    border-radius: 16px;
  }

  .site-sidebar-close,
  .site-sidebar-backdrop {
    display: none;
  }

  .site-header .header-nav-actions {
    display: none;
  }
}

@media (max-width: 1099px) {
  .header-primary-links {
    display: none;
  }

  .site-header .header-nav-actions {
    display: flex;
  }
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--border));
  border-radius: 50%;
  background: var(--primary);
  color: var(--bg-body);
  box-shadow: 0 6px 20px rgb(20 35 32 / 22%);
  cursor: pointer;
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px) scale(0.86);
  transition: opacity 180ms ease, transform 220ms ease, visibility 0s linear 220ms, background-color 180ms ease;
}

.back-to-top.is-visible {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.back-to-top:hover {
  background: color-mix(in srgb, var(--primary) 82%, #000);
  transform: translateY(-3px) scale(1.04);
}

.back-to-top:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 42%, transparent);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .back-to-top {
    right: 1rem;
    bottom: 1rem;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
  }

  main a,
  .footer-links a {
    transition: none;
  }
}

/* Barra global: marca à esquerda e menu alinhado à direita em telas compactas. */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-main-nav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.site-header .header-nav-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  padding-left: 0;
  border-left: 0;
}

.site-header .sidebar-toggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
}

.site-header .sidebar-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 35%, transparent);
  outline-offset: 2px;
}

@media (min-width: 1100px) {
  .site-header .header-primary-links,
  .site-header .header-nav-actions {
    display: none;
  }

  .site-header .header-main-nav {
    flex: 0 0 auto;
  }
}

@media (max-width: 1099px) {
  .site-header .header-primary-links {
    display: none;
  }
}

@media (max-width: 540px) {
  .site-header {
    gap: 0.75rem;
    padding: 1rem 1.1rem;
  }

  .site-header .logo-top {
    font-size: 1.55rem;
  }

  .site-header .logo-bottom {
    font-size: 0.65rem;
    letter-spacing: 0.28rem;
  }
}

@media (min-width: 1100px) {
  /* Navegação lateral fixa inspirada na estrutura da documentação discord.js. */

  body {
    display: block;
    min-height: 100vh;
    padding: 0 0 0 280px;
  }

  body.sidebar-collapsed {
    padding-left: 280px;
  }

  body > .container {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .site-header {
    border-radius: 0;
    border-bottom-color: var(--sidebar-border);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    box-shadow: none;
  }

  .site-header .logo-bottom {
    color: var(--sidebar-muted);
  }

  .site-header .sidebar-toggle {
    display: none;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .site-header .header-main-nav {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
  }

  .site-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1000;
    width: 280px;
    height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transform: translateX(0);
    border: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: 6px 0 24px rgb(16 24 40 / 8%);
    background: var(--bg-body);
    color: var(--sidebar-text);
    scrollbar-width: none;
  }

  .site-sidebar::-webkit-scrollbar {
    display: none;
  }

  .site-sidebar-header {
    border-bottom-color: var(--sidebar-border);
  }

  .site-sidebar-preferences {
    display: none;
  }

  .sidebar-top-preferences {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .site-sidebar-group,
  .site-sidebar-preferences {
    border-color: var(--sidebar-border);
  }

  .site-sidebar-label,
  .site-sidebar-nav a i,
  .sidebar-theme-toggle i {
    color: var(--sidebar-muted);
  }

  .site-sidebar-nav a,
  .sidebar-theme-toggle {
    color: var(--sidebar-text);
  }

  .site-sidebar-nav a:hover,
  .site-sidebar-nav a:focus-visible,
  .site-sidebar-nav a.active,
  .site-sidebar-nav a[aria-current="page"],
  .sidebar-theme-toggle:hover,
  .sidebar-theme-toggle:focus-visible {
    background: var(--sidebar-hover);
    color: var(--sidebar-text);
  }

  .site-sidebar-nav a.active,
  .site-sidebar-nav a[aria-current="page"] {
    box-shadow: inset 3px 0 var(--primary);
  }

  .site-sidebar-nav a.active i,
  .site-sidebar-nav a[aria-current="page"] i {
    color: var(--primary);
  }

  .site-sidebar.is-open {
    transform: translateX(0);
  }

  .site-sidebar-close {
    display: none;
  }

  .site-sidebar-backdrop {
    display: none;
  }

  .site-header .header-primary-links {
    display: none;
  }

  .site-header .header-nav-actions {
    display: flex;
    padding-left: 0;
    border-left: 0;
  }

  .site-header #theme-toggle.header-theme-toggle {
    display: inline-flex;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 0.4rem 0.6rem;
    color: var(--sidebar-text);
  }

  .site-header #theme-toggle.header-theme-toggle:hover,
  .site-header #theme-toggle.header-theme-toggle:focus-visible {
    color: var(--sidebar-text);
    background: var(--sidebar-hover);
  }

  .site-header .header-main-nav {
    flex: 0 0 auto;
    width: auto;
  }
}

.site-header .sidebar-toggle[aria-expanded="true"] .hamburger-icon span:first-child {
  transform: translateY(6px) rotate(45deg);
}

.site-header .sidebar-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
  opacity: 0;
}

.site-header .sidebar-toggle[aria-expanded="true"] .hamburger-icon span:last-child {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 1099px) {
  .site-sidebar .sidebar-top-preferences {
    display: block;
    margin: 0.65rem 0 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
  }

  .site-sidebar .sidebar-top-preferences > .site-sidebar-label {
    display: block;
    margin: 0 0 0.35rem 0.7rem;
  }

  .site-sidebar .sidebar-top-preferences > #theme-toggle {
    margin: 0;
  }
}

.nav-search[hidden] {
  display: none !important;
}

/* AVISOS DE ATUALIZAÇÃO — painel lateral compacto */

.site-update-panel {
  position: fixed;
  z-index: 1102;
  top: 50%;
  left: calc(50% + 140px);
  right: auto;
  transform: translate(-50%, -50%);
  width: min(360px, calc(100vw - 2rem));
  height: auto;
  max-height: min(68vh, 520px);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
  border: 1px solid var(--border);
  border-right: 3px solid var(--primary);
  border-radius: 12px;
  background: var(--bg-container);
  color: var(--text-main);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.2);
  animation: site-update-panel-in 0.22s ease-out;
}

.site-update-panel-header,
.site-update-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-update-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.site-update-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 12%, var(--card-bg));
  color: var(--primary);
}

.site-update-brand-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.site-update-brand-copy strong {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
}

.site-update-brand-copy small {
  color: var(--text-muted);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.site-update-panel .site-update-panel-header {
  position: sticky;
  top: -1rem;
  z-index: 2;
  flex: 0 0 auto;
  margin: -1rem -1rem 0.1rem;
  padding: 0.85rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-container);
}

.site-update-panel .site-update-markdown {
  flex: 0 1 auto;
}

.site-update-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.site-update-eyebrow {
  display: block;
  color: var(--primary);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.site-update-panel h2 {
  margin: -0.35rem 0 0;
  font: 700 1.2rem/1.25 "Playfair Display", serif;
  overflow-wrap: anywhere;
}

.site-update-markdown {
  min-height: 0;
  overflow-wrap: anywhere;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.site-update-markdown > :first-child {
  margin-top: 0;
}

.site-update-markdown > :last-child {
  margin-bottom: 0;
}

.site-update-markdown p {
  margin: 0.45rem 0;
}

.site-update-markdown h3,
.site-update-markdown h4,
.site-update-markdown h5,
.site-update-markdown h6 {
  margin: 0.7rem 0 0.35rem;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.35;
}

.site-update-markdown strong {
  color: var(--text-main);
}

.site-update-markdown ul,
.site-update-markdown ol {
  display: grid;
  gap: 0.3rem;
  margin: 0.45rem 0;
  padding-left: 1.2rem;
}

.site-update-markdown li::marker {
  color: var(--primary);
}

.site-update-markdown a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-update-markdown blockquote {
  margin: 0.5rem 0;
  padding: 0.25rem 0.7rem;
  border-left: 2px solid var(--primary);
  color: var(--text-muted);
}

.site-update-markdown pre {
  max-width: 100%;
  overflow: auto;
  padding: 0.6rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-bg);
  font-size: 0.72rem;
}

.site-update-markdown code {
  padding: 0.08rem 0.25rem;
  border-radius: 4px;
  background: var(--card-bg);
  font-size: 0.92em;
}

.site-update-markdown pre code {
  padding: 0;
  background: transparent;
}

.site-update-markdown hr {
  border: 0;
  border-top: 1px solid var(--border);
}

@keyframes site-update-panel-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 1099px) {
  .site-update-panel {
    left: 50%;
  }
}

@media (min-width: 1100px) {
  .site-update-panel {
    width: min(860px, calc(100vw - 400px));
    max-height: min(82vh, 900px);
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 18px;
  }

  .site-update-panel .site-update-panel-header {
    top: -1.5rem;
    margin: -1.5rem -1.5rem 0.2rem;
    padding: 1.2rem 1.5rem 1rem;
  }

  .site-update-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    font-size: 1.2rem;
  }

  .site-update-brand-copy strong {
    font-size: 0.82rem;
  }

  .site-update-brand-copy small {
    font-size: 0.68rem;
  }

  .site-update-close {
    width: 40px;
    height: 40px;
    font-size: 1.6rem;
  }

  .site-update-eyebrow {
    font-size: 0.75rem;
  }

  .site-update-panel h2 {
    margin-top: -0.25rem;
    font-size: clamp(1.7rem, 2.2vw, 2.3rem);
    line-height: 1.2;
  }

  .site-update-markdown {
    font-size: 1.05rem;
    line-height: 1.8;
  }

  .site-update-markdown h3,
  .site-update-markdown h4,
  .site-update-markdown h5,
  .site-update-markdown h6 {
    font-size: 1.2rem;
  }

  .site-update-markdown ul,
  .site-update-markdown ol {
    gap: 0.55rem;
  }
}

@media (min-width: 1700px) {
  .site-update-panel {
    width: min(1000px, calc(100vw - 520px));
    padding: 1.8rem;
    gap: 1.5rem;
  }

  .site-update-panel .site-update-panel-header {
    top: -1.8rem;
    margin: -1.8rem -1.8rem 0.25rem;
    padding: 1.4rem 1.8rem 1.15rem;
  }

  .site-update-markdown {
    font-size: 1.12rem;
  }
}

@media (max-width: 600px) {
  .site-update-panel {
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: calc(100vw - 1.3rem);
    max-height: min(64dvh, 440px);
    padding: 0.85rem;
    gap: 0.6rem;
    border-radius: 12px;
  }

  .site-update-panel .site-update-panel-header {
    top: -0.85rem;
    margin: -0.85rem -0.85rem 0.1rem;
    padding: 0.75rem 0.85rem 0.6rem;
  }

  .site-update-brand-copy strong {
    font-size: 0.65rem;
  }

  .site-update-panel h2 {
    font-size: 1.08rem;
  }

  .site-update-markdown {
    font-size: 0.8rem;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-update-panel {
    animation: none;
  }
}

/* Seletor compacto de aparência */

.site-palette-picker {
  width: 100%;
  min-width: 0;
  margin-top: 0.55rem;
}

.site-sidebar .site-palette-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  margin: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--sidebar-border);
  border-radius: 10px;
  background: var(--bg-container);
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.25;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.site-sidebar .site-palette-toggle:hover {
  border-color: var(--primary);
  background: var(--sidebar-hover);
}

.site-sidebar .site-palette-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-palette-toggle-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--primary) 13%, var(--bg-container));
  color: var(--primary);
  font-size: 1rem;
}

.site-palette-current {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 0.18rem;
}

.site-palette-current strong {
  display: block;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
}

.site-palette-current small {
  display: block;
  margin: 0;
  overflow: hidden;
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-palette-current-swatch,
.site-palette-swatch {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px #00000020;
}

.site-palette-chevron {
  flex: 0 0 auto;
  color: var(--sidebar-muted);
  font-size: 0.72rem;
  transition: transform 180ms ease;
}

.site-palette-toggle[aria-expanded="true"] .site-palette-chevron {
  transform: rotate(180deg);
}

.site-palette-options[hidden] {
  display: none !important;
}

.site-palette-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.4rem;
  margin-top: 0.55rem;
}

.site-sidebar .site-palette-option {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  min-height: 36px;
  margin: 0;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  background: var(--bg-container);
  color: var(--sidebar-text);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.site-sidebar .site-palette-option:hover {
  border-color: var(--primary);
  background: var(--sidebar-hover);
}

.site-sidebar .site-palette-option:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-sidebar .site-palette-option[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--sidebar-hover);
  font-weight: 700;
}

.site-palette-option > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-palette-option > .fa-check {
  display: none;
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 0.68rem;
}

.site-palette-option[aria-pressed="true"] > .fa-check {
  display: inline-block;
}

:root[data-palette="green"] {
  --primary: #064e46;
  --primary-hover: #0b766b;
  --switch-focus: #064e46;
}

:root[data-palette="blue"] {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --switch-focus: #2563eb;
}

:root[data-palette="purple"] {
  --primary: #7c3aed;
  --primary-hover: #6d28d9;
  --switch-focus: #7c3aed;
}

:root[data-palette="red"] {
  --primary: #D50032;
  --primary-hover: #ad0029;
  --switch-focus: #D50032;
}

:root[data-palette="orange"] {
  --primary: #c65d16;
  --primary-hover: #9a4310;
  --switch-focus: #c65d16;
}

:root[data-palette="gray"] {
  --primary: #f5c518;
  --primary-hover: #d9ad00;
  --switch-focus: #f5c518;
}

:root[data-theme="dark"][data-palette="green"] {
  --primary: #34a89a;
  --primary-hover: #55c5b5;
  --switch-focus: #34a89a;
}

:root[data-theme="dark"][data-palette="blue"] {
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --switch-focus: #60a5fa;
}

:root[data-theme="dark"][data-palette="purple"] {
  --primary: #a78bfa;
  --primary-hover: #c4b5fd;
  --switch-focus: #a78bfa;
}

:root[data-theme="dark"][data-palette="red"] {
  --primary: #D50032;
  --primary-hover: #ff335d;
  --switch-focus: #D50032;
}

:root[data-theme="dark"][data-palette="orange"] {
  --primary: #fb923c;
  --primary-hover: #fdba74;
  --switch-focus: #fb923c;
}

:root[data-theme="dark"][data-palette="gray"] {
  --primary: #f5c518;
  --primary-hover: #ffdc5c;
  --switch-focus: #f5c518;
}

@media (max-width: 480px) {
  .site-sidebar .site-palette-toggle {
    gap: 0.5rem;
    padding-inline: 0.55rem;
  }

  .site-palette-options {
    gap: 0.35rem;
  }

  .site-sidebar .site-palette-option {
    padding-inline: 0.35rem;
    font-size: 0.67rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-palette-toggle,
  .site-palette-chevron,
  .site-palette-option {
    transition: none;
  }
}

/* Nota de lançamento acessada pelo sino da navegação. */

.site-update-notice {
  position: relative;
  flex: 0 0 auto;
}

.site-header .header-nav-actions .site-update-trigger {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease;
}

.site-header .header-nav-actions .site-update-trigger:hover,
.site-header .header-nav-actions .site-update-trigger:focus-visible,
.site-header .header-nav-actions .site-update-trigger[aria-expanded="true"] {
  background: color-mix(in srgb, var(--primary) 9%, var(--card-bg));
  color: var(--primary);
}

.site-header .header-nav-actions .site-update-trigger:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.site-update-indicator {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--bg-container);
  border-radius: 50%;
  background: var(--primary);
}

.site-update-panel[hidden] {
  display: none !important;
}

.site-update-panel:not([hidden]) {
  position: absolute !important;
  top: calc(100% + 0.75rem) !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  width: min(560px, calc(100vw - 1.5rem)) !important;
  max-height: min(78dvh, 720px) !important;
  margin: 0 !important;
  padding: 1rem !important;
  gap: 0.6rem !important;
  transform: none !important;
  z-index: 1202;
  overscroll-behavior: contain;
  animation: site-update-dropdown-in 160ms ease-out;
}

.site-update-panel:not([hidden]) .site-update-panel-header {
  top: -1rem;
  margin: -1rem -1rem 0.1rem;
  padding: 0.8rem 1rem 0.65rem;
}

.site-update-panel:not([hidden]) .site-update-markdown {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
  line-height: 1.65;
}

.site-update-panel:not([hidden]) .site-update-markdown > * {
  max-width: 100%;
}

.site-update-panel:not([hidden]) .site-update-markdown > :first-child {
  margin-top: 0;
}

.site-update-panel:not([hidden]) .site-update-markdown > :last-child {
  margin-bottom: 0;
}

.site-update-panel:not([hidden]) .site-update-markdown p {
  margin: 0.25rem 0 0.55rem;
}

.site-update-panel:not([hidden]) .site-update-markdown h3,
.site-update-panel:not([hidden]) .site-update-markdown h4,
.site-update-panel:not([hidden]) .site-update-markdown h5,
.site-update-panel:not([hidden]) .site-update-markdown h6 {
  margin: 0.85rem 0 0.4rem;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.35;
}

.site-update-panel:not([hidden]) .site-update-markdown ul,
.site-update-panel:not([hidden]) .site-update-markdown ol {
  display: block;
  margin: 0.25rem 0 0.55rem;
  padding-left: 1.35rem;
}

.site-update-panel:not([hidden]) .site-update-markdown ul {
  list-style: disc outside;
}

.site-update-panel:not([hidden]) .site-update-markdown ol {
  list-style: decimal outside;
}

.site-update-panel:not([hidden]) .site-update-markdown li {
  margin: 0.22rem 0;
  padding-left: 0.15rem;
  line-height: 1.55;
}

.site-update-panel:not([hidden]) .site-update-markdown li::marker {
  color: var(--primary);
}

.site-update-panel:not([hidden]) .site-update-markdown strong {
  color: var(--text-main);
  font-weight: 750;
}

.site-update-panel:not([hidden]) .site-update-markdown em {
  font-style: italic;
}

.site-update-panel:not([hidden]) .site-update-markdown a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.site-update-panel:not([hidden]) .site-update-markdown blockquote {
  margin: 0.45rem 0;
  padding: 0.35rem 0.8rem;
  border-left: 3px solid var(--primary);
  color: var(--text-muted);
}

.site-update-panel:not([hidden]) .site-update-markdown blockquote > :first-child {
  margin-top: 0;
}

.site-update-panel:not([hidden]) .site-update-markdown blockquote > :last-child {
  margin-bottom: 0;
}

.site-update-panel:not([hidden]) .site-update-markdown pre {
  max-width: 100%;
  overflow: auto;
}

@keyframes site-update-dropdown-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .site-update-panel:not([hidden]) {
    right: -0.4rem !important;
    width: min(360px, calc(100vw - 1rem)) !important;
    max-height: min(78dvh, 620px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-update-panel:not([hidden]) {
    animation: none;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
}

/* Identidade editorial compartilhada pelas páginas públicas. */

body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.container {
  background: var(--bg-container);
  color: var(--text-main);
  border-color: var(--border);
  box-shadow: none;
}

.site-header {
  background: var(--bg-container);
  color: var(--text-main);
  border-color: var(--border);
  box-shadow: none !important;
}

.logo-top,
main h1,
main h2,
main h3 {
  color: var(--editorial-ink);
}

.logo-top,
main h1,
main h2 {
  font-family: "Playfair Display", Georgia, serif;
}

.logo-bottom {
  color: var(--text-muted);
}

main a:not(.cta-button):not(.button):not([class*="btn-"]) {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .container {
    border-radius: 0;
  }
}

/* ============================================================
   Refinamento de interface: acessibilidade + identidade editorial
   Camada aditiva — não substitui as regras existentes.
   ============================================================ */

/* Utilidades */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Atalho de teclado para o conteúdo principal */

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.7rem 1.15rem;
  background: var(--primary);
  color: var(--bg-container);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgb(0 0 0 / 18%);
  transform: translateY(-160%);
  transition: transform 140ms ease-out;
}

.skip-link:focus-visible {
  transform: translateY(0);
  outline: 3px solid var(--editorial-accent);
  outline-offset: 2px;
}

/* Foco de teclado consistente e visível em toda a interface */

/* Ritmo tipográfico */

main h1,
main h2,
main h3,
.hero h1 {
  text-wrap: balance;
}

main p,
main li {
  text-wrap: pretty;
}

::selection {
  background: color-mix(in srgb, var(--primary) 24%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}

/* O <main> recebe foco programático pelo atalho de teclado, sem anel visual. */

main[tabindex="-1"]:focus {
  outline: none;
}

/* Marca e botão de fechar do aviso de atualização */

.site-update-close {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-container);
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.site-update-close:hover {
  border-color: var(--primary);
}

.site-update-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 44px 22px 0;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.site-update-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
}

.site-update-mark i {
  font-size: 15px;
}

.site-update-brand-copy {
  display: grid;
  gap: 3px;
}

.site-update-brand-copy strong {
  color: var(--text-main);
  font: 700 11px Inter, sans-serif;
  letter-spacing: 0.07em;
}

.site-update-brand-copy small {
  color: var(--text-muted);
  font: 700 9px Inter, sans-serif;
  letter-spacing: 0.12em;
}

.site-update-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .site-update-brand {
    margin-bottom: 18px;
  }
}

.footer-legal {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.footer-legal a i {
  font-size: 0.8rem;
  color: var(--primary);
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.footer-legal a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.footer-legal a[aria-current="page"] {
  color: var(--primary);
  font-weight: 600;
}

.footer-legal-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border);
}

.footer-nowrap {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .site-footer {
    flex-direction: column;
    gap: 0.75rem;
  }

  .site-footer .daniel {
    text-wrap: balance;
  }

  .footer-copy {
    font-size: 0.85rem;
    color: var(--text-muted);
  }
}

@media (max-width: 480px) {
  /* Keep the last line clear of the fixed back-to-top button. */
  .site-footer {
    padding-bottom: 4.5rem;
  }

  .footer-legal {
    flex-wrap: nowrap;
    gap: 0.25rem;
  }

  .footer-legal a {
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
    white-space: nowrap;
  }
}
