/* Base */
:root {
  --menta: #d5efca;
  --verde-claro: #a9d79c;
  --verde-vivo: #2f9e41;
  --verde: #0d4b2a;
  --verde-escuro: #08371e;
  --tinta: #14231b;

  --margem: clamp(20px, 5vw, 80px);
  --base: clamp(22px, 3.6svh, 36px);
  --titulo: "Bricolage Grotesque", system-ui, sans-serif;
  --texto: Figtree, system-ui, sans-serif;
  --suaviza: cubic-bezier(.16, 1, .3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
}

html { scroll-behavior: smooth; }

body {
  position: relative;
  font: 400 1.0625rem/1.65 var(--texto);
  color: var(--tinta);
  background: var(--menta);
}

h1, h2, h3 {
  font-family: var(--titulo);
  font-weight: 700;
  color: var(--verde);
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1, h2 {
  line-height: .96;
  letter-spacing: -.04em;
}

ul {
  list-style: none;
  padding: 0;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--verde-vivo);
  outline-offset: 3px;
}

.pular {
  position: absolute;
  left: -999px;
  z-index: 10;
  padding: 12px;
  background: #fff;
}

.pular:focus {
  left: 8px;
  top: 8px;
}

.botao {
  display: inline-block;
  padding: 15px 26px;
  border-radius: 99px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  color: #fff;
  background: var(--verde);
  transition: background .25s, translate .35s var(--suaviza), scale .35s var(--suaviza);
}

.botao:hover {
  background: var(--verde-escuro);
  translate: 0 -3px;
}

.botao:active { scale: .97; }

/* Navbar */
.topo {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding: 0 var(--margem);
  color: var(--verde);
  transition: color .3s, background .3s, min-height .3s;
}

.topo.rolou {
  min-height: 64px;
  background: var(--menta);
}

.topo.rolou[data-secao="integrantes"] { background: var(--verde-claro); }

.topo.rolou[data-secao="demandante"] {
  color: var(--menta);
  background: var(--verde);
}

.topo a { text-decoration: none; }

.marca {
  font: 700 1.1rem var(--titulo);
  white-space: nowrap;
}

.topo nav {
  display: flex;
  gap: clamp(14px, 3vw, 32px);
}

.topo nav a {
  position: relative;
  padding: 10px 0;
  font-weight: 600;
}

.topo nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 6px;
  height: 2px;
  background: currentColor;
  scale: 0 1;
  transform-origin: left;
  transition: scale .35s var(--suaviza);
}

.topo nav a:hover::after,
.topo nav a[aria-current]::after { scale: 1; }

/* Hero */
.hero {
  --r: min(52vw, 100svh - 112px);
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  padding: 112px var(--margem) 64px;
  overflow: hidden;
  background: var(--menta);
}

.ondas {
  position: absolute;
  inset: 0;
  transform-origin: 100% 100%;
  background: radial-gradient(circle at 100% 100%,
    transparent calc(var(--r) + 22px),
    var(--verde-vivo) calc(var(--r) + 23px) calc(var(--r) + 37px),
    transparent calc(var(--r) + 38px) calc(var(--r) + 70px),
    #a4d597 calc(var(--r) + 71px) calc(var(--r) + 113px),
    transparent calc(var(--r) + 114px) calc(var(--r) + 150px),
    #bee4b1 calc(var(--r) + 151px) calc(var(--r) + 221px),
    transparent calc(var(--r) + 222px) calc(var(--r) + 270px),
    #cbebbf calc(var(--r) + 271px) calc(var(--r) + 381px),
    transparent calc(var(--r) + 382px));
}

.hero-texto {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 20px;
  width: calc(100vw - var(--r) - var(--margem) - 40px);
}

.hero h1 { font-size: clamp(3rem, min(7vw, 14svh), 8.4rem); }

.hero h1 span { display: inline-block; }

.subtitulo {
  max-width: 32ch;
  font-size: clamp(1.15rem, 1.5vw, 1.5rem);
  font-weight: 650;
  line-height: 1.35;
}

.chamada {
  max-width: 36ch;
  font-size: clamp(1.15rem, 1.45vw, 1.6rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--tinta);
}

.hero .botao { margin-top: 12px; }

.hero-foto {
  position: absolute;
  right: 0;
  bottom: 0;
  width: var(--r);
  height: var(--r);
  border-top-left-radius: 100%;
  overflow: hidden;
  background: var(--verde);
  transform-origin: 100% 100%;
}

