:root {
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #dbeafe;
  --radius: 8px;
  --gutter: 32px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--line-strong) var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, p, ul { margin: 0; }
::selection { background: var(--accent-soft); color: var(--ink); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: min(1280px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 10; padding: 10px 14px; border-radius: 6px; background: var(--ink); color: #fff; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Topo */
.topbar { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar-inner { height: 56px; display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.topbar nav { display: flex; gap: 4px; margin-right: -12px; }
.topbar nav a { padding: 8px 12px; border-radius: 6px; color: var(--text-2); font-size: 14px; font-weight: 500; }

/* Abertura */
.intro { padding: 32px 0 20px; }
.intro h1 { font-size: clamp(22px, 2.2vw, 28px); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.lead { max-width: 720px; margin-top: 6px; color: var(--text-2); font-size: 16px; }

/* Acervo */
.archive { padding-bottom: 72px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.filters button span { color: var(--text-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.filters button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.filters button.active span { color: #d1d5db; }
.summary { color: var(--text-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.summary strong { color: var(--ink); font-weight: 600; }

.group { margin-top: 24px; }
.group + .group { margin-top: 48px; }
.group-title { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.group-title span { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.group-note { max-width: 720px; margin: -4px 0 16px; color: var(--text-2); font-size: 14px; }
.meta { color: var(--text-3); font-size: 13px; }

/* Cards dos projetos publicados */
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.card-thumb { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); }
.card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; }
.card h3 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.card-text { color: var(--text-2); font-size: 14px; }
.card .meta { margin-top: auto; padding-top: 6px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 6px; font-size: 13px; }
.card-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.card-url { overflow: hidden; color: var(--text-3); text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 1241px) { .card-url { display: none; } }

/* Índice dos trabalhos internos */
.index { padding: 0; list-style: none; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 260px 150px; gap: 8px 32px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); }
.row h3 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; }
.row-main p { margin-top: 2px; color: var(--text-2); font-size: 14px; }
.row .status { justify-self: end; color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap; }

/* Escopo */
.scope { display: grid; grid-template-columns: 1fr 2fr; gap: 24px 48px; padding: 56px 0 72px; border-top: 1px solid var(--line); }
.scope h2 { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.015em; }
.scope p { max-width: 680px; color: var(--text-2); font-size: 17px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding: 0; list-style: none; }
.tags li { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text-2); font-size: 14px; }

/* Rodapé */
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 32px; padding: 28px 0; color: var(--text-3); font-size: 14px; }
.footer strong { color: var(--ink); font-weight: 600; }
.footer a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }

@media (hover: hover) {
  .topbar nav a:hover { background: var(--surface); color: var(--ink); }
  .filters button:not(.active):hover { border-color: var(--text-3); color: var(--ink); }
  a.card:hover { border-color: var(--line-strong); box-shadow: 0 6px 20px -8px rgba(17, 24, 39, .18); }
  a.card:hover h3 { color: var(--accent-strong); }
  .footer a:hover { color: var(--ink); text-decoration-color: currentColor; }
}
a.card:focus-visible { outline-offset: 3px; border-radius: var(--radius); }

@media (max-width: 1240px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .meta { grid-row: 2; }
  .row .status { grid-row: 1 / 3; grid-column: 2; align-self: start; }
  .scope { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .intro { padding: 24px 0 16px; }
  .lead { font-size: 15px; }
  .toolbar { padding-top: 16px; }
  .grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row .meta, .row .status { grid-row: auto; grid-column: auto; justify-self: start; }
  .scope { padding: 40px 0 48px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
