/* ==========================================================================
   BASE, reset, tipografia, layout do app (shell)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}
img, svg, video, canvas { display: block; max-width: 100%; }
figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--primary-soft); }
[hidden] { display: none !important; }

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

/* ---------- Tipografia ---------- */
.t-display { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: -.01em; }
.t-h1 { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-2xl); line-height: var(--lh-tight); }
.t-h2 { font-family: var(--font-title); font-weight: 600; font-size: var(--fs-xl); line-height: var(--lh-snug); }
.t-h3 { font-family: var(--font-sub); font-weight: 700; font-size: var(--fs-lg); line-height: var(--lh-snug); }
.t-eyebrow { font-family: var(--font-sub); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .14em; text-transform: uppercase; color: var(--link); }
.t-body { font-size: var(--fs-md); color: var(--text-2); }
.t-small { font-size: var(--fs-sm); color: var(--text-muted); }
.t-xs { font-size: var(--fs-xs); color: var(--text-muted); }
.t-center { text-align: center; }
.t-muted { color: var(--text-muted); }
.prose p + p { margin-top: .9em; }
.prose h3 { font-family: var(--font-title); font-size: var(--fs-xl); margin: 1.2em 0 .4em; }
.prose h4 { font-family: var(--font-sub); font-size: var(--fs-md); margin: 1em 0 .3em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: .6em 0; }
.prose li + li { margin-top: .35em; }
.prose strong { color: var(--text); }
.prose img { border-radius: var(--r-md); height: auto; margin: 1em 0; }
.prose blockquote { margin: 1em 0; padding: .6em 1em; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.prose a { text-decoration: underline; }
.prose figure { margin: 1em 0; }
.prose iframe { max-width: 100%; border-radius: var(--r-md); }

/* ---------- Shell do app ---------- */
.app-backdrop {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 110% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--secondary) 16%, transparent), transparent 60%),
    var(--bg);
}
.app {
  position: relative;
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  display: flex; flex-direction: column;
}
@media (min-width: 560px) {
  .app { box-shadow: 0 0 0 1px var(--border), var(--sh-3); }
}
.view {
  flex: 1;
  display: flex; flex-direction: column;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + var(--sp-6));
  animation: view-in var(--t-med) var(--ease);
}
.view--full { padding-bottom: 0; }
.view--nonav { padding-bottom: var(--sp-8); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.container { padding: 0 var(--sp-5); }
.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-8); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.section { margin-top: var(--sp-8); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--sp-3); }
.section-head .t-h2 { font-size: var(--fs-lg); }
.flex-1 { flex: 1; }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) var(--sp-3) 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  }
.topbar__title { flex: 1; font-family: var(--font-sub); font-weight: 700; font-size: var(--fs-md); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__spacer { width: 44px; }
.topbar--transparent { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; position: absolute; left: 0; right: 0; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--app-max);
  height: calc(var(--nav-h) + var(--safe-b));
  padding: 6px var(--sp-2) var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid var(--border);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-muted); text-decoration: none;
  font-family: var(--font-sub); font-size: 11px; font-weight: 600;
  border-radius: var(--r-md);
  transition: color var(--t-fast);
  position: relative;
}
.bottom-nav a .ico { width: 26px; height: 26px; transition: transform var(--t-med) var(--ease-spring); }
.bottom-nav a[aria-current="page"] { color: var(--text); }
.bottom-nav a[aria-current="page"] .ico { transform: translateY(-2px) scale(1.08); color: var(--brand-marrom-terra); }
:root[data-theme="dark"] .bottom-nav a[aria-current="page"] .ico { color: var(--primary); }
.bottom-nav a[aria-current="page"]::before {
  content: ""; position: absolute; top: -6px; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary);
}
.bottom-nav .badge-dot { position: absolute; top: 6px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

/* ---------- Ícones ---------- */
.ico { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico--fill { fill: currentColor; stroke: none; }
.ico-sm { width: 18px; height: 18px; }
.ico-lg { width: 28px; height: 28px; }
.ico-xl { width: 40px; height: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Barras de rolagem da marca (sem a barra cinza do Windows) */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--primary) 55%, transparent) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
::-webkit-scrollbar-corner { background: transparent; }
.sheet::-webkit-scrollbar-track { margin: 22px 0 12px; }
