/* Archivo servida pelo próprio site: sem a ida e volta ao Google antes do primeiro quadro.
   O itálico (só dos bilhetes à mão) chega depois do carregamento, pelo cenas.js. */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 300 900; font-stretch: 62% 125%; font-display: swap; src: url('../assets/fonts/archivo-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 300 900; font-stretch: 62% 125%; font-display: swap; src: url('../assets/fonts/archivo-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Versão 1 · Contagem. Uma página só, contada pela rolagem: primeiro a pele e o
   conteúdo das cenas, depois a rolagem que as prende na tela e as empilha. */

:root {
  --room: #0b0b0a;
  --room-line: #2a2a27;
  --room-text: #d6d5d0;
  --room-dim: #8f8e89;
  --leader: #8e8c87;
  --leader-deep: #777570;
  --light: #ededea;
  --ink: #111110;
  --ink-2: #474643;
  --ink-3: #64635f;
  --reel: #040404;
  --tungsten: #ffa64d;

  --mt: clamp(40px, 5.2vh, 52px);
  --mb: clamp(44px, 5.6vh, 56px);
  --mx: clamp(10px, 2vw, 28px);
  --r: clamp(10px, 1.5vmin, 20px);
  --wdth: 125%;

  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

@media (max-width: 720px) {
  :root { --mt: 48px; --mb: 58px; --mx: 8px; }
}
@media (max-height: 460px) {
  :root { --mt: 38px; --mb: 42px; }
}

html, body { background: var(--room); color: var(--room-text); }
body {
  font-family: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--tungsten); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; border-radius: 2px; }
.graph-handle:focus-visible { outline: none; }

/* ---------- Quadros ----------
   O quadro ocupa a cena inteira: a barra de cima e a de baixo passam por cima
   dele, e o conteúdo guarda a distância delas (--mt, --mb). */

.frame {
  position: absolute; inset: 0;
  color: var(--ink);
  overflow: hidden;
  container-type: size;
}
@keyframes expose { 0% { filter: brightness(1.14); } 14% { filter: brightness(0.95); } 30% { filter: brightness(1.06); } 100% { filter: none; } }
@keyframes frame-cue { 0% { opacity: 1; } 22% { opacity: 0; } 44% { opacity: 1; } 66%, 100% { opacity: 0; } }
.frame--credits { background: var(--reel); color: var(--room-text); }

.chapter-title {
  font-weight: 760; font-stretch: max(var(--wdth), 108%);
  font-size: clamp(38px, min(7.2cqw, 13cqh), 96px);
  line-height: 0.94; letter-spacing: -0.02em;
  text-wrap: balance;
}
.chapter-line {
  margin-top: 0.9em;
  font-size: clamp(17px, min(1.7cqw, 3.4cqh), 22px);
  line-height: 1.35; max-width: 24ch; color: var(--ink);
  text-wrap: balance;
}
.chapter-caption {
  margin-top: 0.7em; font-size: 13.5px; line-height: 1.4; color: var(--ink-3); max-width: 32ch;
}

/* ---------- 1 · Título ---------- */

.frame--title {
  --s: 0;
  background: #050505;
  color: var(--light);
}
/* o fundo do canvas é um quadro parado da própria luz (assets/luz-*.webp, o instante em que
   ela começa): aparece no primeiro quadro, antes do script, e o WebGL o cobre ao desenhar.
   Onde a luz não roda (sem WebGL, desenho por software) ele fica, apagando junto com --s */
.title-light {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  background: url('../assets/luz-h.webp') center / 100% 100% no-repeat;
  opacity: 0.4; transition: opacity 1400ms var(--ease-out);
}
@media (max-aspect-ratio: 1/1) { .title-light { background-image: url('../assets/luz-v.webp'); } }
.is-titled .title-light { opacity: 1; }
.no-light.is-titled .title-light { opacity: calc(1 - var(--s) * 0.62); }
.name {
  position: absolute; left: 6cqw; right: 6cqw; top: 50%;
  display: flex; flex-direction: column; align-items: center;
  font-weight: 820; font-stretch: var(--wdth); text-transform: uppercase;
  line-height: 0.8; letter-spacing: -0.012em;
  color: #f4f4f0;
  /* onde a luz passa, o nome inverte */
  mix-blend-mode: difference;
  /* na segunda parada o nome sobe e encolhe até o lugar que o script mede para o bloco todo */
  transform: translateY(calc(-50% + var(--s) * var(--ny, -15cqh))) scale(calc(1 - var(--s) * (1 - var(--nk, 0.58))));
  transform-origin: 50% 50%;
  will-change: transform;
}
.name-line { display: block; width: max-content; white-space: nowrap; font-size: 12cqw; }
.name-line + .name-line { margin-top: 0.06em; }
.name-measure {
  position: fixed; left: -9999px; top: 0; visibility: hidden; pointer-events: none;
  font-size: 100px; font-weight: 820; font-stretch: var(--wdth); text-transform: uppercase;
  letter-spacing: -0.012em; white-space: nowrap; line-height: 1;
}
.name-line .ch { display: inline-block; clip-path: inset(100% 0 -10% 0); }
/* com script, o nome cru (antes de ser dividido em letras e medido) não aparece */
.js .frame--title:not(.is-split) .name { visibility: hidden; }
.roles-static { display: none; font-size: 0.5em; letter-spacing: 0.02em; }
.motion-off .cells { display: none; }
.motion-off .roles-static { display: inline; }
.is-titled .name-line .ch { clip-path: inset(-10% 0 -10% 0); transition: clip-path 600ms var(--ease-out); }

.title-sub {
  z-index: 1;
  position: absolute; left: 6cqw; right: 6cqw; top: var(--sub-top, 58%);
  text-align: center;
  /* entram só na segunda metade da subida, quando o nome já saiu da frente */
  opacity: clamp(0, (var(--s) - 0.45) / 0.55, 1);
  transform: translateY(calc((1 - var(--s)) * 4cqh));
}
.roles {
  color: var(--light);
  font-weight: 640; font-stretch: 78%; text-transform: uppercase;
  font-size: clamp(22px, min(4.2cqw, 7cqh), 64px); line-height: 1;
  letter-spacing: 0.01em;
}
.cells { display: inline-flex; }
.cell { display: inline-block; width: 0.66em; text-align: center; }
.cell.is-flip { animation: cell-flip 260ms var(--ease-out); }
@keyframes cell-flip {
  0% { transform: translateY(-0.28em); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.lead {
  margin: 0.8em auto 0; max-width: 34ch;
  font-size: clamp(16px, min(1.5cqw, 3cqh), 20px); line-height: 1.4; letter-spacing: 0.005em; color: var(--room-text);
}
/* a caixinha: um quadro pequeno e aceso, solto sobre o título, na letra larga do nome.
   A inclinação e o movimento vêm do script. */
.title-play { position: relative; margin-top: clamp(26px, 5cqh, 48px); line-height: 1; }
.title-box {
  position: relative; display: inline-block; max-width: 100%;
  padding: 0.86em 1.35em 0.9em;
  border-radius: 6px;
  background: var(--light); color: var(--ink);
  font-size: clamp(13px, min(1.05cqw, 2.2cqh), 14.5px); font-weight: 700; font-stretch: clamp(84%, var(--wdth), 116%); line-height: 1.2;
  letter-spacing: 0.01em; text-wrap: balance;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 24px -12px rgba(0, 0, 0, 0.7);
  outline: 1px solid transparent; outline-offset: 0;
  cursor: grab; touch-action: none; pointer-events: none;
  /* camada própria: ela se move quase o tempo todo e as sombras não são repintadas a cada quadro */
  will-change: transform;
  /* é um objeto, não um texto: nada de seleção nem do menu de toque longo */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: box-shadow 260ms var(--ease-out);
}
/* o convite: uma camada de tungstênio por cima do papel acende e apaga em ciclo enquanto
   ninguém mexeu nela; só a opacidade anima, então o navegador não repinta nada.
   Com o mouse em cima ela já fica meio acesa. */
.title-text { position: relative; z-index: 1; }
.title-tint {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--tungsten);
  box-shadow: 0 0 0 1px rgba(255, 200, 140, 0.9), 0 0 30px rgba(255, 166, 77, 0.5);
  opacity: 0; transition: opacity 240ms var(--ease-out);
}
.is-inviting .title-tint { animation: box-tint 2800ms ease-in-out infinite; }
@keyframes box-tint { 0%, 34% { opacity: 0; } 52%, 64% { opacity: 1; } 86%, 100% { opacity: 0; } }
@media (hover: hover) { .title-box:hover .title-tint { animation: none; opacity: 0.7; } }
.is-pulling .title-tint { animation: none; opacity: 1; }
/* no mergulho as setas piscam embaixo dela */
.is-hint .title-drop { opacity: 0.9; }
.is-hint .title-drop path { animation: drop-run 900ms var(--ease-out) 1; }
.is-hint .title-drop path:nth-child(2) { animation-delay: 120ms; }
.is-hint .title-drop path:nth-child(3) { animation-delay: 240ms; }
/* depois de arremessada, volta ao lugar com um pulo */
.title-box.is-back { animation: box-back 560ms var(--ease-out) 1; }
@keyframes box-back { 0% { opacity: 0; scale: 0.6; } 60% { opacity: 1; scale: 1.06; } 100% { scale: 1; } }
.has-sub .title-box { pointer-events: auto; }
.title-box:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.32), 0 16px 30px -12px rgba(0, 0, 0, 0.72); }
.title-box.is-held { cursor: grabbing; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3), 0 28px 44px -16px rgba(0, 0, 0, 0.8); }
/* a marca de troca de rolo no canto: só acende quando a caixinha chama */
.title-box::after {
  content: ''; position: absolute; top: 6px; right: 6px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--tungsten); opacity: 0; pointer-events: none;
}
.title-box.is-cue::after { animation: frame-cue 900ms steps(1) 1; }
/* e um contorno se solta dela, como os anéis das alças na Interação */
.title-box.is-call { animation: box-call 1000ms var(--ease-out) 1; }
/* arrastando, a caixinha acende em tungstênio, três setas descem dela e a zona
   "ARREMESSE" aparece na borda de baixo, onde o capítulo seguinte espera;
   tudo esquenta conforme ela chega perto (--pull) */
