/* ===================== Fontes ===================== */
@font-face {
  font-family: "Switzer";
  src: url("../assets/fonts/Switzer-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Retrogression";
  src: url("../assets/fonts/Retrogression-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

/* ===================== Tokens ===================== */
:root {
  --azul: #0000ec;
  --rosa: #fae7ec;

  --fonte: "Switzer", "Helvetica Neue", Arial, sans-serif;
  --fonte-cap: "Retrogression", var(--fonte);

  --t-titulo: clamp(2.375rem, 1.35rem + 4.4vw, 3.875rem); /* ~62px no desktop */
  --t-sub: clamp(1.125rem, 0.95rem + 0.75vw, 1.5rem);    /* ~24px */
  --t-menu: clamp(1.0625rem, 0.9rem + 0.7vw, 1.5rem);    /* ~24px */
  --t-texto: clamp(1rem, 0.94rem + 0.25vw, 1.125rem);    /* ~18px */
  --t-card: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);     /* ~16px */

  --menu-h: clamp(4.5rem, 3rem + 6vw, 7.75rem);
  --lateral: clamp(1rem, 5vw, 5.375rem);
  --largura: 69.5rem; /* ~1112px */
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--fonte);
  font-size: var(--t-texto);
  line-height: 1.2;
  background: var(--rosa);
  color: var(--azul);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0; }

.tema-azul { background: var(--azul); color: var(--rosa); }
.tema-rosa { background: var(--rosa); color: var(--azul); }

::selection { background: currentColor; }
.tema-azul ::selection { background: var(--rosa); color: var(--azul); }
.tema-rosa ::selection { background: var(--azul); color: var(--rosa); }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

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

/* Letra pixelada (Retrogression) dentro dos títulos */
.cap {
  font-family: var(--fonte-cap);
  font-weight: 400;
  letter-spacing: 0;
}

/* ===================== Tipografia ===================== */
.titulo {
  margin: 0;
  font-weight: 400;
  font-size: var(--t-titulo);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-align: center;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.subtitulo {
  margin-top: 0.85em;
  font-size: var(--t-sub);
  line-height: 1.25;
  text-align: center;
}

.texto p + p { margin-top: 1.2em; }

/* ===================== Menu ===================== */
.menu {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  height: var(--menu-h);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: clamp(1.25rem, 4.4vw, 3.5rem);
  padding: 0 1rem;
  font-size: var(--t-menu);
  transition: background-color 0.3s, color 0.3s;
}
.menu a { text-decoration: none; }
.menu a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* ===================== Seções ===================== */
.secao {
  padding: calc(var(--menu-h) + 2rem) var(--lateral) 5rem;
  scroll-margin-top: 0;
}

.hero,
.servicos,
.contato {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Header 3 */
.hero .subtitulo { margin-top: 1.4em; }

/* Projetos */
.projetos { padding-top: calc(var(--menu-h) + 3.5rem); }
.projetos .subtitulo { margin-top: 0.6em; }

.grade {
  list-style: none;
  margin: 1.75rem auto 0;
  padding: 0;
  max-width: var(--largura);
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  row-gap: 4rem;
}
/* colunas desencontradas: a da direita começa mais abaixo */
.card:nth-child(even) { margin-top: 7.5rem; }
.card:nth-child(even):last-child { margin-bottom: 0; }

.card a {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  text-decoration: none;
}
.card img {
  width: 49%;
  flex-shrink: 0;
  aspect-ratio: 273 / 375;
  object-fit: cover;
  transition: opacity 0.25s;
}
.card a:hover img { opacity: 0.85; }
.card__info {
  display: flex;
  flex-direction: column;
  gap: 1.25em;
  max-width: 11.5rem;
  font-size: var(--t-card);
  line-height: 1.1;
}
.card a:hover .card__titulo { text-decoration: underline; text-underline-offset: 0.2em; }

/* Sobre */
.sobre {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(var(--menu-h) + 5.5rem);
  padding-bottom: 8rem;
}
.sobre__conteudo {
  width: 100%;
  max-width: 66.375rem; /* ~1062px */
  margin-top: clamp(2.5rem, 6vw, 6.25rem);
  display: grid;
  grid-template-columns: 41.8% 1fr;
  column-gap: clamp(1.5rem, 3vw, 2.4rem);
  align-items: start;
}
.sobre__foto {
  width: 100%;
  aspect-ratio: 444 / 555;
  object-fit: cover;
}
.sobre .texto {
  padding-top: clamp(0rem, 4vw, 3rem);
  font-size: var(--t-sub);
  line-height: 1.04;
}
.sobre .texto p + p { margin-top: 0.85em; }

/* Rosto (header 2). Usa a imagem como máscara para herdar a cor do tema. */
.rosto {
  display: block;
  width: clamp(8.5rem, 12vw, 9.5rem);
  aspect-ratio: 737 / 800;
  background-color: currentColor;
  -webkit-mask: url("../assets/img/rosto.png") center / contain no-repeat;
  mask: url("../assets/img/rosto.png") center / contain no-repeat;
}

/* O que eu faço */
.servicos .lista {
  list-style: none;
  margin: 1.6em 0 0;
  padding: 0;
  font-size: var(--t-sub);
  line-height: 1.1;
  text-align: center;
}

/* Contato */
.contato .titulo { margin-bottom: 2.25rem; }
.form {
  width: 100%;
  max-width: 37.75rem; /* ~604px */
  display: grid;
  grid-template-columns: 1.16fr 1fr;
  gap: 1.75rem 2.1rem;
}
.campo { display: block; }
.campo--largo,
.form__rodape { grid-column: 1 / -1; }
.form input,
.form textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-size: var(--t-texto);
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 0;
  opacity: 0.92;
  -webkit-appearance: none;
  appearance: none;
}
.form input { height: 3rem; }
.form textarea { height: 11.6rem; resize: vertical; }
.form ::placeholder { color: inherit; opacity: 0.55; }
.form input:focus,
.form textarea:focus { outline: none; opacity: 1; box-shadow: inset 0 0 0 1px currentColor; }
.form__rodape {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: -0.5rem;
}
.form__status { font-size: var(--t-card); }
.botao {
  margin-left: auto;
  padding: 0.45rem 1.4rem;
  font: inherit;
  font-size: var(--t-sub);
  color: var(--azul);
  background: var(--rosa);
  border: 2px solid var(--rosa);
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.botao:hover { background: transparent; color: var(--rosa); }
.contato__links {
  margin-top: 2.5rem;
  font-size: var(--t-sub);
  text-align: center;
}
.contato__links a { text-decoration: none; }
.contato__links a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.contato__links .sep { margin: 0 0.6em; }

/* ===================== Página interna de projeto ===================== */
.projeto {
  max-width: calc(var(--largura) + 2 * var(--lateral));
  margin: 0 auto;
  padding-top: calc(var(--menu-h) + 6.5rem);
  padding-bottom: 6rem;
}
.projeto .subtitulo { margin-top: 0.55em; }
.projeto__banner {
  width: 100%;
  aspect-ratio: 1062 / 390;
  object-fit: cover;
  margin-top: 4.4rem;
}
.projeto__texto {
  margin-top: 5.5rem;
  padding: 0 0.8rem;
  line-height: 1.07;
}
.projeto__galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.projeto__galeria:empty { display: none; }
.projeto__navegacao {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 5rem;
  padding: 0 0.8rem;
  font-size: var(--t-sub);
}
.projeto__navegacao a { text-decoration: none; }
.projeto__navegacao a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* ===================== Abertura (headers 1, 2 e 3) =====================
   Cada tela entra em etapas: primeiro a cor, depois o conteúdo.
   O main.js vai acrescentando as classes na ordem:
   intro--cor-1 → intro--conteudo-1 → intro--cor-2 → intro--conteudo-2 →
   intro--fim (revela o header 3) → hero-visivel → menu-visivel           */
.intro { display: none; }
.com-intro body { overflow: hidden; }
.com-intro .intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 20;
  cursor: pointer;
  background: var(--rosa);
  transition: opacity 0.7s ease;
}
.intro__tela {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 var(--lateral);
  opacity: 0;
  transition: opacity 0.7s ease;
}
.intro__tela > * {
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.intro__tela--1 .titulo { line-height: 1.08; }

.intro--cor-1 .intro__tela--1,
.intro--cor-2 .intro__tela--2 { opacity: 1; }
.intro--conteudo-1 .intro__tela--1 > *,
.intro--conteudo-2 .intro__tela--2 > * { opacity: 1; transform: none; }
.intro--fim { opacity: 0; pointer-events: none; }

/* Rostinho: balança a cabeça e o traço "treme" como desenho à mão */
.rosto-animado {
  display: block;
  filter: url(#rabisco);
}
.rosto-animado .rosto {
  transform-origin: 50% 85%;
  animation: balanca 1.6s ease-in-out infinite;
}
@keyframes balanca {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg) translateX(0.25rem); }
}

/* Header 3: o título e depois o menu aparecem quando a abertura termina */
.com-intro .hero > *,
.com-intro .menu {
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 0.8s ease, transform 0.8s ease, background-color 0.3s, color 0.3s;
}
.com-intro .hero .subtitulo { transition-delay: 0.25s; }
.com-intro.hero-visivel .hero > *,
.com-intro.menu-visivel .menu { opacity: 1; transform: none; }

/* ===================== Responsivo ===================== */
@media (max-width: 900px) {
  .card a { flex-direction: column; align-items: flex-start; }
  .card img { width: 100%; }
  .card__info { max-width: none; gap: 0.5em; }
  .card:nth-child(even) { margin-top: 5rem; }

  .sobre__conteudo { grid-template-columns: 1fr; row-gap: 2rem; max-width: 34rem; }
  .sobre__foto { width: 75%; max-width: 22rem; margin: 0 auto; }
  .sobre .texto { padding-top: 0; line-height: 1.2; }
}

@media (max-width: 600px) {
  .grade { grid-template-columns: 1fr; row-gap: 3rem; max-width: 22rem; }
  .card:nth-child(even) { margin-top: 0; }
  /* mantém o ar "desencontrado" no celular */
  .card:nth-child(odd) a { margin-right: 12%; }
  .card:nth-child(even) a { margin-left: 12%; }

  .form { grid-template-columns: 1fr; gap: 1rem; }
  .form__rodape { margin-top: 0; }
  .projeto { padding-top: calc(var(--menu-h) + 3rem); }
  .projeto__banner { margin-top: 2.5rem; aspect-ratio: 4 / 3; }
  .projeto__texto { margin-top: 2.5rem; padding: 0; line-height: 1.25; }
  .projeto__navegacao { padding: 0; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .rosto-animado { filter: none; }
  .rosto-animado .rosto { animation: none; }
}
