/* =========================================================================
   Esqueleto comum dos mundos das obras.
   Cada mundo redefine as variáveis --m-* e o estilo do fio (--thread).
   A estrutura se repete (abertura, logline, história, mundo, equipe, tese,
   ficha, próxima obra): é isso que faz o conjunto conversar.
   ========================================================================= */

body.world {
  background: var(--w-bg);
  color: var(--w-ink);
  font-family: var(--w-body);
  --focus: var(--w-accent);
}
.world .site-header { color: var(--w-ink); background: linear-gradient(to bottom, color-mix(in srgb, var(--w-bg) 80%, transparent), transparent); }
.world .site-header .brand b, .world .site-header .brand span { font-family: var(--font-fund); }
.world .site-header .btn--solid { background: var(--w-ink); color: var(--w-bg); border-color: var(--w-ink); }
.world .toggle[aria-pressed="true"] span, .world .toggle[aria-pressed="true"] svg { color: var(--w-bg); }
.back-link { font-family: var(--font-fund); font-size: .85rem; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; opacity: .85; }
.back-link:hover { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }

.w-section { position: relative; padding: clamp(96px, 12vw, 170px) var(--gutter) clamp(80px, 10vw, 140px) calc(var(--gutter) + var(--rail)); }
.w-wrap { max-width: 1280px; margin: 0 auto; }
.w-text { max-width: 62ch; }

/* Abertura */
.w-opening { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; padding: 120px var(--gutter) 9vh calc(var(--gutter) + var(--rail)); isolation: isolate; }
.w-opening__background { position: absolute; inset: 0; z-index: -2; }
.w-opening__background img { width: 100%; height: 100%; object-fit: cover; }
.w-opening canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* Logline */
.w-logline p { font-size: clamp(1.7rem, 3.6vw, 3.1rem); line-height: 1.18; max-width: 26ch; margin: 0; text-wrap: balance; }

/* Capítulos da história */
.w-chapters { display: grid; gap: clamp(90px, 14vw, 180px); counter-reset: chapter; }
.w-chapter { display: grid; gap: 22px; align-items: center; }
@media (min-width: 1000px) {
  .w-chapter { grid-template-columns: 1.55fr 1fr; gap: 48px; }
  .w-chapter:nth-child(even) .w-chapter__frame { order: 2; }
}
.w-chapter__frame { position: relative; overflow: hidden; }
.w-chapter__frame img { width: 100%; height: 100%; object-fit: cover; }
.w-chapter h3 { margin: 0 0 12px; }
.w-chapter p { margin: 0 0 12px; max-width: 46ch; }

/* Legendas que entram uma a uma com a rolagem */
.w-subtitles { display: grid; gap: 26px; }
.w-subtitles p { margin: 0; opacity: .14; transition: opacity .6s var(--ease); }
.w-subtitles p.is-spoken { opacity: 1; }
html.reduced-motion .w-subtitles p { opacity: 1; }

/* Equipe */
.w-team { display: grid; gap: 28px; }
@media (min-width: 900px) { .w-team { grid-template-columns: repeat(3, 1fr); } }
.w-team dt { font-size: .82rem; opacity: .65; margin-bottom: 4px; }
.w-team dd { margin: 0; font-size: var(--s-1); }

/* Tese: por que esta obra */
.w-thesis { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 22px; }
@media (min-width: 900px) { .w-thesis { grid-template-columns: repeat(3, 1fr); } }
.w-thesis li { border-top: 1px solid color-mix(in srgb, var(--w-ink) 30%, transparent); padding-top: 14px; }
.w-thesis b { display: block; margin-bottom: 6px; }

/* Ficha */
.w-sheet { display: grid; gap: 0; margin: 28px 0 0; border-top: 1px solid color-mix(in srgb, var(--w-ink) 30%, transparent); }
.w-sheet div { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 20px; padding: 14px 0; border-bottom: 1px solid color-mix(in srgb, var(--w-ink) 30%, transparent); }
.w-sheet dt { opacity: .7; }
.w-sheet dd { margin: 0; }
.is-pending { opacity: .6; font-style: italic; }

/* Próxima obra */
.w-next { display: block; position: relative; text-decoration: none; color: #fff; overflow: hidden; }
.w-next img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); filter: brightness(.7); }
.w-next:hover img, .w-next:focus-visible img { transform: scale(1.04); }
.w-next__text { position: absolute; left: 4%; bottom: 10%; right: 4%; }
.w-next__label { font-family: var(--font-fund); font-size: .9rem; opacity: .85; display: block; margin-bottom: 10px; }

