/* ==========================================================
   ROTA QUADRAS: a praça vira matéria.
   Quadras chapadas, cantos vivos, separadas por ruas claras (o fundo da página aparecendo
   entre elas). O quadrado vermelho é a praça e marca "onde você está".
   Celular primeiro; o computador entra a partir de 900 px. Cores e fontes só por tokens.css.
   ========================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--font-texto);
  font-weight: var(--peso-texto);
  font-size: var(--texto-corpo);
  line-height: 1.5;
}
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-titulo); font-weight: 600; margin: 0; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; }

/* A rua: o vão entre quadras. Estreita no celular, mais larga no computador. */
:root { --rua: 8px; }
@media (min-width: 900px) { :root { --rua: 16px; } }

.pular { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--superficie); padding: 12px 16px; font-size: var(--texto-apoio); }
.pular:focus { left: 8px; }

.rotulo {
  font-family: var(--font-texto);
  font-size: var(--texto-legenda);
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------- Botões e links ---------- */
.botao {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--altura-controle); padding: 0 24px;
  font-family: var(--font-texto); font-size: var(--texto-apoio); font-weight: 600;
  text-decoration: none; border: 0;
}
.botao--escuro { background: var(--botao-fundo); color: var(--botao-texto); }
.botao--claro { background: var(--quase-branco); color: var(--tinta); }
.botao:hover { text-decoration: underline; text-underline-offset: 4px; }

