@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap");

:root {
  --bg: #f7f6f3;
  --paper: #ffffff;
  --ink: #141311;
  --muted: #6e6a62;
  --line: #ebe7df;
  --accent: #0d9488;
  --accent-hot: #e11d48;
  --accent-soft: #ccfbf1;
  --shadow: 0 8px 28px rgba(20, 19, 17, .10);
  --shadow-hover: 0 16px 40px rgba(20, 19, 17, .16);
  --topo: 60px;
  --arvore: 280px;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
  --radius: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

.topo {
  height: var(--topo);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.marca {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.busca { flex: 1; min-width: 0; max-width: 640px; }
.busca input {
  width: 100%;
  border: 1px solid transparent;
  background: var(--bg);
  border-radius: 999px;
  padding: 10px 16px;
  outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.busca input:focus {
  background: var(--paper);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.acoes { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.lang {
  display: flex;
  background: var(--bg);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}
.lang button {
  border: 0; background: transparent; padding: 5px 10px; cursor: pointer;
  border-radius: 999px; font-weight: 600; font-size: 12px; color: var(--muted);
  transition: background .15s, color .15s;
}
.lang button.ativo {
  background: var(--ink); color: #fff;
}
.entrar {
  border: 0; background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-weight: 600; font-size: 13px;
  transition: transform .15s var(--ease), filter .15s;
}
.entrar:hover { filter: brightness(1.06); transform: translateY(-1px); }
.menu {
  display: none; border: 0; background: var(--bg); width: 38px; height: 38px;
  border-radius: 10px; cursor: pointer; font-size: 18px;
}
.ia {
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 4px 9px; border-radius: 999px;
  white-space: nowrap;
}

.nota { background: var(--paper); border-bottom: 1px solid var(--line); }
.nota-bar {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 12px 22px; display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; color: var(--muted); font-weight: 500;
}
.nota-bar:hover { color: var(--ink); }
.nota-corpo { padding: 0 22px 18px; max-width: 740px; font-family: var(--serif); font-size: 16.5px; line-height: 1.6; }
.nota-corpo p { margin: 0 0 12px; }
.link {
  background: none; border: 0; padding: 0; color: var(--accent);
  cursor: pointer; font-weight: 600; text-decoration: none;
}
.link:hover { text-decoration: underline; }

.layout {
  display: grid;
  grid-template-columns: var(--arvore) 1fr;
  min-height: calc(100vh - var(--topo));
}
.arvore {
  border-right: 1px solid var(--line);
  padding: 14px 10px 48px;
  overflow: auto;
  background: var(--paper);
  position: sticky; top: var(--topo); height: calc(100vh - var(--topo));
}
.arvore-cab {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 12px 12px; font-size: 12px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.arvore-cab a {
  text-decoration: none; text-transform: none; letter-spacing: 0; font-weight: 500;
  color: var(--accent);
}
.arvore-cab a:hover { text-decoration: underline; }

.no {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center; gap: 4px;
  width: 100%; text-align: left; background: none; border: 0;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.no:hover { background: var(--bg); }
.no.ativo {
  background: var(--accent-soft);
  color: #0f766e;
  font-weight: 600;
}
.no .seta {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent);
  font-size: 11px;
  transition: transform .18s var(--ease);
  transform: rotate(0deg);
}
.no .seta.aberta { transform: rotate(90deg); }
.no .seta.vazia { visibility: hidden; }
.no .rotulo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no .n {
  color: var(--muted); font-size: 11px; font-weight: 500;
  background: var(--bg); padding: 1px 6px; border-radius: 999px;
}
.no.ativo .n { background: #fff; color: #0f766e; }
.filhos { padding-left: 8px; border-left: 1px solid var(--line); margin-left: 16px; }

main { padding: 18px 22px 96px; }
.trilha {
  margin-bottom: 14px;
  min-height: 1.4em;
}
.trilha .crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.trilha .crumbs strong {
  color: var(--ink); font-size: 18px; font-family: var(--serif); font-weight: 600;
}
.trilha .sep { opacity: .45; }
.trilha .meta {
  margin-top: 4px; font-size: 12px; color: var(--muted);
}
.filtros { margin-bottom: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.filtros label {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 999px; font-size: 12px; color: var(--muted);
}
.filtros select {
  border: 0; background: transparent; font-weight: 600; color: var(--ink); outline: none;
}

.grade {
  columns: 220px;
  column-gap: 14px;
}
.card {
  break-inside: avoid;
  margin: 0 0 14px;
  background: var(--paper);
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 2px rgba(20,19,17,.04);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
  isolation: isolate;
}
.card img {
  width: 100%; height: auto; display: block;
  transition: transform .35s var(--ease);
}
.card .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 12px 12px;
  background: linear-gradient(to top, rgba(12,11,10,.78), transparent);
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  pointer-events: none;
}
.card .cap strong {
  display: block; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .cap span {
  display: block; font-size: 11px; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: var(--shadow-hover);
  z-index: 2;
}
.card:hover img { transform: scale(1.04); }
.card:hover .cap { opacity: 1; transform: translateY(0); }
.card:active { transform: translateY(-1px) scale(1.01); }

.vazio { color: var(--muted); text-align: center; padding: 64px 0; }
.mais { height: 1px; }

.lb {
  border: 0; padding: 0;
  max-width: min(1180px, 96vw);
  background: transparent;
  animation: lbIn .22s var(--ease);
}
@keyframes lbIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.lb::backdrop {
  background: rgba(12, 11, 10, .72);
  backdrop-filter: blur(6px);
}
.lb-in {
  display: grid;
  grid-template-columns: 1.4fr 340px;
  background: var(--paper);
  border-radius: 16px;
  overflow: hidden;
  max-height: 92vh;
  box-shadow: var(--shadow-hover);
}
.lb-in img {
  width: 100%; height: 100%; object-fit: contain;
  background: #0c0b0a; max-height: 92vh;
}
.lb-meta { padding: 24px; overflow: auto; display: flex; flex-direction: column; }
.lb-meta h2 {
  font-family: var(--serif); font-weight: 600; font-size: 22px;
  margin: 0 0 8px; letter-spacing: -.01em; line-height: 1.25;
}
.lb-meta .caminho {
  color: var(--muted); margin: 0 0 14px; font-size: 12.5px; line-height: 1.45;
}
.lb-meta .caminho .dot { color: var(--accent); margin: 0 4px; font-weight: 700; }
.lb-meta .pasta { display: none; }
.dl { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 16px; }
.dl a, .dl button, .fechar {
  display: block; text-align: center; text-decoration: none;
  border: 1px solid transparent; background: var(--ink); color: #fff;
  padding: 11px; border-radius: 10px; cursor: pointer; font-weight: 600;
  transition: transform .15s var(--ease), filter .15s;
}
.dl a:hover, .dl button:hover, .fechar:hover { filter: brightness(1.05); transform: translateY(-1px); }
.dl button, .fechar {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.fechar { margin-top: auto; }
.aviso { font-size: 12px; color: var(--muted); }

.painel {
  max-width: 560px; margin: 48px auto; background: var(--paper);
  padding: 32px; border-radius: 16px; box-shadow: var(--shadow);
}
.painel h1 { font-family: var(--serif); font-weight: 600; margin: 0 0 8px; }
.painel input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; margin: 6px 0 12px; background: var(--bg);
}
.cards { display: grid; gap: 12px; margin-top: 20px; }
.cards article {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.cards article:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.cards h2 { margin: 0 0 6px; font-size: 16px; }

@media (max-width: 900px) {
  .menu { display: inline-flex; align-items: center; justify-content: center; }
  .layout { grid-template-columns: 1fr; }
  .arvore {
    display: none; position: fixed; top: var(--topo); left: 0; bottom: 0;
    width: min(86vw, 320px); z-index: 25; height: auto;
    box-shadow: 12px 0 40px rgba(0,0,0,.12);
  }
  .arvore.aberta { display: block; }
  .ia { display: none; }
  .lb-in { grid-template-columns: 1fr; }
  .grade { columns: 160px; column-gap: 10px; }
  main { padding: 14px 14px 80px; }
}

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