@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-latin-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

/* Recursive é a fonte do massa e do seguro (cópia do arquivo deles, OFL).
   Só entra dentro dos cards, onde vale a identidade de cada projeto. */
@font-face {
  font-family: "Recursive";
  src: url("/fonts/recursive.woff2") format("woff2");
  font-weight: 300 1000;
  font-display: swap;
}

/* A página é neutra: a cor vem só de dentro dos cards. */
:root {
  --fundo: #fafafa;
  --superficie: #ffffff;
  --tinta: #18181b;
  --tinta-2: #52525b;
  --linha: #e4e4e7;
  --linha-forte: #a1a1aa;
  --selecao: #18181b;
  --sobre-selecao: #fafafa;
  --sombra: 0 1px 2px rgb(24 24 27 / 0.06), 0 12px 32px -12px rgb(24 24 27 / 0.18);
  --contorno: rgb(24 24 27 / 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #0e0e10;
    --superficie: #17171a;
    --tinta: #ededef;
    --tinta-2: #a1a1aa;
    --linha: #27272a;
    --linha-forte: #52525b;
    --selecao: #ededef;
    --sobre-selecao: #0e0e10;
    --sombra: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px -12px rgb(0 0 0 / 0.6);
    --contorno: rgb(255 255 255 / 0.09);
    color-scheme: dark;
  }
}

/* Paletas dos projetos, copiadas dos tokens de cada um (Azulejo e Santorini). */
.projeto-massa {
  --p-cabecalho: #0f2554;
  --p-papel: #f3f6fb;
  --p-marca: #7fe3da;
  --p-sobre-marca: #0f2554;
  --p-filete: #7fe3da;
  --p-texto: #ffffff;
  --p-texto-2: #b9c4dc;
}

.projeto-seguro {
  --p-cabecalho: #191f22;
  --p-papel: #f4f2ec;
  --p-marca: #9cc9ea;
  --p-sobre-marca: #191f22;
  --p-filete: #b8903a;
  --p-texto: #ece6da;
  --p-texto-2: #b8b4a7;
}

@media (prefers-color-scheme: dark) {
  .projeto-massa {
    --p-cabecalho: #070d19;
    --p-papel: #0b1220;
  }
  .projeto-seguro {
    --p-cabecalho: #0b0e10;
    --p-papel: #121618;
    --p-filete: #d4ad5a;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--fundo);
  scrollbar-color: var(--linha-forte) var(--fundo);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fundo);
  color: var(--tinta);
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--selecao);
  color: var(--sobre-selecao);
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--tinta);
  outline-offset: 3px;
  border-radius: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.limite {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.icone {
  width: 1em;
  height: 1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Topo */

.topo-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4rem;
}

.marca {
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  padding-block: 0.5rem;
}

.topo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0;
  color: var(--tinta-2);
  font-size: 0.95rem;
  text-decoration: none;
}

.topo-link:hover {
  color: var(--tinta);
}

.autor,
.apresentacao strong {
  color: var(--tinta);
  font-weight: 600;
}

/* Abertura */

main {
  flex: 1;
}

.abertura {
  padding-block: clamp(2.25rem, 6vh, 4rem) clamp(2.25rem, 5vh, 3.25rem);
}

h1 {
  max-width: 16ch;
  font-size: clamp(2.5rem, 5.4vw, 4.25rem);
  font-weight: 650;
  font-stretch: 94%;
  line-height: 1.02;
  letter-spacing: -0.028em;
  word-spacing: 0.05em;
  text-wrap: balance;
}

.apresentacao {
  max-width: 46ch;
  margin-top: 1.25rem;
  color: var(--tinta-2);
  font-size: clamp(1.075rem, 1.4vw, 1.25rem);
  line-height: 1.55;
  text-wrap: pretty;
}

.apresentacao a {
  color: var(--tinta);
}

/* No desktop o título cabe numa linha e os cards sobem para a dobra. */
@media (min-width: 64rem) {
  h1 {
    max-width: none;
  }
}

/* Projetos */

.projetos {
  padding-bottom: clamp(3rem, 8vh, 6rem);
}

