@import "./fonts.css";
@import "./tokens.css";

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cover-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--wine); outline-offset: 3px; border-radius: 4px; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
html.modal-open { overflow: hidden; }

/* Skip link */
.skip-link {
  position: absolute; left: 0; top: -100%;
  background: var(--mustard); color: var(--ink);
  padding: .7rem 1.1rem; z-index: 1000; font-weight: 700;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ============================================================
   Section scaffolding — texto sempre em coluna central
   ============================================================ */
.section {
  position: relative;
  padding: var(--section-pad) var(--gutter);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
/* coluna central única de leitura (como o manifesto) */
.section__inner {
  width: min(100%, var(--measure));
  margin-inline: auto;
  position: relative;
  z-index: 2;
}
.section__inner--wide { width: min(100%, 76rem); }
.kicker {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: var(--step--1);
  color: var(--wine);
  margin: 0 0 1.4rem;
}
p { margin: 0 0 1.15em; }

/* Decoratives — elementos grandes que interagem com as bordas */
.decor {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: .9;
  will-change: transform;
}
.decor--soft { opacity: .6; }

/* ============================================================
   Reveal system
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--reveal-dur) var(--ease-out),
              transform var(--reveal-dur) var(--ease-out);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }
.reveal[data-delay="5"] { transition-delay: .40s; }

/* ============================================================
   01 — Capa (a partir do poster "Como Sobreviver")
   ============================================================ */
.cover {
  background: var(--cover-bg);
  padding: 0;
}
.cover__art {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: center top;
  will-change: transform;
}
.cover__logo {
  position: absolute; z-index: 2;
  left: clamp(1.25rem, 6vw, 6rem);
  bottom: clamp(3.5rem, 12vh, 8rem);
  width: min(72vw, 40rem);
  filter: drop-shadow(0 6px 24px rgba(0,0,0,.35));
}
.cover__scroll {
  position: absolute; bottom: clamp(1.2rem, 4vh, 2.4rem); left: 50%; translate: -50%;
  z-index: 3; font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .35em; font-size: var(--step--1); color: var(--cream);
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.cover__scroll::after {
  content: ""; width: 1px; height: 2.4rem;
  background: linear-gradient(var(--cream), transparent);
  animation: scrollPulse 1.8s var(--ease-out) infinite;
}
@keyframes scrollPulse { 0%{ transform: scaleY(.3); transform-origin: top; opacity:.3 } 50%{ transform: scaleY(1); opacity:1 } 100%{ transform: scaleY(.3); transform-origin: bottom; opacity:.3 } }

/* ============================================================
   02 — Manifesto (COLORIDO — sálvia)
   ============================================================ */
.manifesto { background: var(--sage); color: var(--ink); }
.manifesto__body p { font-size: var(--step-1); line-height: 1.5; color: var(--ink); }
.manifesto__closing {
  font-family: var(--font-head); font-weight: 800;
  font-size: var(--step-3); line-height: 1.05;
  color: var(--wine); margin-top: 1rem;
}

/* ============================================================
   Blocos de vídeo (off-white)
   ============================================================ */
.cinema {
  background: var(--paper-matte);
  padding: clamp(2.5rem, 8vh, 6rem) var(--gutter);
  min-height: 100vh;
  display: grid; place-items: center;
}
.cinema__frame {
  position: relative; width: min(100%, 80rem);
  aspect-ratio: 16/9; background: #000;
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 30px 80px -34px rgba(0,0,0,.55);
}
.cinema__frame video { width: 100%; height: 100%; object-fit: contain; display: block; background:#000; }
.cinema__poster {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: opacity .6s var(--ease-out); z-index: 1;
}
.cinema.is-playing .cinema__poster { opacity: 0; pointer-events: none; }
.cinema__iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 3; }
.cinema__frame.is-playing .cinema__poster,
.cinema__frame.is-playing .cinema__play { opacity: 0; pointer-events: none; }
.cinema__unmute {
  position: absolute; right: clamp(1rem,3vw,1.6rem); top: clamp(1rem,3vw,1.6rem); z-index: 4;
  display: none; align-items: center; gap: .5rem;
  padding: .55rem .9rem; border-radius: 999px; cursor: pointer;
  background: rgba(0,0,0,.6); border: 1px solid rgba(239,233,218,.55); color: var(--cream);
  font: 600 var(--step--1)/1 var(--font-sans); backdrop-filter: blur(2px);
}
.cinema.is-playing.is-muted .cinema__unmute { display: inline-flex; }
.cinema__unmute svg { width: 18px; height: 18px; }

/* ============================================================
   03 — Diário da diretora (off-white)
   ============================================================ */
.diary { background: var(--paper-matte); color: var(--ink); }
.diary__head { text-align: center; margin-bottom: clamp(2rem,6vh,4rem); }
.diary__title {
  font-family: var(--font-head); font-weight: 800;
  font-size: var(--step-4); line-height: .95; color: var(--wine);
  text-transform: lowercase; letter-spacing: -.01em;
}
.diary__title span { display: block; color: var(--ink); }
.diary__body p { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.62; color: var(--ink); }
.diary__photo {
  float: left; width: min(40%, 13rem); margin: .4rem 1.6rem 1rem 0;
  shape-outside: margin-box;
}
.diary__photo img {
  width: 100%; border-radius: 3px;
  box-shadow: 0 14px 36px -18px rgba(0,0,0,.5); border: 4px solid #fff;
}
.diary__photo figcaption {
  font-family: var(--font-display); font-size: var(--step--1);
  color: var(--wine); margin-top: .5rem; letter-spacing: .02em;
}
@media (max-width: 600px) { .diary__photo { float: none; width: 70%; margin: 0 auto 1.5rem; } }
.diary__body p:first-of-type::first-letter {
  font-family: var(--font-head); font-weight: 800; font-size: 3.2em; float: left;
  line-height: .72; padding: .04em .1em 0 0; color: var(--wine);
}

/* ============================================================
   04 — Colagem Biomas (COLORIDO — verde)
   ============================================================ */
.biomes { background: var(--green-forest); color: var(--cream); }
.biomes__stage { width: min(100%, 62rem); margin-inline: auto; }
.biomes__lines {
  text-align: center; margin: 0 auto clamp(1.4rem,4vh,2.4rem);
  font-family: var(--font-head); font-weight: 700;
}
.biomes__lines p { font-size: var(--step-2); line-height: 1.08; color: var(--cream); margin: .08em 0; }
.biomes__lines--alt { color: var(--mustard); }
/* as 4 imagens de drone se encostam (sem espaço), agrupadas numa tela */
.biomes__drone {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 26px 70px -30px rgba(0,0,0,.9);
}
.biomes__drone img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }

/* ============================================================
   05 — Mutirão (off-white, coluna única)
   ============================================================ */
.mutirao { background: var(--paper-matte); color: var(--ink); justify-content: flex-start; }
.mutirao .section__inner { padding-top: clamp(2rem, 7vh, 5rem); }
/* ilustração de cactos/folhas/pedras — no rodapé, como transição p/ a próxima
   tela; sangra na borda inferior, sem ficar atrás do texto. */
.mutirao__illo {
  width: min(58vw, 660px); left: -2%; bottom: -5%; right: auto; top: auto;
  opacity: 1; z-index: 1;
}
@media (max-width: 760px) { .mutirao__illo { width: 96vw; left: -8%; bottom: -2%; opacity: .6; } }
.mutirao__headline {
  font-family: var(--font-head); font-weight: 700;
  font-size: var(--step-3); line-height: 1.04;
  color: var(--wine); margin: 0 0 clamp(2rem,5vh,3.5rem);
}
.mutirao__headline em { color: var(--ink); font-style: normal; }
.mutirao__body p { font-size: var(--step-0); color: var(--ink); }

/* ============================================================
   06 — 11 artistas + trilha de formigas (off-white, coluna única)
   ============================================================ */
.artists { background: var(--paper-matte); color: var(--ink); min-height: 130vh; }
.artists__headline {
  font-family: var(--font-head); font-weight: 700; font-size: var(--step-3); line-height: 1.08;
  color: var(--wine); margin: 0 0 clamp(2rem,5vh,3.5rem); text-align: left;
}
.artists__headline span { color: var(--ink); }
.artists__body p { color: var(--ink); }
/* trilha de formigas carregando folhas — faixa larga, sangra nas laterais */
.ant-trail {
  position: relative; width: 100%; margin: clamp(2.5rem,7vh,5rem) 0 0;
  overflow: visible; z-index: 2;
}
.ant-trail__img {
  width: min(112%, 1500px); max-width: none; margin-inline: auto; display: block;
  will-change: transform;
}

/* ============================================================
   07 — Colagem "failed" (off-white, artes originais)
   ============================================================ */
.failed { background: var(--paper-matte); color: var(--ink); }
.failed__stage { position: relative; width: min(100%, 52rem); margin-inline: auto; }
/* arte pronta da colagem "failed" */
.failed__art { margin: 0 auto; width: min(100%, 33rem); }
.failed__art img { width: 100%; height: auto; display: block; }

/* imagem da enchente (com estojo sobreposto) flutua à direita; o texto contorna */
.failed__compose { position: relative; }
.failed__media {
  float: right; width: min(58%, 27rem);
  margin: 3.5rem 0 1rem 1.6rem; position: relative;
  shape-outside: margin-box;
}
/* o fichário é o DESTAQUE da colagem — imagem grande em primeiro plano */
.failed__media .case {
  position: relative; z-index: 2; width: 100%; border-radius: 4px;
  transform: rotate(-3deg);
  box-shadow: 0 22px 50px -22px rgba(0,0,0,.55);
}
/* a enchente entra como acento, atrás do fichário, espiando no topo */
.failed__media .flood {
  position: absolute; z-index: 1; top: -26%; right: -16%; width: 74%;
  border-radius: 4px; filter: grayscale(.45) contrast(1.06);
  box-shadow: 0 16px 40px -22px rgba(0,0,0,.5);
}
.failed__text { font-family: var(--font-serif); font-size: var(--step-1); line-height: 1.55; }
.failed__text p { margin: 0 0 .35em; }
.failed__text .em { font-style: italic; }
/* palavra "failed" caindo letra a letra, contornando a imagem */
.failed__word { margin: .3rem 0 .4rem; }
.failed__word .ltr {
  display: block; font-family: var(--font-head); font-weight: 700;
  font-size: var(--step-2); line-height: .98; color: var(--wine);
  will-change: transform;
}
.failed__word .ltr:nth-child(1){ margin-left: 0; }
.failed__word .ltr:nth-child(2){ margin-left: 2ch; }
.failed__word .ltr:nth-child(3){ margin-left: 4ch; }
.failed__word .ltr:nth-child(4){ margin-left: 6ch; }
.failed__word .ltr:nth-child(5){ margin-left: 8ch; }
.failed__word .ltr:nth-child(6){ margin-left: 10ch; }
.failed__year { margin-top: .4rem; }

.failed__lower {
  display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(1rem,4vw,3rem);
  align-items: center; margin-top: clamp(3rem,9vh,6rem); clear: both;
}
.failed__delete img { width: 100%; }
.failed__river p {
  font-family: var(--font-serif); font-style: italic; font-size: var(--step-2);
  line-height: 1.2; color: var(--ink); margin: 0;
}
.failed__river p:nth-child(2){ margin-left: 2ch; }
.failed__river p:nth-child(3){ margin-left: 4ch; }
.failed__river p:nth-child(4){ margin-left: 6ch; color: var(--wine); }
@media (max-width: 720px) {
  .failed__media { float: none; width: 80%; margin: 1.5rem auto; }
  .failed__lower { grid-template-columns: 1fr; }
}

/* ============================================================
   08 — Colagem fotos (off-white)
   ============================================================ */
.photos { background: var(--paper-matte); color: var(--ink); }
.photos__grid {
  display: grid; grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: clamp(70px, 9vw, 120px); gap: clamp(.5rem,1.5vw,1rem);
  width: min(100%, 76rem); margin-inline: auto;
}
.photos__cell { overflow: hidden; border-radius: 6px; will-change: transform; box-shadow: 0 10px 30px -18px rgba(0,0,0,.4); }
.photos__cell img { width: 100%; height: 100%; object-fit: cover; }
.photos__caption {
  text-align: center; font-family: var(--font-head); font-weight: 700;
  font-size: var(--step-2); color: var(--wine); margin-top: clamp(2rem,5vh,3rem);
}

/* ============================================================
   09 — Contracapa: cogumelo + perguntas + CTAs (COLORIDO — vinho)
   ============================================================ */
.closing {
  background:
    linear-gradient(rgba(63,14,24,.55), rgba(63,14,24,.85)),
    var(--wine-deep);
  color: var(--cream);
  text-align: center;
  border-top: clamp(8px,2vw,18px) solid var(--wine);
  min-height: 130vh;
}
.closing .kicker { color: var(--mustard); }
.closing__mushroom {
  position: absolute; z-index: 0; inset: 0;
  background: center/cover no-repeat;
  opacity: .28; mix-blend-mode: luminosity;
}
.closing__questions { position: relative; z-index: 2; max-width: 50rem; margin: 0 auto clamp(2.5rem,7vh,5rem); }
.closing__q {
  font-family: var(--font-serif); font-weight: 700; font-style: normal;
  font-size: var(--step-2); line-height: 1.18; color: var(--cream); margin: .7em 0;
}
.closing__q:nth-child(odd) { color: var(--mustard); }

/* CTA trio */
.ctas {
  position: relative; z-index: 3;
  display: grid; gap: clamp(1rem,2.5vw,1.6rem);
  grid-template-columns: repeat(3, 1fr);
  max-width: 60rem; margin: 0 auto;
}
.cta {
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
  padding: clamp(1.5rem,3vw,2.4rem) 1.2rem;
  background: rgba(239,233,218,.06);
  border: 1.5px solid rgba(239,233,218,.35);
  border-radius: var(--radius);
  color: var(--cream); font-family: var(--font-sans); font-weight: 600;
  font-size: var(--step-0); text-align: center; cursor: pointer;
  text-decoration: none; transition: transform .25s var(--ease-out), background .25s, border-color .25s;
}
.cta:hover, .cta:focus-visible { transform: translateY(-4px); background: var(--wine); border-color: var(--cream); }
.cta__icon { width: clamp(40px,6vw,56px); height: clamp(40px,6vw,56px); color: var(--mustard); }
.cta:hover .cta__icon, .cta:focus-visible .cta__icon { color: var(--cream); }

/* ============================================================
   10 — Créditos do filme (off-white, ao final; 2 colunas permitidas)
   ============================================================ */
.credits-section { background: var(--paper-matte); color: var(--ink); padding: clamp(3rem,9vh,7rem) var(--gutter); }
.credits-section .kicker { text-align: center; }
.credits__presented { text-align: center; font-weight: 700; color: var(--wine); font-size: var(--step-1); margin: 0 auto clamp(1.5rem,4vh,2.5rem); max-width: 40rem; }
.credits__list {
  max-width: 60rem; margin-inline: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: .6rem clamp(2rem,5vw,4rem);
}
.credits__row { break-inside: avoid; padding: .5rem 0; border-bottom: 1px solid rgba(34,28,21,.12); display: flex; flex-direction: column; gap: .15rem; }
.credits__role { font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.credits__name { font-weight: 700; color: var(--ink); }
@media (max-width: 640px) { .credits__list { grid-template-columns: 1fr; } }

/* ============================================================
   Modals
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 1.2rem;
  background: rgba(20,10,14,.7); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal__panel {
  width: min(100%, 34rem); max-height: 90vh; overflow: auto;
  background: var(--cream); color: var(--ink); border-radius: var(--radius);
  padding: clamp(1.5rem,4vw,2.6rem); position: relative;
  transform: translateY(16px) scale(.98); transition: transform .3s var(--ease-out);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6);
}
.modal.is-open .modal__panel { transform: none; }
.modal__close {
  position: absolute; top: .8rem; right: .8rem; width: 40px; height: 40px;
  border-radius: 50%; border: 0; background: transparent; cursor: pointer;
  font-size: 1.5rem; color: var(--ink); line-height: 1;
}
.modal__close:hover { background: rgba(0,0,0,.06); }
.modal h2 { font-family: var(--font-head); font-weight: 800; color: var(--wine); font-size: var(--step-2); margin: 0 0 .4rem; }
.modal__intro { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 1.4rem; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 700; font-size: var(--step--1); }
.field input, .field textarea {
  font: inherit; padding: .7rem .8rem; border: 1.5px solid rgba(26,20,16,.3);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--wine); outline: none; }
.field textarea { min-height: 7rem; resize: vertical; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field .error { color: var(--red-vivid); font-size: var(--step--1); min-height: 1.1em; }
.btn-submit {
  width: 100%; padding: .9rem 1rem; border: 0; border-radius: 8px;
  background: var(--wine); color: var(--cream); font: inherit; font-weight: 700;
  cursor: pointer; transition: background .2s;
}
.btn-submit:hover { background: var(--wine-deep); }
.btn-submit[disabled] { opacity: .6; cursor: wait; }
.form-success { text-align: center; padding: 1rem 0; }
.form-success svg { width: 56px; height: 56px; color: var(--grass); margin: 0 auto 1rem; }
.form-success p { font-size: var(--step-1); color: var(--ink); }
[hidden] { display: none !important; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--cover-bg); color: rgba(239,233,218,.75);
  text-align: center; padding: clamp(2rem,6vh,4rem) var(--gutter);
  font-size: var(--step--1); letter-spacing: .06em;
}
.site-footer strong { color: var(--cream); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 760px) {
  .ctas { grid-template-columns: 1fr; }
  .field--row { grid-template-columns: 1fr; }
  .section { min-height: auto; }
  .cinema, .closing, .biomes, .artists, .failed { min-height: auto; }
  /* a capa tem conteúdo absoluto — preenche a tela toda do celular */
  .cover { min-height: 100vh; min-height: 100dvh; }
  /* fotos do final: empilhar mantendo o ratio (sem distorcer no celular) */
  .photos__grid { display: flex; flex-direction: column; gap: .8rem; }
  .photos__cell { width: 100%; height: auto; aspect-ratio: auto; }
  .photos__cell img { height: auto; aspect-ratio: auto; }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .cover__scroll::after { animation: none; }
  * { scroll-behavior: auto !important; }
}
html.no-anim .reveal { opacity: 1; transform: none; }