/* Integrantes */
@property --esmaecer {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@keyframes revelar-fim {
  0%, 85% { --esmaecer: 72px; }
  100% { --esmaecer: 0px; }
}

.integrantes {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: 88px var(--margem) 32px;
  overflow: hidden;
  background: var(--verde-claro);
}

.integrantes::before {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: 100% 0;
  background: radial-gradient(circle at 100% 0,
    #b6dfaa 0 180px, transparent 181px 230px,
    #b6dfaa 231px 330px, transparent 331px 400px,
    #b1dca5 401px 540px, transparent 541px 620px,
    #aedaa2 621px 800px, transparent 801px);
}

.integrantes > * { position: relative; }

.integrantes h2 { font-size: clamp(2.6rem, min(5.4vw, 10svh), 6rem); }

.integrantes ul {
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-content: center;
  align-items: start;
  column-gap: clamp(28px, 2.2vw, 44px);
  margin-top: 28px;
  padding: 12px;
}

.integrantes li {
  --forma: 500px 500px 0 0; /* arco */
  --onda: 0;
  min-width: 0;
  margin-top: calc(var(--onda) * min(13svh, 120px));
}

.integrantes li:nth-child(4n + 2) { /* folha */
  --forma: 0 70% 0 70% / 0 35% 0 35%;
  --onda: .5;
}

.integrantes li:nth-child(4n + 3) { /* cápsula */
  --forma: 500px;
  --onda: 1;
}

.integrantes li:nth-child(4n) { /* folha invertida */
  --forma: 70% 0 70% 0 / 35% 0 35% 0;
  --onda: .5;
}

.retrato {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 4 / 9;
  max-height: 52svh;
  margin-bottom: 26px;
  border-radius: var(--forma);
  overflow: hidden;
  background: var(--verde);
  box-shadow: 0 0 0 4px var(--verde-claro), 0 0 0 7px var(--verde-vivo), 0 0 0 12px #c6e8ba;
  transition: box-shadow .35s, translate .5s var(--suaviza);
}

.retrato:empty::before {
  content: attr(data-iniciais) / "";
  place-self: center;
  font: 700 clamp(2.2rem, 3.4vw, 4.4rem)/1 var(--titulo);
  letter-spacing: -.04em;
  color: var(--verde-claro);
}

.retrato img {
  position: absolute;
  inset: 0;
  transition: scale .7s var(--suaviza);
}

.integrantes li:hover .retrato {
  translate: 0 -8px;
  box-shadow: 0 0 0 2px var(--verde-claro), 0 0 0 7px var(--verde), 0 0 0 12px var(--menta);
}

.integrantes li:hover img { scale: 1.06; }

.integrantes h3 {
  font-size: clamp(1rem, 1.25vw, 1.7rem);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.ingresso {
  margin-top: 4px;
  font-size: clamp(.95rem, 1vw, 1.3rem);
  line-height: 1.45;
  white-space: nowrap;
  color: #1c3a29;
}

/* Demandante */
@property --abertura {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

.demandante {
  --r: min(47vw, 100svh - 150px);
  --raio: calc(var(--r) * var(--abertura));
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  min-height: 100svh;
  padding: 120px var(--margem) calc(var(--base) + clamp(28px, 6svh, 60px) + 2.76rem);
  overflow: hidden;
  text-align: center;
  background: radial-gradient(circle at 50% 100%,
    var(--menta) var(--raio),
    var(--verde) calc(var(--raio) + 1px) calc(var(--raio) + 20px),
    var(--verde-vivo) calc(var(--raio) + 21px) calc(var(--raio) + 35px),
    var(--verde) calc(var(--raio) + 36px) calc(var(--raio) + 68px),
    #1d6b3e calc(var(--raio) + 69px) calc(var(--raio) + 111px),
    var(--verde) calc(var(--raio) + 112px) calc(var(--raio) + 150px),
    #175d35 calc(var(--raio) + 151px) calc(var(--raio) + 221px),
    var(--verde) calc(var(--raio) + 222px) calc(var(--raio) + 270px),
    #125330 calc(var(--raio) + 271px) calc(var(--raio) + 381px),
    var(--verde) calc(var(--raio) + 382px));
}

.portal {
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2svh, 20px);
}

.rotulo {
  font-weight: 650;
  color: #1b6a31;
}

.demandante h2 { font-size: clamp(2.7rem, min(6.6vw, 12svh), 7.6rem); }

.resumo {
  max-width: 54ch;
  font-size: clamp(1.02rem, 1.15vw, 1.2rem);
  line-height: 1.5;
  text-wrap: balance;
}

.portal .botao { margin-top: 8px; }

/* Rodapé */
.rodape {
  position: absolute;
  inset: auto var(--margem) var(--base);
  text-align: center;
  font-size: .95rem;
  line-height: 1.45;
  color: #2f5a40;
}

/* Telas menores */
@media (max-width: 1180px) {
  .integrantes ul {
    grid-auto-columns: clamp(128px, 17vw, 170px);
    margin-inline: calc(-1 * var(--margem));
    padding: 12px var(--margem) 20px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: var(--margem);
  }

  @supports (animation-timeline: scroll()) {
    .integrantes ul {
      mask-image: linear-gradient(to left, transparent, #000 var(--esmaecer));
      animation: revelar-fim linear both;
      animation-timeline: scroll(self inline);
    }
  }

  .integrantes li { scroll-snap-align: start; }
}

@media (max-width: 800px) {
  .hero {
    --r: min(82vw, 60svh);
    display: block;
    padding: 96px var(--margem) calc(var(--r) + 60px);
  }

  .hero-texto {
    gap: 16px;
    width: auto;
  }

  .hero h1 { font-size: clamp(2.9rem, 14vw, 5.6rem); }

  .chamada {
    font-size: 1.0625rem;
    line-height: 1.4;
  }

  .demandante { --r: min(128vw, 100svh - 150px); }

  .rodape { font-size: .88rem; }
}

/* Animações */
@keyframes surgir { from { opacity: 0; transform: translateY(36px); } }
@keyframes descer { from { opacity: 0; transform: translateY(-20px); } }
@keyframes crescer { from { transform: scale(.55); } }
@keyframes espalhar { from { opacity: 0; transform: scale(.5); } }
@keyframes respirar { to { transform: scale(1.035); } }
@keyframes subir { to { transform: translateY(-70px); } }
@keyframes aproximar { to { transform: scale(1.18); } }

/* .anima é adicionada por js/site.js */
@media (prefers-reduced-motion: no-preference) {
  .topo { animation: descer 1s var(--suaviza) .2s backwards; }
  .hero-foto { animation: crescer 1.3s var(--suaviza) backwards; }

  .ondas {
    animation:
      espalhar 1.6s var(--suaviza) .1s backwards,
      respirar 5s ease-in-out 1.8s infinite alternate;
  }

  .hero h1 span,
  .hero-texto > :not(h1) { animation: surgir 1s var(--suaviza) var(--atraso, .15s) backwards; }

  .hero h1 span:nth-child(2) { --atraso: .25s; }
  .hero h1 span:nth-child(3) { --atraso: .35s; }
  .subtitulo { --atraso: .45s; }
  .chamada { --atraso: .55s; }
  .hero .botao { --atraso: .65s; }

  .anima :is(.integrantes, .demandante):not(.visivel) :is(h2, li, .portal > *),
  .anima main:has(.demandante:not(.visivel)) + .rodape {
    opacity: 0;
    transform: translateY(44px);
  }

  .anima .integrantes:not(.visivel)::before { transform: scale(.4); }
  .anima .demandante:not(.visivel) { --abertura: .55; }

  .anima .integrantes::before { transition: transform 1.8s var(--suaviza); }
  .anima .demandante { transition: --abertura 1.5s var(--suaviza); }

  .anima :is(.integrantes h2, .integrantes li, .portal > *, .rodape) {
    transition: opacity .8s var(--atraso, 0s), transform 1s var(--suaviza) var(--atraso, 0s);
  }

  .anima .portal > .botao {
    transition:
      opacity .8s var(--atraso), transform 1s var(--suaviza) var(--atraso),
      background .25s, translate .35s var(--suaviza), scale .35s var(--suaviza);
  }

  .anima .integrantes li { --atraso: calc(.1s + var(--ordem, 0) * .07s); }

  .anima .rotulo { --atraso: .35s; }
  .anima .demandante h2 { --atraso: .43s; }
  .anima .resumo { --atraso: .51s; }
  .anima .portal .botao { --atraso: .59s; }
  .anima .rodape { --atraso: .7s; }

  @supports (animation-timeline: scroll()) {
    .hero-texto,
    .hero-foto img {
      animation: subir linear both;
      animation-timeline: scroll(root);
      animation-range: 0 100svh;
    }

    .hero-foto img {
      animation-name: aproximar;
      transform-origin: 60% 70%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