/* Nota de fonte e de pendência */
.w-note { font-size: .8rem; opacity: .68; max-width: 72ch; margin-top: 18px; }

/* Transição entre mundos: véu na cor do destino */
.veil { position: fixed; inset: 0; z-index: 90; pointer-events: none; background: var(--veil, #000); clip-path: circle(0 at var(--vx, 50%) var(--vy, 50%)); transition: clip-path .75s cubic-bezier(.7, 0, .2, 1); }
.veil.is-active { clip-path: circle(150% at var(--vx, 50%) var(--vy, 50%)); }
.arrival { position: fixed; inset: 0; z-index: 89; pointer-events: none; background: var(--w-bg); animation: arrival-fade 1s .1s var(--ease) forwards; }
@keyframes arrival-fade { to { opacity: 0; visibility: hidden; } }
html.reduced-motion .veil, html.reduced-motion .arrival { display: none; }

/* Vídeo em loop por cima da foto da abertura: a foto fica como quadro inicial */
.w-ambient { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.2s var(--ease); }
.w-ambient.is-ready { opacity: 1; }
html.reduced-motion .w-ambient { display: none; }

/* Ouvir a obra: narração curta */
.w-listen { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 10px 16px 10px 12px; border: 1px solid currentColor; border-radius: 999px; background: color-mix(in srgb, #000 35%, transparent); color: inherit; font: 600 .9rem/1 var(--font-fund); cursor: pointer; backdrop-filter: blur(6px); }
.w-listen svg { width: 18px; height: 18px; }
.w-listen[aria-pressed="true"] { background: currentColor; }
.w-listen[aria-pressed="true"] .label, .w-listen[aria-pressed="true"] svg { color: #000; }
.w-listen__bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.w-listen__bars i { width: 3px; height: 30%; background: currentColor; border-radius: 1px; }
.w-listen[aria-pressed="true"] .w-listen__bars i { background: #000; animation: w-listen-bars .9s ease-in-out infinite; }
.w-listen[aria-pressed="true"] .w-listen__bars i:nth-child(2) { animation-delay: .15s; }
.w-listen[aria-pressed="true"] .w-listen__bars i:nth-child(3) { animation-delay: .3s; }
@keyframes w-listen-bars { 50% { height: 100%; } }

/* Entradas com a rolagem (initReveals em world.js) */
/* a transição fica só na entrada: ao receber a classe, o item some sem animar */
.w-reveal { opacity: 0; transform: translateY(28px); }
.w-reveal.is-in { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--reveal-delay, 0s); }
html.reduced-motion .w-reveal { opacity: 1; transform: none; transition: none; }

/* Filme guiado pela rolagem */
.w-film { position: relative; height: 320vh; background: #000; color: #fff; }
.w-film__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.w-film__video, .w-film__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.w-film__stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0) 45%), radial-gradient(120% 90% at 50% 45%, rgba(0,0,0,0) 60%, rgba(0,0,0,.45)); }
.w-film__caption { position: absolute; z-index: 1; left: calc(var(--gutter) + var(--rail)); right: var(--gutter); bottom: 11vh; max-width: 30ch; margin: 0; font-size: clamp(1.5rem, 3.4vw, 2.8rem); line-height: 1.15; text-wrap: balance; opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .9s var(--ease); text-shadow: 0 2px 24px rgba(0,0,0,.6); }
.w-film__caption.is-visible { opacity: 1; transform: none; }
.w-film__credit { position: absolute; z-index: 1; right: var(--gutter); bottom: 22px; margin: 0; font: .72rem/1.3 var(--font-fund); opacity: .6; }
html.reduced-motion .w-film { height: auto; }
html.reduced-motion .w-film__stage { position: relative; height: 80svh; }
html.reduced-motion .w-film__video { display: none; }
html.reduced-motion .w-film__caption { position: absolute; }
html.reduced-motion .w-film__caption + .w-film__caption { display: none; }

/* Cena em loop, de ponta a ponta */
.w-scene { position: relative; height: 92vh; height: 92svh; overflow: hidden; display: grid; align-items: end; background: #000; }
.w-scene__poster, .w-scene .w-ambient { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.w-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0) 50%); }
.w-scene__caption { position: relative; z-index: 1; margin: 0; padding: 0 var(--gutter) 9vh calc(var(--gutter) + var(--rail)); max-width: 34ch; font-size: clamp(1.4rem, 3vw, 2.4rem); line-height: 1.2; color: #fff; text-wrap: balance; }