.frame--title::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 34cqh; pointer-events: none;
  background: linear-gradient(to top, rgba(255, 166, 77, 0.32), rgba(255, 166, 77, 0) 100%);
  opacity: 0; transition: opacity 400ms var(--ease-out);
}
.frame--title.is-pulling::after { opacity: calc(0.35 + var(--pull, 0) * 0.65); }
.is-pulling .title-box {
  background: var(--tungsten); color: #120b04;
  box-shadow: 0 0 0 1px rgba(255, 200, 140, 0.9), 0 0 34px rgba(255, 166, 77, 0.55), 0 28px 44px -16px rgba(0, 0, 0, 0.8);
  transition: background-color 250ms var(--ease-out), color 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}
.title-drop {
  position: absolute; left: 50%; top: calc(100% + 16px); width: 26px; margin-left: -13px;
  opacity: 0; transition: opacity 300ms var(--ease-out); pointer-events: none;
}
.title-drop svg { width: 100%; height: auto; overflow: visible; fill: none; stroke: var(--tungsten); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(255, 166, 77, 0.9)); }
.is-pulling .title-drop { opacity: 1; }
.title-zone {
  position: absolute; left: 50%; bottom: calc(var(--mb) + 0.6cqh); z-index: 0;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px 12px 16px; border-radius: 999px;
  border: 1.5px dashed rgba(255, 166, 77, 0.85);
  color: #ffd2a3; font-size: clamp(14px, 1.2cqw, 16px); font-weight: 760; font-stretch: 112%; letter-spacing: 0.14em; white-space: nowrap;
  -webkit-user-select: none; user-select: none;
  background: rgba(255, 166, 77, calc(0.08 + var(--pull, 0) * 0.3));
  box-shadow: 0 0 calc(var(--pull, 0) * 40px) rgba(255, 166, 77, 0.6);
  opacity: 0; transform: translate(-50%, 14px); pointer-events: none;
  transition: opacity 300ms var(--ease-out), transform 400ms var(--ease-out);
}
.title-zone svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.is-pulling .title-zone { opacity: 1; transform: translate(-50%, 0); }
.is-pulling .title-zone svg { animation: zone-bob 800ms var(--ease-out) infinite; }
@keyframes zone-bob { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
.is-pulling .title-drop path { animation: drop-run 900ms var(--ease-out) infinite; }
.is-pulling .title-drop path:nth-child(2) { animation-delay: 150ms; }
.is-pulling .title-drop path:nth-child(3) { animation-delay: 300ms; }
@keyframes drop-run { 0% { opacity: 0; transform: translateY(-6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }

/* a assinatura: segue o bloco do nome (sobe e encolhe com ele) e fica ao lado dele.
   Só aparece na segunda fase, junto com os papéis: o traço se risca enquanto eles entram */
.sign {
  position: absolute; left: 6cqw; right: 6cqw; top: 50%; height: var(--nh, 30cqh); z-index: 1;
  transform: translateY(calc(-50% + var(--s) * var(--ny, -15cqh))) scale(calc(1 - var(--s) * (1 - var(--nk, 0.58))));
  transform-origin: 50% 50%; pointer-events: none; will-change: transform;
}
.sign svg {
  position: absolute; left: 100%; top: 50%; height: 50%; width: auto; overflow: visible;
  transform: translate(-2%, -42%) rotate(-8deg); opacity: 0; transition: opacity 300ms var(--ease-out);
}
.sign path { fill: none; stroke: var(--tungsten); stroke-width: 20; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 300ms ease-in; }
.is-signing .sign svg { opacity: 1; transition-duration: 120ms; }
.is-signing .sign path { stroke-dashoffset: 0; transition: stroke-dashoffset 1100ms cubic-bezier(0.45, 0, 0.25, 1); }
/* no retrato as duas linhas ocupam a largura toda: ela assina acima de SAVIO, no canto direito,
   sem tocar nas letras */
@container (max-aspect-ratio: 1/1) {
  .sign svg { left: auto; right: 0; top: auto; bottom: calc(100% + 0.6cqh); height: 34%; transform: rotate(-8deg); }
}

@keyframes box-call {
  0% { outline-color: rgba(237, 237, 234, 0.7); outline-offset: 0; }
  100% { outline-color: rgba(237, 237, 234, 0); outline-offset: 18px; }
}
.title-hint {
  position: absolute; left: 0; right: 0; bottom: calc(var(--mb) + 2cqh);
  text-align: center; font-size: 13px; color: var(--room-text);
  opacity: calc(1 - var(--s) * 4);
  transition: opacity 600ms;
}
.title-hint.is-gone { opacity: 0; }

/* ---------- 2 · Design ---------- */

/* o painel é escuro: a malha clara vaga por trás e o quadro vira vidro.
   Aqui a tinta é clara, então --ink e as irmãs trocam de valor. */
.frame--design {
  --ink: #f1f0ec; --ink-2: #aeada8; --ink-3: #8f8e89;
  /* a mesma grade de pontos da pasta dos trabalhos, por baixo da malha */
  background: #050505 radial-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1.5px) 0 0 / 22px 22px;
}
.frame--design {
  display: grid;
  grid-template-columns: minmax(0, 31cqw) minmax(0, 1fr);
  gap: 4cqw;
  padding: calc(var(--mt) + 4cqh) 5cqw calc(var(--mb) + 3cqh);
}
.design-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-self: center; min-height: 0; margin-left: 3.5cqw; }
/* "Design é" numa linha só, do tamanho da coluna; o D grande recua o que a letra tem de respiro para alinhar com o resto */
.frame--design .chapter-title { white-space: nowrap; margin-left: -0.055em; font-size: clamp(38px, min(6.1cqw, 13cqh), 96px); }
/* a malha (e a grade cinética do fechamento) fica atrás de tudo no painel */
.kgrid, .lattice { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.monitor-area { z-index: 1; }
.formats { display: flex; gap: 18px; margin-top: 2.2em; }
.formats button {
  position: relative; padding: 12px 0 8px; font-size: 13.5px; color: var(--ink-2);
}
.formats button::before {
  content: ''; position: absolute; left: 0; top: 0; height: 0; width: 8px;
  border-top: 1px solid currentColor;
}
.formats button:hover { color: var(--ink); }
.formats button.is-on { color: var(--ink); }
.formats button.is-on::before { width: 100%; border-top-width: 2px; }

/* "Design é o que dá forma ao… caos": a palavra é um quadrado de letras do tamanho do título */
.design-claim { font-size: clamp(20px, min(2.2cqw, 4.4cqh), 32px); line-height: 1.25; margin-top: 0.45em; }
.caos {
  /* o tamanho final vem do script: a largura do título, limitada pela altura livre */
  --cell: 1.16em;
  --line: rgba(237, 237, 234, 0.2);
  --paint: var(--tungsten);
  position: relative; display: block; flex: none;
  width: calc(var(--cols, 2) * var(--cell) + 1px); height: calc(var(--rows, 2) * var(--cell) + 1px);
  margin-top: 0.32em;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / var(--cell) 100%,
    linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% var(--cell);
  font-size: clamp(38px, min(7.2cqw, 13cqh), 96px);
  font-weight: 760; font-stretch: max(var(--wdth), 108%); line-height: 1;
  cursor: pointer; border-radius: 0;
}
.caos:focus-visible { outline-offset: 6px; }
/* cada letra é pintada da esquerda para a direita: uma cópia colorida se revela por cima da preta */
.caos-l {
  position: absolute; left: 0; top: 0; width: var(--cell); height: var(--cell);
  display: grid; place-items: center; padding-bottom: 0.1em;
  color: var(--ink);
  transform: translate(calc(var(--x, 0) * 100%), calc(var(--y, 0) * 100%)) rotate(var(--rot, 0deg));
  transition: transform 780ms var(--ease-io) var(--d, 0ms);
}
.caos-l::after {
  content: attr(data-ch);
  position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 0.1em;
  color: var(--paint);
  clip-path: inset(0 100% 0 0);
  transition: clip-path 300ms var(--ease-out) var(--pd, 0ms);
}
.caos-l.is-painted::after { clip-path: inset(0 0 0 0); transition-duration: 560ms; }
.caos.is-instant .caos-l, .caos.is-instant .caos-l::after { transition: none; }

.monitor-area { position: relative; min-height: 0; display: grid; place-items: center; }
/* o quadro é uma placa de vidro: deixa a malha passar borrada, tem um véu mais claro
   no alto e uma borda fina que pega a luz do lado em que o cursor está (--gx, --gy) */
.monitor {
  --gx: 18%; --gy: 0%;
  position: relative; width: 320px; height: 180px;
  border-radius: 10px;
  background:
    linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, 0.03) 30%, transparent 44%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.015) 42%, rgba(255, 255, 255, 0.005) 70%, rgba(255, 255, 255, 0.03) 100%);
  -webkit-backdrop-filter: blur(3.5px) saturate(150%) brightness(1.06);
  backdrop-filter: blur(3.5px) saturate(150%) brightness(1.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 30px 60px -28px rgba(0, 0, 0, 0.9);
  container-type: size;
  cursor: pointer;
}
.monitor::before, .monitor::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
}
/* o reflexo: uma mancha de luz suave sobre a placa */
.monitor::before {
  background: radial-gradient(70% 60% at var(--gx) var(--gy), rgba(255, 255, 255, 0.075), transparent 72%);
}
/* a borda: 1px de vidro, mais acesa perto da luz */
.monitor::after {
  padding: 1px;
  background: radial-gradient(90% 110% at var(--gx) var(--gy), rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.14) 55%, rgba(255, 255, 255, 0.08));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.monitor > span, .monitor > svg { position: absolute; display: block; }