.projetos h2 {
  margin-bottom: 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.grade {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

@media (min-width: 52rem) {
  .grade {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.projeto {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: var(--p-cabecalho);
  box-shadow: 0 0 0 1px var(--contorno), var(--sombra);
  isolation: isolate;
}

/* A captura real do projeto, sobre o papel dele, inteira na largura e sangrando embaixo. */
.tela {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--p-papel);
}

.tela picture {
  position: absolute;
  top: clamp(1rem, 2.4vw, 1.75rem);
  left: clamp(1rem, 2.4vw, 1.75rem);
  right: clamp(1rem, 2.4vw, 1.75rem);
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.12), 0 16px 40px -16px rgb(15 23 42 / 0.35);
  transition: transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tela img {
  display: block;
  width: 100%;
  height: auto;
}

.projeto:hover .tela picture,
.projeto:focus-within .tela picture {
  transform: translateY(-9%);
}

/* O painel na identidade do projeto: o mesmo desenho do og.png de cada um. */
.painel {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1.5rem, 3vw, 2.25rem) clamp(1.25rem, 2.5vw, 1.75rem) calc(clamp(1.5rem, 3vw, 2.25rem) + 6px);
  color: var(--p-texto);
  font-family: "Recursive", ui-sans-serif, system-ui, sans-serif;
  font-variation-settings: "MONO" 0, "CASL" 0;
}

/* Filete da marca de cada projeto (ativo de marca, não borda de card). */
.painel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--p-filete);
  transition: width 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.projeto:hover .painel::before,
.projeto:focus-within .painel::before {
  width: 10px;
}

.cabeca {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.6rem;
}

/* Estado do projeto como marca impressa, não como cor nova. */
.selo {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--p-filete);
  border-radius: 4px;
  color: var(--p-filete);
  font-size: 0.75rem;
  line-height: 1;
  font-variation-settings: "MONO" 1, "CASL" 0;
}

.assinatura {
  color: var(--p-texto-2);
  font-size: 0.8rem;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variation-settings: "MONO" 1, "CASL" 0;
}

.wordmark {
  margin-top: 0.15rem;
  color: #ffffff;
  font-size: clamp(3.25rem, 6vw, 4.5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  font-variation-settings: "MONO" 0, "CASL" 1;
}

.principal {
  text-decoration: none;
}

/* O card inteiro leva ao projeto; os atalhos ficam por cima. */
.principal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.principal:focus-visible {
  outline: none;
}

.projeto:has(.principal:focus-visible) {
  outline: 2px solid var(--tinta);
  outline-offset: 4px;
}

.faixa {
  align-self: flex-start;
  justify-self: start;
  margin-top: 1rem;
  padding: 0.35rem 0.7rem;
  background: var(--p-marca);
  color: var(--p-sobre-marca);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  font-weight: 700;
  line-height: 1.3;
}

.itens {
  margin-top: 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.detalhe {
  margin-top: 0.35rem;
  color: var(--p-texto-2);
  font-size: 0.9rem;
  line-height: 1.5;
  font-variation-settings: "MONO" 1, "CASL" 0;
}

.atalhos {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.atalhos a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid color-mix(in srgb, var(--p-texto) 28%, transparent);
  border-radius: 999px;
  color: var(--p-texto);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.atalhos a:hover {
  background: var(--p-marca);
  border-color: var(--p-marca);
  color: var(--p-sobre-marca);
}

.atalhos a:focus-visible {
  outline: 2px solid var(--p-marca);
  outline-offset: 2px;
  border-radius: 999px;
}

.endereco {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 1.5rem;
  color: var(--p-texto-2);
  font-size: 0.85rem;
  font-variation-settings: "MONO" 1, "CASL" 0;
}

.endereco .icone {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--p-texto);
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.projeto:hover .endereco .icone,
.projeto:focus-within .endereco .icone {
  transform: translateX(4px);
}

/* Dois cards lado a lado dividem as mesmas linhas: faixa, termos, atalhos
   e endereço ficam na mesma altura nos dois. Fica depois das regras base
   do card para vencer o display: flex delas. */
@media (min-width: 52rem) {
  .grade {
    grid-template-rows: auto repeat(7, auto);
    row-gap: 0;
  }
  .projeto {
    display: grid;
    grid-row: span 8;
    grid-template-rows: subgrid;
    grid-template-columns: minmax(0, 1fr);
  }
  .painel {
    display: grid;
    grid-row: span 7;
    grid-template-rows: subgrid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .endereco {
    align-self: end;
  }
}

/* Rodapé */

.rodape {
  border-top: 1px solid var(--linha);
  color: var(--tinta-2);
  font-size: 0.9rem;
}

.rodape-linha {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-block: 1.75rem;
}

/* 404 */

.voltar {
  margin-top: 2rem;
  font-size: 1.05rem;
}

/* Utilidades */

.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;
}

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