.link-seta {
  display: inline-block; padding: 12px 0; line-height: 1.5;
  font-size: var(--texto-apoio); font-weight: 600;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.junto { white-space: nowrap; }
.seta {
  display: inline-block; width: 32px; height: 16px; margin-left: 12px; vertical-align: -2px;
  background: currentColor;
  -webkit-mask: var(--seta-forma) center / contain no-repeat;
  mask: var(--seta-forma) center / contain no-repeat;
}

/* ---------- Cabeçalho ---------- */
.cabecalho {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 0 var(--margem);
}
.cabecalho__marca { display: block; padding: 8px 0; }
.cabecalho__marca img { height: 34px; width: auto; }
.cabecalho__menu {
  min-height: 44px; padding: 0 18px;
  font-family: var(--font-texto); font-size: var(--texto-apoio); font-weight: 600;
  color: var(--tinta); background: transparent; border: 2px solid var(--tinta);
}
.cabecalho__nav ul { list-style: none; margin: 0; padding: 0; }
.cabecalho__nav a:not(.botao) { text-decoration: none; font-size: var(--texto-apoio); font-weight: 500; }
.cabecalho__nav a:not(.botao):hover { text-decoration: underline; text-underline-offset: 5px; }

/* No celular, o menu fica atrás do botão e abre como uma quadra branca embaixo do cabeçalho */
.js .cabecalho__nav { display: none; }
.js .cabecalho__nav.aberto {
  display: block; position: absolute; left: var(--rua); right: var(--rua); top: 100%;
  background: var(--superficie); padding: 8px 20px 20px;
}
.cabecalho__nav li a:not(.botao) { display: flex; align-items: center; min-height: 52px; font-size: var(--texto-corpo); }
.cabecalho__nav li + li { border-top: 1px solid var(--linha); }
.cabecalho__nav li:last-child { border: 0; padding-top: 12px; }
.cabecalho__nav .botao { width: 100%; }

@media (min-width: 900px) {
  .cabecalho { min-height: var(--altura-cabecalho); }
  .cabecalho__marca img { height: 40px; }
  .cabecalho__menu { display: none; }
  .js .cabecalho__nav, .cabecalho__nav { display: block; position: static; padding: 0; background: none; }
  .cabecalho__nav ul { display: flex; align-items: center; gap: 32px; }
  .cabecalho__nav li + li, .cabecalho__nav li:last-child { border: 0; padding: 0; }
  .cabecalho__nav li a:not(.botao) { min-height: 44px; font-size: var(--texto-apoio); }
  .cabecalho__nav .botao { width: auto; }
}

/* ---------- Quadras ---------- */
.quadra { margin: 0; }
.quadra--tinta { background: var(--tinta); color: var(--quase-branco); }
.quadra--grafite { background: var(--grafite); color: var(--branco); }

/* ---------- Abertura ---------- */
.abertura {
  display: grid; gap: var(--rua);
  padding: 0 var(--rua) var(--rua);
}
.abertura__titulo { padding: 24px 20px 28px; }
.abertura__titulo .rotulo { color: var(--cinza-claro); margin-bottom: 14px; }
.abertura h1 {
  font-size: clamp(44px, 7.4vw, 104px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.abertura__apoio { padding: 22px 20px 24px; display: grid; gap: 22px; justify-items: start; }
.abertura__apoio p { font-size: var(--texto-corpo); line-height: 1.45; font-weight: 300; }
.abertura__foto { aspect-ratio: 4 / 3; overflow: hidden; }
.abertura__foto img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }

@media (min-width: 900px) {
  .abertura {
    grid-template-columns: minmax(0, 6fr) minmax(0, 7fr);
    grid-template-rows: 1fr auto;
    grid-template-areas: "titulo foto" "apoio foto";
    height: clamp(600px, calc(100svh - var(--altura-cabecalho)), 940px);
  }
  .abertura__titulo { grid-area: titulo; padding: clamp(40px, 4vw, 64px); display: flex; flex-direction: column; justify-content: flex-end; }
  .abertura__titulo .rotulo { margin-bottom: 28px; font-size: var(--texto-apoio); }
  .abertura__apoio { grid-area: apoio; padding: clamp(32px, 3vw, 48px) clamp(40px, 4vw, 64px); gap: 28px; }
  .abertura__apoio p { font-size: var(--texto-destaque); max-width: 30em; }
  .abertura__foto { grid-area: foto; aspect-ratio: auto; height: 100%; }
}

/* ---------- Em que fase está ---------- */
.fases-secao {
  max-width: calc(var(--largura-maxima) + 2 * var(--margem));
  margin: 0 auto;
  padding: var(--espaco-7) var(--margem) var(--espaco-7);
}
.fases-secao__cabeca { margin-bottom: 32px; }
.fases-secao h2 {
  font-size: clamp(34px, 4.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 14em;
}
.fases-secao__cabeca p { margin-top: 16px; color: var(--texto-suave); max-width: 36em; }
.fases-secao__ciclo { margin-top: 28px; }

.fases { display: flex; flex-direction: column; gap: var(--rua); }
.fase { margin: 0; font-size: inherit; }
.fase button {
  position: relative; width: 100%;
  display: grid; gap: 4px; justify-items: start; text-align: left;
  min-height: 96px; padding: 18px 64px 20px 20px;
  border: 0; border-radius: 0; cursor: pointer;
  background: var(--cinza-claro); color: var(--tinta);
  font: inherit;
}
@media (hover: hover) { .fase button:hover { background: var(--cinza-intermediario); } }
.fase__num { font-size: var(--texto-legenda); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.fase__nome { font-family: var(--font-titulo); font-weight: 600; font-size: 22px; line-height: 1.15; }
.fase__etapas { font-size: var(--texto-apoio); font-weight: 400; }

/* Fechada: um "+" no lugar da praça. Aberta: a quadra fica em grafite e a praça vermelha aparece. */
.praca { position: absolute; top: 20px; right: 20px; width: 22px; height: 22px; }
.fase [aria-expanded="false"] .praca::before,
.fase [aria-expanded="false"] .praca::after { content: ""; position: absolute; background: var(--tinta); }
.fase [aria-expanded="false"] .praca::before { left: 0; right: 0; top: 10px; height: 2px; }
.fase [aria-expanded="false"] .praca::after { top: 0; bottom: 0; left: 10px; width: 2px; }
.fase button[aria-expanded="true"] { background: var(--grafite); color: var(--branco); cursor: default; }
/* quase-branco, e não cinza-claro: o cinza-claro sobre o grafite fica em 4,49:1, abaixo do AA */
.fase [aria-expanded="true"] .fase__num,
.fase [aria-expanded="true"] .fase__etapas { color: var(--quase-branco); }
.fase [aria-expanded="true"] .praca { background: var(--praca); }

/* O painel encosta na quadra da fase (sem rua entre os dois): é o conteúdo dela */
.painel { background: var(--superficie); padding: 24px 20px 28px; display: grid; gap: 24px; }
.js .painel[hidden] { display: none; }
.fases > .painel { margin-top: calc(-1 * var(--rua)); }
.painel__faz { font-size: var(--texto-corpo); line-height: 1.5; font-weight: 400; }
.painel__pronto h4 { font-size: 20px; margin-bottom: 12px; }
.painel__pronto .link-seta { margin-top: 12px; }

.lista-quadras { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lista-quadras li { position: relative; padding-left: 26px; font-size: var(--texto-corpo); line-height: 1.4; }
.lista-quadras li::before { content: ""; position: absolute; left: 0; top: .45em; width: 12px; height: 12px; background: var(--grafite); }

@media (min-width: 900px) {
  .fases-secao { padding: var(--espaco-7) var(--margem); }
  .fases-secao__cabeca { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; margin-bottom: 40px; }
  .fases-secao__cabeca p { margin: 0; font-size: var(--texto-destaque); }

  /* As três fases lado a lado, como um trecho de bairro; o painel ocupa a quadra de baixo inteira */
  .js .fases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--rua); }
  .js .fase { grid-row: 1; grid-column: var(--coluna); }
  .js .fases > .painel { grid-row: 2; grid-column: 1 / -1; margin-top: 0; }
  .fase button { height: 100%; min-height: 168px; align-content: end; padding: 28px 72px 28px 28px; }
  .fase__nome { font-size: 26px; }
  .praca { top: 28px; right: 28px; width: 28px; height: 28px; }
  .fase [aria-expanded="false"] .praca { display: none; }

  .painel { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 64px; padding: 48px; align-items: start; }
  .painel__faz { font-size: 26px; line-height: 1.35; font-family: var(--font-titulo); font-weight: 500; letter-spacing: -0.005em; }
}