.m-safe { inset: 7% 7%; border: 1px dashed rgba(237, 237, 234, 0.26); border-radius: 2px; }
.m-third { background: rgba(237, 237, 234, 0.08); }
.m-third--v1, .m-third--v2 { top: 0; bottom: 0; width: 1px; }
.m-third--v1 { left: 33.333%; } .m-third--v2 { left: 66.666%; }
.m-third--h1, .m-third--h2 { left: 0; right: 0; height: 1px; }
.m-third--h1 { top: 33.333%; } .m-third--h2 { top: 66.666%; }
.m-blob { overflow: visible; max-width: none; }
.m-blob path { fill: var(--ink); }
.m-blob-img { opacity: 0; transition: opacity 600ms var(--ease-out); }
.m-blob-img.is-ready { opacity: 1; }
.monitor > .m-shapes { left: 0; top: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.m-bar { height: 2.6cqmin; min-height: 2px; background: var(--ink); }
/* a janela da corrente: três linhas, medidas e escaladas pelo script; as palavras andam pelo relógio */
.m-words { left: 0; top: 0; font-size: 100px; transform-origin: 0 0; }
.m-w, .m-w-measure {
  font-weight: 820; font-stretch: 112%; line-height: 0.8; color: var(--ink);
  letter-spacing: -0.02em; white-space: nowrap;
}
.m-w { position: absolute; left: 0; top: 0; }
/* o verbo é a dobradiça da corrente: mais leve que os dois nomes */
.m-w--verb { font-weight: 440; letter-spacing: -0.01em; }
.m-w-measure { position: fixed; left: -9999px; top: 0; visibility: hidden; pointer-events: none; font-size: 100px; }
/* o subtítulo do quadro fecha a ideia do capítulo */
.monitor > .m-text {
  font-size: clamp(10px, 4.3cqmin, 19px); font-weight: 560; line-height: 1.18; color: var(--ink);
  letter-spacing: -0.005em; text-wrap: balance;
}
.m-ratio { left: 3.2%; top: 3.2%; z-index: 2; font-size: 13px; color: var(--ink); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
/* o canto que se arrasta: área de toque de 44px, desenho de um canto de recorte */
.monitor > .m-handle {
  right: -22px; bottom: -22px; width: 44px; height: 44px;
  cursor: nwse-resize; touch-action: none; border-radius: 50%;
}
.m-handle::before {
  content: ''; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transition: transform 300ms var(--ease-out);
}
.m-handle:hover::before, .is-resizing .m-handle::before { transform: translate(3px, 3px); }
.m-handle:focus-visible { outline: none; }
.m-handle:focus-visible::before { border-color: var(--tungsten); }

/* ---------- 4 · Trabalhos recentes: a abertura ----------
   Painel escuro, como a Interação e o Design. O arco só guia o olhar; quem leva
   aos vídeos é a pasta de vidro (desenho do Glassmorphism Folder Cards,
   de Kedhareswer Naidu, MIT). */

.frame--works {
  --ink: #f1f0ec; --ink-2: #aeada8; --ink-3: #8f8e89; --light: #070707;
  background: #070707 radial-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1.5px) 0 0 / 22px 22px;
}
.frame--works { padding: 6cqh 5cqw; }
/* o desenho não pega o ponteiro */
.onion { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.onion-svg { width: 100%; height: 100%; overflow: visible; }
.onion-path { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; stroke-dasharray: 2 6; }
/* a linha cheia se desenha atrás do ponto e mostra o caminho já andado */
.onion-run { fill: none; stroke: var(--ink); stroke-width: 1.6; opacity: 0.45; stroke-dasharray: 1000; }
.onion-ghosts circle { fill: none; stroke: var(--ink); stroke-width: 1; }
.onion-dot { fill: var(--ink); transition: opacity 300ms var(--ease-out); }
/* o ponto jogado pelo clique é de tungstênio, para se distinguir do que anda sozinho */
.onion-toss { fill: var(--tungsten); }
/* a cada queda um anel se abre na boca do bolso */
.onion-splash { fill: none; stroke: var(--tungsten); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }
.onion-splash.is-on { animation: onion-splash 900ms var(--ease-out) 1; }
@keyframes onion-splash { 0% { opacity: 0.9; transform: scale(0.2); } 100% { opacity: 0; transform: scale(2.4); } }
.frame--works.is-open .onion-dot, .frame--works.is-open .onion-ghosts { opacity: 0 !important; }
.works-copy { position: absolute; left: 5cqw; top: calc(var(--mt) + 3.5cqh); z-index: 2; max-width: 44cqw; pointer-events: none; }
.frame--works .chapter-title { font-size: clamp(34px, min(5.4cqw, 11cqh), 84px); }
.works-readout { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 1.1em; font-size: 13.5px; color: var(--ink-2); }
.readout-count { font-variant-numeric: tabular-nums; color: var(--tungsten); }
.readout-work { color: var(--ink); font-weight: 560; }
/* o nome troca subindo, a cada trabalho que sai da pasta */
.works-readout.is-flip span { animation: readout-in 520ms var(--ease-out) both; }
.works-readout.is-flip .readout-work { animation-delay: 70ms; }
@keyframes readout-in { from { opacity: 0; transform: translateY(0.6em); } to { opacity: 1; transform: none; } }
.readout-count, .readout-work { display: inline-block; }

/* ---- a pasta ---- */
.folders { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.gf {
  --s: 1;
  --gf-px: 0; --gf-py: 0;
  --gf-ease: cubic-bezier(.2, .8, .2, 1);
  --gf-spring: cubic-bezier(.34, 1.36, .5, 1);
  --gf-hinge: 0deg; --gf-lift: 42px; --gf-spread: 0px; --gf-fan: 0deg; --gf-stack: 15px;
  position: absolute; isolation: isolate; pointer-events: none;
  -webkit-tap-highlight-color: transparent;
}
.gf:hover, .gf:focus-within { --gf-hinge: -11deg; --gf-lift: -34px; --gf-spread: 8px; --gf-fan: 1.4deg; --gf-stack: 10px; }
.gf[data-open] { --gf-hinge: -24deg; --gf-lift: -96px; --gf-spread: 40px; --gf-fan: 5deg; --gf-stack: 30px; }
/* aberta, os arquivos se espalham em degraus, cada nome à mostra */
.gf[data-open] { --gf-spread: 22px; --gf-fan: 2.5deg; --gf-stack: 46px; }
/* fechada: a tampa entreaberta e os arquivos em cascata, cada um com a faixa do nome à mostra */
.gf:not([data-open]) { --gf-hinge: -8deg; --gf-lift: -10px; --gf-spread: 0px; --gf-fan: 0deg; --gf-stack: 32px; }
.gf:not([data-open]):hover, .gf:not([data-open]):focus-within { --gf-hinge: -13deg; --gf-lift: -16px; --gf-stack: 34px; }
.gf-stage { position: absolute; left: 0; top: 0; width: 340px; height: 272px; transform-origin: 0 0; }
.gf-tilt {
  position: absolute; inset: 0;
  transform: perspective(1400px) rotateX(calc(var(--gf-py) * -3deg)) rotateY(calc(var(--gf-px) * 4deg));
  transition: transform .9s var(--gf-ease);
}
.gf-shadow {
  position: absolute; left: 18px; right: 18px; bottom: -6px; height: 60px; border-radius: 40px;
  background: rgba(0, 0, 0, .62); filter: blur(22px);
  transform: translateX(calc(var(--gf-px) * -8px));
  transition: transform .9s var(--gf-ease), opacity .9s var(--gf-ease), background .6s var(--gf-ease);
}
.gf:hover .gf-shadow, .gf[data-open] .gf-shadow { background: rgba(255, 166, 77, .22); }
/* o fundo da pasta: grafite com a luz de tungstênio batendo num canto */
.gf-back {
  position: absolute; inset: 0; overflow: hidden; pointer-events: auto; cursor: pointer;
  background: linear-gradient(180deg, #2a2a2e 0%, #121214 100%);
}
.gf-art {
  position: absolute; inset: -12px;
  background:
    radial-gradient(58% 66% at var(--ax, 70%) var(--ay, 20%), rgba(255, 166, 77, .62), rgba(255, 166, 77, 0) 72%),
    radial-gradient(46% 56% at calc(100% - var(--ax, 70%)) 92%, rgba(241, 240, 236, .16), rgba(241, 240, 236, 0) 70%),
    linear-gradient(180deg, #2a2a2e 0%, #121214 100%);
  transform: translate(calc(var(--gf-px) * -7px), calc(var(--gf-py) * -6px)) scale(1.02);
  transition: transform 1.1s var(--gf-ease);
}
.gf-back-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .14) 0%, rgba(255, 255, 255, 0) 22%),
    radial-gradient(120% 80% at 80% 0%, rgba(255, 255, 255, .1), rgba(255, 255, 255, 0) 60%);
}
.gf-rim { position: absolute; left: 0; top: 0; max-width: none; overflow: visible; pointer-events: none; fill: none; }
.gf-back-rim { width: 340px; height: 272px; }
.gf-back-rim path { stroke: rgba(255, 255, 255, .16); stroke-width: 1; }

/* as folhas: nada pendura para fora do fundo do bolso */
.gf-files { position: absolute; inset: 0; z-index: 5; pointer-events: none; clip-path: inset(-400px -400px 10px -400px); }
.gf-sheet {
  all: unset; box-sizing: border-box;
  position: absolute; left: 34px; top: 96px; width: 272px; height: 184px;
  border-radius: 16px; overflow: hidden; pointer-events: none;
  background: linear-gradient(180deg, #2c2c30 0%, #1c1c1f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 .5px rgba(255, 255, 255, .08), 0 12px 28px -8px rgba(0, 0, 0, .7);
  transform-origin: 50% 100%;
  transform:
    translate(calc(var(--gf-jx) + var(--gf-slot) * var(--gf-spread)), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1))
    rotate(calc(var(--gf-jr) + var(--gf-slot) * var(--gf-fan)));
  transition:
    transform .75s var(--gf-spring) calc(var(--gf-depth) * 40ms),
    box-shadow .4s var(--gf-ease),
    translate .9s var(--gf-ease),
    opacity .9s var(--gf-ease),
    filter .5s var(--gf-ease);
}
.gf-sheet--art { background: #1a1a1d; }
/* a folha da vez sobe acima do vidro; aberta a pasta, cada folha é um link */
/* o arquivo da vez sobe um pouco na cascata: aparece mais, e como a ordem da pilha não
   muda, ele nunca passa na frente dos que estão à frente dele */
.gf-sheet.is-called { translate: 0 -24px; box-shadow: inset 0 0 0 1.5px var(--tungsten), 0 18px 34px -10px rgba(0, 0, 0, .8); }
/* os outros escurecem um pouco enquanto um está em destaque */
.gf-files.has-call .gf-sheet:not(.is-called) { filter: brightness(.6); }
.gf[data-open] button.gf-sheet { pointer-events: auto; cursor: pointer; }
.gf[data-open] .gf-sheet:hover, .gf[data-open] .gf-sheet:focus-visible {
  transform:
    translate(calc(var(--gf-jx) + var(--gf-slot) * var(--gf-spread)), calc(var(--gf-lift) + var(--gf-depth) * var(--gf-stack) * -1 - 18px))
    rotate(calc(var(--gf-slot) * var(--gf-fan) * .6));
  box-shadow: inset 0 0 0 1.5px var(--tungsten), 0 22px 40px -12px rgba(0, 0, 0, .8);
  transition-delay: 0s;
}
.gf-sheet:focus-visible { outline: none; }
.gf-sheet-art { position: absolute; left: 0; top: 0; width: 272px; height: 184px; max-width: none; object-fit: cover; }
.gf-sheet--art::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 38%), rgba(0, 0, 0, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}
/* sem pôster, a folha mostra o número do trabalho */
.gf-ph {
  position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 0 16px 6px;
  font-size: 92px; font-weight: 800; font-stretch: 118%; line-height: 1; letter-spacing: -0.04em;
  color: rgba(241, 240, 236, .09);
}
.gf-sheet-head {
  position: absolute; left: 14px; right: 14px; top: 11px; z-index: 1;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; white-space: nowrap;
}
.gf-sheet-name {
  overflow: hidden; text-overflow: ellipsis; color: #fafafa;
  font-size: calc(max(12.5px * var(--s), 11px) / var(--s)); font-weight: 560; letter-spacing: -.005em;
}
.gf-sheet-meta { flex: none; font-size: calc(max(10.5px * var(--s), 10px) / var(--s)); font-variant-numeric: tabular-nums; color: var(--tungsten); }
.gf-lines { position: absolute; left: 14px; right: 14px; top: 40px; display: flex; flex-direction: column; gap: 9px; }
.gf-lines i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .08); }
.gf-lines i:first-child { height: 9px; margin-bottom: 4px; background: rgba(255, 255, 255, .16); }

/* a frente de vidro */
.gf-front {
  position: absolute; left: 0; top: 74px; width: 340px; height: 198px; z-index: 10; border-radius: 22px;
  -webkit-backdrop-filter: blur(5px) saturate(1.35); backdrop-filter: blur(5px) saturate(1.35);
  transform-origin: 50% 100%;
  transform: perspective(760px) rotateX(var(--gf-hinge));
  transition: transform .8s var(--gf-spring), translate 1s var(--gf-ease), opacity 1s var(--gf-ease);
}
.gf-front--bump { animation: gf-bump .7s var(--gf-ease) both; }
@keyframes gf-bump {
  0% { scale: 1; }
  35% { scale: 1.018 .975; }
  70% { scale: .996 1.006; }
  100% { scale: 1; }
}
/* clara no alto (os arquivos aparecem) e mais escura embaixo, onde está o nome da pasta */
.gf-tint { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 18, 20, .05) 0%, rgba(14, 14, 16, .32) 46%, rgba(8, 8, 10, .84) 100%); }
.gf-spec {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: .16;
  background: radial-gradient(260px 200px at calc(50% + var(--gf-px) * 46%) calc(30% + var(--gf-py) * 40%), rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 70%);
}
.gf-front-rim { width: 340px; height: 198px; opacity: .55; transition: opacity .4s var(--gf-ease); }
.gf-front-rim path { stroke-width: 2.4; transition: stroke .4s var(--gf-ease), stroke-width .3s var(--gf-ease); }
.gf:hover .gf-front-rim, .gf:focus-within .gf-front-rim { opacity: .9; }
.gf:hover .gf-front-rim path, .gf-front:has(.gf-hit:focus-visible) .gf-front-rim path { stroke: var(--tungsten); }
.gf-front:has(.gf-hit:focus-visible) .gf-front-rim path { stroke-width: 5; }
.gf-hit { all: unset; position: absolute; inset: 0; z-index: 1; cursor: pointer; pointer-events: auto; }
.gf-label {
  position: absolute; z-index: 2; left: 28px; bottom: 30px; right: 28px;
  display: flex; flex-direction: column; gap: 5px; pointer-events: none; color: #f5f5f7;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .8);
}
.gf-title {
  font-size: calc(max(19px * var(--s), 13px) / var(--s)); font-weight: 600; line-height: 1.15; letter-spacing: -.012em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.gf-meta { font-size: calc(max(12px * var(--s), 10.5px) / var(--s)); letter-spacing: .03em; font-variant-numeric: tabular-nums; color: rgba(245, 245, 247, .58); }
.gf:hover .gf-meta { color: var(--tungsten); }


/* a entrada: a pasta se monta sozinha */
.gf:not([data-entered]) .gf-back, .gf:not([data-entered]) .gf-back-rim { translate: 0 22px; opacity: 0; }
.gf:not([data-entered]) .gf-sheet { translate: 0 -120px; opacity: 0; }
.gf:not([data-entered]) .gf-front { translate: 0 46px; opacity: 0; }
.gf:not([data-entered]) .gf-shadow { opacity: 0; }
.gf-back, .gf-back-rim { transition: translate 1s var(--gf-ease), opacity .9s var(--gf-ease); }
.gf[data-entered] .gf-sheet { transition-delay: calc(var(--gf-depth) * 40ms), 0s, calc(.18s + var(--gf-depth) * 90ms), calc(.18s + var(--gf-depth) * 90ms); }
.gf[data-entered] .gf-front { transition-delay: 0s, .42s, .42s; }
.gf[data-entered] .gf-sheet.is-called { transition-delay: 0s; }

/* ---------- 4 · Interação: a curva comanda o fundo ----------
   O editor tem o tamanho de antes; o quadro inteiro atrás dele é o fundo que a curva desenha. */

.frame--play { background: #070707; color: var(--room-text); }
.frame--play {
  display: grid;
  grid-template-columns: minmax(0, 28cqw) auto minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 2cqh 4cqw;
  padding: calc(var(--mt) + 3cqh) 5cqw calc(var(--mb) + 2cqh);
}
.play-bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.play-copy, .graph-wrap, .play-tools { position: relative; z-index: 1; }
.play-copy { grid-column: 1; grid-row: 1; align-self: start; }
.frame--play .chapter-title { color: #f4f3ef; }
.frame--play .chapter-line { color: var(--room-text); }
.graph-wrap {
  grid-column: 2; grid-row: 1; align-self: center;
  height: min(76cqh, 52cqw); aspect-ratio: 144 / 164;
  /* o gráfico inteiro segura o toque: mexer na curva nunca rola a página */
  touch-action: none; cursor: default;
}
/* a área de pegar de cada alça, do tamanho de um dedo */
.graph-grip {
  position: absolute; z-index: 2; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  border-radius: 50%; touch-action: none; cursor: grab;
}
.graph-grip:active { cursor: grabbing; }
/* o cursor-guia: a ponta fica na origem do elemento, que o script leva até a alça.
   Com mouse, uma seta de traço fino que deixa um ponto de tungstênio ao apertar; no toque,
   o marcador de dedo das gravações de tela (um disco translúcido com aro). */
.graph-hand {
  position: absolute; left: 0; top: 0; z-index: 3; width: 0; height: 0;
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.hand-arrow {
  position: absolute; left: -4px; top: -3.5px; width: 34px; height: 34px; max-width: none; overflow: visible;
  fill: #f6f5f1; stroke: #0b0b0a; stroke-width: 1.1; stroke-linejoin: round; paint-order: stroke;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.5));
  transition: transform 160ms var(--ease-out);
}
.graph-hand.is-down .hand-arrow { transform: translate(1px, 1px) scale(0.92); }
.hand-dot {
  display: none; position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%;
  background: rgba(246, 245, 241, 0.22); border: 1.5px solid rgba(246, 245, 241, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: background-color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.graph-hand.is-down .hand-dot { background: rgba(255, 166, 77, 0.38); border-color: var(--tungsten); }
@media (hover: none) {
  .hand-arrow { display: none; }
  .hand-dot { display: block; }
}
/* apertado: um ponto de tungstênio fica sob a ponta enquanto a alça é puxada */
.graph-press {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--tungsten); box-shadow: 0 0 12px rgba(255, 166, 77, 0.8);
  opacity: 0; transform: scale(0.4); transition: opacity 160ms var(--ease-out), transform 220ms var(--ease-out);
}
.graph-hand.is-down .graph-press { opacity: 1; transform: none; }
/* o clique: dois anéis finos saem da ponta, um logo depois do outro */
.graph-tap, .graph-tap::after {
  position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--tungsten); opacity: 0; transform: scale(0.3);
}
.graph-tap::after { content: ''; left: -1.5px; top: -1.5px; }
.graph-tap.is-on { animation: hand-tap 760ms var(--ease-out) 1; }
.graph-tap.is-on::after { animation: hand-tap 760ms var(--ease-out) 140ms 1; }
@keyframes hand-tap { 0% { opacity: 0.95; transform: scale(0.3); } 100% { opacity: 0; transform: scale(1.5); } }
.graph-hand.is-static { opacity: 1; }
.graph { width: 100%; height: 100%; overflow: visible; }
.graph-box { fill: rgba(7, 7, 7, 0.62); stroke: rgba(255, 255, 255, 0.3); stroke-width: 0.004; }
.graph-grid line { stroke: rgba(255, 255, 255, 0.1); stroke-width: 0.003; }
.graph-arm { stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.005; }
.graph-curve { fill: none; stroke: #fff; stroke-width: 0.014; stroke-linecap: round; }
.graph-rider { fill: var(--tungsten); }
.graph-ring { fill: none; stroke: #fff; stroke-width: 0.006; opacity: 0; pointer-events: none; }
.graph-handle { cursor: grab; outline: none; }
.graph-handle:active { cursor: grabbing; }
.graph-hit { fill: transparent; }
.graph-knob { fill: #070707; stroke: #fff; stroke-width: 0.008; }
.graph-handle:hover .graph-knob, .graph-handle.is-active .graph-knob { fill: #fff; }
.graph-handle:focus-visible .graph-knob { stroke: var(--tungsten); stroke-width: 0.014; }

.play-tools { grid-column: 3; grid-row: 1; align-self: start; justify-self: start; display: flex; flex-direction: column; gap: 1.6em; margin-top: 1.2em; }
/* as curvas prontas: quadrados pequenos, cada um com o desenho da própria curva (o nome fica no
   rótulo de acessibilidade e na dica do mouse). A escolhida ganha só um fundo laranja leve.
   Enquanto ninguém usou, um aro fino passa por eles em sequência (só opacidade). */
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.presets-label {
  flex: 0 0 100%; margin-bottom: 3px;
  font-size: 11px; font-weight: 640; letter-spacing: 0.1em; text-transform: uppercase; color: var(--room-dim);
}
.frame--play .presets button {
  position: relative; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.03);
  color: #e9e8e4; cursor: pointer;
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.preset-curve { width: 22px; height: 22px; max-width: none; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
@media (hover: hover) {
  .frame--play .presets button:hover { border-color: rgba(255, 255, 255, 0.45); }
}
.frame--play .presets button:active { transform: scale(0.95); }
.frame--play .presets button.is-on { background: rgba(255, 166, 77, 0.16); border-color: rgba(255, 166, 77, 0.4); }
.frame--play .presets button:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 3px; }
.frame--play .presets button::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  border: 1px solid rgba(255, 166, 77, 0.75); opacity: 0;
}
.presets.is-inviting button::after { animation: preset-call 4000ms ease-in-out 900ms infinite; }
.presets.is-inviting button:nth-of-type(2)::after { animation-delay: 1050ms; }
.presets.is-inviting button:nth-of-type(3)::after { animation-delay: 1200ms; }
.presets.is-inviting button:nth-of-type(4)::after { animation-delay: 1350ms; }
@keyframes preset-call { 0%, 6% { opacity: 0; } 14% { opacity: 1; } 30%, 100% { opacity: 0; } }
/* a bolinha: halo que cresce com a pressa, cópias do caminho atrás e as linhas até os eixos */
.graph-halo { fill: none; stroke: var(--tungsten); stroke-width: 0.006; opacity: 0; pointer-events: none; }
.rider-ghost { fill: none; stroke: var(--tungsten); stroke-width: 0.005; opacity: 0; pointer-events: none; }
.graph-guide { stroke: rgba(255, 166, 77, 0.5); stroke-width: 0.004; stroke-dasharray: 0.012 0.014; pointer-events: none; }
/* "experiência": em destaque no subtítulo, com a cor e o corpo comandados pela curva */
.exp { display: inline-block; font-weight: 720; color: var(--tungsten); transform-origin: 50% 85%; will-change: transform; }

/* COR: a palavra pinta com a cor que a curva dá (o script escreve a cor) */
.cor {
  font-weight: 820; font-stretch: max(var(--wdth), 108%); text-transform: uppercase;
  font-size: clamp(52px, min(8cqw, 15cqh), 150px); line-height: 0.8; letter-spacing: -0.02em;
  color: hsl(30, 88%, 62%);
}

/* ---------- Bilhetes à mão ----------
   Uma palavra em itálico e uma seta riscada que aponta onde mexer. A seta se
   desenha a cada chegada; feito o gesto, o bilhete se apaga um pouco. */

.note {
  position: absolute; z-index: 3; display: flex; align-items: flex-end; gap: 2px;
  color: var(--tungsten); pointer-events: none; white-space: nowrap;
  transition: opacity 600ms var(--ease-out);
}
.note-word {
  font-style: italic; font-weight: 560; font-stretch: 100%; line-height: 1;
  font-size: clamp(19px, min(1.9cqw, 3.4cqh), 27px); letter-spacing: 0.005em;
  transform: rotate(-6deg); transform-origin: 100% 100%;
}
.note-arrow { flex: none; width: clamp(44px, 4.4cqw, 62px); height: auto; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.note-arrow path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.note.is-in .note-arrow path { animation: note-draw 700ms var(--ease-out) both; }
.note.is-in .note-arrow path + path { animation-delay: 520ms; animation-duration: 260ms; }
@keyframes note-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.note.is-in .note-word { animation: note-word 700ms var(--ease-out) both; }
@keyframes note-word { from { opacity: 0; transform: rotate(-6deg) translateY(6px); } to { opacity: 1; transform: rotate(-6deg); } }
.note.is-done { opacity: 0.35; }
.note-arrow--d { display: none; }
/* bagunce: à esquerda da alça de cima (onde o cursor-guia clica), a seta aponta para ela */
.note--mess { right: 63%; bottom: 81%; margin-bottom: 0; }
.note--mess .note-arrow { margin-bottom: -14px; }
/* abrir: o script põe ao lado da pasta; clicar nele também abre */
button.note { all: unset; position: absolute; z-index: 3; display: flex; align-items: flex-end; gap: 2px; color: var(--tungsten); white-space: nowrap; cursor: pointer; pointer-events: auto; transition: opacity 600ms var(--ease-out); }
.note--open .note-arrow { margin-bottom: -16px; }
.note--open.is-portrait { flex-direction: column; align-items: flex-end; }
.note--open.is-portrait .note-arrow--r { display: none; }
.note--open.is-portrait .note-arrow--d { display: block; transform: scaleX(-1); margin: 4px 12px 0 0; }
.frame--works.is-open .note--open { opacity: 0; pointer-events: none; }

/* ---------- 5 · O rolo ---------- */

/* A janela é do tamanho do vídeo: o quadro é o próprio vídeo, sem margem em volta.
   O título fica numa linha acima dele. A proporção vem do arquivo (--ar, que o JS
   ajusta quando o vídeo carrega); enquanto isso vale 16:9. */
.reel {
  --ar: 1.7778;
  --cap: 34px;
  --ww: min(100cqw - 2 * var(--mx), (100cqh - var(--mt) - var(--mb) - var(--cap)) * var(--ar));
  --wh: calc(var(--ww) / var(--ar));
  --wl: calc((100cqw - var(--ww)) / 2);
  --wt: calc(var(--mt) + var(--cap) + (100cqh - var(--mt) - var(--mb) - var(--cap) - var(--wh)) / 2);
  container-type: size;
}
.reel-window {
  position: absolute; left: var(--wl); top: var(--wt); width: var(--ww); height: var(--wh);
  border-radius: var(--r); overflow: hidden;
  background: var(--reel);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.reel-label {
  position: absolute; left: var(--wl); top: calc(var(--wt) - var(--cap)); width: var(--ww); height: var(--cap);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13.5px; color: var(--room-dim);
}
.reel-label strong { font-weight: 500; color: var(--room-text); }
.reel-window .ph-cap { display: none; }
.reel-screen { position: absolute; inset: 0; }
.reel-screen .work-media { width: 100%; height: 100%; background: #0e0e0d; container-type: size; }
.work-ph { background: var(--leader); overflow: hidden; }
.ph-leader { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.ph-bg { fill: var(--leader); }
.ph-sweep { fill: var(--leader-deep); }
.ph-cross { stroke: #151514; stroke-width: 0.5; }
.ph-ring1 { fill: none; stroke: #f4f4f0; stroke-width: 2.2; }
.ph-ring2 { fill: none; stroke: #151514; stroke-width: 1.3; }
.ph-num {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -52%);
  font-weight: 800; font-stretch: 72%; line-height: 1; color: #121211; font-size: 56cqh;
}
.ph-cap {
  position: absolute; left: 0; right: 0; bottom: 8cqh; text-align: center;
  font-size: clamp(13px, 3.4cqh, 18px); font-weight: 600; color: var(--ink);
}
.work-ph-label {
  position: absolute; left: 2.4cqw; bottom: 2.6cqh; right: 2.4cqw;
  font-size: 11px; line-height: 1.3; color: rgba(17, 17, 16, 0.78); text-align: left;
}
.work-ph-label code { font-family: inherit; font-weight: 600; white-space: nowrap; }
@container (max-height: 300px) {
  .ph-cap { bottom: auto; top: 5cqh; }
  .ph-num { font-size: 46cqh; }
}

/* ---------- Créditos ---------- */

.frame--credits { display: grid; place-items: center; padding: calc(var(--mt) + 3cqh) 6cqw calc(var(--mb) + 3cqh); }
/* a grade do fechamento esmaece nas bordas do quadro, como luz sobre o escuro */
.frame--credits .kgrid {
  -webkit-mask-image: radial-gradient(ellipse 78% 82% at 50% 50%, #000 38%, rgba(0, 0, 0, 0.28) 100%);
  mask-image: radial-gradient(ellipse 78% 82% at 50% 50%, #000 38%, rgba(0, 0, 0, 0.28) 100%);
}
.credits { position: relative; z-index: 1; width: min(100%, 640px); display: flex; flex-direction: column; align-items: center; text-align: center; }
.credits-photo { width: clamp(84px, 16cqmin, 168px); aspect-ratio: 4 / 5; border-radius: 6px; overflow: hidden; background: #151513; margin-bottom: 4.5cqh; }
.credits-photo .img-slot { width: 100%; height: 100%; }
.credits-photo img { filter: grayscale(1) contrast(1.06); }
.credits-photo .img-slot.is-missing { display: grid; place-items: center; }
.credits-photo .img-slot.is-missing::after { content: 'SC'; font-weight: 800; font-stretch: 112%; color: #74736e; font-size: 22px; }
.credits-title { font-size: 13.5px; font-weight: 500; color: var(--room-dim); margin-bottom: 1.4em; }
.credits-list { width: 100%; display: grid; gap: 2px; }
.credits-list li { display: grid; grid-template-columns: 1fr 1fr; gap: 2ch; font-size: clamp(15px, 2.2cqh, 19px); }
.credits-list .c-label { text-align: right; color: var(--room-dim); }
.credits-list .c-value { text-align: left; color: var(--room-text); }
.credits-list a { display: contents; text-decoration: none; }
.credits-list a .c-value { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: rgba(214, 213, 208, 0.35); }
.credits-list a:hover .c-value { text-decoration-color: var(--tungsten); }
.credits-list li > a:focus-visible { outline: none; }
.credits-list li:focus-within { outline: 2px solid var(--tungsten); outline-offset: 4px; border-radius: 2px; }
.credits-list .is-draft { color: var(--room-dim); text-decoration: underline dashed 1px; text-underline-offset: 4px; text-decoration-color: rgba(143, 142, 137, 0.6); }
.credits-name {
  margin-top: 6cqh;
  font-weight: 800; font-stretch: max(var(--wdth), 108%); text-transform: uppercase;
  font-size: clamp(22px, min(4.6cqw, 7cqh), 54px); line-height: 0.9; color: var(--room-text);
}
.credits-roles { margin-top: 0.9em; font-size: 13.5px; color: var(--room-dim); }

/* ---------- HUD nas margens do quadro ---------- */

.hud {
  position: fixed; left: var(--mx); right: var(--mx); z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--room-text);
  opacity: 0; transition: opacity 700ms var(--ease-out);
}
.is-ready .hud { opacity: 1; }
.hud-top { top: 0; height: var(--mt); }
.hud-bottom { bottom: 0; height: var(--mb); gap: 20px; }
/* um véu escuro atrás das barras: o conteúdo passa por baixo delas sem brigar com o texto */
.hud::before {
  content: ''; position: absolute; left: calc(-1 * var(--mx)); right: calc(-1 * var(--mx)); z-index: -1; pointer-events: none;
}
.hud-top::before { top: 0; height: calc(var(--mt) + 24px); background: linear-gradient(to bottom, rgba(5, 5, 5, 0.7), rgba(5, 5, 5, 0)); }
.hud-bottom::before { bottom: 0; height: calc(var(--mb) + 30px); background: linear-gradient(to top, rgba(5, 5, 5, 0.78), rgba(5, 5, 5, 0)); }

.mark { height: 100%; padding: 0 4px; }
.mark-img { height: 18px; filter: brightness(0) invert(0.86); }
.mark-text { font-weight: 820; font-stretch: 112%; font-size: 14px; letter-spacing: 0.02em; }

.hud-actions { display: flex; align-items: center; gap: clamp(14px, 2vw, 26px); height: 100%; }
.hud-actions button { height: 100%; padding: 0 2px; color: var(--room-text); position: relative; }
.hud-actions button:hover { color: #fff; }
.motion-toggle[aria-pressed="false"] span { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--room-dim); }
[data-map-toggle][aria-pressed="true"] span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }

.index { display: flex; align-items: center; gap: clamp(12px, 1.8vw, 24px); height: 100%; min-width: 0; }
.index li { height: 100%; }
.index button {
  position: relative; height: 100%; display: flex; align-items: center; gap: 7px;
  color: var(--room-dim); padding: 0 1px;
}
/* cada capítulo tem a sua régua, que enche conforme a navegação passa por ele:
   vazia, ainda não chegou; cheia, já passou; pela metade, é onde a página está */
.index button { min-width: 28px; }
.index button::before {
  content: ''; position: absolute; left: 0; top: 10px; width: 100%; border-top: 1px solid rgba(214, 213, 208, 0.2);
}
.index button::after {
  content: ''; position: absolute; left: 0; top: 9.5px; height: 2px;
  width: calc(var(--pr, 0) * 100%); background: currentColor;
}
.index button.is-current { color: var(--room-text); }
.index button:hover { color: #fff; }
.index .i-num { font-weight: 700; font-stretch: 80%; }
.index .i-label { white-space: nowrap; }


@media (max-width: 1100px) { .index .i-label { display: none; } .index .i-label--short { display: inline; } }
@media (min-width: 1101px) { .index .i-label--short { display: none; } }
@media (max-width: 720px) {
  .hud { font-size: 13px; }
  .index { gap: 14px; }
}

/* ---------- Grão ---------- */

.grain {
  position: fixed; inset: -100%; z-index: 40; pointer-events: none;
  opacity: 0.06; background: url('../assets/grain.png') repeat; background-size: 180px 180px;
  animation: grain 900ms steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-3%, 2%); } 33% { transform: translate(2%, -4%); }
  50% { transform: translate(-4%, -1%); } 67% { transform: translate(3%, 3%); } 83% { transform: translate(-1%, 4%); } 100% { transform: translate(0, 0); }
}

/* ---------- Retrato (telefone) ---------- */

@container (max-aspect-ratio: 1/1) {
  .frame--design { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); padding: calc(var(--mt) + 3cqh) 6cqw calc(var(--mb) + 2cqh); gap: 3cqh; }
  .design-copy { align-self: start; margin-left: 0; }
  .formats { margin-top: 1.4em; }
  .chapter-title, .frame--design .chapter-title { font-size: clamp(40px, 13cqw, 96px); }
  .chapter-line { font-size: 18px; }
  .design-claim { font-size: 20px; }
  .chapter-caption { display: none; }

  .works-copy { left: 6cqw; right: 6cqw; top: calc(var(--mt) + 2.5cqh); max-width: none; }
  .frame--works .chapter-title { font-size: clamp(34px, 11cqw, 64px); }

  .frame--play { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); padding: calc(var(--mt) + 2.5cqh) 6cqw calc(var(--mb) + 1.5cqh); gap: 2.4cqh; }
  .play-copy { grid-row: 1; }
  .play-tools { grid-column: 1; grid-row: 2; align-self: start; gap: 0.4em; margin-top: 0; }
  .graph-wrap { grid-column: 1; grid-row: 3; justify-self: center; height: min(44cqh, 100cqw); }
  .play-tools { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 1em; }
  .cor { font-size: clamp(40px, 13cqw, 72px); }
  .frame--play .presets button { width: 36px; height: 36px; }
  .preset-curve { width: 20px; height: 20px; }
  .note--mess { right: 61%; bottom: 82%; flex-direction: column; align-items: flex-end; }
  .note--mess .note-arrow--r { display: none; }
  .note--mess .note-arrow--d { display: block; margin: 2px 0 -8px 0; }

  .work-ph-label span { display: block; }
  .lead { max-width: 26ch; }
}

@container (max-height: 420px) {
  .chapter-caption, .lead { display: none; }
  .chapter-title, .frame--design .chapter-title { font-size: clamp(30px, 11cqh, 60px); }
  .chapter-line { margin-top: 0.5em; font-size: 15px; }
  .design-claim { font-size: 16px; }
  .formats { margin-top: 0.8em; }
  .credits-photo { width: clamp(56px, 12cqh, 84px); margin-bottom: 2.4cqh; }
}

/* ---------- Movimento desligado ---------- */

.motion-off .grain { animation: none; }
.motion-off .cell.is-flip { animation: none; }
.motion-off .monitor, .motion-off .monitor > span, .motion-off .caos-l, .motion-off .caos-l::after { transition: none; }
.motion-off .is-titled .name-line .ch { transition: none; }
.motion-off .title-box.is-cue::after, .motion-off .title-box.is-call, .motion-off .title-box.is-back, .motion-off .title-tint , .motion-off .presets button::after , .motion-off .onion-splash, .motion-off .works-readout span  { animation: none; }
.motion-off .title-drop path, .motion-off .title-zone svg { animation: none !important; }
.motion-off .sign path { stroke-dashoffset: 0; transition: none; }
.motion-off .title-light { transition: none; }
.motion-off .gf, .motion-off .gf * { transition: none !important; animation: none !important; }
.motion-off .gf-tilt { transform: none; }
.motion-off .note-arrow path, .motion-off .note-word { animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
}

/* ---------- A rolagem ----------
   Uma página só, na rolagem do próprio navegador. Cada capítulo é uma cena
   presa na tela enquanto a rolagem a conta; a seguinte sobe por cima dela, e a
   de baixo recua para dentro da janela do projetor e escurece. Os vídeos passam
   de lado, um rolo inteiro, enquanto a página desce. */

html.js, html.js body { height: auto; overflow: visible; overscroll-behavior: auto; }
html:not(.motion-off) { scroll-behavior: smooth; }
body { overflow-x: clip; }

/* a barra de rolagem também é da sala */
html { scrollbar-width: thin; scrollbar-color: #3a3a37 var(--room); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--room); }
::-webkit-scrollbar-thumb { background: #3a3a37; border: 3px solid var(--room); border-radius: 6px; }

/* ---------- Cenas ----------
   A altura da cena (--len telas) é quanto de rolagem ela ganha. A seguinte começa
   uma tela antes do fim dela, e é nessa tela que uma cobre a outra. */

.film { position: relative; }
.scene { position: relative; height: calc(var(--len, 1) * 100lvh); }
.scene + .scene { margin-top: -100lvh; }
.stage {
  position: sticky; top: 0; height: 100lvh; overflow: hidden;
  container-type: size;
  background: var(--room);
  transform-origin: 50% 42%;
}
/* a cena que recua escurece por inteiro (--dim vem do script) */
.stage::after {
  content: ''; position: absolute; inset: 0; z-index: 20; pointer-events: none;
  background: #000; opacity: var(--dim, 0);
}
/* a que chega traz a borda do quadro e uma sombra sobre a de baixo */
/* enquanto a cena está recortada (chegando ou sendo coberta), o vidro da pasta perde o
   desfoque: sem ele o recorte da silhueta volta a valer e nada vaza para fora da pasta */
.stage.is-cut .gf-front { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(13, 13, 15, 0.46); }
.stage.is-arriving { box-shadow: 0 -28px 60px -24px rgba(0, 0, 0, 0.9), 0 -1px 0 rgba(255, 255, 255, 0.08); }

/* ---------- O rolo de vídeos ---------- */

/* no toque o gesto de lado é dos vídeos (o script arrasta a fita); o vertical rola a página */
.scene--reels .stage { background: #070707; touch-action: pan-y; }
.strip {
  --gap: 4cqw;
  --iw: min(76cqw, (100cqh - var(--mt) - var(--mb) - 34px - 7cqh) * 1.7778);
  position: absolute; left: 0; top: 0; height: 100%;
  display: flex; gap: var(--gap);
  padding: 0 calc((100cqw - var(--iw)) / 2);
  will-change: transform;
}
.strip .reel { --mx: 0px; position: relative; flex: none; width: var(--iw); height: 100cqh; transform-origin: 50% 50%; }
.strip .reel-label { transition: color 300ms var(--ease-out); }
/* só o vídeo do meio fala: os vizinhos ficam de lado, apagados */
.strip .reel:not(.is-on) .reel-label strong { color: var(--room-dim); }

@container (max-aspect-ratio: 1/1) {
  .strip { --gap: 5cqw; --iw: 86cqw; }
}

/* ---------- Movimento desligado: as cenas se cobrem sem recuar ---------- */

.motion-off .stage { transform: none !important; border-radius: 0 !important; }

/* ---------- Entrada ----------
   O letreiro chega num empurrão lento de câmera, com as letras se revelando uma a
   uma; o resto da página só aparece quando o nome assenta no alto. */

@keyframes v1-open { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
.is-opening .film > .scene:first-child > .stage > .frame {
  animation: v1-open 1100ms cubic-bezier(0.16, 1, 0.3, 1) both; transform-origin: 50% 46%;
}
/* enquanto o letreiro está na tela cheia, nada mais aparece */
.is-opening .hud, .is-opening .title-hint { opacity: 0; }
.motion-off .stage::after { opacity: 0; }

/* ---------- Sem script: as cenas descem uma depois da outra ---------- */

html.no-js .scene { height: auto; margin-top: 0; }
html.no-js .stage { position: relative; height: 100lvh; }
html.no-js .hud-bottom, html.no-js .scene--reels { display: none; }
